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)
commit27640ce68d21e556b66bc5fa022aacd26e53c947
tree14321ddaa51cfa0d24c66165af3b4a43b3af9248
parentca0c753815fe4786b79a80abf0412eb5d52090b8
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: c0c050c58d84 ("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