From: "Scott J. Goldman" <redacted>
Date: Thu, 16 Jun 2011 15:02:27 -0700
if the rx ring is completely empty, then the device may never fire an rx
interrupt. unfortunately, the rx interrupt is what triggers populating
the rx ring with fresh buffers, so this will cause networking to lock
up.
this patch recycles the last skb that we were about to indicate up to
the network stack (only if the rx ring is completely starved of skbs)
so the ring will never be completely empty. If we fail to allocate a
secondary page buffer, we just indicate a 0 length buffer to the device.
Signed-off-by: Scott J. Goldman <redacted>
This is why other drivers allocate the replacement skb _first_ before
handing the current receive packet to the stack.
And if the replacement allocation fails, they elide passing the packet
to the stack, and instead recycle it back onto the RX ring.
Please implement your RX policy in this manner, as we advise all Linux
networking drivers to, and you simply won't have this problem.