From: Alexander Kozyrev Date: Sun, 8 Nov 2020 04:28:04 +0000 (+0000) Subject: net/mlx5: fix Rx descriptors info for MPRQ X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=70a3ee6bb74ea089751abbc4954ffc850a5ed46e;p=dpdk.git net/mlx5: fix Rx descriptors info for MPRQ 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: 26f1bae837eb ("net/mlx5: add Rx/Tx burst mode info") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev Acked-by: Viacheslav Ovsiienko --- diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index a5829f00de..844a1c633d 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -548,7 +548,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; @@ -558,7 +558,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); } /**