Re: [PATCH net-next v3] virtio_net: add support for Byte Queue Limits

2024-06-18 Thread Jiri Pirko
Tue, Jun 18, 2024 at 08:18:12PM CEST, m...@redhat.com wrote: >This looks like a sensible way to do this. >Yet something to improve: > > >On Tue, Jun 18, 2024 at 04:44:56PM +0200, Jiri Pirko wrote: >> From: Jiri Pirko >> [...] >> +static void __free_old_xmit(struct send_queue *sq, struct netdev

[PATCH] virtio_net: Use u64_stats_fetch_begin() for stats fetch

2024-06-18 Thread Li RongQing
This place is fetching the stats, so u64_stats_fetch_begin and u64_stats_fetch_retry should be used Fixes: 6208799553a8 ("virtio-net: support rx netdim") Signed-off-by: Li RongQing --- drivers/net/virtio_net.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dri

Re: [PATCH 1/2] virtio_net: checksum offloading handling fix

2024-06-18 Thread Heng Qi
On Tue, 18 Jun 2024 18:15:16 -0700, Jakub Kicinski wrote: > On Tue, 18 Jun 2024 11:09:02 +0800 Heng Qi wrote: > > > (Should we manually do checksum if RXCUSM is disabled?) > > > > > > > Currently we do not allow RXCUSM to be disabled. > > You don't have to disable checksuming in the device.

Re: [PATCH 1/2] virtio_net: checksum offloading handling fix

2024-06-18 Thread Jakub Kicinski
On Tue, 18 Jun 2024 11:09:02 +0800 Heng Qi wrote: > > (Should we manually do checksum if RXCUSM is disabled?) > > > > Currently we do not allow RXCUSM to be disabled. You don't have to disable checksuming in the device. Just ignore VIRTIO_NET_HDR_F_DATA_VALID if user cleared NETIF_F_RXCSUM. I

Re: [patch net-next] virtio_net: add support for Byte Queue Limits

2024-06-18 Thread Michael S. Tsirkin
On Tue, Jun 18, 2024 at 08:52:38AM +0800, Jason Wang wrote: > On Mon, Jun 17, 2024 at 5:30 PM Jiri Pirko wrote: > > > > Mon, Jun 17, 2024 at 03:44:55AM CEST, jasow...@redhat.com wrote: > > >On Mon, Jun 10, 2024 at 10:19 PM Michael S. Tsirkin > > >wrote: > > >> > > >> On Fri, Jun 07, 2024 at 01:3

Re: [PATCH net-next v3] virtio_net: add support for Byte Queue Limits

2024-06-18 Thread Michael S. Tsirkin
This looks like a sensible way to do this. Yet something to improve: On Tue, Jun 18, 2024 at 04:44:56PM +0200, Jiri Pirko wrote: > From: Jiri Pirko > > Add support for Byte Queue Limits (BQL). > > Tested on qemu emulated virtio_net device with 1, 2 and 4 queues. > Tested with fq_codel and pfif

Re: [PATCH net-next 2/2] vsock/virtio: avoid enqueue packets when work queue is empty

2024-06-18 Thread Luigi Leonardi
Hi Stefano and Matias, @Stefano Thanks for your review(s)! I'll send a V2 by the end of the week. @Matias Thanks for your feedback! > I think It would be interesting to know what exactly the test does It's relatively easy: I used fio's pingpong mode. This mode is specifically for measuring the

[PATCH net-next v3] virtio_net: add support for Byte Queue Limits

2024-06-18 Thread Jiri Pirko
From: Jiri Pirko Add support for Byte Queue Limits (BQL). Tested on qemu emulated virtio_net device with 1, 2 and 4 queues. Tested with fq_codel and pfifo_fast. Super netperf with 50 threads is running in background. Netperf TCP_RR results: NOBQL FQC 1q: 159.56 159.33 158.50 154.31agv:

Re: [PATCH net-next v3 4/4] virtio_net: improve dim command request efficiency

2024-06-18 Thread Heng Qi
On Tue, 18 Jun 2024 09:29:48 +0800, Jason Wang wrote: > On Mon, Jun 17, 2024 at 4:08 PM Heng Qi wrote: > > > > On Mon, 17 Jun 2024 12:05:30 +0800, Jason Wang wrote: > > > On Thu, Jun 6, 2024 at 2:15 PM Heng Qi wrote: > > > > > > > > Currently, control vq handles commands synchronously, > > > >

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

2024-06-18 Thread Xuan Zhuo
Support AF-XDP for merge mode. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 139 +++ 1 file changed, 139 insertions(+) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 06608d696e2e..cfa106aa8039 100644 --- a/drivers/net/virtio

[PATCH net-next v6 10/10] virtio_net: xsk: rx: free the unused xsk buffer

2024-06-18 Thread Xuan Zhuo
Release the xsk buffer, when the queue is releasing or the queue is resizing. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index cfa106aa8039..33695b86bd99 100644 --- a/drivers/n

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

2024-06-18 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 v6 06/10] virtio_net: xsk: support wakeup

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

2024-06-18 Thread Xuan Zhuo
Implement the logic of filling rq with XSK buffers. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 68 ++-- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 2bbc715f22c6..2ac5668a

[PATCH net-next v6 05/10] virtio_net: xsk: bind/unbind xsk for rx

2024-06-18 Thread Xuan Zhuo
This patch implement the logic of bind/unbind xsk pool to rq. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 133 +++ 1 file changed, 133 insertions(+) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index df885cdbe658..d8cce143be26

[PATCH net-next v6 04/10] virtio_net: separate receive_mergeable

2024-06-18 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 v6 03/10] virtio_net: separate receive_buf

2024-06-18 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 | 56 +++---

[PATCH net-next v6 02/10] virtio_net: separate virtnet_tx_resize()

2024-06-18 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 v6 00/10] virtio-net: support AF_XDP zero copy

2024-06-18 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 v6 01/10] virtio_net: separate virtnet_rx_resize()

2024-06-18 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

Re: [PATCH net-next v2] virtio_net: add support for Byte Queue Limits

2024-06-18 Thread Jiri Pirko
Tue, Jun 18, 2024 at 02:53:42AM CEST, jasow...@redhat.com wrote: >On Mon, Jun 17, 2024 at 5:18 PM Jiri Pirko wrote: >> >> Mon, Jun 17, 2024 at 04:34:26AM CEST, jasow...@redhat.com wrote: >> >On Thu, Jun 13, 2024 at 1:09 AM Jiri Pirko wrote: >> >> >> >> From: Jiri Pirko >> >> >> >> Add support fo

Re: [PATCH net-next v2] virtio_net: add support for Byte Queue Limits

2024-06-18 Thread Jiri Pirko
Mon, Jun 17, 2024 at 06:14:11PM CEST, m...@redhat.com wrote: >On Wed, Jun 12, 2024 at 07:08:51PM +0200, Jiri Pirko wrote: >> From: Jiri Pirko >> >> Add support for Byte Queue Limits (BQL). >> >> Tested on qemu emulated virtio_net device with 1, 2 and 4 queues. >> Tested with fq_codel and pfifo_f