Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Sandeep Haemoon
Sun, 22 Nov 2026 23:13
[PATCH net-next v8 2/3] net: ethernet: mtk_eth_soc: skip page_pool
Author: Sandeep Haemoon
Date: Sun, 22 Nov 2026 23:13
Date: Sun, 22 Nov 2026 23:13
43 lines
10386 bytes
10386 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
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 v8 2/3] net: ethernet: mtk_eth_soc: skip page_pool
Author: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 23:15
Date: Mon, 23 Nov 2026 23:15
49 lines
9762 bytes
9762 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 line 'net: ethernet: mtk_eth_soc: skip page_pool'
leaves out the condition.
--
net: ethernet: mtk_eth_soc: skip page_pool
This commit adds a check in mtk_rx_alloc() so that an RX ring only gets
a page_pool when ring->buf_size fits within MTK_PP_MAX_BUF_SIZE. Rings
larger than that use the existing netdev_alloc_frag() and
mtk_max_lro_buf_alloc() path. The commit message says the check always
passes with the current MTU limits and only matters once 9K jumbo
support is added.
Link: https://github.com/mediatek/mtk-openwrt-feeds
> net: ethernet: mtk_eth_soc: skip page_pool
[Severity: Low]
This isn't a bug, but the subject doesn't say when page_pool is skipped.
In a shortlog or a backport scan, it reads as if page_pool is being
removed from the driver.
The patch only adds a per-ring check in mtk_rx_alloc():
if (mtk_page_pool_enabled(eth) &&
ring->buf_size <= MTK_PP_MAX_BUF_SIZE) {
At this commit the check changes nothing on SoCs that use page_pool. The
non-HWLRO rings are sized from ETH_DATA_LEN, so buf_size stays around
2K. That is well below MTK_PP_MAX_BUF_SIZE, which is about 3520 with 4K
pages.
The HWLRO rings are larger. They only exist on NETSYS v1 SoCs
(mt2701/mt7622/mt7623/mt7629), and mtk_page_pool_enabled() is already
false there.
Could the subject say when page_pool is skipped? For example, "skip
page_pool for RX rings larger than MTK_PP_MAX_BUF_SIZE".
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/patch-51fa5ed3bc801edb3f29b61ca7888382%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