From patchwork Wed Jun 11 18:31:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 358850 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 56AB9140085 for ; Thu, 12 Jun 2014 04:31:19 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755177AbaFKSbO (ORCPT ); Wed, 11 Jun 2014 14:31:14 -0400 Received: from mail-pb0-f49.google.com ([209.85.160.49]:41458 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752667AbaFKSbO (ORCPT ); Wed, 11 Jun 2014 14:31:14 -0400 Received: by mail-pb0-f49.google.com with SMTP id jt11so88639pbb.22 for ; Wed, 11 Jun 2014 11:31:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-transfer-encoding; bh=w5BZhhrEzqGBNOMUfXCZ4nxMLzT0CxhU+njuWcMaMuE=; b=GOYA6jmTipc4uhJs/YyZs63omX9Ak1HpOb7ToZcqMkTa7pK8lTLbv72V2Bysn24gLP LagE0r+Wi/RQDNv6Pw6DrMXBRj+DPScl3JVXoT1rqBPX/eRTuf/bDDCL2Vzj/nflAvqh CI6+PQrLF3uuKK8KmFITwUHct0CRRtfkt8xXEQaFtxPdMNYwEm0kC6ZEHMEIzt/rIJgH 7yD5klPbYcEyzJXoVVHZvgeeDkf9Ysd2ssd3r3ePJ7vw73bs4lGWMJF8xPajvcJ7fgQJ oAyi7dDYHqKI17T9MTJcIJ/4PagFbsMv19HNwQ3zJbiax8F3kY1XWlk8SI4wcrUY7LOm WH0A== X-Gm-Message-State: ALoCoQkNfPzCoG50o0/mqKpnz2bcM7aBa21kL8C6EEkyrztBxwoRW86E6feVkAYSYghlqM7rcAH3 X-Received: by 10.68.163.100 with SMTP id yh4mr7154584pbb.122.1402511473120; Wed, 11 Jun 2014 11:31:13 -0700 (PDT) Received: from nehalam.linuxnetplumber.net (static-50-53-83-51.bvtn.or.frontiernet.net. [50.53.83.51]) by mx.google.com with ESMTPSA id ja8sm76295885pbd.3.2014.06.11.11.31.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 11 Jun 2014 11:31:12 -0700 (PDT) Date: Wed, 11 Jun 2014 11:31:09 -0700 From: Stephen Hemminger To: David Miller Cc: netdev@vger.kernel.org Subject: [PATCH net-next] ndisc: use netdev_alloc_skb Message-ID: <20140611113109.4c104592@nehalam.linuxnetplumber.net> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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);