Re: [PATCH net-next v7 00/10] virtio-net: support AF_XDP zero copy

2024-07-05 Thread Michal Kubiak
On Fri, Jul 05, 2024 at 03:37:24PM +0800, Xuan Zhuo wrote: > v6: > 1. start from supporting the rx zerocopy > > v5: > 1. fix the comments of last version > > http://lore.kernel.org/all/2024064147.31320-1-xuanz...@linux.alibaba.com > v4: > 1. remove the commits that introdu

[PATCH net-next v7 09/10] virtio_net: xsk: rx: support recv small mode

2024-07-05 Thread Xuan Zhuo
In the process: 1. We may need to copy data to create skb for XDP_PASS. 2. We may need to call xsk_buff_free() to release the buffer. 3. The handle for xdp_buff is difference from the buffer. If we pushed this logic into existing receive handle(merge and small), we would have to maintain code scat

[PATCH net-next v7 06/10] virtio_net: xsk: bind/unbind xsk for rx

2024-07-05 Thread Xuan Zhuo
This patch implement the logic of bind/unbind xsk pool to rq. Signed-off-by: Xuan Zhuo --- v7: 1. remove a container struct for xsk 2. update comments 3. add check between hdr_len and xsk headroom drivers/net/virtio_net.c | 134 +++ 1 file change

[PATCH net-next v7 10/10] virtio_net: xsk: rx: support recv merge mode

2024-07-05 Thread Xuan Zhuo
Support AF-XDP for merge mode. Signed-off-by: Xuan Zhuo --- v7: 1. include the handle for unused buffers drivers/net/virtio_net.c | 144 +++ 1 file changed, 144 insertions(+) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 64d8cd4

[PATCH net-next v7 08/10] virtio_net: xsk: rx: support fill with xsk buffer

2024-07-05 Thread Xuan Zhuo
Implement the logic of filling rq with XSK buffers. Signed-off-by: Xuan Zhuo --- v7: 1. some small fixes drivers/net/virtio_net.c | 70 +--- 1 file changed, 66 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c

[PATCH net-next v7 07/10] virtio_net: xsk: support wakeup

2024-07-05 Thread Xuan Zhuo
xsk wakeup is used to trigger the logic for xsk xmit by xsk framework or user. Virtio-net does not support to actively generate an interruption, so it tries to trigger tx NAPI on the local cpu. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/net/virtio_net.c | 24

[PATCH net-next v7 05/10] virtio_net: separate receive_mergeable

2024-07-05 Thread Xuan Zhuo
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_net.c | 77 1 file ch

[PATCH net-next v7 04/10] virtio_net: separate receive_buf

2024-07-05 Thread Xuan Zhuo
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_net.c | 62 +++---

[PATCH net-next v7 03/10] virtio_net: separate virtnet_tx_resize()

2024-07-05 Thread Xuan Zhuo
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_net.c | 35 +-- 1

[PATCH net-next v7 02/10] virtio_net: separate virtnet_rx_resize()

2024-07-05 Thread Xuan Zhuo
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_net.c | 29 + 1 file cha

[PATCH net-next v7 00/10] virtio-net: support AF_XDP zero copy

2024-07-05 Thread Xuan Zhuo
v6: 1. start from supporting the rx zerocopy v5: 1. fix the comments of last version http://lore.kernel.org/all/2024064147.31320-1-xuanz...@linux.alibaba.com v4: 1. remove the commits that introduce the independent directory 2. remove the supporting for the rx merge mo

[PATCH net-next v7 01/10] virtio_net: replace VIRTIO_XDP_HEADROOM by XDP_PACKET_HEADROOM

2024-07-05 Thread Xuan Zhuo
virtio net has VIRTIO_XDP_HEADROOM that is equal to XDP_PACKET_HEADROOM to calculate the headroom for xdp. But here we should use the macro XDP_PACKET_HEADROOM from bpf.h to calculate the headroom for xdp. So here we remove the VIRTIO_XDP_HEADROOM, and use the XDP_PACKET_HEADROOM to replace it. S