Message ID | 1619215999-8880-1-git-send-email-michael.chan@broadcom.com (mailing list archive) |
---|---|
State | Accepted |
Commit | bbd6f0a948139970f4a615dff189d9a503681a39 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] bnxt_en: Fix RX consumer index logic in the error path. | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | success | CCed 4 of 4 maintainers |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 18 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
Hello: This patch was applied to netdev/net.git (refs/heads/master): On Fri, 23 Apr 2021 18:13:19 -0400 you wrote: > In bnxt_rx_pkt(), the RX buffers are expected to complete in order. > If the RX consumer index indicates an out of order buffer completion, > it means we are hitting a hardware bug and the driver will abort all > remaining RX packets and reset the RX ring. The RX consumer index > that we pass to bnxt_discard_rx() is not correct. We should be > passing the current index (tmp_raw_cons) instead of the old index > (raw_cons). This bug can cause us to be at the wrong index when > trying to abort the next RX packet. It can crash like this: > > [...] Here is the summary with links: - [net] bnxt_en: Fix RX consumer index logic in the error path. https://git.kernel.org/netdev/net/c/bbd6f0a94813 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index aeb8c61c0f87..73239d3eaca1 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -1732,14 +1732,16 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, cons = rxcmp->rx_cmp_opaque; if (unlikely(cons != rxr->rx_next_cons)) { - int rc1 = bnxt_discard_rx(bp, cpr, raw_cons, rxcmp); + int rc1 = bnxt_discard_rx(bp, cpr, &tmp_raw_cons, rxcmp); /* 0xffff is forced error, don't print it */ if (rxr->rx_next_cons != 0xffff) netdev_warn(bp->dev, "RX cons %x != expected cons %x\n", cons, rxr->rx_next_cons); bnxt_sched_reset(bp, rxr); - return rc1; + if (rc1) + return rc1; + goto next_rx_no_prod_no_len; } rx_buf = &rxr->rx_buf_ring[cons]; data = rx_buf->data;