Skip to contentSkip to conversation

another transmit timestamping driver set

PATCH Applied Willem de Bruijn 4 participants 14 messages Apr 27, 2012 – May 1, 2012

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover another transmit timestamping driver set

This series adds skb_tx_timestamp calls into the ndo_start_xmit implementations of a few more drivers. All calls are added before increasing the txqueue write offset, to avoid the race conditions with the completion handler experienced earlier.

All changes have been tested with the txtimestamp test at
http://kernel.googlecode.com/files/txtimestamp.c before and after applying the change (to a slightly different kernel, though) to verify that it actually adds the missing functionality and introduces no obvious bugs.

Apologies if I missed any driver maintainers.

Signed-off-by Willem de Bruijn <[email protected]>

#1 lore raw

PATCH 1/4 e1000: add transmit timestamping support

---
 drivers/net/ethernet/intel/e1000/e1000_main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +2 -0
index 3d712f2..40438ea 100644
@@ -3261,6 +3261,8 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 	                     nr_frags, mss);
 
 	if (count) {
+		skb_tx_timestamp(skb);
+
 		e1000_tx_queue(adapter, tx_ring, tx_flags, count);
 		/* Make sure there is space in the ring for the next send. */
 		e1000_maybe_stop_tx(netdev, tx_ring, MAX_SKB_FRAGS + 2);
Signature · 1 line
1.7.7.3
Acked-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] e1000: add transmit timestamping support

Quoted 10 lines · Willem de Bruijn
---
 drivers/net/ethernet/intel/e1000/e1000_main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +0 -0
index 3d712f2..40438ea 100644

drivers/net/ethernet/intel/e1000/e1000_main.c static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, · line 3268

Quoted 8 lines
drivers/net/ethernet/intel/e1000/e1000_main.c +2 -0
@@ -3261,6 +3261,8 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 	                     nr_frags, mss);
 
 	if (count) {
+		skb_tx_timestamp(skb);
+
 		e1000_tx_queue(adapter, tx_ring, tx_flags, count);
 		/* Make sure there is space in the ring for the next send. */
 		e1000_maybe_stop_tx(netdev, tx_ring, MAX_SKB_FRAGS + 2);
#4 lore raw

PATCH 2/4 e1000e: add transmit timestamping support

In reply to Willem de Bruijn
---
 drivers/net/ethernet/intel/e1000e/netdev.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/ethernet/intel/e1000e/netdev.c +2 -0
index 851f793..c5d9ad7 100644
@@ -5150,6 +5150,8 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 	/* if count is 0 then mapping error has occurred */
 	count = e1000_tx_map(tx_ring, skb, first, max_per_txd, nr_frags, mss);
 	if (count) {
+		skb_tx_timestamp(skb);
+
 		netdev_sent_queue(netdev, skb->len);
 		e1000_tx_queue(tx_ring, tx_flags, count);
 		/* Make sure there is space in the ring for the next send. */
Signature · 1 line
1.7.7.3
Acked-by on v1 2/4
#5 lore raw

Re: [PATCH 2/4] e1000e: add transmit timestamping support

Quoted 10 lines · Willem de Bruijn
---
 drivers/net/ethernet/intel/e1000e/netdev.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/ethernet/intel/e1000e/netdev.c +0 -0
index 851f793..c5d9ad7 100644

drivers/net/ethernet/intel/e1000e/netdev.c static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, · line 5157

Quoted 8 lines
drivers/net/ethernet/intel/e1000e/netdev.c +2 -0
@@ -5150,6 +5150,8 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 	/* if count is 0 then mapping error has occurred */
 	count = e1000_tx_map(tx_ring, skb, first, max_per_txd, nr_frags, mss);
 	if (count) {
+		skb_tx_timestamp(skb);
+
 		netdev_sent_queue(netdev, skb->len);
 		e1000_tx_queue(tx_ring, tx_flags, count);
 		/* Make sure there is space in the ring for the next send. */
#7 lore raw

PATCH 3/4 bnx2x: add transmit timestamping support

In reply to Willem de Bruijn
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +2 -0
index 60d5b54..afa6cbb 100644
@@ -2953,6 +2953,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	netdev_tx_sent_queue(txq, skb->len);
 
+	skb_tx_timestamp(skb);
+
 	txdata->tx_pkt_prod++;
 	/*
 	 * Make sure that the BD data is updated before updating the producer
Signature · 1 line
1.7.7.3
Acked-by on v1 3/4
#9 lore raw

Re: [PATCH 3/4] bnx2x: add transmit timestamping support

In reply to Willem de Bruijn
Quoted 10 lines · Willem de Bruijn
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +0 -0
index 60d5b54..afa6cbb 100644

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · line 2960

Quoted 8 lines
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +2 -0
@@ -2953,6 +2953,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	netdev_tx_sent_queue(txq, skb->len);
 
+	skb_tx_timestamp(skb);
+
 	txdata->tx_pkt_prod++;
 	/*
 	 * Make sure that the BD data is updated before updating the producer
#11 lore raw

PATCH 4/4 forcedeth: add transmit timestamping support

In reply to Willem de Bruijn

Insert an skb_tx_timestamp call in both ndo_start_xmit routines Tested to work for the nv_start_xmit_optimized case

---
 drivers/net/ethernet/nvidia/forcedeth.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/ethernet/nvidia/forcedeth.c +4 -0
index d93a088..928913c 100644
@@ -2279,6 +2279,8 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	netdev_sent_queue(np->dev, skb->len);
 
+	skb_tx_timestamp(skb);
+
 	np->put_tx.orig = put_tx;
 
 	spin_unlock_irqrestore(&np->lock, flags);
@@ -2426,6 +2428,8 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
 
 	netdev_sent_queue(np->dev, skb->len);
 
+	skb_tx_timestamp(skb);
+
 	np->put_tx.ex = put_tx;
 
 	spin_unlock_irqrestore(&np->lock, flags);
Signature · 1 line
1.7.7.3
Acked-by on v1 4/4
#12 lore raw

Re: [PATCH 4/4] forcedeth: add transmit timestamping support

Quoted 22 lines · Willem de Bruijn

Insert an skb_tx_timestamp call in both ndo_start_xmit routines Tested to work for the nv_start_xmit_optimized case

---
 drivers/net/ethernet/nvidia/forcedeth.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/ethernet/nvidia/forcedeth.c +2 -0
index d93a088..928913c 100644
@@ -2279,6 +2279,8 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	netdev_sent_queue(np->dev, skb->len);
 
+	skb_tx_timestamp(skb);
+
 	np->put_tx.orig = put_tx;
 
 	spin_unlock_irqrestore(&np->lock, flags);

drivers/net/ethernet/nvidia/forcedeth.c static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb, · line 2435

Quoted 8 lines
drivers/net/ethernet/nvidia/forcedeth.c +2 -0
@@ -2426,6 +2428,8 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
 
 	netdev_sent_queue(np->dev, skb->len);
 
+	skb_tx_timestamp(skb);
+
 	np->put_tx.ex = put_tx;
 
 	spin_unlock_irqrestore(&np->lock, flags);