From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Subject: Fw: [PATCH] xen-netback: use netdev_alloc_skb_ip_align
Date: Wed, 10 Apr 2013 09:41:29 -0700 [thread overview]
Message-ID: <20130410094129.7086842d@nehalam.linuxnetplumber.net> (raw)
Begin forwarded message:
Date: Wed, 10 Apr 2013 14:18:16 +0100
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] xen-netback: use netdev_alloc_skb_ip_align
On Wed, 2013-04-10 at 00:07 +0100, Stephen Hemminger wrote:
> On Tue, 9 Apr 2013 12:27:31 +0100
> Ian Campbell <Ian.Campbell@citrix.com> wrote:
>
> > (apologies for the late reply, I've been away)
> >
> > On Wed, 2013-03-20 at 19:21 +0000, Stephen Hemminger wrote:
> > > Use standard helper function to allocate and align received packet.
> > > Compile tested only
> > >
> > > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > >
> > >
> > > --- a/drivers/net/xen-netback/netback.c 2013-03-07 18:12:52.825300956 -0800
> > > +++ b/drivers/net/xen-netback/netback.c 2013-03-20 12:09:09.052034865 -0700
> > > @@ -1357,8 +1357,8 @@ static unsigned xen_netbk_tx_build_gops(
> > > ret < MAX_SKB_FRAGS) ?
> > > PKT_PROT_LEN : txreq.size;
> > >
> > > - skb = alloc_skb(data_len + NET_SKB_PAD + NET_IP_ALIGN,
> > > - GFP_ATOMIC | __GFP_NOWARN);
> > > + skb = __netdev_alloc_skb_ip_align(vif->dev, data_len,
> > > + GFP_ATOMIC | __GFP_NOWARN);
> >
> > __netdev_alloc_skb_ip_align accounts for NET_IP_ALIGN but not
> > NET_SKB_PAD, is this aspect of the change intentional? (I'm not really
> > sure how much NET_SKB_PAD is worth in practice).
>
> __nedev_alloc_skb_ip_align(dev, length, gfp)
> calls __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp)
> calls __netdev_alloc_skb
>
> which adds padding here:
> struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
> unsigned int length, gfp_t gfp_mask)
> {
> struct sk_buff *skb = NULL;
> unsigned int fragsz = SKB_DATA_ALIGN(length + NET_SKB_PAD) +
> SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
Thanks for the explanation.
Acked-by: Ian Campbell <ian.campbell@citix.com>
I see this wasn't CCd to netdev -- do you want to resend or would you
like me to fwd to DaveM for you?
Ian.
reply other threads:[~2013-04-10 16:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20130410094129.7086842d@nehalam.linuxnetplumber.net \
--to=stephen@networkplumber.org \
--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