netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Matyukevich <geomatsi@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, leoli@freescale.com, avorontsov@ru.mvista.com
Subject: [PATCH v2] ucc_geth: fix for RX skb buffers recycling
Date: Mon, 14 Jun 2010 20:35:20 +0400	[thread overview]
Message-ID: <20100614203520.23a02c25@realm> (raw)
In-Reply-To: <20100609.180240.59675642.davem@davemloft.net>

Hello David,

Could you please consider the second, simplified, version of the patch
for ucc_geth driver regarding proper RX error skb buffer recycling.


This patch implements a proper modification of RX skb buffers before
recycling. Adjusting only skb->data is not enough because after that
skb->tail and skb->len become incorrect.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>
---
 drivers/net/ucc_geth.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 4a34833..807470e 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3215,6 +3215,8 @@ static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit
 					   __func__, __LINE__, (u32) skb);
 			if (skb) {
 				skb->data = skb->head + NET_SKB_PAD;
+				skb->len = 0;
+				skb_reset_tail_pointer(skb);
 				__skb_queue_head(&ugeth->rx_recycle, skb);
 			}
 
-- 
1.6.2.5


  reply	other threads:[~2010-06-14 16:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-07 18:38 [PATCH 1/2] [PATCH] ucc_geth driver: add ioctl Sergey Matyukevich
2010-06-07 18:38 ` [PATCH 2/2] [PATCH] ucc_geth: fix for RX skb buffers recycling Sergey Matyukevich
2010-06-10  1:02   ` David Miller
2010-06-14 16:35     ` Sergey Matyukevich [this message]
2010-06-17  1:17       ` [PATCH v2] " David Miller
2010-06-12 22:26 ` [PATCH 1/2] [PATCH] ucc_geth driver: add ioctl David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100614203520.23a02c25@realm \
    --to=geomatsi@gmail.com \
    --cc=avorontsov@ru.mvista.com \
    --cc=davem@davemloft.net \
    --cc=leoli@freescale.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).