Skip to contentSkip to conversation

net/bnxt: don't fail rte_pmd_bnxt_set_all_queues_drop_en if no VF's

PATCH New Stephen Hemminger 1 participant 1 message Nov 25, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bnxt: don't fail rte_pmd_bnxt_set_all_queues_drop_en if no VF's

The function should return success if called with no active VF's. It is OK to call this function if the desired outcome is to change the flag for PF's even if there are no VF's.

Original code may have worked by accidental uninitialized variable; then this bug was introduced by change to fix compilation warning.

Fixes 4a671fdea9f4 ("net/bnxt: fix compilation with -Og")
---
 drivers/net/bnxt/rte_pmd_bnxt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/bnxt/rte_pmd_bnxt.c +2 -1
index d67db46c65eb..6a236ff4803b 100644
@@ -85,7 +85,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on)
 	struct rte_eth_dev *eth_dev;
 	struct bnxt *bp;
 	uint32_t i;
-	int rc = -EINVAL;
+	int rc;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
 
@@ -118,6 +118,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on)
 	}
 
 	/* Stall all active VFs */
+	rc = 0;
 	for (i = 0; i < bp->pf->active_vfs; i++) {
 		rc = bnxt_hwrm_func_vf_vnic_query_and_config(bp, i,
 				rte_pmd_bnxt_set_all_queues_drop_en_cb, &on,
Signature · 1 line
2.27.0