net/bnxt: fix max ring count calculation

Message ID 20200424110054.2668-1-somnath.kotur@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series net/bnxt: fix max ring count calculation |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot warning Travis build: failed
ci/iol-testing fail Testing issues
ci/Intel-compilation success Compilation OK

Commit Message

Somnath Kotur April 24, 2020, 11 a.m. UTC
  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 <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Ajit Khaparde April 24, 2020, 5:58 p.m. UTC | #1
On Fri, Apr 24, 2020 at 4:04 AM Somnath Kotur <somnath.kotur@broadcom.com>
wrote:

> 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 <somnath.kotur@broadcom.com>
>
Patch applied to dpdk-next-net-brcm.


> ---
>  drivers/net/bnxt/bnxt.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
> index 586d3f5..12fed1e 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)))
> --
> 1.8.3.1
>
>
  

Patch

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 586d3f5..12fed1e 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)))