eth: link netdev to page_pools in drivers
authorJakub Kicinski <kuba@kernel.org>
Sun, 26 Nov 2023 23:07:32 +0000 (15:07 -0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 28 Nov 2023 14:48:39 +0000 (15:48 +0100)
Link page pool instances to netdev for the drivers which
already link to NAPI. Unless the driver is doing something
very weird per-NAPI should imply per-netdev.

Add netsec as well, Ilias indicates that it fits the mold.

Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/microsoft/mana/mana_en.c
drivers/net/ethernet/socionext/netsec.c

index d8cf7b30bd03f967acf3166bababa6befa0bf3e6..e35e7e02538c77ab3f94415b89f947fa610b538a 100644 (file)
@@ -3331,6 +3331,7 @@ static int bnxt_alloc_rx_page_pool(struct bnxt *bp,
                pp.pool_size += bp->rx_ring_size;
        pp.nid = dev_to_node(&bp->pdev->dev);
        pp.napi = &rxr->bnapi->napi;
+       pp.netdev = bp->dev;
        pp.dev = &bp->pdev->dev;
        pp.dma_dir = bp->rx_dir;
        pp.max_len = PAGE_SIZE;
index 3aecdf099a2fc7556984d576239e0fe9680b9af5..af5e0d3c8ee1276fa69c0aa470f4466082875ca5 100644 (file)
@@ -902,6 +902,7 @@ static int mlx5e_alloc_rq(struct mlx5e_params *params,
                pp_params.nid       = node;
                pp_params.dev       = rq->pdev;
                pp_params.napi      = rq->cq.napi;
+               pp_params.netdev    = rq->netdev;
                pp_params.dma_dir   = rq->buff.map_dir;
                pp_params.max_len   = PAGE_SIZE;
 
index 6b857188b9dac7ac8c42fd2acd617532543ab22d..0eb8321d76c96e7dd308336020207f6ab2f18d19 100644 (file)
@@ -2137,6 +2137,7 @@ static int mana_create_page_pool(struct mana_rxq *rxq, struct gdma_context *gc)
        pprm.pool_size = RX_BUFFERS_PER_QUEUE;
        pprm.nid = gc->numa_node;
        pprm.napi = &rxq->rx_cq.napi;
+       pprm.netdev = rxq->ndev;
 
        rxq->page_pool = page_pool_create(&pprm);
 
index 0891e9e49ecb584362d0f576f15a8ea612b8d5f3..5ab8b81b84e6f6d8e0022d476980f403c3d89272 100644 (file)
@@ -1302,6 +1302,8 @@ static int netsec_setup_rx_dring(struct netsec_priv *priv)
                .dma_dir = xdp_prog ? DMA_BIDIRECTIONAL : DMA_FROM_DEVICE,
                .offset = NETSEC_RXBUF_HEADROOM,
                .max_len = NETSEC_RX_BUF_SIZE,
+               .napi = &priv->napi,
+               .netdev = priv->ndev,
        };
        int i, err;