netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* e1000_xmit_frame and e1000_down racing  with next_to_use?
@ 2006-09-06 17:58 shaw
  2006-09-06 18:13 ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: shaw @ 2006-09-06 17:58 UTC (permalink / raw)
  To: netdev

Hello All,

I have a question about the use of the tx_ring->next_to_use variable in
the e1000.  Specifically, I'm wondering about a race between the use of
next_to_use in e1000_xmit_frame and the clearing of next_to_use in
e1000_down via e1000_clean_tx_ring.

Thread 1 (_xmit) ->  first = adapter->tx_ring.next_to_use;
                     e1000_tx_map();
Thread 2 (_down) ->  e1000_clean_tx_ring();
                     tx_ring->next_to_use = 0;
Thread 1 (_xmit) -> e1000_tx_queue();

It seems that tx_ring.next_to_use could change between the time the skbuff
is mapped in e1000_tx_map and the time it is reported to the hardware in
e1000_tx_queue.  While I don't see any memory leaks or possible oops, it
does seem possible that that an skbuff could be "lost" in the ring as it
will not be queued in the subsequent e1000_queue.

If the race is possible, perhaps this could be the culprit behind the tx
timeouts we've seen reported in this list?  The watchdog will eventually
find the "lost" skbuff and mistakenly think that the hardware transmit has
hung and stop the queue.

Could one of you plese tell me how this race is avoided, if indeed it is?

Thanks,
Shaw


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

end of thread, other threads:[~2006-09-08 15:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-06 17:58 e1000_xmit_frame and e1000_down racing with next_to_use? shaw
2006-09-06 18:13 ` Stephen Hemminger
2006-09-07  0:18   ` Shaw Vrana
2006-09-08 15:51     ` Auke Kok

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).