[Qemu-devel] [PATCH v4 06/11] virtio: get avail bytes check for packed ring

2019-02-13 Thread wexu
From: Wei Xu Add packed ring headcount check. Common part of split/packed ring are kept. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 197 - 1 file changed, 179 insertions(+), 18 deletions(-) diff --git a/hw/virtio/virtio.c

[Qemu-devel] [PATCH v4 09/11] virtio-net: update the head descriptor in a chain lastly

2019-02-13 Thread wexu
From: Wei Xu This is a helper for packed ring. To support packed ring, the head descriptor in a chain should be updated lastly since no 'avail_idx' like in packed ring to explicitly tell the driver side that all payload is ready after having done the chain, so the head is always visible

[Qemu-devel] [PATCH v4 08/11] virtio: event suppression support for packed ring

2019-02-13 Thread wexu
From: Wei Xu Difference between 'avail_wrap_counter' and 'last_avail_wrap_counter': For Tx(guest transmitting), they are the same after each pop of a desc. For Rx(guest receiving), they are also the same when there are enough descriptors to carry the payload for a packet(e.g. usually 16 descs

[Qemu-devel] [PATCH v4 10/11] virtio: migration support for packed ring

2019-02-13 Thread wexu
From: Wei Xu Both userspace and vhost-net/user are supported with this patch. A new subsection is introduced for packed ring, only 'last_avail_idx' and 'last_avail_wrap_counter' are saved/loaded presumably based on all the others relevant data(inuse, used/avail index and wrap count should be

[Qemu-devel] [PATCH v4 05/11] virtio: queue/descriptor check helpers for packed ring

2019-02-13 Thread wexu
From: Wei Xu These are descriptor available and queue empty check helpers. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 56 +- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH v4 11/11] virtio: CLI and provide packed ring feature bit by default

2019-02-13 Thread wexu
From: Wei Xu Add userspace and vhost kernel/user support. Add CLI "ring_packed=true/false" to enable/disable packed ring provision. Usage: -device virtio-net-pci,netdev=xx,mac=xx:xx:xx:xx:xx:xx,ring_packed=false By default it is provided. Signed-off-by: Wei Xu --- hw/net/vhost_net.c

[Qemu-devel] [PATCH v4 01/11] virtio: rename structure for packed ring

2019-02-13 Thread wexu
From: Wei Xu Redefine packed ring structure according to Qemu nomenclature. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index a1ff647..eafb4cc 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [PATCH v4 00/11] packed ring virtio-net backends support

2019-02-13 Thread wexu
From: Wei Xu https://github.com/Whishay/qemu.git Userspace and vhost-net backend test has been done with upstream kernel in guest. v3->v4: - add version number to the subject of each patch.(mst) v2->v3: v2/01 - drop it since the header has been synchronized from kernel.(mst & jason)

[Qemu-devel] [PATCH v4 07/11] virtio: fill/flush/pop for packed ring

2019-02-13 Thread wexu
From: Wei Xu last_used_idx/wrap_counter should be equal to last_avail_idx/wrap_counter after a successful flush. Batching in vhost-net & dpdk testpmd is not equivalently supported in userspace backend, but a chained descriptors for Rx is similarly presented as a lightweight batch, so a write

[Qemu-devel] [PATCH v4 04/11] virtio: initialize wrap counter for packed ring

2019-02-13 Thread wexu
From: Wei Xu Set to 'true' by default due to spec. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 1a98e61..54dc098 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1238,6 +1238,9 @@

[Qemu-devel] [PATCH v4 03/11] virtio: initialize packed ring region

2019-02-13 Thread wexu
From: Wei Xu Initialize packed ring memory region with correct size and attribute. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 6769e54..1a98e61 100644 ---

[Qemu-devel] [PATCH v4 02/11] virtio: device/driver area size calculation helper for split ring

2019-02-13 Thread wexu
From: Wei Xu There is slight size difference between split/packed rings. This is a refactor of split ring as well as a helper to expand device and driver area size calculation for packed ring. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 16 ++-- 1 file changed, 10

[Qemu-devel] [PATCH 10/11] virtio: migration support for packed ring

2019-02-13 Thread wexu
From: Wei Xu Both userspace and vhost-net/user are supported with this patch. A new subsection is introduced for packed ring, only 'last_avail_idx' and 'last_avail_wrap_counter' are saved/loaded presumably based on all the others relevant data(inuse, used/avail index and wrap count should be

[Qemu-devel] [PATCH 05/11] virtio: queue/descriptor check helpers for packed ring

2019-02-13 Thread wexu
From: Wei Xu These are descriptor available and queue empty check helpers. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 56 +- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH 11/11] virtio: CLI and provide packed ring feature bit by default

2019-02-13 Thread wexu
From: Wei Xu Add userspace and vhost kernel/user support. Add CLI "ring_packed=true/false" to enable/disable packed ring provision. Usage: -device virtio-net-pci,netdev=xx,mac=xx:xx:xx:xx:xx:xx,ring_packed=false By default it is provided. Signed-off-by: Wei Xu --- hw/net/vhost_net.c

[Qemu-devel] [PATCH 06/11] virtio: get avail bytes check for packed ring

2019-02-13 Thread wexu
From: Wei Xu Add packed ring headcount check. Common part of split/packed ring are kept. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 197 - 1 file changed, 179 insertions(+), 18 deletions(-) diff --git a/hw/virtio/virtio.c

[Qemu-devel] [PATCH 03/11] virtio: initialize packed ring region

2019-02-13 Thread wexu
From: Wei Xu Initialize packed ring memory region with correct size and attribute. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 6769e54..1a98e61 100644 ---

[Qemu-devel] [PATCH 08/11] virtio: event suppression support for packed ring

2019-02-13 Thread wexu
From: Wei Xu Difference between 'avail_wrap_counter' and 'last_avail_wrap_counter': For Tx(guest transmitting), they are the same after each pop of a desc. For Rx(guest receiving), they are also the same when there are enough descriptors to carry the payload for a packet(e.g. usually 16 descs

[Qemu-devel] [PATCH 02/11] virtio: device/driver area size calculation helper for split ring

2019-02-13 Thread wexu
From: Wei Xu There is slight size difference between split/packed rings. This is a refactor of split ring as well as a helper to expand device and driver area size calculation for packed ring. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 16 ++-- 1 file changed, 10

[Qemu-devel] [PATCH 04/11] virtio: initialize wrap counter for packed ring

2019-02-13 Thread wexu
From: Wei Xu Set to 'true' by default due to spec. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 1a98e61..54dc098 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1238,6 +1238,9 @@

[Qemu-devel] [PATCH 07/11] virtio: fill/flush/pop for packed ring

2019-02-13 Thread wexu
From: Wei Xu last_used_idx/wrap_counter should be equal to last_avail_idx/wrap_counter after a successful flush. Batching in vhost-net & dpdk testpmd is not equivalently supported in userspace backend, but a chained descriptors for Rx is similarly presented as a lightweight batch, so a write

[Qemu-devel] [PATCH 09/11] virtio-net: update the head descriptor in a chain lastly

2019-02-13 Thread wexu
From: Wei Xu This is a helper for packed ring. To support packed ring, the head descriptor in a chain should be updated lastly since no 'avail_idx' like in packed ring to explicitly tell the driver side that all payload is ready after having done the chain, so the head is always visible

[Qemu-devel] [PATCH 01/11] virtio: rename structure for packed ring

2019-02-13 Thread wexu
From: Wei Xu Redefine packed ring structure according to Qemu nomenclature. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index a1ff647..eafb4cc 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [PATCH v3 00/11] packed ring virtio-net backends support

2019-02-13 Thread wexu
From: Wei Xu https://github.com/Whishay/qemu.git Userspace and vhost-net backedn test has been done with upstream kernel in guest. v2->v3 v2/01 - drop it since the header has been synchronized from kernel.(mst & jason) v3/01 - rename 'avail_wrap_counter' to 'last_avail_wrap_counter',

[Qemu-devel] [PATCH v2 15/15] virtio: enable packed ring via a new command line

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- include/hw/virtio/virtio.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 9c1fa07..cb286bb 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@

[Qemu-devel] [PATCH v2 14/15] vhost: enable packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index fb4b18f..f593086 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -53,6 +53,7 @@ static const int kernel_feature_bits[] = {

[Qemu-devel] [PATCH v2 11/15] virtio: add userspace migration for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 0bcf8a5..722a4fd 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2346,6 +2346,13 @@

[Qemu-devel] [PATCH v2 09/15] virtio: event suppression support for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 121 +++-- 1 file changed, 118 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 5562ecd..0bcf8a5 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [PATCH v2 12/15] virtio: add vhost-net migration for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 27 --- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 722a4fd..0cb912e 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2991,17

[Qemu-devel] [PATCH v2 13/15] virtio: packed ring feature bit for userspace backend

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index e037db6..fb4b18f 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -78,6 +78,7 @@ static const int user_feature_bits[] = {

[Qemu-devel] [PATCH v2 07/15] virtio: get avail bytes check for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 180 + 1 file changed, 167 insertions(+), 13 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index e728201..cb599e9 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [PATCH v2 06/15] virtio: init and desc empty check for packed ring

2019-01-16 Thread wexu
From: Wei Xu ring check and other basical helpers for packed ring. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 59 +- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH v2 08/15] virtio: fill/flush/pop for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 295 ++--- 1 file changed, 278 insertions(+), 17 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index cb599e9..5562ecd 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [PATCH v2 10/15] virtio-net: fill head desc after done all in a chain

2019-01-16 Thread wexu
From: Wei Xu With the support of marking a descriptor used/unused in 'flags' field for 1.1, the current way of filling a chained descriptors does not work since driver side may get the wrong 'num_buffer' information in case of the head descriptor has been filled in while the subsequent ones are

[Qemu-devel] [PATCH v2 05/15] virtio: init wrap counter for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 454da3d..833289e 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1239,6 +1239,9 @@ void virtio_reset(void *opaque)

[Qemu-devel] [PATCH v2 00/15] packed ring virtio-net backends support

2019-01-16 Thread wexu
From: Wei Xu v1->v2: - fix patchew complaint - only set/get last_avail_idx/wrap_counter for vhost migration(Maxime) - replace 'out_num' and 'in_num' with 'elem_entries'in packed_pop()(Maxime) - set last used idx/wrap_counter to last avail ones when flushing(Maxime) - replace

[Qemu-devel] [PATCH v2 03/15] virtio: expand offset calculation for packed ring

2019-01-16 Thread wexu
From: Wei Xu Expand 1.0 to 1.1 by adding offset calculation accordingly. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 827e745..112845c 100644 ---

[Qemu-devel] [PATCH v2 02/15] virtio: redefine structure & memory cache for packed ring

2019-01-16 Thread wexu
From: Wei Xu Redefine packed ring structure according to Qemu nomenclature, field data(wrap counter, etc) are introduced also. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 16 1 file changed, 16 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH v2 04/15] virtio: add memory region init for packed ring

2019-01-16 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 112845c..454da3d 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -156,10 +156,8 @@ static void

[Qemu-devel] [PATCH v2 01/15] virtio: introduce packed ring definitions

2019-01-16 Thread wexu
From: Wei Xu >From 1.1 spec. Signed-off-by: Wei Xu --- include/standard-headers/linux/virtio_config.h | 15 + include/standard-headers/linux/virtio_ring.h | 43 ++ 2 files changed, 58 insertions(+) diff --git a/include/standard-headers/linux/virtio_config.h

[Qemu-devel] [PATCH v1 15/16] vhost: enable packed ring

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index fb4b18f..f593086 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -53,6 +53,7 @@ static const int kernel_feature_bits[] = {

[Qemu-devel] [PATCH v1 16/16] virtio: enable packed ring via a new command line

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- include/hw/virtio/virtio.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index a6fdf3f..36fc4ef 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@

[Qemu-devel] [PATCH v1 14/16] virtio: packed ring feature bit for userspace backend

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index e037db6..fb4b18f 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -78,6 +78,7 @@ static const int user_feature_bits[] = {

[Qemu-devel] [PATCH v1 12/16] virtio: add userspace migration of packed ring

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 240c4e3..64d5c04 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2558,6 +2558,12 @@ int

[Qemu-devel] [PATCH v1 13/16] virtio: add vhost-net migration of packed ring

2018-11-22 Thread wexu
From: Wei Xu tweaked vhost-net code to test migration. @@ -1414,64 +1430,20 @@ long vhost_vring_ioctl(struct vhost_dev r = -EFAULT; break; } + vq->last_avail_idx = s.num & 0x7FFF; + /* Forget the cached index value. */ +

[Qemu-devel] [PATCH v1 10/16] virtio: event suppression support for packed ring

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 121 +++-- 1 file changed, 118 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 99a6601..240c4e3 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [PATCH v1 07/16] virtio: init and desc empty check for packed ring

2018-11-22 Thread wexu
From: Wei Xu ring check and other basical helpers for packed ring. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 59 +- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH v1 09/16] virtio: fill/flush/pop for packed ring

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 290 + 1 file changed, 273 insertions(+), 17 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 13265e3..99a6601 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [PATCH v1 06/16] virtio: init wrap counter for packed ring

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 99565c6..74d9710 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1239,6 +1239,9 @@ void virtio_reset(void *opaque)

[Qemu-devel] [PATCH v1 11/16] virtio-net: fill head desc after done all in a chain

2018-11-22 Thread wexu
From: Wei Xu With the support of marking a descriptor used/unused in 'flags' field for 1.1, the current way of filling a chained descriptors does not work since driver side may get the wrong 'num_buffer' information in case of the head descriptor has been filled in while the subsequent ones are

[Qemu-devel] [PATCH v1 05/16] virtio: add memory region init for packed ring

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index a41c2d3..99565c6 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -156,10 +156,8 @@ static void

[Qemu-devel] [PATCH v1 04/16] virtio: expand offset calculation for packed ring

2018-11-22 Thread wexu
From: Wei Xu Expand 1.0 to 1.1 by adding offset calculation accordingly. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index a8e737c..a41c2d3 100644 ---

[Qemu-devel] [PATCH v1 01/16] Update version for v3.1.0-rc2 release

2018-11-22 Thread wexu
From: Peter Maydell Signed-off-by: Peter Maydell --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 3af1c22..bbcce69 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.91 +3.0.92 -- 1.8.3.1

[Qemu-devel] [PATCH v1 08/16] virtio: get avail bytes check for packed ring

2018-11-22 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 180 + 1 file changed, 167 insertions(+), 13 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 9d485e4..13265e3 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [PATCH v1 00/16] packed ring virtio-net backend support

2018-11-22 Thread wexu
From: Wei Xu Code base: https://github.com/Whishay/qemu.git rfc v3 -> v1 - migration support for both userspace and vhost-net, need tweak vhost ioctl() to make it work(the code is pasted in the commit message of vhost migration patch #13). Note: the high 32-bit guest feature bit is

[Qemu-devel] [PATCH v1 03/16] virtio: redefine structure & memory cache for packed ring

2018-11-22 Thread wexu
From: Wei Xu Redefine packed ring structure according to Qemu nomenclature, field data(wrap counter, etc) are introduced also. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 16 1 file changed, 16 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH v1 02/16] virtio: introduce packed ring definitions

2018-11-22 Thread wexu
From: Wei Xu >From 1.1 spec. Signed-off-by: Wei Xu --- include/standard-headers/linux/virtio_config.h | 15 + include/standard-headers/linux/virtio_ring.h | 43 ++ 2 files changed, 58 insertions(+) diff --git a/include/standard-headers/linux/virtio_config.h

[Qemu-devel] [[RFC v3 09/12] virtio-net: fill head desc after done all in a chain

2018-10-11 Thread wexu
From: Wei Xu With the support of marking a descriptor used/unused in 'flags' field for 1.1, the current way of filling a chained descriptors does not work since driver side may get the wrong 'num_buffer' information in case of the head descriptor has been filled in while the subsequent ones are

[Qemu-devel] [[RFC v3 10/12] virtio: packed ring feature bit for userspace backend

2018-10-11 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index e037db6..fb4b18f 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -78,6 +78,7 @@ static const int user_feature_bits[] = {

[Qemu-devel] [[RFC v3 12/12] virtio: feature vhost-net support for packed ring

2018-10-11 Thread wexu
From: Wei Xu (cherry picked from commit 305a2c4640c15c5717245067ab937fd10f478ee6) Signed-off-by: Wei Xu (cherry picked from commit 46476dae6f44c6fef8802a4a0ac7d0d79fe399e3) Signed-off-by: Wei Xu --- hw/virtio/vhost.c | 3 +++ hw/virtio/virtio.c | 4

[Qemu-devel] [[RFC v3 06/12] virtio: get avail bytes check for packed ring

2018-10-11 Thread wexu
From: Wei Xu Same thought as 1.0 except a bit confused when trying to reuse 'shadow_avail_idx', so the interrelated new event_idx and the wrap counter for notifications has been introduced in previous patch. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 176

[Qemu-devel] [[RFC v3 08/12] virtio: event suppression support for packed ring

2018-10-11 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 126 +++-- 1 file changed, 123 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index d12a7e3..1d25776 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [[RFC v3 04/12] virtio: init wrap counter for packed ring

2018-10-11 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index bfb3364..9185efb 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1243,6 +1243,9 @@ void virtio_reset(void *opaque)

[Qemu-devel] [[RFC v3 11/12] virtio: enable packed ring via a new command line

2018-10-11 Thread wexu
From: Wei Xu only userspace virtio net backend has been supported by the CLI so far. (cherry picked from commit 0b3ec96f4a9402cca467c40353066e57608ac6b6) Signed-off-by: Wei Xu (cherry picked from commit a1a3b85f00299ccc6f4bc819abe470da88059fb7) Signed-off-by: Wei Xu ---

[Qemu-devel] [[RFC v3 02/12] virtio: redefine structure & memory cache for packed ring

2018-10-11 Thread wexu
From: Wei Xu Redefine packed ring structure according to qemu nomenclature, also supported data(event index, wrap counter, etc) are introduced. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 26 -- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [[RFC v3 07/12] virtio: fill/flush/pop for packed ring

2018-10-11 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 258 ++--- 1 file changed, 244 insertions(+), 14 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 13c6c98..d12a7e3 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [[RFC v3 01/12] virtio: introduce packed ring definitions

2018-10-11 Thread wexu
From: Wei Xu sync from 1.1 spec Signed-off-by: Wei Xu --- include/standard-headers/linux/virtio_config.h | 15 + include/standard-headers/linux/virtio_ring.h | 43 ++ 2 files changed, 58 insertions(+) diff --git

[Qemu-devel] [[RFC v3 03/12] virtio: init memory cache for packed ring

2018-10-11 Thread wexu
From: Wei Xu Expand 1.0 by adding offset calculation accordingly. Signed-off-by: Wei Xu --- hw/virtio/vhost.c | 16 hw/virtio/virtio.c | 35 +++ include/hw/virtio/virtio.h | 4 ++-- 3 files changed, 33 insertions(+), 22

[Qemu-devel] [[RFC v3 05/12] virtio: init and desc empty check for packed ring

2018-10-11 Thread wexu
From: Wei Xu Basic initialization and helpers for packed ring. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 57 +- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 9185efb..86f88da

[Qemu-devel] [RFC v3 00/12] packed ring virtio-net userspace backend support

2018-10-11 Thread wexu
From: Wei Xu code base: https://github.com/Whishay/qemu.git Todo: - migration has not been support yet v2->v3 - addressed performance issue - fixed feedback from v2 v1->v2 - sync to tiwei's v5 - reuse memory cache function with 1.0 - dropped detach patch and notification helper(04 & 05 in v1)

[Qemu-devel] [RFC v2 8/8] virtio: guest driver reload for vhost-net

2018-06-05 Thread wexu
From: Wei Xu last_avail, avail_wrap_count, used_idx and used_wrap_count are needed to support vhost-net backend, all these are either 16 or bool variables, since state.num is 64bit wide, so here it is possible to put them to the 'num' without introducing a new case while handling ioctl.

[Qemu-devel] [RFC v2 4/8] virtio: get avail bytes check for packed ring

2018-06-05 Thread wexu
From: Wei Xu mostly as same as 1.0 except traversing all desc to feed headcount, need a refactor. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 148 +++-- 1 file changed, 145 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c

[Qemu-devel] [RFC v2 3/8] virtio: empty check and desc read for packed ring

2018-06-05 Thread wexu
From: Wei Xu helper for ring empty check and descriptor read. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 62 +++--- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index f6c0689..bd669a2

[Qemu-devel] [RFC v2 6/8] virtio: flush/push for packed ring

2018-06-05 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 109 ++--- 1 file changed, 96 insertions(+), 13 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 0160d03..6f2da83 100644 ---

[Qemu-devel] [RFC v2 7/8] virtio: event suppression for packed ring

2018-06-05 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 115 +++-- include/standard-headers/linux/virtio_config.h | 13 +++ 2 files changed, 119 insertions(+), 9 deletions(-) diff --git a/hw/virtio/virtio.c

[Qemu-devel] [RFC v2 2/8] virtio: memory cache for packed ring

2018-06-05 Thread wexu
From: Wei Xu Mostly reuse memory cache with 1.0 except for the offset calculation. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 29 - 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index e192a9a..f6c0689

[Qemu-devel] [RFC v2 5/8] virtio: queue pop for packed ring

2018-06-05 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 145 - 1 file changed, 144 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index cdbb5af..0160d03 100644 --- a/hw/virtio/virtio.c +++

[Qemu-devel] [RFC v2 1/8] virtio: feature bit, data structure, init for 1.1

2018-06-05 Thread wexu
From: Wei Xu New feature bit and members for packed ring. Signed-off-by: Wei Xu --- hw/net/vhost_net.c | 2 ++ hw/virtio/virtio.c | 27 -- include/hw/virtio/virtio.h | 4 +++-

[Qemu-devel] [RFC v2 0/8] packed ring virtio-net userspace backend support

2018-06-05 Thread wexu
From: Wei Xu Todo: - address Rx slow performance - event index interrupt suppression test v1->v2 - sync to tiwei's v5 - reuse memory cache function with 1.0 - dropped detach patch and notification helper(04 & 05 in v1) - guest virtio-net driver unload/reload support - event suppression

[Qemu-devel] [PATCH 8/8] virtio: queue pop support for packed ring

2018-04-04 Thread wexu
From: Wei Xu cloned from split ring pop, a global static length array and the inside-element length array are introduced to easy prototype, this consumes more memory and it is valuable to move to dynamic allocation as the out/in sg does. Signed-off-by: Wei Xu

[Qemu-devel] [PATCH 6/8] virtio: flush/push support for packed ring

2018-04-04 Thread wexu
From: Wei Xu Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 104 + 1 file changed, 90 insertions(+), 14 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 95a4681..def07c6 100644 ---

[Qemu-devel] [PATCH 3/8] virtio: add empty check for packed ring

2018-04-04 Thread wexu
From: Wei Xu helper for ring empty check. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 62 +++--- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH 4/8] virtio: add detach element for packed ring(1.1)

2018-04-04 Thread wexu
From: Wei Xu helper for packed ring Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 478df3d..fdee40f 100644 ---

[Qemu-devel] [PATCH 5/8] virtio: notification tweak for packed ring

2018-04-04 Thread wexu
From: Wei Xu Always enable notify and bypass set notification before supporting driver and device area. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index

[Qemu-devel] [PATCH 7/8] virtio: get avail bytes check for packed ring

2018-04-04 Thread wexu
From: Wei Xu mostly as same as 1.0, copy it separately for prototype, need a refactoring. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 142 +++-- 1 file changed, 139 insertions(+), 3 deletions(-) diff --git

[Qemu-devel] [PATCH 2/8] virtio: memory cache for packed ring

2018-04-04 Thread wexu
From: Wei Xu A new memory cache is introduced to for packed ring, the code looks pretty duplicated with split(1.0) ring, any refactor idea? Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 79 +++--- 1 file

[Qemu-devel] [RFC PATCH 0/8] virtio-net 1.1 userspace backend support

2018-04-04 Thread wexu
From: Wei Xu This is a prototype for virtio-net 1.1 support in userspace backend, only minimum part are included in this RFC(roughly synced to v8 as Jason and Tiwei's RFC). Test has been done together with Tiwei's RFC guest virtio-net driver patch, ping and a quick iperf test

[Qemu-devel] [PATCH 1/8] virtio: feature bit, data structure for packed ring

2018-04-04 Thread wexu
From: Wei Xu Only minimum definitions from the spec are included for prototype. Signed-off-by: Wei Xu --- hw/virtio/virtio.c | 47 +++--- include/hw/virtio/virtio.h | 12 ++-

[Qemu-devel] [Patch 3/3] vfio: remove checking duplicated vfio device

2017-09-11 Thread wexu
From: Wei Xu This has been done when introducing 'vfio_lookup_as()' patch as a side work to reuse the loop. Signed-off-by: Wei Xu --- hw/vfio/pci.c | 9 - 1 file changed, 9 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index

[Qemu-devel] [Patch 2/3] vfio: invoke looking up address space.

2017-09-11 Thread wexu
From: Wei Xu Invoke looking up correct address space before getting an IOMMU group. Signed-off-by: Wei Xu --- hw/vfio/pci.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 31e1edf..856cefd 100644

[Qemu-devel] [Patch 0/3] vfio: reusing address space for the same iommu group devices

2017-09-11 Thread wexu
From: Wei Xu Recently I have been testing passing through 2 ixgbe(82599ES) nics which belong to the same iommu group to a guest with virtual iommu(vIOMMU) on my desktop, while vfio failed to realize the second device and prompted error message as 'group xxx used in multiple

[Qemu-devel] [Patch 1/3] vfio: reusing address space for the same IOMMU group devices

2017-09-11 Thread wexu
From: Wei Xu Currently address space of a vfio device is selected by directly looking up pci device IOMMU address space during realizing, this usually works for most none separate address space targeted cases since they are using the system address space, i.e. a q35 machine

[Qemu-devel] [PATCH 1/2] virtio-net rsc: support coalescing ipv4 tcp traffic

2016-10-31 Thread wexu
From: Wei Xu All the data packets in a tcp connection are cached to a single buffer in every receive interval, and will be sent out via a timer, the 'virtio_net_rsc_timeout' controls the interval, this value may impact the performance and response time of tcp connection,

[Qemu-devel] [PATCH 2/2] virtio-net rsc: support coalescing ipv6 tcp traffic

2016-10-31 Thread wexu
From: Wei Xu Most process flows work like ipv4, 2 differences between ipv4 and ipv6. 1. Fragment length in ipv4 header includes itself, while it's not included for ipv6, thus means ipv6 can carry a real '65535' payload. 2. IPv6 header does not need calculate header checksum.

[Qemu-devel] [ RFC Patch v7 0/2] Support Receive-Segment-Offload(RSC) for WHQL

2016-10-31 Thread wexu
From: Wei Xu This patch is to support WHQL test for Windows guest, while this feature also benifits other guest works as a kernel 'gro' like feature with userspace implementation. Feature information: http://msdn.microsoft.com/en-us/library/windows/hardware/jj853324 v6->v7

[Qemu-devel] [ RFC Patch v6 3/3] virtio-net rsc: add 2 new rsc information fields to 'virtio_net_hdr'

2016-05-28 Thread wexu
From: Wei Xu Field 'coalesced' is to indicate how many packets are coalesced and field 'dup_ack' is how many duplicate acks are merged, guest driver can use these information to notify what's the exact scene of original traffic over the networks. Signed-off-by: Wei Xu

[Qemu-devel] [ RFC Patch v6 1/3] virtio-net rsc: support coalescing ipv4 tcp traffic

2016-05-28 Thread wexu
From: Wei Xu All the data packets in a tcp connection will be cached to a big buffer in every receive interval, and will be sent out via a timer, the 'virtio_net_rsc_timeout' controls the interval, the value will influent the performance and response of tcp connection extremely,

[Qemu-devel] [ RFC Patch v6 2/3] virtio-net rsc: support coalescing ipv6 tcp traffic

2016-05-28 Thread wexu
From: Wei Xu Most stuffs are like ipv4 2 differences between ipv4 and ipv6. 1. Fragment length in ipv4 header includes itself, while it's not included for ipv6, thus means ipv6 can carry a real '65535' payload. 2. IPv6 header does not need calculate header checksum.

[Qemu-devel] [ RFC Patch v6 0/2] Support Receive-Segment-Offload(RSC) for WHQL

2016-05-28 Thread wexu
From: Wei Xu Changes in V6: - Sync upstream code - Split new fields in 'virtio_net_hdr' to a seperate patch - Remove feature bit code, replace it with a command line parameter 'guest_rsc' which is turned off by default. Changes in V5: - Passed all IPv4/6 test cases - Add new

[Qemu-devel] [ RFC Patch v5 1/2] virtio-net rsc: support coalescing ipv4 tcp traffic

2016-05-23 Thread wexu
From: Wei Xu All the data packets in a tcp connection will be cached to a big buffer in every receive interval, and will be sent out via a timer, the 'virtio_net_rsc_timeout' controls the interval, the value will influent the performance and response of tcp connection extremely,

  1   2   >