diff options
author | Yangbo Lu <yangbo.lu@nxp.com> | 2021-04-27 07:21:57 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-28 00:10:15 +0300 |
commit | cfd12c06cdceac094aab3f097cce24c279bfd43b (patch) | |
tree | 208aa03e7a98c8b605e95011e976d8a5a5607aa3 /net/dsa | |
parent | 23c9c2b314bab7f7f807a2f0cfe06cc4451b6eb7 (diff) | |
download | linux-cfd12c06cdceac094aab3f097cce24c279bfd43b.tar.xz |
net: dsa: check tx timestamp request in core driver
Check tx timestamp request in core driver at very beginning of
dsa_skb_tx_timestamp(), so that most skbs not requiring tx
timestamp just return. And drop such checking in device drivers.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Tested-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/slave.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 77b33bd161b8..b2a802e9330e 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -559,6 +559,9 @@ static void dsa_skb_tx_timestamp(struct dsa_slave_priv *p, struct sk_buff *clone; unsigned int type; + if (!(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) + return; + type = ptp_classify_raw(skb); if (type == PTP_CLASS_NONE) return; |