From: Somnath Kotur Date: Fri, 24 Apr 2020 11:00:54 +0000 (+0530) Subject: net/bnxt: fix max ring count X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9bccd7010f1f627895409fe189627b2dd5a2c460;p=dpdk.git net/bnxt: fix max ring count Max Rx Ring count could be < Max stat contexts. While accounting for stat contexts, this should be also considered and the max ring count adjusted accordingly. Fixes: f03e66cb64ce ("net/bnxt: limit queue count for NS3/Stingray devices") Cc: stable@dpdk.org Signed-off-by: Somnath Kotur Reviewed-by: Kalesh AP --- diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 586d3f5349..12fed1e9d7 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -653,10 +653,10 @@ struct bnxt { #define MAX_STINGRAY_RINGS 128U /* For sake of symmetry, max Tx rings == max Rx rings, one stat ctx for each */ #define BNXT_MAX_RX_RINGS(bp) \ - (BNXT_STINGRAY(bp) ? RTE_MIN(RTE_MIN(bp->max_rx_rings, \ + (BNXT_STINGRAY(bp) ? RTE_MIN(RTE_MIN(bp->max_rx_rings / 2U, \ MAX_STINGRAY_RINGS), \ bp->max_stat_ctx / 2U) : \ - RTE_MIN(bp->max_rx_rings, \ + RTE_MIN(bp->max_rx_rings / 2U, \ bp->max_stat_ctx / 2U)) #define BNXT_MAX_TX_RINGS(bp) \ (RTE_MIN((bp)->max_tx_rings, BNXT_MAX_RX_RINGS(bp)))