Netdev List
 help / color / mirror / Atom feed
From: Petr Oros <poros@redhat.com>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
	Michal Schmidt <mschmidt@redhat.com>,
	edumazet@kernel.org, horms@kernel.org, pabeni@redhat.com,
	davem@davemloft.net, Jiri Pirko <jiri@resnulli.us>,
	andrew+netdev@lunn.ch, jacob.e.keller@intel.com,
	jedrzej.jagielski@intel.com, anzaki@gmail.com,
	brett.creeley@amd.com
Subject: Re: [PATCH net-next v7 15/15] ice: support up to 256 VF queues
Date: Thu, 26 Nov 2026 10:43:19 +0100	[thread overview]
Message-ID: <20261126094321.40071-1-poros@redhat.com> (raw)
In-Reply-To: <20261121230123.316391-16-przemyslaw.kitszel@intel.com>

On Sat, 21 Nov 2026 23:55:42 +0100, Przemek Kitszel wrote:
> Note that VF reset is deferred to service task. A message from the VF
> while that reset is pending does the reset instead, without a reply, so
> the VF never sees a half-applied change.

Sashiko asked whether this reset can run at the same time as the VSI
rebuild of a sriov_vf_msix_count write. It can. On my E810-C, with KASAN
and lockdep, this loop crashed within its first two iterations in both
of my runs.

  VF=0000:04:01.0
  echo $VF > /sys/bus/pci/drivers/iavf/unbind
  sleep 2
  for i in $(seq 100); do
          devlink resource set pci/$VF path rss_lut size 512
          echo 65 > /sys/bus/pci/devices/$VF/sriov_vf_msix_count
          devlink resource set pci/$VF path rss_lut size 64
          echo 17 > /sys/bus/pci/devices/$VF/sriov_vf_msix_count
  done

The reports differ from run to run, this is one of them.

  BUG: KASAN: slab-use-after-free in ice_vsi_free_q_vectors+0x498/0x550 [ice]
   ice_vsi_decfg+0x145/0x350 [ice]
   ice_vsi_rebuild+0x232/0x1420 [ice]
   ice_sriov_set_msix_vec_count+0x447/0x6a0 [ice]
  Freed by task 649:
   ice_vsi_free_q_vectors+0x30e/0x550 [ice]
   ice_vsi_decfg+0x145/0x350 [ice]
   ice_reset_vf+0xbf1/0x1260 [ice]
   ice_service_task.cold+0x94/0x620 [ice]

The missing lock is older, as Sashiko says. The parent can crash in the
same write right after an iavf unbind, once in 21 tries here, but it
survives 100 iterations of this loop with "ip link set $PF vf 0 trust
on" and "off" in place of the devlink commands. With the deferred reset
a LUT change followed by the write is enough.

> +	scoped_guard(devl, pf_devlink)
> +		err = devl_nested_devlink_set(pf_devlink, devlink);

Sashiko also asked whether this can deadlock against
ice_tear_down_devlink_rate_tree(). In legacy mode it does. v7 blocks
within the first two cycles of this loop, three runs out of three, and
rtnl stays locked.

  ethtool -K $PF hw-tc-offload on
  while :; do
          tc qdisc add dev $PF root mqprio num_tc 2 map 0 0 0 0 1 1 1 1 \
                  queues 3@0 3@3 hw 1 mode channel
          tc qdisc del dev $PF root
  done &
  for i in $(seq 10); do
          echo 62 > /sys/bus/pci/devices/0000:04:00.0/sriov_numvfs
          echo 0 > /sys/bus/pci/devices/0000:04:00.0/sriov_numvfs
  done

  task:bash            state:D
   ice_init_vf_devlink+0x135/0x280 [ice]
   ice_sriov_configure.cold+0xe97/0x1116 [ice]
   sriov_numvfs_store+0x288/0x490
  task:tc              state:D
   ice_tear_down_devlink_rate_tree+0x47/0xf0 [ice]
   ice_setup_tc+0x44c/0x3100 [ice]
   mqprio_enable_offload+0x38e/0x5a0 [sch_mqprio]

The parent finishes the ten cycles. With patches 1 to 4 of your
"ice: fix DCB lock ordering" on top v7 does not block there either, so
this series depends on that one.

Each nested VF instance adds 40 bytes to the DEVLINK_CMD_GET reply of
the PF. I measured 240 bytes without VFs and 2720 with 62, and my card
stops at 64 VFs per PF. Does the reply still fit with 128 or 256?

Regards,
Petr


  parent reply	other threads:[~2026-11-26  9:43 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 22:55 [PATCH net-next v7 00/15] devlink, mlx5, iavf, ice: XLVF for iavf Przemek Kitszel
2026-11-21 22:55 ` [PATCH net-next v7 01/15] iavf: keep RSS config across resets Przemek Kitszel
2026-11-24 21:57   ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 02/15] ice: prepare RSS LUT config for runtime LUT changes Przemek Kitszel
2026-11-24 21:57   ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 03/15] ice: add VF queue ena/dis helper functions Przemek Kitszel
2026-11-21 22:55 ` [PATCH net-next v7 04/15] ice: add helpers for Global RSS LUT alloc, free, vsi_update Przemek Kitszel
2026-11-24 21:57   ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 05/15] ice: rename ICE_MAX_RSS_QS_PER_VF to ICE_MAX_QS_PER_VF_VCV1 Przemek Kitszel
2026-11-21 22:55 ` [PATCH net-next v7 06/15] ice: bump to 256qs for VF Przemek Kitszel
2026-11-24 21:57   ` netdev-bot+sashiko
2026-11-26  9:43   ` Petr Oros
2026-11-21 22:55 ` [PATCH net-next v7 07/15] iavf: extend iavf_configure_queues() to support more queues Przemek Kitszel
2026-11-21 22:55 ` [PATCH net-next v7 08/15] iavf: temporary rename of IAVF_MAX_REQ_QUEUES to IAVF_MAX_REQ_QUEUES_VCV1 Przemek Kitszel
2026-11-21 22:55 ` [PATCH net-next v7 09/15] iavf: increase max number of queues to 256 Przemek Kitszel
2026-11-24 21:57   ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 10/15] iavf: use new opcodes to request more than 16 queues Przemek Kitszel
2026-11-24 21:57   ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 11/15] ice: introduce handling of virtchnl LARGE VF opcodes Przemek Kitszel
2026-11-24 21:57   ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 12/15] devlink: add cmode to resources Przemek Kitszel
2026-11-24 21:57   ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 13/15] ice: represent RSS LUTs as devlink resources Przemek Kitszel
2026-11-24 21:57   ` netdev-bot+sashiko
2026-11-21 22:55 ` [PATCH net-next v7 14/15] devlink: add devlink_alloc_drv() Przemek Kitszel
2026-11-21 22:55 ` [PATCH net-next v7 15/15] ice: support up to 256 VF queues Przemek Kitszel
2026-11-24 21:57   ` netdev-bot+sashiko
2026-11-26  9:43   ` Petr Oros [this message]
2026-11-23  8:53 ` [PATCH net-next v7 00/15] devlink, mlx5, iavf, ice: XLVF for iavf Matthieu Baerts
2026-11-23 15:03   ` Przemek Kitszel
2026-11-26  9:43 ` Petr Oros

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=20261126094321.40071-1-poros@redhat.com \
    --to=poros@redhat.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=anzaki@gmail.com \
    --cc=brett.creeley@amd.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jedrzej.jagielski@intel.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=mschmidt@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.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