Skip to content

Commit 16517bc

Browse files
kaleshap86kuba-moo
authored andcommitted
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: a588e45 ("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>
1 parent 54c28fa commit 16517bc

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,14 @@ int bnxt_register_dev(struct bnxt_en_dev *edev,
175175
ulp->handle = handle;
176176
rcu_assign_pointer(ulp->ulp_ops, ulp_ops);
177177

178-
if (test_bit(BNXT_STATE_OPEN, &bp->state))
179-
bnxt_hwrm_vnic_cfg(bp, &bp->vnic_info[BNXT_VNIC_DEFAULT]);
178+
if (test_bit(BNXT_STATE_OPEN, &bp->state)) {
179+
rc = bnxt_hwrm_vnic_cfg(bp, &bp->vnic_info[BNXT_VNIC_DEFAULT]);
180+
if (rc) {
181+
netdev_err(dev, "Failed to configure dual VNIC mode\n");
182+
RCU_INIT_POINTER(ulp->ulp_ops, NULL);
183+
goto exit;
184+
}
185+
}
180186

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

0 commit comments

Comments
 (0)