XDP-Newbies Archive mirror
 help / color / mirror / Atom feed
From: "Kuruvinakunnel, George" <george.kuruvinakunnel@intel.com>
To: "Fijalkowski, Maciej" <maciej.fijalkowski@intel.com>,
	"intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>
Cc: "alasdair.mcwilliam@outlook.com" <alasdair.mcwilliam@outlook.com>,
	"xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>,
	"Karlsson, Magnus" <magnus.karlsson@intel.com>
Subject: RE: [Intel-wired-lan] [PATCH intel-net 2/2] ice: xsk: use Rx ring's XDP ring when picking NAPI context
Date: Fri, 19 Aug 2022 14:05:23 +0000	[thread overview]
Message-ID: <PH0PR11MB51448EF4094FF8F262B1FD92E26C9@PH0PR11MB5144.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220811182149.145358-3-maciej.fijalkowski@intel.com>

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Maciej
> Fijalkowski
> Sent: Thursday, August 11, 2022 11:52 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: alasdair.mcwilliam@outlook.com; xdp-newbies@vger.kernel.org; Karlsson,
> Magnus <magnus.karlsson@intel.com>
> Subject: [Intel-wired-lan] [PATCH intel-net 2/2] ice: xsk: use Rx ring's XDP ring
> when picking NAPI context
> 
> Ice driver allocates per cpu XDP queues so that redirect path can safely use
> smp_processor_id() as an index to the array. At the same time though, XDP rings
> are used to pick NAPI context to call napi_schedule() or set
> NAPIF_STATE_MISSED. When user reduces queue count, say to 8, and
> num_possible_cpus() of underlying platform is 44, then this means queue vectors
> with correlated NAPI contexts will carry several XDP queues.
> 
> This in turn can result in a broken behavior where NAPI context of interest will
> never be scheduled and AF_XDP socket will not process any traffic.
> 
> To fix this, let us change the way how XDP rings are assigned to Rx rings and
> use this information later on when setting ice_tx_ring::xsk_pool pointer. For each
> Rx ring, grab the associated queue vector and walk through Tx ring's linked list.
> Once we stumble upon XDP ring in it, assign this ring to ice_rx_ring::xdp_ring.
> 
> Previous [0] approach of fixing this issue was for txonly scenario because of the
> described grouping of XDP rings across queue vectors. So, relying on Rx ring
> meant that NAPI context could be scheduled with a queue vector without XDP ring
> with associated XSK pool.
> 
> [0]: https://lore.kernel.org/netdev/20220707161128.54215-1-
> maciej.fijalkowski@intel.com/
> 
> Fixes: 2d4238f55697 ("ice: Add support for AF_XDP")
> Fixes: 22bf877e528f ("ice: introduce XDP_TX fallback path")
> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice.h      | 36 +++++++++++++++--------
>  drivers/net/ethernet/intel/ice/ice_lib.c  |  4 +--
> drivers/net/ethernet/intel/ice/ice_main.c | 25 +++++++++++-----
> drivers/net/ethernet/intel/ice/ice_xsk.c  | 12 ++++----
>  4 files changed, 48 insertions(+), 29 deletions(-)
> 

Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>

      reply	other threads:[~2022-08-19 14:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 18:21 [PATCH intel-net 0/2] ice: xsk: reduced queue count fixes Maciej Fijalkowski
2022-08-11 18:21 ` [PATCH intel-net 1/2] ice: xsk: prohibit usage of non-balanced queue id Maciej Fijalkowski
2022-08-18 18:27   ` [Intel-wired-lan] " Kuruvinakunnel, George
2022-08-11 18:21 ` [PATCH intel-net 2/2] ice: xsk: use Rx ring's XDP ring when picking NAPI context Maciej Fijalkowski
2022-08-19 14:05   ` Kuruvinakunnel, George [this message]

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=PH0PR11MB51448EF4094FF8F262B1FD92E26C9@PH0PR11MB5144.namprd11.prod.outlook.com \
    --to=george.kuruvinakunnel@intel.com \
    --cc=alasdair.mcwilliam@outlook.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=xdp-newbies@vger.kernel.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).