This patch set prepares for supporting af-xdp zerocopy.
There is no feature change in this patch set.
I just want to reduce the patch num of the final patch set,
so I split the patch set.
#1-#3 add independent directory for virtio-net
#4-#7 do some refactor, the sub-functions will be used by the s
Create a separate directory for virtio-net. AF_XDP support will be added
later, then a separate xsk.c file will be added, so we should create a
directory for virtio-net.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
MAINTAINERS | 2 +-
drivers/net/Kc
We move some structures to the header file, but these structures do not
prefixed with virtnet. This patch adds virtnet for these.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/virtnet.h | 12 ++--
drivers/net/virtio/virtnet_main.c | 110 +++--
This patch separates two sub-functions from virtnet_tx_resize():
* virtnet_tx_pause
* virtnet_tx_resume
Then the subsequent virtnet_tx_reset() can share these two functions.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/virtnet.h | 2 ++
drivers/net/virtio/virtnet
This patch separates two sub-functions from virtnet_rx_resize():
* virtnet_rx_pause
* virtnet_rx_resume
Then the subsequent reset rx for xsk can share these two functions.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/virtnet.h | 3 +++
drivers/net/virtio/virtnet_
Move some core structures (send_queue, receive_queue, virtnet_info)
definitions and the relative structures definitions into the
virtio_net.h file.
That will be used by the other c code files.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/virtnet.h | 239 +++
This commit separates the function receive_mergeable(),
put the logic of appending frag to the skb as an independent function.
The subsequent commit will reuse it.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/virtnet.h | 4 ++
drivers/net/virtio/virtnet_main.c | 77
This commit separates the function receive_buf(), then we wrap the logic
of handling the skb to an independent function virtnet_receive_done().
The subsequent commit will reuse it.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/virtnet_main.c | 56 ++---
On Thu, May 30, 2024 at 03:26:42PM +0800, Xuan Zhuo wrote:
> This patch set prepares for supporting af-xdp zerocopy.
> There is no feature change in this patch set.
> I just want to reduce the patch num of the final patch set,
> so I split the patch set.
>
> #1-#3 add independent directory for vir
On Thu, 30 May 2024 03:55:35 -0400, "Michael S. Tsirkin"
wrote:
> On Thu, May 30, 2024 at 03:26:42PM +0800, Xuan Zhuo wrote:
> > This patch set prepares for supporting af-xdp zerocopy.
> > There is no feature change in this patch set.
> > I just want to reduce the patch num of the final patch set
On Tue, 2024-05-28 at 21:41 +0800, Heng Qi wrote:
> When the following snippet is run, lockdep will report a deadlock[1].
>
> /* Acquire all queues dim_locks */
> for (i = 0; i < vi->max_queue_pairs; i++)
> mutex_lock(&vi->rq[i].dim_lock);
>
> There's no deadlock here because the vq
On Thu, 30 May 2024 10:34:07 +0200, Paolo Abeni wrote:
> On Tue, 2024-05-28 at 21:41 +0800, Heng Qi wrote:
> > When the following snippet is run, lockdep will report a deadlock[1].
> >
> > /* Acquire all queues dim_locks */
> > for (i = 0; i < vi->max_queue_pairs; i++)
> > mutex_loc
On Tue, May 28, 2024 at 09:41:16PM +0800, Heng Qi wrote:
> When the following snippet is run, lockdep will report a deadlock[1].
>
> /* Acquire all queues dim_locks */
> for (i = 0; i < vi->max_queue_pairs; i++)
> mutex_lock(&vi->rq[i].dim_lock);
>
> There's no deadlock here because
On Tue, May 28, 2024 at 09:41:15PM +0800, Heng Qi wrote:
> When the dim worker is scheduled, if it no longer needs to issue
> commands, dim may not be able to return to the working state later.
>
> For example, the following single queue scenario:
> 1. The dim worker of rxq0 is scheduled, and th
On Tue, 28 May 2024 21:41:15 +0800, Heng Qi wrote:
> When the dim worker is scheduled, if it no longer needs to issue
> commands, dim may not be able to return to the working state later.
>
> For example, the following single queue scenario:
> 1. The dim worker of rxq0 is scheduled, and the dim
On Tue, 28 May 2024 21:41:16 +0800, Heng Qi wrote:
> When the following snippet is run, lockdep will report a deadlock[1].
>
> /* Acquire all queues dim_locks */
> for (i = 0; i < vi->max_queue_pairs; i++)
> mutex_lock(&vi->rq[i].dim_lock);
>
> There's no deadlock here because the vq
On Thu, May 30, 2024 at 5:17 PM Michael S. Tsirkin wrote:
>
> On Tue, May 28, 2024 at 09:41:16PM +0800, Heng Qi wrote:
> > When the following snippet is run, lockdep will report a deadlock[1].
> >
> > /* Acquire all queues dim_locks */
> > for (i = 0; i < vi->max_queue_pairs; i++)
> >
This patch set prepares for supporting af-xdp zerocopy.
There is no feature change in this patch set.
I just want to reduce the patch num of the final patch set,
so I split the patch set.
Thanks.
v2:
1. Add five commits. That provides some helper for sq to support premapped
mode. And t
Move some core structures (send_queue, receive_queue, virtnet_info)
definitions and the relative structures definitions into the
virtio_net.h file.
That will be used by the other c code files.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/virtnet.h | 239 +++
We move some structures to the header file, but these structures do not
prefixed with virtnet. This patch adds virtnet for these.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/virtnet.h | 12 ++--
drivers/net/virtio/virtnet_main.c | 110 +++--
Create a separate directory for virtio-net. AF_XDP support will be added
later, then a separate xsk.c file will be added, so we should create a
directory for virtio-net.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
MAINTAINERS | 2 +-
drivers/net/Kc
This patch separates two sub-functions from virtnet_rx_resize():
* virtnet_rx_pause
* virtnet_rx_resume
Then the subsequent reset rx for xsk can share these two functions.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/virtnet.h | 3 +++
drivers/net/virtio/virtnet_
This patch separates two sub-functions from virtnet_tx_resize():
* virtnet_tx_pause
* virtnet_tx_resume
Then the subsequent virtnet_tx_reset() can share these two functions.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/virtnet.h | 2 ++
drivers/net/virtio/virtnet
This commit separates the function receive_mergeable(),
put the logic of appending frag to the skb as an independent function.
The subsequent commit will reuse it.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/virtnet.h | 4 ++
drivers/net/virtio/virtnet_main.c | 77
This commit separates the function receive_buf(), then we wrap the logic
of handling the skb to an independent function virtnet_receive_done().
The subsequent commit will reuse it.
Signed-off-by: Xuan Zhuo
Acked-by: Jason Wang
---
drivers/net/virtio/virtnet_main.c | 56 ++---
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
The virtio-net sq will use these APIs to map the scatterlist.
dma_addr_t virtqueue_dma_map_page_attrs(struct virtqueue *_vq, struct page
*page,
size_t offset, size_t size,
enum dma_data_direction dir,
Introduce a helper to do dma map for scatterlist.
That can be used by other drivers.
Signed-off-by: Xuan Zhuo
---
drivers/virtio/virtio_ring.c | 32
include/linux/virtio.h | 3 +++
2 files changed, 35 insertions(+)
diff --git a/drivers/virtio/virtio_ring.
virtio-net sq will only enable premapped mode when the sq is bound to
the af-xdp.
So we need the helper (virtqueue_set_dma_premapped) to enable the
premapped mode when af-xdp binds to the sq. And to disable the
premapped mode when af-xdp unbinds to the sq.
Signed-off-by: Xuan Zhuo
---
drivers/n
Because the af-xdp and the sq premapped mode will introduce two
new xmit types, so I refactor the xmit type mechanism first.
Then we can add two new xmit types simply by add two new enum.
We can use the last two bits of the pointer to distinguish the xmit type,
so we can distinguish four xmit type
On Thu, May 30, 2024 at 07:23:54PM +0800, Xuan Zhuo wrote:
> This patch set prepares for supporting af-xdp zerocopy.
> There is no feature change in this patch set.
> I just want to reduce the patch num of the final patch set,
> so I split the patch set.
>
> Thanks.
>
> v2:
> 1. Add five comm
On Thu, 30 May 2024 07:53:17 -0400, "Michael S. Tsirkin"
wrote:
> On Thu, May 30, 2024 at 07:23:54PM +0800, Xuan Zhuo wrote:
> > This patch set prepares for supporting af-xdp zerocopy.
> > There is no feature change in this patch set.
> > I just want to reduce the patch num of the final patch set
On Thu, 30 May 2024 19:54:44 +0800, Xuan Zhuo
wrote:
> On Thu, 30 May 2024 07:53:17 -0400, "Michael S. Tsirkin"
> wrote:
> > On Thu, May 30, 2024 at 07:23:54PM +0800, Xuan Zhuo wrote:
> > > This patch set prepares for supporting af-xdp zerocopy.
> > > There is no feature change in this patch se
On Fri, 31 May 2024 09:40:14 +0800 Xuan Zhuo wrote:
> On Thu, 30 May 2024 19:54:44 +0800, Xuan Zhuo
> wrote:
> > On Thu, 30 May 2024 07:53:17 -0400, "Michael S. Tsirkin"
> > wrote:
> > > It's great that you are working on this but
> > > I'd like to see the actual use of this first.
> >
> >
On Thu, 30 May 2024 18:55:17 -0700, Jakub Kicinski wrote:
> On Fri, 31 May 2024 09:40:14 +0800 Xuan Zhuo wrote:
> > On Thu, 30 May 2024 19:54:44 +0800, Xuan Zhuo
> > wrote:
> > > On Thu, 30 May 2024 07:53:17 -0400, "Michael S. Tsirkin"
> > > wrote:
> > > > It's great that you are working on th
35 matches
Mail list logo