Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4976788imm; Tue, 31 Jul 2018 03:32:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpecZC0AKJWxi8K9eZeya/TkZGjaW1yYem41d7IM8QzY3tZRcJLQ6zBIhmZifIyy3os933uL X-Received: by 2002:a17:902:5a82:: with SMTP id r2-v6mr8336055pli.315.1533033176798; Tue, 31 Jul 2018 03:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533033176; cv=none; d=google.com; s=arc-20160816; b=HismVofyydiq9ku0HT0U72PjQ6qgPp3ivfR+zBvzZ9xaBntT2trhvNjZP3dGyCWTae urJnx9ozpEvX4C/cGVNMBU1/3THME68nv8T7jWZzhFro4Vi4x1lAkIq3x1hjNWXvqZSe 9WgNJRjkNH+MFXGNIHN+x13p2G18j6an46AEfQCiqwbFfGADXo85QeVIhW4qeu5vjxhf IYXmQqop/0KLjW6wrreUtiEILfQRbo1NkOytL+cvbDq8FP0pJ2QsguEygEb9eaHCYZ2f VORS8Cug20tPhXLbclWB/aJL25aykFgMdwHNmzi8IbAJZ2ODheU01CYv0ysYcP1KpKtW r1hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=v7ye2FuySFP2SnvA5vWo/bKOYpQZ3BDYfzbYmdNMI+w=; b=j+d1/0eCawpz3gOKMv97hoCKlAeunRWskzoMq+/janBk7tLVviKseZnqySusbzzlqm YR2DQy/+ot0bz+vucKFQT98o2LNRk+iHy2INSAx/SuJyRglnb5Eb2S2FZnkMKGJX39zJ ZujKozr4GqxSqqpXJK1mQA9lQ5SdCPAtG8/gbK8VaAd4umneevj4+/qcBgS/1hcxv7sX OpwUvOneUFZ7UE6q+QXEoEm4SFWODSxQ+amFwoC6ue2mRilB3LCdpAOFC8kyXOnsyD5p fTapYiz3w76Gqm7jRkMyTuZZXREZB928OxfMkaBSOdCfc4kBDiSXYHJsCXF0T+Za7vpc 2vdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11-v6si12328768plg.344.2018.07.31.03.32.42; Tue, 31 Jul 2018 03:32:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731503AbeGaMLf convert rfc822-to-8bit (ORCPT + 99 others); Tue, 31 Jul 2018 08:11:35 -0400 Received: from mga11.intel.com ([192.55.52.93]:40418 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727409AbeGaMLf (ORCPT ); Tue, 31 Jul 2018 08:11:35 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jul 2018 03:31:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,427,1526367600"; d="scan'208";a="249839735" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga005.fm.intel.com with ESMTP; 31 Jul 2018 03:31:55 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 31 Jul 2018 03:31:55 -0700 Received: from hasmsx107.ger.corp.intel.com (10.184.198.27) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 31 Jul 2018 03:31:55 -0700 Received: from hasmsx106.ger.corp.intel.com ([169.254.10.9]) by hasmsx107.ger.corp.intel.com ([169.254.2.132]) with mapi id 14.03.0319.002; Tue, 31 Jul 2018 13:31:52 +0300 From: "Basierski, SebastianX" To: Jia-Ju Bai , "Kirsher, Jeffrey T" CC: "netdev@vger.kernel.org" , "intel-wired-lan@lists.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: RE: [Intel-wired-lan] [PATCH] net: intel: ixgbe: Replace GFP_ATOMIC with GFP_KERNEL Thread-Topic: [Intel-wired-lan] [PATCH] net: intel: ixgbe: Replace GFP_ATOMIC with GFP_KERNEL Thread-Index: AQHUJYMCq8jgYK/qI0K524Y7tR5SwaSpJWvg Date: Tue, 31 Jul 2018 10:31:52 +0000 Message-ID: <3A7E81AC661B4646A4CE6F2E09B7B74E05C6434C@HASMSX106.ger.corp.intel.com> References: <20180727082231.3798-1-baijiaju1990@gmail.com> In-Reply-To: <20180727082231.3798-1-baijiaju1990@gmail.com> Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.103.102.154] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Acked-by: Sebastian Basierski Pozdrawiam Sebastian Basierski SII Engineer Delivering outsourced services to Intel e-mail: sebastianx.basierski@intel.com -----Original Message----- From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On Behalf Of Jia-Ju Bai Sent: Friday, July 27, 2018 10:23 AM To: Kirsher, Jeffrey T Cc: netdev@vger.kernel.org; Jia-Ju Bai ; intel-wired-lan@lists.osuosl.org; linux-kernel@vger.kernel.org Subject: [Intel-wired-lan] [PATCH] net: intel: ixgbe: Replace GFP_ATOMIC with GFP_KERNEL ixgbe_fcoe_ddp_setup(), ixgbe_setup_fcoe_ddp_resources() and ixgbe_sw_init() are never called in atomic context. They call kmalloc(), dma_pool_alloc() and kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 4 ++-- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c index 7a09a40e4472..ff7ed77ce224 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c @@ -217,7 +217,7 @@ static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid, } /* alloc the udl from per cpu ddp pool */ - ddp->udl = dma_pool_alloc(ddp_pool->pool, GFP_ATOMIC, &ddp->udp); + ddp->udl = dma_pool_alloc(ddp_pool->pool, GFP_KERNEL, &ddp->udp); if (!ddp->udl) { e_err(drv, "failed allocated ddp context\n"); goto out_noddp_unmap; @@ -785,7 +785,7 @@ int ixgbe_setup_fcoe_ddp_resources(struct ixgbe_adapter *adapter) return 0; /* Extra buffer to be shared by all DDPs for HW work around */ - buffer = kmalloc(IXGBE_FCBUFF_MIN, GFP_ATOMIC); + buffer = kmalloc(IXGBE_FCBUFF_MIN, GFP_KERNEL); if (!buffer) return -ENOMEM; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index afadba99f7b8..fe4a6125576d 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -6138,7 +6138,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter, adapter->mac_table = kzalloc(sizeof(struct ixgbe_mac_addr) * hw->mac.num_rar_entries, - GFP_ATOMIC); + GFP_KERNEL); if (!adapter->mac_table) return -ENOMEM; -- 2.17.0 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan