[PATCH v6] virtio_blk: add DISCARD and WRIET ZEROES commands support

2018-06-05 Thread Changpeng Liu
Existing virtio-blk protocol doesn't have DISCARD/WRITE ZEROES commands support, this will impact the performance when using SSD backend over file systems. Commit 88c85538 "virtio-blk: add discard and write zeroes features to specification"(see https://github.com/oasis-tcs/virtio-spec) extended ex

Re: [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net

2018-06-05 Thread Jason Wang
On 2018年06月05日 20:33, Michael S. Tsirkin wrote: I don't think this is sufficient. If both primary and standby devices are present, a legacy guest without support for the feature might see two devices with same mac and get confused. I think that we should only make primary visible after guest

Re: [virtio-dev] Re: [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net

2018-06-05 Thread Siwei Liu
On Tue, Jun 5, 2018 at 2:32 PM, Michael S. Tsirkin wrote: > On Tue, Jun 05, 2018 at 02:16:44PM -0700, Siwei Liu wrote: >> Good to see this discussion going. I share the same feeling that the >> decision of plugging the primary (passthrough) should only be made >> until guest driver acknowledges DR

Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations

2018-06-05 Thread Joe Perches
On Tue, 2018-06-05 at 12:50 -0700, Nick Desaulniers wrote: > On Tue, Jun 5, 2018 at 12:14 PM Joe Perches wrote: > > > > On Tue, 2018-06-05 at 10:23 -0700, Joe Perches wrote: > > > Perhaps these are simpler as > > > > > > #define __inline__inline > > > #define __inline inline > > > > Cu

Re: [virtio-dev] Re: [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net

2018-06-05 Thread Michael S. Tsirkin
On Tue, Jun 05, 2018 at 02:16:44PM -0700, Siwei Liu wrote: > Good to see this discussion going. I share the same feeling that the > decision of plugging the primary (passthrough) should only be made > until guest driver acknowledges DRIVER_OK and _F_STANDBY. > Architecturally this intelligence shou

Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread Arnd Bergmann
On Tue, Jun 5, 2018 at 11:28 PM, Arnd Bergmann wrote: > On Tue, Jun 5, 2018 at 7:05 PM, Nick Desaulniers > wrote: >> >> The semantics of extern inline has changed since gnu89. This means that >> folks using GCC versions >= 5.1 may see symbol redefinition errors at >> link time for subdirs that ov

Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread Arnd Bergmann
On Tue, Jun 5, 2018 at 7:05 PM, Nick Desaulniers wrote: > > The semantics of extern inline has changed since gnu89. This means that > folks using GCC versions >= 5.1 may see symbol redefinition errors at > link time for subdirs that override KBUILD_CFLAGS (making the C standard > used implicit) re

Re: [virtio-dev] Re: [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net

2018-06-05 Thread Siwei Liu
Good to see this discussion going. I share the same feeling that the decision of plugging the primary (passthrough) should only be made until guest driver acknowledges DRIVER_OK and _F_STANDBY. Architecturally this intelligence should be baken to QEMU itself rather than moving up to management stac

Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations

2018-06-05 Thread Joe Perches
On Tue, 2018-06-05 at 10:05 -0700, Nick Desaulniers wrote: > Functions marked extern inline do not emit an externally visible > function when the gnu89 C standard is used. Some KBUILD Makefiles > overwrite KBUILD_CFLAGS. This is an issue for GCC 5.1+ users as without > an explicit C standard specif

Re: [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net

2018-06-05 Thread Michael S. Tsirkin
On Tue, Jun 05, 2018 at 01:20:33PM -0700, Samudrala, Sridhar wrote: > > On 6/5/2018 5:33 AM, Michael S. Tsirkin wrote: > > I don't think this is sufficient. > > Sure. This is not sufficient for a complete solution, but is Qemu the right > place > to manage primary/standby interfaces? > > I thin

Re: [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net

2018-06-05 Thread Samudrala, Sridhar
On 6/5/2018 5:33 AM, Michael S. Tsirkin wrote: I don't think this is sufficient. Sure. This is not sufficient for a complete solution, but is Qemu the right place to manage primary/standby interfaces? I think the other steps including plugging/unplugging the primary interface needs to hand

Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations

2018-06-05 Thread Joe Perches
On Tue, 2018-06-05 at 10:23 -0700, Joe Perches wrote: > Perhaps these are simpler as > > #define __inline__inline > #define __inline inline Currently, there are these uses of inline variants in the kernel $ git grep -w inline | wc -l 68410 $ git grep -w __inline__ | wc -l 503 $ git grep

Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread H. Peter Anvin
On 06/05/18 10:52, Nick Desaulniers wrote: > > Does the kernel have a different calling convention for 32b x86? How > does that work? regparm=3? Does that need to be added to the > declaration? > Yes, -mregparm=3. No, doesn't need to be added to the declaration. >> Something like this added t

Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread H. Peter Anvin
On 06/05/18 10:28, H. Peter Anvin wrote: > On 06/05/18 10:05, Nick Desaulniers wrote: >> + >> +/* >> + * void native_restore_fl(unsigned long flags) >> + * %rdi: flags >> + */ >> +ENTRY(native_restore_fl) >> +push %_ASM_DI >> +popf >> +ret >> +ENDPROC(native_restore_fl) >> +EXPORT_SYMBO

Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread H. Peter Anvin
On 06/05/18 10:05, Nick Desaulniers wrote: > + > +/* > + * void native_restore_fl(unsigned long flags) > + * %rdi: flags > + */ > +ENTRY(native_restore_fl) > + push %_ASM_DI > + popf > + ret > +ENDPROC(native_restore_fl) > +EXPORT_SYMBOL(native_restore_fl) > To work on i386, this woul

Re: [PATCH] qemu: Introduce VIRTIO_NET_F_STANDBY feature bit to virtio_net

2018-06-05 Thread Michael S. Tsirkin
I don't think this is sufficient. If both primary and standby devices are present, a legacy guest without support for the feature might see two devices with same mac and get confused. I think that we should only make primary visible after guest acked the backup feature bit. And on reset or when

Re: [virtio-dev] Re: [PATCH v3] virtio_pci: support enabling VFs

2018-06-05 Thread Michael S. Tsirkin
On Tue, Jun 05, 2018 at 09:36:53AM +0800, Tiwei Bie wrote: > On Mon, Jun 04, 2018 at 07:32:25PM +0300, Michael S. Tsirkin wrote: > > On Fri, Jun 01, 2018 at 12:02:39PM +0800, Tiwei Bie wrote: > > > There is a new feature bit allocated in virtio spec to > > > support SR-IOV (Single Root I/O Virtuali

[RFC v6 5/5] virtio_ring: enable packed ring

2018-06-05 Thread Tiwei Bie
Signed-off-by: Tiwei Bie --- drivers/s390/virtio/virtio_ccw.c | 8 drivers/virtio/virtio_ring.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c index 8f5c1d7f751a..ff5b85736d8d 100644 --- a/drivers/s390/virti

[RFC v6 4/5] virtio_ring: add event idx support in packed ring

2018-06-05 Thread Tiwei Bie
This commit introduces the EVENT_IDX support in packed ring. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 74 1 file changed, 67 insertions(+), 7 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 983ce

[RFC v6 3/5] virtio_ring: add packed ring support

2018-06-05 Thread Tiwei Bie
This commit introduces the support (without EVENT_IDX) for packed ring. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 486 ++- 1 file changed, 479 insertions(+), 7 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c

[RFC v6 2/5] virtio_ring: support creating packed ring

2018-06-05 Thread Tiwei Bie
This commit introduces the support for creating packed ring. All split ring specific functions are added _split suffix. Some necessary stubs for packed ring are also added. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 801 +++ include/linux/virtio_r

[RFC v6 1/5] virtio: add packed ring definitions

2018-06-05 Thread Tiwei Bie
Signed-off-by: Tiwei Bie --- include/uapi/linux/virtio_config.h | 5 - include/uapi/linux/virtio_ring.h | 36 ++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h index 308e209

[RFC v6 0/5] virtio: support packed ring

2018-06-05 Thread Tiwei Bie
Hello everyone, This RFC implements packed ring support in virtio driver. Some functional tests have been done with Jason's packed ring implementation in vhost (RFC v5): https://lwn.net/Articles/755862/ Both of ping and netperf worked as expected. TODO: - Refinements (for code and commit log);