Subject: Re: [PATCH net v2] dpaa_eth: fix XDP queue index

From: Maciej Fijalkowski <[email-masked]>
Date: Thu, 7 Mar 2024 16:51:16 +0100

On Thu, Mar 07, 2024 at 03:24:02PM +0100, David Gouarin wrote:
> Make it possible to bind a XDP socket to a queue id.
> The DPAA FQ Id was passed to the XDP program in the XDP packet metadata
> which made it unusable with bpf_map_redirect.

I think that referring to a member from xdp_rxq_info struct as 'packet
metadata' is confusing. I was trying to find a place where you are
actually storing this id at xdp_buff::data_meta. This is not happening
AFAICT. Thing is that xsk_rcv_check() picks xdp->rxq->queue_index which
holds fqid which is not related to queue number, right?

> Instead of the DPAA FQ Id, initialise the XDP rx queue with the channel id.
> 
> Fixes: d57e57d0cd04 ("dpaa_eth: add XDP_TX support")
> 
> Signed-off-by: David Gouarin <[email-masked]>
> ---
> v2: add Fixes: in description
> ---
>  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> index dcbc598b11c6..988dc9237368 100644
> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> @@ -1154,7 +1154,7 @@ static int dpaa_fq_init(struct dpaa_fq *dpaa_fq, bool td_enable)
>  	if (dpaa_fq->fq_type == FQ_TYPE_RX_DEFAULT ||
>  	    dpaa_fq->fq_type == FQ_TYPE_RX_PCD) {
>  		err = xdp_rxq_info_reg(&dpaa_fq->xdp_rxq, dpaa_fq->net_dev,
> -				       dpaa_fq->fqid, 0);
> +				       dpaa_fq->channel, 0);
>  		if (err) {
>  			dev_err(dev, "xdp_rxq_info_reg() = %d\n", err);
>  			return err;
> -- 
> 2.34.1
>