Re: [PATCH] virtio_ring: aovid reading flag from the descriptor ring

2022-02-22 Thread Jason Wang
On Wed, Feb 23, 2022 at 3:34 PM Jason Wang wrote: > > On Wed, Feb 23, 2022 at 3:08 PM Michael S. Tsirkin wrote: > > > > On Wed, Feb 23, 2022 at 11:19:03AM +0800, Jason Wang wrote: > > > On Mon, Nov 8, 2021 at 4:13 PM Jason Wang wrote: > > > > > > > > Commit 72b5e8958738 ("virtio-ring: store DMA

Re: [PATCH] virtio_ring: aovid reading flag from the descriptor ring

2022-02-22 Thread Jason Wang
On Wed, Feb 23, 2022 at 3:08 PM Michael S. Tsirkin wrote: > > On Wed, Feb 23, 2022 at 11:19:03AM +0800, Jason Wang wrote: > > On Mon, Nov 8, 2021 at 4:13 PM Jason Wang wrote: > > > > > > Commit 72b5e8958738 ("virtio-ring: store DMA metadata in desc_extra > > > for split virtqueue") tries to make

Re: [PATCH] virtio_ring: aovid reading flag from the descriptor ring

2022-02-22 Thread Michael S. Tsirkin
On Wed, Feb 23, 2022 at 11:19:03AM +0800, Jason Wang wrote: > On Mon, Nov 8, 2021 at 4:13 PM Jason Wang wrote: > > > > Commit 72b5e8958738 ("virtio-ring: store DMA metadata in desc_extra > > for split virtqueue") tries to make it possible for the driver to not > > read from the descriptor ring to

Re: [RFC PATCH 1/5] uapi/linux/if_tun.h: Added new ioctl for tun/tap.

2022-02-22 Thread Jason Wang
On Tue, Feb 22, 2022 at 9:28 PM Andrew Melnichenko wrote: > > Hi all, > > On Wed, Feb 9, 2022 at 6:26 AM Jason Wang wrote: > > > > > > 在 2022/1/25 下午4:46, Andrew Melnychenko 写道: > > > Added TUNGETSUPPORTEDOFFLOADS that should allow > > > to get bits of supported offloads. > > > > > > So we don't

Re: [PATCH 28/31] vdpa: Expose VHOST_F_LOG_ALL on SVQ

2022-02-22 Thread Jason Wang
On Tue, Feb 22, 2022 at 4:06 PM Eugenio Perez Martin wrote: > > On Tue, Feb 22, 2022 at 8:41 AM Jason Wang wrote: > > > > > > 在 2022/2/17 下午4:22, Eugenio Perez Martin 写道: > > > On Thu, Feb 17, 2022 at 7:02 AM Jason Wang wrote: > > >> On Wed, Feb 16, 2022 at 11:54 PM Eugenio Perez Martin > > >>

Re: [PATCH v1 0/6] virtio: support advance DMA

2022-02-22 Thread Jason Wang
On Wed, Feb 23, 2022 at 10:58 AM Jason Wang wrote: > > On Tue, Feb 22, 2022 at 4:00 PM Xuan Zhuo wrote: > > > > On Tue, 22 Feb 2022 12:02:14 +0800, Jason Wang wrote: > > > > > > 在 2022/2/21 下午7:23, Xuan Zhuo 写道: > > > > On Mon, 21 Feb 2022 11:32:52 +0800, Jason Wang > > > > wrote: > > > >> On

Re: [PATCH v1 6/6] virtio: packed: virtqueue_add_packed() support dma address

2022-02-22 Thread Jason Wang
在 2022/2/10 下午4:51, Xuan Zhuo 写道: virtqueue_add_packed() only supports virtual addresses, dma is completed in virtqueue_add_packed(). In some scenarios (such as the AF_XDP scenario), the memory is allocated and DMA is completed in advance, so it is necessary for us to support passing the DMA ad

Re: [PATCH v1 5/6] virtio: split: virtqueue_add_split() support dma address

2022-02-22 Thread Jason Wang
在 2022/2/10 下午4:51, Xuan Zhuo 写道: virtqueue_add_split() only supports virtual addresses, dma is completed in virtqueue_add_split(). In some scenarios (such as the AF_XDP scenario), the memory is allocated and DMA is completed in advance, so it is necessary for us to support passing the DMA addr

Re: [PATCH] virtio_ring: aovid reading flag from the descriptor ring

2022-02-22 Thread Jason Wang
On Mon, Nov 8, 2021 at 4:13 PM Jason Wang wrote: > > Commit 72b5e8958738 ("virtio-ring: store DMA metadata in desc_extra > for split virtqueue") tries to make it possible for the driver to not > read from the descriptor ring to prevent the device from corrupting > the descriptor ring. But it still

Re: [PATCH v1 4/6] virtio: virtqueue_add() support predma

2022-02-22 Thread Jason Wang
On Wed, Feb 23, 2022 at 11:01 AM Jason Wang wrote: > > > 在 2022/2/10 下午4:51, Xuan Zhuo 写道: > > virtuque_add() adds parameter predma. > > > > Signed-off-by: Xuan Zhuo > > --- > > drivers/virtio/virtio_ring.c | 11 ++- > > 1 file changed, 6 insertions(+), 5 deletions(-) > > > > diff --gi

Re: [PATCH v1 4/6] virtio: virtqueue_add() support predma

2022-02-22 Thread Jason Wang
在 2022/2/10 下午4:51, Xuan Zhuo 写道: virtuque_add() adds parameter predma. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index cfb028ca238e..c

Re: [PATCH v1 0/6] virtio: support advance DMA

2022-02-22 Thread Jason Wang
On Tue, Feb 22, 2022 at 4:00 PM Xuan Zhuo wrote: > > On Tue, 22 Feb 2022 12:02:14 +0800, Jason Wang wrote: > > > > 在 2022/2/21 下午7:23, Xuan Zhuo 写道: > > > On Mon, 21 Feb 2022 11:32:52 +0800, Jason Wang > > > wrote: > > >> On Fri, Feb 18, 2022 at 5:00 PM Xuan Zhuo > > >> wrote: > > >>> On Thu,

Re: [PATCH v1 3/6] virtio: remove flags check for unmap packed indirect desc

2022-02-22 Thread Jason Wang
在 2022/2/10 下午4:51, Xuan Zhuo 写道: When calling vring_unmap_desc_packed(), it will not encounter the situation that the flags contains VRING_DESC_F_INDIRECT. So remove this logic. This seems not correct. There's a call from detach_buf_packed() that can work for indirect descriptors? Thanks

Re: [PATCH v1 2/6] virtio: remove flags check for unmap split indirect desc

2022-02-22 Thread Jason Wang
在 2022/2/10 下午4:51, Xuan Zhuo 写道: When calling vring_unmap_one_split_indirect(), it will not encounter the situation that the flags contains VRING_DESC_F_INDIRECT. So remove this logic. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 18 +--

Re: [PATCH v1 1/6] virtio: rename vring_unmap_state_packed() to vring_unmap_extra_packed()

2022-02-22 Thread Jason Wang
在 2022/2/10 下午4:51, Xuan Zhuo 写道: The actual parameter handled by vring_unmap_state_packed() is that vring_desc_extra, so this function should use "extra" instead of "state". Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 17 - 1 file

Re: [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding

2022-02-22 Thread Jason Wang
On Tue, Feb 22, 2022 at 4:56 PM Eugenio Perez Martin wrote: > > On Tue, Feb 22, 2022 at 8:26 AM Jason Wang wrote: > > > > > > 在 2022/2/21 下午4:15, Eugenio Perez Martin 写道: > > > On Mon, Feb 21, 2022 at 8:44 AM Jason Wang wrote: > > >> > > >> 在 2022/2/17 下午8:48, Eugenio Perez Martin 写道: > > >>> On

Re: [PATCH] vhost: use bvec_kmap_local in {get,put}u16_iotlb

2022-02-22 Thread Jason Wang
On Tue, Feb 22, 2022 at 11:49 PM Christoph Hellwig wrote: > > Using local kmaps slightly reduces the chances to stray writes, and > the bvec interface cleans up the code a little bit. > > Signed-off-by: Christoph Hellwig Acked-by: Jason Wang > --- > drivers/vhost/vringh.c | 18 ---

Re: [PATCH v2] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-22 Thread Jason Wang
On Tue, Feb 22, 2022 at 5:47 PM Stefano Garzarella wrote: > > vhost_vsock_stop() calls vhost_dev_check_owner() to check the device > ownership. It expects current->mm to be valid. > > vhost_vsock_stop() is also called by vhost_vsock_dev_release() when > the user has not done close(), so when we ar

Re: [PATCH] vhost: validate range size before adding to iotlb

2022-02-22 Thread Jason Wang
On Tue, Feb 22, 2022 at 11:02 PM Michael S. Tsirkin wrote: > > On Tue, Feb 22, 2022 at 03:11:07PM +0800, Jason Wang wrote: > > On Tue, Feb 22, 2022 at 12:57 PM Anirudh Rayabharam > > wrote: > > > > > > On Tue, Feb 22, 2022 at 10:50:20AM +0800, Jason Wang wrote: > > > > On Tue, Feb 22, 2022 at 3:

Re: [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding

2022-02-22 Thread Jason Wang
On Wed, Feb 23, 2022 at 3:01 AM Eugenio Perez Martin wrote: > > On Tue, Feb 8, 2022 at 9:11 AM Jason Wang wrote: > > > > > > 在 2022/2/2 上午1:08, Eugenio Perez Martin 写道: > > > On Sun, Jan 30, 2022 at 5:43 AM Jason Wang wrote: > > >> > > >> 在 2022/1/22 上午4:27, Eugenio Pérez 写道: > > >>> Initial ver

Re: [PATCH] vhost: validate range size before adding to iotlb

2022-02-22 Thread Michael S. Tsirkin
On Tue, Feb 22, 2022 at 10:57:41PM +0530, Anirudh Rayabharam wrote: > On Tue, Feb 22, 2022 at 10:02:29AM -0500, Michael S. Tsirkin wrote: > > On Tue, Feb 22, 2022 at 03:11:07PM +0800, Jason Wang wrote: > > > On Tue, Feb 22, 2022 at 12:57 PM Anirudh Rayabharam > > > wrote: > > > > > > > > On Tue,

Re: [PATCH] tools/virtio: Test virtual address range detection

2022-02-22 Thread Matthew Wilcox
On Tue, Feb 22, 2022 at 07:58:33AM +, David Woodhouse wrote: > On Tue, 2022-02-22 at 01:31 -0500, Michael S. Tsirkin wrote: > > On Mon, Feb 21, 2022 at 05:18:48PM +, David Woodhouse wrote: > > > > > > [dwoodhou@i7 virtio]$ sudo ~/virtio_test > > > Detected virtual address range 0x1000-0x7f

Re: [PATCH] drm/virtio: Add USE_INTERNAL blob flag

2022-02-22 Thread Chia-I Wu
On Fri, Feb 18, 2022 at 9:51 AM Rob Clark wrote: > > On Fri, Feb 18, 2022 at 8:42 AM Chia-I Wu wrote: > > > > On Fri, Feb 18, 2022 at 7:57 AM Rob Clark wrote: > > > > > > From: Rob Clark > > > > > > With native userspace drivers in guest, a lot of GEM objects need to be > > > neither shared nor

Re: [PATCH] drm/virtio: Remove restriction of non-zero blob_flags

2022-02-22 Thread Chia-I Wu
On Sat, Feb 19, 2022 at 9:02 AM Rob Clark wrote: > > From: Rob Clark > > With native userspace drivers in guest, a lot of GEM objects need to be > neither shared nor mappable. And in fact making everything mappable > and/or sharable results in unreasonably high fd usage in host VMM. > > Signed-o

Re: [PATCH v4 3/4] drivers/net/virtio_net: Added RSS hash report.

2022-02-22 Thread kernel test robot
note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Andrew-Melnychenko/RSS-support-for-VirtioNet/20220222-200334 base: https://git.kernel.org/pub/scm/linux/kernel/git/mst

[PATCH] vhost: use bvec_kmap_local in {get,put}u16_iotlb

2022-02-22 Thread Christoph Hellwig
Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig --- drivers/vhost/vringh.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/vhost/vringh.c b/dri

Re: [PATCH] vhost: validate range size before adding to iotlb

2022-02-22 Thread Michael S. Tsirkin
On Tue, Feb 22, 2022 at 03:11:07PM +0800, Jason Wang wrote: > On Tue, Feb 22, 2022 at 12:57 PM Anirudh Rayabharam > wrote: > > > > On Tue, Feb 22, 2022 at 10:50:20AM +0800, Jason Wang wrote: > > > On Tue, Feb 22, 2022 at 3:53 AM Anirudh Rayabharam > > > wrote: > > > > > > > > In vhost_iotlb_add

Re: [PATCH] vhost: validate range size before adding to iotlb

2022-02-22 Thread Michael S. Tsirkin
On Tue, Feb 22, 2022 at 01:23:03AM +0530, Anirudh Rayabharam wrote: > In vhost_iotlb_add_range_ctx(), validate the range size is non-zero > before proceeding with adding it to the iotlb. > > Range size can overflow to 0 when start is 0 and last is (2^64 - 1). > One instance where it can happen is

Re: [RFC PATCH 1/5] uapi/linux/if_tun.h: Added new ioctl for tun/tap.

2022-02-22 Thread Andrew Melnichenko
Hi all, On Wed, Feb 9, 2022 at 6:26 AM Jason Wang wrote: > > > 在 2022/1/25 下午4:46, Andrew Melnychenko 写道: > > Added TUNGETSUPPORTEDOFFLOADS that should allow > > to get bits of supported offloads. > > > So we don't use dedicated ioctls in the past, instead, we just probing > by checking the retur

Re: [RFC PATCH 2/5] driver/net/tun: Added features for USO.

2022-02-22 Thread Andrew Melnichenko
On Wed, Feb 9, 2022 at 6:39 AM Jason Wang wrote: > > > 在 2022/1/25 下午4:46, Andrew Melnychenko 写道: > > Added support for USO4 and USO6, also added code for new ioctl > > TUNGETSUPPORTEDOFFLOADS. > > For now, to "enable" USO, it's required to set both USO4 and USO6 > > simultaneously. > > USO enab

Re: [RFC PATCH 3/5] uapi/linux/virtio_net.h: Added USO types.

2022-02-22 Thread Andrew Melnichenko
Hi all, On Wed, Feb 9, 2022 at 6:41 AM Jason Wang wrote: > > > 在 2022/1/25 下午4:47, Andrew Melnychenko 写道: > > Added new GSO type for USO: VIRTIO_NET_HDR_GSO_UDP_L4. > > Feature VIRTIO_NET_F_HOST_USO allows to enable NETIF_F_GSO_UDP_L4. > > Separated VIRTIO_NET_F_GUEST_USO4 & VIRTIO_NET_F_GUEST_

Re: [RFC PATCH 0/5] TUN/VirtioNet USO features support.

2022-02-22 Thread Andrew Melnichenko
Hi all, On Wed, Feb 9, 2022 at 7:41 AM Jason Wang wrote: > > > 在 2022/2/8 下午9:09, Andrew Melnichenko 写道: > > Hi people, > > Can you please review this series? > > > Are there any performance number to demonstrate the difference? > > Thanks > Yeah, I've used udpgso_bench from Linux to test. Here

[PATCH v4 3/4] drivers/net/virtio_net: Added RSS hash report.

2022-02-22 Thread Andrew Melnychenko
Added features for RSS hash report. If hash is provided - it sets to skb. Added checks if rss and/or hash are enabled together. Signed-off-by: Andrew Melnychenko --- drivers/net/virtio_net.c | 55 +++- 1 file changed, 49 insertions(+), 6 deletions(-) diff --g

[PATCH v4 4/4] drivers/net/virtio_net: Added RSS hash report control.

2022-02-22 Thread Andrew Melnychenko
Now it's possible to control supported hashflows. Added hashflow set/get callbacks. Also, disabling RXH_IP_SRC/DST for TCP would disable then for UDP. TCP and UDP supports only: ethtool -U eth0 rx-flow-hash tcp4 sd RXH_IP_SRC + RXH_IP_DST ethtool -U eth0 rx-flow-hash tcp4 sdfn RXH_IP_SRC +

[PATCH v4 2/4] drivers/net/virtio_net: Added basic RSS support.

2022-02-22 Thread Andrew Melnychenko
Added features for RSS. Added initialization, RXHASH feature and ethtool ops. By default RSS/RXHASH is disabled. Virtio RSS "IPv6 extensions" hashes disabled. Added ethtools ops to set key and indirection table. Signed-off-by: Andrew Melnychenko --- drivers/net/virtio_net.c | 192 +++

[PATCH v4 1/4] drivers/net/virtio_net: Fixed padded vheader to use v1 with hash.

2022-02-22 Thread Andrew Melnychenko
The header v1 provides additional info about RSS. Added changes to computing proper header length. In the next patches, the header may contain RSS hash info for the hash population. Signed-off-by: Andrew Melnychenko --- drivers/net/virtio_net.c | 11 ++- 1 file changed, 6 insertions(+),

[PATCH v4 0/4] RSS support for VirtioNet.

2022-02-22 Thread Andrew Melnychenko
Virtio-net supports "hardware" RSS with toeplitz key. Also, it allows receiving calculated hash in vheader that may be used with RPS. Added ethtools callbacks to manipulate RSS. Technically hash calculation may be set only for SRC+DST and SRC+DST+PORTSRC+PORTDST hashflows. The completely disabling

Re: [syzbot] INFO: task hung in vhost_work_dev_flush

2022-02-22 Thread Dan Carpenter
On Mon, Feb 21, 2022 at 09:23:04PM +0530, Anirudh Rayabharam wrote: > On Mon, Feb 21, 2022 at 03:12:33PM +0100, Stefano Garzarella wrote: > > #syz test: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ > > f71077a4d84b > > > > Patch sent upstream: > > https://lore.kernel.or

[PATCH v2] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-22 Thread Stefano Garzarella
vhost_vsock_stop() calls vhost_dev_check_owner() to check the device ownership. It expects current->mm to be valid. vhost_vsock_stop() is also called by vhost_vsock_dev_release() when the user has not done close(), so when we are in do_exit(). In this case current->mm is invalid and we're releasin

Re: [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-22 Thread Stefano Garzarella
On Tue, Feb 22, 2022 at 01:06:12AM +0530, Anirudh Rayabharam wrote: On Mon, Feb 21, 2022 at 07:26:28PM +0100, Stefano Garzarella wrote: On Mon, Feb 21, 2022 at 11:33:11PM +0530, Anirudh Rayabharam wrote: > On Mon, Feb 21, 2022 at 05:44:20PM +0100, Stefano Garzarella wrote: > > On Mon, Feb 21, 20

Re: [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-22 Thread Stefano Garzarella
linux-next config: x86_64-randconfig-m031-20220221 (https://download.01.org/0day-ci/archive/20220222/202202220707.am3rkucp-...@intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan

Re: [PATCH v1 0/6] virtio: support advance DMA

2022-02-22 Thread Xuan Zhuo
On Tue, 22 Feb 2022 12:02:14 +0800, Jason Wang wrote: > > 在 2022/2/21 下午7:23, Xuan Zhuo 写道: > > On Mon, 21 Feb 2022 11:32:52 +0800, Jason Wang wrote: > >> On Fri, Feb 18, 2022 at 5:00 PM Xuan Zhuo > >> wrote: > >>> On Thu, 17 Feb 2022 15:19:44 +0800, Jason Wang > >>> wrote: > On Thu, Feb

Re: [PATCH 17/31] vdpa: adapt vhost_ops callbacks to svq

2022-02-22 Thread Jason Wang
On Tue, Feb 22, 2022 at 3:43 PM Eugenio Perez Martin wrote: > > On Tue, Feb 22, 2022 at 4:16 AM Jason Wang wrote: > > > > On Tue, Feb 22, 2022 at 1:23 AM Eugenio Perez Martin > > wrote: > > > > > > On Mon, Feb 21, 2022 at 8:15 AM Jason Wang wrote: > > > > > > > > > > > > 在 2022/2/18 上午1:13, Eug