From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 482F1A00C2; Fri, 24 Apr 2020 13:04:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC12A1B5E1; Fri, 24 Apr 2020 13:04:17 +0200 (CEST) Received: from relay.smtp.broadcom.com (unknown [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id C46762B83 for ; Fri, 24 Apr 2020 13:04:16 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (bgccx-dev-host-lnx35.bec.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 4E4132953BE; Fri, 24 Apr 2020 04:04:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 4E4132953BE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1587726255; bh=n0HLMnBMYgKd9KdyK8qM5/mu/1NpuRlrKHA2oAa1XDQ=; h=From:To:Cc:Subject:Date:From; b=fj5YHiUkUYLYYa0o/juv00Svv+l67vf/xTqfEjKD84zx9fhkVZF1U3aO0Wxt9z15X yAo6V2J241ZaXnIrEu/LqqyD7O8hUGUGytZ/rkxLFAwfwwqyWQA8oqPM2V1jY7pbSr gc8NnLdZ2FBISSEl9ZlKKqSFVk5xXCE9rUgFk/34= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 24 Apr 2020 16:30:54 +0530 Message-Id: <20200424110054.2668-1-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 Subject: [dpdk-dev] [PATCH] net/bnxt: fix max ring count calculation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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