diff mbox series

[net,v2] dpaa_eth: fix XDP queue index

Message ID 20240307142402.906681-1-dgouarin@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net,v2] dpaa_eth: fix XDP queue index | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes fail Problems with Fixes tag: 1
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-07--15-00 (tests: 892)

Commit Message

David Gouarin March 7, 2024, 2:24 p.m. UTC
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.
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 <dgouarin@gmail.com>
---
v2: add Fixes: in description
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maciej Fijalkowski March 7, 2024, 3:51 p.m. UTC | #1
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 <dgouarin@gmail.com>
> ---
> 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
>
David Gouarin March 7, 2024, 5:48 p.m. UTC | #2
Le jeu. 7 mars 2024 à 16:51, Maciej Fijalkowski
<maciej.fijalkowski@intel.com> a écrit :
>
> 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?

Correct. I have used the term xdp metadata because that is the terminology
used in the xdp program (struct xdp_md).
I should have said instead :
The DPAA FQ Id was passed to the XDP program in the xdp_rxq_info->queue_index
instead of the queue number [...]

Maciej please forgive me for the double send and formatting mistakes,
kernel mailing lists are new to me.

>
> > 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 <dgouarin@gmail.com>
> > ---
> > 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
> >
diff mbox series

Patch

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;