From patchwork Thu Mar 19 17:13:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 452088 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 D8FBA14010F for ; Fri, 20 Mar 2015 04:28:04 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030235AbbCSR14 (ORCPT ); Thu, 19 Mar 2015 13:27:56 -0400 Received: from mail-by2on0119.outbound.protection.outlook.com ([207.46.100.119]:61356 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030231AbbCSR1z (ORCPT ); Thu, 19 Mar 2015 13:27:55 -0400 Received: from BN1PR02CA0017.namprd02.prod.outlook.com (10.141.56.17) by BN1PR02MB149.namprd02.prod.outlook.com (10.242.212.139) with Microsoft SMTP Server (TLS) id 15.1.106.15; Thu, 19 Mar 2015 17:13:22 +0000 Received: from BN1AFFO11FD049.protection.gbl (2a01:111:f400:7c10::195) by BN1PR02CA0017.outlook.office365.com (2a01:111:e400:2a::17) with Microsoft SMTP Server (TLS) id 15.1.118.21 via Frontend Transport; Thu, 19 Mar 2015 17:13:22 +0000 Received: from atltwp01.amd.com (165.204.84.221) by BN1AFFO11FD049.mail.protection.outlook.com (10.58.53.64) with Microsoft SMTP Server id 15.1.125.13 via Frontend Transport; Thu, 19 Mar 2015 17:13:22 +0000 X-WSS-ID: 0NLGYI8-07-DZ4-02 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp01.amd.com (Axway MailGate 5.3.1) with ESMTPS id 26F49CAE663; Thu, 19 Mar 2015 12:13:20 -0500 (CDT) Received: from SATLEXDAG05.amd.com (10.181.40.11) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 19 Mar 2015 12:13:24 -0500 Received: from tlendack-t1.amdoffice.net (10.180.168.240) by satlexdag05.amd.com (10.181.40.11) with Microsoft SMTP Server id 14.3.195.1; Thu, 19 Mar 2015 13:13:19 -0400 Subject: [PATCH net-next 09/10] amd-xgbe: Use napi_alloc_skb when allocating skb in softirq From: Tom Lendacky To: CC: David Miller Date: Thu, 19 Mar 2015 12:13:19 -0500 Message-ID: <20150319171319.26446.11901.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20150319171225.26446.36048.stgit@tlendack-t1.amdoffice.net> References: <20150319171225.26446.36048.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-EOPAttributedMessage: 0 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=Thomas.Lendacky@amd.com; davemloft.net; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:165.204.84.221; CTRY:US; IPV:NLI; EFV:NLI; BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(428002)(199003)(189002)(83506001)(97746001)(101416001)(103116003)(87936001)(23676002)(53416004)(50466002)(50986999)(54356999)(76176999)(86362001)(19580395003)(19580405001)(110136001)(105586002)(62966003)(77156002)(106466001)(2950100001)(46102003)(2351001)(77096005)(229853001)(47776003)(92566002)(33646002)(71626003); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR02MB149; H:atltwp01.amd.com; FPR:; SPF:None; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR02MB149; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002010)(5005006); SRVR:BN1PR02MB149; BCL:0; PCL:0; RULEID:; SRVR:BN1PR02MB149; X-Forefront-PRVS: 052017CAF1 X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2015 17:13:22.5496 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96; Ip=[165.204.84.221]; Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR02MB149 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use the napi_alloc_skb function to allocate an skb when running within the softirq context to avoid calls to local_irq_save/restore. Signed-off-by: Tom Lendacky --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 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 diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c index 2927d7c..89b1fca 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c @@ -1819,16 +1819,15 @@ static void xgbe_rx_refresh(struct xgbe_channel *channel) lower_32_bits(rdata->rdesc_dma)); } -static struct sk_buff *xgbe_create_skb(struct xgbe_prv_data *pdata, +static struct sk_buff *xgbe_create_skb(struct napi_struct *napi, struct xgbe_ring_data *rdata, unsigned int *len) { - struct net_device *netdev = pdata->netdev; struct sk_buff *skb; u8 *packet; unsigned int copy_len; - skb = netdev_alloc_skb_ip_align(netdev, rdata->rx.hdr.dma_len); + skb = napi_alloc_skb(napi, rdata->rx.hdr.dma_len); if (!skb) return NULL; @@ -1998,7 +1997,7 @@ read_again: rdata->rx.hdr.dma_len, DMA_FROM_DEVICE); - skb = xgbe_create_skb(pdata, rdata, &put_len); + skb = xgbe_create_skb(napi, rdata, &put_len); if (!skb) { error = 1; goto skip_data;