🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7175

[PATCH net v5 1/2] net: stmmac: honor allocation flags when initializing RX buffers

#7175
From: Ding Hui
Date: Sun, 25 Oct 2026 10:06
37 lines
9834 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>
---
Changes in v5:
- Split this fix from the resume fix as requested.
- Add a Fixes tag for the page_pool conversion.

 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 b20e5038eead..f5ae12208e85 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1688,7 +1688,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: <20261025100636.613670-2-dinghui1111@163.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351522-linux-kernel-netdev=dewy.ru
References: <20261025100636.613670-1-dinghui1111@163.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351522-linux-kernel-netdev=dewy.ru
From: dinghui1111@163.com (Ding Hui)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v5 1/2] net: stmmac: honor allocation flags when initializing RX buffers
Date: Sun, 25 Oct 2026 18:06:35 +0800
Organization: Usenet Network
Message-ID: <20261025100636.613670-2-dinghui1111@163.com>
References: <20261025100636.613670-1-dinghui1111@163.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="985394"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:japAz3L40cTVWfOY9z9rK2cfTnI= sha256:+grBQku5xuDD6rmNpA1wPzcrwYivC2t1xfeke1vz9Yw=
	sha1:rsjYBiL5yefXCDJXzWYlfjzGaxE= sha256:ZL1VxTZP+bHEvAQ3F/O+Jc1K8SxBccJBEMoH0Y0Iq7U=
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 D38A1125B2C; Sun, 25 Oct 2026 13:10:03 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.047
X-Spam-Status: No, score=-3.047 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.25,
	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 vBEcJY6Xt9nX;
	Sun, 25 Oct 2026 13:10:01 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-351522-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 BC054125B2F; Sun, 25 Oct 2026 13:09:52 +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 87CD046D65; Sun, 25 Oct 2026 10:08:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792922935;
	b=bAec8AhXqfRqmLjyuVEQF7qoxSCnrug9ujF9MwNthChre3LCVflCBRaxighGxW5ARC/B
	 F7LApaESbRLo4+ztTAhRuinmuldFN9vfP8V5xFHj97lMm5pjTZ6TywDXQ0eWS/2wTVH34
	 mi9mnMDaKrPuwAhMTP9wXP4j/hCvmcYwX539H2A00hoGMDjchEyhzwki4xl6m/ktS7j1n
	 Jepv2kGkhS6OLkKCTA8N9A/n3dQs3hAqPZkCEJkEdXxfCr7xwkNTOYp++s2Mh8oG7YxOk
	 zKojI8TIHZlsfsEvI59OC7WIkNMEDSiP+S2HReBAMgLS97H7efsOYibIn8wBCOUoy7w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792922935;
	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=OyUY9uNJwoHV4iwApdNFM3PeLlmsfhKj3ed2bSvE2TY=;
	b=utWuGVnAsR+bJHiMQpnb76PoU3h4qC1Zo493kG7oBIYS3uwk88ncMQeUTFa3el8hOSrA
	 h8zqWOA+2JaiU8B3SCaRPv0fgPtzHodxKJ0V5ZBAHXFwjbAlrILkxIh/zgXmuTMdU8tBV
	 /61N6PaSNDx2IDM9mBmkUAuHE6O51+/R5Xlek+sZXiK4IpiHqbZwaEr8/2o5YEog08Krb
	 NhE69lPdsmny8wFDjxwcKO+O3Mbozsw6izHhzx2kn7+FExbyIZ+omk70ntx4MIv4YDq7/
	 IpJQLt6g5oiWWhBfqJatNwVQ+f4M9iW2EFUPMHPzy7pOFUHmMxWMVkPrWtG2TlRJ7VQ==
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="hHrcQd5/";
	dmarc=pass header.from=163.com;
	spf=pass smtp.mailfrom=163.com;
	arc=pass header.oldest-pass=0 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 5A7CE606A32A;
	Sun, 25 Oct 2026 10:08:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=hHrcQd5/
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.3
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792922929;
	b=iHhiRN9pFkRd6u4VWpIWt3wD6jin5gz1vAnjEYbfxPs/y39N49tzQNju367MNvviqj/D
	 zyMw62sLmB9zzxp4G6hw2kmKAJW/DKFitlp9Qbwx5ang7V6RnjgzhnB4+pcg+5nG9Jbqu
	 EoBha1rGw+U6QBPHj8DHEh4kwSnYbrwmXwrRbGp6a0qeH6A+HoonCvXxbtAudrUia14Mz
	 HHN3usvILf75OWg5K5HD4y3TQ9vbPcKDMPmadgSWV51MF2MR2vqax9igrhT2qFzQzcN1c
	 11q0V2kwdrEdnJcNX+dbYo2OXHknJ+uqqyHikaxNsxD3h0NiXXFT4ttPMNn5diZHRhw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792922929;
	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=OyUY9uNJwoHV4iwApdNFM3PeLlmsfhKj3ed2bSvE2TY=;
	b=BxIKoRQb4sPJ9cLh7rsagl3pd977LmndA5Se60w+pJ2DEP90v9kVd+D/xupM79bET8zf
	 7c8FupuJnPhGAR3W1qM2T7fNZB8cqRGKpJmdkIys/MqoCEoibDa6+roedDxl3G9PPhfQF
	 79yK4viXngPL7mEw15W2wqoUFMNH161m/r3YlpBFbVXc9aqHwMvBtJ5R7wkkAroXjrHDS
	 cw3eQgitIlqoSUmLtZ0K8dczAcwlLUoield1u6g7aFCQrOr34MpI7cMdlSgx/SDI0pk2/
	 gxzg3Ivx3rLmswJzKLGp5MrNEY32oK47uUNXX7Cvy9DOE2XerIU+gOULDel6/OZ5PLg==
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="hHrcQd5/";
	arc=none smtp.remote-ip=220.197.31.3
X-Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.3])
	(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 7FA81606A31F;
	Sun, 25 Oct 2026 10:08:47 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7FA81606A31F
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=Oy
	UY9uNJwoHV4iwApdNFM3PeLlmsfhKj3ed2bSvE2TY=; b=hHrcQd5/laq1KlukWR
	M4UFMjNMZxEpoJuMpnJKhIe+I6PqJJ4rUzowx7dBJTh9JPujljRuDv40k91iWFbt
	RKMU1B8279Yfc880IN0/hzFVlo7t6uIV9CZ4K7iyo1WX+cOAKThdBfT4UD3nQhdE
	gg95+pDxebit22yFy6NUYnmfk=
X-Received: from 4CV529F122.company.local (unknown [])
	by gzga-smtp-mtada-g1-0 (Coremail) with SMTP id _____wD3_26u1N1q7fwbCQ--.3918S3;
	Sun, 25 Oct 2026 18:07:01 +0800 (CST)
X-Cc: dinghui@lixiang.com,
	xiasanbo@lixiang.com,
	yangchen11@lixiang.com,
	liuxuanjun@lixiang.com,
	zhoujing3@lixiang.com,
	fujiahui@lixiang.com
X-Mailer: git-send-email 2.34.1
X-In-Reply-To: <20261025100636.613670-1-dinghui1111@163.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: _____wD3_26u1N1q7fwbCQ--.3918S3
X-Coremail-Antispam: 1Uf129KBjvJXoW7Kw4Dtw1rZrWxWr17CFyDWrg_yoW8Xrykpa
	9rAa409r1kXr1xJw4DGw4xZFW3Ka4UKrWUuw4xJFW3Za97KF90qryYqFy5Xr17urW8ZF4a
	qr1j93s8uF1DAw7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2
	9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j_4SrUUUUU=
X-CM-SenderInfo: pglqwx1xlriiqr6rljoofrz/xtbC0gZ4pGrd1MaxaQAA31