DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix info about Rx descriptors for MPRQ
@ 2020-11-05 23:58 Alexander Kozyrev
  2020-11-08  4:28 ` [dpdk-dev] [PATCH v2] " Alexander Kozyrev
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Kozyrev @ 2020-11-05 23:58 UTC (permalink / raw)
  To: dev; +Cc: stable, rasland, viacheslavo, matan

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")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 3aee8d4def..f90124a2aa 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -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);
 }
 
 /**
-- 
2.24.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH v2] net/mlx5: fix info about Rx descriptors for MPRQ
  2020-11-05 23:58 [dpdk-dev] [PATCH] net/mlx5: fix info about Rx descriptors for MPRQ Alexander Kozyrev
@ 2020-11-08  4:28 ` Alexander Kozyrev
  2020-11-10 16:32   ` Slava Ovsiienko
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Kozyrev @ 2020-11-08  4:28 UTC (permalink / raw)
  To: dev; +Cc: rasland, matan, viacheslavo, 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 <akozyrev@nvidia.com>
---
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix info about Rx descriptors for MPRQ
  2020-11-08  4:28 ` [dpdk-dev] [PATCH v2] " Alexander Kozyrev
@ 2020-11-10 16:32   ` Slava Ovsiienko
  2020-11-13 18:03     ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Slava Ovsiienko @ 2020-11-10 16:32 UTC (permalink / raw)
  To: Alexander Kozyrev, dev; +Cc: Raslan Darawsheh, Matan Azrad, stable

> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Sunday, November 8, 2020 6:28
> To: dev@dpdk.org
> Cc: Raslan Darawsheh <rasland@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>;
> stable@dpdk.org
> 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.
> 
> Fixes: 26f1bae837 ("net/mlx5: add Rx/Tx burst mode info")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix info about Rx descriptors for MPRQ
  2020-11-10 16:32   ` Slava Ovsiienko
@ 2020-11-13 18:03     ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2020-11-13 18:03 UTC (permalink / raw)
  To: Alexander Kozyrev
  Cc: dev, Raslan Darawsheh, Matan Azrad, stable, Slava Ovsiienko, asafp

> > 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 <akozyrev@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Applied in next-net-mlx, thanks.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-13 18:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 23:58 [dpdk-dev] [PATCH] net/mlx5: fix info about Rx descriptors for MPRQ Alexander Kozyrev
2020-11-08  4:28 ` [dpdk-dev] [PATCH v2] " Alexander Kozyrev
2020-11-10 16:32   ` Slava Ovsiienko
2020-11-13 18:03     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).