diff options
author | Ben Menchaca <ben@bigfootnetworks.com> | 2010-03-24 05:05:02 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-26 20:16:23 -0700 |
commit | a6d36d5689b1806a3365c909192e9f03a43a632b (patch) | |
tree | 19de0640cf7f9c8cf634ac2d1c334094303e5bd8 /drivers/net/gianfar.c | |
parent | af06393bbde6e8d474622a0517cffc662676e3fe (diff) | |
download | kernel_goldelico_gta04-a6d36d5689b1806a3365c909192e9f03a43a632b.zip kernel_goldelico_gta04-a6d36d5689b1806a3365c909192e9f03a43a632b.tar.gz kernel_goldelico_gta04-a6d36d5689b1806a3365c909192e9f03a43a632b.tar.bz2 |
gianfar: fix undo of reserve()
Fix undo of reserve() before RX recycle
gfar_new_skb reserve()s space in the SKB to align it. If an error occurs,
and the skb needs to be returned to the RX recycle queue, the current code
attempts to reset head, but did not reset tail. This patch remembers the
alignment amount, and reverses the reserve() when needed.
Signed-off-by: Ben Menchaca <ben@bigfootnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r-- | drivers/net/gianfar.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index b671555..669de02 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -2393,6 +2393,7 @@ struct sk_buff * gfar_new_skb(struct net_device *dev) * as many bytes as needed to align the data properly */ skb_reserve(skb, alignamount); + GFAR_CB(skb)->alignamount = alignamount; return skb; } @@ -2533,13 +2534,13 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit) newskb = skb; else if (skb) { /* - * We need to reset ->data to what it + * We need to un-reserve() the skb to what it * was before gfar_new_skb() re-aligned * it to an RXBUF_ALIGNMENT boundary * before we put the skb back on the * recycle list. */ - skb->data = skb->head + NET_SKB_PAD; + skb_reserve(skb, -GFAR_CB(skb)->alignamount); __skb_queue_head(&priv->rx_recycle, skb); } } else { |