Subject: Re: [PATCH] Deadlock in af_packet/packet_rcv

From: Tommy Christensen <[email-masked]>
Date: Tue, 30 Nov 2004 10:32:31 +0100

Olaf Kirch wrote:
> Before introduction of lock-less loopback, all of netdev_xmit_nit was
> running with bottom halves disabled, and some code seems to rely on
> this. One of them is af_packet's packet_rcv handler, which is called
> from the receive path via netdev_xmit_nit.  It takes a spin lock,
> and if an interrupt occurs and calls netdev_xmit during this time,
> the CPU deadlocks.

An interrupt handler shouldn't call dev_queue_xmit() directly. If
this indeed happens, it needs to be fixed. Which handler is this?

> The patch below disables BHs while in the TX path for loopback and
> similar devices.

dev_queue_xmit() already have BHs disabled, so this won't do anything.
And weren't you talking about interrupts ??

Protocol handlers are called with bottom halves disabled, but IRQs
are enabled. This hasn't changed - and is assumed in lots of places.

-Tommy