netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] bnxt_en: Bug fixes.
@ 2021-01-11  9:26 Michael Chan
  2021-01-11  9:26 ` [PATCH net 1/2] bnxt_en: Improve stats context resource accounting with RDMA driver loaded Michael Chan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Chan @ 2021-01-11  9:26 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

This series has 2 fixes.  The first one fixes a resource accounting error
with the RDMA driver loaded and the second one fixes the firmware
flashing sequence after defragmentation.

Please queue the 1st one for -stable.  Thanks.

Michael Chan (1):
  bnxt_en: Improve stats context resource accounting with RDMA driver
    loaded.

Pavan Chebbi (1):
  bnxt_en: Clear DEFRAG flag in firmware message when retry flashing.

 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 3 ++-
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c     | 8 ++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

-- 
2.18.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/2] bnxt_en: Improve stats context resource accounting with RDMA driver loaded.
  2021-01-11  9:26 [PATCH net 0/2] bnxt_en: Bug fixes Michael Chan
@ 2021-01-11  9:26 ` Michael Chan
  2021-01-11  9:26 ` [PATCH net 2/2] bnxt_en: Clear DEFRAG flag in firmware message when retry flashing Michael Chan
  2021-01-13  4:10 ` [PATCH net 0/2] bnxt_en: Bug fixes patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Chan @ 2021-01-11  9:26 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

The function bnxt_get_ulp_stat_ctxs() does not count the stats contexts
used by the RDMA driver correctly when the RDMA driver is freeing the
MSIX vectors.  It assumes that if the RDMA driver is registered, the
additional stats contexts will be needed.  This is not true when the
RDMA driver is about to unregister and frees the MSIX vectors.

This slight error leads to over accouting of the stats contexts needed
after the RDMA driver has unloaded.  This will cause some firmware
warning and error messages in dmesg during subsequent config. changes
or ifdown/ifup.

Fix it by properly accouting for extra stats contexts only if the
RDMA driver is registered and MSIX vectors have been successfully
requested.

Fixes: c027c6b4e91f ("bnxt_en: get rid of num_stat_ctxs variable")
Reviewed-by: Yongping Zhang <yongping.zhang@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
index 8c8368c2f335..64dbbb04b043 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
@@ -222,8 +222,12 @@ int bnxt_get_ulp_msix_base(struct bnxt *bp)
 
 int bnxt_get_ulp_stat_ctxs(struct bnxt *bp)
 {
-	if (bnxt_ulp_registered(bp->edev, BNXT_ROCE_ULP))
-		return BNXT_MIN_ROCE_STAT_CTXS;
+	if (bnxt_ulp_registered(bp->edev, BNXT_ROCE_ULP)) {
+		struct bnxt_en_dev *edev = bp->edev;
+
+		if (edev->ulp_tbl[BNXT_ROCE_ULP].msix_requested)
+			return BNXT_MIN_ROCE_STAT_CTXS;
+	}
 
 	return 0;
 }
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net 2/2] bnxt_en: Clear DEFRAG flag in firmware message when retry flashing.
  2021-01-11  9:26 [PATCH net 0/2] bnxt_en: Bug fixes Michael Chan
  2021-01-11  9:26 ` [PATCH net 1/2] bnxt_en: Improve stats context resource accounting with RDMA driver loaded Michael Chan
@ 2021-01-11  9:26 ` Michael Chan
  2021-01-13  4:10 ` [PATCH net 0/2] bnxt_en: Bug fixes patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Chan @ 2021-01-11  9:26 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuba, gospo

From: Pavan Chebbi <pavan.chebbi@broadcom.com>

When the FW tells the driver to retry the INSTALL_UPDATE command after
it has cleared the NVM area, the driver is not clearing the previously
used ALLOWED_TO_DEFRAG flag. As a result the FW tries to defrag the NVM
area a second time in a loop and can fail the request.

Fixes: 1432c3f6a6ca ("bnxt_en: Retry installing FW package under NO_SPACE error condition.")
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 9ff79d5d14c4..2f8b193a772d 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -2532,7 +2532,7 @@ int bnxt_flash_package_from_fw_obj(struct net_device *dev, const struct firmware
 
 		if (rc && ((struct hwrm_err_output *)&resp)->cmd_err ==
 		    NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) {
-			install.flags |=
+			install.flags =
 				cpu_to_le16(NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG);
 
 			rc = _hwrm_send_message_silent(bp, &install,
@@ -2546,6 +2546,7 @@ int bnxt_flash_package_from_fw_obj(struct net_device *dev, const struct firmware
 				 * UPDATE directory and try the flash again
 				 */
 				defrag_attempted = true;
+				install.flags = 0;
 				rc = __bnxt_flash_nvram(bp->dev,
 							BNX_DIR_TYPE_UPDATE,
 							BNX_DIR_ORDINAL_FIRST,
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 0/2] bnxt_en: Bug fixes.
  2021-01-11  9:26 [PATCH net 0/2] bnxt_en: Bug fixes Michael Chan
  2021-01-11  9:26 ` [PATCH net 1/2] bnxt_en: Improve stats context resource accounting with RDMA driver loaded Michael Chan
  2021-01-11  9:26 ` [PATCH net 2/2] bnxt_en: Clear DEFRAG flag in firmware message when retry flashing Michael Chan
@ 2021-01-13  4:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-01-13  4:10 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev, kuba, gospo

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Mon, 11 Jan 2021 04:26:38 -0500 you wrote:
> This series has 2 fixes.  The first one fixes a resource accounting error
> with the RDMA driver loaded and the second one fixes the firmware
> flashing sequence after defragmentation.
> 
> Please queue the 1st one for -stable.  Thanks.
> 
> Michael Chan (1):
>   bnxt_en: Improve stats context resource accounting with RDMA driver
>     loaded.
> 
> [...]

Here is the summary with links:
  - [net,1/2] bnxt_en: Improve stats context resource accounting with RDMA driver loaded.
    https://git.kernel.org/netdev/net/c/869c4d5eb1e6
  - [net,2/2] bnxt_en: Clear DEFRAG flag in firmware message when retry flashing.
    https://git.kernel.org/netdev/net/c/687487751814

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-13  4:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11  9:26 [PATCH net 0/2] bnxt_en: Bug fixes Michael Chan
2021-01-11  9:26 ` [PATCH net 1/2] bnxt_en: Improve stats context resource accounting with RDMA driver loaded Michael Chan
2021-01-11  9:26 ` [PATCH net 2/2] bnxt_en: Clear DEFRAG flag in firmware message when retry flashing Michael Chan
2021-01-13  4:10 ` [PATCH net 0/2] bnxt_en: Bug fixes patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).