Update vhost_net_virtqueue_restart() for vhost-user scenario.
In order to reuse some functions, we process the idx for
vhost-user case. It is because vhost_get_vq_index behave
differently in vhost-user.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 3 +++
1 file
Update virtio_net_queue_reset() and virtio_net_queue_enable()
for vhost-user scenario.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/virtio-net.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 6ab796b399
Update vhost_net_virtqueue_reset() for vhost-user scenario.
In order to reuse some functions, we process the idx for
vhost-user scenario because vhost_get_vq_index behave
differently for vhost-user.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 3 +++
1 file
Add virtqueue reset feature for vhost-user.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 8b80942e7c..ad319faee8 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net
mode, modify Qemu virtio-net to add PACKED feature to
test packed mode.
Guest Kernel Patch:
https://lore.kernel.org/bpf/20220801063902.129329-1-xuanz...@linux.alibaba.com/
DPDK Patch:
https://github.com/middaywords/dpdk/compare/72206323a5dd3182b13f61b25a64abdddfee595c...080d9d5a6bba8
There is only vhost_set_dev_enable op in VhostOps. Thus, we introduce
the interface vhost_set_vring_enable to set the enable status for a
single vring.
Resetting a single vq will rely on this interface.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost-user.c
Previously, vhost_set_vring_enable will enable/disable all vrings
in a device, which causes ambiguity. So we rename it to
vhost_set_dev_enable.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
backends/cryptodev-vhost.c| 12 ++--
hw/net/vhost_net-stub.c | 2
initalized until VIRTIO_PCI_COMMON_STATUS
is written. Thus, we should use vhost_started to differentiate the
two cases: vq reset and device start.
Currently it only supports vhost-kernel.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/virtio-net.c | 21 +
1 file
mem table and features
do not change, so we can call the vhost_virtqueue_start() to
restart a specific queue.
This patch only considers the case of vhost-kernel, when
NetClientDriver is NET_CLIENT_DRIVER_TAP.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 52
A a new command line parameter "queue_reset" is added.
Meanwhile, the vq reset feature is disabled for pre-7.2 machines.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/core/machine.c | 4 +++-
include/hw/virtio/virtio.h | 4 +++-
2 files changed, 6 insert
Introduce the fucntion flush_or_purge_queued_packets(), it will be
used in device reset and virtqueue reset. Therefore, we extract the
common logic as a new function.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
hw/net/virtio-net.c | 17 +++--
1 file
.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 25 +
include/net/vhost_net.h | 2 ++
2 files changed, 27 insertions(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index d28f8b974b..8beecb4d22 100644
--- a/hw/net/vhost_net.c
() and virtio_net_flush_tx() will not receive
or send packets.
For vhost-net, the datapath will be disabled in vhost_net_virtqueue_reset().
Signed-off-by: Xuan Zhuo
Signed-off-by: Kangjie Xu
---
hw/net/virtio-net.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/hw/net
Expose vhost_virtqueue_stop(), we need to use it when resetting a
virtqueue.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost.c | 8
include/hw/virtio/vhost.h | 2 ++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw
From: Xuan Zhuo
Introduce a new interface function virtio_queue_reset() to implement
reset for vq.
Add a new callback to VirtioDeviceClass for queue reset operation for
each child device.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
hw/virtio/virtio.c | 11 +++
include/h
code.
2. Rename 'vhost_net_virtqueue_stop' to 'vhost_net_virtqueue_reset'.
3. Make PCI transport ready before device ready when queue_enabled is set to
true.
4. Add some comments.
v2:
1. Add support for vhost-net kernel scenario.
2. Add a new vhost-user message VHOST_USER_RESET_V
PCI devices support device specific vq enable.
Based on this function, the driver can re-enable the virtqueue after the
virtqueue is reset.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
hw/virtio/virtio-pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a
From: Xuan Zhuo
Separate the logic of vq reset. This logic will be called directly
later.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
hw/virtio/virtio.c | 37 +
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/hw/virtio/virtio.c b/hw/vi
. Migration
thread also needs the lock. As a result, when migration of virtio
devices starts, the 'reset' status of VirtIOPCIQueue will always be 0.
Thus, we do not need to add it in vmstate_virtio_pci_modern_queue_state.
Signed-off-by: Xuan Zhuo
Signed-off-by: Kangjie Xu
Acked-by: Jason Wan
from here:
https://github.com/oasis-tcs/virtio-spec/issues/89
Signed-off-by: Xuan Zhuo
Signed-off-by: Kangjie Xu
Acked-by: Jason Wang
---
include/standard-headers/linux/virtio_config.h | 5 +
include/standard-headers/linux/virtio_pci.h| 2 ++
2 files changed, 7 insertions(+)
diff --git a
Expose vhost_virtqueue_start(), we need to use it when restarting a
virtqueue.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost.c | 8
include/hw/virtio/vhost.h | 3 +++
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw
Add virtqueue reset feature for vhost-kernel.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 1059aa45b4..97cdf9280b 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net
start the virtqueue when DRIVER_OK.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
hw/virtio/virtio.c | 14 ++
include/hw/virtio/virtio.h | 2 ++
2 files changed, 16 insertions(+)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index
在 2022/9/5 16:30, Jason Wang 写道:
在 2022/8/25 16:08, Kangjie Xu 写道:
From: Xuan Zhuo
virtio-net and vhost-kernel implement queue reset.
Queued packets in the corresponding queue pair are flushed
or purged.
Signed-off-by: Xuan Zhuo
Signed-off-by: Kangjie Xu
---
hw/net/virtio-net.c | 18
在 2022/9/5 16:30, Jason Wang 写道:
在 2022/8/25 16:08, Kangjie Xu 写道:
From: Xuan Zhuo
virtio-net and vhost-kernel implement queue reset.
Queued packets in the corresponding queue pair are flushed
or purged.
Signed-off-by: Xuan Zhuo
Signed-off-by: Kangjie Xu
---
hw/net/virtio-net.c | 18
在 2022/9/5 16:03, Jason Wang 写道:
在 2022/8/25 16:08, Kangjie Xu 写道:
Introduce vhost_virtqueue_reset(), which can reset the specific
virtqueue in the device. Then it will unmap vrings and the desc
of the virtqueue.
Here we do not reuse the vhost_net_stop_one() or vhost_dev_stop(),
because
在 2022/9/5 16:30, Jason Wang 写道:
在 2022/8/25 16:08, Kangjie Xu 写道:
From: Xuan Zhuo
virtio-net and vhost-kernel implement queue reset.
Queued packets in the corresponding queue pair are flushed
or purged.
Signed-off-by: Xuan Zhuo
Signed-off-by: Kangjie Xu
---
hw/net/virtio-net.c | 18
在 2022/9/5 16:24, Jason Wang 写道:
在 2022/8/25 16:08, Kangjie Xu 写道:
Introduce vhost_net_virtqueue_restart(), which can restart the
specific virtqueue when the vhost net started running before.
If it fails to restart the virtqueue, the device will be stopped.
Here we do not reuse
Do you have any comments about this patch set?
Thanks
在 2022/8/25 16:08, Kangjie Xu 写道:
The virtio queue reset function has already been defined in the virtio spec 1.2.
The relevant virtio spec information is here:
https://github.com/oasis-tcs/virtio-spec/issues/124
https
Update vhost_net_virtqueue_restart() for vhost-user scenario.
In order to reuse some functions, we process the idx for
vhost-user case. It is because vhost_get_vq_index behave
differently in vhost-user.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 12
Introduce the interface vhost_reset_vring(). The interface is a wrapper
to send a VHOST_USER_RESET_VRING message to the back-end. It will reset
an individual vring in the back-end. Meanwhile, it will wait for a reply
to ensure the reset has been completed.
Signed-off-by: Kangjie Xu
Signed-off-by
Update virtio_net_queue_reset() and virtio_net_queue_enable()
for vhost-user scenario.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/virtio-net.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 6ab796b399
Update vhost_net_virtqueue_reset() for vhost-user scenario.
In order to reuse some functions, we process the idx for
vhost-user scenario because vhost_get_vq_index behave
differently for vhost-user.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 13
Previously, vhost_set_vring_enable will enable/disable all vrings
in a device, which causes ambiguity. So we rename it to
vhost_set_dev_enable.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
backends/cryptodev-vhost.c| 12 ++--
hw/net/vhost_net-stub.c | 2
Add virtqueue reset feature for vhost-user.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 13b9c11e68..745cb4375b 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net
There is only vhost_set_dev_enable op in VhostOps. Thus, we introduce
the interface vhost_set_vring_enable to set the enable status for a
single vring.
Resetting a single vq will rely on this interface.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost-user.c
-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
docs/interop/vhost-user.rst | 10 ++
1 file changed, 10 insertions(+)
diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
index 3f18ab424e..ce7991b9d3 100644
--- a/docs/interop/vhost-user.rst
+++ b/docs/interop/vhost
/T/#t)
1. rename vhost_set_vring_enable to vhost_set_dev_enable.
2. add vhost-user message VHOST_USER_RESET_VRING
3. remove restart/reset functions of virtqueue in vhost module.
Kangjie Xu (8):
docs: vhost-user: add VHOST_USER_RESET_VRING message
net: virtio: rename vhost_set_vring_enable to vh
Add virtqueue reset feature for vhost-kernel.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 0716f6cd96..74c5147d6e 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net
initalized until VIRTIO_PCI_COMMON_STATUS
is written. Thus, we should use vhost_started to differentiate the
two cases: vq reset and device start.
Currently it only supports vhost-kernel.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/virtio-net.c | 21 +
1 file
ser message VHOST_USER_RESET_VRING.
3. Add migration compatibility for virtqueue reset.
Kangjie Xu (10):
virtio: introduce virtio_queue_enable()
virtio: core: vq reset feature negotation support
virtio-pci: support queue enable
vhost: extract the logic of unmapping the vrings and de
From: Xuan Zhuo
Separate the logic of vq reset. This logic will be called directly
later.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
hw/virtio/virtio.c | 37 +
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/hw/virtio/virtio.c b/hw/vi
From: Xuan Zhuo
virtio-net and vhost-kernel implement queue reset.
Queued packets in the corresponding queue pair are flushed
or purged.
Signed-off-by: Xuan Zhuo
Signed-off-by: Kangjie Xu
---
hw/net/virtio-net.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/hw/net
PCI devices support device specific vq enable.
Based on this function, the driver can re-enable the virtqueue after the
virtqueue is reset.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/virtio-pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/virtio/virtio-pci.c
A a new command line parameter "queue_reset" is added.
Meanwhile, the vq reset feature is disabled for pre-7.1 machines.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/core/machine.c | 1 +
include/hw/virtio/virtio.h | 4 +++-
2 files changed, 4 insertions(+),
it may stop the device in the
backend.
This patch only considers the case of vhost-kernel, when
NetClientDriver is NET_CLIENT_DRIVER_TAP.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 22 ++
include/net/vhost_net.h | 2 ++
2 files changed
start the virtqueue when DRIVER_OK.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
hw/virtio/virtio.c | 14 ++
include/hw/virtio/virtio.h | 2 ++
2 files changed, 16 insertions(+)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index
From: Xuan Zhuo
Introduce a new interface function virtio_queue_reset() to implement
reset for vq.
Add a new callback to VirtioDeviceClass for queue reset operation for
each child device.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
hw/virtio/virtio.c | 11 +++
include/h
Introduce vhost_virtqueue_unmap() to ummap the vrings and desc
of a virtqueue.
The function will be re-used when resetting a virtqueue.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
hw/virtio/vhost.c | 20 ++--
include/hw/virtio/vhost.h
from here:
https://github.com/oasis-tcs/virtio-spec/issues/89
Signed-off-by: Xuan Zhuo
Signed-off-by: Kangjie Xu
---
include/standard-headers/linux/virtio_config.h | 5 +
include/standard-headers/linux/virtio_pci.h| 2 ++
2 files changed, 7 insertions(+)
diff --git a/include/standard
Introduce the fucntion flush_or_purge_queued_packets(), it will be
used in device reset and virtqueue reset. Therefore, we extract the
common logic as a new function.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/virtio-net.c | 17 +++--
1 file changed, 11
. Migration
thread also needs the lock. As a result, when migration of virtio
devices starts, the 'reset' status of VirtIOPCIQueue will always be 0.
Thus, we do not need to add it in vmstate_virtio_pci_modern_queue_state.
Signed-off-by: Xuan Zhuo
Signed-off-by: Kangjie Xu
---
hw/virtio/vi
mem table and features
do not change, so we can call the vhost_virtqueue_start() to
restart a specific queue.
This patch only considers the case of vhost-kernel, when
NetClientDriver is NET_CLIENT_DRIVER_TAP.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 52
Expose vhost_virtqueue_start(), we need to use it when restarting a
virtqueue.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost.c | 8
include/hw/virtio/vhost.h | 2 ++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw
在 2022/8/25 10:52, Jason Wang 写道:
On Wed, Aug 24, 2022 at 7:27 PM Kangjie Xu wrote:
在 2022/8/24 16:59, Jason Wang 写道:
在 2022/8/23 16:20, Kangjie Xu 写道:
在 2022/8/23 15:44, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
PCI devices support vq enable.
Nit: it might be "su
在 2022/8/24 16:59, Jason Wang 写道:
在 2022/8/23 16:20, Kangjie Xu 写道:
在 2022/8/23 15:44, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
PCI devices support vq enable.
Nit: it might be "support device specific vq enable"
Get it.
Based on this function, the driver can re-
在 2022/8/24 17:02, Jason Wang 写道:
在 2022/8/24 11:09, Kangjie Xu 写道:
在 2022/8/24 10:53, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
The interface to set enable status for a single vring is lacked in
VhostOps, since the vhost_set_vring_enable_op will manipulate all
virtqueues in a
在 2022/8/24 17:04, Jason Wang 写道:
在 2022/8/24 12:57, Kangjie Xu 写道:
在 2022/8/24 12:05, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
Update vhost_net_virtqueue_stop() for vhost-user scenario.
Let's explain why it is needed now or why it doesn't cause any issue
or it'
在 2022/8/24 17:01, Jason Wang 写道:
在 2022/8/24 10:53, Kangjie Xu 写道:
在 2022/8/24 10:44, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
Introduce vhost_net_virtqueue_restart(), which can restart the
virtqueue when the vhost net started running before. If it fails
to restart the virtqueue
在 2022/8/24 12:03, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
Update vhost_dev_virtqueue_restart() for vhost-user scenario.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost.c | 26 ++
1 file changed, 22 insertions(+), 4 deletions
在 2022/8/24 11:56, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
Update vhost_dev_virtqueue_stop() for vhost-user scenario.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost.c | 19 +++
1 file changed, 19 insertions(+)
diff --git a/hw/virtio
在 2022/8/24 12:05, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
Update vhost_net_virtqueue_stop() for vhost-user scenario.
Let's explain why it is needed now or why it doesn't cause any issue
or it's a bug fix or not.
Thanks
This patch is to suppport vq reset for
在 2022/8/24 10:40, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
Introduce vhost_virtqueue_stop(), which can reset the virtqueue
in the device. Then it will unmap vrings and the desc of the
virtqueue.
This patch only considers the case for vhost-kernel, when
NetClientDriver is
在 2022/8/24 10:53, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
The interface to set enable status for a single vring is lacked in
VhostOps, since the vhost_set_vring_enable_op will manipulate all
virtqueues in a device.
Resetting a single vq will rely on this interface.
Signed-off-by
在 2022/8/24 10:50, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
Introduce the interface vhost_reset_vring(). The interface is a wrapper
to send a VHOST_USER_RESET_VRING message to the back-end. It will reset
an individual vring in the back-end. Meanwhile, it will wait for a reply
to
在 2022/8/24 10:44, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
Introduce vhost_net_virtqueue_restart(), which can restart the
virtqueue when the vhost net started running before. If it fails
to restart the virtqueue, the device will be stopped.
This patch only considers the case for
在 2022/8/24 10:40, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
Introduce vhost_virtqueue_stop(), which can reset the virtqueue
in the device. Then it will unmap vrings and the desc of the
virtqueue.
This patch only considers the case for vhost-kernel, when
NetClientDriver is
在 2022/8/24 10:37, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
Introduce vhost_dev_virtqueue_restart(), which can restart the
virtqueue when the vhost has already started running.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost.c | 13
在 2022/8/23 15:44, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
PCI devices support vq enable.
Nit: it might be "support device specific vq enable"
Get it.
Based on this function, the driver can re-enable the virtqueue after the
virtqueue is reset.
Signed-off-by:
在 2022/8/23 15:52, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
Introduce vhost_dev_virtqueue_stop(), which can ummap the
vrings and the desc of it.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost.c | 9 +
include/hw/virtio/vhost.h | 3 +++
2
在 2022/8/23 15:40, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
From: Xuan Zhuo
PCI devices support vq reset.
Based on this function, the driver can adjust the size of the ring, and
quickly recycle the buffer in the ring.
The migration of the virtio devices will not happen during a
在 2022/8/23 15:34, Jason Wang 写道:
在 2022/8/16 09:06, Kangjie Xu 写道:
A a new command line parameter "queue_reset" is added.
Meanwhile, the vq reset feature is disabled for pre-7.1 machines.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/core/machine.c | 1 +
patch set, thanks. :)
Best regards,
Kangjie
在 2022/8/16 09:06, Kangjie Xu 写道:
The virtio queue reset function has already been defined in the virtio spec 1.2.
The relevant virtio spec information is here:
https://github.com/oasis-tcs/virtio-spec/issues/124
https://github.com/oasis
在 2022/8/16 14:22, Michael S. Tsirkin 写道:
On Tue, Aug 16, 2022 at 02:15:57PM +0800, Xuan Zhuo wrote:
On Tue, 16 Aug 2022 02:14:10 -0400, "Michael S. Tsirkin"
wrote:
On Tue, Aug 16, 2022 at 09:06:12AM +0800, Kangjie Xu wrote:
The virtio queue reset function has already been defi
Update vhost_net_virtqueue_restart() for vhost-user scenario.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 4
1 file changed, 4 insertions(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index c0d408f3b4..778081e54a 100644
--- a/hw/net/vhost_net.c
Introduce the fucntion flush_or_purge_queued_packets(), it will be
used in device reset and virtqueue reset. Therefore, we extract the
common logic as a new function.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/virtio-net.c | 17 +++--
1 file changed, 11
Add virtqueue reset feature for vhost-user.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 9ea160e4e9..5bc89f2842 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net
Update vhost_net_virtqueue_stop() for vhost-user scenario.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 4
1 file changed, 4 insertions(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 2ab67e875e..c0d408f3b4 100644
--- a/hw/net/vhost_net.c
From: Xuan Zhuo
virtio-net, vhost-kernel, vhost-user implement queue reset.
Queued packets in the corresponding queue pair are flushed
or purged.
Signed-off-by: Xuan Zhuo
Signed-off-by: Kangjie Xu
---
hw/net/virtio-net.c | 19 +++
1 file changed, 19 insertions(+)
diff --git
Update vhost_dev_virtqueue_stop() for vhost-user scenario.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost.c | 19 +++
1 file changed, 19 insertions(+)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index fc3f550c76..a0d6824353 100644
--- a/hw/virtio
vhost
is not started and all vqs are not initalized until
VIRTIO_PCI_COMMON_STATUS is written. Thus, we should use vhost_started
to differentiate the two cases: vq reset and device start.
Currently it only supports vhost-user and vhost-kernel.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
Introduce the interface vhost_reset_vring(). The interface is a wrapper
to send a VHOST_USER_RESET_VRING message to the back-end. It will reset
an individual vring in the back-end. Meanwhile, it will wait for a reply
to ensure the reset has been completed.
Signed-off-by: Kangjie Xu
Signed-off-by
The interface to set enable status for a single vring is lacked in
VhostOps, since the vhost_set_vring_enable_op will manipulate all
virtqueues in a device.
Resetting a single vq will rely on this interface.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost-user.c
Introduce vhost_virtqueue_stop(), which can reset the virtqueue
in the device. Then it will unmap vrings and the desc of the
virtqueue.
This patch only considers the case for vhost-kernel, when
NetClientDriver is NET_CLIENT_DRIVER_TAP.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw
Update vhost_dev_virtqueue_restart() for vhost-user scenario.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost.c | 26 ++
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index a0d6824353
: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 48 +
include/net/vhost_net.h | 2 ++
2 files changed, 50 insertions(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index aa60dd901c..2ab67e875e 100644
--- a/hw/net/vhost_net.c
Introduce vhost_dev_virtqueue_restart(), which can restart the
virtqueue when the vhost has already started running.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost.c | 13 +
include/hw/virtio/vhost.h | 2 ++
2 files changed, 15 insertions(+)
diff
Introduce vhost_dev_virtqueue_stop(), which can ummap the
vrings and the desc of it.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost.c | 9 +
include/hw/virtio/vhost.h | 3 +++
2 files changed, 12 insertions(+)
diff --git a/hw/virtio/vhost.c b/hw/virtio
From: Xuan Zhuo
Separate the logic of vq reset. This logic will be called directly
later.
Signed-off-by: Xuan Zhuo
---
hw/virtio/virtio.c | 37 +
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 5d
A a new command line parameter "queue_reset" is added.
Meanwhile, the vq reset feature is disabled for pre-7.1 machines.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/core/machine.c | 1 +
include/hw/virtio/virtio.h | 4 +++-
2 files changed, 4 insertions(+),
Introduce vhost_virtqueue_unmap() to ummap the vrings and desc
of a virtqueue.
The function will be used later.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/vhost.c | 20 ++--
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/hw/virtio/vhost.c
from here:
https://github.com/oasis-tcs/virtio-spec/issues/89
Signed-off-by: Xuan Zhuo
Signed-off-by: Kangjie Xu
---
include/standard-headers/linux/virtio_config.h | 5 +
include/standard-headers/linux/virtio_pci.h| 2 ++
2 files changed, 7 insertions(+)
diff --git a/include/standard
Add virtqueue reset feature for vhost-kernel.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/net/vhost_net.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 778081e54a..9ea160e4e9 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net
. Migration
thread also needs the lock. As a result, we do not need to migrate the
reset state of VirtIOPCIQueue.
Signed-off-by: Xuan Zhuo
Signed-off-by: Kangjie Xu
---
hw/virtio/virtio-pci.c | 19 +++
include/hw/virtio/virtio-pci.h | 1 +
2 files changed, 20 insertions(+)
diff
rds/linux/commit/19a91e0d7167b2031e46078c6215c213b89cb2c3
Looking forward to your review and comments. Thanks.
Kangjie Xu (19):
virtio: introduce virtio_queue_enable()
virtio: core: vq reset feature negotation support
virtio-pci: support queue enable
vhost: extract the l
From: Xuan Zhuo
Introduce a new interface function virtio_queue_reset() to implement
reset for vq.
Add a new callback to VirtioDeviceClass for queue reset operation for
each child device.
Signed-off-by: Xuan Zhuo
---
hw/virtio/virtio.c | 11 +++
include/hw/virtio/virtio.h | 2
-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
docs/interop/vhost-user.rst | 10 ++
1 file changed, 10 insertions(+)
diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
index 3f18ab424e..ce7991b9d3 100644
--- a/docs/interop/vhost-user.rst
+++ b/docs/interop/vhost
start the virtqueue when DRIVER_OK.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/virtio.c | 14 ++
include/hw/virtio/virtio.h | 2 ++
2 files changed, 16 insertions(+)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 0e9d41366f..141f18c633 100644
PCI devices support vq enable.
Based on this function, the driver can re-enable the virtqueue after the
virtqueue is reset.
Signed-off-by: Kangjie Xu
Signed-off-by: Xuan Zhuo
---
hw/virtio/virtio-pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio
在 2022/7/28 10:41, Jason Wang 写道:
On Wed, Jul 27, 2022 at 3:05 PM Kangjie Xu wrote:
在 2022/7/27 12:55, Jason Wang 写道:
On Tue, Jul 26, 2022 at 2:39 PM Kangjie Xu wrote:
在 2022/7/26 11:49, Jason Wang 写道:
在 2022/7/18 19:17, Kangjie Xu 写道:
The interface to set enable status for a single
1 - 100 of 133 matches
Mail list logo