在 2022/7/26 15:22, 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
在 2022/7/26 15:22, 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 |
在 2022/7/26 15:22, Xuan Zhuo 写道:
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 | 19 +++
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git
在 2022/7/26 15:22, 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
在 2022/7/26 15:22, 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
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 48
在 2022/7/26 15:22, Xuan Zhuo 写道:
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
在 2022/7/26 15:22, Xuan Zhuo 写道:
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
在 2022/7/26 15:21, Xuan Zhuo 写道:
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 | 51 +---
1 file changed, 35
> From: Zhu, Lingshan
> Sent: Tuesday, July 26, 2022 10:53 PM
>
> On 7/27/2022 10:17 AM, Parav Pandit wrote:
> >> From: Zhu, Lingshan
> >> Sent: Tuesday, July 26, 2022 10:15 PM
> >>
> >> On 7/26/2022 11:56 PM, Parav Pandit wrote:
> From: Zhu, Lingshan
> Sent: Tuesday, July 12, 2022
在 2022/7/26 15:21, 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
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 65 ++--
1 file
在 2022/7/26 15:21, 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,
在 2022/7/26 15:21, Xuan Zhuo 写道:
__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
---
在 2022/7/26 15:21, Xuan Zhuo 写道:
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.
> From: Zhu, Lingshan
> Sent: Tuesday, July 26, 2022 10:15 PM
>
> On 7/26/2022 11:56 PM, Parav Pandit wrote:
> >> From: Zhu, Lingshan
> >> Sent: Tuesday, July 12, 2022 11:46 PM
> >>> When the user space which invokes netlink commands, detects that
> _MQ
> >> is not supported, hence it takes
> From: Michael S. Tsirkin
> Sent: Tuesday, July 26, 2022 3:49 PM
>
> On Tue, Jul 26, 2022 at 03:54:06PM +, Parav Pandit wrote:
> >
> > > From: Michael S. Tsirkin
> > > Sent: Wednesday, July 13, 2022 1:27 AM
> > >
> > > On Fri, Jul 01, 2022 at 10:07:59PM +, Parav Pandit wrote:
> > > >
> From: Michael S. Tsirkin
> Sent: Tuesday, July 26, 2022 3:52 PM
>
> On Tue, Jul 26, 2022 at 03:56:32PM +, Parav Pandit wrote:
> >
> > > From: Zhu, Lingshan
> > > Sent: Tuesday, July 12, 2022 11:46 PM
> > > > When the user space which invokes netlink commands, detects that
> > > > _MQ
> >
On Tue, Jul 26, 2022 at 03:56:32PM +, Parav Pandit wrote:
>
> > From: Zhu, Lingshan
> > Sent: Tuesday, July 12, 2022 11:46 PM
> > > When the user space which invokes netlink commands, detects that _MQ
> > is not supported, hence it takes max_queue_pair = 1 by itself.
> > I think the kernel
On Tue, Jul 26, 2022 at 03:54:06PM +, Parav Pandit wrote:
>
> > From: Michael S. Tsirkin
> > Sent: Wednesday, July 13, 2022 1:27 AM
> >
> > On Fri, Jul 01, 2022 at 10:07:59PM +, Parav Pandit wrote:
> > >
> > >
> > > > From: Zhu Lingshan
> > > > Sent: Friday, July 1, 2022 9:28 AM
> > >
> On Jul 26, 2022, at 9:18 AM, Joe Perches wrote:
>
> On Tue, 2022-07-26 at 15:55 +, Vishnu Dasa wrote:
>>> On Jul 26, 2022, at 8:10 AM, Greg KH >> On Mon, Jul 25, 2022 at 06:29:25PM +, Vishnu Dasa wrote:
> On Jul 25, 2022, at 11:05 AM, Greg KH wrote:
> On Mon, Jul 25, 2022
On Tue, 2022-07-26 at 15:55 +, Vishnu Dasa wrote:
> > On Jul 26, 2022, at 8:10 AM, Greg KH > On Mon, Jul 25, 2022 at 06:29:25PM +, Vishnu Dasa wrote:
> > > > On Jul 25, 2022, at 11:05 AM, Greg KH
> > > > wrote:
> > > > On Mon, Jul 25, 2022 at 09:32:46AM -0700, vd...@vmware.com wrote:
>
> From: Zhu, Lingshan
> Sent: Tuesday, July 12, 2022 11:46 PM
> > When the user space which invokes netlink commands, detects that _MQ
> is not supported, hence it takes max_queue_pair = 1 by itself.
> I think the kernel module have all necessary information and it is the only
> one which have
> On Jul 26, 2022, at 8:10 AM, Greg KH wrote:
>
> On Mon, Jul 25, 2022 at 06:29:25PM +, Vishnu Dasa wrote:
>>
>>> On Jul 25, 2022, at 11:05 AM, Greg KH wrote:
>>>
>>> On Mon, Jul 25, 2022 at 09:32:46AM -0700, vd...@vmware.com wrote:
From: Vishnu Dasa
Remove Rajesh as a
> From: Michael S. Tsirkin
> Sent: Wednesday, July 13, 2022 1:27 AM
>
> On Fri, Jul 01, 2022 at 10:07:59PM +, Parav Pandit wrote:
> >
> >
> > > From: Zhu Lingshan
> > > Sent: Friday, July 1, 2022 9:28 AM
> > > If VIRTIO_NET_F_MQ == 0, the virtio device should have one queue
> > > pair, so
On Mon, Jul 25, 2022 at 06:29:25PM +, Vishnu Dasa wrote:
>
> > On Jul 25, 2022, at 11:05 AM, Greg KH wrote:
> >
> > On Mon, Jul 25, 2022 at 09:32:46AM -0700, vd...@vmware.com wrote:
> >> From: Vishnu Dasa
> >>
> >> Remove Rajesh as a maintainer for the VMCI driver.
> >
> > Why?
>
>
On 26.07.2022 16:45, Michael S. Tsirkin wrote:
On Mon, Jul 25, 2022 at 11:27:53PM +0300, Andrey Zhadchenko wrote:
Although QEMU virtio is quite fast, there is still some room for
improvements. Disk latency can be reduced if we handle virito-blk requests
in host kernel istead of passing them to
On Mon, Jul 25, 2022 at 11:27:53PM +0300, Andrey Zhadchenko wrote:
> Although QEMU virtio is quite fast, there is still some room for
> improvements. Disk latency can be reduced if we handle virito-blk requests
> in host kernel istead of passing them to QEMU. The patch adds vhost-blk
> kernel
On 7/26/2022 7:06 PM, Parav Pandit via Virtualization wrote:
From: Zhu, Lingshan
Sent: Tuesday, July 26, 2022 7:03 AM
On 7/24/2022 11:21 PM, Parav Pandit wrote:
From: Zhu, Lingshan
Sent: Saturday, July 23, 2022 7:24 AM
On 7/22/2022 9:12 PM, Parav Pandit wrote:
From: Zhu Lingshan
Sent:
> From: Zhu, Lingshan
> Sent: Tuesday, July 26, 2022 7:03 AM
>
> On 7/24/2022 11:21 PM, Parav Pandit wrote:
> >
> >> From: Zhu, Lingshan
> >> Sent: Saturday, July 23, 2022 7:24 AM
> >>
> >>
> >> On 7/22/2022 9:12 PM, Parav Pandit wrote:
> From: Zhu Lingshan
> Sent: Friday, July 22,
在 2022/7/21 16:43, Guo Zhi 写道:
If in order feature negotiated, we can skip the used ring to get
buffer's desc id sequentially.
Let's rename the patch to something like "in order support for virtio_ring"
Signed-off-by: Guo Zhi
---
drivers/virtio/virtio_ring.c | 37
在 2022/7/21 16:43, Guo Zhi 写道:
Device may not use descriptors in order, for example, NIC and SCSI may
not call __vhost_add_used_n with buffers in order. It's the task of
__vhost_add_used_n to order them.
I'm not sure this is ture. Having ooo descriptors is probably by design
to have better
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
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
---
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(+)
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
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
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
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
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
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 |
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
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
---
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
Acked-by: Jason Wang
---
drivers/virtio/virtio_pci_modern_dev.c | 39
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
Acked-by: Jason Wang
---
include/linux/virtio_pci_modern.h | 2 +-
include/uapi/linux/virtio_pci.h | 1 +
2 files
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
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(+)
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
---
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
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
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 attach vring, the subsequent patch will call it
separately.
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 19 +++
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index
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 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
Free the structure struct vring_vritqueue_packed.
Subsequent patches require it.
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 22 ++
1 file changed, 22 insertions(+)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index
Separate the logic of packed to create vring queue.
This feature is required for subsequent virtuqueue reset vring.
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 80 +++-
1 file changed, 51 insertions(+), 29 deletions(-)
diff --git
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())
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
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
---
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
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
---
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 | 65 ++--
1 file changed, 40 insertions(+), 25 deletions(-)
diff --git
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 | 51 +---
1 file changed, 35 insertions(+), 16 deletions(-)
diff --git
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
__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
---
drivers/virtio/virtio_ring.c | 29 +++--
1
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
Acked-by: Jason Wang
---
drivers/virtio/virtio_ring.c | 63 ++--
1
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
---
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
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
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
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
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
---
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
73 matches
Mail list logo