[PATCH v2 5/5] VSOCK: batch sending rx buffer to increase bandwidth

2018-12-12 Thread jiangyiwen
Batch sending rx buffer can improve total bandwidth. Signed-off-by: Yiwen Jiang --- drivers/vhost/vsock.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 9600133..a4bf0a1 100644 ---

[PATCH v2 4/5] VSOCK: increase send pkt len in mergeable mode to improve performance

2018-12-12 Thread jiangyiwen
Since VSOCK already support mergeable rx buffer, so it can implement the balance with performance and guest memory, we can increase the sent pkt len to improve performance. And in order to be compatible with old version, so we still send max default rx buf size once. Signed-off-by: Yiwen Jiang

[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest

2018-12-12 Thread jiangyiwen
Guest receive mergeable rx buffer, it can merge scatter rx buffer into a big buffer and then copy to user space. In addition, it also use iovec to replace buf in struct virtio_vsock_pkt, keep tx and rx consistency. The only difference is now tx still uses a segment of continuous physical memory

Re: [PATCH net V3 0/3] Fix various issue of vhost

2018-12-12 Thread David Miller
From: Jason Wang Date: Thu, 13 Dec 2018 10:53:36 +0800 > This series tries to fix various issues of vhost: > > - Patch 1 adds a missing write barrier between used idx updating and > logging. > - Patch 2-3 brings back the protection of device IOTLB through vq > mutex, this fixes possible use

[PATCH v2 2/5] VSOCK: support fill data to mergeable rx buffer in host

2018-12-12 Thread jiangyiwen
When vhost support VIRTIO_VSOCK_F_MRG_RXBUF feature, it will merge big packet into rx vq. Signed-off-by: Yiwen Jiang --- drivers/vhost/vsock.c | 111 ++ include/linux/virtio_vsock.h | 1 + include/uapi/linux/virtio_vsock.h | 5 ++ 3 files

[PATCH v2 1/5] VSOCK: support fill mergeable rx buffer in guest

2018-12-12 Thread jiangyiwen
In driver probing, if virtio has VIRTIO_VSOCK_F_MRG_RXBUF feature, it will fill mergeable rx buffer, support for host send mergeable rx buffer. It will fill a fixed size(PAGE_SIZE) everytime to compact with small packet and big packet. In addition, it also add one optimizations copied from

Re: [PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling

2018-12-12 Thread Michael S. Tsirkin
On Wed, Dec 12, 2018 at 11:03:57AM +0800, Jason Wang wrote: > > On 2018/12/11 下午12:04, Michael S. Tsirkin wrote: > > On Tue, Dec 11, 2018 at 11:06:43AM +0800, Jason Wang wrote: > > > On 2018/12/11 上午9:34, Michael S. Tsirkin wrote: > > > > On Mon, Dec 10, 2018 at 05:44:52PM +0800, Jason Wang

Re: [PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling

2018-12-12 Thread Jason Wang
On 2018/12/11 下午12:04, Michael S. Tsirkin wrote: On Tue, Dec 11, 2018 at 11:06:43AM +0800, Jason Wang wrote: On 2018/12/11 上午9:34, Michael S. Tsirkin wrote: On Mon, Dec 10, 2018 at 05:44:52PM +0800, Jason Wang wrote: When we try to do rx busy polling in tx path in commit 441abde4cd84 ("net:

Re: [PATCH v6 0/7] Add virtio-iommu driver

2018-12-12 Thread Michael S. Tsirkin
On Tue, Dec 11, 2018 at 10:31:01AM -0800, Christoph Hellwig wrote: > On Tue, Dec 11, 2018 at 06:20:57PM +, Jean-Philippe Brucker wrote: > > Implement the virtio-iommu driver, following specification v0.9 [1]. > > > > Only minor changes since v5 [2]. I fixed issues reported by Michael and > >

Re: [PATCH v6 0/7] Add virtio-iommu driver

2018-12-12 Thread Jean-Philippe Brucker
On 11/12/2018 18:31, Christoph Hellwig wrote: > On Tue, Dec 11, 2018 at 06:20:57PM +, Jean-Philippe Brucker wrote: >> Implement the virtio-iommu driver, following specification v0.9 [1]. >> >> Only minor changes since v5 [2]. I fixed issues reported by Michael and >> added tags from Eric and

Re: [PATCH v6 0/7] Add virtio-iommu driver

2018-12-12 Thread Christoph Hellwig
On Tue, Dec 11, 2018 at 06:20:57PM +, Jean-Philippe Brucker wrote: > Implement the virtio-iommu driver, following specification v0.9 [1]. > > Only minor changes since v5 [2]. I fixed issues reported by Michael and > added tags from Eric and Bharat. Thanks! > > You can find Linux driver and

[PATCH v2 0/5] VSOCK: support mergeable rx buffer in vhost-vsock

2018-12-12 Thread jiangyiwen
Now vsock only support send/receive small packet, it can't achieve high performance. As previous discussed with Jason Wang, I revisit the idea of vhost-net about mergeable rx buffer and implement the mergeable rx buffer in vhost-vsock, it can allow big packet to be scattered in into different

[PATCH v6 7/7] iommu/virtio: Add event queue

2018-12-12 Thread Jean-Philippe Brucker
The event queue offers a way for the device to report access faults from endpoints. It is implemented on virtqueue #1. Whenever the host needs to signal a fault, it fills one of the buffers offered by the guest and interrupts it. Tested-by: Bharat Bhushan Tested-by: Eric Auger Reviewed-by: Eric

[PATCH v6 6/7] iommu/virtio: Add probe request

2018-12-12 Thread Jean-Philippe Brucker
When the device offers the probe feature, send a probe request for each device managed by the IOMMU. Extract RESV_MEM information. When we encounter a MSI doorbell region, set it up as a IOMMU_RESV_MSI region. This will tell other subsystems that there is no need to map the MSI doorbell in the

[PATCH v6 5/7] iommu: Add virtio-iommu driver

2018-12-12 Thread Jean-Philippe Brucker
The virtio IOMMU is a para-virtualized device, allowing to send IOMMU requests such as map/unmap over virtio transport without emulating page tables. This implementation handles ATTACH, DETACH, MAP and UNMAP requests. The bulk of the code transforms calls coming from the IOMMU API into

[PATCH v6 4/7] PCI: OF: Initialize dev->fwnode appropriately

2018-12-12 Thread Jean-Philippe Brucker
For PCI devices that have an OF node, set the fwnode as well. This way drivers that rely on fwnode don't need the special case described by commit f94277af03ea ("of/platform: Initialise dev->fwnode appropriately"). Acked-by: Bjorn Helgaas Signed-off-by: Jean-Philippe Brucker ---

[PATCH v6 3/7] of: Allow the iommu-map property to omit untranslated devices

2018-12-12 Thread Jean-Philippe Brucker
In PCI root complex nodes, the iommu-map property describes the IOMMU that translates each endpoint. On some platforms, the IOMMU itself is presented as a PCI endpoint (e.g. AMD IOMMU and virtio-iommu). This isn't supported by the current OF driver, which expects all endpoints to have an IOMMU.

[PATCH v6 2/7] dt-bindings: virtio: Add virtio-pci-iommu node

2018-12-12 Thread Jean-Philippe Brucker
Some systems implement virtio-iommu as a PCI endpoint. The operating system needs to discover the relationship between IOMMU and masters long before the PCI endpoint gets probed. Add a PCI child node to describe the virtio-iommu device. The virtio-pci-iommu is conceptually split between a PCI