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

2018-05-28 Thread Tiwei Bie
On Tue, May 29, 2018 at 11:18:57AM +0800, Jason Wang wrote: > On 2018年05月22日 16:16, Tiwei Bie wrote: [...] > > +static void detach_buf_packed(struct vring_virtqueue *vq, > > + unsigned int id, void **ctx) > > +{ > > + struct vring_desc_state_packed *state; > > + struct

Re: [PATCH net-next v12 1/5] net: Introduce generic failover module

2018-05-28 Thread Stephen Hemminger
On Fri, 25 May 2018 16:06:58 -0700 "Samudrala, Sridhar" wrote: > On 5/25/2018 3:38 PM, Stephen Hemminger wrote: > > On Thu, 24 May 2018 09:55:13 -0700 > > Sridhar Samudrala wrote: > > > >> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h > >> index 03ed492c4e14..0f4ba52b641d

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

2018-05-28 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

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

2018-05-28 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

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

2018-05-28 Thread Jason Wang
On 2018年05月22日 16:16, Tiwei Bie wrote: This commit introduces the support (without EVENT_IDX) for packed ring. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 474 ++- 1 file changed, 468 insertions(+), 6 deletions(-) diff --git

Re: [PATCH net-next v12 0/5] Enable virtio_net to act as a standby for a passthru device

2018-05-28 Thread David Miller
From: Sridhar Samudrala Date: Thu, 24 May 2018 09:55:12 -0700 > The main motivation for this patch is to enable cloud service providers > to provide an accelerated datapath to virtio-net enabled VMs in a > transparent manner with no/minimal guest userspace changes. This also > enables

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

2018-05-28 Thread Jason Wang
On 2018年05月22日 16:16, Tiwei Bie wrote: 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

[RFC V5 PATCH 8/8] vhost: event suppression for packed ring

2018-05-28 Thread Jason Wang
This patch introduces basic support for event suppression aka driver and device area. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c| 191 --- drivers/vhost/vhost.h| 10 +- include/uapi/linux/virtio_ring.h | 19 3 files

[RFC V5 PATCH 7/8] vhost: packed ring support

2018-05-28 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/vhost/net.c | 13 +- drivers/vhost/vhost.c | 585 ++ drivers/vhost/vhost.h | 13 +- 3 files changed, 566 insertions(+), 45 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index

[RFC V5 PATCH 6/8] virtio: introduce packed ring defines

2018-05-28 Thread Jason Wang
Signed-off-by: Jason Wang --- include/uapi/linux/virtio_config.h | 9 + include/uapi/linux/virtio_ring.h | 13 + 2 files changed, 22 insertions(+) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h index 308e209..5903d51 100644 ---

[RFC V5 PATCH 5/8] vhost: vhost_put_user() can accept metadata type

2018-05-28 Thread Jason Wang
We assumes used ring update is the only user for vhost_put_user() in the past. This may not be the case for the incoming packed ring which may update the descriptor ring for used. So introduce a new type parameter. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 14 +++--- 1 file

[RFC V5 PATCH 4/8] vhost_net: do not explicitly manipulate vhost_used_elem

2018-05-28 Thread Jason Wang
Two helpers of setting/getting used len were introduced to avoid explicitly manipulating vhost_used_elem in zerocopy code. This will be used to hide used_elem internals and simplify packed ring implementation. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 11 +--

[RFC V5 PATCH 3/8] vhost: do not use vring_used_elem

2018-05-28 Thread Jason Wang
Instead of depending on the exported vring_used_elem, this patch switches to use a new internal structure vhost_used_elem which embed vring_used_elem in itself. This could be used to let vhost to record extra metadata for the incoming packed ring layout. Signed-off-by: Jason Wang ---

[RFC V5 PATCH 2/8] vhost: hide used ring layout from device

2018-05-28 Thread Jason Wang
We used to return descriptor head by vhost_get_vq_desc() to device and pass it back to vhost_add_used() and its friends. This exposes the internal used ring layout to device which makes it hard to be extended for e.g packed ring layout. So this patch tries to hide the used ring layout by -

[RFC V5 PATCH 1/8] vhost: move get_rx_bufs to vhost.c

2018-05-28 Thread Jason Wang
Move get_rx_bufs() to vhost.c and rename it to vhost_get_bufs(). This helps to hide vring internal layout from specific device implementation. Packed ring implementation will benefit from this. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 83

[RFC V5 PATCH 0/8] Packed ring layout for vhost

2018-05-28 Thread Jason Wang
Hi all: This RFC implement packed ring layout. The code were tested with Tiwei's RFC V5 at https://lkml.org/lkml/2018/5/22/138. Some fixups and tweaks were needed on top of Tiwei's code to make it run for event index. Pktgen reports about 20% improvement on TX PPS when doing pktgen from guest to

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

2018-05-28 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

Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices

2018-05-28 Thread Benjamin Herrenschmidt
On Tue, 2018-05-29 at 09:48 +1000, Benjamin Herrenschmidt wrote: > > Well it's not supposed to be much slower for the static case. > > > > vhost has a cache so should be fine. > > > > A while ago Paolo implemented a translation cache which should be > > perfect for this case - most of the code

Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices

2018-05-28 Thread Benjamin Herrenschmidt
On Fri, 2018-05-25 at 20:45 +0300, Michael S. Tsirkin wrote: > On Thu, May 24, 2018 at 08:27:04AM +1000, Benjamin Herrenschmidt wrote: > > On Wed, 2018-05-23 at 21:50 +0300, Michael S. Tsirkin wrote: > > > > > I re-read that discussion and I'm still unclear on the > > > original question, since I