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/
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
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
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
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
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
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
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
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
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
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
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 -
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
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
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
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
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
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
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
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
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 -
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
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
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
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
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
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
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
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
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 |
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
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
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/
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
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
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
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/
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
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
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
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
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
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
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
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
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 +++
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
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
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 ++--
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
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
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.
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_
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
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_
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
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
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
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
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
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(-)
>
>
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
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
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
64 matches
Mail list logo