Re: [PATCH net-next v4 2/5] virtio_net: enable irq for the control vq

2024-07-08 Thread Heng Qi
On Mon, 8 Jul 2024 13:40:42 +0200, Jiri Pirko wrote: > Wed, Jun 26, 2024 at 01:51:00PM CEST, j...@resnulli.us wrote: > >Wed, Jun 26, 2024 at 11:58:08AM CEST, m...@redhat.com wrote: > >>On Wed, Jun 26, 2024 at 10:43:11AM +0200, Jiri Pirko wrote: > >>> Wed, Jun 26, 2024 at 10:08:14AM CEST, m...@redh

Re: [PATCH net-next v4 2/5] virtio_net: enable irq for the control vq

2024-07-08 Thread Jiri Pirko
Wed, Jun 26, 2024 at 01:51:00PM CEST, j...@resnulli.us wrote: >Wed, Jun 26, 2024 at 11:58:08AM CEST, m...@redhat.com wrote: >>On Wed, Jun 26, 2024 at 10:43:11AM +0200, Jiri Pirko wrote: >>> Wed, Jun 26, 2024 at 10:08:14AM CEST, m...@redhat.com wrote: >>> >On Wed, Jun 26, 2024 at 09:52:58AM +0200, J

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

2024-07-08 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 v8 10/10] virtio_net: xsk: rx: support recv merge mode

2024-07-08 Thread Xuan Zhuo
Support AF-XDP for merge mode. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- 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 c9c65948b71f..b6323346208d 100644 --

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

2024-07-08 Thread Xuan Zhuo
This patch implement the logic of bind/unbind xsk pool to rq. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/net/virtio_net.c | 134 +++ 1 file changed, 134 insertions(+) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 3c828

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

2024-07-08 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 v8 09/10] virtio_net: xsk: rx: support recv small mode

2024-07-08 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 v8 08/10] virtio_net: xsk: rx: support fill with xsk buffer

2024-07-08 Thread Xuan Zhuo
Implement the logic of filling rq with XSK buffers. Signed-off-by: Xuan Zhuo --- v8: 1. update comment 2. return err from virtnet_add_recvbuf_xsk() when encounters error drivers/net/virtio_net.c | 70 +--- 1 file changed, 66 insertions(+), 4 deletions(

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

2024-07-08 Thread Xuan Zhuo
v8: 1. virtnet_add_recvbuf_xsk() always return err, when encounters error v7: 1. some small fixes 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.

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

2024-07-08 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 v8 04/10] virtio_net: separate receive_buf

2024-07-08 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 v8 02/10] virtio_net: separate virtnet_rx_resize()

2024-07-08 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 v8 01/10] virtio_net: replace VIRTIO_XDP_HEADROOM by XDP_PACKET_HEADROOM

2024-07-08 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

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

2024-07-08 Thread Xuan Zhuo
On Mon, 8 Jul 2024 16:08:44 +0800, Jason Wang wrote: > On Mon, Jul 8, 2024 at 3:47 PM Xuan Zhuo wrote: > > > > On Mon, 8 Jul 2024 15:00:50 +0800, Jason Wang wrote: > > > On Fri, Jul 5, 2024 at 3:38 PM Xuan Zhuo > > > wrote: > > > > > > > > In the process: > > > > 1. We may need to copy data to

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

2024-07-08 Thread Jason Wang
On Fri, Jul 5, 2024 at 3:37 PM Xuan Zhuo wrote: > > Support AF-XDP for merge mode. > > Signed-off-by: Xuan Zhuo > --- > Acked-by: Jason Wang Thanks

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

2024-07-08 Thread Jason Wang
On Mon, Jul 8, 2024 at 3:47 PM Xuan Zhuo wrote: > > On Mon, 8 Jul 2024 15:00:50 +0800, Jason Wang wrote: > > On Fri, Jul 5, 2024 at 3:38 PM Xuan Zhuo wrote: > > > > > > 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 r

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

2024-07-08 Thread Xuan Zhuo
On Mon, 8 Jul 2024 14:49:35 +0800, Jason Wang wrote: > On Fri, Jul 5, 2024 at 3:37 PM Xuan Zhuo wrote: > > > > 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 ++

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

2024-07-08 Thread Xuan Zhuo
On Mon, 8 Jul 2024 15:00:50 +0800, Jason Wang wrote: > On Fri, Jul 5, 2024 at 3:38 PM Xuan Zhuo wrote: > > > > 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

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

2024-07-08 Thread Jason Wang
On Fri, Jul 5, 2024 at 3:38 PM Xuan Zhuo wrote: > > 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 receiv