Re: [PATCH V3 04/14] virtio-blk: limit max allowed submit queues

2023-08-10 Thread Michael S. Tsirkin
On Tue, Aug 08, 2023 at 06:42:29PM +0800, Ming Lei wrote: > Take blk-mq's knowledge into account for calculating io queues. > > Fix wrong queue mapping in case of kdump kernel. > > On arm and ppc64, 'maxcpus=1' is passed to kdump command line, see > `Documentation/admin-guide/kdump/kdump.rst`,

Re: [PATCH] virtio_ring: fix avail_wrap_counter in virtqueue_add_packed

2023-08-10 Thread Michael S. Tsirkin
On Tue, Aug 08, 2023 at 07:05:38PM +0900, Yuan Yao wrote: > Sorry, but please ignore this thread. ok, dropped. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop

2023-08-10 Thread Michael S. Tsirkin
On Tue, Aug 08, 2023 at 10:30:56AM +0800, Jason Wang wrote: > On Mon, Jul 31, 2023 at 2:30 PM Jason Wang wrote: > > > > On Thu, Jul 27, 2023 at 5:46 PM Michael S. Tsirkin wrote: > > > > > > On Thu, Jul 27, 2023 at 04:59:33PM +0800, Jason Wang wrote: > > > > > They really shouldn't - any NIC that

Re: [PATCH v3 0/3] vduse: add support for networking devices

2023-08-10 Thread Michael S. Tsirkin
On Thu, Aug 10, 2023 at 02:29:49PM -0700, Jakub Kicinski wrote: > On Thu, 10 Aug 2023 15:04:27 -0400 Michael S. Tsirkin wrote: > > Another question is that with this userspace can inject > > packets directly into net stack. Should we check CAP_NET_ADMIN > > or such? > > Directly into the stack? I

Re: [PATCH v3 0/3] vduse: add support for networking devices

2023-08-10 Thread Michael S. Tsirkin
On Wed, Jul 05, 2023 at 12:04:27PM +0200, Maxime Coquelin wrote: > This small series enables virtio-net device type in VDUSE. > With it, basic operation have been tested, both with > virtio-vdpa and vhost-vdpa using DPDK Vhost library series > adding VDUSE support using split rings layout (merged

Re: [PATCH] virtio_mmio: add suspend and resume calls for virtio_mmio devices

2023-08-10 Thread Michael S. Tsirkin
On Fri, Jul 28, 2023 at 12:31:27PM +0530, Anvesh Jain P wrote: > Handle suspend and resume calls for virtio mmio devices from > PM core. Expose these notifications to virtio drivers that can quiesce and > resume vq operations. Update virtio pm ops to handle freeze& restore and > suspend & resume

Re: [PATCH v11 8/8] vhost: use vhost_tasks for worker threads

2023-08-10 Thread Michael S. Tsirkin
On Sat, Jul 22, 2023 at 11:03:29PM -0500, michael.chris...@oracle.com wrote: > On 7/20/23 8:06 AM, Michael S. Tsirkin wrote: > > On Thu, Feb 02, 2023 at 05:25:17PM -0600, Mike Christie wrote: > >> For vhost workers we use the kthread API which inherit's its values from > >> and checks against the

Re: [PATCH] A new virtio pci driver is added for listening to vcpus inside guest. Each vcpu creates a corresponding thread to periodically send data to qemu's back-end watchdog device.

2023-08-10 Thread kernel test robot
Hi zhanghao1, kernel test robot noticed the following build warnings: [auto build test WARNING on linus/master] [also build test WARNING on v6.5-rc5 next-20230809] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as

Re: [PATCH] virtio: a new vcpu watchdog driver

2023-08-10 Thread Michael S. Tsirkin
On Mon, Jul 31, 2023 at 09:25:12AM +0800, zhanghao1 wrote: > A new virtio pci driver is added for listening to vcpus > inside guest. Each vcpu creates a corresponding thread to > periodically send data to qemu's back-end watchdog device. > If a vCPU is in the stall state, data cannot be sent to >

Re: [PATCH v1 0/2] vduse: add support for networking devices

2023-08-10 Thread Michael S. Tsirkin
On Tue, Jun 27, 2023 at 01:36:50PM +0200, Maxime Coquelin wrote: > This small series enables virtio-net device type in VDUSE. > With it, basic operation have been tested, both with > virtio-vdpa and vhost-vdpa using DPDK Vhost library series > adding VDUSE support using split rings layout (merged

[mst-vhost:vhost 34/46] drivers/vdpa/vdpa_user/vduse_dev.c:1812:23: error: use of undeclared identifier 'VIRTIO_RING_F_INDIRECT_DESC'

2023-08-10 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost head: bb59e1f960bd07f70a4b3d8de99bfd8d71835199 commit: 334f48a83105ebe129a660d1ea1a0c29f87d50c7 [34/46] vduse: Temporarily disable control queue features config: x86_64-buildonly-randconfig-r001-20230811

Re: [PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop

2023-08-10 Thread Jason Wang
On Fri, Aug 11, 2023 at 3:41 AM Michael S. Tsirkin wrote: > > On Tue, Aug 08, 2023 at 10:30:56AM +0800, Jason Wang wrote: > > On Mon, Jul 31, 2023 at 2:30 PM Jason Wang wrote: > > > > > > On Thu, Jul 27, 2023 at 5:46 PM Michael S. Tsirkin > > > wrote: > > > > > > > > On Thu, Jul 27, 2023 at

Re: [PATCH] virtio_mmio: add suspend and resume calls for virtio_mmio devices

2023-08-10 Thread Jason Wang
On Fri, Aug 11, 2023 at 3:45 AM Michael S. Tsirkin wrote: > > On Fri, Jul 28, 2023 at 12:31:27PM +0530, Anvesh Jain P wrote: > > Handle suspend and resume calls for virtio mmio devices from > > PM core. Expose these notifications to virtio drivers that can quiesce and > > resume vq operations.

Re: [PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop

2023-08-10 Thread Michael S. Tsirkin
On Fri, Aug 11, 2023 at 10:23:15AM +0800, Jason Wang wrote: > On Fri, Aug 11, 2023 at 3:41 AM Michael S. Tsirkin wrote: > > > > On Tue, Aug 08, 2023 at 10:30:56AM +0800, Jason Wang wrote: > > > On Mon, Jul 31, 2023 at 2:30 PM Jason Wang wrote: > > > > > > > > On Thu, Jul 27, 2023 at 5:46 PM

Re: [PATCH 1/2] vdpa/mlx5: Fix mr->initialized semantics

2023-08-10 Thread Si-Wei Liu
On 8/9/2023 8:10 PM, Jason Wang wrote: On Thu, Aug 10, 2023 at 8:40 AM Si-Wei Liu wrote: On 8/8/2023 11:52 PM, Jason Wang wrote: On Wed, Aug 9, 2023 at 6:58 AM Si-Wei Liu wrote: On 8/7/2023 8:00 PM, Jason Wang wrote: On Fri, Aug 4, 2023 at 1:58 AM Si-Wei Liu wrote: On 8/3/2023 1:03

Re: [PATCH vhost v11 05/10] virtio_ring: introduce virtqueue_dma_dev()

2023-08-10 Thread Jason Wang
On Thu, Aug 10, 2023 at 9:59 AM Xuan Zhuo wrote: > > > Ping!! > > Could we push this to the next linux version? How about implementing the wrappers along with virtqueue_dma_dev() to see if Christoph is happy? Thanks > > Thanks. > ___ Virtualization

Re: [PATCH vhost v11 05/10] virtio_ring: introduce virtqueue_dma_dev()

2023-08-10 Thread Michael S. Tsirkin
On Thu, Aug 10, 2023 at 02:37:20PM +0800, Jason Wang wrote: > On Thu, Aug 10, 2023 at 9:59 AM Xuan Zhuo wrote: > > > > > > Ping!! > > > > Could we push this to the next linux version? > > How about implementing the wrappers along with virtqueue_dma_dev() to > see if Christoph is happy? > >

Re: [PATCH vhost v11 05/10] virtio_ring: introduce virtqueue_dma_dev()

2023-08-10 Thread Xuan Zhuo
On Thu, 10 Aug 2023 02:39:47 -0400, "Michael S. Tsirkin" wrote: > On Thu, Aug 10, 2023 at 09:56:54AM +0800, Xuan Zhuo wrote: > > > > Ping!! > > > > Could we push this to the next linux version? > > > > Thanks. > > You sent v12, so not this one for sure. > v12 triggered kbuild warnings, you need

Re: [PATCH 0/2] vdpa/mlx5: Fixes for ASID handling

2023-08-10 Thread Michael S. Tsirkin
On Wed, Aug 02, 2023 at 08:12:16PM +0300, Dragos Tatulea wrote: > This patch series is based on Eugenio's fix for handling CVQs in > a different ASID [0]. > > The first patch is the actual fix. > > The next 2 patches are fixing a possible issue that I found while > implementing patch 1. The

Re: [PATCH vhost v11 05/10] virtio_ring: introduce virtqueue_dma_dev()

2023-08-10 Thread Michael S. Tsirkin
On Thu, Aug 10, 2023 at 09:56:54AM +0800, Xuan Zhuo wrote: > > Ping!! > > Could we push this to the next linux version? > > Thanks. You sent v12, so not this one for sure. v12 triggered kbuild warnings, you need to fix them and repost. Note that I'm on vacation from monday, so if you want this

Re: [PATCH] virtio-net: Zero max_tx_vq field for VIRTIO_NET_CTRL_MQ_HASH_CONFIG case

2023-08-10 Thread Michael S. Tsirkin
On Thu, Aug 10, 2023 at 11:15:57AM +0800, Hawkins Jiawei wrote: > Kernel uses `struct virtio_net_ctrl_rss` to save command-specific-data > for both the VIRTIO_NET_CTRL_MQ_HASH_CONFIG and > VIRTIO_NET_CTRL_MQ_RSS_CONFIG commands. > > According to the VirtIO standard, "Field reserved MUST contain

Re: [PATCH 0/2] vdpa/mlx5: Fixes for ASID handling

2023-08-10 Thread Jason Wang
On Thu, Aug 10, 2023 at 4:54 PM Michael S. Tsirkin wrote: > > On Wed, Aug 02, 2023 at 08:12:16PM +0300, Dragos Tatulea wrote: > > This patch series is based on Eugenio's fix for handling CVQs in > > a different ASID [0]. > > > > The first patch is the actual fix. > > > > The next 2 patches are

Re: [PATCH] virtio-net: Zero max_tx_vq field for VIRTIO_NET_CTRL_MQ_HASH_CONFIG case

2023-08-10 Thread Michael S. Tsirkin
On Thu, Aug 10, 2023 at 11:15:57AM +0800, Hawkins Jiawei wrote: > Kernel uses `struct virtio_net_ctrl_rss` to save command-specific-data > for both the VIRTIO_NET_CTRL_MQ_HASH_CONFIG and > VIRTIO_NET_CTRL_MQ_RSS_CONFIG commands. > > According to the VirtIO standard, "Field reserved MUST contain

Re: [PATCH 0/2] vdpa/mlx5: Fixes for ASID handling

2023-08-10 Thread Dragos Tatulea via Virtualization
On Thu, 2023-08-10 at 04:54 -0400, Michael S. Tsirkin wrote: > On Wed, Aug 02, 2023 at 08:12:16PM +0300, Dragos Tatulea wrote: > > This patch series is based on Eugenio's fix for handling CVQs in > > a different ASID [0]. > > > > The first patch is the actual fix. > > > > The next 2 patches are

[PATCH vhost v13 00/12] virtio core prepares for AF_XDP

2023-08-10 Thread Xuan Zhuo
## About DMA APIs Now, virtio may can not work with DMA APIs when virtio features do not have VIRTIO_F_ACCESS_PLATFORM. 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just work with the "real" devices. 2. I tried to let xsk support callballs to get phy address

[PATCH vhost v13 08/12] virtio_ring: separate the logic of reset/enable from virtqueue_resize

2023-08-10 Thread Xuan Zhuo
The subsequent reset function will reuse these logic. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 58 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/drivers/virtio/virtio_ring.c

[PATCH vhost v13 04/12] virtio_ring: support add premapped buf

2023-08-10 Thread Xuan Zhuo
If the vq is the premapped mode, use the sg_dma_address() directly. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index

[PATCH vhost v13 07/12] virtio_ring: correct the expression of the description of virtqueue_resize()

2023-08-10 Thread Xuan Zhuo
Modify the "useless" to a more accurate "unused". Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 7973814b6e31..fd9ae020e0a3

[PATCH vhost v13 02/12] virtio_ring: put mapping error check in vring_map_one_sg

2023-08-10 Thread Xuan Zhuo
This patch put the dma addr error check in vring_map_one_sg(). The benefits of doing this: 1. reduce one judgment of vq->use_dma_api. 2. make vring_map_one_sg more simple, without calling vring_mapping_error to check the return value. simplifies subsequent code Signed-off-by: Xuan Zhuo

[PATCH vhost v13 06/12] virtio_ring: skip unmap for premapped

2023-08-10 Thread Xuan Zhuo
Now we add a case where we skip dma unmap, the vq->premapped is true. We can't just rely on use_dma_api to determine whether to skip the dma operation. For convenience, I introduced the "do_unmap". By default, it is the same as use_dma_api. If the driver is configured with premapped, then

[PATCH vhost v13 03/12] virtio_ring: introduce virtqueue_set_dma_premapped()

2023-08-10 Thread Xuan Zhuo
This helper allows the driver change the dma mode to premapped mode. Under the premapped mode, the virtio core do not do dma mapping internally. This just work when the use_dma_api is true. If the use_dma_api is false, the dma options is not through the DMA APIs, that is not the standard way of

[PATCH vhost v13 01/12] virtio_ring: check use_dma_api before unmap desc for indirect

2023-08-10 Thread Xuan Zhuo
Inside detach_buf_split(), if use_dma_api is false, vring_unmap_one_split_indirect will be called many times, but actually nothing is done. So this patch check use_dma_api firstly. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 6 -- 1 file changed, 4

[PATCH vhost v13 05/12] virtio_ring: introduce virtqueue_dma_dev()

2023-08-10 Thread Xuan Zhuo
Added virtqueue_dma_dev() to get DMA device for virtio. Then the caller can do dma operation in advance. The purpose is to keep memory mapped across multiple add/get buf operations. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 17 +

[PATCH vhost v13 09/12] virtio_ring: introduce virtqueue_reset()

2023-08-10 Thread Xuan Zhuo
Introduce virtqueue_reset() to release all buffer inside vq. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 33 + include/linux/virtio.h | 2 ++ 2 files changed, 35 insertions(+) diff --git a/drivers/virtio/virtio_ring.c

[PATCH vhost v13 11/12] virtio_ring: introduce dma sync api for virtqueue

2023-08-10 Thread Xuan Zhuo
These API has been introduced: * virtqueue_dma_need_sync * virtqueue_dma_sync_single_range_for_cpu * virtqueue_dma_sync_single_range_for_device These APIs can be used together with the premapped mechanism to sync the DMA address. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 76

[PATCH vhost v13 12/12] virtio_net: merge dma operations when filling mergeable buffers

2023-08-10 Thread Xuan Zhuo
Currently, the virtio core will perform a dma operation for each buffer. Although, the same page may be operated multiple times. This patch, the driver does the dma operation and manages the dma address based the feature premapped of virtio core. This way, we can perform only one dma operation

[PATCH vhost v13 10/12] virtio_ring: introduce dma map api for virtqueue

2023-08-10 Thread Xuan Zhuo
Added virtqueue_dma_map_api* to map DMA addresses for virtual memory in advance. The purpose is to keep memory mapped across multiple add/get buf operations. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 69 include/linux/virtio.h | 8

Re: Unbinding virtio_pci_modern does not release BAR4 in Linux 6.5.0-rc4

2023-08-10 Thread Stefan Hajnoczi
On Thu, Aug 10, 2023 at 11:08:52AM +0800, Jason Wang wrote: > On Thu, Aug 3, 2023 at 10:37 PM Stefan Hajnoczi wrote: > > > > Hi, > > After running "driverctl --nosave set-override :01:00.0 vfio-pci" on > > a virtio-blk-pci device, /proc/iomem shows that BAR4 is still owned by > >