ixgbe & if_igb RX ring locking

Alexander V. Chernikov melifaro at FreeBSD.org
Wed Oct 31 13:10:33 UTC 2012


On 22.10.2012 05:43, Ryan Stone wrote:
> On Sun, Oct 21, 2012 at 2:21 PM, Alexander V. Chernikov
> <melifaro at freebsd.org> wrote:
>>> ix:rx ->  udp is also fairly obvious (here's one backtrace):
>> The same question, where "udp" -> "ix:rx" can happen ?
>
> It can't happen directly as far as I can tell.  But to trigger a
> deadlock, "all" that has to happen is that a thread holds each mutex
> in the cycle while trying to acquire the next mutex in the cycle.  I
Sorry, which mutex ? What cycle?

> realize that in this case that requires five separate threads to all
5?
> lose a race simultaneously, but it's still theoretically possible and
> needs to be avoided.
Can you please be more explicit?

Once again, initial point of discussion was: do we _really_ need to 
unlock rx ring before calling if_input?

It has been said that there are some complicated cases, where something 
bad can happen so we still need to call unlock.

That's OK and we probably should try to fix such cases generally in 
networking stack if we can (maybe by saying explicitly that, say, ioctl 
calls are forbidden in ithreads).

However, it is still unclear (at least to me) how both LORs can really 
happen in current code (especially given modified ixgbe driver in your 
traces).



> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>


-- 
WBR, Alexander




More information about the freebsd-net mailing list