BPF List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Suman Ghosh <sumang@marvell.com>,
	horms@kernel.org, sgoutham@marvell.com, gakula@marvell.com,
	sbhatta@marvell.com, hkelam@marvell.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, lcherian@marvell.com,
	jerinj@marvell.com, john.fastabend@gmail.com,
	bbhushan2@marvell.com, hawk@kernel.org, andrew+netdev@lunn.ch,
	ast@kernel.org, daniel@iogearbox.net, bpf@vger.kernel.org
Subject: Re: [net-next PATCH v3 1/6] octeontx2-pf: Don't unmap page pool buffer used by XDP
Date: Tue, 14 Jan 2025 13:44:02 +0100	[thread overview]
Message-ID: <2e4d11f6-843b-4e25-b4d1-727dc4edbefe@redhat.com> (raw)
In-Reply-To: <20250110093807.2451954-2-sumang@marvell.com>

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


  reply	other threads:[~2025-01-14 12:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-10  9:38 [net-next PATCH v3 0/6] Add af_xdp support for cn10k Suman Ghosh
2025-01-10  9:38 ` [net-next PATCH v3 1/6] octeontx2-pf: Don't unmap page pool buffer used by XDP Suman Ghosh
2025-01-14 12:44   ` Paolo Abeni [this message]
2025-01-15 18:29     ` [EXTERNAL] " Suman Ghosh
2025-01-10  9:38 ` [net-next PATCH v3 2/6] octeontx2-pf: Add AF_XDP non-zero copy support Suman Ghosh
2025-01-14 12:39   ` Paolo Abeni
2025-01-15 18:27     ` [EXTERNAL] " Suman Ghosh
2025-01-10  9:38 ` [net-next PATCH v3 3/6] octeontx2-pf: AF_XDP zero copy receive support Suman Ghosh
2025-01-14 12:46   ` Paolo Abeni
2025-01-15 18:31     ` [EXTERNAL] " Suman Ghosh
2025-01-10  9:38 ` [net-next PATCH v3 4/6] octeontx2-pf: Reconfigure RSS table after enabling AF_XDP zerocopy on rx queue Suman Ghosh
2025-01-10  9:38 ` [net-next PATCH v3 5/6] Octeontx2-pf: Prepare for AF_XDP Suman Ghosh
2025-01-10  9:38 ` [net-next PATCH v3 6/6] octeontx2-pf: AF_XDP zero copy transmit support Suman Ghosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e4d11f6-843b-4e25-b4d1-727dc4edbefe@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bbhushan2@marvell.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hawk@kernel.org \
    --cc=hkelam@marvell.com \
    --cc=horms@kernel.org \
    --cc=jerinj@marvell.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    --cc=sumang@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox