Re: [net-next PATCH v3 1/6] octeontx2-pf: Don't unmap page pool buffer used by XDP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux