[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2e4d11f6-843b-4e25-b4d1-727dc4edbefe@redhat.com>
Date: Tue, 14 Jan 2025 13:44:02 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Suman Ghosh <sumang@...vell.com>, horms@...nel.org, sgoutham@...vell.com,
gakula@...vell.com, sbhatta@...vell.com, hkelam@...vell.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org, lcherian@...vell.com,
jerinj@...vell.com, john.fastabend@...il.com, bbhushan2@...vell.com,
hawk@...nel.org, andrew+netdev@...n.ch, ast@...nel.org,
daniel@...earbox.net, bpf@...r.kernel.org
Subject: Re: [net-next PATCH v3 1/6] octeontx2-pf: Don't unmap page pool
buffer used by XDP
On 1/10/25 10:38 AM, Suman Ghosh wrote:
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> index e1dde93e8af8..8ba44164736a 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
> @@ -2701,11 +2701,15 @@ static int otx2_xdp_xmit_tx(struct otx2_nic *pf, struct xdp_frame *xdpf,
> if (dma_mapping_error(pf->dev, dma_addr))
> return -ENOMEM;
>
> - err = otx2_xdp_sq_append_pkt(pf, dma_addr, xdpf->len, qidx);
> + err = otx2_xdp_sq_append_pkt(pf, dma_addr, xdpf->len,
> + qidx, XDP_REDIRECT);
> if (!err) {
> otx2_dma_unmap_page(pf, dma_addr, xdpf->len, DMA_TO_DEVICE);
> page = virt_to_page(xdpf->data);
> - put_page(page);
> + if (page->pp)
> + page_pool_recycle_direct(page->pp, page);
> + else
> + put_page(page);
Side note for a possible follow-up: I guess that if you enable the page
pool usage for all the RX ring, regardless of XDP presence you could
avoid a bunch of conditionals in the fast-path and simplify the code a bit.
/P
Powered by blists - more mailing lists