All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: [PATCH] xen-netback: use netdev_alloc_skb_ip_align
Date: Wed, 20 Mar 2013 12:21:30 -0700	[thread overview]
Message-ID: <20130320122130.04039b0d@nehalam.linuxnetplumber.net> (raw)

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);
 		if (unlikely(skb == NULL)) {
 			netdev_dbg(vif->dev,
 				   "Can't allocate a skb in start_xmit.\n");
@@ -1366,9 +1366,6 @@ static unsigned xen_netbk_tx_build_gops(
 			break;
 		}
 
-		/* Packets passed to netif_rx() must have some headroom. */
-		skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);
-
 		if (extras[XEN_NETIF_EXTRA_TYPE_GSO - 1].type) {
 			struct xen_netif_extra_info *gso;
 			gso = &extras[XEN_NETIF_EXTRA_TYPE_GSO - 1];

             reply	other threads:[~2013-03-20 19:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 19:21 Stephen Hemminger [this message]
2013-04-09 11:27 ` [PATCH] xen-netback: use netdev_alloc_skb_ip_align Ian Campbell
2013-04-09 23:07   ` Stephen Hemminger
2013-04-10 13:18     ` Ian Campbell

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=20130320122130.04039b0d@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber.org \
    --cc=ian.campbell@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.