summaryrefslogtreecommitdiffstats
path: root/net/dsa/slave.c
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2021-04-27 06:21:58 +0200
committerDavid S. Miller <davem@davemloft.net>2021-04-27 23:10:15 +0200
commitcf536ea3c7eefb26082836eb7f930b293dd38345 (patch)
tree6490772a48679661cafbb8084661d456a8a1219b /net/dsa/slave.c
parentnet: dsa: check tx timestamp request in core driver (diff)
downloadlinux-cf536ea3c7eefb26082836eb7f930b293dd38345.tar.xz
linux-cf536ea3c7eefb26082836eb7f930b293dd38345.zip
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 <yangbo.lu@nxp.com> Tested-by: Kurt Kanzenbach <kurt@linutronix.de> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r--net/dsa/slave.c12
1 files changed, 2 insertions, 10 deletions
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 <linux/if_bridge.h>
#include <linux/if_hsr.h>
#include <linux/netpoll.h>
-#include <linux/ptp_classify.h>
#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)) {