[v2,13/20] net/bnxt: check for invalid VNIC ID in vnic tpa cfg
diff mbox series

Message ID 20191002232601.22715-14-ajit.khaparde@broadcom.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
  • bnxt patchset to improve rte flow support
Related show


Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Ajit Khaparde Oct. 2, 2019, 11:25 p.m. UTC
From: Somnath Kotur <somnath.kotur@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@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
 drivers/net/bnxt/bnxt_hwrm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff mbox series

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 89697b83ac..e5f8fda9a3 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1965,6 +1965,11 @@  int bnxt_hwrm_vnic_tpa_cfg(struct bnxt *bp,
 	if (BNXT_CHIP_THOR(bp))
 		return 0;
+	if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
+		PMD_DRV_LOG(DEBUG, "Invalid vNIC ID\n");
+		return 0;
+	}
 	if (enable) {