From: Michael Chan <michael.chan@broadcom.com> Date: 2022-05-03 01:13:47
This patch series includes 3 fixes:
1. Fix an occasional VF open failure.
2. Fix a PTP spinlock usage before initialization
3. Fix unnecesary RX packet drops under high TX traffic load.
Michael Chan (2):
bnxt_en: Initiallize bp->ptp_lock first before using it
bnxt_en: Fix unnecessary dropping of RX packets
Somnath Kotur (1):
bnxt_en: Fix possible bnxt_open() failure caused by wrong RFS flag
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 13 ++++++++-----
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 15 +++++++--------
2 files changed, 15 insertions(+), 13 deletions(-)
--
2.18.1
From: Michael Chan <michael.chan@broadcom.com> Date: 2022-05-03 01:13:37
From: Somnath Kotur <redacted>
bnxt_open() can fail in this code path, especially on a VF when
it fails to reserve default rings:
bnxt_open()
__bnxt_open_nic()
bnxt_clear_int_mode()
bnxt_init_dflt_ring_mode()
RX rings would be set to 0 when we hit this error path.
It is possible for a subsequent bnxt_open() call to potentially succeed
with a code path like this:
bnxt_open()
bnxt_hwrm_if_change()
bnxt_fw_init_one()
bnxt_fw_init_one_p3()
bnxt_set_dflt_rfs()
bnxt_rfs_capable()
bnxt_hwrm_reserve_rings()
On older chips, RFS is capable if we can reserve the number of vnics that
is equal to RX rings + 1. But since RX rings is still set to 0 in this
code path, we may mistakenly think that RFS is supported for 0 RX rings.
Later, when the default RX rings are reserved and we try to enable
RFS, it would fail and cause bnxt_open() to fail unnecessarily.
We fix this in 2 places. bnxt_rfs_capable() will always return false if
RX rings is not yet set. bnxt_init_dflt_ring_mode() will call
bnxt_set_dflt_rfs() which will always clear the RFS flags if RFS is not
supported.
Fixes: 20d7d1c5c9b1 ("bnxt_en: reliably allocate IRQ table on reset to avoid crash")
Signed-off-by: Somnath Kotur <redacted>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
From: Michael Chan <michael.chan@broadcom.com> Date: 2022-05-03 01:13:54
bnxt_ptp_init() calls bnxt_ptp_init_rtc() which will acquire the ptp_lock
spinlock. The spinlock is not initialized until later. Move the
bnxt_ptp_init_rtc() call after the spinlock is initialized.
Fixes: 24ac1ecd5240 ("bnxt_en: Add driver support to use Real Time Counter for PTP")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Saravanan Vajravel <redacted>
Reviewed-by: Andy Gospodarek <redacted>
Reviewed-by: Somnath Kotur <redacted>
Reviewed-by: Damodharam Ammepalli <redacted>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
From: Michael Chan <michael.chan@broadcom.com> Date: 2022-05-03 01:13:56
In bnxt_poll_p5(), we first check cpr->has_more_work. If it is true,
we are in NAPI polling mode and we will call __bnxt_poll_cqs() to
continue polling. It is possible to exhanust the budget again when
__bnxt_poll_cqs() returns.
We then enter the main while loop to check for new entries in the NQ.
If we had previously exhausted the NAPI budget, we may call
__bnxt_poll_work() to process an RX entry with zero budget. This will
cause packets to be dropped unnecessarily, thinking that we are in the
netpoll path. Fix it by breaking out of the while loop if we need
to process an RX NQ entry with no budget left. We will then exit
NAPI and stay in polling mode.
Fixes: 389a877a3b20 ("bnxt_en: Process the NQ under NAPI continuous polling.")
Reviewed-by: Andy Gospodarek <redacted>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -2707,6 +2707,10 @@ static int bnxt_poll_p5(struct napi_struct *napi, int budget)u32idx=le32_to_cpu(nqcmp->cq_handle_low);structbnxt_cp_ring_info*cpr2;+/* No more budget for RX work */+if(budget&&work_done>=budget&&idx==BNXT_RX_HDL)+break;+cpr2=cpr->cp_ring_arr[idx];work_done+=__bnxt_poll_work(bp,cpr2,budget-work_done);
Hello:
This series was applied to netdev/net.git (master)
by Jakub Kicinski [off-list ref]:
On Mon, 2 May 2022 21:13:09 -0400 you wrote:
This patch series includes 3 fixes:
1. Fix an occasional VF open failure.
2. Fix a PTP spinlock usage before initialization
3. Fix unnecesary RX packet drops under high TX traffic load.
Michael Chan (2):
bnxt_en: Initiallize bp->ptp_lock first before using it
bnxt_en: Fix unnecessary dropping of RX packets
[...]