Commit 16517bc9 authored by Kalesh AP's avatar Kalesh AP Committed by Jakub Kicinski
Browse files

bnxt_en: Check return value of bnxt_hwrm_vnic_cfg



When the bnxt RDMA driver is loaded, it calls bnxt_register_dev().
As part of this, driver sends HWRM_VNIC_CFG firmware command
to configure the VNIC to operate in dual VNIC mode. Currently
the driver ignores the result of this firmware command. The RDMA
driver must know the result since it affects its functioning.

Check return value of call to bnxt_hwrm_vnic_cfg() in
bnxt_register_dev() and return failure on error.

Fixes: a588e458 ("bnxt_en: Add interface to support RDMA driver.")
Reviewed-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
Link: https://patch.msgid.link/20260504083611.1383776-4-pavan.chebbi@broadcom.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 54c28fab
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -175,8 +175,14 @@ int bnxt_register_dev(struct bnxt_en_dev *edev,
	ulp->handle = handle;
	rcu_assign_pointer(ulp->ulp_ops, ulp_ops);

	if (test_bit(BNXT_STATE_OPEN, &bp->state))
		bnxt_hwrm_vnic_cfg(bp, &bp->vnic_info[BNXT_VNIC_DEFAULT]);
	if (test_bit(BNXT_STATE_OPEN, &bp->state)) {
		rc = bnxt_hwrm_vnic_cfg(bp, &bp->vnic_info[BNXT_VNIC_DEFAULT]);
		if (rc) {
			netdev_err(dev, "Failed to configure dual VNIC mode\n");
			RCU_INIT_POINTER(ulp->ulp_ops, NULL);
			goto exit;
		}
	}

	edev->ulp_tbl->msix_requested = bnxt_get_ulp_msix_num(bp);