lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1350308008-17189-3-git-send-email-giometti@linux.it>
Date:	Mon, 15 Oct 2012 15:33:27 +0200
From:	Rodolfo Giometti <giometti@...ux.it>
To:	netdev@...r.kernel.org
Cc:	Lennert Buytenhek <buytenh@...tstofly.org>,
	Rodolfo Giometti <giometti@...ux.it>
Subject: [PATCH] net dsa: add TX timestamping support

Signed-off-by: Rodolfo Giometti <giometti@...ux.it>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ