Skip to contentSkip to conversation

bnxt_en: Bug fixes

PATCH Applied Michael Chan 2 participants 5 messages Apr 5, 2024 – Apr 8, 2024

Subsystems (3)
lore
Share & tools
lore

Michael Chan

author maintainer
#0 lore raw

cover bnxt_en: Bug fixes

The first 2 patches fix 2 potential issues in the aux bus initialization and error recovery paths. The 3rd patch fixes a potential PTP TX timestamp issue during error recovery.

Pavan Chebbi (1):
bnxt_en: Reset PTP tx_avail after possible firmware reset

Vikas Gupta (2):
bnxt_en: Fix possible memory leak in bnxt_rdma_aux_device_init()
bnxt_en: Fix error recovery for RoCE ulp client

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 2 ++
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
Signature · 1 line
2.30.1
author maintainer
#1 lore raw

PATCH 1/3 bnxt_en: Fix possible memory leak in bnxt_rdma_aux_device_init()

From: Vikas Gupta <[email protected]>

If ulp = kzalloc() fails, the allocated edev will leak because it is not properly assigned and the cleanup path will not be able to free it. Fix it by assigning it properly immediately after allocation.

Fixes 303432211324 ("bnxt_en: Remove runtime interrupt vector allocation")
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +2 -1
index 93f9bd55020f..a5f9c9090a6b 100644
@@ -392,12 +392,13 @@ void bnxt_rdma_aux_device_init(struct bnxt *bp)
 	if (!edev)
 		goto aux_dev_uninit;
 
+	aux_priv->edev = edev;
+
 	ulp = kzalloc(sizeof(*ulp), GFP_KERNEL);
 	if (!ulp)
 		goto aux_dev_uninit;
 
 	edev->ulp_tbl = ulp;
-	aux_priv->edev = edev;
 	bp->edev = edev;
 	bnxt_set_edev_info(edev, bp);
 
Signature · 1 line
2.30.1
author maintainer
#2 lore raw

PATCH 2/3 bnxt_en: Fix error recovery for RoCE ulp client

In reply to Michael Chan

From: Vikas Gupta <[email protected]>

Since runtime MSIXs vector allocation/free has been removed, the L2 driver needs to repopulate the MSIX entries for the ulp client as the irq table may change during the recovery process.

Fixes 303432211324 ("bnxt_en: Remove runtime interrupt vector allocation")
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +3 -0
index a5f9c9090a6b..195c02dc0683 100644
@@ -210,6 +210,9 @@ void bnxt_ulp_start(struct bnxt *bp, int err)
 	if (err)
 		return;
 
+	if (edev->ulp_tbl->msix_requested)
+		bnxt_fill_msix_vecs(bp, edev->msix_entries);
+
 	if (aux_priv) {
 		struct auxiliary_device *adev;
 
Signature · 1 line
2.30.1
author maintainer
#3 lore raw

PATCH 3/3 bnxt_en: Reset PTP tx_avail after possible firmware reset

In reply to Michael Chan

From: Pavan Chebbi <[email protected]>

It is possible that during error recovery and firmware reset, there is a pending TX PTP packet waiting for the timestamp. We need to reset this condition so that after recovery, the tx_avail count for PTP is reset back to the initial value. Otherwise, we may not accept any PTP TX timestamps after recovery.

Fixes 118612d519d8 ("bnxt_en: Add PTP clock APIs, ioctls, and ethtool methods")
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -0
index 493b724848c8..57e61f963167 100644
@@ -11758,6 +11758,8 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
 	/* VF-reps may need to be re-opened after the PF is re-opened */
 	if (BNXT_PF(bp))
 		bnxt_vf_reps_open(bp);
+	if (bp->ptp_cfg)
+		atomic_set(&bp->ptp_cfg->tx_avail, BNXT_MAX_TX_TS);
 	bnxt_ptp_init_rtc(bp, true);
 	bnxt_ptp_cfg_tstamp_filters(bp);
 	bnxt_cfg_usr_fltrs(bp);
Signature · 1 line
2.30.1
#4 lore raw
In reply to Michael Chan
This series was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This series was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 8 lines · On Fri, 5 Apr 2024 16:55:10 -0700 you wrote:

The first 2 patches fix 2 potential issues in the aux bus initialization and error recovery paths. The 3rd patch fixes a potential PTP TX timestamp issue during error recovery.

Pavan Chebbi (1):
bnxt_en: Reset PTP tx_avail after possible firmware reset

[...]

Here is the summary with links:
- [net,1/3] bnxt_en: Fix possible memory leak in bnxt_rdma_aux_device_init()

    https://git.kernel.org/netdev/net/c/7ac10c7d728d
  - [net,2/3] bnxt_en: Fix error recovery for RoCE ulp client
    https://git.kernel.org/netdev/net/c/b5ea7d33ba2a
  - [net,3/3] bnxt_en: Reset PTP tx_avail after possible firmware reset
    https://git.kernel.org/netdev/net/c/faa12ca24558

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html