DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vdpa/mlx5: fix live migration termination
@ 2020-07-24 12:07 Matan Azrad
  2020-07-28  9:29 ` Maxime Coquelin
  2020-07-28 15:27 ` Maxime Coquelin
  0 siblings, 2 replies; 3+ messages in thread
From: Matan Azrad @ 2020-07-24 12:07 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: dev

There are a lot of per virtq operations in the live migration
handling.

Before the driver support for queue update, when a virtq was not valid,
all the LM handling was terminated.

But now, when the driver supports queue update, the virtq can be invalid
as legal stage.

Skip invalid virtq in LM handling.

Fixes: c47d6e83334e ("vdpa/mlx5: support queue update")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Xueming Li <xuemingl@mellanox.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
index 460e01d..273c46f 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_lm.c
@@ -19,9 +19,13 @@
 
 	for (i = 0; i < priv->nr_virtqs; ++i) {
 		attr.queue_index = i;
-		if (!priv->virtqs[i].virtq ||
-		    mlx5_devx_cmd_modify_virtq(priv->virtqs[i].virtq, &attr)) {
-			DRV_LOG(ERR, "Failed to modify virtq %d logging.", i);
+		if (!priv->virtqs[i].virtq) {
+			DRV_LOG(DEBUG, "virtq %d is invalid for dirty bitmap "
+				"enabling.", i);
+		} else if (mlx5_devx_cmd_modify_virtq(priv->virtqs[i].virtq,
+			   &attr)) {
+			DRV_LOG(ERR, "Failed to modify virtq %d for dirty "
+				"bitmap enabling.", i);
 			return -1;
 		}
 	}
@@ -69,9 +73,11 @@
 	attr.dirty_bitmap_mkey = mr->mkey->id;
 	for (i = 0; i < priv->nr_virtqs; ++i) {
 		attr.queue_index = i;
-		if (!priv->virtqs[i].virtq ||
-		    mlx5_devx_cmd_modify_virtq(priv->virtqs[i].virtq, &attr)) {
-			DRV_LOG(ERR, "Failed to modify virtq %d for lm.", i);
+		if (!priv->virtqs[i].virtq) {
+			DRV_LOG(DEBUG, "virtq %d is invalid for LM.", i);
+		} else if (mlx5_devx_cmd_modify_virtq(priv->virtqs[i].virtq,
+						      &attr)) {
+			DRV_LOG(ERR, "Failed to modify virtq %d for LM.", i);
 			goto err;
 		}
 	}
@@ -104,15 +110,15 @@
 	if (!RTE_VHOST_NEED_LOG(features))
 		return 0;
 	for (i = 0; i < priv->nr_virtqs; ++i) {
-		if (priv->virtqs[i].virtq) {
+		if (!priv->virtqs[i].virtq) {
+			DRV_LOG(DEBUG, "virtq %d is invalid for LM log.", i);
+		} else {
 			ret = mlx5_vdpa_virtq_stop(priv, i);
 			if (ret) {
-				DRV_LOG(ERR, "Failed to stop virtq %d.", i);
+				DRV_LOG(ERR, "Failed to stop virtq %d for LM "
+					"log.", i);
 				return -1;
 			}
-		} else {
-			DRV_LOG(ERR, "virtq %d is not created.", i);
-			return -1;
 		}
 		rte_vhost_log_used_vring(priv->vid, i, 0,
 			      MLX5_VDPA_USED_RING_LEN(priv->virtqs[i].vq_size));
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: fix live migration termination
  2020-07-24 12:07 [dpdk-dev] [PATCH] vdpa/mlx5: fix live migration termination Matan Azrad
@ 2020-07-28  9:29 ` Maxime Coquelin
  2020-07-28 15:27 ` Maxime Coquelin
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2020-07-28  9:29 UTC (permalink / raw)
  To: Matan Azrad; +Cc: dev



On 7/24/20 2:07 PM, Matan Azrad wrote:
> There are a lot of per virtq operations in the live migration
> handling.
> 
> Before the driver support for queue update, when a virtq was not valid,
> all the LM handling was terminated.
> 
> But now, when the driver supports queue update, the virtq can be invalid
> as legal stage.
> 
> Skip invalid virtq in LM handling.
> 
> Fixes: c47d6e83334e ("vdpa/mlx5: support queue update")
> 
> Signed-off-by: Matan Azrad <matan@mellanox.com>
> Acked-by: Xueming Li <xuemingl@mellanox.com>
> ---
>  drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 28 +++++++++++++++++-----------
>  1 file changed, 17 insertions(+), 11 deletions(-)

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [dpdk-dev] [PATCH] vdpa/mlx5: fix live migration termination
  2020-07-24 12:07 [dpdk-dev] [PATCH] vdpa/mlx5: fix live migration termination Matan Azrad
  2020-07-28  9:29 ` Maxime Coquelin
@ 2020-07-28 15:27 ` Maxime Coquelin
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2020-07-28 15:27 UTC (permalink / raw)
  To: Matan Azrad; +Cc: dev



On 7/24/20 2:07 PM, Matan Azrad wrote:
> There are a lot of per virtq operations in the live migration
> handling.
> 
> Before the driver support for queue update, when a virtq was not valid,
> all the LM handling was terminated.
> 
> But now, when the driver supports queue update, the virtq can be invalid
> as legal stage.
> 
> Skip invalid virtq in LM handling.
> 
> Fixes: c47d6e83334e ("vdpa/mlx5: support queue update")
> 
> Signed-off-by: Matan Azrad <matan@mellanox.com>
> Acked-by: Xueming Li <xuemingl@mellanox.com>
> ---
>  drivers/vdpa/mlx5/mlx5_vdpa_lm.c | 28 +++++++++++++++++-----------
>  1 file changed, 17 insertions(+), 11 deletions(-)

Applied to dpdk-next-virtio/master

Thanks,
Maxime


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

end of thread, other threads:[~2020-07-28 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24 12:07 [dpdk-dev] [PATCH] vdpa/mlx5: fix live migration termination Matan Azrad
2020-07-28  9:29 ` Maxime Coquelin
2020-07-28 15:27 ` Maxime Coquelin

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