configuration. To avoid
that, we will not send vring_enable until all configuration is used by
the device.
As a first step, reverse the DRIVER_OK and SET_VRING_ENABLE steps.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-vdpa.c | 22 --
1 file changed, 16 insertions(+), 6
needs SVQ CVQ support [1] and fixes [2] to be applied.
Thanks!
[1] https://lists.nongnu.org/archive/html/qemu-devel/2022-07/msg02808.html
[2] https://lists.nongnu.org/archive/html/qemu-devel/2022-07/msg02726.html
Eugenio Pérez (12):
vhost: Get vring base from vq, not svq
vhost: Move SVQ queue
So we can reuse to inject state messages.
Signed-off-by: Eugenio Pérez
---
net/vhost-vdpa.c | 89 +++-
1 file changed, 51 insertions(+), 38 deletions(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 211bd0468b..aaae51a778 100644
--- a/net
So later patches are cleaner
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-vdpa.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 4458c8d23e..906c365036 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost
the device's used idx and check for the
last avail idx. Since we cannot report in-flight descriptors with vdpa,
let's rewind all of them.
Fixes: 6d0b22266633 ("vdpa: Adapt vhost_vdpa_get_vring_base to SVQ")
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-vdpa.c | 8 +---
1 file changed, 5
Migration with SVQ already migrate the inflight descriptors, so the
destination can perform the work.
This makes easier to migrate between backends or to recover them in
vhost devices that support set in flight descriptors.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-vdpa.c | 24
Finally offering the possibility to enable SVQ from the command line.
Signed-off-by: Eugenio Pérez
Acked-by: Markus Armbruster
---
qapi/net.json| 9 +-
net/vhost-vdpa.c | 72 ++--
2 files changed, 77 insertions(+), 4 deletions(-)
diff --git
Shadow CVQ will copy buffers on qemu VA, so we avoid TOCTOU attacks from
the guest that could set a different state in qemu device model and vdpa
device.
To do so, it needs to be able to map these new buffers to the device.
Signed-off-by: Eugenio Pérez
Acked-by: Jason Wang
---
include/hw
Since the vhost-vdpa device is exposing _F_LOG, adding a migration blocker if
it uses CVQ.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/vhost-vdpa.h | 1 +
hw/virtio/vhost-vdpa.c | 14 ++
2 files changed, 15 insertions(+)
diff --git a/include/hw/virtio/vhost-vdpa.h b
It allows the Shadow Control VirtQueue to wait for the device to use the
available buffers.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 1 +
hw/virtio/vhost-shadow-virtqueue.c | 22 ++
2 files changed, 23 insertions(+)
diff --git a/hw/virtio/vhost
Do a simple forwarding of CVQ buffers, the same work SVQ could do but
through callbacks. No functional change intended.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/vhost-vdpa.h | 3 ++
hw/virtio/vhost-vdpa.c | 3 +-
net/vhost-vdpa.c | 58
event
will be raised.
More cvq commands could be added here straightforwardly but they have
not been tested.
Signed-off-by: Eugenio Pérez
---
net/vhost-vdpa.c | 211 +--
1 file changed, 204 insertions(+), 7 deletions(-)
diff --git a/net/vhost-vdpa.c b
This function allows external SVQ users to return guest's available
buffers.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 3 +++
hw/virtio/vhost-shadow-virtqueue.c | 16
2 files changed, 19 insertions(+)
diff --git a/hw/virtio/vhost-shadow-virtqueue.h
To know the device features is needed for CVQ SVQ, so SVQ knows if it
can handle all commands or not. Extract from
vhost_vdpa_get_max_queue_pairs so we can reuse it.
Signed-off-by: Eugenio Pérez
Acked-by: Jason Wang
---
net/vhost-vdpa.c | 30 --
1 file changed, 20
This allows external vhost-net devices to modify the state of the
VirtIO device model once the vhost-vdpa device has acknowledged the
control commands.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/virtio-net.h | 4 ++
hw/net/virtio-net.c| 84
This allows external parts of SVQ to forward custom buffers to the
device.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 3 +++
hw/virtio/vhost-shadow-virtqueue.c | 6 +++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/vhost-shadow
This will allow SVQ to add context to the different queue elements.
This patch only store the actual element, no functional change intended.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 8 ++--
hw/virtio/vhost-shadow-virtqueue.c | 16
2 files
A guest's buffer continuos on GPA may need multiple descriptors on
qemu's VA, so SVQ should track its length sepparatedly.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 6 ++
hw/virtio/vhost-shadow-virtqueue.c | 4 ++--
2 files changed, 8 insertions(+), 2 deletions
It's done for both in and out descriptors so it's better placed here.
Acked-by: Jason Wang
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 38 +-
1 file changed, 27 insertions(+), 11 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
Future code needs to call it from vhost_svq_add.
No functional change intended.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 28 ++--
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio
.
Signed-off-by: Eugenio Pérez
Acked-by: Jason Wang
---
hw/virtio/vhost-shadow-virtqueue.c | 33 --
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index aee9891a67..b005a457c6 100644
vhost-vdpa control virtqueue needs to know the maximum entries supported
by the virtio-net device, so we know if it is possible to apply the
filter.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/virtio-net.h | 3 +++
hw/net/virtio-net.c| 1 -
2 files changed, 3 insertions(+), 1
The series need to expose vhost_svq_add with full functionality,
including checking for full queue.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 59 +-
1 file changed, 33 insertions(+), 26 deletions(-)
diff --git a/hw/virtio/vhost-shadow
://patchwork.kernel.org/project/qemu-devel/cover/20220706184008.1649478-1-epere...@redhat.com/
Eugenio Pérez (19):
vhost: move descriptor translation to vhost_svq_vring_write_descs
virtio-net: Expose MAC_TABLE_ENTRIES
virtio-net: Expose ctrl virtqueue logic
vhost: Reorder vhost_svq_kick
vhost: Move
The series needs to expose vhost_svq_add with full functionality,
including kick
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index
it. The
callback is also free to process the command by itself and use the
element with svq_push.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 31 +-
hw/virtio/vhost-shadow-virtqueue.c | 14 --
hw/virtio/vhost-vdpa.c | 3
Migration with SVQ already migrate the inflight descriptors, so the
destination can perform the work.
This makes easier to migrate between backends or to recover them in
vhost devices that support set in flight descriptors.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-vdpa.c | 24
.)
Eugenio Pérez (2):
vhost: Get vring base from vq, not svq
vhost: Move SVQ queue rewind to the destination
hw/virtio/vhost-vdpa.c | 24
1 file changed, 12 insertions(+), 12 deletions(-)
--
2.31.1
the device's used idx and check for the
last avail idx. Since we cannot report in-flight descriptors with vdpa,
let's rewind all of them.
Fixes: 6d0b22266633 ("vdpa: Adapt vhost_vdpa_get_vring_base to SVQ")
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-vdpa.c | 8 +---
1 file changed, 5
DO NOT MERGE THIS RFC
... so we can evaluate if it is worth to move.
Answering [1].
It basically makes SVQ work in two different modes:
* data virtqueues works with the SVQ loop, intercepting guest's kicks
and device's call.
* CVQ does not move to that. Instead
- It "forbid" to vhost-dev to
Future code needs to call it from vhost_svq_add.
No functional change intended.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 28 ++--
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio
Since the vhost-vdpa device is exposing _F_LOG, adding a migration blocker if
it uses CVQ.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/vhost-vdpa.h | 1 +
hw/virtio/vhost-vdpa.c | 14 ++
2 files changed, 15 insertions(+)
diff --git a/include/hw/virtio/vhost-vdpa.h b
it. The
callback is also free to process the command by itself and use the
element with svq_push.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 31 +-
hw/virtio/vhost-shadow-virtqueue.c | 14 --
hw/virtio/vhost-vdpa.c | 3
Finally offering the possibility to enable SVQ from the command line.
Signed-off-by: Eugenio Pérez
Acked-by: Markus Armbruster
---
qapi/net.json| 9 +-
net/vhost-vdpa.c | 72 ++--
2 files changed, 77 insertions(+), 4 deletions(-)
diff --git
Do a simple forwarding of CVQ buffers, the same work SVQ could do but
through callbacks. No functional change intended.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/vhost-vdpa.h | 3 ++
hw/virtio/vhost-vdpa.c | 3 +-
net/vhost-vdpa.c | 58
It allows the Shadow Control VirtQueue to wait for the device to use the
available buffers.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 1 +
hw/virtio/vhost-shadow-virtqueue.c | 22 ++
2 files changed, 23 insertions(+)
diff --git a/hw/virtio/vhost
event
will be raised.
More cvq commands could be added here straightforwardly but they have
not been tested.
Signed-off-by: Eugenio Pérez
---
net/vhost-vdpa.c | 211 +--
1 file changed, 204 insertions(+), 7 deletions(-)
diff --git a/net/vhost-vdpa.c b
To know the device features is needed for CVQ SVQ, so SVQ knows if it
can handle all commands or not. Extract from
vhost_vdpa_get_max_queue_pairs so we can reuse it.
Signed-off-by: Eugenio Pérez
Acked-by: Jason Wang
---
net/vhost-vdpa.c | 30 --
1 file changed, 20
Since CVQ will be able to modify elements, the number of descriptors in
the guest may not match with the number of descriptors exposed. Track
separately.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 6 ++
hw/virtio/vhost-shadow-virtqueue.c | 10 +-
2 files
Shadow CVQ will copy buffers on qemu VA, so we avoid TOCTOU attacks from
the guest that could set a different state in qemu device model and vdpa
device.
To do so, it needs to be able to map these new buffers to the device.
Signed-off-by: Eugenio Pérez
Acked-by: Jason Wang
---
include/hw
This function allows external SVQ users to return guest's available
buffers.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 3 +++
hw/virtio/vhost-shadow-virtqueue.c | 16
2 files changed, 19 insertions(+)
diff --git a/hw/virtio/vhost-shadow-virtqueue.h
The series needs to expose vhost_svq_add with full functionality,
including kick
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index
This allows external parts of SVQ to forward custom buffers to the
device.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 3 +++
hw/virtio/vhost-shadow-virtqueue.c | 6 +++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/vhost-shadow
This will allow SVQ to add context to the different queue elements.
This patch only store the actual element, no functional change intended.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 8 ++--
hw/virtio/vhost-shadow-virtqueue.c | 32
vhost-vdpa control virtqueue needs to know the maximum entries supported
by the virtio-net device, so we know if it is possible to apply the
filter.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/virtio-net.h | 3 +++
hw/net/virtio-net.c| 1 -
2 files changed, 3 insertions(+), 1
/20220706184008.1649478-1-epere...@redhat.com/
Eugenio Pérez (19):
vhost: move descriptor translation to vhost_svq_vring_write_descs
virtio-net: Expose MAC_TABLE_ENTRIES
virtio-net: Expose ctrl virtqueue logic
vhost: Reorder vhost_svq_kick
vhost: Move vhost_svq_kick call to vhost_svq_add
vhost: Check
This allows external vhost-net devices to modify the state of the
VirtIO device model once the vhost-vdpa device has acknowledged the
control commands.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/virtio-net.h | 4 ++
hw/net/virtio-net.c| 84
.
Signed-off-by: Eugenio Pérez
Acked-by: Jason Wang
---
hw/virtio/vhost-shadow-virtqueue.c | 33 --
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index aee9891a67..b005a457c6 100644
It's done for both in and out descriptors so it's better placed here.
Acked-by: Jason Wang
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 38 +-
1 file changed, 27 insertions(+), 11 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
The series need to expose vhost_svq_add with full functionality,
including checking for full queue.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 59 +-
1 file changed, 33 insertions(+), 26 deletions(-)
diff --git a/hw/virtio/vhost-shadow
Return value is never checked and is a clean path, so assume success
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-vdpa.c | 33 ++---
1 file changed, 10 insertions(+), 23 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 66f054a12c
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow-virtqueue.c
index 56c96ebd13..9280285435 100644
--- a/hw/virtio/vhost-shadow-virtqueue.c
+++ b
Finally offering the possibility to enable SVQ from the command line.
Signed-off-by: Eugenio Pérez
---
qapi/net.json| 9 +-
net/vhost-vdpa.c | 74 ++--
2 files changed, 79 insertions(+), 4 deletions(-)
diff --git a/qapi/net.json b/qapi
The device may need to add migration blockers. For example, if vdpa
device uses features not compatible with migration.
Add the possibility here.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/vhost-vdpa.h | 1 +
hw/virtio/vhost-vdpa.c | 14 ++
2 files changed, 15
using vhost_svq_inject. An opaque data must be
given with it, and its returned to the callback at used_handler call.
In the case of networking, this will be used to inspect control
virtqueue messages status from the device.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 15
To know the device features is needed for CVQ SVQ, so SVQ knows if it
can handle all commands or not. Extract from
vhost_vdpa_get_max_queue_pairs so we can reuse it.
Signed-off-by: Eugenio Pérez
---
net/vhost-vdpa.c | 30 --
1 file changed, 20 insertions(+), 10
driver changes MAC the virtio-net device
model will be updated with the new one, and a rx filtering change event
will be raised.
Others cvq commands could be added here straightforwardly but they have
been not tested.
Signed-off-by: Eugenio Pérez
---
net/vhost-vdpa.c | 334
Do a simple forwarding of CVQ buffers, the same work SVQ could do but
through callbacks. No functional change intended.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/vhost-vdpa.h | 3 ++
hw/virtio/vhost-vdpa.c | 3 +-
net/vhost-vdpa.c | 59
it. The callback is
also free to process the command by itself and use the element with
svq_push.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 23 ++-
hw/virtio/vhost-shadow-virtqueue.c | 13 +++--
hw/virtio/vhost-vdpa.c | 2 +-
3 files
To notify the caller it needs to discard the element.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 11 +++
hw/virtio/vhost-shadow-virtqueue.c | 11 ++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.h
b
Shadow CVQ will copy buffers on qemu VA, so we avoid TOCTOU attacks that
can set a different state in qemu device model and vdpa device.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/vhost-vdpa.h | 4
hw/virtio/vhost-vdpa.c | 7 +++
2 files changed, 7 insertions(+), 4
This function allows external SVQ users to return guest's available
buffers.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 2 ++
hw/virtio/vhost-shadow-virtqueue.c | 16
2 files changed, 18 insertions(+)
diff --git a/hw/virtio/vhost-shadow-virtqueue.h
So later patches are cleaner
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-vdpa.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index d6ba4a492a..fccfc832ea 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost
SVQ is going to store it in SVQElement, so we need it before add functions.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow
It allows the Shadow Control VirtQueue to wait the device to use the commands
that restore the net device state after a live migration.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 1 +
hw/virtio/vhost-shadow-virtqueue.c | 54 --
2 files
We will allow SVQ user to store opaque data for each element, so its
easier if we store this kind of information just at avail.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 3 +++
hw/virtio/vhost-shadow-virtqueue.c | 14 --
2 files changed, 11 insertions
This allows qemu to inject buffers to the device.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 2 ++
hw/virtio/vhost-shadow-virtqueue.c | 37 ++
2 files changed, 39 insertions(+)
diff --git a/hw/virtio/vhost-shadow-virtqueue.h
b/hw/virtio
Return value is never checked and is a clean path, so assume success
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-vdpa.c | 33 ++---
1 file changed, 10 insertions(+), 23 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 66f054a12c
When qemu injects buffers to the vdpa device it will be used to maintain
contextual data. If SVQ has no operation, it will be used to maintain
the VirtQueueElement pointer.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 3 ++-
hw/virtio/vhost-shadow-virtqueue.c | 13
VirtQueueElement comes from the guest, but we're heading SVQ to be able
to inject element without the guest's knowledge.
To do so, make this accept sg buffers directly, instead of using
VirtQueueElement.
Add vhost_svq_add_element to maintain element convenience
Signed-off-by: Eugenio Pérez
It's done for both in and out descriptors so it's better placed here.
Acked-by: Jason Wang
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 38 +-
1 file changed, 27 insertions(+), 11 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
This will allow SVQ to add metadata to the different queue elements. To
simplify changes, only store actual element at this patch.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 8 --
hw/virtio/vhost-shadow-virtqueue.c | 41 --
2 files
This allows external vhost-net devices to modify the state of the
VirtIO device model once vhost-vdpa device has acknowledge the control
commands.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/virtio-net.h | 4 ++
hw/net/virtio-net.c| 84 --
2
Previous function misses the just picked avail buffer from the queue.
This way keeps blocking the used queue forever, but is cleaner to check
before calling to vhost_svq_get_buf.
Fixes: 100890f7cad50 ("vhost: Shadow virtqueue buffers forwarding")
Acked-by: Jason Wang
Signed-off-by: Eug
, using this work.
Comments are welcome.
[1]
https://patchwork.kernel.org/project/qemu-devel/cover/20220706184008.1649478-1-epere...@redhat.com/
Eugenio Pérez (22):
vhost: Return earlier if used buffers overrun
vhost: move descriptor translation to vhost_svq_vring_write_descs
vdpa: Clean
Shadow CVQ will copy buffers on qemu VA, so we avoid TOCTOU attacks that
can set a different state in qemu device model and vdpa device.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/vhost-vdpa.h | 4
hw/virtio/vhost-vdpa.c | 7 +++
2 files changed, 7 insertions(+), 4
This is needed so the destination vdpa device see the same state a the
guest set in the source.
Signed-off-by: Eugenio Pérez
---
net/vhost-vdpa.c | 49 +++-
1 file changed, 48 insertions(+), 1 deletion(-)
diff --git a/net/vhost-vdpa.c b/net/vhost
To notify the caller it needs to discard the element.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 11 +++
hw/virtio/vhost-shadow-virtqueue.c | 11 ++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.h
b
As a first step we only enable CVQ first than others. Future patches add
state restore.
Signed-off-by: Eugenio Pérez
---
net/vhost-vdpa.c | 19 +++
1 file changed, 19 insertions(+)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index e415cc8de5..77d013833f 100644
--- a/net
Finally offering the possibility to enable SVQ from the command line.
Signed-off-by: Eugenio Pérez
---
qapi/net.json| 9 +-
net/vhost-vdpa.c | 72 ++--
2 files changed, 77 insertions(+), 4 deletions(-)
diff --git a/qapi/net.json b/qapi
using vhost_svq_inject. An opaque data must be
given with it, and its returned to the callback at used_handler call.
In the case of networking, this will be used to inspect control
virtqueue messages and to recover status injection at the first time.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost
To know the device features is needed for CVQ SVQ, so SVQ knows if it
can handle all commands or not. Extract from
vhost_vdpa_get_max_queue_pairs so we can reuse it.
Signed-off-by: Eugenio Pérez
---
net/vhost-vdpa.c | 30 --
1 file changed, 20 insertions(+), 10
SVQ is going to store it in SVQElement, so we need it before add functions.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
b/hw/virtio/vhost-shadow
it. The callback is
also free to process the command by itself and use the element with
svq_push.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 16
hw/virtio/vhost-shadow-virtqueue.c | 8 +++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/hw
It allows the Shadow Control VirtQueue to wait the device to use the commands
that restore the net device state after a live migration.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 1 +
hw/virtio/vhost-shadow-virtqueue.c | 54 --
2 files
When qemu injects buffers to the vdpa device it will be used to maintain
contextual data. If SVQ has no operation, it will be used to maintain
the VirtQueueElement pointer.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 3 ++-
hw/virtio/vhost-shadow-virtqueue.c | 13
configuration. To avoid
that, we will not send vring_enable until all configuration is used by
the device.
As a first step, reverse the DRIVER_OK and SET_VRING_ENABLE steps.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-vdpa.c | 22 --
1 file changed, 16 insertions(+), 6
We will allow SVQ user to store opaque data for each element, so its
easier if we store this kind of information just at avail.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 3 +++
hw/virtio/vhost-shadow-virtqueue.c | 14 --
2 files changed, 11 insertions
This function allows external SVQ users to return guest's available
buffers.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 2 ++
hw/virtio/vhost-shadow-virtqueue.c | 16
2 files changed, 18 insertions(+)
diff --git a/hw/virtio/vhost-shadow-virtqueue.h
could be added here straightforwardly but they have
been not tested.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/vhost-vdpa.h | 3 +
hw/virtio/vhost-vdpa.c | 5 +-
net/vhost-vdpa.c | 373 +
3 files changed, 379 insertions(+), 2
This will allow SVQ to add metadata to the different queue elements. To
simplify changes, only store actual element at this patch.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 8 --
hw/virtio/vhost-shadow-virtqueue.c | 41 --
2 files
This allows external vhost-net devices to modify the state of the
VirtIO device model once vhost-vdpa device has acknowledge the control
commands.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/virtio-net.h | 4 ++
hw/net/virtio-net.c| 84 --
2
It's done for both in and out descriptors so it's better placed here.
Acked-by: Jason Wang
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.c | 39 +-
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/hw/virtio/vhost-shadow-virtqueue.c
from rfc v3:
* Fix bad returning of descriptors to SVQ list.
Changes from rfc v2:
* Fix use-after-free.
Changes from rfc v1:
* Rebase to latest master.
* Configure ASID instead of assuming cvq asid != data vqs asid.
* Update device model so (MAC) state can be migrated too.
Eugenio Pérez (23
This allows qemu to inject buffers to the device.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 2 ++
hw/virtio/vhost-shadow-virtqueue.c | 34 ++
2 files changed, 36 insertions(+)
diff --git a/hw/virtio/vhost-shadow-virtqueue.h
b/hw/virtio
Previous function misses the just picked avail buffer from the queue.
This way keeps blocking the used queue forever, but is cleaner to check
before calling to vhost_svq_get_buf.
Fixes: 100890f7cad50 ("vhost: Shadow virtqueue buffers forwarding")
Signed-off-by: Eugenio Pérez
---
hw/vi
VirtQueueElement comes from the guest, but we're heading SVQ to be able
to inject element without the guest's knowledge.
To do so, make this accept sg buffers directly, instead of using
VirtQueueElement.
Add vhost_svq_add_element to maintain element convenience
Signed-off-by: Eugenio Pérez
It allows to run commands at SVQ start.
Signed-off-by: Eugenio Pérez
---
hw/virtio/vhost-shadow-virtqueue.h | 18 +-
hw/virtio/vhost-shadow-virtqueue.c | 8 +++-
hw/virtio/vhost-vdpa.c | 17 -
3 files changed, 40 insertions(+), 3 deletions
The used idx used to match with this, but it will not match from the
moment we introduce svq_inject. Rewind all the descriptors not used by
vdpa device and get the vq state properly.
Signed-off-by: Eugenio Pérez
---
include/hw/virtio/virtio.h | 1 +
hw/virtio/vhost-vdpa.c | 7 +++
hw
This isolates shadow cvq in its own group.
Signed-off-by: Eugenio Pérez
---
qapi/net.json| 8 ++-
net/vhost-vdpa.c | 134 ---
2 files changed, 133 insertions(+), 9 deletions(-)
diff --git a/qapi/net.json b/qapi/net.json
index cd7a1b32fe
701 - 800 of 1363 matches
Mail list logo