]> git.baikalelectronics.ru Git - kernel.git/commit
gianfar: fix BUG under load after introduction of skb recycling
authorLennert Buytenhek <buytenh@wantstofly.org>
Mon, 25 May 2009 07:42:34 +0000 (00:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 May 2009 07:42:34 +0000 (00:42 -0700)
commit1b1b275cc06aaa88226cc32202de6a37c86d2e54
tree474454cd8fbe7f643d5ae5136bf43ec8a8513359
parentfef538af5a94ec1da188ade6df2c9732c5597c6d
gianfar: fix BUG under load after introduction of skb recycling

Since commit e23ee2064b1246a9f9c04af7e8cf7202272ff97c ("gianfar:
Add support for skb recycling"), gianfar puts skbuffs that are in
the rx ring back onto the recycle list as-is in case there was a
receive error, but this breaks the following invariant: that all
skbuffs on the recycle list have skb->data = skb->head + NET_SKB_PAD.

The RXBUF_ALIGNMENT realignment done in gfar_new_skb() will be done
twice on skbuffs recycled in this way, causing there not to be enough
room in the skb anymore to receive a full packet, eventually leading
to an skb_over_panic from gfar_clean_rx_ring() -> skb_put().

Resetting the skb->data pointer to skb->head + NET_SKB_PAD before
putting the skb back onto the recycle list restores the mentioned
invariant, and should fix this issue.

Reported-by: Michael Guntsche <mike@it-loops.com>
Tested-by: Michael Guntsche <mike@it-loops.com>
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/gianfar.c