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_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 Signed-off-by: Sandeep Haemoon --- 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 a46cf5441..6768ab8eb 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -2825,7 +2825,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_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