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

2023-06-27 Thread Hawkins Jiawei
On 2023/6/26 17:08, Eugenio Perez Martin wrote: > On Mon, Jun 26, 2023 at 10:26 AM Hawkins Jiawei wrote: >> >> 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

[PATCH v2] vdpa: Return -EINVAL if device ack is VIRTIO_NET_ERR

2023-06-27 Thread Hawkins Jiawei
es this problem by returning -EINVAL when the device's ack is not VIRTIO_NET_OK. Fixes: f73c0c43ac ("vdpa: extract vhost_vdpa_net_load_mac from vhost_vdpa_net_load") Fixes: f64c7cda69 ("vdpa: Add vhost_vdpa_net_load_mq") Fixes: 0b58d3686a ("vdpa: Add vhost_vdpa_net_load_

[PATCH RFC v2 0/4] Vhost-vdpa Shadow Virtqueue _F_CTRL_RX commands support

2023-06-29 Thread Hawkins Jiawei
suggested by Eugenio v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg04423.html Hawkins Jiawei (4): vdpa: Use iovec for vhost_vdpa_net_load_cmd() vdpa: Restore MAC address filtering state vdpa: Restore packet receive filtering state relative with _F_CTRL_RX feature vdpa

[PATCH RFC v2 1/4] vdpa: Use iovec for vhost_vdpa_net_load_cmd()

2023-06-29 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 --- v2: - refactor vhost_

[PATCH RFC v2 2/4] vdpa: Restore MAC address filtering state

2023-06-29 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 --- v2: - use iovec suggested by Eugenio - avoid sending CVQ command in default state v1: https://lore.kernel.or

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

2023-06-29 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 --- v2: - avoid sending CVQ command in default state suggest

[PATCH RFC v2 4/4] vdpa: Allow VIRTIO_NET_F_CTRL_RX in SVQ

2023-06-29 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 9d5d88756c..0410a52043 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c

[PATCH v2 1/2] vdpa: delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits

2023-06-30 Thread Hawkins Jiawei
This entry was duplicated on referenced commit. Removing it. Fixes: 402378407dbd ("vhost-vdpa: multiqueue support") Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index e19ab063fa..0479988a79 10

[PATCH v2 0/2] vdpa: refactor vdpa_feature_bits array

2023-06-30 Thread Hawkins Jiawei
/archive/html/qemu-devel/2023-06/msg01583.html Hawkins Jiawei (2): vdpa: delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits vdpa: order vdpa_feature_bits array net/vhost-vdpa.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) -- 2.25.1

[PATCH v2 2/2] vdpa: order vdpa_feature_bits array

2023-06-30 Thread Hawkins Jiawei
This patch reorganizes the vdpa_feature_bits array in ascending order based on its value to avoid future duplicates. Signed-off-by: Hawkins Jiawei --- v2: - resolve conflicts with the master branch v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg01585.html net/vhost-vdpa.c

Re: [PATCH v2 2/2] vdpa: order vdpa_feature_bits array

2023-06-30 Thread Hawkins Jiawei
On 2023/6/30 18:20, Philippe Mathieu-Daudé wrote: > On 30/6/23 10:54, Hawkins Jiawei wrote: >> This patch reorganizes the vdpa_feature_bits array >> in ascending order based on its value to avoid future duplicates. >> >> Signed-off-by: Hawkins Jiawei >> --- >

[PATCH v3 0/2] vdpa: Refactor vdpa_feature_bits array

2023-06-30 Thread Hawkins Jiawei
/archive/html/qemu-devel/2023-06/msg06764.html - resolve conflicts with the master branch v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg01583.html Hawkins Jiawei (2): vdpa: Delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits vdpa: Sort vdpa_feature_bits array alphabetically

[PATCH v3 1/2] vdpa: Delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits

2023-06-30 Thread Hawkins Jiawei
This entry was duplicated on referenced commit. Removing it. Fixes: 402378407dbd ("vhost-vdpa: multiqueue support") Signed-off-by: Hawkins Jiawei Reviewed-by: Philippe Mathieu-Daudé --- net/vhost-vdpa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vh

[PATCH v3 2/2] vdpa: Sort vdpa_feature_bits array alphabetically

2023-06-30 Thread Hawkins Jiawei
This patch sorts the vdpa_feature_bits array alphabetically in ascending order to avoid future duplicates. Signed-off-by: Hawkins Jiawei --- v3: - sort array alphabetically suggested by Philippe v2: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg06766.html - resolve conflicts

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

2023-07-02 Thread Hawkins Jiawei
is merged. [1]. https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg06559.html Changelog = v2: - 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 pac

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

2023-07-03 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 4919e18208..e10a0128c3 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost

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

2023-07-03 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 --- v2: - avoid sending CVQ command in default state suggested by Eugenio v1:

Re: [PATCH RFC 1/1] vdpa: Return -EINVAL if device's ack is VIRTIO_NET_ERR

2023-07-03 Thread Hawkins Jiawei
On 2023/7/4 0:38, Eugenio Perez Martin wrote: > On Wed, Jun 14, 2023 at 3:02 PM 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. >> Th

Re: [PATCH RFC 1/1] vdpa: Return -EINVAL if device's ack is VIRTIO_NET_ERR

2023-07-03 Thread Hawkins Jiawei
On 2023/7/4 0:52, Michael S. Tsirkin wrote: > On Wed, Jun 14, 2023 at 09:01:47PM +0800, 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

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

2023-07-03 Thread Hawkins Jiawei
x the same bug in vhost_vdpa_net_load_offloads() v1: https://lore.kernel.org/all/cover.1686746406.git.yin31...@gmail.com/ Hawkins Jiawei (3): vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mac() vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mq() vdpa: Return -EIO if

[PATCH v3 1/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mac()

2023-07-03 Thread Hawkins Jiawei
s this problem by returning -EIO when the device's ack is not VIRTIO_NET_OK. Fixes: f73c0c43ac ("vdpa: extract vhost_vdpa_net_load_mac from vhost_vdpa_net_load") Signed-off-by: Hawkins Jiawei Acked-by: Jason Wang Acked-by: Eugenio Pérez --- v3: - split the fixes suggested by

[PATCH v3 3/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_offloads()

2023-07-03 Thread Hawkins Jiawei
atch fixes this problem by returning -EIO when the device's ack is not VIRTIO_NET_OK. Fixes: 0b58d3686a ("vdpa: Add vhost_vdpa_net_load_offloads()") Signed-off-by: Hawkins Jiawei Acked-by: Jason Wang Acked-by: Eugenio Pérez --- v3: - split the fixes suggested by Eugenio - return -EI

[PATCH v3 2/3] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mq()

2023-07-03 Thread Hawkins Jiawei
s this problem by returning -EIO when the device's ack is not VIRTIO_NET_OK. Fixes: f64c7cda69 ("vdpa: Add vhost_vdpa_net_load_mq") Signed-off-by: Hawkins Jiawei Acked-by: Jason Wang Acked-by: Eugenio Pérez --- v3: - split the fixes suggested by Eugenio - return -EI

Re: [PATCH RFC v2 1/4] vdpa: Use iovec for vhost_vdpa_net_load_cmd()

2023-07-04 Thread Hawkins Jiawei
On 2023/7/4 22:17, Eugenio Perez Martin wrote: > On Thu, Jun 29, 2023 at 5:25 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 RFC v2 2/4] vdpa: Restore MAC address filtering state

2023-07-04 Thread Hawkins Jiawei
On 2023/7/4 22:53, Eugenio Perez Martin wrote: > On Thu, Jun 29, 2023 at 5:26 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 J

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

2023-07-04 Thread Hawkins Jiawei
On 2023/7/4 23:39, Eugenio Perez Martin wrote: > On Thu, Jun 29, 2023 at 5:26 PM 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 v2 3/4] vdpa: Restore packet receive filtering state relative with _F_CTRL_RX feature

2023-07-04 Thread Hawkins Jiawei
On 2023/7/5 14:40, Eugenio Perez Martin wrote: > On Wed, Jul 5, 2023 at 4:09 AM Hawkins Jiawei wrote: >> >> On 2023/7/4 23:39, Eugenio Perez Martin wrote: >>> On Thu, Jun 29, 2023 at 5:26 PM Hawkins Jiawei wrote: >>>> >>>> This patch i

Re: [PATCH RFC v2 2/4] vdpa: Restore MAC address filtering state

2023-07-05 Thread Hawkins Jiawei
On 2023/7/5 14:29, Eugenio Perez Martin wrote: > On Wed, Jul 5, 2023 at 3:43 AM Hawkins Jiawei wrote: >> >> On 2023/7/4 22:53, Eugenio Perez Martin wrote: >>> On Thu, Jun 29, 2023 at 5:26 PM Hawkins Jiawei wrote: >>>> >>>> This patch refactors v

[PATCH RFC 0/1] Return -EINVAL if device's ack is VIRTIO_NET_ERR

2023-06-14 Thread Hawkins Jiawei
]. Because this patch has not been merged yet, so I will submit the v2 patch to fix the problem in that patch once the pending patch has been successfully merged. [1]. https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00504.html Hawkins Jiawei (1): vdpa: Return -EINVAL if device's

[PATCH RFC 1/1] vdpa: Return -EINVAL if device's ack is VIRTIO_NET_ERR

2023-06-14 Thread Hawkins Jiawei
es this problem by returning -EINVAL when the device's ack is not VIRTIO_NET_OK. Fixes: f73c0c43ac ("vdpa: extract vhost_vdpa_net_load_mac from vhost_vdpa_net_load") Fixes: f64c7cda69 ("vdpa: Add vhost_vdpa_net_load_mq") Signed-off-by: Hawkins Jiawei --- net/vhost-vd

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

2023-06-21 Thread Hawkins Jiawei
a need for more than thoes entries, we can increase the value for vhost_vdpa_net_cvq_cmd_page_len() in the future, mapping more than one page for command output. Fixes: 7a7f87e94c ("vdpa: Move command buffers map to start of net device") Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c

[PATCH RFC 0/3] Vhost-vdpa Shadow Virtqueue _F_CTRL_RX commands support

2023-06-21 Thread Hawkins Jiawei
conflicts [2], which have not been merged. I will submit the v2 patch after they are merged. [1]. https://lore.kernel.org/all/cover.1685704856.git.yin31...@gmail.com/ [2]. https://lore.kernel.org/all/cover.1686746406.git.yin31...@gmail.com/ Hawkins Jiawei (3): vdpa: Restore MAC address filtering state

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

2023-06-21 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 --- net/vhost-vdpa.c

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

2023-06-21 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 --- net/vhost-vdpa.c | 39 ++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c

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

2023-06-21 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_RX 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 355a6aef15..ca800f97e2 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -99,6 +99,7 @@ static

Re: [PATCH 1/2] vdpa: Add vhost_vdpa_net_load_offloads

2023-05-31 Thread Hawkins Jiawei
On 2023/5/30 0:19, Eugenio Perez Martin wrote: > On Mon, May 29, 2023 at 3:18 PM Hawkins Jiawei wrote: >> >> This patch introduces vhost_vdpa_net_load_offloads() to >> restore offloads state at device's startup. >> >> Signed-off-by: Hawkins Jia

Re: [PATCH 1/2] vdpa: Add vhost_vdpa_net_load_offloads

2023-05-31 Thread Hawkins Jiawei
On 2023/5/31 14:37, Eugenio Perez Martin wrote: > On Wed, May 31, 2023 at 3:47 AM Jason Wang wrote: >> >> On Mon, May 29, 2023 at 9:18 PM Hawkins Jiawei wrote: >>> >>> This patch introduces vhost_vdpa_net_load_offloads() to >>> restore offloads state

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

2023-06-01 Thread Hawkins Jiawei
virtio_vdev_has_feature() suggested by Eugenio and Jason - avoid sending CVQ command in default state suggested by Eugenio v1: https://lore.kernel.org/all/cover.1685359572.git.yin31...@gmail.com/ Hawkins Jiawei (6): include/hw/virtio: make some VirtIODevice const vdpa: reuse virtio_vdev_has_feature

[PATCH v2 4/6] virtio-net: expose virtio_net_supported_guest_offloads()

2023-06-01 Thread Hawkins Jiawei
To support restoring offloads state in vdpa, need to expose the function virtio_net_supported_guest_offloads(), then vdpa uses this function to get the guest supported offloads. Signed-off-by: Hawkins Jiawei --- hw/net/virtio-net.c| 2 +- include/hw/virtio/virtio-net.h | 1 + 2

[PATCH v2 1/6] include/hw/virtio: make some VirtIODevice const

2023-06-01 Thread Hawkins Jiawei
The VirtIODevice structure is not modified in virtio_vdev_has_feature(). Therefore, make it const to allow this function to accept const variables. Signed-off-by: Hawkins Jiawei --- include/hw/virtio/virtio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/virtio

[PATCH v2 3/6] hw/net/virtio-net: make some VirtIONet const

2023-06-01 Thread Hawkins Jiawei
The VirtIONet structure is not modified in virtio_net_supported_guest_offloads(). Therefore, make it const to allow this function to accept const variables. Signed-off-by: Hawkins Jiawei --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/virtio

[PATCH v2 5/6] vdpa: Add vhost_vdpa_net_load_offloads()

2023-06-01 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 | 38 ++ 1 file changed, 38 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index e907a

[PATCH v2 6/6] vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ

2023-06-01 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature. Signed-off-by: Hawkins Jiawei Acked-by: Jason Wang --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 0e647886d1..4cc24a2997 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost

[PATCH v2 2/6] vdpa: reuse virtio_vdev_has_feature()

2023-06-01 Thread Hawkins Jiawei
We can use virtio_vdev_has_feature() instead of manually accessing the features. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 37cdc84562..e907a3c792 100644 --- a/net/vhost

Re: [PATCH v2 4/6] virtio-net: expose virtio_net_supported_guest_offloads()

2023-06-01 Thread Hawkins Jiawei
On Thu, 1 Jun 2023 at 16:48, Hawkins Jiawei wrote: > > To support restoring offloads state in vdpa, need to expose > the function virtio_net_supported_guest_offloads(), then vdpa > uses this function to get the guest supported offloads. Here it should be changed to "then QEMU u

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

2023-06-01 Thread Hawkins Jiawei
eems that testing it is not feasible at the moment due to the migration blocker. And you can test on my v3 patch, I will send the v3 patch to the mailing lists later. Thank you for your efforts! > > > > > On Thu, Jun 1, 2023 at 4:29 PM Hawkins Jiawei wrote: >> >> This seri

[PATCH v3 1/6] include/hw/virtio: make some VirtIODevice const

2023-06-01 Thread Hawkins Jiawei
The VirtIODevice structure is not modified in virtio_vdev_has_feature(). Therefore, make it const to allow this function to accept const variables. Signed-off-by: Hawkins Jiawei --- include/hw/virtio/virtio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/virtio

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

2023-06-01 Thread Hawkins Jiawei
xpose virtio_net_supported_guest_offloads()" v2: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00044.html v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-05/msg07198.html Hawkins Jiawei (6): include/hw/virtio: make some VirtIODevice const vdpa: reuse virtio_vdev_h

[PATCH v3 2/6] vdpa: reuse virtio_vdev_has_feature()

2023-06-01 Thread Hawkins Jiawei
We can use virtio_vdev_has_feature() instead of manually accessing the features. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 37cdc84562..e907a3c792 100644 --- a/net/vhost

[PATCH v3 6/6] vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ

2023-06-01 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature. Signed-off-by: Hawkins Jiawei Acked-by: Jason Wang --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 0e647886d1..4cc24a2997 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost

[PATCH v3 4/6] virtio-net: expose virtio_net_supported_guest_offloads()

2023-06-01 Thread Hawkins Jiawei
To support restoring offloads state in vdpa, need to expose the function virtio_net_supported_guest_offloads(). QEMU uses this function to get the guest supported offloads and no needs to send the corresponding CVQ command if guest enables all supported features. Signed-off-by: Hawkins Jiawei

[PATCH v3 3/6] hw/net/virtio-net: make some VirtIONet const

2023-06-01 Thread Hawkins Jiawei
The VirtIONet structure is not modified in virtio_net_supported_guest_offloads(). Therefore, make it const to allow this function to accept const variables. Signed-off-by: Hawkins Jiawei --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/virtio

[PATCH v3 5/6] vdpa: Add vhost_vdpa_net_load_offloads()

2023-06-01 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 | 38 ++ 1 file changed, 38 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index e907a

Re: [PATCH v2 4/6] virtio-net: expose virtio_net_supported_guest_offloads()

2023-06-01 Thread Hawkins Jiawei
On 2023/6/1 21:43, Eugenio Perez Martin wrote: > On Thu, Jun 1, 2023 at 11:05 AM Hawkins Jiawei wrote: >> >> On Thu, 1 Jun 2023 at 16:48, Hawkins Jiawei wrote: >>> >>> To support restoring offloads state in vdpa, need to expose >>> the function virtio

Re: [PATCH v3 4/6] virtio-net: expose virtio_net_supported_guest_offloads()

2023-06-01 Thread Hawkins Jiawei
On 2023/6/1 22:37, Eugenio Perez Martin wrote: > On Thu, Jun 1, 2023 at 3:49 PM Hawkins Jiawei wrote: >> >> To support restoring offloads state in vdpa, need to expose >> the function virtio_net_supported_guest_offloads(). >> QEMU uses this function to get the guest s

Re: [PATCH v3 5/6] vdpa: Add vhost_vdpa_net_load_offloads()

2023-06-02 Thread Hawkins Jiawei
On 2023/6/1 22:12, Eugenio Perez Martin wrote: > On Thu, Jun 1, 2023 at 3:49 PM Hawkins Jiawei wrote: >> >> This patch introduces vhost_vdpa_net_load_offloads() to >> restore offloads state at device's startup. >> >> Signed-off-by: Hawkins Jia

[PATCH v4 5/6] vdpa: Add vhost_vdpa_net_load_offloads()

2023-06-02 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 | 42 ++ 1 file changed, 42 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c

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

2023-06-02 Thread Hawkins Jiawei
tps://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00206.html v2: https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00044.html v1: https://lists.nongnu.org/archive/html/qemu-devel/2023-05/msg07198.html Hawkins Jiawei (6): include/hw/virtio: make some VirtIODevice const vdpa:

[PATCH v4 3/6] hw/net/virtio-net: make some VirtIONet const

2023-06-02 Thread Hawkins Jiawei
The VirtIONet structure is not modified in virtio_net_supported_guest_offloads(). Therefore, make it const to allow this function to accept const variables. Signed-off-by: Hawkins Jiawei Reviewed-by: Eugenio Pérez --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v4 1/6] include/hw/virtio: make some VirtIODevice const

2023-06-02 Thread Hawkins Jiawei
The VirtIODevice structure is not modified in virtio_vdev_has_feature(). Therefore, make it const to allow this function to accept const variables. Signed-off-by: Hawkins Jiawei Reviewed-by: Eugenio Pérez Martin --- include/hw/virtio/virtio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v4 4/6] virtio-net: expose virtio_net_supported_guest_offloads()

2023-06-02 Thread Hawkins Jiawei
to get the device supported offloads. This allows QEMU to know the device's defaults and skip the control message sending if these defaults align with the driver's configuration. Note that the device's defaults can mismatch the driver's configuration only at live migration.

[PATCH v4 6/6] vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ

2023-06-02 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature. Signed-off-by: Hawkins Jiawei Acked-by: Jason Wang 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 1a295af51d..5a72204899 100644 --- a/net/vhost

[PATCH v4 2/6] vdpa: reuse virtio_vdev_has_feature()

2023-06-02 Thread Hawkins Jiawei
We can use virtio_vdev_has_feature() instead of manually accessing the features. Signed-off-by: Hawkins Jiawei Acked-by: Eugenio Pérez --- net/vhost-vdpa.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 37cdc84562..e907a3c792

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

2023-06-02 Thread Hawkins Jiawei
r, I noticed a small correction. In the argument '-netdev', the value of member 'x-svq' should be 'true' instead of 'on'. I have tested these patches using a vp-vdpa device, and without them, I encountered an error "vpda svq is not available for feature 4" w

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

2023-06-03 Thread Hawkins Jiawei
On 2023/6/3 1:47, Eugenio Perez Martin wrote: > On Fri, Jun 2, 2023 at 1:52 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

[PATCH RFC 2/2] vdpa: order vdpa_feature_bits array

2023-06-07 Thread Hawkins Jiawei
This patch reorganizes the vdpa_feature_bits array in ascending order based on its value to avoid future duplicates. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost

[PATCH RFC 0/2] vdpa: refactor vdpa_feature_bits array

2023-06-07 Thread Hawkins Jiawei
VIRTIO_NET_F_CTRL_GUEST_OFFLOADS entry into vdpa_feature_bits array in order. [1]. https://lists.nongnu.org/archive/html/qemu-devel/2023-06/msg00601.html Hawkins Jiawei (2): vdpa: delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits vdpa: order vdpa_feature_bits array net/vhost-vdpa.c

[PATCH RFC 1/2] vdpa: delete duplicated VIRTIO_NET_F_RSS in vdpa_feature_bits

2023-06-07 Thread Hawkins Jiawei
This entry was duplicated on referenced commit. Removing it. Fixes: 402378407dbd ("vhost-vdpa: multiqueue support") Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 37cdc84562..d90c8e2796 10

Re: [PULL 08/83] vdpa: Restore hash calculation state

2023-10-19 Thread Hawkins Jiawei
在 2023/10/20 02:07, Michael S. Tsirkin 写道: > On Thu, Oct 19, 2023 at 09:32:28AM -0700, Stefan Hajnoczi wrote: >> On Wed, 18 Oct 2023 at 08:56, Michael S. Tsirkin wrote: >>> >>> From: Hawkins Jiawei >>> >>> This patch introduces vhost_vdpa_net_load_rs

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

2023-10-21 Thread Hawkins Jiawei
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. Hawkins Jiawei (2): vdpa: Restore hash calculation state vdpa: Allow VIRTIO_NET_F_HA

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

2023-10-21 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_HASH_REPORT feature. Signed-off-by: Hawkins Jiawei --- v3: no code changes v2: https://lore.kernel.org/all/a67d4abc2c8c5c7636addc729daa5432fa8193bd.1693297766.git.yin31...@gmail.com/ net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost

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

2023-10-21 Thread Hawkins Jiawei
This patch introduces vhost_vdpa_net_load_rss() to restore the hash calculation state at device's startup. Signed-off-by: Hawkins Jiawei --- v3: - remove the `do_rss` argument in vhost_vdpa_net_load_rss() - zero reserved fields in "cfg" manually instead of using memset() to p

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

2023-10-21 Thread Hawkins Jiawei
L2 source guest, run the following bash command: ```bash #!/bin/sh ethtool -K eth0 rxhash on ``` - 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

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

2023-10-21 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 --- v4: - add do_rss argument and relative code in vhost_vdpa_net_load_rss() v3: https://lore.kernel.or

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

2023-10-21 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_RSS feature. Signed-off-by: Hawkins Jiawei --- v4: no code changes v3: https://lore.kernel.org/all/2d2a378291bfac4144a0c0c473cf80415bb580b3.1693299194.git.yin31...@gmail.com/ net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b

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

2023-10-21 Thread Hawkins Jiawei
code maintainbility. Suggested-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- v4: no code changes v3: https://lore.kernel.org/all/30509e3c3b07bcadd95d5932aeb16820cb022902.1693299194.git.yin31...@gmail.com/ net/vhost-vdpa.c | 8 1 file changed, 8 insertions(+) diff --git a/net

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

2023-10-22 Thread Hawkins Jiawei
在 2023/10/22 18:00, Michael S. Tsirkin 写道: > On Sun, Oct 22, 2023 at 10:00:48AM +0800, Hawkins Jiawei wrote: >> This patch introduces vhost_vdpa_net_load_rss() to restore >> the hash calculation state at device's startup. >> >> Signed-off-by: Hawkins Jiawei

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

2023-10-24 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_HASH_REPORT feature. Signed-off-by: Hawkins Jiawei --- v4: - no changes v3: https://lore.kernel.org/all/c3b69f0a65600722c1e4d3aa14d53a71e8ffb888.1697902949.git.yin31...@gmail.com/ - no code changes v2: https://lore.kernel.org/all

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

2023-10-24 Thread Hawkins Jiawei
xecuting without triggering any error or warning. Hawkins Jiawei (2): vdpa: Restore hash calculation state vdpa: Allow VIRTIO_NET_F_HASH_REPORT in SVQ net/vhost-vdpa.c | 92 1 file changed, 92 insertions(+) -- 2.25.1

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

2023-10-24 Thread Hawkins Jiawei
This patch introduces vhost_vdpa_net_load_rss() to restore the hash calculation state at device's startup. Signed-off-by: Hawkins Jiawei --- v4: - fix some typos pointed out by Michael - zero the `cfg` fields at the definition suggested by Michael v3: https://patchwork.kernel.org/pr

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

2023-10-24 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 --- v5: - resolve conflict with the updated patch "Vhost-vdpa Shadow Virtqueue Hash calculation Support&qu

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

2023-10-24 Thread Hawkins Jiawei
code maintainbility. Suggested-by: Eugenio Pérez Signed-off-by: Hawkins Jiawei --- v5: - no changes v4: https://lore.kernel.org/all/1c6faf4c5c3304c0bf14929143ccedb2e90dbcb2.1697904740.git.yin31...@gmail.com/ - no code changes v3: https://lore.kernel.org/all

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

2023-10-24 Thread Hawkins Jiawei
hout 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 state vdpa: Allow VIRTIO_NET_F_RSS in SVQ net/vhost-vdpa.c | 76 +++

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

2023-10-24 Thread Hawkins Jiawei
Enable SVQ with VIRTIO_NET_F_RSS feature. Signed-off-by: Hawkins Jiawei --- v5: - no changes v4: https://lore.kernel.org/all/4ee7f3f339469f41626ca2c3ac7b1c574ebce901.1697904740.git.yin31...@gmail.com/ - no code changes v3: https://lore.kernel.org/all

[PATCH v5 4/7] vdpa: Move vhost_svq_poll() to the caller of vhost_vdpa_net_cvq_add()

2023-10-13 Thread Hawkins Jiawei
commands shadow buffers are full. Signed-off-by: Hawkins Jiawei --- v5: - no change v4: https://lore.kernel.org/all/496c542c22ae1b4222175d5576c949621c7c2fc0.1693287885.git.yin31...@gmail.com/ - always check the return value of vhost_vdpa_net_svq_poll() suggested Eugenio v3: https

[PATCH v5 7/7] vdpa: Send cvq state load commands in parallel

2023-10-13 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 Acked-by: Eugenio Pérez --- v5: - remove the assertion suggested by Eugenio - inline the

[PATCH v5 5/7] vdpa: Introduce cursors to vhost_vdpa_net_loadx()

2023-10-13 Thread Hawkins Jiawei
uffers, allowing QEMU to send CVQ state load commands in parallel at device startup. Signed-off-by: Hawkins Jiawei --- v5: - move iov_copy() call before vhost_vdpa_net_cvq_add() and add comments for iov_copy() to improve readability - fix conflicts with master branch v4: https://lore.kernel.o

[PATCH v5 6/7] vhost: Expose vhost_svq_available_slots()

2023-10-13 Thread Hawkins Jiawei
poses vhost_svq_available_slots(), allowing QEMU to know whether the SVQ is full. Signed-off-by: Hawkins Jiawei Acked-by: Eugenio Pérez --- v5: - inline the vhost_svq_available_slots() in the caller and remove the helper function from this patch suggested by Eugenio v4: https://lore.kernel.or

[PATCH v5 1/7] vdpa: Use iovec for vhost_vdpa_net_cvq_add()

2023-10-13 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 Acked-by: Eugenio Pérez --- v5: - no change

[PATCH v5 3/7] vdpa: Check device ack in vhost_vdpa_net_load_rx_mode()

2023-10-13 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 Acked-by: Eu

[PATCH v5 0/7] vdpa: Send all CVQ state load commands in parallel

2023-10-13 Thread Hawkins Jiawei
* without this series, QEMU should not trigger any warning or error except something like "vhost_vdpa_net_load() = 20848 us" Hawkins Jiawei (7): vdpa: Use iovec for vhost_vdpa_net_cvq_add() vdpa: Avoid using vhost_vdpa_net_load_*() outside vhost_vdpa_net_load() vdpa: Check de

[PATCH v5 2/7] vdpa: Avoid using vhost_vdpa_net_load_*() outside vhost_vdpa_net_load()

2023-10-13 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 Acked-by: Eugenio Pérez --- v5: - remove redundant initialization statement suggested by Eugenio - remove assertion suggested by Eugenio v4: https

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

2023-08-28 Thread Hawkins Jiawei
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 count argument to vhost_svq_poll() vdpa: Use iovec for vhost_vdpa_net_cvq_add(

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

2023-08-28 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 --- v4: - split `in` to `vdpa_in` and `model_

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

2023-08-28 Thread Hawkins Jiawei
uffers, allowing QEMU to send CVQ state load commands in parallel at device startup. Signed-off-by: Hawkins Jiawei --- v4: - use `struct iovec` instead of `void **` as cursor suggested by Eugenio - add vhost_vdpa_net_load_cursor_reset() helper function to reset the cursors - re

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

2023-08-28 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 Acked-by: Eugenio Pérez --- v4: - refactor subject line suggested by Eugenio v3: https://lore.kerne

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

2023-08-28 Thread Hawkins Jiawei
commands shadow buffers are full. Signed-off-by: Hawkins Jiawei --- v4: - always check the return value of vhost_vdpa_net_svq_poll() suggested Eugenio v3: https://lore.kernel.org/all/152177c4e7082236fba9d31d535e40f8c2984349.1689748694.git.yin31...@gmail.com/ net/vhost-vdpa.c | 53

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

2023-08-28 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 --- v4: - pack CVQ command by iov_from_buf() instead of accessing `out` directly suggested by Eugenio v3: https://lore.kernel.org/all

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

2023-08-28 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 --- v4: - refactor argument `cmds_in_flight` to `len` for vhost_vdpa_net_svq_full() - check the return

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

2023-08-28 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 Acked-by: Eu

<    1   2   3   >