๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Sandeep Haemoon Fri, 13 Nov 2026 22:34
[PATCH net-next v7 2/3] net: ethernet: mtk_eth_soc: skip page_pool
#18088
Author: Sandeep Haemoon
Date: Fri, 13 Nov 2026 22:34
44 lines
10428 bytes
The page_pool is created with order-0 pages and MTK_PP_MAX_BUF_SIZE as
the maximum DMA length, so it can only back a ring whose descriptor
length fits in that.

Gate the pool on ring->buf_size <= MTK_PP_MAX_BUF_SIZE and let larger
rings use the netdev_alloc_frag()/mtk_max_lro_buf_alloc() path that already
exists.  ring->frag_size cannot serve as the limit: it follows the
netdev_alloc_frag() layout, whose headroom and skb_shared_info footprint
differ from the pool's, so a ring can have frag_size <= PAGE_SIZE while
its descriptor length is already larger than the pool can map.

With the current MTU limits every ring fits and the gate always passes;
it becomes active with the 9K jumbo support that follows, when the
shared rings grow past the limit.

Link: https://github.com/mediatek/mtk-openwrt-feeds
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Sandeep Haemoon <sandeeph@loljews.com>
---
 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 6c8b039fad..b3a6e57035 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -2824,7 +2824,13 @@ static int mtk_rx_alloc(struct mtk_eth *eth, int ring_no, int rx_flag)
 	if (!ring->data)
 		return -ENOMEM;
 
-	if (mtk_page_pool_enabled(eth)) {
+	/* A page_pool hands out order-0 pages and is created with
+	 * MTK_PP_MAX_BUF_SIZE, so it can only back a ring whose descriptor
+	 * length fits.  Larger rings use the netdev_alloc_frag()/
+	 * mtk_max_lro_buf_alloc() path below instead.
+	 */
+	if (mtk_page_pool_enabled(eth) &&
+	    ring->buf_size <= MTK_PP_MAX_BUF_SIZE) {
 		struct page_pool *pp;
 
 		pp = mtk_create_page_pool(eth, &ring->xdp_q, ring_no,
-- 
2.53.0
Re: [PATCH net-next v7 2/3] net: ethernet: mtk_eth_soc: skip page_pool
#20217
Author: netdev-bot+sashiko
Date: Sat, 21 Nov 2026 20:22
44 lines
9574 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The subject "net: ethernet: mtk_eth_soc: skip page_pool" leaves
  out when the page_pool is skipped.

--

net: ethernet: mtk_eth_soc: skip page_pool

This commit adds a condition in mtk_rx_alloc() so that a page_pool is
only created for an RX ring whose ring->buf_size fits in
MTK_PP_MAX_BUF_SIZE. Larger rings fall back to the existing
netdev_alloc_frag()/mtk_max_lro_buf_alloc() path. With the current MTU
limits this condition always passes. It only takes effect once the
9K jumbo support that follows is applied.

Link: https://github.com/mediatek/mtk-openwrt-feeds

> net: ethernet: mtk_eth_soc: skip page_pool

[Severity: Low]
This isn't a bug, but could the subject say when the page_pool is
skipped?

Read on its own in the shortlog, or during stable/backport triage,
"skip page_pool" reads as if page_pool is being removed from the driver
entirely. The change in mtk_rx_alloc() is actually a per-ring check:

	if (mtk_page_pool_enabled(eth) &&
	    ring->buf_size <= MTK_PP_MAX_BUF_SIZE) {

Something like "skip page_pool for RX rings larger than
MTK_PP_MAX_BUF_SIZE" would describe the change.

The earlier patch in the series, "net: ethernet: mtk_eth_soc: fix the
RX", also seems to have a subject that was cut short.

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/patch-7d2c457e68de6b53b7348d1bdbeadcec%40loljews.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads