netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netxen: fix race in skb->len access
@ 2011-06-20  6:26 Eric Dumazet
  2011-06-20 20:05 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2011-06-20  6:26 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Amit Kumar Salecha

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 <eric.dumazet@gmail.com>
CC: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 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:



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] netxen: fix race in skb->len access
  2011-06-20  6:26 [PATCH] netxen: fix race in skb->len access Eric Dumazet
@ 2011-06-20 20:05 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-06-20 20:05 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, amit.salecha

From: Eric Dumazet <eric.dumazet@gmail.com>
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 <eric.dumazet@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-20 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-20  6:26 [PATCH] netxen: fix race in skb->len access Eric Dumazet
2011-06-20 20:05 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).