Skip to contentSkip to conversation

virtio-net: not enable vq reset feature unconditionally

PATCH In review Eugenio Pérez 4 participants 13 messages May 4, 2023 – May 9, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-net: not enable vq reset feature unconditionally

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

---
 hw/net/virtio-net.c | 1 -
 1 file changed, 1 deletion(-)
hw/net/virtio-net.c +0 -1
index 53e1c32643..4ea33b6e2e 100644
@@ -805,7 +805,6 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features,
     }
 
     if (!get_vhost_net(nc->peer)) {
-        virtio_add_feature(&features, VIRTIO_F_RING_RESET);
         return features;
     }
 
Signature · 1 line
2.31.1
#1 lore raw
Quoted 8 lines · On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?=…

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

Quoted 8 lines

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

Do you mean that this feature cannot be closed?

I tried to close in the guest, it was successful.

In addition, in this case, could you try to repair the problem instead of directly revert.

Thanks.

Quoted 19 lines
---
 hw/net/virtio-net.c | 1 -
 1 file changed, 1 deletion(-)
hw/net/virtio-net.c +0 -2
index 53e1c32643..4ea33b6e2e 100644
@@ -805,7 +805,6 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features,
     }
 
     if (!get_vhost_net(nc->peer)) {
-        virtio_add_feature(&features, VIRTIO_F_RING_RESET);
         return features;
     }
 
--

2.31.1

#2 lore raw
Quoted 18 lines · Xuan Zhuo
Quoted 8 lines · On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?=…

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

Quoted 8 lines

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

Quoted 8 lines

Do you mean that this feature cannot be closed?

I tried to close in the guest, it was successful.

In addition, in this case, could you try to repair the problem instead of directly revert.

Thanks.

What does you patch accomplish though? If it's not needed let's not do it.

Quoted 19 lines
Quoted 19 lines
---
 hw/net/virtio-net.c | 1 -
 1 file changed, 1 deletion(-)
hw/net/virtio-net.c +0 -2
index 53e1c32643..4ea33b6e2e 100644
@@ -805,7 +805,6 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features,
     }
 
     if (!get_vhost_net(nc->peer)) {
-        virtio_add_feature(&features, VIRTIO_F_RING_RESET);
         return features;
     }
 
--

2.31.1

#3 lore raw
Quoted 24 lines · Michael S. Tsirkin
Quoted 22 lines · Xuan Zhuo
Quoted 8 lines · On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?=…

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

Quoted 8 lines

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

Do you mean that this feature cannot be closed?

I tried to close in the guest, it was successful.

Quoted 7 lines
Quoted 4 lines

In addition, in this case, could you try to repair the problem instead of directly revert.

Thanks.

What does you patch accomplish though? If it's not needed let's not do it.

It looks to me the unconditional set of this feature breaks the migration of pre 7.2 machines.

Also we probably need to make ring_reset as false by default, or compat it for pre 7.2 machines.

    DEFINE_PROP_BIT64("queue_reset", _state, _field, \
                      VIRTIO_F_RING_RESET, true)

Thanks

Quoted 21 lines
Quoted 20 lines
Quoted 20 lines
---
 hw/net/virtio-net.c | 1 -
 1 file changed, 1 deletion(-)
hw/net/virtio-net.c +0 -2
index 53e1c32643..4ea33b6e2e 100644
@@ -805,7 +805,6 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features,
     }
 
     if (!get_vhost_net(nc->peer)) {
-        virtio_add_feature(&features, VIRTIO_F_RING_RESET);
         return features;
     }
 
--

2.31.1

#4 lore raw
Quoted 36 lines · Jason Wang
Quoted 24 lines · Michael S. Tsirkin
Quoted 22 lines · Xuan Zhuo
Quoted 8 lines · On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?=…

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

Quoted 8 lines

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

Do you mean that this feature cannot be closed?

I tried to close in the guest, it was successful.

Quoted 7 lines
Quoted 4 lines

In addition, in this case, could you try to repair the problem instead of directly revert.

Thanks.

What does you patch accomplish though? If it's not needed let's not do it.

It looks to me the unconditional set of this feature breaks the migration of pre 7.2 machines.

Quoted 8 lines

Also we probably need to make ring_reset as false by default, or compat it for pre 7.2 machines.

    DEFINE_PROP_BIT64("queue_reset", _state, _field, \
                      VIRTIO_F_RING_RESET, true)

Thanks

Compat I am guessing. Eugenio?

Quoted 21 lines
Quoted 21 lines
Quoted 20 lines
Quoted 20 lines
---
 hw/net/virtio-net.c | 1 -
 1 file changed, 1 deletion(-)
hw/net/virtio-net.c +0 -2
index 53e1c32643..4ea33b6e2e 100644
@@ -805,7 +805,6 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features,
     }
 
     if (!get_vhost_net(nc->peer)) {
-        virtio_add_feature(&features, VIRTIO_F_RING_RESET);
         return features;
     }
 
--

2.31.1

Acked-by Jason Wang Reviewed-by Michael S. Tsirkin
#5 lore raw
In reply to Jason Wang
Quoted 33 lines · Jason Wang
Quoted 24 lines · Michael S. Tsirkin
Quoted 22 lines · Xuan Zhuo
Quoted 8 lines · On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?=…

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

Quoted 8 lines

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

Do you mean that this feature cannot be closed?

I tried to close in the guest, it was successful.

Quoted 7 lines
Quoted 4 lines

In addition, in this case, could you try to repair the problem instead of directly revert.

Thanks.

What does you patch accomplish though? If it's not needed let's not do it.

Quoted 9 lines

It looks to me the unconditional set of this feature breaks the migration of pre 7.2 machines.

Also we probably need to make ring_reset as false by default, or compat it for pre 7.2 machines.

    DEFINE_PROP_BIT64("queue_reset", _state, _field, \
                      VIRTIO_F_RING_RESET, true)

Do you mean this?

Thanks

commit 69e1c14aa22284f933a6ea134b96d5cb5a88a94d

Author: Kangjie Xu <[email protected]>
Date:   Mon Oct 17 17:25:47 2022 +0800

virtio: core: vq reset feature negotation support

A a new command line parameter "queue_reset" is added.

Meanwhile, the vq reset feature is disabled for pre-7.2 machines.

Message-Id: <[email protected]>

hw/core/machine.c +3 -1
index aa520e74a8..907fa78ff0 100644
@@ -40,7 +40,9 @@
 #include "hw/virtio/virtio-pci.h"
 #include "qom/object_interfaces.h"
 
-GlobalProperty hw_compat_7_1[] = {};
+GlobalProperty hw_compat_7_1[] = {
+    { "virtio-device", "queue_reset", "false" },
+};
 const size_t hw_compat_7_1_len = G_N_ELEMENTS(hw_compat_7_1);
 
 GlobalProperty hw_compat_7_0[] = {
include/hw/virtio/virtio.h +3 -1
index b00b3fcf31..1423dba379 100644
@@ -313,7 +313,9 @@ typedef struct VirtIORNGConf VirtIORNGConf;
     DEFINE_PROP_BIT64("iommu_platform", _state, _field, \
                       VIRTIO_F_IOMMU_PLATFORM, false), \
     DEFINE_PROP_BIT64("packed", _state, _field, \
-                      VIRTIO_F_RING_PACKED, false)
+                      VIRTIO_F_RING_PACKED, false), \
+    DEFINE_PROP_BIT64("queue_reset", _state, _field, \
+                      VIRTIO_F_RING_RESET, true)
 
 hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n);
 bool virtio_queue_enabled_legacy(VirtIODevice *vdev, int n);
Quoted 25 lines

Thanks

Quoted 21 lines
Quoted 20 lines
Quoted 20 lines
---
 hw/net/virtio-net.c | 1 -
 1 file changed, 1 deletion(-)
hw/net/virtio-net.c +0 -2
index 53e1c32643..4ea33b6e2e 100644
@@ -805,7 +805,6 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features,
     }
 
     if (!get_vhost_net(nc->peer)) {
-        virtio_add_feature(&features, VIRTIO_F_RING_RESET);
         return features;
     }
 
--

2.31.1

#6 lore raw
In reply to Xuan Zhuo
Quoted 14 lines · Xuan Zhuo
Quoted 12 lines · On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?=…

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")
Quoted 9 lines
Quoted 4 lines

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

Do you mean that this feature cannot be closed?

I tried to close in the guest, it was successful.

I'm not sure what you mean with close. If the device dataplane is emulated in qemu (vhost=off), I'm not able to make the device not offer it.

Quoted 3 lines

In addition, in this case, could you try to repair the problem instead of directly revert.

I'm not following this. The revert is not to always disable the feature.

By default, the feature is enabled. If cmdline states queue_reset=on, the feature is enabled. That is true both before and after applying this patch.

However, in qemu master, queue_reset=off keeps enabling this feature on the device. It happens that there is a commit explicitly doing that, so I'm reverting it.

Let me know if that makes sense to you.

Thanks!

Reviewed-by
#7 lore raw
Quoted 39 lines · Eugenio Perez Martin
Quoted 14 lines · Xuan Zhuo
Quoted 12 lines · On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?=…

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")
Quoted 9 lines
Quoted 4 lines

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

Do you mean that this feature cannot be closed?

I tried to close in the guest, it was successful.

I'm not sure what you mean with close. If the device dataplane is emulated in qemu (vhost=off), I'm not able to make the device not offer it.

Quoted 3 lines

In addition, in this case, could you try to repair the problem instead of directly revert.

I'm not following this. The revert is not to always disable the feature.

By default, the feature is enabled. If cmdline states queue_reset=on, the feature is enabled. That is true both before and after applying this patch.

Quoted 5 lines

However, in qemu master, queue_reset=off keeps enabling this feature on the device. It happens that there is a commit explicitly doing that, so I'm reverting it.

Let me know if that makes sense to you.

I got it.

Looks like it's indeed a bug.

Thanks.

Quoted 3 lines

Thanks!

#8 lore raw
In reply to Eugenio Perez Martin
Quoted 39 lines · Eugenio Perez Martin
Quoted 14 lines · Xuan Zhuo
Quoted 12 lines · On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?=…

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")
Quoted 9 lines
Quoted 4 lines

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

Do you mean that this feature cannot be closed?

I tried to close in the guest, it was successful.

I'm not sure what you mean with close. If the device dataplane is emulated in qemu (vhost=off), I'm not able to make the device not offer it.

Quoted 3 lines

In addition, in this case, could you try to repair the problem instead of directly revert.

I'm not following this. The revert is not to always disable the feature.

By default, the feature is enabled. If cmdline states queue_reset=on, the feature is enabled. That is true both before and after applying this patch.

Quoted 7 lines

However, in qemu master, queue_reset=off keeps enabling this feature on the device. It happens that there is a commit explicitly doing that, so I'm reverting it.

Let me know if that makes sense to you.

Thanks!

question is this:

    DEFINE_PROP_BIT64("queue_reset", _state, _field, \
                      VIRTIO_F_RING_RESET, true)

don't we need compat for 7.2 and back for this property?

Signature · 1 line
MST
#9 lore raw
Quoted 50 lines · Michael S. Tsirkin
Quoted 39 lines · Eugenio Perez Martin
Quoted 14 lines · Xuan Zhuo
Quoted 12 lines · On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?=…

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")
Quoted 9 lines
Quoted 4 lines

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

Do you mean that this feature cannot be closed?

I tried to close in the guest, it was successful.

I'm not sure what you mean with close. If the device dataplane is emulated in qemu (vhost=off), I'm not able to make the device not offer it.

Quoted 3 lines

In addition, in this case, could you try to repair the problem instead of directly revert.

I'm not following this. The revert is not to always disable the feature.

By default, the feature is enabled. If cmdline states queue_reset=on, the feature is enabled. That is true both before and after applying this patch.

Quoted 7 lines

However, in qemu master, queue_reset=off keeps enabling this feature on the device. It happens that there is a commit explicitly doing that, so I'm reverting it.

Let me know if that makes sense to you.

Thanks!

Quoted 9 lines

question is this:

    DEFINE_PROP_BIT64("queue_reset", _state, _field, \
                      VIRTIO_F_RING_RESET, true)

don't we need compat for 7.2 and back for this property?

I think that part is already covered by commit 69e1c14aa222 ("virtio:
core: vq reset feature negotation support"). In that regard, maybe we can simplify the patch message simply stating that queue_reset=off does not work.

Thanks!

#10 lore raw
Quoted 61 lines · Eugenio Perez Martin
Quoted 50 lines · Michael S. Tsirkin
Quoted 39 lines · Eugenio Perez Martin
Quoted 14 lines · Xuan Zhuo
Quoted 12 lines · On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?=…

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")
Quoted 9 lines
Quoted 4 lines

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

Do you mean that this feature cannot be closed?

I tried to close in the guest, it was successful.

I'm not sure what you mean with close. If the device dataplane is emulated in qemu (vhost=off), I'm not able to make the device not offer it.

Quoted 3 lines

In addition, in this case, could you try to repair the problem instead of directly revert.

I'm not following this. The revert is not to always disable the feature.

By default, the feature is enabled. If cmdline states queue_reset=on, the feature is enabled. That is true both before and after applying this patch.

Quoted 7 lines

However, in qemu master, queue_reset=off keeps enabling this feature on the device. It happens that there is a commit explicitly doing that, so I'm reverting it.

Let me know if that makes sense to you.

Thanks!

Quoted 9 lines

question is this:

    DEFINE_PROP_BIT64("queue_reset", _state, _field, \
                      VIRTIO_F_RING_RESET, true)

don't we need compat for 7.2 and back for this property?

Quoted 6 lines

I think that part is already covered by commit 69e1c14aa222 ("virtio:
core: vq reset feature negotation support"). In that regard, maybe we can simplify the patch message simply stating that queue_reset=off does not work.

Thanks!

that compat for 7.1 and not 7.2 though? is that correct?

#12 lore raw
In reply to Eugenio Perez Martin
Quoted 62 lines · Eugenio Perez Martin
Quoted 50 lines · Michael S. Tsirkin
Quoted 39 lines · Eugenio Perez Martin
Quoted 14 lines · Xuan Zhuo
Quoted 12 lines · On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?=…

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")
Quoted 9 lines
Quoted 4 lines

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

Do you mean that this feature cannot be closed?

I tried to close in the guest, it was successful.

I'm not sure what you mean with close. If the device dataplane is emulated in qemu (vhost=off), I'm not able to make the device not offer it.

Quoted 3 lines

In addition, in this case, could you try to repair the problem instead of directly revert.

I'm not following this. The revert is not to always disable the feature.

By default, the feature is enabled. If cmdline states queue_reset=on, the feature is enabled. That is true both before and after applying this patch.

Quoted 7 lines

However, in qemu master, queue_reset=off keeps enabling this feature on the device. It happens that there is a commit explicitly doing that, so I'm reverting it.

Let me know if that makes sense to you.

Thanks!

Quoted 9 lines

question is this:

    DEFINE_PROP_BIT64("queue_reset", _state, _field, \
                      VIRTIO_F_RING_RESET, true)

don't we need compat for 7.2 and back for this property?

Quoted 6 lines

I think that part is already covered by commit 69e1c14aa222 ("virtio:
core: vq reset feature negotation support"). In that regard, maybe we can simplify the patch message simply stating that queue_reset=off does not work.

Thanks!

Ack

Thanks

Quoted 1 line
#11 lore raw
In reply to Michael S. Tsirkin
Quoted 63 lines · Michael S. Tsirkin
Quoted 61 lines · Eugenio Perez Martin
Quoted 59 lines · Michael S. Tsirkin
Quoted 39 lines · Eugenio Perez Martin
Quoted 14 lines · Xuan Zhuo
Quoted 12 lines · On Thu, 4 May 2023 12:14:47 +0200, =?utf-8?q?Eugenio_P=C3=A9rez?=…

The commit 93a97dc5200a ("virtio-net: enable vq reset feature") enables unconditionally vq reset feature as long as the device is emulated. This makes impossible to actually disable the feature, and it causes migration problems from qemu version previous than 7.2.

The entire final commit is unneeded as device system already enable or disable the feature properly.

This reverts commit 93a97dc5200a95e63b99cb625f20b7ae802ba413.

Fixes 93a97dc5200a ("virtio-net: enable vq reset feature")
Quoted 9 lines
Quoted 4 lines

---
Tested by checking feature bit at /sys/devices/pci.../virtio0/features enabling and disabling queue_reset virtio-net feature and vhost=on/off on net device backend.

Do you mean that this feature cannot be closed?

I tried to close in the guest, it was successful.

I'm not sure what you mean with close. If the device dataplane is emulated in qemu (vhost=off), I'm not able to make the device not offer it.

Quoted 3 lines

In addition, in this case, could you try to repair the problem instead of directly revert.

I'm not following this. The revert is not to always disable the feature.

By default, the feature is enabled. If cmdline states queue_reset=on, the feature is enabled. That is true both before and after applying this patch.

Quoted 7 lines

However, in qemu master, queue_reset=off keeps enabling this feature on the device. It happens that there is a commit explicitly doing that, so I'm reverting it.

Let me know if that makes sense to you.

Thanks!

question is this:

    DEFINE_PROP_BIT64("queue_reset", _state, _field, \
                      VIRTIO_F_RING_RESET, true)

don't we need compat for 7.2 and back for this property?

Quoted 9 lines
Quoted 6 lines

I think that part is already covered by commit 69e1c14aa222 ("virtio:
core: vq reset feature negotation support"). In that regard, maybe we can simplify the patch message simply stating that queue_reset=off does not work.

Thanks!

that compat for 7.1 and not 7.2 though? is that correct?

Yes. queue_reset support was added for 7.2 and there are cases where it can be on or off, like using vhost=on.

If a new rhel 7.2 guest starts with cmdline vhost=off queue_reset=off, both the guest and device model still see queue_reset=on, so they will migrate with queue_reset=on. In the case of a migration to a current qemu master with cmdline vhost=off queue_reset=off, dst qemu will complain and block the migration (untested).

I think this is the least bad of all the bad behaviors, as a sudden change to honor cmdline will cause a change of the device features that the guest sees. I'm not sure if there are better ways to accomplish this.

Maybe I'm missing something?

Thanks!