lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250210175415.GI554665@kernel.org>
Date: Mon, 10 Feb 2025 17:54:15 +0000
From: Simon Horman <horms@...nel.org>
To: Suman Ghosh <sumang@...vell.com>
Cc: sgoutham@...vell.com, gakula@...vell.com, sbhatta@...vell.com,
	hkelam@...vell.com, davem@...emloft.net, edumazet@...gle.com,
	kuba@...nel.org, pabeni@...hat.com, 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, larysa.zaremba@...el.com
Subject: Re: [net-next PATCH v5 1/6] octeontx2-pf: use xdp_return_frame() to
 free xdp buffers

On Thu, Feb 06, 2025 at 02:20:29PM +0530, Suman Ghosh wrote:
> xdp_return_frames() will help to free the xdp frames and their
> associated pages back to page pool.
> 
> Signed-off-by: Geetha sowjanya <gakula@...vell.com>
> Signed-off-by: Suman Ghosh <sumang@...vell.com>

...

> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c

...

> @@ -1465,10 +1476,14 @@ static bool otx2_xdp_rcv_pkt_handler(struct otx2_nic *pfvf,
>  		trace_xdp_exception(pfvf->netdev, prog, act);
>  		break;
>  	case XDP_DROP:
> +		cq->pool_ptrs++;
> +		if (page->pp) {
> +			page_pool_recycle_direct(pool->page_pool, page);
> +			return true;
> +		}
>  		otx2_dma_unmap_page(pfvf, iova, pfvf->rbsize,
>  				    DMA_FROM_DEVICE);
>  		put_page(page);
> -		cq->pool_ptrs++;
>  		return true;

The above seems to get shuffled around in the next patch anyway, so
maybe it's best to do this here (completely untested):

	case XDP_DROP:
		cq->pool_ptrs++;
		if (page->pp) {
			page_pool_recycle_direct(pool->page_pool, page);
		} else {
			otx2_dma_unmap_page(pfvf, iova, pfvf->rbsize,
					    DMA_FROM_DEVICE);
			put_page(page);
		}
		return true;

>  	}
>  	return false;

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ