Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp537124imm; Fri, 27 Jul 2018 01:23:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfbb232Mwcu9U+nTEOJ5hlwdbgR1nu7yP0dlkVnM8wmoJHmAZtzy1UlH3hRQdCe3fsRoKmg X-Received: by 2002:a63:6743:: with SMTP id b64-v6mr5088000pgc.91.1532679839723; Fri, 27 Jul 2018 01:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532679839; cv=none; d=google.com; s=arc-20160816; b=ubHqK6B7frAyt9OoFe4cT3WcZqOs4dtmEELajIlcuGMW+A+Kloqy9uQbNgH0E2PF4Q ZE4q9HmW4uB/qNHQ89pc7OPzCUIcda+SDLnpX+outjtoBpLH3wcNIZc06mpHt+8jbH8/ vVqO1ecHD4UFJYbNmwsugNpOXdPGcx44jexjwnWwhQZCwIYB2AlfipOM9cO4TKILW5/e ieMO4xC0Bxyrf5lCxH12HMHvG/uYC2cmXfU7kEwgSf1Hh2orqh8bIbHMHfhqo6GuER6k I5do7/XgF8gOq0u8wRyWy66QLDaE/2SszEqC1R4m3LxVXm1pllW+houti6sqB/wNVuv5 2Ukw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=/gzMd54Ec+OtZaWMQabcpGO3Adpp6UPzv3QK9xSICBM=; b=VTNpawRqOPJt5vkD0kZtgzXjY5wqglpSVdf9wA0jNHTY3jYQzGHsmWvmQEN5J/CFwW GvxPDIbl8snCDmc9NMXHw2VDUifn4wNwWxN1pKppo07lDYhWdepx1iWb/UuQV6s8ZWGa m15DbuKpIpKaGCOP6qfDxejADEPXcuHsCRwiaeCdjMnrhEpOHLSadhxWia1zmsHQn5pb OYQnqt7spB1h1p0zuhItXvV2AGwh5BKptVGXU9aeev/BeU/5kcdNCuBlCbOAUHtuka92 99VlANd4GpZ0tnyD86ntaeb4VXy4sfIdk1KlxI2i7Hw9Ja3dwYi7i5Eq+lgm0Yb5gjGt 0yGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="iT1Aw/tH"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10-v6si3183670pfg.258.2018.07.27.01.23.45; Fri, 27 Jul 2018 01:23:59 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="iT1Aw/tH"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730407AbeG0JnZ (ORCPT + 99 others); Fri, 27 Jul 2018 05:43:25 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:46672 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730189AbeG0JnZ (ORCPT ); Fri, 27 Jul 2018 05:43:25 -0400 Received: by mail-pl0-f66.google.com with SMTP id t17-v6so1998241ply.13; Fri, 27 Jul 2018 01:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=/gzMd54Ec+OtZaWMQabcpGO3Adpp6UPzv3QK9xSICBM=; b=iT1Aw/tHcOrtcvZTWUUffBXO61lXo8j9RsD3zivpcsABkx471mCgVzWQ3E+TPox6zH znfNN73ogmlyWH5jQr13cKH/bP4GXYO/0bgwU7H1XaiXSq9h7Lczw/T9JVosVCXv2IkP tWArHaGeDdIQoTTlkplXvLUbzQNvEJaXQ47LSF+/6NxRgKmhTWawEzF/eugtRBwtlzt1 t7QZ7LgJipNRBAjY5QQJjuRHmBmF96wMQinVO6qt8QXU6aUM5TxdRWDa6hb37FnOZgfU gE7zaIpjbCozWm0ijVCYWXbMHo3umOHEwfYDfEWDTcP4yzAjWeO7aN/SW+guGy4eUTn3 fC0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/gzMd54Ec+OtZaWMQabcpGO3Adpp6UPzv3QK9xSICBM=; b=udYGIN3mMeTBt97olk7kpcDfH7X0G1UCfma6VUMIIh0r/t3oh37U6t+sBwdaqm2Wuv q4uRBqwvIGz+4vNW5zZr42NU+RaXX9xhzs7g5wv40W1DSZBtdwmoHzeIJHXBbQstN68A ghaGLA/NXD5NGPd7tt2JeqAY0yD/e6ZnHQFKEG4TkleAMh8PvAQ3IaJ2OLWFZJoxs1gz 5S/umzQn7WNIgUH1UsafIYsZT2UuOi7L+sGtNSPeq4v1c3awT9yE/Gei/rVTnZiEFj9F R8cQZoLkAQy0UPAQWxFSUgqF/miuNt0nET4P2fY/4CSSjZbmPmpVpFCKmOzD1sTg2tLe BTCw== X-Gm-Message-State: AOUpUlHypgv9E26Ugs1JCFpYtduxVqzfnYFoVgPTXJkyfy9mlaNDOHeN t8DfUrmWZ/935KgQOcATbMaa1Ee/ X-Received: by 2002:a17:902:28a4:: with SMTP id f33-v6mr5043668plb.297.1532679758992; Fri, 27 Jul 2018 01:22:38 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id d132-v6sm4573023pga.10.2018.07.27.01.22.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 01:22:38 -0700 (PDT) From: Jia-Ju Bai To: jeffrey.t.kirsher@intel.com Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: intel: ixgbe: Replace GFP_ATOMIC with GFP_KERNEL Date: Fri, 27 Jul 2018 16:22:31 +0800 Message-Id: <20180727082231.3798-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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