netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Ivan Vecera <ivecera@redhat.com>
Cc: netdev@vger.kernel.org, poros@redhat.com, mschmidt@redhat.com,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, KP Singh <kpsingh@kernel.org>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	Krzysztof Kazimierczak <krzysztof.kazimierczak@intel.com>,
	Alexander Lobakin <alexandr.lobakin@intel.com>,
	"moderated list:INTEL ETHERNET DRIVERS" 
	<intel-wired-lan@lists.osuosl.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:XDP (eXpress Data Path)" <bpf@vger.kernel.org>
Subject: Re: [PATCH net] ice: Fix logic of getting XSK pool associated with Tx queue
Date: Tue, 29 Mar 2022 14:00:01 +0200	[thread overview]
Message-ID: <YkL0wfgyCq5s8vdu@boxer> (raw)
In-Reply-To: <20220329102752.1481125-1-ivecera@redhat.com>

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 <ivecera@redhat.com>

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

> ---
>  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
> 

  reply	other threads:[~2022-03-29 12:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 10:27 [PATCH net] ice: Fix logic of getting XSK pool associated with Tx queue Ivan Vecera
2022-03-29 12:00 ` Maciej Fijalkowski [this message]
2022-03-29 17:55   ` Ivan Vecera
2022-03-30 16:47     ` Michael, Alice
2022-03-30 17:00       ` Alexander Lobakin
2022-03-30 21:30         ` Michael, Alice

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YkL0wfgyCq5s8vdu@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=andrii@kernel.org \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=ivecera@redhat.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=krzysztof.kazimierczak@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mschmidt@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=poros@redhat.com \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).