Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nguyen, Anthony L <anthony.l.nguyen@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH net] ice: Fix not stopping Tx queues for VFs
Date: Thu, 9 Sep 2021 21:16:51 +0000	[thread overview]
Message-ID: <f2953310f50a0c681643a71d2c80ac2a611388bb.camel@intel.com> (raw)
In-Reply-To: <20210909192709.26269-1-brett.creeley@intel.com>

On Thu, 2021-09-09 at 12:27 -0700, Brett Creeley wrote:
> When a VF is removed and/or reset its Tx queues need to be
> stopped from the PF. This is done by calling the ice_dis_vf_qs()
> function, which calls ice_vsi_stop_lan_tx_rings(). Currently
> ice_dis_vf_qs() is protected by the VF state bit ICE_VF_STATE_QS_ENA.
> Unfortunately, this is causing the Tx queues to not be disabled in
> some
> cases and when the VF tries to re-enable/reconfigure its Tx queues
> over
> virtchnl the op is failing. This is because a VF can be reset and/or
> removed before the ICE_VF_STATE_QS_ENA bit is set, but the Tx queues
> were already configured via ice_vsi_cfg_single_txq() in the
> VIRTCHNL_OP_CONFIG_VSI_QUEUES op. However, the ICE_VF_STATE_QS_ENA
> bit
> is set on a successful VIRTCHNL_OP_ENABLE_QUEUES, which will always
> happen after the VIRTCHNL_OP_CONFIG_VSI_QUEUES op.
> 
> This was causing the following error message when loading the ice
> driver, creating VFs, and modifying VF trust in an endless loop:
> 
> [35274.192484] ice 0000:88:00.0: Failed to set LAN Tx queue context,
> error: ICE_ERR_PARAM
> [35274.193074] ice 0000:88:00.0: VF 0 failed opcode 6, retval: -5
> [35274.193640] iavf 0000:88:01.0: PF returned error -5
> (IAVF_ERR_PARAM) to our request 6
> 
> Fix this by always calling ice_dis_vf_qs() and silencing the error
> message in ice_vsi_stop_tx_ring() since the calling code ignores the
> return anyway. Also, all other places that call
> ice_vsi_stop_tx_ring()
> catch the error, so this doesn't affect those flows since there was
> no
> change to the values the function returns.
> 
> Other solutions were considered (i.e. tracking which VF queues had
> been
> "started/configured" in VIRTCHNL_OP_CONFIG_VSI_QUEUES, but it seemed
> more complicated than it was worth. This solution also brings in the
> chance for other unexpected conditions due to invalid state bit
> checks.
> So, the proposed solution seemed like the best option since there is
> no
> harm in failing to stop Tx queues that were never started.
> 
> This issue can be seen using the following commands:
> 
> for i in {0..50}; do
>         rmmod ice
>         modprobe ice
> 
>         sleep 1
> 
>         echo 1 > /sys/class/net/ens785f0/device/sriov_numvfs
>         echo 1 > /sys/class/net/ens785f1/device/sriov_numvfs
> 
>         ip link set ens785f1 vf 0 trust on
>         ip link set ens785f0 vf 0 trust on
> 
>         sleep 2
> 
>         echo 0 > /sys/class/net/ens785f0/device/sriov_numvfs
>         echo 0 > /sys/class/net/ens785f1/device/sriov_numvfs
>         sleep 1
>         echo 1 > /sys/class/net/ens785f0/device/sriov_numvfs
>         echo 1 > /sys/class/net/ens785f1/device/sriov_numvfs
> 
>         ip link set ens785f1 vf 0 trust on
>         ip link set ens785f0 vf 0 trust on
> done
> 
> Fixes: 77ca27c ("ice: add support for
> virtchnl_queue_select.[tx|rx]_queues bitmap")

The Fixes tag needs a little work:

Fixes tag: Fixes: 77ca27c ("ice: add support for
virtchnl_queue_select.[tx|rx]_queues bitmap")
	Has these problem(s):
		- SHA1 should be at least 12 digits long
		  Can be fixed by setting core.abbrev to 12 (or more) or (for
git v2.11
		  or later) just making sure it is not set (or set to "auto").


> Signed-off-by: Brett Creeley <brett.creeley@intel.com>

      parent reply	other threads:[~2021-09-09 21:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 19:27 [Intel-wired-lan] [PATCH net] ice: Fix not stopping Tx queues for VFs Brett Creeley
2021-09-09 19:27 ` [Intel-wired-lan] [PATCH net] ice: Fix race conditions between virtchnl handling and VF ndo ops Brett Creeley
2021-09-09 21:16 ` Nguyen, Anthony L [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=f2953310f50a0c681643a71d2c80ac2a611388bb.camel@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@osuosl.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