[PATCH net] virtio-net: set queues after driver_ok

2023-08-08 Thread Jason Wang
Commit 25266128fe16 ("virtio-net: fix race between set queues and probe") tries to fix the race between set queues and probe by calling _virtnet_set_queues() before DRIVER_OK is set. This violates virtio spec. Fixing this by setting queues after virtio_device_ready(). Fixes: 25266128fe16

Re: [PATCH net] virtio-net: fix race between set queues and probe

2023-08-08 Thread Jason Wang
On Tue, Aug 8, 2023 at 7:35 PM Dragos Tatulea wrote: > > On Tue, 2023-07-25 at 03:20 -0400, Jason Wang wrote: > > A race were found where set_channels could be called after registering > > but before virtnet_set_queues() in virtnet_probe(). Fixing this by > > moving the virtnet_set_queues()

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

2023-08-08 Thread Jason Wang
On Tue, Aug 8, 2023 at 3:24 PM Dragos Tatulea wrote: > > On Tue, 2023-08-08 at 10:57 +0800, Jason Wang wrote: > > On Thu, Aug 3, 2023 at 7:40 PM Dragos Tatulea wrote: > > > > > > On Thu, 2023-08-03 at 16:03 +0800, Jason Wang wrote: > > > > On Thu, Aug 3, 2023 at 1:13 AM Dragos Tatulea > > > >

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

2023-08-08 Thread Si-Wei Liu
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 AM, Jason Wang wrote: On Thu, Aug 3, 2023 at 1:13 AM Dragos Tatulea wrote: The mr->initialized flag is shared between the control vq and data vq part of the mr init/uninit. But if

Re: [PATCH net] virtio-net: fix race between set queues and probe

2023-08-08 Thread Dragos Tatulea via Virtualization
On Tue, 2023-07-25 at 03:20 -0400, Jason Wang wrote: > A race were found where set_channels could be called after registering > but before virtnet_set_queues() in virtnet_probe(). Fixing this by > moving the virtnet_set_queues() before netdevice registering. While at > it, use

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

2023-08-08 Thread Ming Lei
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`, so num_possible_cpus() still returns all CPUs because 'maxcpus=1' just

Re: [PATCH] virtio_ring: fix avail_wrap_counter in virtqueue_add_packed

2023-08-08 Thread Michael S. Tsirkin
On Tue, Aug 08, 2023 at 05:37:29PM +0900, Yuan Yao wrote: > Thank you for reviewing, sent a patch with your ack. Don't do this pls. And don't top post please. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

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

2023-08-08 Thread Dragos Tatulea via Virtualization
On Tue, 2023-08-08 at 10:57 +0800, Jason Wang wrote: > On Thu, Aug 3, 2023 at 7:40 PM Dragos Tatulea wrote: > > > > On Thu, 2023-08-03 at 16:03 +0800, Jason Wang wrote: > > > On Thu, Aug 3, 2023 at 1:13 AM Dragos Tatulea wrote: > > > > > > > > The mr->initialized flag is shared between the

Re: [PATCH] virtio_ring: fix avail_wrap_counter in virtqueue_add_packed

2023-08-08 Thread Jason Wang
On Tue, Aug 8, 2023 at 1:59 PM Yuan Yao wrote: > > Since there is a check for 0-length chain in code;BUG_ON(total_sg == 0), we > won’t get a 0-length chain in practice. So, I think use (i <= head) makes the > commit as small as possible. Ok, offered ack in other mail. Thanks > > > Best

Re: [PATCH] virtio_ring: fix avail_wrap_counter in virtqueue_add_packed

2023-08-08 Thread Jason Wang
On Tue, Aug 8, 2023 at 1:59 PM Michael S. Tsirkin wrote: > > On Tue, Aug 08, 2023 at 01:43:02PM +0800, Jason Wang wrote: > > On Tue, Aug 8, 2023 at 1:11 PM Yuan Yao wrote: > > > > > > In current packed virtqueue implementation, the avail_wrap_counter won't > > > flip, in the case when the driver

Re: [PATCH] virtio_ring: fix avail_wrap_counter in virtqueue_add_packed

2023-08-08 Thread Michael S. Tsirkin
On Tue, Aug 08, 2023 at 01:43:02PM +0800, Jason Wang wrote: > On Tue, Aug 8, 2023 at 1:11 PM Yuan Yao wrote: > > > > In current packed virtqueue implementation, the avail_wrap_counter won't > > flip, in the case when the driver supplies a descriptor chain with a > > length equals to the queue