bnxt_en: 3 bug fixes
Michael Chan
maintainercover bnxt_en: 3 bug fixes
The first one fixes a possible failure when setting DCB ETS. The second one fixes the ethtool coredump (-W 2) not containing all the FW traces. The third one fixes the DMA unmap length when transmitting XDP_REDIRECT packets.
Shravya KN (1):
bnxt_en: Fix DCB ETS validation
Shruti Parab (1):
bnxt_en: Flush FW trace before copying to the coredump
Somnath Kotur (1):
bnxt_en: Set DMA unmap len correctly for XDP_REDIRECT
.../net/ethernet/broadcom/bnxt/bnxt_coredump.c | 18 +++++++++++------- drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c | 2 ++ drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-)
Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 1/3 bnxt_en: Fix DCB ETS validation
From: Shravya KN <[email protected]>
In bnxt_ets_validate(), the code incorrectly loops over all possible traffic classes to check and add the ETS settings. Fix it to loop over the configured traffic classes only.
The unconfigured traffic classes will default to TSA_ETS with 0 bandwidth. Looping over these unconfigured traffic classes may cause the validation to fail and trigger this error message:
"rejecting ETS config starving a TC\n"
The .ieee_setets() will then fail.
--- drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c +2 -0
@@ -487,7 +487,9 @@ static int bnxt_ets_validate(struct bnxt *bp, struct ieee_ets *ets, u8 *tc)if ((ets->tc_tx_bw[i] || ets->tc_tsa[i]) && i > bp->max_tc)return -EINVAL ; + } +for (i =0 ; i < max_tc; i++) {switch (ets->tc_tsa[i]) {case IEEE_8021QAZ_TSA_STRICT :break ;
Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 2/3 bnxt_en: Flush FW trace before copying to the coredump
In reply to Michael ChanFrom: Shruti Parab <[email protected]>
bnxt_fill_drv_seg_record() calls bnxt_dbg_hwrm_log_buffer_flush() to flush the FW trace buffer. This needs to be done before we call bnxt_copy_ctx_mem() to copy the trace data.
Without this fix, the coredump may not contain all the FW traces.
--- .../net/ethernet/broadcom/bnxt/bnxt_coredump.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_coredump.c +11 -7
@@ -368,23 +368,27 @@ static u32 bnxt_get_ctx_coredump(struct bnxt *bp, void *buf, u32 offset,if (!ctxm->mem_valid || !seg_id)continue ; -if (trace) +if (trace) { extra_hlen =BNXT_SEG_RCD_LEN ; +if (buf) { +u16 trace_type = bnxt_bstore_to_trace[type]; + +bnxt_fill_drv_seg_record (bp, &record, ctxm, + trace_type); + } + } +if (buf) data = buf +BNXT_SEG_HDR_LEN + extra_hlen; + seg_len =bnxt_copy_ctx_mem (bp, ctxm, data,0 ) + extra_hlen;if (buf) {bnxt_fill_coredump_seg_hdr (bp, &seg_hdr,NULL , seg_len,0 ,0 ,0 , comp_id, seg_id);memcpy (buf, &seg_hdr,BNXT_SEG_HDR_LEN ); buf +=BNXT_SEG_HDR_LEN ; -if (trace) { -u16 trace_type = bnxt_bstore_to_trace[type]; - -bnxt_fill_drv_seg_record (bp, &record, ctxm, - trace_type); +if (trace)memcpy (buf, &record,BNXT_SEG_RCD_LEN ); - } buf += seg_len; } len +=BNXT_SEG_HDR_LEN + seg_len;
Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 3/3 bnxt_en: Set DMA unmap len correctly for XDP_REDIRECT
In reply to Michael ChanFrom: Somnath Kotur <[email protected]>
When transmitting an XDP_REDIRECT packet, call dma_unmap_len_set() with the proper length instead of 0. This bug triggers this warning on a system with IOMMU enabled:
WARNING: CPU: 36 PID: 0 at drivers/iommu/dma-iommu.c:842 __iommu_dma_unmap+0x159/0x170 RIP: 0010:__iommu_dma_unmap+0x159/0x170 Code: a8 00 00 00 00 48 c7 45 b0 00 00 00 00 48 c7 45 c8 00 00 00 00 48 c7 45 a0 ff ff ff ff 4c 89 45
b8 4c 89 45 c0 e9 77 ff ff ff <0f> 0b e9 60 ff ff ff e8 8b bf 6a 00 66 66 2e 0f 1f 84 00 00 00 00
RSP: 0018:ff22d31181150c88 EFLAGS: 00010206
RAX: 0000000000002000 RBX: 00000000e13a0000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ff22d31181150cf0 R08: ff22d31181150ca8 R09: 0000000000000000
R10: 0000000000000000 R11: ff22d311d36c9d80 R12: 0000000000001000
R13: ff13544d10645010 R14: ff22d31181150c90 R15: ff13544d0b2bac00
FS: 0000000000000000(0000) GS:ff13550908a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005be909dacff8 CR3: 0008000173408003 CR4: 0000000000f71ef0
PKRU: 55555554
Call Trace: <IRQ> ? show_regs+0x6d/0x80 ? __warn+0x89/0x160 ? __iommu_dma_unmap+0x159/0x170 ? report_bug+0x17e/0x1b0 ? handle_bug+0x46/0x90 ? exc_invalid_op+0x18/0x80 ? asm_exc_invalid_op+0x1b/0x20 ? __iommu_dma_unmap+0x159/0x170 ? __iommu_dma_unmap+0xb3/0x170 iommu_dma_unmap_page+0x4f/0x100 dma_unmap_page_attrs+0x52/0x220 ? srso_alias_return_thunk+0x5/0xfbef5 ? xdp_return_frame+0x2e/0xd0 bnxt_tx_int_xdp+0xdf/0x440 [bnxt_en] __bnxt_poll_work_done+0x81/0x1e0 [bnxt_en] bnxt_poll+0xd3/0x1e0 [bnxt_en]
--- drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +1 -1
@@ -115,7 +115,7 @@ static void __bnxt_xmit_xdp_redirect(struct bnxt *bp, tx_buf->action =XDP_REDIRECT ; tx_buf->xdpf = xdpf;dma_unmap_addr_set (tx_buf, mapping, mapping); -dma_unmap_len_set (tx_buf, len,0 ); +dma_unmap_len_set (tx_buf, len, len); }void bnxt_tx_int_xdp (struct bnxt *bp,struct bnxt_napi *bnapi,int budget)
Signature · 1 line
2.30.1
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 9 lines · On Thu, 10 Jul 2025 14:39:35 -0700 you wrote:
The first one fixes a possible failure when setting DCB ETS. The second one fixes the ethtool coredump (-W 2) not containing all the FW traces. The third one fixes the DMA unmap length when transmitting
XDP_REDIRECTpackets.Shravya KN (1):
bnxt_en: Fix DCB ETS validation[...]
Here is the summary with links:
- [net,1/3] bnxt_en: Fix DCB ETS validation
https://git.kernel.org/netdev/net/c/b74c2a2e9cc4 - [net,2/3] bnxt_en: Flush FW trace before copying to the coredump https://git.kernel.org/netdev/net/c/100c08c89d17 - [net,3/3] bnxt_en: Set DMA unmap len correctly for XDP_REDIRECT https://git.kernel.org/netdev/net/c/3cdf199d4755
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html