netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: David Miller <davem@davemloft.net>
Cc: ben@bigfootnetworks.com, netdev@vger.kernel.org,
	Sandeep.Kumar@freescale.com
Subject: Re: Gianfar: RX Recycle skb->len error
Date: Mon, 22 Mar 2010 20:24:46 +0300	[thread overview]
Message-ID: <20100322172446.GA32758@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20100321.214642.67901344.davem@davemloft.net>

On Sun, Mar 21, 2010 at 09:46:42PM -0700, David Miller wrote:
[...]
> > 				 * recycle list.
> >  				 */
> >  				skb->data = skb->head + NET_SKB_PAD;
> > +				skb_reset_tail_pointer(skb);
> > 				__skb_queue_head(&priv->rx_recycle, skb);
> > 			}
> > 		} else {
> 
> This code is essentially trying to undo skb_reserve()
> but as you found it's doing so in a buggy manner.
> 
> skb_reserve() adjusts both the 'data' and 'tail' pointers,
> but this attempt at a reversal is only modifying 'data'.
> 
> Your fix is fine, but really any by-hand modification of
> skb->data is a bug, and we should provide an skb_unreserve()
> or similar to hide such details away, and use it here.
> 
> Anton?

Yes, skb_unreserve() (or skb_reset_reserved() for naming consistency?)
would be great.

Ben, note that ucc_geth.c driver is also affected by that bug,
so I guess it needs a similar fix.

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

  reply	other threads:[~2010-03-22 17:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-20 19:54 Gianfar: RX Recycle skb->len error Ben Menchaca (ben@bigfootnetworks.com)
2010-03-22  4:46 ` David Miller
2010-03-22 17:24   ` Anton Vorontsov [this message]
2010-03-22 21:10     ` Ben Menchaca (ben@bigfootnetworks.com)
2010-03-23  3:30       ` David Miller
2010-03-23 14:16         ` Ben Menchaca (ben@bigfootnetworks.com)
2010-03-23 20:00           ` 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=20100322172446.GA32758@oksana.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=Sandeep.Kumar@freescale.com \
    --cc=ben@bigfootnetworks.com \
    --cc=davem@davemloft.net \
    --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).