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 45DFEA051A; Wed, 10 Jun 2020 13:48:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 251E52BF7; Wed, 10 Jun 2020 13:48:11 +0200 (CEST) Received: from relay.smtp.broadcom.com (unknown [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 646032B83 for ; Wed, 10 Jun 2020 13:48:09 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 3F2AA29A270; Wed, 10 Jun 2020 04:48:08 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 3F2AA29A270 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1591789688; bh=n0HLMnBMYgKd9KdyK8qM5/mu/1NpuRlrKHA2oAa1XDQ=; h=From:To:Cc:Subject:Date:From; b=k5pnKt2taditvXqHfWtIPwNnQVfcWV9Y0DpmXiCDb9HQO9B9hUiiW9Hk9/X839yvM ZZFIfnx3qpStnhDS3pUl5/0EQO4lR48m/KWROlrLMoeaUZkod3K6iKWkpVT9DBFwLg zCCIoC57BG10EGmSQtRn8jFURvnglrjRmHfhrMbQ= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Wed, 10 Jun 2020 17:13:44 +0530 Message-Id: <20200610114344.22097-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