Skip to contentSkip to conversation

bnxt_en: Bug fixes

PATCH Applied Pavan Chebbi 3 participants 7 messages May 4 – May 6

Subsystems (3)
lore
Share & tools
lore

Pavan Chebbi

author maintainer
#0 lore raw

cover bnxt_en: Bug fixes

This patchset adds the following fixes for bnxt:

Patch #1 fixes DPC AER handling to make it more reliable

Patch #2 fixes incorrect capping bp->max_tpa based on what the FW supports

Patch #3 fixes ignoring of VNIC configuration result when RDMA driver is loading

Patch #4 fixes logic to make phase adjustment on the PPS OUT signal

Kalesh AP (1):
bnxt_en: Check return value of bnxt_hwrm_vnic_cfg

Michael Chan (2):
bnxt_en: Delay for 5 seconds after AER DPC for all chips
bnxt_en: Set bp->max_tpa according to what the FW supports

Pavan Chebbi (1):
bnxt_en: Use absolute target ns from ptp_clock_request

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 16 +++++++---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 29 ++++---------------
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 10 +++++--
 3 files changed, 25 insertions(+), 30 deletions(-)
Signature · 1 line
2.52.0
author maintainer
#1 lore raw

PATCH 1/4 bnxt_en: Delay for 5 seconds after AER DPC for all chips

From: Michael Chan <[email protected]>

The FW on all chips is requiring a 5-second delay after Downstream Port Containment (DPC) AER. The previously added 900 msec delay was not long enough in all cases because the chip's CRS (Configuration Request Retry Status) mechanism is not always reliable.

Fixes d5ab32e9b02d ("bnxt_en: Add delay to handle Downstream Port Containment (DPC) AER")
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +8 -3
index 8c55874f44ca..3db951d0c690 100644
@@ -17360,9 +17360,14 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
 
 	netdev_info(bp->dev, "PCI Slot Reset\n");
 
-	if (!(bp->flags & BNXT_FLAG_CHIP_P5_PLUS) &&
-	    test_bit(BNXT_STATE_PCI_CHANNEL_IO_FROZEN, &bp->state))
-		msleep(900);
+	if (test_bit(BNXT_STATE_PCI_CHANNEL_IO_FROZEN, &bp->state)) {
+		/* After DPC, the chip should return CRS when the vendor ID
+		 * config register is read until it is ready.  On all chips,
+		 * this is not happening reliably so add a 5-second delay as a
+		 * workaround.
+		 */
+		msleep(5000);
+	}
 
 	netdev_lock(netdev);
 
Signature · 1 line
2.52.0
author maintainer
#2 lore raw

PATCH 2/4 bnxt_en: Set bp->max_tpa according to what the FW supports

In reply to Pavan Chebbi

From: Michael Chan <[email protected]>

Fix the logic to set bp->max_tpa no higher than what the FW supports. On P5 chips, some older FW sets max_tpa very low so we override it to prevent performance regressions with the older FW.

Fixes 79632e9ba386 ("bnxt_en: Expand bnxt_tpa_info struct to support 57500 chips.")
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +4 -1
index 3db951d0c690..008c34cff7b4 100644
@@ -3825,7 +3825,10 @@ static int bnxt_alloc_tpa_info(struct bnxt *bp)
 	if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) {
 		if (!bp->max_tpa_v2)
 			return 0;
-		bp->max_tpa = max_t(u16, bp->max_tpa_v2, MAX_TPA_P5);
+		bp->max_tpa = min_t(u16, bp->max_tpa_v2, MAX_TPA_P5);
+		/* Older P5 FW sets max_tpa_v2 low by mistake except NPAR */
+		if (bp->max_tpa <= 32 && BNXT_CHIP_P5(bp) && !BNXT_NPAR(bp))
+			bp->max_tpa = MAX_TPA_P5;
 	}
 
 	for (i = 0; i < bp->rx_nr_rings; i++) {
Signature · 1 line
2.52.0
author maintainer
#3 lore raw

PATCH 3/4 bnxt_en: Check return value of bnxt_hwrm_vnic_cfg

In reply to Pavan Chebbi

From: Kalesh AP <[email protected]>

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.")
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +8 -2
index 052bf69cfa4c..5c751933da6a 100644
@@ -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);
 
Signature · 1 line
2.52.0
author maintainer
#4 lore raw

PATCH 4/4 bnxt_en: Use absolute target ns from ptp_clock_request

In reply to Pavan Chebbi

There is no need to calculate the target PHC cycles required to make phase adjustment on the PPS OUT signal. This is because the application supplies absolute n_sec value in the future and is already the actual desired target value.

Remove the unnecessary code.

Fixes 9e518f25802c ("bnxt_en: 1PPS functions to configure TSIO pins")
Cc Richard Cochran <[email protected]>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 29 ++++---------------
 1 file changed, 5 insertions(+), 24 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c +5 -24
index 53f336db4fcc..5d41dc1bc782 100644
@@ -419,31 +419,13 @@ void bnxt_ptp_reapply_pps(struct bnxt *bp)
 	}
 }
 
-static int bnxt_get_target_cycles(struct bnxt_ptp_cfg *ptp, u64 target_ns,
-				  u64 *cycles_delta)
-{
-	u64 cycles_now;
-	u64 nsec_now, nsec_delta;
-	int rc;
-
-	rc = bnxt_refclk_read(ptp->bp, NULL, &cycles_now);
-	if (rc)
-		return rc;
-
-	nsec_now = bnxt_timecounter_cyc2time(ptp, cycles_now);
-
-	nsec_delta = target_ns - nsec_now;
-	*cycles_delta = div64_u64(nsec_delta << ptp->cc.shift, ptp->cc.mult);
-	return 0;
-}
-
 static int bnxt_ptp_perout_cfg(struct bnxt_ptp_cfg *ptp,
 			       struct ptp_clock_request *rq)
 {
 	struct hwrm_func_ptp_cfg_input *req;
 	struct bnxt *bp = ptp->bp;
 	struct timespec64 ts;
-	u64 target_ns, delta;
+	u64 target_ns;
 	u16 enables;
 	int rc;
 
@@ -451,10 +433,6 @@ static int bnxt_ptp_perout_cfg(struct bnxt_ptp_cfg *ptp,
 	ts.tv_nsec = rq->perout.start.nsec;
 	target_ns = timespec64_to_ns(&ts);
 
-	rc = bnxt_get_target_cycles(ptp, target_ns, &delta);
-	if (rc)
-		return rc;
-
 	rc = hwrm_req_init(bp, req, HWRM_FUNC_PTP_CFG);
 	if (rc)
 		return rc;
@@ -468,7 +446,10 @@ static int bnxt_ptp_perout_cfg(struct bnxt_ptp_cfg *ptp,
 	req->ptp_freq_adj_dll_phase = 0;
 	req->ptp_freq_adj_ext_period = cpu_to_le32(NSEC_PER_SEC);
 	req->ptp_freq_adj_ext_up = 0;
-	req->ptp_freq_adj_ext_phase_lower = cpu_to_le32(delta);
+	req->ptp_freq_adj_ext_phase_lower =
+		cpu_to_le32(lower_32_bits(target_ns));
+	req->ptp_freq_adj_ext_phase_upper =
+		cpu_to_le32(upper_32_bits(target_ns));
 
 	return hwrm_req_send(bp, req);
 }
Signature · 1 line
2.52.0
Reviewed-by Tested-by on v1 4/4
#5 lore raw

Re: [PATCH net 4/4] bnxt_en: Use absolute target ns from ptp_clock_request

Quoted 7 lines · Pavan Chebbi

There is no need to calculate the target PHC cycles required to make phase adjustment on the PPS OUT signal. This is because the application supplies absolute n_sec value in the future and is already the actual desired target value.

Remove the unnecessary code.

Quoted 8 lines
Fixes 9e518f25802c ("bnxt_en: 1PPS functions to configure TSIO pins")
Cc Richard Cochran <[email protected]>
---
  drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 29 ++++---------------
  1 file changed, 5 insertions(+), 24 deletions(-)
#6 lore raw
In reply to Pavan Chebbi
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 8 lines · On Mon, 4 May 2026 14:06:07 +0530 you wrote:

This patchset adds the following fixes for bnxt:

Patch #1 fixes DPC AER handling to make it more reliable

Patch #2 fixes incorrect capping bp->max_tpa based on what the FW supports

[...]

Here is the summary with links:
- [net,1/4] bnxt_en: Delay for 5 seconds after AER DPC for all chips

    https://git.kernel.org/netdev/net/c/07f44433355f
  - [net,2/4] bnxt_en: Set bp->max_tpa according to what the FW supports
    https://git.kernel.org/netdev/net/c/54c28fab2fa5
  - [net,3/4] bnxt_en: Check return value of bnxt_hwrm_vnic_cfg
    https://git.kernel.org/netdev/net/c/16517bc98a56
  - [net,4/4] bnxt_en: Use absolute target ns from ptp_clock_request
    https://git.kernel.org/netdev/net/c/bd279e104e5f

You are awesome, thank you!

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