]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Fix completion ring sizing with TPA enabled.
authorMichael Chan <michael.chan@broadcom.com>
Sun, 12 Jul 2020 00:48:25 +0000 (20:48 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 12 Jul 2020 22:29:01 +0000 (15:29 -0700)
commit68c3fd2bbc6609468896f3dff562244894b36c09
tree14321ddaa51cfa0d24c66165af3b4a43b3af9248
parent7c94ef4e278e62ada40a8e276867c29bcff7772f
bnxt_en: Fix completion ring sizing with TPA enabled.

The current completion ring sizing formula is wrong with TPA enabled.
The formula assumes that the number of TPA completions are bound by the
RX ring size, but that's not true.  TPA_START completions are immediately
recycled so they are not bound by the RX ring size.  We must add
bp->max_tpa to the worst case maximum RX and TPA completions.

The completion ring can overflow because of this mistake.  This will
cause hardware to disable the completion ring when this happens,
leading to RX and TX traffic to stall on that ring.  This issue is
generally exposed only when the RX ring size is set very small.

Fix the formula by adding bp->max_tpa to the number of RX completions
if TPA is enabled.

Fixes: dfe047769e71 ("bnxt_en: New Broadcom ethernet driver.");
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c