[dpdk-stable] patch 'net/virtio: fix crash when device reconnecting' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:05:30 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From dafdf5879988e8eb64b4659a0f104b665fd5aab9 Mon Sep 17 00:00:00 2001
From: Marvin Liu <yong.liu at intel.com>
Date: Wed, 6 May 2020 23:07:24 +0800
Subject: [PATCH] net/virtio: fix crash when device reconnecting

[ upstream commit 01996a034a78db79686238a9656f8a49367fe963 ]

When doing virtio device initialization, virtqueues will be reset in
server mode if ring type is packed. It will cause issue because queues
have been freed in the beginning of device initialization.

Fix this issue by checking whether device has been initialized before
reset. If device hasn't been initialized, there's no need to reset
queues.

Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode")

Signed-off-by: Marvin Liu <yong.liu at intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 drivers/net/virtio/virtio_user_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index e5b5a804a2..e2cbd2478d 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -89,7 +89,8 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)
 	dev->features &= dev->device_features;
 
 	/* For packed ring, resetting queues is required in reconnection. */
-	if (vtpci_packed_queue(hw)) {
+	if (vtpci_packed_queue(hw) &&
+	   (vtpci_get_status(hw) & VIRTIO_CONFIG_STATUS_DRIVER_OK)) {
 		PMD_INIT_LOG(NOTICE, "Packets on the fly will be dropped"
 				" when packed ring reconnecting.");
 		virtio_user_reset_queues_packed(eth_dev);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:52.539641439 +0100
+++ 0195-net-virtio-fix-crash-when-device-reconnecting.patch	2020-05-19 14:04:44.556654535 +0100
@@ -1,8 +1,10 @@
-From 01996a034a78db79686238a9656f8a49367fe963 Mon Sep 17 00:00:00 2001
+From dafdf5879988e8eb64b4659a0f104b665fd5aab9 Mon Sep 17 00:00:00 2001
 From: Marvin Liu <yong.liu at intel.com>
 Date: Wed, 6 May 2020 23:07:24 +0800
 Subject: [PATCH] net/virtio: fix crash when device reconnecting
 
+[ upstream commit 01996a034a78db79686238a9656f8a49367fe963 ]
+
 When doing virtio device initialization, virtqueues will be reset in
 server mode if ring type is packed. It will cause issue because queues
 have been freed in the beginning of device initialization.
@@ -12,7 +14,6 @@
 queues.
 
 Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode")
-Cc: stable at dpdk.org
 
 Signed-off-by: Marvin Liu <yong.liu at intel.com>
 Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
@@ -21,7 +22,7 @@
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
-index dfc5291d4c..798f191c32 100644
+index e5b5a804a2..e2cbd2478d 100644
 --- a/drivers/net/virtio/virtio_user_ethdev.c
 +++ b/drivers/net/virtio/virtio_user_ethdev.c
 @@ -89,7 +89,8 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)


More information about the stable mailing list