netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ben@bigfootnetworks.com
Cc: avorontsov@ru.mvista.com, netdev@vger.kernel.org,
	Sandeep.Kumar@freescale.com
Subject: Re: Gianfar: RX Recycle skb->len error
Date: Mon, 22 Mar 2010 20:30:53 -0700 (PDT)	[thread overview]
Message-ID: <20100322.203053.37576243.davem@davemloft.net> (raw)
In-Reply-To: <A6A1774AFD79E346AE6D49A33CB294530DC19F18@EX-BE-017-SFO.shared.themessagecenter.com>

From: "Ben Menchaca (ben@bigfootnetworks.com)" <ben@bigfootnetworks.com>
Date: Mon, 22 Mar 2010 14:10:48 -0700

> 	It's yucky, but skb_reserve(skb, -alignamount) works,

I have no problem with people using that.

> 	It seems in both these cases for gianfar, the amount of the
> 	alignment is not immediately available to the code the
> 	recognizes that the skb_reset_reserved() is required.  A bit
> 	larger rework appears to be needed.

There's no need to make this so complicated.  Just remember the
value and then refer to it later, when needed.

struct gianfar_skb_cb {
       int	alignamount;
};

#define GIANFAR_CB(skb) ((struct gianfar_skb_cb *)((skb)->cb))

...
	GIANFAR_CB(skb)->alignamount = alignamount;
...

		skb_reserve(skb, -GIANFAR_CB(skb)->alignamount);

  reply	other threads:[~2010-03-23  3:30 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
2010-03-22 21:10     ` Ben Menchaca (ben@bigfootnetworks.com)
2010-03-23  3:30       ` David Miller [this message]
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=20100322.203053.37576243.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Sandeep.Kumar@freescale.com \
    --cc=avorontsov@ru.mvista.com \
    --cc=ben@bigfootnetworks.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).