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 B6102A0526 for ; Sun, 8 Nov 2020 05:28:16 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 89E512C18; Sun, 8 Nov 2020 05:28:15 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id C9B96DED for ; Sun, 8 Nov 2020 05:28:12 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from akozyrev@nvidia.com) with SMTP; 8 Nov 2020 06:28:06 +0200 Received: from nvidia.com (pegasus02.mtr.labs.mlnx [10.210.16.122]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0A84S6ng023246; Sun, 8 Nov 2020 06:28:06 +0200 From: Alexander Kozyrev To: dev@dpdk.org Cc: rasland@nvidia.com, matan@nvidia.com, viacheslavo@nvidia.com, stable@dpdk.org Date: Sun, 8 Nov 2020 04:28:04 +0000 Message-Id: <20201108042804.29039-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20201105235856.25475-1-akozyrev@nvidia.com> References: <20201105235856.25475-1-akozyrev@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v2] net/mlx5: fix info about Rx descriptors for MPRQ X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" The number of descriptors configured is returned to a user via the rxq_info_get API. This number is incorrect for MPRQ. For SPRQ this number matches the number of mbufs allocated. For MPRQ we have fewer external MPRQ buffers that can hold multiple packets in strides of this big buffer. Take that into account and return the number of MPRQ buffers multiplied by the number of strides in this case. Fixes: 26f1bae837 ("net/mlx5: add Rx/Tx burst mode info") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev --- v1: https://patchwork.dpdk.org/patch/83778/ v2: fixed a commit message typo and a coverity issue drivers/net/mlx5/mlx5_rxtx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 3aee8d4def..c540849da2 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -556,7 +556,7 @@ mlx5_rxq_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id, if (!rxq) return; - qinfo->mp = mlx5_rxq_mprq_enabled(&rxq_ctrl->rxq) ? + qinfo->mp = mlx5_rxq_mprq_enabled(rxq) ? rxq->mprq_mp : rxq->mp; qinfo->conf.rx_thresh.pthresh = 0; qinfo->conf.rx_thresh.hthresh = 0; @@ -566,7 +566,9 @@ mlx5_rxq_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id, qinfo->conf.rx_deferred_start = rxq_ctrl ? 0 : 1; qinfo->conf.offloads = dev->data->dev_conf.rxmode.offloads; qinfo->scattered_rx = dev->data->scattered_rx; - qinfo->nb_desc = 1 << rxq->elts_n; + qinfo->nb_desc = mlx5_rxq_mprq_enabled(rxq) ? + (1 << rxq->elts_n) * (1 << rxq->strd_num_n) : + (1 << rxq->elts_n); } /** -- 2.24.1