DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix shared Rx queue config reuse
@ 2022-11-02 14:25 Alexander Kozyrev
  2022-11-06 13:16 ` Matan Azrad
  2022-11-06 15:41 ` Raslan Darawsheh
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Kozyrev @ 2022-11-02 14:25 UTC (permalink / raw)
  To: dev; +Cc: stable, rasland, viacheslavo, matan, xuemingl

There is a check for the configuration match between
all the Rx queues shared among multiple ports in DPDK.
This check ensures that the configuration is the same.

The issue is this check takes place before the queue
is released and configured again in case of reconfiguration.
That leads to checking against the old configuration and
preventing the shared Rx queue to start properly.

Release the old configuration and prepare a new Rx queue
before checking that its parameters match the config.

Fixes: 09c2555303 ("net/mlx5: support shared Rx queue")

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

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index b7818f9598..0d9d11680b 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -902,16 +902,20 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 		/* Try to reuse shared RXQ. */
 		rxq_ctrl = mlx5_shared_rxq_get(dev, conf->share_group,
 					       conf->share_qid);
+		res = mlx5_rx_queue_pre_setup(dev, idx, &desc, &rxq_ctrl);
+		if (res)
+			return res;
 		if (rxq_ctrl != NULL &&
 		    !mlx5_shared_rxq_match(rxq_ctrl, dev, idx, desc, socket,
 					   conf, mp)) {
 			rte_errno = EINVAL;
 			return -rte_errno;
 		}
+	} else {
+		res = mlx5_rx_queue_pre_setup(dev, idx, &desc, &rxq_ctrl);
+		if (res)
+			return res;
 	}
-	res = mlx5_rx_queue_pre_setup(dev, idx, &desc, &rxq_ctrl);
-	if (res)
-		return res;
 	/* Allocate RXQ. */
 	rxq = mlx5_malloc(MLX5_MEM_RTE | MLX5_MEM_ZERO, sizeof(*rxq), 0,
 			  SOCKET_ID_ANY);
-- 
2.18.2


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

* RE: [PATCH] net/mlx5: fix shared Rx queue config reuse
  2022-11-02 14:25 [PATCH] net/mlx5: fix shared Rx queue config reuse Alexander Kozyrev
@ 2022-11-06 13:16 ` Matan Azrad
  2022-11-06 15:41 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Matan Azrad @ 2022-11-06 13:16 UTC (permalink / raw)
  To: Alexander Kozyrev, dev
  Cc: stable, Raslan Darawsheh, Slava Ovsiienko, Xueming(Steven) Li



> There is a check for the configuration match between all the Rx queues
> shared among multiple ports in DPDK.
> This check ensures that the configuration is the same.
> 
> The issue is this check takes place before the queue is released and
> configured again in case of reconfiguration.
> That leads to checking against the old configuration and preventing the
> shared Rx queue to start properly.
> 
> Release the old configuration and prepare a new Rx queue before checking
> that its parameters match the config.
> 
> Fixes: 09c2555303 ("net/mlx5: support shared Rx queue")
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>

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

* RE: [PATCH] net/mlx5: fix shared Rx queue config reuse
  2022-11-02 14:25 [PATCH] net/mlx5: fix shared Rx queue config reuse Alexander Kozyrev
  2022-11-06 13:16 ` Matan Azrad
@ 2022-11-06 15:41 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2022-11-06 15:41 UTC (permalink / raw)
  To: Alexander Kozyrev, dev
  Cc: stable, Slava Ovsiienko, Matan Azrad, Xueming(Steven) Li

Hi,

> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Wednesday, November 2, 2022 4:25 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>;
> Xueming(Steven) Li <xuemingl@nvidia.com>
> Subject: [PATCH] net/mlx5: fix shared Rx queue config reuse
> 
> There is a check for the configuration match between all the Rx queues
> shared among multiple ports in DPDK.
> This check ensures that the configuration is the same.
> 
> The issue is this check takes place before the queue is released and
> configured again in case of reconfiguration.
> That leads to checking against the old configuration and preventing the
> shared Rx queue to start properly.
> 
> Release the old configuration and prepare a new Rx queue before checking
> that its parameters match the config.
> 
> Fixes: 09c2555303 ("net/mlx5: support shared Rx queue")
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2022-11-06 15:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 14:25 [PATCH] net/mlx5: fix shared Rx queue config reuse Alexander Kozyrev
2022-11-06 13:16 ` Matan Azrad
2022-11-06 15:41 ` Raslan Darawsheh

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).