Re: [net-next PATCH v2 3/6] octeontx2-pf: Add AF_XDP zero copy support for rx side
From: Simon Horman
Date: Thu Jan 09 2025 - 11:15:13 EST
On Thu, Jan 09, 2025 at 12:03:26AM +0530, Suman Ghosh wrote:
> This patch adds support to AF_XDP zero copy for CN10K.
> This patch specifically adds receive side support. In this approach once
> a xdp program with zero copy support on a specific rx queue is enabled,
> then that receive quse is disabled/detached from the existing kernel
> queue and re-assigned to the umem memory.
>
> Signed-off-by: Suman Ghosh <sumang@xxxxxxxxxxx>
...
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
...
> @@ -572,20 +575,31 @@ int otx2_napi_handler(struct napi_struct *napi, int budget)
> if (pfvf->flags & OTX2_FLAG_ADPTV_INT_COAL_ENABLED)
> otx2_adjust_adaptive_coalese(pfvf, cq_poll);
>
> + if (likely(cq))
> + pool = &pfvf->qset.pool[cq->cq_idx];
> +
Hi Suman,
FWIIW, Smatch is still concerned that cq may be used uninitialised here.
...
> @@ -1429,13 +1447,24 @@ static bool otx2_xdp_rcv_pkt_handler(struct otx2_nic *pfvf,
> unsigned char *hard_start;
> struct otx2_pool *pool;
> int qidx = cq->cq_idx;
> - struct xdp_buff xdp;
> + struct xdp_buff xdp, *xsk_buff = NULL;
> struct page *page;
> u64 iova, pa;
> u32 act;
> int err;
Please consider preserving reverse xmas tree order - longest line to
shortest - for local variable declarations.
...