From patchwork Wed Mar 20 19:02:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 229463 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 CC5B02C0079 for ; Thu, 21 Mar 2013 06:03:06 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756874Ab3CTTCs (ORCPT ); Wed, 20 Mar 2013 15:02:48 -0400 Received: from mail-da0-f42.google.com ([209.85.210.42]:42468 "EHLO mail-da0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755297Ab3CTTCr (ORCPT ); Wed, 20 Mar 2013 15:02:47 -0400 Received: by mail-da0-f42.google.com with SMTP id n15so1158346dad.29 for ; Wed, 20 Mar 2013 12:02:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=4AzOH7eXo8DENzm8jZ+6nnAv3JDaK9lSEEU6nKNtufY=; b=GIrEKG9FPfEfvs4GEqMjqgUBAgZGrML7jAhnjKRhMP82eRMVO1go222joykwDiHPiW J9T+5X/cHSzotV9DvM79eX+hFf6I3ZKfXt+UpP/69dhrCGf5tps1F/yzPRR9LbYDG9aN Y0pZ95HWbqH8pj9t3ECtyrTJJZOUCqsbJtu9LAsiXN7KBVfoK2xy93DEVlHqfr7AHwc8 t1K1o7lURJHwyMtI050c4TXAGZoDDpj9LXErL28U7l+5RYcNpxBBftxDh1Quv+IFJY7n /pAue2XsxvNIdRbyLWEQ4iTUkPOTEO+iACWysPcmXptQH/F7lPOUVpWE2l8Xxzh9qYpG xIfA== X-Received: by 10.66.170.176 with SMTP id an16mr11053661pac.24.1363806166953; Wed, 20 Mar 2013 12:02:46 -0700 (PDT) Received: from nehalam.linuxnetplumber.net (static-50-53-71-109.bvtn.or.frontiernet.net. [50.53.71.109]) by mx.google.com with ESMTPS id oq3sm3235176pac.16.2013.03.20.12.02.45 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 20 Mar 2013 12:02:46 -0700 (PDT) Date: Wed, 20 Mar 2013 12:02:41 -0700 From: Stephen Hemminger To: Eric Dumazet Cc: David Miller , netdev Subject: [PATCH v2] chelsio: use netdev_alloc_skb_ip_align Message-ID: <20130320120241.19314ab6@nehalam.linuxnetplumber.net> In-Reply-To: <1363804952.3333.29.camel@edumazet-glaptop> References: <1363797199.3333.18.camel@edumazet-glaptop> <20130320113024.00377b99@nehalam.linuxnetplumber.net> <1363804952.3333.29.camel@edumazet-glaptop> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Gm-Message-State: ALoCoQlgcdcWMsIFGAKm3LoDODd4pvk5j1xaOsPqptLJGRguyvnh7NxlaVP4hCf/KttWXWw3IMot Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use netdev_alloc_sk_ip_align in the case where packet is copied. This handles case where NET_IP_ALIGN == 0 as well as adding required header padding. 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/drivers/net/ethernet/chelsio/cxgb/sge.c 2013-03-20 11:13:47.950986878 -0700 +++ b/drivers/net/ethernet/chelsio/cxgb/sge.c 2013-03-20 12:00:01.551115729 -0700 @@ -1046,11 +1046,10 @@ static inline struct sk_buff *get_packet const struct freelQ_ce *ce = &fl->centries[fl->cidx]; if (len < copybreak) { - skb = alloc_skb(len + 2, GFP_ATOMIC); + skb = netdev_alloc_skb_ip_align(NULL, len); if (!skb) goto use_orig_buf; - skb_reserve(skb, 2); /* align IP header */ skb_put(skb, len); pci_dma_sync_single_for_cpu(pdev, dma_unmap_addr(ce, dma_addr),