[PATCH] netxen: fix race in skb->len access

Subsystems: networking drivers, the rest

STALE5520d

2 messages, 2 authors, 2011-06-20 · open the first message on its own page

[PATCH] netxen: fix race in skb->len access

From: Eric Dumazet <hidden>
Date: 2011-06-20 06:33:35

As soon as skb is given to hardware, TX completion can free skb under
us.
Therefore, we should update dev stats before kicking the device.

Signed-off-by: Eric Dumazet <redacted>
CC: Amit Kumar Salecha <redacted>
---
 drivers/net/netxen/netxen_nic_main.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index b644383..c0788a3 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -1965,11 +1965,11 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 
 	netxen_tso_check(netdev, tx_ring, first_desc, skb);
 
-	netxen_nic_update_cmd_producer(adapter, tx_ring);
-
 	adapter->stats.txbytes += skb->len;
 	adapter->stats.xmitcalled++;
 
+	netxen_nic_update_cmd_producer(adapter, tx_ring);
+
 	return NETDEV_TX_OK;
 
 drop_packet:

Re: [PATCH] netxen: fix race in skb->len access

From: David Miller <davem@davemloft.net>
Date: 2011-06-20 20:06:15

From: Eric Dumazet <redacted>
Date: Mon, 20 Jun 2011 08:26:15 +0200
As soon as skb is given to hardware, TX completion can free skb under
us.
Therefore, we should update dev stats before kicking the device.

Signed-off-by: Eric Dumazet <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help