netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ndisc: use netdev_alloc_skb
@ 2014-06-11 18:31 Stephen Hemminger
  2014-06-11 19:58 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2014-06-11 18:31 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

IPv6 neighbor discovery should use netdev_alloc_skb which adds
extra space for headroom. The old code would allocate packet w/o any
additional headroom and force drivers to reallocate and copy the
packet in some cases.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>


--- a/net/ipv6/ndisc.c	2014-06-03 08:06:35.549942475 -0700
+++ b/net/ipv6/ndisc.c	2014-06-11 08:54:31.729764741 -0700
@@ -375,7 +375,7 @@ static struct sk_buff *ndisc_alloc_skb(s
 	struct sock *sk = dev_net(dev)->ipv6.ndisc_sk;
 	struct sk_buff *skb;
 
-	skb = alloc_skb(hlen + sizeof(struct ipv6hdr) + len + tlen, GFP_ATOMIC);
+	skb = netdev_alloc_skb(dev, hlen + sizeof(struct ipv6hdr) + len + tlen);
 	if (!skb) {
 		ND_PRINTK(0, err, "ndisc: %s failed to allocate an skb\n",
 			  __func__);
@@ -383,7 +383,6 @@ static struct sk_buff *ndisc_alloc_skb(s
 	}
 
 	skb->protocol = htons(ETH_P_IPV6);
-	skb->dev = dev;
 
 	skb_reserve(skb, hlen + sizeof(struct ipv6hdr));
 	skb_reset_transport_header(skb);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-11 21:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-11 18:31 [PATCH net-next] ndisc: use netdev_alloc_skb Stephen Hemminger
2014-06-11 19:58 ` Eric Dumazet
2014-06-11 21:40   ` Stephen Hemminger

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).