Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp2893889pxb; Sun, 20 Feb 2022 03:52:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJyykqQSRGwDXPCib/PzVuOiKQFSWZZukf9YZOvON8ibDAt9ZVTHois9OOhlTMGtPiMeyBU4 X-Received: by 2002:a05:6a00:130c:b0:4bd:118:8071 with SMTP id j12-20020a056a00130c00b004bd01188071mr15831950pfu.28.1645357963227; Sun, 20 Feb 2022 03:52:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645357963; cv=none; d=google.com; s=arc-20160816; b=FBnP/tQ0Do1+VR2ev0thX9LS4dte8B/sdeEH4fx3f+Is164OjJtGuotKM/y+RwbkzE lkYrpHGxf9W4q371zqlzu5GqKDLBvvQucFjl7UtX8hVRRLrDA/5yrmFh4eLOmUWf5dQh w+i3LDkF33s4Tw3Ec/eqWtielXWCraBNDcVOtNJddlyMlmdp1q8+R3SYD5WPhKFLPOcu oYJwsXc+UeyEn5AfRgChFtrxNkOVhSWikBgpHugy5saIErLiF/thHHDn6m8ZoUSZFtMv GHgJOw4FLWuvxkn3zLazIEcNqb+LOYy+BqvbeQ/LziuOmg9JDuWftRUxpkQ5gx0Wnowy GMSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=l2HIPyc/qjfiRX3Yj/rbnXa/24xw/4FVp8wQ/6PHgEs=; b=dCacQQgzei3TMcL0Hg4vy0xx6/h4+E+jizQKf1//YQlstRIJz5lhC4MLGQcnkCy5Y+ uAkx8wSZbgGdNJesCMdqzIkn3UZ638RkGNKhzdo9+wRtJnsVBSKlbQY2RDPTBEXuCM1n OzcJWOrEKSIFeKKfvTZptJ+APg7xrnMzAVR+HCvGqN/U7m4MUNNqSH+Sg3azRjq0UYGd R/UtuMUPHZCMq68l7fS19gfLIYTFGMMJFxsh50VlYvUXVGwGA1s6xKLU4L7fh6bGTisa EMwFboI9loNAsv5LpSfjhD9kASKhlq1oBF+KPOeiBXlTjkjOJREID1rpR3QwJP/tm3Qh K/LA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6si15185301pgq.608.2022.02.20.03.52.29; Sun, 20 Feb 2022 03:52:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235013AbiBTH1n (ORCPT + 99 others); Sun, 20 Feb 2022 02:27:43 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234532AbiBTH1l (ORCPT ); Sun, 20 Feb 2022 02:27:41 -0500 Received: from smtp.smtpout.orange.fr (smtp06.smtpout.orange.fr [80.12.242.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7571141990 for ; Sat, 19 Feb 2022 23:27:20 -0800 (PST) Received: from pop-os.home ([90.126.236.122]) by smtp.orange.fr with ESMTPA id Lgcmnw8HQuCn2LgcmnuVzW; Sun, 20 Feb 2022 08:27:18 +0100 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sun, 20 Feb 2022 08:27:18 +0100 X-ME-IP: 90.126.236.122 From: Christophe JAILLET To: Sergey Shtylyov , "David S. Miller" , Jakub Kicinski Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH] ravb: Use GFP_KERNEL instead of GFP_ATOMIC when possible Date: Sun, 20 Feb 2022 08:27:15 +0100 Message-Id: <3d67f0369909010d620bd413c41d11b302eb0ff8.1645342015.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'max_rx_len' can be up to GBETH_RX_BUFF_MAX (i.e. 8192) (see 'gbeth_hw_info'). The default value of 'num_rx_ring' can be BE_RX_RING_SIZE (i.e. 1024). So this loop can allocate 8 Mo of memory. Previous memory allocations in this function already use GFP_KERNEL, so use __netdev_alloc_skb() and an explicit GFP_KERNEL instead of a implicit GFP_ATOMIC. This gives more opportunities of successful allocation. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/renesas/ravb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 24e2635c4c80..525d66f71f02 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -475,7 +475,7 @@ static int ravb_ring_init(struct net_device *ndev, int q) goto error; for (i = 0; i < priv->num_rx_ring[q]; i++) { - skb = netdev_alloc_skb(ndev, info->max_rx_len); + skb = __netdev_alloc_skb(ndev, info->max_rx_len, GFP_KERNEL); if (!skb) goto error; ravb_set_buffer_align(skb); -- 2.32.0