* [PATCH net v2 0/2][pull request] ice bug fixes
@ 2022-04-04 18:35 Tony Nguyen
2022-04-04 18:35 ` [PATCH net v2 1/2] ice: Set txq_teid to ICE_INVAL_TEID on ring creation Tony Nguyen
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tony Nguyen @ 2022-04-04 18:35 UTC (permalink / raw)
To: davem, kuba, pabeni; +Cc: Tony Nguyen, netdev, alice.michael
Alice Michael says:
There were a couple of bugs that have been found and
fixed by Anatolii in the ice driver. First he fixed
a bug on ring creation by setting the default value
for the teid. Anatolli also fixed a bug with deleting
queues in ice_vc_dis_qs_msg based on their enablement.
---
v2: Remove empty lines between tags
The following are changes since commit 458f5d92df4807e2a7c803ed928369129996bf96:
sfc: Do not free an empty page_ring
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE
Anatolii Gerasymenko (2):
ice: Set txq_teid to ICE_INVAL_TEID on ring creation
ice: Do not skip not enabled queues in ice_vc_dis_qs_msg
drivers/net/ethernet/intel/ice/ice_lib.c | 1 +
drivers/net/ethernet/intel/ice/ice_virtchnl.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
--
2.31.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net v2 1/2] ice: Set txq_teid to ICE_INVAL_TEID on ring creation
2022-04-04 18:35 [PATCH net v2 0/2][pull request] ice bug fixes Tony Nguyen
@ 2022-04-04 18:35 ` Tony Nguyen
2022-04-04 18:35 ` [PATCH net v2 2/2] ice: Do not skip not enabled queues in ice_vc_dis_qs_msg Tony Nguyen
2022-04-05 11:10 ` [PATCH net v2 0/2][pull request] ice bug fixes patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Tony Nguyen @ 2022-04-04 18:35 UTC (permalink / raw)
To: davem, kuba, pabeni
Cc: Anatolii Gerasymenko, netdev, anthony.l.nguyen,
Maciej Fijalkowski, Konrad Jankowski, Alice Michael
From: Anatolii Gerasymenko <anatolii.gerasymenko@intel.com>
When VF is freshly created, but not brought up, ring->txq_teid
value is by default set to 0.
But 0 is a valid TEID. On some platforms the Root Node of
Tx scheduler has a TEID = 0. This can cause issues as shown below.
The proper way is to set ring->txq_teid to ICE_INVAL_TEID (0xFFFFFFFF).
Testing Hints:
echo 1 > /sys/class/net/ens785f0/device/sriov_numvfs
ip link set dev ens785f0v0 up
ip link set dev ens785f0v0 down
If we have freshly created VF and quickly turn it on and off, so there
would be no time to reach VIRTCHNL_OP_CONFIG_VSI_QUEUES stage, then
VIRTCHNL_OP_DISABLE_QUEUES stage will fail with error:
[ 639.531454] disable queue 89 failed 14
[ 639.532233] Failed to disable LAN Tx queues, error: ICE_ERR_AQ_ERROR
[ 639.533107] ice 0000:02:00.0: Failed to stop Tx ring 0 on VSI 5
The reason for the fail is that we are trying to send AQ command to
delete queue 89, which has never been created and receive an "invalid
argument" error from firmware.
As this queue has never been created, it's teid and ring->txq_teid
have default value 0.
ice_dis_vsi_txq has a check against non-existent queues:
node = ice_sched_find_node_by_teid(pi->root, q_teids[i]);
if (!node)
continue;
But on some platforms the Root Node of Tx scheduler has a teid = 0.
Hence, ice_sched_find_node_by_teid finds a node with teid = 0 (it is
pi->root), and we go further to submit an erroneous request to firmware.
Fixes: 37bb83901286 ("ice: Move common functions out of ice_main.c part 7/7")
Signed-off-by: Anatolii Gerasymenko <anatolii.gerasymenko@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Alice Michael <alice.michael@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_lib.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 6d6233204388..2774cbd5b12a 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -1480,6 +1480,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi)
ring->tx_tstamps = &pf->ptp.port.tx;
ring->dev = dev;
ring->count = vsi->num_tx_desc;
+ ring->txq_teid = ICE_INVAL_TEID;
if (dvm_ena)
ring->flags |= ICE_TX_FLAGS_RING_VLAN_L2TAG2;
else
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net v2 2/2] ice: Do not skip not enabled queues in ice_vc_dis_qs_msg
2022-04-04 18:35 [PATCH net v2 0/2][pull request] ice bug fixes Tony Nguyen
2022-04-04 18:35 ` [PATCH net v2 1/2] ice: Set txq_teid to ICE_INVAL_TEID on ring creation Tony Nguyen
@ 2022-04-04 18:35 ` Tony Nguyen
2022-04-05 11:10 ` [PATCH net v2 0/2][pull request] ice bug fixes patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Tony Nguyen @ 2022-04-04 18:35 UTC (permalink / raw)
To: davem, kuba, pabeni
Cc: Anatolii Gerasymenko, netdev, anthony.l.nguyen, Konrad Jankowski,
Alice Michael
From: Anatolii Gerasymenko <anatolii.gerasymenko@intel.com>
Disable check for queue being enabled in ice_vc_dis_qs_msg, because
there could be a case when queues were created, but were not enabled.
We still need to delete those queues.
Normal workflow for VF looks like:
Enable path:
VIRTCHNL_OP_ADD_ETH_ADDR (opcode 10)
VIRTCHNL_OP_CONFIG_VSI_QUEUES (opcode 6)
VIRTCHNL_OP_ENABLE_QUEUES (opcode 8)
Disable path:
VIRTCHNL_OP_DISABLE_QUEUES (opcode 9)
VIRTCHNL_OP_DEL_ETH_ADDR (opcode 11)
The issue appears only in stress conditions when VF is enabled and
disabled very fast.
Eventually there will be a case, when queues are created by
VIRTCHNL_OP_CONFIG_VSI_QUEUES, but are not enabled by
VIRTCHNL_OP_ENABLE_QUEUES.
In turn, these queues are not deleted by VIRTCHNL_OP_DISABLE_QUEUES,
because there is a check whether queues are enabled in
ice_vc_dis_qs_msg.
When we bring up the VF again, we will see the "Failed to set LAN Tx queue
context" error during VIRTCHNL_OP_CONFIG_VSI_QUEUES step. This
happens because old 16 queues were not deleted and VF requests to create
16 more, but ice_sched_get_free_qparent in ice_ena_vsi_txq would fail to
find a parent node for first newly requested queue (because all nodes
are allocated to 16 old queues).
Testing Hints:
Just enable and disable VF fast enough, so it would be disabled before
reaching VIRTCHNL_OP_ENABLE_QUEUES.
while true; do
ip link set dev ens785f0v0 up
sleep 0.065 # adjust delay value for you machine
ip link set dev ens785f0v0 down
done
Fixes: 77ca27c41705 ("ice: add support for virtchnl_queue_select.[tx|rx]_queues bitmap")
Signed-off-by: Anatolii Gerasymenko <anatolii.gerasymenko@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Alice Michael <alice.michael@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_virtchnl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
index 3f1a63815bac..69ff4b929772 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
@@ -1358,9 +1358,9 @@ static int ice_vc_dis_qs_msg(struct ice_vf *vf, u8 *msg)
goto error_param;
}
- /* Skip queue if not enabled */
if (!test_bit(vf_q_id, vf->txq_ena))
- continue;
+ dev_dbg(ice_pf_to_dev(vsi->back), "Queue %u on VSI %u is not enabled, but stopping it anyway\n",
+ vf_q_id, vsi->vsi_num);
ice_fill_txq_meta(vsi, ring, &txq_meta);
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net v2 0/2][pull request] ice bug fixes
2022-04-04 18:35 [PATCH net v2 0/2][pull request] ice bug fixes Tony Nguyen
2022-04-04 18:35 ` [PATCH net v2 1/2] ice: Set txq_teid to ICE_INVAL_TEID on ring creation Tony Nguyen
2022-04-04 18:35 ` [PATCH net v2 2/2] ice: Do not skip not enabled queues in ice_vc_dis_qs_msg Tony Nguyen
@ 2022-04-05 11:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-05 11:10 UTC (permalink / raw)
To: Tony Nguyen; +Cc: davem, kuba, pabeni, netdev, alice.michael
Hello:
This series was applied to netdev/net.git (master)
by Paolo Abeni <pabeni@redhat.com>:
On Mon, 4 Apr 2022 11:35:46 -0700 you wrote:
> Alice Michael says:
>
> There were a couple of bugs that have been found and
> fixed by Anatolii in the ice driver. First he fixed
> a bug on ring creation by setting the default value
> for the teid. Anatolli also fixed a bug with deleting
> queues in ice_vc_dis_qs_msg based on their enablement.
>
> [...]
Here is the summary with links:
- [net,v2,1/2] ice: Set txq_teid to ICE_INVAL_TEID on ring creation
https://git.kernel.org/netdev/net/c/ccfee1822042
- [net,v2,2/2] ice: Do not skip not enabled queues in ice_vc_dis_qs_msg
https://git.kernel.org/netdev/net/c/05ef6813b234
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-05 12:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-04 18:35 [PATCH net v2 0/2][pull request] ice bug fixes Tony Nguyen
2022-04-04 18:35 ` [PATCH net v2 1/2] ice: Set txq_teid to ICE_INVAL_TEID on ring creation Tony Nguyen
2022-04-04 18:35 ` [PATCH net v2 2/2] ice: Do not skip not enabled queues in ice_vc_dis_qs_msg Tony Nguyen
2022-04-05 11:10 ` [PATCH net v2 0/2][pull request] ice bug fixes patchwork-bot+netdevbpf
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).