On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote:
>
> This commit structure the indirect desc table.
> Then we can get the desc num directly when doing unmap.
>
> And save the dma info to the struct, then the indirect
> will not use the dma fields of the desc_extra. The subsequent
> commits will ma
On Wed, Mar 27, 2024 at 7:14 PM Xuan Zhuo wrote:
>
> In the functions vring_unmap_extra_packed and vring_unmap_desc_packed,
> multiple checks are made whether unmap is performed and whether it is
> INDIRECT.
>
> These two functions are usually called in a loop, and we should put the
> check outsid
> From: Heng Qi
> Sent: Wednesday, March 27, 2024 11:57 PM
> To: Dan Jurgens ; netdev@vger.kernel.org
> Cc: m...@redhat.com; jasow...@redhat.com; xuanz...@linux.alibaba.com;
> virtualizat...@lists.linux.dev; da...@davemloft.net;
> eduma...@google.com; k...@kernel.org; pab...@redhat.com; Jiri Pirko
在 2024/3/28 下午12:47, Daniel Jurgens 写道:
Since we no longer have to hold the RTNL lock here just do updates for
the specified queue.
Signed-off-by: Daniel Jurgens
---
drivers/net/virtio_net.c | 38 ++
1 file changed, 14 insertions(+), 24 deletions(-)
di
The rtnl lock is no longer needed to protect the control buffer and
command VQ.
Signed-off-by: Daniel Jurgens
Reviewed-by: Jiri Pirko
---
drivers/net/virtio_net.c | 27 +--
1 file changed, 5 insertions(+), 22 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/
Since we no longer have to hold the RTNL lock here just do updates for
the specified queue.
Signed-off-by: Daniel Jurgens
---
drivers/net/virtio_net.c | 38 ++
1 file changed, 14 insertions(+), 24 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/n
Allocate memory for the data when it's used. Ideally the could be on the
stack, but we can't DMA stack memory. With this change only the header
and status memory are shared between commands, which will allow using a
tighter lock than RTNL.
Signed-off-by: Daniel Jurgens
Reviewed-by: Jiri Pirko
--
Once the RTNL locking around the control buffer is removed there can be
contention on the per queue RX interrupt coalescing data. Use a spin
lock per queue.
Signed-off-by: Daniel Jurgens
---
drivers/net/virtio_net.c | 27 ++-
1 file changed, 18 insertions(+), 9 deletions(
Currently the buffer used for control VQ commands is protected by the
RTNL lock. Previously this wasn't a major concern because the control
VQ was only used during device setup and user interaction. With the
recent addition of dynamic interrupt moderation the control VQ may be
used frequently durin
The command VQ will no longer be protected by the RTNL lock. Use a
spinlock to protect the control buffer header and the VQ.
Signed-off-by: Daniel Jurgens
Reviewed-by: Jiri Pirko
---
drivers/net/virtio_net.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/vi
Stop storing RSS setting in the control buffer. This is prep work for
removing RTNL lock protection of the control buffer.
Signed-off-by: Daniel Jurgens
Reviewed-by: Jiri Pirko
---
drivers/net/virtio_net.c | 40
1 file changed, 20 insertions(+), 20 delet
在 2024/3/27 上午10:10, Heng Qi 写道:
在 2024/3/26 下午11:18, Dan Jurgens 写道:
From: Heng Qi
Sent: Tuesday, March 26, 2024 3:55 AM
To: Dan Jurgens ; netdev@vger.kernel.org
Cc: m...@redhat.com; jasow...@redhat.com; xuanz...@linux.alibaba.com;
virtualizat...@lists.linux.dev; da...@davemloft.net;
edum
If the premapped mode is enabled, the dma array(struct vring_desc_dma) of
virtio core will not be allocated. That is judged when find_vqs() is
called. To avoid allocating dma array in find_vqs() and releasing it
immediately by virtqueue_set_dma_premapped(). This patch introduces a
new parameter to
Now, the API virtqueue_set_dma_premapped just support to
enable premapped mode.
If we allow enabling the premapped dynamically, we should
make this API to support disable the premapped mode.
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 39 +++-
inc
Now, the virtio core can set the premapped mode by find_vqs().
If the premapped can be enabled, the dma array will not be
allocated. So virtio-net use the api of find_vqs to enable the
premapped.
Judge the premapped mode by the vq->premapped instead of saving
local variable.
Signed-off-by: Xuan Z
Export the premapped to drivers, then drivers can check
the vq premapped mode after the find_vqs().
Because the find_vqs() just try to enable the vq premapped mode,
the driver must check that after find_vqs().
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 13 +
include/
As discussed:
http://lore.kernel.org/all/CACGkMEug-=C+VQhkMYSgUKMC==04m7-uem_yc21bggkkzh8...@mail.gmail.com
When the vq is premapped mode, the driver manages the dma
info is a good way.
So this commit make the virtio core not to store the dma
info and release the memory which is used to store the
This commit structure the indirect desc table.
Then we can get the desc num directly when doing unmap.
And save the dma info to the struct, then the indirect
will not use the dma fields of the desc_extra. The subsequent
commits will make the dma fields are optional. But for
the indirect case, we m
In the functions vring_unmap_one_split and
vring_unmap_one_split_indirect,
multiple checks are made whether unmap is performed and whether it is
INDIRECT.
These two functions are usually called in a loop, and we should put the
check outside the loop.
And we unmap the descs with VRING_DESC_F_INDIR
This commit structure the indirect desc table.
Then we can get the desc num directly when doing unmap.
And save the dma info to the struct, then the indirect
will not use the dma fields of the desc_extra. The subsequent
commits will make the dma fields are optional. But for
the indirect case, we m
In the functions vring_unmap_extra_packed and vring_unmap_desc_packed,
multiple checks are made whether unmap is performed and whether it is
INDIRECT.
These two functions are usually called in a loop, and we should put the
check outside the loop.
And we unmap the descs with VRING_DESC_F_INDIRECT
To make the code readable, introduce vring_need_unmap_buffer() to
replace do_unmap.
use_dma_api premapped -> vring_need_unmap_buffer()
1. false falsefalse
2. truefalsetrue
3. truetrue false
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drive
As discussed:
http://lore.kernel.org/all/cacgkmevq0no8qgc46u4mgsmtud44fd_cflcpavmj3rhyqrz...@mail.gmail.com
If the virtio is premapped mode, the driver should manage the dma info by self.
So the virtio core should not store the dma info. We can release the memory used
to store the dma info.
For
On Wed, Mar 27, 2024 at 4:07 PM Xuan Zhuo wrote:
>
> On Wed, 27 Mar 2024 15:50:17 +0800, Jason Wang wrote:
> > On Wed, Mar 27, 2024 at 3:16 PM Xuan Zhuo
> > wrote:
> > >
> > > On Tue, 26 Mar 2024 14:35:21 +0800, Jason Wang
> > > wrote:
> > > > On Mon, Mar 25, 2024 at 4:54 PM Xuan Zhuo
> > >
On Wed, 27 Mar 2024 15:50:17 +0800, Jason Wang wrote:
> On Wed, Mar 27, 2024 at 3:16 PM Xuan Zhuo wrote:
> >
> > On Tue, 26 Mar 2024 14:35:21 +0800, Jason Wang wrote:
> > > On Mon, Mar 25, 2024 at 4:54 PM Xuan Zhuo
> > > wrote:
> > > >
> > > > As discussed:
> > > >
> > > > http://lore.kernel.o
On Wed, Mar 27, 2024 at 3:16 PM Xuan Zhuo wrote:
>
> On Tue, 26 Mar 2024 14:35:21 +0800, Jason Wang wrote:
> > On Mon, Mar 25, 2024 at 4:54 PM Xuan Zhuo
> > wrote:
> > >
> > > As discussed:
> > >
> > > http://lore.kernel.org/all/cacgkmevq0no8qgc46u4mgsmtud44fd_cflcpavmj3rhyqrz...@mail.gmail.com
On Tue, 26 Mar 2024 14:35:21 +0800, Jason Wang wrote:
> On Mon, Mar 25, 2024 at 4:54 PM Xuan Zhuo wrote:
> >
> > As discussed:
> >
> > http://lore.kernel.org/all/cacgkmevq0no8qgc46u4mgsmtud44fd_cflcpavmj3rhyqrz...@mail.gmail.com
> >
> > If the virtio is premapped mode, the driver should manage th
On Tue, 26 Mar 2024 03:32:43 -0400, "Michael S. Tsirkin"
wrote:
> On Thu, Mar 21, 2024 at 04:20:09PM +0800, Xuan Zhuo wrote:
> > On Thu, 21 Mar 2024 13:57:06 +0800, Jason Wang wrote:
> > > On Tue, Mar 12, 2024 at 11:36 AM Xuan Zhuo
> > > wrote:
> > > >
> > > > In the functions vring_unmap_extr
st 27. 3. 2024 v 4:11 odesílatel Jason Wang napsal:
>
> On Tue, Mar 26, 2024 at 9:26 PM Jaroslav Pulchart
> wrote:
> >
> > >
> > > On Mon, Mar 25, 2024 at 4:44 PM Igor Raits wrote:
> > > >
> > > > Hello,
> > > >
> > > > On Fri, Mar 22, 2024 at 12:19 PM Igor Raits wrote:
> > > > >
> > > > > Hi J
29 matches
Mail list logo