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 tx queues.
Based on this function, it is possible to modify the ring num of the
queue.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 47
1 file changed, 47 insertions(+)
dif
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
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 22 ++
1 file changed, 22 insertions(+)
diff --git a/drivers/
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
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 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
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
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
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
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
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 -
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
Add queue_reset in virtio_pci_modern_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
Acked-by: Jason Wang
---
include/linux/virtio_pci_modern.h | 2 +-
include/uapi/linux/virtio_pci.h | 1 +
2 file
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
Acked-by: Jason Wang
---
drivers/virtio/virtio_pci_modern_dev.c | 39 +++
Introduce a new member reset to the structure virtqueue to determine
whether the current vq is in the reset state. Subsequent patches will
use it.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 2 ++
include/linux/virtio.h | 2 ++
2 files changed, 4 inser
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
In order not to affect the API, add a dedicated structure struct
virtio_pci_modern_common_cfg to virtio_pci_modern.h.
Since I want to add queue_reset after queue_notify_
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
This patch allows the new introduced
__virtqueue_break()/__virtqueue_unbreak() to break/unbreak the
virtqueue.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 24
include/linux/virtio.h | 3 +++
2 files changed, 27 insertions(+)
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
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 | 12
1 file changed, 12 insertio
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
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 48 +---
1 fil
Separate the logic of attach vring, the subsequent patch will call it
separately.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 25 ++---
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers
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
Acked-by: Jason Wang
---
drivers
Free the structure struct vring_vritqueue_packed.
Subsequent patches require it.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 22 ++
1 file changed, 22 insertions(+)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.
Separate the logic of packed to create vring queue.
This feature is required for subsequent virtuqueue reset vring.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 80 +++-
1 file changed, 51 insertions(+), 29 deletions(-)
diff
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
Separate the logic of attach vring, subsequent patches will call it
separately.
virtqueue_vring_init_split() completes the initialization of other
variables of vring split. We can directly use
vq->split = *vring_split to complete attach.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
driver
In vring_alloc_queue_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
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/d
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 | 23 +++
1 file changed,
Separate the logic of creating desc_state, desc_extra, and subsequent
patches will call it independently.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 52 +---
1 file changed, 36 insertions(+), 16 deletions(-)
diff --git a/dri
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
Acked-by: Jason Wang
---
drivers/
Separate the logic of split to create vring queue.
This feature is required for subsequent virtuqueue reset vring.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 65 ++--
1 file changed, 40 insertions(+), 25 deletions(-)
diff -
Free the structure struct vring_vritqueue_split.
Subsequent patches require it.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 1d51
__vring_new_virtqueue() instead accepts struct vring_virtqueue_split.
The purpose of this is to pass more information into
__vring_new_virtqueue() to make the code simpler and the structure
cleaner.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 29 +++
There is currently only one place to reference __vring_new_virtqueue()
directly from the outside of virtio core. And here vring_new_virtqueue()
can be used instead.
Subsequent patches will modify __vring_new_virtqueue, so stop it as an
export symbol for now.
Signed-off-by: Xuan Zhuo
Acked-by: Ja
Separate the logic of virtqueue initialization. These variables should
be reset during reset.
This logic can be called independently when implementing resize/reset
later.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 38 +---
1
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
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 116 ++
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
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 Zhuo
Acked-by: Jason Wang
---
arch/um/drivers/virtio_um
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
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 Mon, Aug 1, 2022 at 2:13 PM Xuan Zhuo wrote:
>
> On Mon, 1 Aug 2022 12:49:12 +0800, Jason Wang wrote:
> > On Thu, Jul 28, 2022 at 7:27 PM Xuan Zhuo
> > wrote:
> > >
> > > On Thu, 28 Jul 2022 17:04:36 +0800, Jason Wang
> > > wrote:
> > > > On Thu, Jul 28, 2022 at 4:18 PM Xuan Zhuo
> > > >
On Mon, Aug 01, 2022 at 12:33:44PM +0800, Jason Wang wrote:
>
> 在 2022/7/29 17:39, Michael S. Tsirkin 写道:
> > On Fri, Jul 29, 2022 at 05:35:09PM +0800, Zhu, Lingshan wrote:
> > >
> > > On 7/29/2022 5:23 PM, Michael S. Tsirkin wrote:
> > > > On Fri, Jul 29, 2022 at 05:20:17PM +0800, Zhu, Lingshan
On Mon, 1 Aug 2022 12:49:12 +0800, Jason Wang wrote:
> On Thu, Jul 28, 2022 at 7:27 PM Xuan Zhuo wrote:
> >
> > On Thu, 28 Jul 2022 17:04:36 +0800, Jason Wang wrote:
> > > On Thu, Jul 28, 2022 at 4:18 PM Xuan Zhuo
> > > wrote:
> > > >
> > > > On Thu, 28 Jul 2022 15:42:50 +0800, Jason Wang
>
On Thu, Jul 28, 2022 at 2:41 PM Michael S. Tsirkin wrote:
>
> On Thu, Jul 28, 2022 at 01:53:51PM +0800, Jason Wang wrote:
> > On Thu, Jul 28, 2022 at 11:47 AM Zhu, Lingshan
> > wrote:
> > >
> > >
> > >
> > > On 7/28/2022 9:21 AM, Jason Wang wrote:
> > > > On Wed, Jul 27, 2022 at 11:45 PM Michael
On Thu, Jul 28, 2022 at 7:27 PM Xuan Zhuo wrote:
>
> On Thu, 28 Jul 2022 17:04:36 +0800, Jason Wang wrote:
> > On Thu, Jul 28, 2022 at 4:18 PM Xuan Zhuo
> > wrote:
> > >
> > > On Thu, 28 Jul 2022 15:42:50 +0800, Jason Wang
> > > wrote:
> > > > On Thu, Jul 28, 2022 at 3:24 PM Xuan Zhuo
> > >
在 2022/7/30 04:55, Si-Wei Liu 写道:
On 7/28/2022 7:04 PM, Zhu, Lingshan wrote:
On 7/29/2022 5:48 AM, Si-Wei Liu wrote:
On 7/27/2022 7:43 PM, Zhu, Lingshan wrote:
On 7/28/2022 8:56 AM, Si-Wei Liu wrote:
On 7/27/2022 4:47 AM, Zhu, Lingshan wrote:
On 7/27/2022 5:43 PM, Si-Wei Liu wro
在 2022/7/29 17:39, Michael S. Tsirkin 写道:
On Fri, Jul 29, 2022 at 05:35:09PM +0800, Zhu, Lingshan wrote:
On 7/29/2022 5:23 PM, Michael S. Tsirkin wrote:
On Fri, Jul 29, 2022 at 05:20:17PM +0800, Zhu, Lingshan wrote:
On 7/29/2022 5:17 PM, Michael S. Tsirkin wrote:
On Fri, Jul 29, 2022 at 05:
50 matches
Mail list logo