patches for DPDK stable branches
 help / color / Atom feed
From: Matan Azrad <matan@mellanox.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: dev@dpdk.org, stable@dpdk.org, Xueming Li <xuemingl@mellanox.com>
Subject: [dpdk-stable] [PATCH] vdpa/mlx5: fix steering update in virtq unset
Date: Mon, 27 Jul 2020 08:07:59 +0000
Message-ID: <1595837279-112146-1-git-send-email-matan@mellanox.com> (raw)

When a virtq is destroyed by the driver, it must be removed from the
steering RQT which holds its reference.

The driver didn't remove the virtq from RQT before destroying it what
caused HW syndrome in virtq unset.

Remove the virtq from RQT before destroying it.

Fixes: 9f09b1ca15c5 ("vdpa/mlx5: recreate a virtq becoming enabled")
Cc: stable@dpdk.org

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c
index 3e61264..19554f6 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c
@@ -482,6 +482,13 @@
 		DRV_LOG(INFO, "Virtq %d was modified, recreate it.", index);
 	}
 	if (virtq->virtq) {
+		virtq->enable = 0;
+		if (is_virtq_recvq(virtq->index, priv->nr_virtqs)) {
+			ret = mlx5_vdpa_steer_update(priv);
+			if (ret)
+				DRV_LOG(WARNING, "Failed to disable steering "
+					"for virtq %d.", index);
+		}
 		ret = mlx5_vdpa_virtq_stop(priv, index);
 		if (ret)
 			DRV_LOG(WARNING, "Failed to stop virtq %d.", index);
@@ -493,14 +500,12 @@
 			DRV_LOG(ERR, "Failed to setup virtq %d.", index);
 			return ret;
 		}
-	}
-	virtq->enable = !!enable;
-	if (is_virtq_recvq(virtq->index, priv->nr_virtqs)) {
-		/* Need to add received virtq to the RQT table of the TIRs. */
-		ret = mlx5_vdpa_steer_update(priv);
-		if (ret) {
-			virtq->enable = !enable;
-			return ret;
+		virtq->enable = 1;
+		if (is_virtq_recvq(virtq->index, priv->nr_virtqs)) {
+			ret = mlx5_vdpa_steer_update(priv);
+			if (ret)
+				DRV_LOG(WARNING, "Failed to enable steering "
+					"for virtq %d.", index);
 		}
 	}
 	return 0;
-- 
1.8.3.1


             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27  8:07 Matan Azrad [this message]
2020-07-28  9:44 ` Maxime Coquelin
2020-07-28 15:48 ` Maxime Coquelin

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1595837279-112146-1-git-send-email-matan@mellanox.com \
    --to=matan@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=xuemingl@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox