net/bnxt: fix Rx completion ring size calculation
authorLance Richardson <lance.richardson@broadcom.com>
Fri, 29 Jan 2021 18:07:09 +0000 (13:07 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 2 Feb 2021 23:48:11 +0000 (00:48 +0100)
commit8e18a019c1fc942321e5fe4529edfc793a4f0d2a
tree6e55d8fb0a8b1fa9c346d905fe907d06735573e0
parentc678299594a817c62c5d50ec61f444d2e30f5619
net/bnxt: fix Rx completion ring size calculation

The size of the receive completion ring should be recalculated
when MTU is increased to a size that requires scattered receive
or when LRO is enabled. Move logic for this calculation from
the ring configuration path to the device start path.
   - Made size calculation dependent only on scattered_rx
     status.
   - Moved calculation of scattered_rx up in the initialization
     sequence.
   - Made LRO offload status part of scattered_rx calculation.

When the completion ring size is too small, completion overflows
can occur causing the ring to be disabled in hardware.

Fixes: 04067844a3e9 ("net/bnxt: reduce CQ queue size without aggregation ring")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_ring.c
drivers/net/bnxt/bnxt_rxr.c