Skip to contentSkip to conversation

net/mlx5: fix info about Rx descriptors for MPRQ

PATCH Superseded Alexander Kozyrev 3 participants 4 messages Nov 5, 2020 – Nov 13, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix info about Rx descriptors for MPRQ

Numbers of descriptors configured is returned to a user via 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 os this big buffer. Take that into account and return teh number of MPRQ buffers multiplied by the number of strides in this case.

Fixes 26f1bae837 ("net/mlx5: add Rx/Tx burst mode info")
---
 drivers/net/mlx5/mlx5_rxtx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_rxtx.c +3 -1
index 3aee8d4def..f90124a2aa 100644
@@ -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_ctrl->rxq) ?
+		(1 << rxq->elts_n) * (1 << rxq->strd_num_n) :
+		(1 << rxq->elts_n);
 }
 
 /**
Signature · 1 line
2.24.1
#1 lore raw

PATCH v2 1/1 net/mlx5: fix info about Rx descriptors 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 26f1bae837 ("net/mlx5: add Rx/Tx burst mode info")

---
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(-)
drivers/net/mlx5/mlx5_rxtx.c +4 -2
index 3aee8d4def..c540849da2 100644
@@ -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);
 }
 
 /**
Signature · 1 line
2.24.1
Acked-by on v2 1/1
#2 lore raw
Quoted 16 lines

-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Sent: Sunday, November 8, 2020 6:28
To: [email protected]
Cc: Raslan Darawsheh <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; [email protected]
Subject: [PATCH v2] net/mlx5: fix info about Rx descriptors 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.

Quoted 4 lines
Fixes 26f1bae837 ("net/mlx5: add Rx/Tx burst mode info")
#3 lore raw
Quoted 7 lines
Quoted 7 lines

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.

Quoted 5 lines
Quoted 4 lines
Fixes 26f1bae837 ("net/mlx5: add Rx/Tx burst mode info")

Applied in next-net-mlx, thanks.