🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16189

[PATCH net v7 1/4] net: stmmac: honor allocation flags when initializing RX buffers

#16189
From: Ding Hui
Date: Sat, 14 Nov 2026 09:21
33 lines
9704 bytes
From: Ding Hui <dinghui@lixiang.com>

stmmac_init_rx_buffers() accepts allocation flags but stopped using them
when RX buffers were converted to page_pool. As a result, callers passing
GFP_KERNEL still allocate with GFP_ATOMIC | __GFP_NOWARN and cannot use
reclaim to satisfy an allocation.

Use the supplied flags while retaining GFP_DMA32 for hardware without
64-bit DMA addressing. This also allows the resume path to allocate
missing RX pages with GFP_KERNEL.

Fixes: 2af6106ae949 ("net: stmmac: Introducing support for Page Pool")
Signed-off-by: Ding Hui <dinghui@lixiang.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 25894771e9e9..8bd244046195 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1689,7 +1689,7 @@ static int stmmac_init_rx_buffers(struct stmmac_priv *priv,
 {
 	struct stmmac_rx_queue *rx_q = &dma_conf->rx_queue[queue];
 	struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
-	gfp_t gfp = (GFP_ATOMIC | __GFP_NOWARN);
+	gfp_t gfp = flags;
 
 	if (priv->dma_cap.host_dma_width <= 32)
 		gfp |= GFP_DMA32;
-- 
2.34.1
Technical Details
Message-ID: <fb64c1eec47363e697f640834e249a047ca7f58c.1794646293.git.dinghui@lixiang.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363147-linux-kernel-netdev=dewy.ru
References: <cover.1794646293.git.dinghui@lixiang.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363147-linux-kernel-netdev=dewy.ru
From: dinghui1111@163.com (Ding Hui)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v7 1/4] net: stmmac: honor allocation flags when initializing RX buffers
Date: Sat, 14 Nov 2026 17:21:13 +0800
Organization: Usenet Network
Message-ID: <fb64c1eec47363e697f640834e249a047ca7f58c.1794646293.git.dinghui@lixiang.com>
References: <cover.1794646293.git.dinghui@lixiang.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1539600"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:wxZziPIvUq3M0ZIyfSZ6JUtLFMc= sha256:OtDQZ3pVgcb4tmyOxprspcCz11zyVcUDBwekgpgz8u8=
	sha1:b30DRZZ6CK42d56Nu40PmJ+iIlk= sha256:kW4vpEqWD32gwTg9aqkebF64r1eREfmYsFtKb9muAUc=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 1602911478A; Sat, 14 Nov 2026 12:23:28 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=163.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id QrXKAaVqtlef;
	Sat, 14 Nov 2026 12:23:24 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363147-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=163.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id B4099114786; Sat, 14 Nov 2026 12:23:14 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id F1C1062F3F; Sat, 14 Nov 2026 09:23:06 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
	t=1794648180;
	b=bv39Z0ZA7fY0cUYSinAq6pHXJpLb/QIC/DK3elYx+KkOG7A0Pl6GNtjFmJA3Hd2mAOpw
	 dZIDOBxrlnhNOEKvrCATnE4Ik3YUlX2ECAwD7r6Z7eQXidq94PLxTcTK4TfCLkXGyiQuG
	 GlfodbutYvApiQqvfukcS6e5IhPiID97VkuKYMEGaB9a1sKbm0sKm2BVrPQ7aIk/0WMhG
	 crjUeNj0nnF/rcFVqZlUVpsPfVG/EOVzNTY98D4/F3uZHhLjZ2Ncd1k2AZAaPHYUsRzSh
	 fLFif0ZCDoj/B6B8U/t6inQGjg3493b2Phlf0bxpBbTk5GEHspM47YC34nwJAwmuJlQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794648180;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To:
	 Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding:X-CM-TRANSID:X-Coremail-Antispam:
	 X-CM-SenderInfo;
	bh=7VWEQkQ/Bv3OVKC6H48yzpBhMJARpLfAxd56jKkS5oA=;
	b=zJq7eDo4ZiofBWjGG+b61cMFBf/TzFovxMO55FTwo7gtV9oB/oklnyaNGAKlEczQeIcX
	 BVM2gjzMNX3E7kkTCWjc9LMro+paf+yl0mg1QpvdWLCy8iiLMlupUOKrpwE/DFRzEkGgi
	 a+cIZo5CJX0Oyoq+Rn7nQT7aBrpwP/7vV730tu/mvs3+c9Qe+X404u3ps2JkKDrXgE/n9
	 70fRqF+25OmYBx0yuGtmiwh1mm7o28DwPwA5UW4sHSuW6DuC1vVBDlc755p/dI0Ef2kK7
	 LPw/QytNmMUwtBPLEKguTZtt+9IW3lqH637jQQKyr90Ldedp1pXLKjtB5ek41b5PhkA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=iccLuKsI;
	dmarc=pass header.from=163.com;
	spf=pass smtp.mailfrom=163.com;
	arc=fail smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 870E5606A896;
	Sat, 14 Nov 2026 09:23:00 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=iccLuKsI
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=117.135.210.2
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794648179;
	b=M4yn0JMt5whplIZyyLbsd4VIGaqfuJ/FZnh8ldPN5AqQYpTcHj+3jKZX76AKpC/u7uAB
	 5dX+55fdap08N+/bHxplxWN89UOSRn0bzNjlq+Q8CNth48nsDESdwqC2VF1RmguUnP2oP
	 bSdTADr68I0TJcC1FRXj8nWFuzLbQMU05EEz5xXJ+kB6zrVq2ks1E+fIlxV3/Rz8HiHgt
	 Siakbq/u5E1iQ+2lzBulqCqeD7dMugEva1DZ2r8My7FmX9Tvla6sLSdt0zi/84gBHjoBF
	 yEtnKbyhxTXeIVuOd8GqtQ1z0WH9kZn2xoaIyLFDnsAXCs0QOS0DyBwo+6j3g8uc7Og==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794648179;
	h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date:
	 Message-Id:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding:X-CM-TRANSID:X-Coremail-Antispam:
	 X-CM-SenderInfo;
	bh=7VWEQkQ/Bv3OVKC6H48yzpBhMJARpLfAxd56jKkS5oA=;
	b=AkvFxkpEdS6ZInuB/lsIX2BROQVXXzymE3pC4iYXg68KxUKAVSlx5y0kPO4O2PDd+756
	 1aj82ubk/bRMKollEk6zWQqwCsRAeQoUVfkO0BR+L7f642vuT5/lLRjWNiXx6thhBJf55
	 g2+nBR/w/fjzRwep1E2lgWy4ZNIpeIMeqNjE1L705GTvf3fpsUJhGzg3I25ecJPYYqj6P
	 2CfG6VFynShAcrl2MB2XoVp082aL2bJLif4/AcakJljX0U3zdvdYE9QMFUfEAG7YBMe76
	 MvLgUgQOIkt3qNgEBMt5eT5zsci/+1E7omdbMFqAdamz1faSg1XBfsmqkURXuSbFYyw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=163.com;
	spf=pass smtp.mailfrom=163.com;
	dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=iccLuKsI;
	arc=none smtp.remote-ip=117.135.210.2
X-Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.2])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 532BE606A333;
	Sat, 14 Nov 2026 09:22:57 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 532BE606A333
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;
	s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=7V
	WEQkQ/Bv3OVKC6H48yzpBhMJARpLfAxd56jKkS5oA=; b=iccLuKsIuWrxEwaWqq
	4okYBpuvXKa6jPJi0bvBIe8os6bahKBbcz190/oQQi+jzrzVbJWcUIC3FXexehhM
	JIXDtL4sYjs5S2PN3Ebpdl158Dq8Gv9l+YpTkhT0Ah0fi22hbkHtavwlWYFxdf4+
	4hDJsSBIbEfW/JNpC2EwJit+Q=
X-Received: from 4CV529F122.company.local (unknown [])
	by gzga-smtp-mtada-g1-3 (Coremail) with SMTP id _____wA3r6IRKPhqiIvzHA--.51340S3;
	Sat, 14 Nov 2026 17:21:32 +0800 (CST)
X-Cc: tommaso.merciai.xr@bp.renesas.com,
	dinghui@lixiang.com,
	xiasanbo@lixiang.com,
	yangchen11@lixiang.com,
	liuxuanjun@lixiang.com
X-Mailer: git-send-email 2.34.1
X-In-Reply-To: <cover.1794646293.git.dinghui@lixiang.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-CM-TRANSID: _____wA3r6IRKPhqiIvzHA--.51340S3
X-Coremail-Antispam: 1Uf129KBjvJXoW7Kw4Dtw1rZrWxWr17WrWxWFg_yoW8GrWfpa
	9rAa4j9r1kXr17Jw4DGw4xuFW3KayUKFW5uw4xGFW3ZF4xKF90qryaqFyUZr1xCr48ZFWS
	qr4jk3s8uF1UAwUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jGNtxUUUUU=
X-CM-SenderInfo: pglqwx1xlriiqr6rljoofrz/xtbC0RzpFmr4KBzCDwAA3Z