On NETSYS v2 and later every RX ring gets a page_pool. The pool is created with order-0 pages and MTK_PP_MAX_BUF_SIZE (PAGE_SIZE minus the headroom), so it can only serve rings whose buffers fit in one page. The HW-LRO ring already needs 12K buffers, and 9K jumbo adds more such rings; for those the descriptor length is larger than a page, so the pool cannot back them. Only create the pool when ring->frag_size fits in a page. The other rings fall back to the netdev_alloc_frag()/mtk_max_lro_buf_alloc() path that is already there. 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index ad0fdc413..29370376f 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -2819,7 +2819,12 @@ 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)) { + /* page_pool hands out order-0 pages and the pool is created with + * MTK_PP_MAX_BUF_SIZE, so only rings whose buffers fit in a page can + * use it. The larger rings (HW-LRO, and 9K jumbo once enabled) take + * the netdev_alloc_frag()/mtk_max_lro_buf_alloc() path below. + */ + if (mtk_page_pool_enabled(eth) && ring->frag_size <= PAGE_SIZE) { struct page_pool *pp; pp = mtk_create_page_pool(eth, &ring->xdp_q, ring_no, -- 2.53.0