Re: [PATCH net V4] virtio-net: fix the race between refill work and close

2022-07-04 Thread Michael S. Tsirkin
On Mon, Jul 04, 2022 at 12:19:48PM +0800, Jason Wang wrote: > We try using cancel_delayed_work_sync() to prevent the work from > enabling NAPI. This is insufficient since we don't disable the source > of the refill work scheduling. This means an NAPI poll callback after >

Re: [PATCH V3] virtio: disable notification hardening by default

2022-07-04 Thread Jason Wang
On Mon, Jul 4, 2022 at 2:22 PM Michael S. Tsirkin wrote: > > On Mon, Jul 04, 2022 at 12:23:27PM +0800, Jason Wang wrote: > > > So if there are not examples of callbacks not ready after kick > > > then let us block callbacks until first kick. That is my idea. > > > > Ok, let me try. I need to

Re: [PATCH V3] virtio: disable notification hardening by default

2022-07-04 Thread Michael S. Tsirkin
On Mon, Jul 04, 2022 at 02:40:16PM +0800, Jason Wang wrote: > On Mon, Jul 4, 2022 at 2:22 PM Michael S. Tsirkin wrote: > > > > On Mon, Jul 04, 2022 at 12:23:27PM +0800, Jason Wang wrote: > > > > So if there are not examples of callbacks not ready after kick > > > > then let us block callbacks

Re: [PATCH net V4] virtio-net: fix the race between refill work and close

2022-07-04 Thread Jason Wang
On Mon, Jul 4, 2022 at 3:03 PM Michael S. Tsirkin wrote: > > On Mon, Jul 04, 2022 at 02:32:45PM +0800, Jason Wang wrote: > > On Mon, Jul 4, 2022 at 2:19 PM Michael S. Tsirkin wrote: > > > > > > On Mon, Jul 04, 2022 at 12:19:48PM +0800, Jason Wang wrote: > > > > We try using

Re: [PATCH V3] virtio: disable notification hardening by default

2022-07-04 Thread Michael S. Tsirkin
On Mon, Jul 04, 2022 at 12:23:27PM +0800, Jason Wang wrote: > > So if there are not examples of callbacks not ready after kick > > then let us block callbacks until first kick. That is my idea. > > Ok, let me try. I need to drain my queue of fixes first. > > Thanks If we do find issues, another

Re: [PATCH net V4] virtio-net: fix the race between refill work and close

2022-07-04 Thread Jason Wang
On Mon, Jul 4, 2022 at 2:19 PM Michael S. Tsirkin wrote: > > On Mon, Jul 04, 2022 at 12:19:48PM +0800, Jason Wang wrote: > > We try using cancel_delayed_work_sync() to prevent the work from > > enabling NAPI. This is insufficient since we don't disable the source > > of the refill work

Re: [PATCH net V4] virtio-net: fix the race between refill work and close

2022-07-04 Thread Michael S. Tsirkin
On Mon, Jul 04, 2022 at 02:32:45PM +0800, Jason Wang wrote: > On Mon, Jul 4, 2022 at 2:19 PM Michael S. Tsirkin wrote: > > > > On Mon, Jul 04, 2022 at 12:19:48PM +0800, Jason Wang wrote: > > > We try using cancel_delayed_work_sync() to prevent the work from > > > enabling NAPI. This is

Re: [PATCH net V5] virtio-net: fix the race between refill work and close

2022-07-04 Thread Michael S. Tsirkin
On Mon, Jul 04, 2022 at 03:48:59PM +0800, Jason Wang wrote: > We try using cancel_delayed_work_sync() to prevent the work from > enabling NAPI. This is insufficient since we don't disable the source > of the refill work scheduling. This means an NAPI poll callback after >

Re: [PATCH 0/6] VDUSE: Support registering userspace memory as bounce buffer

2022-07-04 Thread Liu Xiaodong
On Wed, Jun 29, 2022 at 04:25:35PM +0800, Xie Yongji wrote: > Hi all, > > This series introduces some new ioctls: VDUSE_IOTLB_GET_INFO, > VDUSE_IOTLB_REG_UMEM and VDUSE_IOTLB_DEREG_UMEM to support > registering and de-registering userspace memory for IOTLB > as bounce buffer in virtio-vdpa case.

[PATCH net V5] virtio-net: fix the race between refill work and close

2022-07-04 Thread Jason Wang
We try using cancel_delayed_work_sync() to prevent the work from enabling NAPI. This is insufficient since we don't disable the source of the refill work scheduling. This means an NAPI poll callback after cancel_delayed_work_sync() can schedule the refill work then can re-enable the NAPI that

Re: [Linaro-mm-sig] Re: [PATCH v6 02/22] drm/gem: Move mapping of imported dma-bufs to drm_gem_mmap_obj()

2022-07-04 Thread Christian König via Virtualization
Am 30.06.22 um 01:06 schrieb Dmitry Osipenko: On 6/29/22 11:43, Thomas Hellström (Intel) wrote: On 6/29/22 10:22, Dmitry Osipenko wrote: On 6/29/22 09:40, Thomas Hellström (Intel) wrote: On 5/27/22 01:50, Dmitry Osipenko wrote: Drivers that use drm_gem_mmap() and drm_gem_mmap_obj() helpers

RE: [PATCH V3 3/6] vDPA: allow userspace to query features of a vDPA device

2022-07-04 Thread Parav Pandit via Virtualization
> From: Jason Wang > Sent: Monday, July 4, 2022 12:47 AM > > > 在 2022/7/2 06:02, Parav Pandit 写道: > > > >> From: Zhu Lingshan > >> Sent: Friday, July 1, 2022 9:28 AM > >> > >> This commit adds a new vDPA netlink attribution > >> VDPA_ATTR_VDPA_DEV_SUPPORTED_FEATURES. Userspace can query >

[RFC PATCH 0/6] virtio_test: add support for vhost-vdpa

2022-07-04 Thread Stefano Garzarella
The first 3 patches fix various problems I have encountered with virtio_test (they may go without this series, but I included to allow you to test the series). Patch 4 is in preparation of patch 5, moving the feature negotiation when we initialize the device. Patch 5 add the support of

[RFC PATCH 1/6] tools/virtio: fix build

2022-07-04 Thread Stefano Garzarella
Fix the build caused by the following changes: - phys_addr_t is now defined in tools/include/linux/types.h - dev_warn_once() is used in drivers/virtio/virtio_ring.c - linux/uio.h included by vringh.h use INT_MAX defined in limits.h Signed-off-by: Stefano Garzarella ---

[RFC PATCH 2/6] vhost_test: add $(srctree) on the included path

2022-07-04 Thread Stefano Garzarella
Adding $(srctree) on the included path we can build vhost_test also when the kernel is not built in the source tree (make O=...). Use of EXTRA_CFLAGS is deprecated, so let's use ccflags-y. Signed-off-by: Stefano Garzarella --- tools/virtio/vhost_test/Makefile | 2 +- 1 file changed, 1

[RFC PATCH 3/6] virtio_test: call __virtio_unbreak_device

2022-07-04 Thread Stefano Garzarella
Commit 8b4ec69d7e09 ("virtio: harden vring IRQ") initialize vq->broken to true, so we need to call __virtio_unbreak_device() before starting to use it. Signed-off-by: Stefano Garzarella --- tools/virtio/linux/virtio.h | 2 ++ tools/virtio/virtio_test.c | 1 + 2 files changed, 3 insertions(+)

Re: [RFC PATCH 1/6] tools/virtio: fix build

2022-07-04 Thread Michael S. Tsirkin
On Mon, Jul 04, 2022 at 07:16:56PM +0200, Stefano Garzarella wrote: > Fix the build caused by the following changes: > - phys_addr_t is now defined in tools/include/linux/types.h > - dev_warn_once() is used in drivers/virtio/virtio_ring.c > - linux/uio.h included by vringh.h use INT_MAX defined in

[RFC PATCH 6/6] vdpasim: add vdpa_sim_test module

2022-07-04 Thread Stefano Garzarella
This adds a test module for vhost-vdpa infrastructure to be used with virtio_test. Intentionally not tied to kbuild to prevent people from installing and loading it accidentally. Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_test.c | 203 ++

[RFC PATCH 4/6] tools/virtio: move feature negotiation in vdev_info_init()

2022-07-04 Thread Stefano Garzarella
The feature negotiation are per device, so it' s better to move them earlier in vdev_info_init() since vhost_vq_setup() contains the code to initialize virtqueue. Signed-off-by: Stefano Garzarella --- tools/virtio/virtio_test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff

[RFC PATCH 5/6] virtio_test: support vhost-vdpa device

2022-07-04 Thread Stefano Garzarella
The new --vdpa parameter can be used to run virtio_test with the new vdpa_sim_test.ko that implements the device. The main differences with vhost_test are: - control of status register - dma map messages - VHOST_SET_MEM_TABLE not supported by vhost-vdpa - VHOST_TEST_RUN not supported by

Re: [RFC PATCH 3/6] virtio_test: call __virtio_unbreak_device

2022-07-04 Thread Michael S. Tsirkin
On Mon, Jul 04, 2022 at 07:16:58PM +0200, Stefano Garzarella wrote: > Commit 8b4ec69d7e09 ("virtio: harden vring IRQ") initialize vq->broken > to true, so we need to call __virtio_unbreak_device() before starting > to use it. > > Signed-off-by: Stefano Garzarella I think this shouldn't be

Re: [PATCH] vDPA/ifcvf: remove duplicated assignment to pointer cfg

2022-07-04 Thread Jason Wang
On Tue, Jul 5, 2022 at 3:05 AM Colin Ian King wrote: > > The assignment to pointer cfg is duplicated, the second assignment > is redundant and can be removed. > > Signed-off-by: Colin Ian King Acked-by: Jason Wang > --- > drivers/vdpa/ifcvf/ifcvf_base.c | 1 - > 1 file changed, 1 deletion(-)

[linux-next:master] BUILD REGRESSION b6f1f2fa2bddd69ff46a190b8120bd440fd50563

2022-07-04 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master branch HEAD: b6f1f2fa2bddd69ff46a190b8120bd440fd50563 Add linux-next specific files for 20220704 Error/Warning: (recently discovered and may have been fixed) drivers/pci/endpoint/functions/pci-epf-vntb.c

Re: [PATCH v11 38/40] virtio_net: support rx queue resize

2022-07-04 Thread Xuan Zhuo
On Mon, 4 Jul 2022 11:44:12 +0800, Jason Wang wrote: > > 在 2022/6/29 14:56, Xuan Zhuo 写道: > > This patch implements the resize function of the rx queues. > > Based on this function, it is possible to modify the ring num of the > > queue. > > > > Signed-off-by: Xuan Zhuo > > --- > >

Re: [PATCH v11 08/40] virtio_ring: split: extract the logic of alloc queue

2022-07-04 Thread Xuan Zhuo
On Mon, 4 Jul 2022 11:59:03 +0800, Jason Wang wrote: > > 在 2022/7/1 16:45, Xuan Zhuo 写道: > > On Fri, 1 Jul 2022 16:26:25 +0800, Jason Wang wrote: > >> 在 2022/6/29 14:56, Xuan Zhuo 写道: > >>> Separate the logic of split to create vring queue. > >>> > >>> This feature is required for subsequent

Re: [PATCH v2 2/3] vdpa_sim_blk: limit the number of request handled per batch

2022-07-04 Thread Jason Wang
On Thu, Jun 30, 2022 at 11:32 PM Stefano Garzarella wrote: > > Limit the number of requests (4 per queue as for vdpa_sim_net) handled > in a batch to prevent the worker from using the CPU for too long. > > Suggested-by: Eugenio Pérez > Signed-off-by: Stefano Garzarella Acked-by: Jason Wang >