[PATCH v11 39/40] virtio_net: support tx queue resize

2022-06-28 Thread Xuan Zhuo
This patch implements the resize function of the tx queues. Based on this function, it is possible to modify the ring num of the queue. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 48 1 file changed, 48 insertions(+) diff --git a/drivers/net/

[PATCH v11 40/40] virtio_net: support set_ringparam

2022-06-28 Thread Xuan Zhuo
Support set_ringparam based on virtio queue reset. Users can use ethtool -G eth0 to modify the ring size of virtio-net. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/net/virtio_net.c | 48 1 file changed, 48 insertions(+) diff --git a/driv

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

2022-06-28 Thread 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 --- drivers/net/virtio_net.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/virtio_net.c b/dri

[PATCH v11 37/40] virtio_net: split free_unused_bufs()

2022-06-28 Thread Xuan Zhuo
This patch separates two functions for freeing sq buf and rq buf from free_unused_bufs(). When supporting the enable/disable tx/rq queue in the future, it is necessary to support separate recovery of a sq buf or a rq buf. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/net/virtio_net

[PATCH v11 36/40] virtio_net: get ringparam by virtqueue_get_vring_max_size()

2022-06-28 Thread Xuan Zhuo
Use virtqueue_get_vring_max_size() in virtnet_get_ringparam() to set tx,rx_max_pending. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/net/virtio_net.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c inde

[PATCH v11 35/40] virtio_net: set the default max ring size by find_vqs()

2022-06-28 Thread Xuan Zhuo
Use virtio_find_vqs_ctx_size() to specify the maximum ring size of tx, rx at the same time. | rx/tx ring size --- speed == UNKNOWN or < 10G| 1024 speed < 40G | 4096 speed >= 40G | 8192 Call virtnet_update_se

[PATCH v11 34/40] virtio: add helper virtio_find_vqs_ctx_size()

2022-06-28 Thread Xuan Zhuo
Introduce helper virtio_find_vqs_ctx_size() to call find_vqs and specify the maximum size of each vq ring. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- include/linux/virtio_config.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/virtio_config.h b/include/li

[PATCH v11 33/40] virtio_mmio: support the arg sizes of find_vqs()

2022-06-28 Thread Xuan Zhuo
Virtio MMIO support the new parameter sizes of find_vqs(). Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_mmio.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 5e3ba3cc7fd0..c

[PATCH v11 32/40] virtio_pci: support the arg sizes of find_vqs()

2022-06-28 Thread Xuan Zhuo
Virtio PCI supports new parameter sizes of find_vqs(). Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_pci_common.c | 18 ++ drivers/virtio/virtio_pci_common.h | 1 + drivers/virtio/virtio_pci_legacy.c | 6 +- drivers/virtio/virtio_pci_modern.c | 10

[PATCH v11 31/40] virtio: find_vqs() add arg sizes

2022-06-28 Thread Xuan Zhuo
find_vqs() adds a new parameter sizes to specify the size of each vq vring. NULL as sizes means that all queues in find_vqs() use the maximum size. A value in the array is 0, which means that the corresponding queue uses the maximum size. In the split scenario, the meaning of size is the largest

[PATCH v11 30/40] virtio_pci: support VIRTIO_F_RING_RESET

2022-06-28 Thread Xuan Zhuo
This patch implements virtio pci support for QUEUE RESET. Performing reset on a queue is divided into these steps: 1. notify the device to reset the queue 2. recycle the buffer submitted 3. reset the vring (may re-alloc) 4. mmap vring to device, and enable the queue This patch implements vir

[PATCH v11 29/40] virtio_pci: extract the logic of active vq for modern pci

2022-06-28 Thread Xuan Zhuo
Introduce vp_active_vq() to configure vring to backend after vq attach vring. And configure vq vector if necessary. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 46 ++ 1 file changed, 28 insertions(+), 18 deletions(-) diff -

[PATCH v11 28/40] virtio_pci: introduce helper to get/set queue reset

2022-06-28 Thread Xuan Zhuo
Introduce new helpers to implement queue reset and get queue reset status. https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_pci_modern_dev.c | 35 ++ include/linux

[PATCH v11 27/40] virtio_pci: struct virtio_pci_common_cfg add queue_reset

2022-06-28 Thread Xuan Zhuo
Add queue_reset in virtio_pci_common_cfg. https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 Signed-off-by: Xuan Zhuo --- include/linux/virtio_pci_modern.h | 2 +- include/uapi/linux/virtio_pci.h | 1 + 2 files changed, 2 insertions(+), 1

[PATCH v11 25/40] virtio: allow to unbreak/break virtqueue individually

2022-06-28 Thread Xuan Zhuo
This patch allows the new introduced __virtqueue_break()/__virtqueue_unbreak() to break/unbreak the virtqueue. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 24 include/linux/virtio.h | 3 +++ 2 files changed, 27 insertions(+) diff --git a/drivers/v

[PATCH v11 26/40] virtio: queue_reset: add VIRTIO_F_RING_RESET

2022-06-28 Thread Xuan Zhuo
Added VIRTIO_F_RING_RESET, it came from here https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 This feature indicates that the driver can reset a queue individually. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- include/uapi/linux/virt

[PATCH v11 24/40] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-06-28 Thread Xuan Zhuo
Add queue_notify_data in struct virtio_pci_common_cfg, which comes from here https://github.com/oasis-tcs/virtio-spec/issues/89 Since I want to add queue_reset after queue_notify_data, I submitted this patch first. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- include/linux/virtio_pci_mode

[PATCH v11 23/40] virtio_pci: move struct virtio_pci_common_cfg to virtio_pci_modern.h

2022-06-28 Thread Xuan Zhuo
In order to facilitate the expansion of virtio_pci_common_cfg in the future, move it from uapi to virtio_pci_modern.h. In this way, we can freely expand virtio_pci_common_cfg in the future. Other projects using virtio_pci_common_cfg in uapi need to maintain a separate virtio_pci_common_cfg or use

[PATCH v11 22/40] virtio_ring: introduce virtqueue_resize()

2022-06-28 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 v11 21/40] virtio_ring: packed: introduce virtqueue_resize_packed()

2022-06-28 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, re-initialize(by virtqueue_reinit_packed

[PATCH v11 20/40] virtio_ring: packed: introduce virtqueue_reinit_packed()

2022-06-28 Thread Xuan Zhuo
Introduce a function to initialize vq without allocating new ring, desc_state, desc_extra. Subsequent patches will call this function after reset vq to reinitialize vq. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 21 + 1 file changed, 21 insertions(+) diff -

[PATCH v11 19/40] virtio_ring: packed: extract the logic of vring init

2022-06-28 Thread Xuan Zhuo
Separate the logic of initializing vring, and subsequent patches will call it separately. This function completes the variable initialization of packed vring. It together with the logic of atatch constitutes the initialization of vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c

[PATCH v11 18/40] virtio_ring: packed: extract the logic of attach vring

2022-06-28 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 | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_rin

[PATCH v11 17/40] virtio_ring: packed: extract the logic of alloc state and extra

2022-06-28 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 | 48 +--- 1 file changed, 34 insertio

[PATCH v11 16/40] virtio_ring: packed: extract the logic of alloc queue

2022-06-28 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 | 80 +++- 1 fi

[PATCH v11 15/40] virtio_ring: packed: introduce vring_free_packed

2022-06-28 Thread Xuan Zhuo
Free the structure struct vring_vritqueue_packed. Subsequent patches require it. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 21 + 1 file changed, 21 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 1aaa1e5f9991..4

[PATCH v11 14/40] virtio_ring: split: introduce virtqueue_resize_split()

2022-06-28 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, re-initialize(virtqueue_reinit_split()) t

[PATCH v11 13/40] virtio_ring: split: reserve vring_align, may_reduce_num

2022-06-28 Thread Xuan Zhuo
In vring_create_virtqueue_split() save vring_align, may_reduce_num to structure vring_virtqueue_split. Used to create a new vring when implementing resize . Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/virtio/virti

[PATCH v11 12/40] virtio_ring: split: introduce virtqueue_reinit_split()

2022-06-28 Thread Xuan Zhuo
Introduce a function to initialize vq without allocating new ring, desc_state, desc_extra. Subsequent patches will call this function after reset vq to reinitialize vq. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 19 +++ 1 file changed, 19 i

[PATCH v11 11/40] virtio_ring: split: extract the logic of vring init

2022-06-28 Thread Xuan Zhuo
Separate the logic of initializing vring, and subsequent patches will call it separately. This function completes the variable initialization of split vring. It together with the logic of atatch constitutes the initialization of vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c |

[PATCH v11 09/40] virtio_ring: split: extract the logic of alloc state and extra

2022-06-28 Thread Xuan Zhuo
Separate the logic of creating desc_state, desc_extra, and subsequent patches will call it independently. Since only the structure vring is passed into __vring_new_virtqueue(), when creating the function vring_alloc_state_extra_split(), we prefer to use vring_virtqueue_split as a parameter, and it

[PATCH v11 10/40] virtio_ring: split: extract the logic of attach vring

2022-06-28 Thread Xuan Zhuo
Separate the logic of attach vring, subsequent patches will call it separately. Since the "struct vring_virtqueue_split split" is created on the stack and has been initialized to 0. So using split->queue_dma_addr/split->queue_size_in_bytes assignment for queue_dma_addr/queue_size_in_bytes can keep

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

2022-06-28 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 | 68 ++-- 1 file changed, 42 insertions(+), 26 deletions(-) diff --git a/drivers/virtio/

[PATCH v11 06/40] virtio_ring: introduce virtqueue_init()

2022-06-28 Thread Xuan Zhuo
Separate the logic of virtqueue initialization. This logic is irrelevant to ring layout. This logic can be called independently when implementing resize/reset later. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 61 ++-- 1 file changed, 31 insertion

[PATCH v11 07/40] virtio_ring: split: introduce vring_free_split()

2022-06-28 Thread Xuan Zhuo
Free the structure struct vring_vritqueue_split. Subsequent patches require it. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 986dbd9294d6..49d61e412dc6

[PATCH v11 05/40] virtio_ring: split vring_virtqueue

2022-06-28 Thread Xuan Zhuo
Separate the two inline structures(split and packed) from the structure vring_virtqueue. In this way, we can use these two structures later to pass parameters and retain temporary variables. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 116 ++- 1 f

[PATCH v11 04/40] virtio_ring: extract the logic of freeing vring

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

[PATCH v11 03/40] virtio_ring: update the document of the virtqueue_detach_unused_buf for queue reset

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

[PATCH v11 02/40] virtio: struct virtio_config_ops add callbacks for queue_reset

2022-06-28 Thread Xuan Zhuo
reset can be divided into the following four steps (example): 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 res

[PATCH v11 01/40] virtio: add helper virtqueue_get_vring_max_size()

2022-06-28 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 v11 00/40] virtio pci support VIRTIO_F_RING_RESET

2022-06-28 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 https://github.com/oasis-tcs/virtio-spec/issues/139 Also regarding MMIO

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

2022-06-28 Thread Michael S. Tsirkin
On Wed, Jun 29, 2022 at 12:07:11PM +0800, Jason Wang wrote: > On Tue, Jun 28, 2022 at 2:17 PM Jason Wang wrote: > > > > On Tue, Jun 28, 2022 at 1:00 PM Michael S. Tsirkin wrote: > > > > > > On Tue, Jun 28, 2022 at 11:49:12AM +0800, Jason Wang wrote: > > > > > Heh. Yea sure. But things work fine f

Re: [PATCH v6 4/4] vdpa_sim: Implement suspend vdpa op

2022-06-28 Thread Jason Wang
On Fri, Jun 24, 2022 at 12:08 AM Eugenio Pérez wrote: > > Implement suspend operation for vdpa_sim devices, so vhost-vdpa will > offer that backend feature and userspace can effectively suspend the > device. > > This is a must before get virtqueue indexes (base) for live migration, > since the dev

Re: [PATCH v6 3/4] vhost-vdpa: uAPI to suspend the device

2022-06-28 Thread Jason Wang
On Fri, Jun 24, 2022 at 12:08 AM Eugenio Pérez wrote: > > The ioctl adds support for suspending the device from userspace. > > This is a must before getting virtqueue indexes (base) for live migration, > since the device could modify them after userland gets them. There are > individual ways to pe

Re: [PATCH v6 2/4] vhost-vdpa: introduce SUSPEND backend feature bit

2022-06-28 Thread Jason Wang
On Fri, Jun 24, 2022 at 12:08 AM Eugenio Pérez wrote: > > Userland knows if it can suspend the device or not by checking this feature > bit. > > It's only offered if the vdpa driver backend implements the suspend() > operation callback, and to offer it or userland to ack it if the backend > does n

Re: [PATCH v6 1/4] vdpa: Add suspend operation

2022-06-28 Thread Jason Wang
On Fri, Jun 24, 2022 at 12:07 AM Eugenio Pérez wrote: > > This operation is optional: It it's not implemented, backend feature bit > will not be exposed. A question, do we allow suspending a device without DRIVER_OK? Thanks > > Signed-off-by: Eugenio Pérez > --- > include/linux/vdpa.h | 4 +++

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

2022-06-28 Thread Jason Wang
On Tue, Jun 28, 2022 at 2:17 PM Jason Wang wrote: > > On Tue, Jun 28, 2022 at 1:00 PM Michael S. Tsirkin wrote: > > > > On Tue, Jun 28, 2022 at 11:49:12AM +0800, Jason Wang wrote: > > > > Heh. Yea sure. But things work fine for people. What is the chance > > > > your review found and fixed all dr

Re: [PATCH v3 0/3] virtio: support requiring restricted access per device

2022-06-28 Thread Stefano Stabellini
On Wed, 22 Jun 2022, Juergen Gross wrote: > Instead of an all or nothing approach add support for requiring > restricted memory access per device. > > Changes in V3: > - new patches 1 + 2 > - basically complete rework of patch 3 > > Juergen Gross (3): > virtio: replace restricted mem access fla

Re: [PATCH v2 -next] vdpa/mlx5: Use eth_zero_addr() to assign zero address

2022-06-28 Thread Michael S. Tsirkin
On Tue, Jun 28, 2022 at 12:34:57PM +, Xu Qiang wrote: > Using eth_zero_addr() to assign zero address instead of memset(). > > Reported-by: Hulk Robot > Signed-off-by: Xu Qiang Acked-by: Michael S. Tsirkin > --- > v2: > - fix typo in commit log > drivers/vdpa/mlx5/net/mlx5_vnet.c | 4 ++--

Re: [PATCH][next] treewide: uapi: Replace zero-length arrays with flexible-array members

2022-06-28 Thread Jason Gunthorpe
On Tue, Jun 28, 2022 at 10:54:58AM -0700, Kees Cook wrote: > which must also be assuming it's a header. So probably better to just > drop the driver_data field? I don't see anything using it (that I can > find) besides as a sanity-check that the field exists and is at the end > of the struct. T

Re: [PATCH][next] treewide: uapi: Replace zero-length arrays with flexible-array members

2022-06-28 Thread Kees Cook
On Tue, Jun 28, 2022 at 09:27:21AM +0200, Geert Uytterhoeven wrote: > Hi Gustavo, > > Thanks for your patch! > > On Mon, Jun 27, 2022 at 8:04 PM Gustavo A. R. Silva > wrote: > > There is a regular need in the kernel to provide a way to declare > > having a dynamically sized set of trailing eleme

Re: [PATCH][next] treewide: uapi: Replace zero-length arrays with flexible-array members

2022-06-28 Thread Kees Cook
On Mon, Jun 27, 2022 at 09:40:52PM -0300, Jason Gunthorpe wrote: > On Mon, Jun 27, 2022 at 08:27:37PM +0200, Daniel Borkmann wrote: > > [...] > > Fyi, this breaks BPF CI: > > > > https://github.com/kernel-patches/bpf/runs/7078719372?check_suite_focus=true > > > > [...] > > progs/map_ptr_kern.

Re: [PATCH v7] x86/paravirt: useless assignment instructions cause Unixbench full core performance degradation

2022-06-28 Thread Waiman Long
On 6/28/22 12:12, Guo Hui wrote: The instructions assigned to the vcpu_is_preempted function parameter in the X86 architecture physical machine are redundant instructions, causing the multi-core performance of Unixbench to drop by about 4% to 5%. The C function is as follows: static bool vcpu_is_

Re: [PATCH v6 00/22] Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers

2022-06-28 Thread Rob Clark
On Tue, Jun 28, 2022 at 5:51 AM Dmitry Osipenko wrote: > > On 6/28/22 15:31, Robin Murphy wrote: > > ->8- > > [ 68.295951] == > > [ 68.295956] WARNING: possible circular locking dependency detected > > [ 68.295963] 5.19.0-rc3+ #400

Re: [PATCH v6] x86/paravirt: useless assignment instructions cause Unixbench full core performance degradation

2022-06-28 Thread Waiman Long
On 6/28/22 08:54, Guo Hui wrote: The instructions assigned to the vcpu_is_preempted function parameter in the X86 architecture physical machine are redundant instructions, causing the multi-core performance of Unixbench to drop by about 4% to 5%. The C function is as follows: static bool vcpu_is_

Re: [PATCH v6 3/4] vhost-vdpa: uAPI to suspend the device

2022-06-28 Thread Stefano Garzarella
On Thu, Jun 23, 2022 at 06:07:37PM +0200, Eugenio Pérez wrote: >The ioctl adds support for suspending the device from userspace. > >This is a must before getting virtqueue indexes (base) for live migration, >since the device could modify them after userland gets them. There are >individual ways to

Re: [PATCH v6 2/4] vhost-vdpa: introduce SUSPEND backend feature bit

2022-06-28 Thread Stefano Garzarella
On Thu, Jun 23, 2022 at 06:07:36PM +0200, Eugenio Pérez wrote: Userland knows if it can suspend the device or not by checking this feature bit. It's only offered if the vdpa driver backend implements the suspend() operation callback, and to offer it or userland to ack it if the backend does not

Re: [PATCH v6 1/4] vdpa: Add suspend operation

2022-06-28 Thread Stefano Garzarella
On Thu, Jun 23, 2022 at 06:07:35PM +0200, Eugenio Pérez wrote: This operation is optional: It it's not implemented, backend feature bit will not be exposed. Signed-off-by: Eugenio Pérez --- include/linux/vdpa.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/vdpa.h b/includ

Re: [PATCH][next] treewide: uapi: Replace zero-length arrays with flexible-array members

2022-06-28 Thread Jason Gunthorpe
On Tue, Jun 28, 2022 at 04:21:29AM +0200, Gustavo A. R. Silva wrote: > > > Though maybe we could just switch off > > > -Wgnu-variable-sized-type-not-at-end during configuration ? > We need to think in a different strategy. I think we will need to switch off the warning in userspace - this is d

Re: [PATCH v6 00/22] Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers

2022-06-28 Thread Robin Murphy
On 2022-05-27 00:50, Dmitry Osipenko wrote: Hello, This patchset introduces memory shrinker for the VirtIO-GPU DRM driver and adds memory purging and eviction support to VirtIO-GPU driver. The new dma-buf locking convention is introduced here as well. During OOM, the shrinker will release BOs

Re: [PATCH -next] vdpa/mlx5: Use eth_zero_addr() to assign zero address

2022-06-28 Thread Michael S. Tsirkin
On Tue, Jun 28, 2022 at 09:44:18AM +, Xu Qiang wrote: > Using eth_zero_addr() to assign zero address insetad of typo > memset(). > > Reported-by: Hulk Robot > Signed-off-by: Xu Qiang > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >

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

2022-06-28 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 the source the scheduling of the refill work. This means an NAPI after cancel_delayed_work_sync() can schedule the refill work then can re-enable the NAPI that leads to us

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

2022-06-28 Thread Stefano Garzarella
On Tue, Jun 28, 2022 at 6:01 AM Jason Wang wrote: > > On Thu, Jun 23, 2022 at 4:58 PM Stefano Garzarella > wrote: > > > > On Thu, Jun 23, 2022 at 11:50:22AM +0800, Jason Wang wrote: > > >On Wed, Jun 22, 2022 at 12:09 AM Stefano Garzarella > > >wrote: > > >> > > >> Limit the number of requests

Re: [PATCH][next] treewide: uapi: Replace zero-length arrays with flexible-array members

2022-06-28 Thread Geert Uytterhoeven
Hi Gustavo, Thanks for your patch! On Mon, Jun 27, 2022 at 8:04 PM Gustavo A. R. Silva wrote: > There is a regular need in the kernel to provide a way to declare > having a dynamically sized set of trailing elements in a structure. > Kernel code should always use “flexible array members”[1] for