Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-23 Thread Michael S. Tsirkin
On Thu, Jan 24, 2019 at 12:11:28PM +0800, Jason Wang wrote: > > On 2019/1/24 下午12:07, Jason Wang wrote: > > > > On 2019/1/23 下午10:08, Michael S. Tsirkin wrote: > > > On Wed, Jan 23, 2019 at 05:55:57PM +0800, Jason Wang wrote: > > > > It was noticed that the copy_user() friends that was used to ac

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-23 Thread Michael S. Tsirkin
On Thu, Jan 24, 2019 at 12:07:54PM +0800, Jason Wang wrote: > > On 2019/1/23 下午10:08, Michael S. Tsirkin wrote: > > On Wed, Jan 23, 2019 at 05:55:57PM +0800, Jason Wang wrote: > > > It was noticed that the copy_user() friends that was used to access > > > virtqueue metdata tends to be very expensi

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-23 Thread Jason Wang
On 2019/1/24 下午12:07, Jason Wang wrote: On 2019/1/23 下午10:08, Michael S. Tsirkin wrote: On Wed, Jan 23, 2019 at 05:55:57PM +0800, Jason Wang wrote: It was noticed that the copy_user() friends that was used to access virtqueue metdata tends to be very expensive for dataplane implementation lik

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-23 Thread Jason Wang
On 2019/1/23 下午10:08, Michael S. Tsirkin wrote: On Wed, Jan 23, 2019 at 05:55:57PM +0800, Jason Wang wrote: It was noticed that the copy_user() friends that was used to access virtqueue metdata tends to be very expensive for dataplane implementation like vhost since it involves lots of software

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-23 Thread Michael S. Tsirkin
On Wed, Jan 23, 2019 at 10:31:39PM +0100, Christoph Hellwig wrote: > On Wed, Jan 23, 2019 at 05:30:49PM +0100, Joerg Roedel wrote: > > + max_size = virtio_max_dma_size(vdev); > > + > > /* Host can optionally specify maximum segment size and number of > > * segments. */ > > err = virt

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-23 Thread Christoph Hellwig
On Wed, Jan 23, 2019 at 05:30:49PM +0100, Joerg Roedel wrote: > + max_size = virtio_max_dma_size(vdev); > + > /* Host can optionally specify maximum segment size and number of >* segments. */ > err = virtio_cread_feature(vdev, VIRTIO_BLK_F_SIZE_MAX, >

Re: [PATCH 0/5 v3] Fix virtio-blk issue with SWIOTLB

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 23, 2019 at 01:51:29PM -0500, Michael S. Tsirkin wrote: > On Wed, Jan 23, 2019 at 05:30:44PM +0100, Joerg Roedel wrote: > > Hi, > > > > here is the third version of this patch-set. Previous > > versions can be found here: > > > > V1: https://lore.kernel.org/lkml/20190110134433.156

Re: [Xen-devel] [RFC] virtio_ring: check dma_mem for xen_domain

2019-01-23 Thread h...@infradead.org
On Wed, Jan 23, 2019 at 01:04:33PM -0800, Stefano Stabellini wrote: > If vring_use_dma_api is actually supposed to return true when > dma_dev->dma_mem is set, then both Peng's patch and the patch I wrote > are not fixing the real issue here. > > I don't know enough about remoteproc to know where t

Re: [PATCH 3/5] dma: Introduce dma_max_mapping_size()

2019-01-23 Thread Christoph Hellwig
This looks ok, but could really use some documentation in Documentation/DMA-API.txt. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 1/5] swiotlb: Introduce swiotlb_max_mapping_size()

2019-01-23 Thread Christoph Hellwig
On Wed, Jan 23, 2019 at 05:30:45PM +0100, Joerg Roedel wrote: > +extern size_t swiotlb_max_mapping_size(struct device *dev); No need for the extern keyword on function declarations in headers. ___ Virtualization mailing list Virtualization@lists.linux-fo

Re: [PATCH 2/5] swiotlb: Add is_swiotlb_active() function

2019-01-23 Thread Christoph Hellwig
On Wed, Jan 23, 2019 at 05:30:46PM +0100, Joerg Roedel wrote: > +bool is_swiotlb_active(void) > +{ > + return !no_iotlb_memory; > +} As I've just introduced and fixed a bug in this area in the current cycle - I don't think no_iotlb_memory is what your want (and maybe not useful at all): if the

Re: [PATCH 0/5 v3] Fix virtio-blk issue with SWIOTLB

2019-01-23 Thread Michael S. Tsirkin
On Wed, Jan 23, 2019 at 05:30:44PM +0100, Joerg Roedel wrote: > Hi, > > here is the third version of this patch-set. Previous > versions can be found here: > > V1: https://lore.kernel.org/lkml/20190110134433.15672-1-j...@8bytes.org/ > > V2: https://lore.kernel.org/lkml/20190115132257

Re: [PATCH net-next V4 0/5] vhost: accelerate metadata access through vmap()

2019-01-23 Thread David Miller
From: "Michael S. Tsirkin" Date: Wed, 23 Jan 2019 08:58:07 -0500 > On Wed, Jan 23, 2019 at 05:55:52PM +0800, Jason Wang wrote: >> This series tries to access virtqueue metadata through kernel virtual >> address instead of copy_user() friends since they had too much >> overheads like checks, spec

Re: [PATCH 0/5 v3] Fix virtio-blk issue with SWIOTLB

2019-01-23 Thread Konrad Rzeszutek Wilk
On Wed, Jan 23, 2019 at 05:30:44PM +0100, Joerg Roedel wrote: > Hi, > > here is the third version of this patch-set. Previous > versions can be found here: > > V1: https://lore.kernel.org/lkml/20190110134433.15672-1-j...@8bytes.org/ > > V2: https://lore.kernel.org/lkml/20190115132257

Re: [PATCH] drm: Split out drm_probe_helper.h

2019-01-23 Thread Sam Ravnborg
Hi Daniel. On Thu, Jan 17, 2019 at 10:03:34PM +0100, Daniel Vetter wrote: > Having the probe helper stuff (which pretty much everyone needs) in > the drm_crtc_helper.h file (which atomic drivers should never need) is > confusing. Split them out. > > To make sure I actually achieved the goal here

[PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-23 Thread Joerg Roedel
From: Joerg Roedel Segments can't be larger than the maximum DMA mapping size supported on the platform. Take that into account when setting the maximum segment size for a block device. Signed-off-by: Joerg Roedel --- drivers/block/virtio_blk.c | 10 ++ 1 file changed, 6 insertions(+),

[PATCH 0/5 v3] Fix virtio-blk issue with SWIOTLB

2019-01-23 Thread Joerg Roedel
Hi, here is the third version of this patch-set. Previous versions can be found here: V1: https://lore.kernel.org/lkml/20190110134433.15672-1-j...@8bytes.org/ V2: https://lore.kernel.org/lkml/20190115132257.6426-1-j...@8bytes.org/ The problem solved here is a limitation of the S

[PATCH 3/5] dma: Introduce dma_max_mapping_size()

2019-01-23 Thread Joerg Roedel
From: Joerg Roedel The function returns the maximum size that can be mapped using DMA-API functions. The patch also adds the implementation for direct DMA and a new dma_map_ops pointer so that other implementations can expose their limit. Signed-off-by: Joerg Roedel --- include/linux/dma-mappi

[PATCH 4/5] virtio: Introduce virtio_max_dma_size()

2019-01-23 Thread Joerg Roedel
From: Joerg Roedel This function returns the maximum segment size for a single dma transaction of a virtio device. The possible limit comes from the SWIOTLB implementation in the Linux kernel, that has an upper limit of (currently) 256kb of contiguous memory it can map. Other DMA-API implementati

[PATCH 1/5] swiotlb: Introduce swiotlb_max_mapping_size()

2019-01-23 Thread Joerg Roedel
From: Joerg Roedel The function returns the maximum size that can be remapped by the SWIOTLB implementation. This function will be later exposed to users through the DMA-API. Signed-off-by: Joerg Roedel --- include/linux/swiotlb.h | 5 + kernel/dma/swiotlb.c| 5 + 2 files changed,

[PATCH 2/5] swiotlb: Add is_swiotlb_active() function

2019-01-23 Thread Joerg Roedel
From: Joerg Roedel This function will be used from dma_direct code to determine the maximum segment size of a dma mapping. Signed-off-by: Joerg Roedel --- include/linux/swiotlb.h | 6 ++ kernel/dma/swiotlb.c| 5 + 2 files changed, 11 insertions(+) diff --git a/include/linux/swiotl

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-23 Thread Michael S. Tsirkin
On Wed, Jan 23, 2019 at 05:55:57PM +0800, Jason Wang wrote: > It was noticed that the copy_user() friends that was used to access > virtqueue metdata tends to be very expensive for dataplane > implementation like vhost since it involves lots of software checks, > speculation barrier, hardware featu

Re: [PATCH net-next V4 0/5] vhost: accelerate metadata access through vmap()

2019-01-23 Thread Michael S. Tsirkin
On Wed, Jan 23, 2019 at 05:55:52PM +0800, Jason Wang wrote: > This series tries to access virtqueue metadata through kernel virtual > address instead of copy_user() friends since they had too much > overheads like checks, spec barriers or even hardware feature > toggling. > > Test shows about 24%

Re: [virtio-dev] [PATCH] virtio: support VIRTIO_F_ORDER_PLATFORM

2019-01-23 Thread Michael S. Tsirkin
On Wed, Jan 23, 2019 at 02:56:00PM +0800, Jason Wang wrote: > > On 2019/1/23 上午11:49, Michael S. Tsirkin wrote: > > On Wed, Jan 23, 2019 at 11:08:04AM +0800, Jason Wang wrote: > > > On 2019/1/23 上午1:03, Tiwei Bie wrote: > > > > This patch introduces the support for VIRTIO_F_ORDER_PLATFORM. > > > >

[PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-23 Thread Jason Wang
It was noticed that the copy_user() friends that was used to access virtqueue metdata tends to be very expensive for dataplane implementation like vhost since it involves lots of software checks, speculation barrier, hardware feature toggling (e.g SMAP). The extra cost will be more obvious when tra

[PATCH net-next V4 3/5] vhost: rename vq_iotlb_prefetch() to vq_meta_prefetch()

2019-01-23 Thread Jason Wang
Rename the function to be more accurate since it actually tries to prefetch vq metadata address in IOTLB. And this will be used by following patch to prefetch metadata virtual addresses. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 4 ++-- drivers/vhost/vhost.c | 4 ++-- drivers/vhost/v

[PATCH net-next V4 4/5] vhost: introduce helpers to get the size of metadata area

2019-01-23 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 46 ++- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 24c74c60c093..37e2cac8e8b0 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vho

[PATCH net-next V4 2/5] vhost: fine grain userspace memory accessors

2019-01-23 Thread Jason Wang
This is used to hide the metadata address from virtqueue helpers. This will allow to implement a vmap based fast accessing to metadata. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 94 +++ 1 file changed, 77 insertions(+), 17 deletions(-) diff --

[PATCH net-next V4 1/5] vhost: generalize adding used elem

2019-01-23 Thread Jason Wang
Use one generic vhost_copy_to_user() instead of two dedicated accessor. This will simplify the conversion to fine grain accessors. About 2% improvement of PPS were seen during vitio-user txonly test. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 11 +-- 1 file changed, 1 insertio

[PATCH net-next V4 0/5] vhost: accelerate metadata access through vmap()

2019-01-23 Thread Jason Wang
This series tries to access virtqueue metadata through kernel virtual address instead of copy_user() friends since they had too much overheads like checks, spec barriers or even hardware feature toggling. Test shows about 24% improvement on TX PPS. It should benefit other cases as well. Changes f

[PATCH v2] virtio: support VIRTIO_F_ORDER_PLATFORM

2019-01-23 Thread Tiwei Bie
This patch introduces the support for VIRTIO_F_ORDER_PLATFORM. If this feature is negotiated, the driver must use the barriers suitable for hardware devices. Otherwise, the device and driver are assumed to be implemented in software, that is they can be assumed to run on identical CPUs in an SMP co

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

2019-01-23 Thread Joerg Roedel
Hi Jean-Philippe, thanks for all your hard work on this! On Tue, Jan 15, 2019 at 12:19:52PM +, Jean-Philippe Brucker wrote: > Implement the virtio-iommu driver, following specification v0.9 [1]. To make progress on this I think the spec needs to be close to something that can be included int

Re: [PATCH] virtio: support VIRTIO_F_ORDER_PLATFORM

2019-01-23 Thread Tiwei Bie
On Tue, Jan 22, 2019 at 11:04:29PM -0500, Michael S. Tsirkin wrote: > On Wed, Jan 23, 2019 at 01:03:46AM +0800, Tiwei Bie wrote: > > This patch introduces the support for VIRTIO_F_ORDER_PLATFORM. > > When this feature is negotiated, driver will use the barriers > > suitable for hardware devices. >