> - The driver would crash the machine if all dev_alloc_skb()'s failed
> during open(). So I simply fail the open() if we can't preallocate all
> the skb's.
Ok
> - The problem reported by Mark Hemment where the rx path would die if 32
> successive dev_alloc_skb()'s failed has been semi-kludgily fixed by
> detecting this situation in the tx interrupt and deliberately calling
> the rx ISR. This means that in cruel OOM situations we're relying on Tx
> interrupts to initiate polling for available memory. This can take some
> time if TCP has backed off a long way, but it recovers eventually.
This is a mess in a lot of Don Becker skeleton base drivers. Its much cleaner
if the last ring buffer slot is about to be used and the new alloc fails to
simply recycle the buffer and throw the received packet away.
Several drivers simply require the ring remains full and they are a lot cleaner
for it.
Will apply
|