]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bnxt_en: Check return value of bnxt_hwrm_vnic_cfg
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Mon, 4 May 2026 08:36:10 +0000 (14:06 +0530)
committerJakub Kicinski <kuba@kernel.org>
Wed, 6 May 2026 00:36:14 +0000 (17:36 -0700)
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: a588e4580a7e ("bnxt_en: Add interface to support RDMA driver.")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Link: https://patch.msgid.link/20260504083611.1383776-4-pavan.chebbi@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c

index 052bf69cfa4cddf5f8d251b47c7f940cc4ebe902..5c751933da6a9d9852f08cd54a50f1bf98e5d56f 100644 (file)
@@ -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);