Skip to contentSkip to conversation

i40e: Fix waiting for queues of all VSIs to be disabled

PATCH In review Ivan Vecera 4 participants 4 messages Nov 8, 2023 – Feb 9, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i40e: Fix waiting for queues of all VSIs to be disabled

The function i40e_pf_wait_queues_disabled() iterates all PF's VSIs up to 'pf->hw.func_caps.num_vsis' but this is incorrect because the real number of VSIs can be up to 'pf->num_alloc_vsi' that can be higher. Fix this loop.

Fixes 69129dc39fac ("i40e: Modify Tx disable wait flow in case of DCB reconfiguration")
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
index 6a2907674583..de19d753ba83 100644
@@ -5340,7 +5340,7 @@ static int i40e_pf_wait_queues_disabled(struct i40e_pf *pf)
 {
 	int v, ret = 0;
 
-	for (v = 0; v < pf->hw.func_caps.num_vsis; v++) {
+	for (v = 0; v < pf->num_alloc_vsi; v++) {
 		if (pf->vsi[v]) {
 			ret = i40e_vsi_wait_queues_disabled(pf->vsi[v]);
 			if (ret)
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Ivan Vecera

The function i40e_pf_wait_queues_disabled() iterates all PF's VSIs up to 'pf->hw.func_caps.num_vsis' but this is incorrect because the real number of VSIs can be up to 'pf->num_alloc_vsi' that can be higher. Fix this loop.

This confused me at first, but as described in i40e_probe:

Quoted 9 lines
        /* The number of VSIs reported by the FW is the minimum guaranteed
         * to us; HW supports far more and we share the remaining pool with
         * the other PFs. We allocate space for more than the guarantee with
         * the understanding that we might not get them all later.
         */
        if (pf->hw.func_caps.num_vsis < I40E_MIN_VSI_ALLOC)
                pf->num_alloc_vsi = I40E_MIN_VSI_ALLOC;
        else
                pf->num_alloc_vsi = pf->hw.func_caps.num_vsis;

The func_caps.num_vsis is really a minimum guaranteed amount and a single PF could get more from the shared pool.

Quoted 20 lines
Fixes 69129dc39fac ("i40e: Modify Tx disable wait flow in case of DCB reconfiguration")
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
index 6a2907674583..de19d753ba83 100644
@@ -5340,7 +5340,7 @@ static int i40e_pf_wait_queues_disabled(struct i40e_pf *pf)
 {
 	int v, ret = 0;
 
-	for (v = 0; v < pf->hw.func_caps.num_vsis; v++) {
+	for (v = 0; v < pf->num_alloc_vsi; v++) {
 		if (pf->vsi[v]) {
 			ret = i40e_vsi_wait_queues_disabled(pf->vsi[v]);
 			if (ret)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Ivan Vecera
Quoted 7 lines · Ivan Vecera

The function i40e_pf_wait_queues_disabled() iterates all PF's VSIs up to 'pf->hw.func_caps.num_vsis' but this is incorrect because the real number of VSIs can be up to 'pf->num_alloc_vsi' that can be higher. Fix this loop.

Fixes 69129dc39fac ("i40e: Modify Tx disable wait flow in case of DCB reconfiguration")

Thanks Ivan!

Quoted 17 lines
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
index 6a2907674583..de19d753ba83 100644
@@ -5340,7 +5340,7 @@ static int i40e_pf_wait_queues_disabled(struct i40e_pf *pf)
 {
 	int v, ret = 0;
 
-	for (v = 0; v < pf->hw.func_caps.num_vsis; v++) {
+	for (v = 0; v < pf->num_alloc_vsi; v++) {
 		if (pf->vsi[v]) {
 			ret = i40e_vsi_wait_queues_disabled(pf->vsi[v]);
 			if (ret)
Tested-by on v1 1/1
#3 lore raw
In reply to Ivan Vecera
Quoted 12 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Ivan Vecera
Sent: Wednesday, November 8, 2023 9:31 PM
To: [email protected]
Cc: Drewek, Wojciech <[email protected]>; open list:NETWORKING DRIVERS <[email protected]>; Brandeburg, Jesse <[email protected]>; Neerav Parikh <[email protected]>; open list <[email protected]>; Eric Dumazet <[email protected]>; Nguyen, Anthony L <[email protected]>; Jeff Kirsher <[email protected]>; Keller, Jacob E <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net] i40e: Fix waiting for queues of all VSIs to be disabled

The function i40e_pf_wait_queues_disabled() iterates all PF's VSIs up to 'pf->hw.func_caps.num_vsis' but this is incorrect because the real number of VSIs can be up to 'pf->num_alloc_vsi' that can be higher. Fix this loop.

Quoted 6 lines
Fixes 69129dc39fac ("i40e: Modify Tx disable wait flow in case of DCB reconfiguration")
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)