summaryrefslogtreecommitdiff
path: root/net/core/timestamping.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-07-15 07:13:00 -0700
committerJakub Kicinski <kuba@kernel.org>2024-07-15 08:02:30 -0700
commit30b3560050486275c6207c8c90c0d53a7cc73ac1 (patch)
treeba82e7543efefbd0cdfc4627f9fecc4df20b2da2 /net/core/timestamping.c
parent9283477e28913c1e7625c0a8d6959745e2431533 (diff)
parent2111375b85ad173d58e7b8604246a3de60950ac8 (diff)
Merge branch 'net-make-timestamping-selectable'
First part of "net: Make timestamping selectable" from Kory Maincent. Change the driver-facing type already to lower rebasing pain. Link: https://lore.kernel.org/20240709-feature_ptp_netnext-v17-0-b5317f50df2a@bootlin.com/ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/timestamping.c')
-rw-r--r--net/core/timestamping.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/core/timestamping.c b/net/core/timestamping.c
index 04840697fe79..3717fb152ecc 100644
--- a/net/core/timestamping.c
+++ b/net/core/timestamping.c
@@ -25,7 +25,8 @@ void skb_clone_tx_timestamp(struct sk_buff *skb)
struct sk_buff *clone;
unsigned int type;
- if (!skb->sk)
+ if (!skb->sk || !skb->dev ||
+ !phy_is_default_hwtstamp(skb->dev->phydev))
return;
type = classify(skb);
@@ -47,7 +48,7 @@ bool skb_defer_rx_timestamp(struct sk_buff *skb)
struct mii_timestamper *mii_ts;
unsigned int type;
- if (!skb->dev || !skb->dev->phydev || !skb->dev->phydev->mii_ts)
+ if (!skb->dev || !phy_is_default_hwtstamp(skb->dev->phydev))
return false;
if (skb_headroom(skb) < ETH_HLEN)