From: Vasundhara Volam Date: Fri, 30 Aug 2019 03:54:51 +0000 (-0400) Subject: bnxt_en: Register buffers for VFs before reserving resources. X-Git-Tag: v5.4-rc1~131^2~115^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=91b9be487001d344a39c453ade6cdbd125e06208;p=thirdparty%2Fkernel%2Flinux.git bnxt_en: Register buffers for VFs before reserving resources. When VFs need to be reconfigured dynamically after firmwware reset, the configuration sequence on the PF needs to be changed to register the VF buffers first. Otherwise, some VF firmware commands may not succeed as there may not be PF buffers ready for the re-directed firmware commands. This sequencing did not matter much before when we only supported the normal bring-up of VFs. Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c index 7506d2025dbcc..ac890ca9feb14 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c @@ -671,6 +671,11 @@ int bnxt_cfg_hw_sriov(struct bnxt *bp, int *num_vfs) { int rc; + /* Register buffers for VFs */ + rc = bnxt_hwrm_func_buf_rgtr(bp); + if (rc) + return rc; + /* Reserve resources for VFs */ rc = bnxt_func_cfg(bp, *num_vfs); if (rc != *num_vfs) { @@ -684,11 +689,6 @@ int bnxt_cfg_hw_sriov(struct bnxt *bp, int *num_vfs) *num_vfs = rc; } - /* Register buffers for VFs */ - rc = bnxt_hwrm_func_buf_rgtr(bp); - if (rc) - return rc; - bnxt_ulp_sriov_cfg(bp, *num_vfs); return 0; }