[dpdk-dev] [PATCH 12/17] net/bnxt: check for invalid VNIC ID in vnic tpa cfg

Ajit Khaparde ajit.khaparde at broadcom.com
Tue Sep 3 04:18:56 CEST 2019


From: Somnath Kotur <somnath.kotur at broadcom.com>

If driver init/probe fails as part of cleanup/rollback, we may end
up invoking this HWRM cmd even on an invalid vNIC which will unecessarily
log an error message as the cmd will fail.
Check for invalid ID before issuing the HWRM cmd

Signed-off-by: Somnath Kotur <somnath.kotur at broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta at broadcom.com>
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil at broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a033e2d1e..227d893da 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1958,6 +1958,11 @@ int bnxt_hwrm_vnic_tpa_cfg(struct bnxt *bp,
 		return -ENOTSUP;
 	}
 
+	if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
+		PMD_DRV_LOG(DEBUG, "Invalid vNIC ID\n");
+		return 0;
+	}
+
 	HWRM_PREP(req, VNIC_TPA_CFG, BNXT_USE_CHIMP_MB);
 
 	if (enable) {
-- 
2.20.1 (Apple Git-117)



More information about the dev mailing list