bnxt_en: Increase maximum RX ring size if jumbo ring is not used
authorMichael Chan <michael.chan@broadcom.com>
Mon, 2 Aug 2021 14:52:39 +0000 (10:52 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Aug 2021 11:38:47 +0000 (12:38 +0100)
commitc1129b51ca0e6d261df7b49388af7962c8e9a19e
tree5e1083736ce28c6c86972ee51c78c40e83e46825
parent03c7448790b87cec82a2f1406ff40dd1a8861170
bnxt_en: Increase maximum RX ring size if jumbo ring is not used

The current maximum RX ring size is defined assuming the RX jumbo ring
(aka aggregation ring) is used.  The RX jumbo ring is automicatically used
when the MTU exceeds a threshold or when rx-gro-hw/lro is enabled.  The RX
jumbo ring is automatically sized up to 4 times the size of the RX ring
size.

The BNXT_MAX_RX_DESC_CNT constant is the upper limit on the size of the
RX ring whether or not the RX jumbo ring is used.  Obviously, the
maximum amount of RX buffer space is significantly less when the RX jumbo
ring is not used.

To increase flexibility for the user who does not use the RX jumbo ring,
we now define a bigger maximum RX ring size when the RX jumbo ring is not
used.  The maximum RX ring size is now up to 8K when the RX jumbo ring
is not used.  The maximum completion ring size also needs to be scaled
up to accomodate the larger maximum RX ring size.

Note that when the RX jumbo ring is re-enabled, the RX ring size will
automatically drop if it exceeds the maximum.

Reviewed-by: Edwin Peer <edwin.peer@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
drivers/net/ethernet/broadcom/bnxt/bnxt.h
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c