Re: [PATCH v2 3/3] vdpa: support exposing the count of vqs to userspace

2022-03-14 Thread Jason Wang
On Tue, Mar 15, 2022 at 11:26 AM Longpeng(Mike) wrote: > From: Longpeng > > - GET_VQS_COUNT: the count of virtqueues that exposed > Acked-by: Jason Wang > > Signed-off-by: Longpeng > --- > drivers/vhost/vdpa.c | 13 + > include/uapi/linux/vhost.h | 3 +++ > 2 files chang

Re: [PATCH v2 2/3] vdpa: change the type of nvqs to u32

2022-03-14 Thread Jason Wang
On Tue, Mar 15, 2022 at 11:26 AM Longpeng(Mike) wrote: > From: Longpeng > > Change vdpa_device.nvqs and vhost_vdpa.nvqs to use u32 > > Signed-off-by: Longpeng > Acked-by: Jason Wang > --- > drivers/vdpa/vdpa.c | 6 +++--- > drivers/vhost/vdpa.c | 10 ++ > include/linux/vdpa.h |

Re: [PATCH] virtio-blk: support polling I/O

2022-03-14 Thread Michael S. Tsirkin
On Mon, Mar 14, 2022 at 06:33:06PM +0200, Max Gurtovoy wrote: > > On 3/14/2022 5:15 PM, Michael S. Tsirkin wrote: > > On Mon, Mar 14, 2022 at 03:26:13PM +0200, Max Gurtovoy wrote: > > > On 3/14/2022 1:15 PM, Michael S. Tsirkin wrote: > > > > On Mon, Mar 14, 2022 at 12:25:08PM +0200, Max Gurtovoy w

Re: [PATCH v7 2/5] mm: page_isolation: check specified range for unmovable pages

2022-03-14 Thread David Hildenbrand
On 11.03.22 19:36, Zi Yan wrote: > From: Zi Yan > > Enable set_migratetype_isolate() to check specified sub-range for > unmovable pages during isolation. Page isolation is done > at max(MAX_ORDER_NR_PAEGS, pageblock_nr_pages) granularity, but not all > pages within that granularity are intended t

Re: [PATCH v7 1/5] mm: page_isolation: move has_unmovable_pages() to mm/page_isolation.c

2022-03-14 Thread David Hildenbrand
On 11.03.22 19:36, Zi Yan wrote: > From: Zi Yan > > has_unmovable_pages() is only used in mm/page_isolation.c. Move it from > mm/page_alloc.c and make it static. > > Signed-off-by: Zi Yan > Reviewed-by: Oscar Salvador > Reviewed-by: Mike Rapoport Acked-by: David Hildenbrand -- Thanks, D

Re: [PATCH] virtio-blk: support polling I/O

2022-03-14 Thread Stefan Hajnoczi
On Sat, Mar 12, 2022 at 12:28:32AM +0900, Suwan Kim wrote: > This patch supports polling I/O via virtio-blk driver. Polling > feature is enabled based on "VIRTIO_BLK_F_MQ" feature and the number > of polling queues can be set by QEMU virtio-blk-pci property > "num-poll-queues=N". This patch improve

Re: [PATCH] virtio-blk: support polling I/O

2022-03-14 Thread Michael S. Tsirkin
On Mon, Mar 14, 2022 at 03:26:13PM +0200, Max Gurtovoy wrote: > > On 3/14/2022 1:15 PM, Michael S. Tsirkin wrote: > > On Mon, Mar 14, 2022 at 12:25:08PM +0200, Max Gurtovoy wrote: > > > On 3/14/2022 11:43 AM, Suwan Kim wrote: > > > > On Sun, Mar 13, 2022 at 12:37:21PM +0200, Max Gurtovoy wrote: >

Re: [PATCH] virtio-blk: support polling I/O

2022-03-14 Thread Michael S. Tsirkin
On Mon, Mar 14, 2022 at 10:22:01PM +0900, Suwan Kim wrote: > On Mon, Mar 14, 2022 at 07:15:18AM -0400, Michael S. Tsirkin wrote: > > On Mon, Mar 14, 2022 at 12:25:08PM +0200, Max Gurtovoy wrote: > > > > > > On 3/14/2022 11:43 AM, Suwan Kim wrote: > > > > On Sun, Mar 13, 2022 at 12:37:21PM +0200, M

Re: [PATCH] virtio-blk: support polling I/O

2022-03-14 Thread Stefan Hajnoczi
On Mon, Mar 14, 2022 at 09:33:08PM +0900, Suwan Kim wrote: > On Mon, Mar 14, 2022 at 02:14:53PM +0800, Jason Wang wrote: > > > > 在 2022/3/11 下午11:28, Suwan Kim 写道: > > > diff --git a/include/uapi/linux/virtio_blk.h > > > b/include/uapi/linux/virtio_blk.h > > > index d888f013d9ff..3fcaf937afe1 100

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-14 Thread Lee Jones
On Mon, 14 Mar 2022, Michael S. Tsirkin wrote: > On Mon, Mar 14, 2022 at 08:43:02AM +, Lee Jones wrote: > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > to vhost_get_vq_desc(). All we have to do here is take the same lock > > during virtqueue clean-up and we mitiga

[GIT PULL] virtio: a last minute regression fix

2022-03-14 Thread Michael S. Tsirkin
The following changes since commit 3dd7d135e75cb37c8501ba02977332a2a487dd39: tools/virtio: handle fallout from folio work (2022-03-06 06:06:50 -0500) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus for you to fetch changes

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-14 Thread Michael S. Tsirkin
On Mon, Mar 14, 2022 at 08:43:02AM +, Lee Jones wrote: > vhost_vsock_handle_tx_kick() already holds the mutex during its call > to vhost_get_vq_desc(). All we have to do here is take the same lock > during virtqueue clean-up and we mitigate the reported issues. > > Also WARN() as a precaution

Re: [PATCH v8 01/16] virtio: add helper virtqueue_get_vring_max_size()

2022-03-14 Thread Xuan Zhuo
On Mon, 14 Mar 2022 07:18:27 -0400, "Michael S. Tsirkin" wrote: > On Mon, Mar 14, 2022 at 10:50:08AM +0100, Cornelia Huck wrote: > > On Mon, Mar 14 2022, Xuan Zhuo wrote: > > > > > Record the maximum queue num supported by the device. > > > > > > virtio-net can display the maximum (supported by

Re: [PATCH v8 01/16] virtio: add helper virtqueue_get_vring_max_size()

2022-03-14 Thread Michael S. Tsirkin
On Mon, Mar 14, 2022 at 10:50:08AM +0100, Cornelia Huck wrote: > On Mon, Mar 14 2022, Xuan Zhuo wrote: > > > Record the maximum queue num supported by the device. > > > > virtio-net can display the maximum (supported by hardware) ring size in > > ethtool -g eth0. > > > > When the subsequent patch

Re: [PATCH] virtio-blk: support polling I/O

2022-03-14 Thread Michael S. Tsirkin
On Mon, Mar 14, 2022 at 12:25:08PM +0200, Max Gurtovoy wrote: > > On 3/14/2022 11:43 AM, Suwan Kim wrote: > > On Sun, Mar 13, 2022 at 12:37:21PM +0200, Max Gurtovoy wrote: > > > On 3/11/2022 6:07 PM, Suwan Kim wrote: > > > > On Fri, Mar 11, 2022 at 10:38:07AM -0500, Michael S. Tsirkin wrote: > > >

Re: [bug report] vDPA/ifcvf: implement shared IRQ feature

2022-03-14 Thread Dan Carpenter
On Mon, Mar 14, 2022 at 10:22:03AM +0800, Zhu, Lingshan wrote: > Hello Dan, > > Thanks for your suggestions and this auto-testing efforts! > On handling the vector for device config interrupt, there are three > possibilities: > (1)it has a dedicated vector(2)it shares a vector with datapath(3)no >

Re: [PATCH v8 01/16] virtio: add helper virtqueue_get_vring_max_size()

2022-03-14 Thread Cornelia Huck
On Mon, Mar 14 2022, Xuan Zhuo wrote: > Record the maximum queue num supported by the device. > > virtio-net can display the maximum (supported by hardware) ring size in > ethtool -g eth0. > > When the subsequent patch implements vring reset, it can judge whether > the ring size passed by the dri

[PATCH v8 16/16] virtio_ring: introduce virtqueue_resize()

2022-03-14 Thread Xuan Zhuo
Introduce virtqueue_resize() to implement the resize of vring. Based on these, the driver can dynamically adjust the size of the vring. For example: ethtool -G. virtqueue_resize() implements resize based on the vq reset function. In case of failure to allocate a new vring, it will give up resize a

[PATCH v8 08/16] virtio_ring: split: extract the logic of attach vring

2022-03-14 Thread Xuan Zhuo
Separate the logic of attach vring, subsequent patches will call it separately. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index

[PATCH v8 14/16] virtio_ring: packed: extract the logic of vq init

2022-03-14 Thread Xuan Zhuo
Separate the logic of initializing vq, and subsequent patches will call it separately. The characteristic of this part of the logic is that it does not depend on the information passed by the upper layer, and can be called repeatedly. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c |

[PATCH v8 03/16] virtio_ring: update the document of the virtqueue_detach_unused_buf for queue reset

2022-03-14 Thread Xuan Zhuo
Added documentation for virtqueue_detach_unused_buf, allowing it to be called on queue reset. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index b87130

[PATCH v8 04/16] virtio_ring: remove the arg vq of vring_alloc_desc_extra()

2022-03-14 Thread Xuan Zhuo
The parameter vq of vring_alloc_desc_extra() is useless. This patch removes this parameter. Subsequent patches will call this function to avoid passing useless arguments. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff

[PATCH v8 01/16] virtio: add helper virtqueue_get_vring_max_size()

2022-03-14 Thread Xuan Zhuo
Record the maximum queue num supported by the device. virtio-net can display the maximum (supported by hardware) ring size in ethtool -g eth0. When the subsequent patch implements vring reset, it can judge whether the ring size passed by the driver is legal based on this. Signed-off-by: Xuan Zhu

[PATCH v8 02/16] virtio: struct virtio_config_ops add callbacks for queue_reset

2022-03-14 Thread Xuan Zhuo
Performing reset on a queue is divided into four steps: 1. transport: notify the device to reset the queue 2. vring: recycle the buffer submitted 3. vring: reset/resize the vring (may re-alloc) 4. transport: mmap vring to device, and enable the queue In order to support queue reset, a

[PATCH v8 11/16] virtio_ring: packed: extract the logic of alloc queue

2022-03-14 Thread Xuan Zhuo
Separate the logic of packed to create vring queue. For the convenience of passing parameters, add a structure vring_packed. This feature is required for subsequent virtuqueue reset vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 121 ++- 1 fi

[PATCH v8 12/16] virtio_ring: packed: extract the logic of alloc state and extra

2022-03-14 Thread Xuan Zhuo
Separate the logic for alloc desc_state and desc_extra, which will be called separately by subsequent patches. Use struct vring_packed to pass desc_state, desc_extra. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 50 ++-- 1 file changed, 36 insertio

[PATCH v8 15/16] virtio_ring: packed: implement virtqueue_resize_packed()

2022-03-14 Thread Xuan Zhuo
virtio ring packed supports resize. Only after the new vring is successfully allocated based on the new num, we will release the old vring. In any case, an error is returned, indicating that the vring still points to the old vring. In the case of an error, we will re-initialize the state of the vr

[PATCH v8 10/16] virtio_ring: split: implement virtqueue_resize_split()

2022-03-14 Thread Xuan Zhuo
virtio ring split supports resize. Only after the new vring is successfully allocated based on the new num, we will release the old vring. In any case, an error is returned, indicating that the vring still points to the old vring. In the case of an error, we will re-initialize the state of the vri

[PATCH v8 09/16] virtio_ring: split: extract the logic of vq init

2022-03-14 Thread Xuan Zhuo
Separate the logic of initializing vq, and subsequent patches will call it separately. The feature of this part is that it does not depend on the information passed by the upper layer and can be called repeatedly. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 65 ++

[PATCH v8 13/16] virtio_ring: packed: extract the logic of attach vring

2022-03-14 Thread Xuan Zhuo
Separate the logic of attach vring, the subsequent patch will call it separately. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 41 +++- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/vir

[PATCH v8 06/16] virtio_ring: split: extract the logic of alloc queue

2022-03-14 Thread Xuan Zhuo
Separate the logic of split to create vring queue. This feature is required for subsequent virtuqueue reset vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 53 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/drivers/virtio/

[PATCH v8 07/16] virtio_ring: split: extract the logic of alloc state and extra

2022-03-14 Thread Xuan Zhuo
Separate the logic of creating desc_state, desc_extra, and subsequent patches will call it independently. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 52 +--- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/drivers/virtio/virtio_rin

[PATCH v8 05/16] virtio_ring: extract the logic of freeing vring

2022-03-14 Thread Xuan Zhuo
Introduce __vring_free() to free the vring of vq. Subsequent patches will use __vring_free() alone. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/vir

[PATCH v8 00/16] virtio pci support VIRTIO_F_RING_RESET (refactor vring)

2022-03-14 Thread Xuan Zhuo
The virtio spec already supports the virtio queue reset function. This patch set is to add this function to the kernel. The relevant virtio spec information is here: https://github.com/oasis-tcs/virtio-spec/issues/124 Also regarding MMIO support for queue reset, I plan to support it after thi

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-14 Thread Greg KH
On Mon, Mar 14, 2022 at 08:43:02AM +, Lee Jones wrote: > vhost_vsock_handle_tx_kick() already holds the mutex during its call > to vhost_get_vq_desc(). All we have to do here is take the same lock > during virtqueue clean-up and we mitigate the reported issues. > > Also WARN() as a precaution

[PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-14 Thread Lee Jones
vhost_vsock_handle_tx_kick() already holds the mutex during its call to vhost_get_vq_desc(). All we have to do here is take the same lock during virtqueue clean-up and we mitigate the reported issues. Also WARN() as a precautionary measure. The purpose of this is to capture possible future race