On Mon, Jan 29, 2024 at 04:45:02PM -0800, Stephen Boyd wrote:
> Call this function unconditionally so that we can populate an empty DTB
> on platforms that don't boot with a firmware provided or builtin DTB.
>
> Cc: Rob Herring
> Cc: Frank Rowand
> Cc: Thomas Gleixner
> Cc: Ingo Molnar
> Cc: B
Please ignore this.
The new thread is sent.
[PATCH vhost 00/17] virtio: drivers maintain dma info for premapped vq
http://lore.kernel.org/all/20240130114224.86536-1-xuanz...@linux.alibaba.com
That includes the refactor of find_vqs().
Thanks.
If the xsk is enabling, the xsk tx will share the send queue.
But the xsk requires that the send queue use the premapped mode.
So the send queue must support premapped mode.
Signed-off-by: Xuan Zhuo
---
drivers/net/virtio_net.c | 167 ++-
1 file changed, 163 i
Since free_old_xmit_skbs not only deals with skb, but also xdp frame and
subsequent added xsk, so change the name of this function to
free_old_xmit.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio_net.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff
The virtio-net sq will use these APIs to map the scatterlist.
For scatterlist, the page dma APIs are more appropriate.
dma_addr_t virtqueue_dma_map_page_attrs(struct virtqueue *_vq, struct page
*page,
size_t offset, size_t size,
There are two completely similar and independent implementations. This
is inconvenient for the subsequent addition of new types. So extract a
function from this piece of code and call this function uniformly to
recover old xmit ptr.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/
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
The virtio-net sets the premapped mode by find_vqs().
So the below API is not used by anyone, we remove it.
int virtqueue_set_dma_premapped(struct virtqueue *_vq);
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 56
include/linux/virtio.h
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/
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
As the refactor of find_vqs()/vring_new_virtqueue(),
the cfg/tp_cfg are passed to vring.
This patch refactors the vring by this structure.
This can simplify the code.
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 162 ---
1 file changed, 53 insertio
Now, we pass multi parameters to find_vqs. These parameters
may work for transport or work for vring.
And find_vqs has multi implements in many places:
But every time,
arch/um/drivers/virtio_uml.c
drivers/platform/mellanox/mlxbf-tmfifo.c
drivers/remoteproc/remoteproc_virtio.c
drivers/s390/vir
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
Just like find_vqs(), it is time to refactor the
vring_new_virtqueue(). We pass the similar struct to
vring_new_virtqueue.
Signed-off-by: Xuan Zhuo
---
drivers/platform/mellanox/mlxbf-tmfifo.c | 12 ---
drivers/remoteproc/remoteproc_virtio.c | 11 ---
drivers/virtio/virtio_ring.c
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
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
---
drivers/virtio/virtio_ring.
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
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.
So we can release the memory used to store the dma info.
Bu
20 matches
Mail list logo