From cf536ea3c7eefb26082836eb7f930b293dd38345 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Tue, 27 Apr 2021 12:21:58 +0800 Subject: net: dsa: no longer identify PTP packet in core driver Move ptp_classify_raw out of dsa core driver for handling tx timestamp request. Let device drivers do this if they want. Not all drivers want to limit tx timestamping for only PTP packet. Signed-off-by: Yangbo Lu Tested-by: Kurt Kanzenbach Acked-by: Richard Cochran Signed-off-by: David S. Miller --- net/dsa/slave.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'net') diff --git a/net/dsa/slave.c b/net/dsa/slave.c index b2a802e9330e..acaa52e60d7f 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -20,7 +20,6 @@ #include #include #include -#include #include "dsa_priv.h" @@ -557,15 +556,10 @@ static void dsa_skb_tx_timestamp(struct dsa_slave_priv *p, { struct dsa_switch *ds = p->dp->ds; 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; - if (!ds->ops->port_txtstamp) return; @@ -573,7 +567,7 @@ static void dsa_skb_tx_timestamp(struct dsa_slave_priv *p, if (!clone) return; - if (ds->ops->port_txtstamp(ds, p->dp->index, clone, type)) { + if (ds->ops->port_txtstamp(ds, p->dp->index, clone)) { DSA_SKB_CB(skb)->clone = clone; return; } @@ -632,9 +626,7 @@ static netdev_tx_t dsa_slave_xmit(struct sk_buff *skb, struct net_device *dev) DSA_SKB_CB(skb)->clone = NULL; - /* Identify PTP protocol packets, clone them, and pass them to the - * switch driver - */ + /* Handle tx timestamp if any */ dsa_skb_tx_timestamp(p, skb); if (dsa_realloc_skb(skb, dev)) { -- cgit v1.2.3