[PATCH 4/4] vdpa: Allow VIRTIO_NET_F_CTRL_VLAN in SVQ

2023-07-19 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_VLAN feature. Co-developed-by: Eugenio Pérez Signed-off-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 0787dd933b..dfd271c456 100644 --- a/net

[PATCH 3/4] vdpa: Restore vlan filtering state

2023-07-19 Thread Hawkins Jiawei
This patch introduces vhost_vdpa_net_load_single_vlan() and vhost_vdpa_net_load_vlan() to restore the vlan filtering state at device's startup. Co-developed-by: Eugenio Pérez Signed-off-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c

[PATCH 0/4] Vhost-vdpa Shadow Virtqueue VLAN support

2023-07-19 Thread Hawkins Jiawei
``` - Execute the live migration in L2 source monitor - Result * with this series, gdb can hit the breakpoint and continue the executing without triggering any error or warning. Eugenio Pérez (1): virtio-net: do not reset vlan filtering at set_features Hawkins Jiawei (3): virtio-net

[PATCH 1/4] virtio-net: do not reset vlan filtering at set_features

2023-07-19 Thread Hawkins Jiawei
thout F_CTRL_VLAN") Signed-off-by: Eugenio Pérez Reviewed-by: Hawkins Jiawei Signed-off-by: Hawkins Jiawei --- hw/net/virtio-net.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 7102ec4817..d20d5a63cd 100644 --- a/hw/

[PATCH 2/4] virtio-net: Expose MAX_VLAN

2023-07-19 Thread Hawkins Jiawei
vhost-vdpa shadowed CVQ needs to know the maximum number of vlans supported by the virtio-net device, so QEMU can restore the VLAN state in a migration. Co-developed-by: Eugenio Pérez Signed-off-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- hw/net/virtio-net.c| 2 -- include

[PATCH v3 0/8] vdpa: Send all CVQ state load commands in parallel

2023-07-19 Thread Hawkins Jiawei
nge the type of `in_cursor`, and refactor the code for updating cursor - return directly when vhost_vdpa_net_load_{mac,mq}() returns a failure in vhost_vdpa_net_load() v1: https://lore.kernel.org/all/cover.1681732982.git.yin31...@gmail.com/ Hawkins Jiawei (8): vhost: Add argument to vhost_svq

[PATCH v3 1/8] vhost: Add argument to vhost_svq_poll()

2023-07-19 Thread Hawkins Jiawei
oring vhost_svq_poll() to accept a new argument `num`, which allows vhost_svq_poll() to wait for the device to use multiple elements, rather than polling for a single element. Signed-off-by: Hawkins Jiawei --- hw/virtio/vhost-shadow-virtqueue.c | 36 ++ hw/virtio/vhost-s

[PATCH v3 2/8] vdpa: Use iovec for vhost_vdpa_net_cvq_add()

2023-07-19 Thread Hawkins Jiawei
hieve this, this patch refactor vhost_vdpa_net_cvq_add() to accept `struct iovec`, which eliminates the coupling of control commands to `s->cvq_cmd_out_buffer` and `s->status`, allowing them to use their own buffer. Signed-off-by: Hawkins Jiawei --- net/vhost-

[PATCH v3 4/8] vdpa: Avoid using vhost_vdpa_net_load_*() outside vhost_vdpa_net_load()

2023-07-19 Thread Hawkins Jiawei
(), it is more elegant to send the CVQ commands directly without invoking vhost_vdpa_net_load_*() helpers. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index dd71008e08

[PATCH v3 8/8] vdpa: Send cvq state load commands in parallel

2023-07-19 Thread Hawkins Jiawei
and checking of buffers until either the SVQ is full or control commands shadow buffers are full. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1578 Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 157 +-- 1 file changed, 96 insertions

[PATCH v3 3/8] vhost: Expose vhost_svq_available_slots()

2023-07-19 Thread Hawkins Jiawei
poses vhost_svq_available_slots() and introduces a helper function, allowing QEMU to know whether the SVQ is full. Signed-off-by: Hawkins Jiawei --- hw/virtio/vhost-shadow-virtqueue.c | 2 +- hw/virtio/vhost-shadow-virtqueue.h | 1 + net/vhost-vdpa.c | 9 + 3 files change

[PATCH v3 5/8] vdpa: Check device ack in vhost_vdpa_net_load_rx_mode()

2023-07-19 Thread Hawkins Jiawei
Considering that vhost_vdpa_net_load_rx_mode() is only called within vhost_vdpa_net_load_rx() now, this patch refactors vhost_vdpa_net_load_rx_mode() to include a check for the device's ack, simplifying the code and improving its maintainability. Signed-off-by: Hawkins Jiawei --- net/

[PATCH v3 6/8] vdpa: Move vhost_svq_poll() to the caller of vhost_vdpa_net_cvq_add()

2023-07-19 Thread Hawkins Jiawei
commands shadow buffers are full. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 50 ++-- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index fe0ba19724..d06f38403f 100644 --- a/net/vhost-vdpa.c

[PATCH v3 7/8] vdpa: Add cursors to vhost_vdpa_net_loadx()

2023-07-19 Thread Hawkins Jiawei
device startup. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 79 ++-- 1 file changed, 50 insertions(+), 29 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index d06f38403f..795c9c1fd2 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost

Re: [PATCH 0/4] Vhost-vdpa Shadow Virtqueue VLAN support

2023-07-19 Thread Hawkins Jiawei
在 2023/7/19 15:47, Hawkins Jiawei 写道: > This series enables shadowed CVQ to intercept VLAN commands > through shadowed CVQ, update the virtio NIC device model > so qemu send it in a migration, and the restore of that > VLAN state in the destination. This patch series is based on

Re: [PATCH v3 0/8] vdpa: Send all CVQ state load commands in parallel

2023-07-19 Thread Hawkins Jiawei
在 2023/7/19 17:11, Michael S. Tsirkin 写道: > On Wed, Jul 19, 2023 at 03:53:45PM +0800, Hawkins Jiawei wrote: >> This patchset allows QEMU to delay polling and checking the device >> used buffer until either the SVQ is full or control commands shadow >> buffers are full, i

Re: [PATCH v3 0/8] vdpa: Send all CVQ state load commands in parallel

2023-07-19 Thread Hawkins Jiawei
在 2023/7/19 20:46, Michael S. Tsirkin 写道: > On Wed, Jul 19, 2023 at 08:35:50PM +0800, Hawkins Jiawei wrote: >> 在 2023/7/19 17:11, Michael S. Tsirkin 写道: >>> On Wed, Jul 19, 2023 at 03:53:45PM +0800, Hawkins Jiawei wrote: >>>> This patchset allows QEMU to delay p

Re: [PATCH v3 0/8] vdpa: Send all CVQ state load commands in parallel

2023-07-19 Thread Hawkins Jiawei
> Lei > > > On Wed, Jul 19, 2023 at 8:37 PM Hawkins Jiawei wrote: >> >> 在 2023/7/19 17:11, Michael S. Tsirkin 写道: >>> On Wed, Jul 19, 2023 at 03:53:45PM +0800, Hawkins Jiawei wrote: >>>> This patchset allows QEMU to delay polling and checking the device &

Re: [PATCH v3 0/8] vdpa: Send all CVQ state load commands in parallel

2023-07-20 Thread Hawkins Jiawei
20, 2023 at 6:54 AM Lei Yang wrote: >> >> On Wed, Jul 19, 2023 at 11:25 PM Hawkins Jiawei wrote: >>> >>> 在 2023/7/19 20:44, Lei Yang 写道: >>>> Hello Hawkins and Michael >>>> >>>> Looks like there are big changes about vp_vdpa, therefor

Re: [PATCH 3/4] vdpa: Restore vlan filtering state

2023-07-21 Thread Hawkins Jiawei
On 2023/7/21 19:57, Eugenio Perez Martin wrote: > On Wed, Jul 19, 2023 at 9:48 AM Hawkins Jiawei wrote: >> >> This patch introduces vhost_vdpa_net_load_single_vlan() >> and vhost_vdpa_net_load_vlan() to restore the vlan >> filtering state at device's startup. >

[PATCH v2 0/4] Vhost-vdpa Shadow Virtqueue VLAN support

2023-07-23 Thread Hawkins Jiawei
int and continue the executing without triggering any error or warning. Eugenio Pérez (1): virtio-net: do not reset vlan filtering at set_features Hawkins Jiawei (3): virtio-net: Expose MAX_VLAN vdpa: Restore vlan filtering state vdpa: Allow VIRTIO_NET_F_CTRL_VLAN in SVQ hw/net/virtio-n

[PATCH v2 2/4] virtio-net: Expose MAX_VLAN

2023-07-23 Thread Hawkins Jiawei
vhost-vdpa shadowed CVQ needs to know the maximum number of vlans supported by the virtio-net device, so QEMU can restore the VLAN state in a migration. Co-developed-by: Eugenio Pérez Signed-off-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- hw/net/virtio-net.c| 2 -- include

[PATCH v2 1/4] virtio-net: do not reset vlan filtering at set_features

2023-07-23 Thread Hawkins Jiawei
thout F_CTRL_VLAN") Signed-off-by: Eugenio Pérez Reviewed-by: Hawkins Jiawei Signed-off-by: Hawkins Jiawei --- hw/net/virtio-net.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 7102ec4817..d20d5a63cd 100644 --- a/hw/

[PATCH v2 4/4] vdpa: Allow VIRTIO_NET_F_CTRL_VLAN in SVQ

2023-07-23 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_VLAN feature. Co-developed-by: Eugenio Pérez Signed-off-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 347241796d..73e9063fa0 100644 --- a/net

[PATCH v2 3/4] vdpa: Restore vlan filtering state

2023-07-23 Thread Hawkins Jiawei
This patch introduces vhost_vdpa_net_load_single_vlan() and vhost_vdpa_net_load_vlan() to restore the vlan filtering state at device's startup. Co-developed-by: Eugenio Pérez Signed-off-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- v2: - remove the extra line pointed out by Eugeni

Re: [PATCH v2 1/4] virtio-net: do not reset vlan filtering at set_features

2023-07-23 Thread Hawkins Jiawei
On 2023/7/23 17:26, Hawkins Jiawei wrote: > From: Eugenio Pérez There was a wrong "From" line by mistake, I will send the v3 patch to fix this. Thanks! > > This function is called after virtio_load, so all vlan configuration is > lost in migration case. > > Ju

[PATCH v3 0/4] Vhost-vdpa Shadow Virtqueue VLAN support

2023-07-23 Thread Hawkins Jiawei
rtio-net: do not reset vlan filtering at set_features Hawkins Jiawei (3): virtio-net: Expose MAX_VLAN vdpa: Restore vlan filtering state vdpa: Allow VIRTIO_NET_F_CTRL_VLAN in SVQ hw/net/virtio-net.c| 6 + include/hw/virtio/virtio-net.h | 6 + net/vhost-vdpa.c |

[PATCH v3 1/4] virtio-net: do not reset vlan filtering at set_features

2023-07-23 Thread Hawkins Jiawei
t;) Signed-off-by: Eugenio Pérez Reviewed-by: Hawkins Jiawei Signed-off-by: Hawkins Jiawei --- v3: - remove the extra "From" line v2: https://lore.kernel.org/all/95af0d013281282f48ad3f47f6ad1ac4ca9e52eb.1690100802.git.yin31...@gmail.com/ hw/net/virtio-net.c | 4 +--- 1 file change

[PATCH v3 4/4] vdpa: Allow VIRTIO_NET_F_CTRL_VLAN in SVQ

2023-07-23 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_VLAN feature. Co-developed-by: Eugenio Pérez Signed-off-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 347241796d..73e9063fa0 100644 --- a/net

[PATCH v3 3/4] vdpa: Restore vlan filtering state

2023-07-23 Thread Hawkins Jiawei
This patch introduces vhost_vdpa_net_load_single_vlan() and vhost_vdpa_net_load_vlan() to restore the vlan filtering state at device's startup. Co-developed-by: Eugenio Pérez Signed-off-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- v2: - remove the extra line pointed out by Eugeni

[PATCH v3 2/4] virtio-net: Expose MAX_VLAN

2023-07-23 Thread Hawkins Jiawei
vhost-vdpa shadowed CVQ needs to know the maximum number of vlans supported by the virtio-net device, so QEMU can restore the VLAN state in a migration. Co-developed-by: Eugenio Pérez Signed-off-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- hw/net/virtio-net.c| 2 -- include

Re: [PATCH v2 3/4] vdpa: Restore vlan filtering state

2023-07-25 Thread Hawkins Jiawei
On 2023/7/25 14:47, Jason Wang wrote: > On Sun, Jul 23, 2023 at 5:28 PM Hawkins Jiawei wrote: >> >> This patch introduces vhost_vdpa_net_load_single_vlan() >> and vhost_vdpa_net_load_vlan() to restore the vlan >> filtering state at device's startup. >> >&g

Re: [PATCH v3 0/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR

2023-08-05 Thread Hawkins Jiawei
On 2023/8/5 14:15, Michael Tokarev wrote: > 04.07.2023 06:34, Hawkins Jiawei wrote: >> According to VirtIO standard, "The class, command and >> command-specific-data are set by the driver, >> and the device sets the ack byte. >> There is little it can do except iss

[PATCH v2 0/2] Send all the SVQ control commands in parallel

2023-05-06 Thread Hawkins Jiawei
`in_cursor`, and refactor the code for updating cursor - return directly when vhost_vdpa_net_load_{mac,mq}() returns a failure in vhost_vdpa_net_load() v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-04/msg02668.html Hawkins Jiawei (2): vdpa: rename vhost_vdpa_net_cvq_add() vdpa

[PATCH v2 2/2] vdpa: send CVQ state load commands in parallel

2023-05-06 Thread Hawkins Jiawei
. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1578 Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 152 +-- 1 file changed, 120 insertions(+), 32 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 10804c7200..14e31c

[PATCH v2 1/2] vdpa: rename vhost_vdpa_net_cvq_add()

2023-05-06 Thread Hawkins Jiawei
We want to introduce a new version of vhost_vdpa_net_cvq_add() that does not poll immediately after forwarding custom buffers to the device, so that QEMU can send all the SVQ control commands in parallel instead of serialized. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 15

[PATCH RESEND] vhost: fix possible wrap in SVQ descriptor ring

2023-05-06 Thread Hawkins Jiawei
of free descriptors. Then we can avoid wrap in SVQ descriptor ring by refactoring vhost_svq_available_slots(). Fixes: 100890f7ca ("vhost: Shadow virtqueue buffers forwarding") Signed-off-by: Hawkins Jiawei --- hw/virtio/vhost-shadow-virtqueue.c | 9 - hw/virtio/vhost-shadow-virtq

Re: [PATCH RESEND] vhost: fix possible wrap in SVQ descriptor ring

2023-05-08 Thread Hawkins Jiawei
Hi Eugenio, Thanks for reviewing. On 2023/5/9 1:26, Eugenio Perez Martin wrote: > On Sat, May 6, 2023 at 5:01 PM Hawkins Jiawei wrote: >> >> QEMU invokes vhost_svq_add() when adding a guest's element into SVQ. >> In vhost_svq_add(), it uses vhost_svq_available_slots(

[PATCH v2] vhost: fix possible wrap in SVQ descriptor ring

2023-05-09 Thread Hawkins Jiawei
s than possible. This patch solves it by adding `num_free` field in VhostShadowVirtqueue structure and updating this field in vhost_svq_add() and vhost_svq_get_buf(), to record the number of free descriptors. Fixes: 100890f7ca ("vhost: Shadow virtqueue buffers forwarding") Signed-off

Re: [PATCH v2 2/2] vdpa: send CVQ state load commands in parallel

2023-05-17 Thread Hawkins Jiawei
Sorry for forgetting cc when replying to the email. On Wed, 17 May 2023 at 16:22, Eugenio Perez Martin wrote: > > On Wed, May 17, 2023 at 7:22 AM Jason Wang wrote: > > > > On Sat, May 6, 2023 at 10:07 PM Hawkins Jiawei wrote: > > > > > > This patch introdu

Re: [PATCH v2 1/2] vdpa: rename vhost_vdpa_net_cvq_add()

2023-05-17 Thread Hawkins Jiawei
Sorry for forgetting cc when replying to the email. I will resend this email with cc. On Wed, 17 May 2023 at 12:12, Jason Wang wrote: > > On Sat, May 6, 2023 at 10:07 PM Hawkins Jiawei wrote: > > > > We want to introduce a new version of vhost_vdpa_net_cvq_add() that

Re: [PATCH v2 2/2] vdpa: send CVQ state load commands in parallel

2023-05-17 Thread Hawkins Jiawei
On 2023/5/18 14:12, Jason Wang wrote: > On Thu, May 18, 2023 at 2:00 PM Eugenio Perez Martin > wrote: >> >> On Thu, May 18, 2023 at 7:47 AM Jason Wang wrote: >>> >>> On Wed, May 17, 2023 at 11:02 PM Hawkins Jiawei wrote: >>>> >>>> Sorr

[PATCH 2/2] vdpa: send CVQ state load commands in parallel

2023-04-19 Thread Hawkins Jiawei
. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1578 Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 137 +++ 1 file changed, 102 insertions(+), 35 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 10804c7200..d1f711

[PATCH 1/2] vdpa: rename vhost_vdpa_net_cvq_add()

2023-04-19 Thread Hawkins Jiawei
We want to introduce a new version of vhost_vdpa_net_cvq_add() that does not poll immediately after forwarding custom buffers to the device, so that QEMU can send all the SVQ control commands in parallel instead of serialized. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 15

[PATCH 0/2] Send all the SVQ control commands in parallel

2023-04-19 Thread Hawkins Jiawei
resolves the GitLab issue at https://gitlab.com/qemu-project/qemu/-/issues/1578. Hawkins Jiawei (2): vdpa: rename vhost_vdpa_net_cvq_add() vdpa: send CVQ state load commands in parallel net/vhost-vdpa.c | 150 +++ 1 file changed, 112 insertions(+), 38

[PATCH] vhost: fix possible wrap in SVQ descriptor ring

2023-04-20 Thread Hawkins Jiawei
of free descriptors. Then we can avoid wrap in SVQ descriptor ring by refactoring vhost_svq_available_slots(). Fixes: 100890f7ca ("vhost: Shadow virtqueue buffers forwarding") Signed-off-by: Hawkins Jiawei --- hw/virtio/vhost-shadow-virtqueue.c | 9 - hw/virtio/vhost-shadow-virtq

Re: [PATCH 0/2] Send all the SVQ control commands in parallel

2023-04-20 Thread Hawkins Jiawei
On Thu, 20 Apr 2023 at 01:17, Eugenio Perez Martin wrote: > > On Wed, Apr 19, 2023 at 1:50 PM Hawkins Jiawei wrote: > > > > This patchset allows QEMU to poll and check the device used buffer > > after sending all SVQ control commands, instead of polling and checking >

Re: [PATCH 2/2] vdpa: send CVQ state load commands in parallel

2023-04-20 Thread Hawkins Jiawei
On Thu, 20 Apr 2023 at 01:43, Eugenio Perez Martin wrote: > > On Wed, Apr 19, 2023 at 1:50 PM Hawkins Jiawei wrote: > > > > This patch introduces the vhost_vdpa_net_cvq_add() and > > refactors the vhost_vdpa_net_load*(), so that QEMU can > > send CVQ state load co

Re: [PATCH 2/2] vdpa: send CVQ state load commands in parallel

2023-04-20 Thread Hawkins Jiawei
On Thu, 20 Apr 2023 at 19:38, Hawkins Jiawei wrote: > > On Thu, 20 Apr 2023 at 01:43, Eugenio Perez Martin > wrote: > > > > On Wed, Apr 19, 2023 at 1:50 PM Hawkins Jiawei wrote: > > > > > > + ++status) { > > > +if (*s

[PATCH 0/2] Vhost-vdpa Shadow Virtqueue Offloads support

2023-05-29 Thread Hawkins Jiawei
This series enables shadowed CVQ to intercept Offloads commands through shadowed CVQ, update the virtio NIC device model so qemu send it in a migration, and the restore of that Offloads state in the destination. Hawkins Jiawei (2): vdpa: Add vhost_vdpa_net_load_offloads vdpa: Allow

[PATCH 1/2] vdpa: Add vhost_vdpa_net_load_offloads

2023-05-29 Thread Hawkins Jiawei
This patch introduces vhost_vdpa_net_load_offloads() to restore offloads state at device's startup. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 37cdc84562..682c7

[PATCH 2/2] vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ

2023-05-29 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 682c749b19..cc52b7f0ad 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -85,6 +85,7

Re: [PATCH 0/2] Vhost-vdpa Shadow Virtqueue Offloads support

2023-05-30 Thread Hawkins Jiawei
On 2023/5/30 0:55, Eugenio Perez Martin wrote: > On Mon, May 29, 2023 at 3:18 PM Hawkins Jiawei wrote: >> >> This series enables shadowed CVQ to intercept Offloads commands >> through shadowed CVQ, update the virtio NIC device model so qemu >> send it in a migrati

[RFC PATCH 0/2] Vhost-vdpa Shadow Virtqueue Hash calculation Support

2023-08-11 Thread Hawkins Jiawei
or warning. Hawkins Jiawei (2): vdpa: Restore hash calculation state vdpa: Allow VIRTIO_NET_F_HASH_REPORT in SVQ net/vhost-vdpa.c | 89 1 file changed, 89 insertions(+) -- 2.25.1

[RFC PATCH 1/2] vdpa: Restore hash calculation state

2023-08-11 Thread Hawkins Jiawei
re is enabled in SVQ. Currently, vhost_vdpa_net_load_rss() could only be invoked when `do_rss` is set to false. Signed-off-by: Hawkins Jiawei --- Question: It seems that virtio_net_handle_rss() currently does not restore the hash key length parsed from the CVQ command sent from the guest into n->

[RFC PATCH 2/2] vdpa: Allow VIRTIO_NET_F_HASH_REPORT in SVQ

2023-08-11 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_HASH_REPORT feature. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index bd51020771..a13b267250 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -118,6 +118,7

[RFC PATCH 1/3] vdpa: Add SetSteeringEBPF method for NetClientState

2023-08-11 Thread Hawkins Jiawei
code maintainbility. Suggested-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 8 1 file changed, 8 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index a13b267250..4c8e4b19f6 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -238,6 +238,12

[RFC PATCH 2/3] vdpa: Restore receive-side scaling state

2023-08-11 Thread Hawkins Jiawei
This patch reuses vhost_vdpa_net_load_rss() with some refactorings to restore the receive-side scaling state at device's startup. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 53 1 file changed, 35 insertions(+), 18 deletions(-)

[RFC PATCH 0/3] Vhost-vdpa Shadow Virtqueue RSS Support

2023-08-11 Thread Hawkins Jiawei
- Execute the live migration in L2 source monitor - Result * with this series, L2 QEMU can execute without triggering any error or warning. L0 QEMU echo "Can't load eBPF RSS - fallback to software RSS". Hawkins Jiawei (3): vdpa: Add SetSteeringEBPF method for NetClientStat

[RFC PATCH 3/3] vdpa: Allow VIRTIO_NET_F_RSS in SVQ

2023-08-11 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_RSS feature. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 7870cbe142..eb08530396 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -119,6 +119,7 @@ static const

Re: [RFC PATCH 2/3] vdpa: Restore receive-side scaling state

2023-08-13 Thread Hawkins Jiawei
On 2023/8/11 23:28, Hawkins Jiawei wrote: > This patch reuses vhost_vdpa_net_load_rss() with some > refactorings to restore the receive-side scaling state > at device's startup. > > Signed-off-by: Hawkins Jiawei > --- &g

[RFC PATCH v2 1/3] vdpa: Add SetSteeringEBPF method for NetClientState

2023-08-13 Thread Hawkins Jiawei
code maintainbility. Suggested-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 8 1 file changed, 8 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index a13b267250..4c8e4b19f6 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -238,6 +238,12

[RFC PATCH v2 2/3] vdpa: Restore receive-side scaling state

2023-08-13 Thread Hawkins Jiawei
This patch reuses vhost_vdpa_net_load_rss() with some refactorings to restore the receive-side scaling state at device's startup. Signed-off-by: Hawkins Jiawei --- v2: - Correct the feature usage to VIRTIO_NET_F_HASH_REPORT when loading the hash calculation state v1: https://lore.kerne

[RFC PATCH v2 3/3] vdpa: Allow VIRTIO_NET_F_RSS in SVQ

2023-08-13 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_RSS feature. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index e21b3ac67a..2a276ef528 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -119,6 +119,7 @@ static const

[RFC PATCH v2 0/3] Vhost-vdpa Shadow Virtqueue RSS Support

2023-08-13 Thread Hawkins Jiawei
monitor - Result * with this series, L2 QEMU can execute without triggering any error or warning. L0 QEMU echo "Can't load eBPF RSS - fallback to software RSS". Hawkins Jiawei (3): vdpa: Add SetSteeringEBPF method for NetClientState vdpa: Restore receive-side scaling stat

Re: [PATCH v3 1/7] vdpa: Use iovec for vhost_vdpa_net_load_cmd()

2023-08-17 Thread Hawkins Jiawei
On 2023/8/17 17:23, Eugenio Perez Martin wrote: > On Fri, Jul 7, 2023 at 5:27 PM Hawkins Jiawei wrote: >> >> According to VirtIO standard, "The driver MUST follow >> the VIRTIO_NET_CTRL_MAC_TABLE_SET command by a le32 number, >> followed by that number of non-mult

Re: [PATCH v3 2/7] vdpa: Restore MAC address filtering state

2023-08-17 Thread Hawkins Jiawei
On 2023/8/17 18:18, Eugenio Perez Martin wrote: > On Fri, Jul 7, 2023 at 5:27 PM Hawkins Jiawei wrote: >> >> This patch refactors vhost_vdpa_net_load_mac() to >> restore the MAC address filtering state at device's startup. >> >> Signed-off-by: Hawkins Jiawei

Re: [PATCH v3 1/7] vdpa: Use iovec for vhost_vdpa_net_load_cmd()

2023-08-17 Thread Hawkins Jiawei
在 2023/8/17 22:05, Eugenio Perez Martin 写道: > On Thu, Aug 17, 2023 at 2:42 PM Hawkins Jiawei wrote: >> >> On 2023/8/17 17:23, Eugenio Perez Martin wrote: >>> On Fri, Jul 7, 2023 at 5:27 PM Hawkins Jiawei wrote: >>>> >>>> According to V

Re: [PATCH v3 1/8] vhost: Add argument to vhost_svq_poll()

2023-08-19 Thread Hawkins Jiawei
On 2023/8/18 23:08, Eugenio Perez Martin wrote: > On Wed, Jul 19, 2023 at 9:54 AM Hawkins Jiawei wrote: >> > > The subject could be more explicit. What about "add count argument to > vhost_svq_poll"? Hi Eugenio, Thanks for reviewing. You are right, I will use this

Re: [PATCH v3 2/8] vdpa: Use iovec for vhost_vdpa_net_cvq_add()

2023-08-19 Thread Hawkins Jiawei
On 2023/8/18 23:23, Eugenio Perez Martin wrote: > On Wed, Jul 19, 2023 at 9:54 AM Hawkins Jiawei wrote: >> >> Next patches in this series will no longer perform an >> immediate poll and check of the device's used buffers >> for each CVQ state load command. Consequ

Re: [PATCH v3 4/8] vdpa: Avoid using vhost_vdpa_net_load_*() outside vhost_vdpa_net_load()

2023-08-19 Thread Hawkins Jiawei
On 2023/8/18 23:39, Eugenio Perez Martin wrote: > On Wed, Jul 19, 2023 at 9:54 AM Hawkins Jiawei wrote: >> >> Next patches in this series will refactor vhost_vdpa_net_load_cmd() >> to iterate through the control commands shadow buffers, allowing QEMU >> to send CVQ stat

Re: [PATCH v3 6/8] vdpa: Move vhost_svq_poll() to the caller of vhost_vdpa_net_cvq_add()

2023-08-19 Thread Hawkins Jiawei
On 2023/8/18 23:48, Eugenio Perez Martin wrote: > On Wed, Jul 19, 2023 at 9:54 AM Hawkins Jiawei wrote: >> >> This patch moves vhost_svq_poll() to the caller of >> vhost_vdpa_net_cvq_add() and introduces a helper funtion. >> >> By making this change, next pat

Re: [PATCH v3 8/8] vdpa: Send cvq state load commands in parallel

2023-08-19 Thread Hawkins Jiawei
On 2023/8/19 01:27, Eugenio Perez Martin wrote: > On Wed, Jul 19, 2023 at 9:54 AM Hawkins Jiawei wrote: >> >> This patch enables sending CVQ state load commands >> in parallel at device startup by following steps: >> >>* Refactor vhost_vdpa_net_load_cmd()

Re: [PATCH v4 3/8] vhost: Expose vhost_svq_available_slots()

2023-10-07 Thread Hawkins Jiawei
在 2023/10/4 01:44, Eugenio Perez Martin 写道: > On Tue, Aug 29, 2023 at 7:55 AM Hawkins Jiawei wrote: >> >> Next patches in this series will delay the polling >> and checking of buffers until either the SVQ is >> full or control commands shadow buffers are full, >&g

Re: [PATCH v4 4/8] vdpa: Avoid using vhost_vdpa_net_load_*() outside vhost_vdpa_net_load()

2023-10-07 Thread Hawkins Jiawei
在 2023/10/4 01:48, Eugenio Perez Martin 写道: > On Tue, Aug 29, 2023 at 7:55 AM Hawkins Jiawei wrote: >> >> Next patches in this series will refactor vhost_vdpa_net_load_cmd() >> to iterate through the control commands shadow buffers, allowing QEMU >> to send CVQ state l

Re: [PATCH v4 7/8] vdpa: Introduce cursors to vhost_vdpa_net_loadx()

2023-10-07 Thread Hawkins Jiawei
在 2023/10/4 15:21, Eugenio Perez Martin 写道: > On Tue, Aug 29, 2023 at 7:55 AM Hawkins Jiawei wrote: >> >> This patch introduces two new arugments, `out_cursor` >> and `in_cursor`, to vhost_vdpa_net_loadx(). Addtionally, >> it includes a helper function >> vhost

Re: [PATCH v4 8/8] vdpa: Send cvq state load commands in parallel

2023-10-07 Thread Hawkins Jiawei
在 2023/10/4 15:33, Eugenio Perez Martin 写道: > On Tue, Aug 29, 2023 at 7:55 AM Hawkins Jiawei wrote: >> >> This patch enables sending CVQ state load commands >> in parallel at device startup by following steps: >> >>* Refactor vhost_vdpa_net_load_cmd()

Re: [PATCH v3 0/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR

2023-07-05 Thread Hawkins Jiawei
QEMU should not trigger any errors or warnings. With the series applied, QEMU should trigger the warning like "qemu-system-x86_64: unable to start vhost net: 5: falling back on userspace virtio". Thanks! > Thanks > Lei > > On Tue, Jul 4, 2023 at 11:36 AM Hawkins Jiawei wrote:

[PATCH v3 6/7] vdpa: Avoid forwarding large CVQ command failures

2023-07-07 Thread Hawkins Jiawei
or SVQ. Fixes: 7a7f87e94c ("vdpa: Move command buffers map to start of net device") Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 162 ++- 1 file changed, 161 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c

[PATCH v3 2/7] vdpa: Restore MAC address filtering state

2023-07-07 Thread Hawkins Jiawei
This patch refactors vhost_vdpa_net_load_mac() to restore the MAC address filtering state at device's startup. Signed-off-by: Hawkins Jiawei --- v3: - return early if mismatch the condition suggested by Eugenio v2: https://lore.kernel.org/all/2f2560f749186c0eb1055f9926f464587e4

[PATCH v3 3/7] vdpa: Restore packet receive filtering state relative with _F_CTRL_RX feature

2023-07-07 Thread Hawkins Jiawei
This patch introduces vhost_vdpa_net_load_rx_mode() and vhost_vdpa_net_load_rx() to restore the packet receive filtering state in relation to VIRTIO_NET_F_CTRL_RX feature at device's startup. Signed-off-by: Hawkins Jiawei --- v3: - return early if mismatch the condition suggested by Eu

[PATCH v3 5/7] vdpa: Accessing CVQ header through its structure

2023-07-07 Thread Hawkins Jiawei
We can access the CVQ header through `struct virtio_net_ctrl_hdr`, instead of accessing it through a `uint8_t` pointer, which improves the code's readability and maintainability. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

[PATCH v3 4/7] vhost: Fix false positive out-of-bounds

2023-07-07 Thread Hawkins Jiawei
94eda ("vdpa: Add custom IOTLB translations to SVQ") Signed-off-by: Hawkins Jiawei --- 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 1b1d85306c..49e5aed931

[PATCH v3 7/7] vdpa: Allow VIRTIO_NET_F_CTRL_RX in SVQ

2023-07-07 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_RX feature. Signed-off-by: Hawkins Jiawei Acked-by: Eugenio Pérez --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index a4ff6c52b7..0994836f8c 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c

[PATCH v3 1/7] vdpa: Use iovec for vhost_vdpa_net_load_cmd()

2023-07-07 Thread Hawkins Jiawei
stored in contiguous memory, this patch refactors vhost_vdpa_net_load_cmd() to accept scattered data, eliminating the need for an addtional data copy or packing the data into s->cvq_cmd_out_buffer outside of vhost_vdpa_net_load_cmd(). Signed-off-by: Hawkins Jiawei --- v3: - rename arg

[PATCH v3 0/7] Vhost-vdpa Shadow Virtqueue _F_CTRL_RX commands support

2023-07-07 Thread Hawkins Jiawei
lures suggested by Eugenio by patch 5 "vdpa: Accessing CVQ header through its structure" and patch 6 "vdpa: Avoid forwarding large CVQ command failures" v2: https://lore.kernel.org/all/cover.1688051252.git.yin31...@gmail.com/ - refactor vhost_vdpa_net_load_cmd() to accept iovec suggested by E

[PATCH 0/1] vdpa: Fix possible use-after-free for VirtQueueElement

2023-07-07 Thread Hawkins Jiawei
"free(): double free detected in tcache 2". Hawkins Jiawei (1): vdpa: Fix possible use-after-free for VirtQueueElement net/vhost-vdpa.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) -- 2.25.1

[PATCH 1/1] vdpa: Fix possible use-after-free for VirtQueueElement

2023-07-07 Thread Hawkins Jiawei
ward CVQ buffers") Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 373609216f..d8f37694ac 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -825,7 +825,16 @@ out:

[PATCH v3 0/2] Vhost-vdpa Shadow Virtqueue _F_CTRL_RX_EXTRA commands support

2023-07-08 Thread Hawkins Jiawei
relative with _F_CTRL_RX_EXTRA feature" v2: https://lore.kernel.org/all/cover.1688365324.git.yin31...@gmail.com/ - avoid sending CVQ command in default state suggested by Eugenio v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg04956.html Hawkins Jiawei (2): vdpa: Restore packet rec

[PATCH v3 1/2] vdpa: Restore packet receive filtering state relative with _F_CTRL_RX_EXTRA feature

2023-07-08 Thread Hawkins Jiawei
This patch refactors vhost_vdpa_net_load_rx() to restore the packet receive filtering state in relation to VIRTIO_NET_F_CTRL_RX_EXTRA feature at device's startup. Signed-off-by: Hawkins Jiawei --- v3: - return early if mismatch the condition suggested by Eugenio - remove the `on` var

[PATCH v3 2/2] vdpa: Allow VIRTIO_NET_F_CTRL_RX_EXTRA in SVQ

2023-07-08 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_RX_EXTRA feature. Signed-off-by: Hawkins Jiawei Acked-by: Eugenio Pérez --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 9a1905fddd..1df82636c9 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost

Re: [PATCH] vdpa: Increase out buffer size for CVQ commands

2023-07-10 Thread Hawkins Jiawei
On 2023/7/11 2:52, Michael S. Tsirkin wrote: > On Mon, Jun 26, 2023 at 04:26:04PM +0800, Hawkins Jiawei wrote: >> It appears that my commit message and comments did not take this into >> account. I will refactor them in the v2 patch.. > > does not look like you ever sent

Re: [PATCH] vdpa: Increase out buffer size for CVQ commands

2023-07-12 Thread Hawkins Jiawei
在 2023/7/12 18:45, Michael Tokarev 写道: > 11.07.2023 04:48, Hawkins Jiawei wrote: > .. >> Sorry for not mentioning that I have moved the patch to the patch series >> titled "Vhost-vdpa Shadow Virtqueue _F_CTRL_RX commands support" at [1]. >> The reason for thi

[PATCH RFC 2/2] vdpa: Allow VIRTIO_NET_F_CTRL_RX_EXTRA in SVQ

2023-06-23 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_RX_EXTRA feature. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 9b929762c5..cdfe8e454e 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -100,6 +100,7

[PATCH RFC 1/2] vdpa: Restore packet receive filtering state relative with _F_CTRL_RX_EXTRA feature

2023-06-23 Thread Hawkins Jiawei
This patch refactors vhost_vdpa_net_load_rx() to restore the packet receive filtering state in relation to VIRTIO_NET_F_CTRL_RX_EXTRA feature at device's startup. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 30 ++ 1 file changed, 30 insertions(+) diff

[PATCH RFC 0/2] Vhost-vdpa Shadow Virtqueue _F_CTRL_RX_EXTRA commands support

2023-06-23 Thread Hawkins Jiawei
[1]. https://lore.kernel.org/all/cover.1687402580.git.yin31...@gmail.com/ Hawkins Jiawei (2): vdpa: Restore packet receive filtering state relative with _F_CTRL_RX_EXTRA feature vdpa: Allow VIRTIO_NET_F_CTRL_RX_EXTRA in SVQ net/vhost-vdpa.c | 31 +++ 1 file changed,

Re: [PATCH] vdpa: Increase out buffer size for CVQ commands

2023-06-26 Thread Hawkins Jiawei
On 2023/6/25 18:48, Eugenio Perez Martin wrote: > On Thu, Jun 22, 2023 at 3:07 AM Hawkins Jiawei wrote: >> >> According to the VirtIO standard, "Since there are no guarantees, >> it can use a hash filter or silently switch to >> allmulti or promiscuous mode i

Re: [PATCH RFC 1/3] vdpa: Restore MAC address filtering state

2023-06-26 Thread Hawkins Jiawei
On 2023/6/25 18:37, Eugenio Perez Martin wrote: > On Thu, Jun 22, 2023 at 5:02 AM Hawkins Jiawei wrote: >> >> This patch refactors vhost_vdpa_net_load_mac() to >> restore the MAC address filtering state at device's startup. >> >> Signed-off-by: Hawkins Jia

Re: [PATCH RFC 2/3] vdpa: Restore packet receive filtering state relative with _F_CTRL_RX feature

2023-06-26 Thread Hawkins Jiawei
On 2023/6/25 18:56, Eugenio Perez Martin wrote: > On Thu, Jun 22, 2023 at 5:02 AM Hawkins Jiawei wrote: >> >> This patch introduces vhost_vdpa_net_load_rx_mode() >> and vhost_vdpa_net_load_rx() to restore the packet >> receive filtering state in relation to >>

Re: [PATCH RFC 1/2] vdpa: Restore packet receive filtering state relative with _F_CTRL_RX_EXTRA feature

2023-06-26 Thread Hawkins Jiawei
On 2023/6/25 18:54, Eugenio Perez Martin wrote: > On Fri, Jun 23, 2023 at 3:26 PM Hawkins Jiawei wrote: >> >> This patch refactors vhost_vdpa_net_load_rx() to >> restore the packet receive filtering state in relation to >> VIRTIO_NET_F_CTRL_RX_EXTRA feature at device&

  1   2   3   >