[PATCH] net dsa: add TX timestamping support
flat view
STALE5115d
From: Rodolfo Giometti <hidden>
Date: 2012-10-15 13:54:46
Subsystem:
networking [dsa], networking [general], the rest · Maintainers:
Andrew Lunn, Vladimir Oltean, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds
Signed-off-by: Rodolfo Giometti <redacted> --- net/dsa/tag_dsa.c | 8 ++++++++ net/dsa/tag_edsa.c | 8 ++++++++ net/dsa/tag_trailer.c | 8 ++++++++ 3 files changed, 24 insertions(+)
diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c
index cacce1e..20c2959 100644
--- a/net/dsa/tag_dsa.c
+++ b/net/dsa/tag_dsa.c@@ -24,6 +24,14 @@ netdev_tx_t dsa_xmit(struct sk_buff *skb, struct net_device *dev) dev->stats.tx_packets++; dev->stats.tx_bytes += skb->len; + /* We should call skb_tx_timestamp() at bottom of this function, + * just before dev_queue_xmit(), but the skb is going to be + * modified by DSA stack so it is going to be NOT recognized + * by the ptp_filter called into function skb_clone_tx_timestamp() + * [see file linux/net/core/timestamping.c]. + */ + skb_tx_timestamp(skb); + /* * Convert the outermost 802.1q tag to a DSA tag for tagged * packets, or insert a DSA tag between the addresses and
diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c
index e70c43c..9138bda 100644
--- a/net/dsa/tag_edsa.c
+++ b/net/dsa/tag_edsa.c@@ -25,6 +25,14 @@ netdev_tx_t edsa_xmit(struct sk_buff *skb, struct net_device *dev) dev->stats.tx_packets++; dev->stats.tx_bytes += skb->len; + /* We should call skb_tx_timestamp() at bottom of this function, + * just before dev_queue_xmit(), but the skb is going to be + * modified by DSA stack so it is going to be NOT recognized + * by the ptp_filter called into function skb_clone_tx_timestamp() + * [see file linux/net/core/timestamping.c]. + */ + skb_tx_timestamp(skb); + /* * Convert the outermost 802.1q tag to a DSA tag and prepend * a DSA ethertype field is the packet is tagged, or insert
diff --git a/net/dsa/tag_trailer.c b/net/dsa/tag_trailer.c
index 94bc260..b92cad2 100644
--- a/net/dsa/tag_trailer.c
+++ b/net/dsa/tag_trailer.c@@ -24,6 +24,14 @@ netdev_tx_t trailer_xmit(struct sk_buff *skb, struct net_device *dev) dev->stats.tx_packets++; dev->stats.tx_bytes += skb->len; + /* We should call skb_tx_timestamp() at bottom of this function, + * just before dev_queue_xmit(), but the skb is going to be + * modified by DSA stack so it is going to be NOT recognized + * by the ptp_filter called into function skb_clone_tx_timestamp() + * [see file linux/net/core/timestamping.c]. + */ + skb_tx_timestamp(skb); + /* * We have to make sure that the trailer ends up as the very * last 4 bytes of the packet. This means that we have to pad
--
1.7.9.5