[ofa-general] Re: [PATCH] IPoIB: Remove redundant check in xmit handler

Krishna Kumar2 krkumar2 at in.ibm.com
Mon Nov 19 21:27:31 PST 2007


Hi Roland,

Roland Dreier <rdreier at cisco.com> wrote on 11/20/2007 09:55:00 AM:

>  > qdisc_run() first checks netif_queue_stopped(dev), and then if
>  > it can get the __LINK_STATE_QDISC_RUNNING bit, it calls
>  > __qdisc_run() which will do the actual xmit. Subsequent calls
>  > to xmit within __qdisc_run checks for netif_queue_stopped.
>  >
>  > So there is no way that xmit can be called with a stopped queue
>  > as the core does it for every skb. And no other cpu can execute
>  > this at the same time as the RUNNING bit is held. So this is a
>  > completely safe removal of check for every skb.
>
> Hmm, I don't see any changes that prevent the race I originally
> described in http://oss.sgi.com/archives/netdev/2004-12/msg00474.html
> Maybe your test may just not be able to hit the race, or am I missing
> something?

(Thanks for the link, I hadn't seen this earlier)

That race will not happen as CPU#2 cannot call qdisc_restart when CPU#1
is holding the RUNNING bit. In this case, CPU#2 simply queue's the skb
to dev->q and returns, while CPU#1 finds this new skb in it's iteration
of __qdisc_run (and ends up processing all queue'd skb after checking for
stopped queue).

> Anyway medium-term I want to move IPoIB away from LLTX so this doesn't
> matter that much.

Are you planning for 2.6.25?

Thanks,

- KK




More information about the general mailing list