2022-03-29 15:36:36

by Maciej Fijalkowski

[permalink] [raw]
Subject: Re: [PATCH net] ice: Fix logic of getting XSK pool associated with Tx queue

On Tue, Mar 29, 2022 at 12:27:51PM +0200, Ivan Vecera wrote:
> Function ice_tx_xsk_pool() used to get XSK buffer pool associated
> with XDP Tx queue returns NULL when number of ordinary Tx queues
> is not equal to num_possible_cpus().
>
> The function computes XDP Tx queue ID as an expression
> `ring->q_index - vsi->num_xdp_txq` but this is wrong because
> XDP Tx queues are placed after ordinary ones so the correct
> formula is `ring->q_index - vsi->alloc_txq`.
>
> Prior commit 792b2086584f ("ice: fix vsi->txq_map sizing") number
> of XDP Tx queues was equal to number of ordinary Tx queues so
> the bug in mentioned function was hidden.
>
> Reproducer:
> host# ethtool -L ens7f0 combined 1
> host# ./xdpsock -i ens7f0 -q 0 -t -N
> samples/bpf/xdpsock_user.c:kick_tx:794: errno: 6/"No such device or address"
>
> sock0@ens7f0:0 txonly xdp-drv
> pps pkts 0.00
> rx 0 0
> tx 0 0
>
> Fixes: 2d4238f55697 ("ice: Add support for AF_XDP")
> Fixes: 792b2086584f ("ice: fix vsi->txq_map sizing")
> Signed-off-by: Ivan Vecera <[email protected]>

Thanks for this fix! I did exactly the same patch yesterday and it's
already applied to bpf tree:

https://lore.kernel.org/bpf/[email protected]/T/#u

Maciej

> ---
> drivers/net/ethernet/intel/ice/ice.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
> index b0b27bfcd7a2..d4f1874df7d0 100644
> --- a/drivers/net/ethernet/intel/ice/ice.h
> +++ b/drivers/net/ethernet/intel/ice/ice.h
> @@ -710,7 +710,7 @@ static inline struct xsk_buff_pool *ice_tx_xsk_pool(struct ice_tx_ring *ring)
> struct ice_vsi *vsi = ring->vsi;
> u16 qid;
>
> - qid = ring->q_index - vsi->num_xdp_txq;
> + qid = ring->q_index - vsi->alloc_txq;
>
> if (!ice_is_xdp_ena_vsi(vsi) || !test_bit(qid, vsi->af_xdp_zc_qps))
> return NULL;
> --
> 2.34.1
>


2022-03-29 23:52:01

by Ivan Vecera

[permalink] [raw]
Subject: Re: [PATCH net] ice: Fix logic of getting XSK pool associated with Tx queue

On Tue, 29 Mar 2022 14:00:01 +0200
Maciej Fijalkowski <[email protected]> wrote:

> Thanks for this fix! I did exactly the same patch yesterday and it's
> already applied to bpf tree:
>
> https://lore.kernel.org/bpf/[email protected]/T/#u
>
> Maciej

Thanks for info... Nice human race condition ;-)

I.

2022-03-31 04:10:45

by Michael, Alice

[permalink] [raw]
Subject: RE: [PATCH net] ice: Fix logic of getting XSK pool associated with Tx queue

> -----Original Message-----
> From: Ivan Vecera <[email protected]>
> Sent: Tuesday, March 29, 2022 10:55 AM
> To: Fijalkowski, Maciej <[email protected]>
> Cc: [email protected]; poros <[email protected]>; mschmidt
> <[email protected]>; Brandeburg, Jesse
> <[email protected]>; Nguyen, Anthony L
> <[email protected]>; David S. Miller <[email protected]>;
> Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>;
> Alexei Starovoitov <[email protected]>; Daniel Borkmann
> <[email protected]>; Jesper Dangaard Brouer <[email protected]>; John
> Fastabend <[email protected]>; Andrii Nakryiko
> <[email protected]>; Martin KaFai Lau <[email protected]>; Song Liu
> <[email protected]>; Yonghong Song <[email protected]>; KP Singh
> <[email protected]>; Jeff Kirsher <[email protected]>; Krzysztof
> Kazimierczak <[email protected]>; Lobakin, Alexandr
> <[email protected]>; moderated list:INTEL ETHERNET DRIVERS
> <[email protected]>; open list <[email protected]>;
> open list:XDP (eXpress Data Path) <[email protected]>
> Subject: Re: [PATCH net] ice: Fix logic of getting XSK pool associated with Tx
> queue
>
> On Tue, 29 Mar 2022 14:00:01 +0200
> Maciej Fijalkowski <[email protected]> wrote:
>
> > Thanks for this fix! I did exactly the same patch yesterday and it's
> > already applied to bpf tree:
> >
> > https://lore.kernel.org/bpf/20220328142123.170157-5-maciej.fijalkowski
> > @intel.com/T/#u
> >
> > Maciej
>
> Thanks for info... Nice human race condition ;-)
>
> I.

I'm covering for Tony this week maintaining this tree. He let me know there were a few patches you had to send Ivan and I was waiting on this one. If I'm following correctly, this one will be dropped and the other ones are ready to be sent now to net then?

Alice.

2022-03-31 04:32:56

by Alexander Lobakin

[permalink] [raw]
Subject: Re: [PATCH net] ice: Fix logic of getting XSK pool associated with Tx queue

From: Alice Michael <[email protected]>
Date: Wed, 30 Mar 2022 16:47:18 +0000

> > -----Original Message-----
> > From: Ivan Vecera <[email protected]>
> > Sent: Tuesday, March 29, 2022 10:55 AM
> > To: Fijalkowski, Maciej <[email protected]>
> > Cc: [email protected]; poros <[email protected]>; mschmidt
> > <[email protected]>; Brandeburg, Jesse
> > <[email protected]>; Nguyen, Anthony L
> > <[email protected]>; David S. Miller <[email protected]>;
> > Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>;
> > Alexei Starovoitov <[email protected]>; Daniel Borkmann
> > <[email protected]>; Jesper Dangaard Brouer <[email protected]>; John
> > Fastabend <[email protected]>; Andrii Nakryiko
> > <[email protected]>; Martin KaFai Lau <[email protected]>; Song Liu
> > <[email protected]>; Yonghong Song <[email protected]>; KP Singh
> > <[email protected]>; Jeff Kirsher <[email protected]>; Krzysztof
> > Kazimierczak <[email protected]>; Lobakin, Alexandr
> > <[email protected]>; moderated list:INTEL ETHERNET DRIVERS
> > <[email protected]>; open list <[email protected]>;
> > open list:XDP (eXpress Data Path) <[email protected]>
> > Subject: Re: [PATCH net] ice: Fix logic of getting XSK pool associated with Tx
> > queue
> >
> > On Tue, 29 Mar 2022 14:00:01 +0200
> > Maciej Fijalkowski <[email protected]> wrote:
> >
> > > Thanks for this fix! I did exactly the same patch yesterday and it's
> > > already applied to bpf tree:
> > >
> > > https://lore.kernel.org/bpf/20220328142123.170157-5-maciej.fijalkowski
> > > @intel.com/T/#u
> > >
> > > Maciej
> >
> > Thanks for info... Nice human race condition ;-)
> >
> > I.
>
> I'm covering for Tony this week maintaining this tree. He let me know there were a few patches you had to send Ivan and I was waiting on this one. If I'm following correctly, this one will be dropped and the other ones are ready to be sent now to net then?

Yes, this one is beaten and the net tree already contains it[0].
There are still 3 Ivan's fixes not applied yet:
* [1]
* [2]
* [3]

I'm wondering if it's worth to pass them through dev-queue since
they're urgent and have been tested already in 2 companies? They
could go directly to -net and make it into RC1.

>
> Alice.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=1ac2524de7b366633fc336db6c94062768d0ab03
[1] https://lore.kernel.org/netdev/[email protected]
[2] https://lore.kernel.org/netdev/[email protected]
[3] https://lore.kernel.org/netdev/[email protected]

Thanks,
Al

2022-03-31 05:02:25

by Michael, Alice

[permalink] [raw]
Subject: RE: [PATCH net] ice: Fix logic of getting XSK pool associated with Tx queue

> -----Original Message-----
> From: Lobakin, Alexandr <[email protected]>
> Sent: Wednesday, March 30, 2022 10:01 AM
> To: Michael, Alice <[email protected]>
> Cc: Lobakin, Alexandr <[email protected]>; ivecera
> <[email protected]>; Fijalkowski, Maciej <[email protected]>;
> [email protected]; poros <[email protected]>; mschmidt
> <[email protected]>; Brandeburg, Jesse
> <[email protected]>; Nguyen, Anthony L
> <[email protected]>; David S. Miller <[email protected]>;
> Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>;
> Alexei Starovoitov <[email protected]>; Daniel Borkmann
> <[email protected]>; Jesper Dangaard Brouer <[email protected]>; John
> Fastabend <[email protected]>; Andrii Nakryiko
> <[email protected]>; Martin KaFai Lau <[email protected]>; Song Liu
> <[email protected]>; Yonghong Song <[email protected]>; KP Singh
> <[email protected]>; moderated list:INTEL ETHERNET DRIVERS <intel-
> [email protected]>; open list <[email protected]>; open
> list:XDP (eXpress Data Path) <[email protected]>
> Subject: Re: [PATCH net] ice: Fix logic of getting XSK pool associated with Tx
> queue
>
> From: Alice Michael <[email protected]>
> Date: Wed, 30 Mar 2022 16:47:18 +0000
>
> > > -----Original Message-----
> > > From: Ivan Vecera <[email protected]>
> > > Sent: Tuesday, March 29, 2022 10:55 AM
> > > To: Fijalkowski, Maciej <[email protected]>
> > > Cc: [email protected]; poros <[email protected]>; mschmidt
> > > <[email protected]>; Brandeburg, Jesse
> > > <[email protected]>; Nguyen, Anthony L
> > > <[email protected]>; David S. Miller <[email protected]>;
> > > Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>;
> > > Alexei Starovoitov <[email protected]>; Daniel Borkmann
> > > <[email protected]>; Jesper Dangaard Brouer <[email protected]>;
> > > John Fastabend <[email protected]>; Andrii Nakryiko
> > > <[email protected]>; Martin KaFai Lau <[email protected]>; Song Liu
> > > <[email protected]>; Yonghong Song <[email protected]>; KP Singh
> > > <[email protected]>; Jeff Kirsher <[email protected]>;
> > > Krzysztof Kazimierczak <[email protected]>; Lobakin,
> > > Alexandr <[email protected]>; moderated list:INTEL ETHERNET
> > > DRIVERS <[email protected]>; open list
> > > <[email protected]>; open list:XDP (eXpress Data Path)
> > > <[email protected]>
> > > Subject: Re: [PATCH net] ice: Fix logic of getting XSK pool
> > > associated with Tx queue
> > >
> > > On Tue, 29 Mar 2022 14:00:01 +0200
> > > Maciej Fijalkowski <[email protected]> wrote:
> > >
> > > > Thanks for this fix! I did exactly the same patch yesterday and
> > > > it's already applied to bpf tree:
> > > >
> > > > https://lore.kernel.org/bpf/20220328142123.170157-5-maciej.fijalko
> > > > wski
> > > > @intel.com/T/#u
> > > >
> > > > Maciej
> > >
> > > Thanks for info... Nice human race condition ;-)
> > >
> > > I.
> >
> > I'm covering for Tony this week maintaining this tree. He let me know there
> were a few patches you had to send Ivan and I was waiting on this one. If
> I'm following correctly, this one will be dropped and the other ones are ready
> to be sent now to net then?
>
> Yes, this one is beaten and the net tree already contains it[0].
> There are still 3 Ivan's fixes not applied yet:
> * [1]
> * [2]
> * [3]
>
> I'm wondering if it's worth to pass them through dev-queue since they're
> urgent and have been tested already in 2 companies? They could go directly
> to -net and make it into RC1.
>
> >
> > Alice.
>
> [0]
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=
> 1ac2524de7b366633fc336db6c94062768d0ab03
> [1] https://lore.kernel.org/netdev/20220322142554.3253428-1-
> [email protected]
> [2] https://lore.kernel.org/netdev/20220325132524.1765342-1-
> [email protected]
> [3] https://lore.kernel.org/netdev/20220325132819.1767050-1-
> [email protected]
>
> Thanks,
> Al

Yes, if you read my original message, I said to net =) I am the
one that takes it from here and sends to net. I was asserting
that his changes were done now and ready to be sent to net or
if I was missing another patch he is working on before putting
it up.
Alice