Re: [PATCH net-next 1/3] virtio-net: fix possible dim status unrecoverable

2024-01-16 Thread Michael S. Tsirkin
On Tue, Jan 16, 2024 at 09:11:31PM +0800, Heng Qi wrote: > When the dim worker is scheduled, if it fails to acquire the lock, > 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 st

Re: [PATCH net-next 00/17] virtio-net: support AF_XDP zero copy (3/3)

2024-01-16 Thread Michael S. Tsirkin
On Tue, Jan 16, 2024 at 07:07:05AM -0800, Jakub Kicinski wrote: > On Tue, 16 Jan 2024 13:37:30 +0100 Paolo Abeni wrote: > > For future submission it would be better if you split this series in > > smaller chunks: the maximum size allowed is 15 patches. > > Which does not mean you can split it up a

Re: [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang

2024-01-18 Thread Michael S. Tsirkin
On Tue, Jan 16, 2024 at 01:04:49PM +0100, Paolo Abeni wrote: > On Mon, 2024-01-15 at 09:29 +0800, Zhu Yanjun wrote: > > From: Zhu Yanjun > > > > Some devices emulate the virtio_net hardwares. When virtio_net > > driver sends commands to the emulated hardware, normally the > > hardware needs time

Re: [PATCH net-next 0/3] virtio-net: a fix and some updates for virtio dim

2024-01-19 Thread Michael S. Tsirkin
On Tue, Jan 16, 2024 at 09:11:30PM +0800, Heng Qi wrote: > Patch 1 fixes an existing bug. Belongs to the net branch. > Patch 2 requires updating the virtio spec. > Patch 3 only attempts to modify the sending of dim cmd to an asynchronous way, > and does not affect the synchronization way of ethtool

Re: [PATCH net-next] virtio_net: Add TX stop and wake counters

2024-01-30 Thread Michael S. Tsirkin
On Tue, Jan 30, 2024 at 08:25:21AM -0600, Daniel Jurgens wrote: > Add a tx queue stop and wake counters, they are useful for debugging. > > $ ethtool -S ens5f2 | grep 'tx_stop\|tx_wake' > ... > tx_queue_1_tx_stop: 16726 > tx_queue_1_tx_wake: 16726 > ... > tx_que

Re: [PATCH net-next] virtio_net: Add TX stop and wake counters

2024-01-30 Thread Michael S. Tsirkin
On Tue, Jan 30, 2024 at 03:40:21PM +, Daniel Jurgens wrote: > > From: Michael S. Tsirkin > > Sent: Tuesday, January 30, 2024 8:58 AM > > > > On Tue, Jan 30, 2024 at 08:25:21AM -0600, Daniel Jurgens wrote: > > > Add a tx queue stop and wake counte

Re: [PATCH net-next] virtio_net: Add TX stop and wake counters

2024-01-30 Thread Michael S. Tsirkin
On Tue, Jan 30, 2024 at 03:43:48PM +, Daniel Jurgens wrote: > > From: Heng Qi > > Sent: Tuesday, January 30, 2024 9:17 AM > > 在 2024/1/30 下午10:25, Daniel Jurgens 写道: > > > Add a tx queue stop and wake counters, they are useful for debugging. > > > > > > $ ethtool -S ens5f2 | grep 'tx_stop\|t

Re: [PATCH net-next] virtio_net: Add TX stop and wake counters

2024-01-30 Thread Michael S. Tsirkin
On Tue, Jan 30, 2024 at 03:50:29PM +, Daniel Jurgens wrote: > > From: Michael S. Tsirkin > > Sent: Tuesday, January 30, 2024 9:42 AM > > On Tue, Jan 30, 2024 at 03:40:21PM +, Daniel Jurgens wrote: > > > > From: Michael S. Tsirkin > > > &g

Re: [PATCH net-next] virtio_net: Add TX stop and wake counters

2024-02-04 Thread Michael S. Tsirkin
On Sun, Feb 04, 2024 at 09:20:18AM +0800, Jason Wang wrote: > On Sat, Feb 3, 2024 at 12:01 AM Jakub Kicinski wrote: > > > > On Fri, 2 Feb 2024 14:52:59 +0800 Jason Xing wrote: > > > > Can you say more? I'm curious what's your use case. > > > > > > I'm not working at Nvidia, so my point of view may

Re: [PATCH net-next] virtio_net: Add TX stop and wake counters

2024-02-07 Thread Michael S. Tsirkin
On Wed, Feb 07, 2024 at 07:38:16PM +, Daniel Jurgens wrote: > > From: Michael S. Tsirkin > > Sent: Sunday, February 4, 2024 6:40 AM > > To: Jason Wang > > Cc: Jakub Kicinski ; Jason Xing > > ; Daniel Jurgens ; > > netdev@vger.kernel.org; xuanz..

Re: [PATCH net-next] virtio_net: Add TX stop and wake counters

2024-02-07 Thread Michael S. Tsirkin
On Mon, Feb 05, 2024 at 09:45:38AM +0800, Jason Wang wrote: > On Sun, Feb 4, 2024 at 8:39 PM Michael S. Tsirkin wrote: > > > > On Sun, Feb 04, 2024 at 09:20:18AM +0800, Jason Wang wrote: > > > On Sat, Feb 3, 2024 at 12:01 AM Jakub Kicinski wrote: > > > > >

Re: [PATCH net-next] virtio_net: Add TX stop and wake counters

2024-02-20 Thread Michael S. Tsirkin
On Tue, Feb 20, 2024 at 06:02:46PM +, Dan Jurgens wrote: > > From: Daniel Jurgens > > Sent: Wednesday, February 7, 2024 2:59 PM > > To: Michael S. Tsirkin > > Cc: Jason Wang ; Jakub Kicinski > > ; Jason Xing ; > > netdev@vger.kernel.org; xuanz..

Re: [PATCH net-next 1/5] virtio_ring: introduce virtqueue_get_buf_ctx_dma()

2024-02-22 Thread Michael S. Tsirkin
On Tue, Jan 16, 2024 at 03:59:20PM +0800, Xuan Zhuo wrote: > introduce virtqueue_get_buf_ctx_dma() to collect the dma info when > get buf from virtio core for premapped mode. > > If the virtio queue is premapped mode, the virtio-net send buf may > have many desc. Every desc dma address need to be

Re: [PATCH net-next 0/5] virtio-net: sq support premapped mode

2024-02-22 Thread Michael S. Tsirkin
On Tue, Jan 16, 2024 at 03:59:19PM +0800, Xuan Zhuo wrote: > This is the second part of virtio-net support AF_XDP zero copy. My understanding is, there's going to be another version of all this work? -- MST

Re: [PATCH vhost v4 00/10] virtio: drivers maintain dma info for premapped vq

2024-03-18 Thread Michael S. Tsirkin
On Tue, Mar 12, 2024 at 11:35:47AM +0800, Xuan Zhuo wrote: > 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

Re: [PATCH vhost v4 02/10] virtio_ring: packed: remove double check of the unmap ops

2024-03-26 Thread Michael S. Tsirkin
On Thu, Mar 21, 2024 at 04:20:09PM +0800, Xuan Zhuo wrote: > On Thu, 21 Mar 2024 13:57:06 +0800, Jason Wang wrote: > > On Tue, Mar 12, 2024 at 11:36 AM Xuan Zhuo > > wrote: > > > > > > In the functions vring_unmap_extra_packed and vring_unmap_desc_packed, > > > multiple checks are made whether u

Re: [PATCH net-next 2/4] virtio_net: Remove command data from control_buf

2024-03-28 Thread Michael S. Tsirkin
On Thu, Mar 28, 2024 at 01:35:16PM +, Simon Horman wrote: > On Mon, Mar 25, 2024 at 04:49:09PM -0500, Daniel Jurgens wrote: > > Allocate memory for the data when it's used. Ideally the could be on the > > stack, but we can't DMA stack memory. With this change only the header > > and status memo

Re: [PATCH net-next v5 0/9] virtio-net: support device stats

2024-04-22 Thread Michael S. Tsirkin
On Mon, Mar 18, 2024 at 07:05:53PM +0800, Xuan Zhuo wrote: > As the spec: > > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > > The virtio net supports to get device stats. > > Please review. series: Acked-by: Michael S. Tsirkin

Re: [PATCH RESEND net-next v7 0/4] ethtool: provide the dim profile fine-tuning channel

2024-04-22 Thread Michael S. Tsirkin
ut this would be better along with cleaning up the rest of > the drivers, which we can get to very soon after this set. > > Please review, thank you very much! Acked-by: Michael S. Tsirkin > Changelog > = > v6->v7: > - A new wrapper struct pointer is used in struc

Re: [patch net-next v4 0/6] selftests: virtio_net: introduce initial testing infrastructure

2024-04-22 Thread Michael S. Tsirkin
devices, allowing > user to filter features to pretend to be driver that is not capable > of the filtered feature. virtio things: Acked-by: Michael S. Tsirkin > Example: > $ cat /sys/bus/virtio/devices/virtio0/features > 111001010101110010001

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

2024-05-09 Thread Michael S. Tsirkin
On Thu, May 09, 2024 at 01:46:15PM +0200, Jiri Pirko wrote: > From: Jiri Pirko > > Add support for Byte Queue Limits (BQL). > > Signed-off-by: Jiri Pirko Can we get more detail on the benefits you observe etc? Thanks! > --- > drivers/net/virtio_net.c | 33 - >

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

2024-05-09 Thread Michael S. Tsirkin
On Thu, May 09, 2024 at 03:31:56PM +0200, Jiri Pirko wrote: > Thu, May 09, 2024 at 02:41:39PM CEST, m...@redhat.com wrote: > >On Thu, May 09, 2024 at 01:46:15PM +0200, Jiri Pirko wrote: > >> From: Jiri Pirko > >> > >> Add support for Byte Queue Limits (BQL). > >> > >> Signed-off-by: Jiri Pirko

Re: [PATCH] virtio_net: Fix memory leak in virtnet_rx_mod_work

2024-05-10 Thread Michael S. Tsirkin
tdev/0674ca1b-020f-4f93-94d0-104964566...@kernel.dk/ > Signed-off-by: Daniel Jurgens Acked-by: Michael S. Tsirkin > --- > drivers/net/virtio_net.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c >

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

2024-05-10 Thread Michael S. Tsirkin
On Fri, May 10, 2024 at 12:37:15PM +0200, Jiri Pirko wrote: > Thu, May 09, 2024 at 04:28:12PM CEST, m...@redhat.com wrote: > >On Thu, May 09, 2024 at 03:31:56PM +0200, Jiri Pirko wrote: > >> Thu, May 09, 2024 at 02:41:39PM CEST, m...@redhat.com wrote: > >> >On Thu, May 09, 2024 at 01:46:15PM +0200,

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

2024-05-10 Thread Michael S. Tsirkin
On Fri, May 10, 2024 at 01:11:49PM +0200, Jiri Pirko wrote: > Fri, May 10, 2024 at 12:52:52PM CEST, m...@redhat.com wrote: > >On Fri, May 10, 2024 at 12:37:15PM +0200, Jiri Pirko wrote: > >> Thu, May 09, 2024 at 04:28:12PM CEST, m...@redhat.com wrote: > >> >On Thu, May 09, 2024 at 03:31:56PM +0200,

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

2024-05-15 Thread Michael S. Tsirkin
On Wed, May 15, 2024 at 09:34:08AM +0200, Jiri Pirko wrote: > Fri, May 10, 2024 at 01:27:08PM CEST, m...@redhat.com wrote: > >On Fri, May 10, 2024 at 01:11:49PM +0200, Jiri Pirko wrote: > >> Fri, May 10, 2024 at 12:52:52PM CEST, m...@redhat.com wrote: > >> >On Fri, May 10, 2024 at 12:37:15PM +0200,

Re: [PATCH] virtio_net: Fix missed rtnl_unlock

2024-05-15 Thread Michael S. Tsirkin
On Wed, May 15, 2024 at 09:31:20AM -0500, Daniel Jurgens wrote: > The rtnl_lock would stay locked if allocating promisc_allmulti failed. > > Reported-by: Eric Dumazet > Link: > https://lore.kernel.org/netdev/cann89ilazvaucvhpm6rpjj0owra_ofnx7fhc8d60gv-65ad...@mail.gmail.com/ > Signed-off-by: Dan

Re: [PATCH v3] virtio_net: Fix missed rtnl_unlock

2024-05-15 Thread Michael S. Tsirkin
-by: Eric Dumazet > Link: > https://lore.kernel.org/netdev/cann89ilazvaucvhpm6rpjj0owra_ofnx7fhc8d60gv-65ad...@mail.gmail.com/ > Signed-off-by: Daniel Jurgens Acked-by: Michael S. Tsirkin > --- > v3: > - Changed to promisc_allmulti alloc to GPF_KERNEL > v2: &

Re: [PATCH v3] virtio_net: Fix missed rtnl_unlock

2024-05-15 Thread Michael S. Tsirkin
-by: Eric Dumazet > Link: > https://lore.kernel.org/netdev/cann89ilazvaucvhpm6rpjj0owra_ofnx7fhc8d60gv-65ad...@mail.gmail.com/ > Signed-off-by: Daniel Jurgens Acked-by: Michael S. Tsirkin net tree I presume. > --- > v3: > - Changed to promisc_allmulti alloc to

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

2024-05-16 Thread Michael S. Tsirkin
On Thu, May 16, 2024 at 12:54:58PM +0200, Jiri Pirko wrote: > Thu, May 16, 2024 at 06:48:38AM CEST, jasow...@redhat.com wrote: > >On Wed, May 15, 2024 at 8:54 PM Jiri Pirko wrote: > >> > >> Wed, May 15, 2024 at 12:12:51PM CEST, j...@resnulli.us wrote: > >> >Wed, May 15, 2024 at 10:20:04AM CEST, m.

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

2024-05-16 Thread Michael S. Tsirkin
On Thu, May 16, 2024 at 05:25:20PM +0200, Jiri Pirko wrote: > > >I'd expect a regression if any to be in a streaming benchmark. > > Can you elaborate? BQL does two things that can hurt throughput: - limits amount of data in the queue - can limit bandwidth if we now get queue underruns - adds C

Re: [PATCH net-next] virtio-net: synchronize operstate with admin state on up/down

2024-05-21 Thread Michael S. Tsirkin
; DEFAULT group default qlen 1000 > link/ether 00:00:05:00:00:09 brd ff:ff:ff:ff:ff:ff > ... > 5: macvlan0@enp0s3: mtu 1500 qdisc > noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000 > link/ether b2:a9:c5:04:da:53 brd ff:ff:ff:ff:ff:ff > > Cc: Venkat Ve

Re: [PATCH net 2/2] Revert "virtio_net: Add a lock for per queue RX coalesce"

2024-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2024 at 04:52:19PM +0800, Heng Qi wrote: > On Wed, 22 May 2024 10:15:46 +0200, Jiri Pirko wrote: > > Wed, May 22, 2024 at 05:45:48AM CEST, hen...@linux.alibaba.com wrote: > > >This reverts commit 4d4ac2ececd3c42a08dd32a6e3a4aaf25f7efe44. > > > > This commit does not exist in -net

Re: [PATCH net 2/2] virtio_net: fix missing lock protection on control_buf access

2024-05-28 Thread Michael S. Tsirkin
On Tue, May 28, 2024 at 03:52:26PM +0800, Heng Qi wrote: > Refactored the handling of control_buf to be within the cvq_lock > critical section, mitigating race conditions between reading device > responses and new command submissions. > > Fixes: 6f45ab3e0409 ("virtio_net: Add a lock for the comman

Re: [PATCH net 2/2] virtio_net: fix missing lock protection on control_buf access

2024-05-28 Thread Michael S. Tsirkin
On Wed, May 29, 2024 at 12:01:45AM +0800, Heng Qi wrote: > On Tue, 28 May 2024 11:46:28 -0400, "Michael S. Tsirkin" > wrote: > > On Tue, May 28, 2024 at 03:52:26PM +0800, Heng Qi wrote: > > > Refactored the handling of control_buf to be within the cvq_lock > >

Re: [PATCH net-next v1 0/7] virtnet_net: prepare for af-xdp

2024-05-30 Thread Michael S. Tsirkin
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

Re: [PATCH net v3 2/2] virtio_net: fix a spurious deadlock issue

2024-05-30 Thread Michael S. Tsirkin
_fault+0x3a2/0x8a0 > ? lock_release+0x72/0x140 > ? do_user_addr_fault+0x3a7/0x8a0 > __x64_sys_sendto+0x29/0x30 > do_syscall_64+0x78/0x180 > entry_SYSCALL_64_after_hwframe+0x76/0x7e > > Fixes: 4d4ac2ececd3 ("virtio_net: Add a lock for per queue RX coalesce") >

Re: [PATCH net v3 1/2] virtio_net: fix possible dim status unrecoverable

2024-05-30 Thread Michael S. Tsirkin
to DIM_START_MEASURE. > > Fixes: 6208799553a8 ("virtio-net: support rx netdim") > Signed-off-by: Heng Qi > Reviewed-by: Jiri Pirko Acked-by: Michael S. Tsirkin > --- > drivers/net/virtio_net.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > di

Re: [PATCH net-next v2 00/12] virtnet_net: prepare for af-xdp

2024-05-30 Thread Michael S. Tsirkin
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

Re: [PATCH net-next v2 00/12] virtnet_net: prepare for af-xdp

2024-06-02 Thread Michael S. Tsirkin
On Sat, Jun 01, 2024 at 09:01:29AM +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. > >

Re: [PATCH net-next v2 12/12] virtio_net: refactor the xmit type

2024-06-02 Thread Michael S. Tsirkin
On Thu, May 30, 2024 at 07:24:06PM +0800, Xuan Zhuo wrote: > +enum virtnet_xmit_type { > + VIRTNET_XMIT_TYPE_SKB, > + VIRTNET_XMIT_TYPE_XDP, > +}; > + > +#define VIRTNET_XMIT_TYPE_MASK (VIRTNET_XMIT_TYPE_SKB | > VIRTNET_XMIT_TYPE_XDP) No idea how this has any chance to work. Was this test

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

2024-06-05 Thread Michael S. Tsirkin
On Thu, Jun 06, 2024 at 12:25:15PM +0800, Jason Wang wrote: > > If the codes of orphan mode don't have an impact when you enable > > napi_tx mode, please keep it if you can. > > For example, it complicates BQL implementation. > > Thanks I very much doubt sending interrupts to a VM can *on all be

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

2024-06-06 Thread Michael S. Tsirkin
On Thu, Jun 06, 2024 at 07:42:35PM +0800, Jason Xing wrote: > On Thu, Jun 6, 2024 at 12:25 PM Jason Wang wrote: > > > > On Thu, Jun 6, 2024 at 10:59 AM Jason Xing > > wrote: > > > > > > Hello Jason, > > > > > > On Thu, Jun 6, 2024 at 8:21 AM Jason Wang wrote: > > > > > > > > On Wed, Jun 5, 2024

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

2024-06-06 Thread Michael S. Tsirkin
On Fri, Jun 07, 2024 at 02:22:31PM +0800, Jason Wang wrote: > On Thu, Jun 6, 2024 at 9:41 PM Jiri Pirko wrote: > > > > Thu, Jun 06, 2024 at 06:25:15AM CEST, jasow...@redhat.com wrote: > > >On Thu, Jun 6, 2024 at 10:59 AM Jason Xing > > >wrote: > > >> > > >> Hello Jason, > > >> > > >> On Thu, Jun

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

2024-06-06 Thread Michael S. Tsirkin
> >On Thu, Jun 6, 2024 at 2:05 PM Michael S. Tsirkin wrote: > >> >> > >> >> On Thu, Jun 06, 2024 at 12:25:15PM +0800, Jason Wang wrote: > >> >> > > If the codes of orphan mode don't have an impact when you enable > >> >> &

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

2024-06-07 Thread Michael S. Tsirkin
On Fri, Jun 07, 2024 at 11:57:37AM +0200, Jiri Pirko wrote: > >True. Personally, I would like to just drop orphan mode. But I'm not > >sure others are happy with this. > > How about to do it other way around. I will take a stab at sending patch > removing it. If anyone is against and has solid dat

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

2024-06-10 Thread Michael S. Tsirkin
On Fri, Jun 07, 2024 at 01:30:34PM +0200, Jiri Pirko wrote: > Fri, Jun 07, 2024 at 12:23:37PM CEST, m...@redhat.com wrote: > >On Fri, Jun 07, 2024 at 11:57:37AM +0200, Jiri Pirko wrote: > >> >True. Personally, I would like to just drop orphan mode. But I'm not > >> >sure others are happy with this.

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

2024-06-12 Thread Michael S. Tsirkin
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_fast. Super netperf with 50 threads is > running in background. Netpe

Re: [PATCH net-next v4 08/15] virtio_net: sq support premapped mode

2024-06-12 Thread Michael S. Tsirkin
On Tue, Jun 11, 2024 at 07:41:40PM +0800, Xuan Zhuo wrote: > 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 when it is bound to > af-xdp. > > * virtnet_sq_set_premapped

Re: [PATCH net-next v4 09/15] virtio_net: xsk: bind/unbind xsk

2024-06-12 Thread Michael S. Tsirkin
On Tue, Jun 11, 2024 at 07:41:41PM +0800, Xuan Zhuo wrote: > This patch implement the logic of bind/unbind xsk pool to sq and rq. > > Signed-off-by: Xuan Zhuo I'd just squash with previous patch. This one is hard to review in isolation. > --- > drivers/net/virtio_net.c | 199 ++

Re: [PATCH net-next v4 11/15] virtio_net: xsk: tx: support xmit xsk buffer

2024-06-12 Thread Michael S. Tsirkin
On Wed, Jun 12, 2024 at 04:25:05PM -0700, Jakub Kicinski wrote: > On Tue, 11 Jun 2024 19:41:43 +0800 Xuan Zhuo wrote: > > @@ -534,10 +534,13 @@ enum virtnet_xmit_type { > > VIRTNET_XMIT_TYPE_SKB, > > VIRTNET_XMIT_TYPE_XDP, > > VIRTNET_XMIT_TYPE_DMA, > > + VIRTNET_XMIT_TYPE_XSK, > > A

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

2024-06-17 Thread Michael S. Tsirkin
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_fast. Super netperf with 50 threads is > running in background. Netpe

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

2024-06-17 Thread Michael S. Tsirkin
On Mon, Jun 17, 2024 at 09:44:55AM +0800, Jason Wang wrote: > Probably, but do we need to define a bar here? Looking at git history, > we didn't ask a full benchmark for a lot of commits that may touch > performance. There's no may here and we even got a report from a real user. -- MST

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

2024-06-17 Thread Michael S. Tsirkin
On Mon, Jun 17, 2024 at 11:30:36AM +0200, 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:30:34PM +0200, Jiri Pirko wrote: > >&g

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] 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: > &g

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

2024-06-19 Thread Michael S. Tsirkin
On Wed, Jun 19, 2024 at 07:45:16AM +0200, Jiri Pirko wrote: > 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 > >> >

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

2024-06-19 Thread Michael S. Tsirkin
e. > >> > >> Not sure I get you. __free_old_xmit() is always called with stats > >> zeroed. So this is just sum-up of one queue completion run. > >> I don't see how this could become "larger and larger number" as you > >> describe. > >

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

2024-06-19 Thread Michael S. Tsirkin
49 110d9 /tmp/orig/virtio_net.o $ size /tmp/new/virtio_net.o textdata bss dec hex filename 657603892 100 69752 11078 /tmp/new/virtio_net.o Couldn't measure any performance impact, unsurprizingly. Signed-off-by: Michael S. Tsirkin --- diff --git a/dri

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

2024-06-19 Thread Michael S. Tsirkin
On Wed, Jun 19, 2024 at 10:55:29AM +0800, Li RongQing wrote: > 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 Ack

Re: [PATCH net-next v4 0/5] virtio_net: enable the irq for ctrlq

2024-06-19 Thread Michael S. Tsirkin
On Thu, Jun 20, 2024 at 12:19:03AM +0800, Heng Qi wrote: > Ctrlq in polling mode may cause the virtual machine to hang and > occupy additional CPU resources. Enabling the irq for ctrlq > alleviates this problem and allows commands to be requested > concurrently. Any patch that is supposed to be a

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

2024-06-19 Thread Michael S. Tsirkin
On Thu, Jun 20, 2024 at 12:19:05AM +0800, Heng Qi wrote: > @@ -5312,7 +5315,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi) > > /* Parameters for control virtqueue, if any */ > if (vi->has_cvq) { > - callbacks[total_vqs - 1] = NULL; > + callbacks[tota

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

2024-06-20 Thread Michael S. Tsirkin
s > >job a bit easier: > > > >$ size /tmp/orig/virtio_net.o > > textdata bss dec hex filename > > 658573892 100 69849 110d9 /tmp/orig/virtio_net.o > >$ size /tmp/new/virtio_net.o > > textdata bss dec h

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

2024-06-20 Thread Michael S. Tsirkin
On Thu, Jun 20, 2024 at 03:29:15PM +0800, Heng Qi wrote: > On Wed, 19 Jun 2024 17:19:12 -0400, "Michael S. Tsirkin" > wrote: > > On Thu, Jun 20, 2024 at 12:19:05AM +0800, Heng Qi wrote: > > > @@ -5312,7 +5315,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi

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

2024-06-20 Thread Michael S. Tsirkin
On Thu, Jun 20, 2024 at 05:38:22PM +0800, Heng Qi wrote: > On Thu, 20 Jun 2024 04:32:15 -0400, "Michael S. Tsirkin" > wrote: > > On Thu, Jun 20, 2024 at 03:29:15PM +0800, Heng Qi wrote: > > > On Wed, 19 Jun 2024 17:19:12 -0400, "Michael S. Tsirkin" >

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

2024-06-20 Thread Michael S. Tsirkin
On Thu, Jun 20, 2024 at 05:53:15PM +0800, Heng Qi wrote: > On Thu, 20 Jun 2024 16:26:05 +0800, Jason Wang wrote: > > On Thu, Jun 20, 2024 at 4:21 PM Jason Wang wrote: > > > > > > On Thu, Jun 20, 2024 at 3:35 PM Heng Qi wrote: > > > > > > >

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

2024-06-20 Thread Michael S. Tsirkin
On Thu, Jun 20, 2024 at 06:10:51AM -0400, Michael S. Tsirkin wrote: > On Thu, Jun 20, 2024 at 05:53:15PM +0800, Heng Qi wrote: > > On Thu, 20 Jun 2024 16:26:05 +0800, Jason Wang wrote: > > > On Thu, Jun 20, 2024 at 4:21 PM Jason Wang wrote: > > > > > > > &g

Re: [PATCH 2/2] virtio_net: fixing XDP for fully checksummed packets handling

2024-06-20 Thread Michael S. Tsirkin
On Thu, Jun 20, 2024 at 05:28:48PM +0800, Heng Qi wrote: > On Thu, 20 Jun 2024 16:33:35 +0800, Jason Wang wrote: > > On Tue, Jun 18, 2024 at 11:17 AM Heng Qi wrote: > > > > > > On Tue, 18 Jun 2024 11:10:26 +0800, Jason Wang > > > wrote: > > > > On Mon, Jun 17, 2024 at 9:15 PM Heng Qi > > > >

Re: [PATCH 2/2] virtio_net: fixing XDP for fully checksummed packets handling

2024-06-20 Thread Michael S. Tsirkin
On Thu, Jun 20, 2024 at 06:38:49PM +0800, Heng Qi wrote: > On Thu, 20 Jun 2024 18:27:16 +0800, Heng Qi wrote: > > On Thu, 20 Jun 2024 06:19:01 -0400, "Michael S. Tsirkin" > > wrote: > > > On Thu, Jun 20, 2024 at 05:28:48PM +0800, Heng Qi wrote: > > >

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

2024-06-20 Thread Michael S. Tsirkin
On Thu, Jun 20, 2024 at 12:46:24PM +0200, Paolo Abeni wrote: > On Tue, 2024-06-18 at 15:56 +0800, Xuan Zhuo wrote: > > 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 cha

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

2024-06-20 Thread Michael S. Tsirkin
On Thu, Jun 20, 2024 at 07:09:08AM -0700, Jakub Kicinski wrote: > On Wed, 19 Jun 2024 10:55:29 +0800 Li RongQing wrote: > > 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") > > Sign

Re: [PATCH][net-next,v2] virtio_net: Remove u64_stats_update_begin()/end() for stats fetch

2024-06-21 Thread Michael S. Tsirkin
d-by: Jakub Kicinski > Signed-off-by: Li RongQing I like the added comment, makes things clearer. Acked-by: Michael S. Tsirkin > --- > drivers/net/virtio_net.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net

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

2024-06-21 Thread Michael S. Tsirkin
On Fri, Jun 21, 2024 at 03:41:46PM +0800, Xuan Zhuo wrote: > On Thu, 20 Jun 2024 06:11:40 -0400, "Michael S. Tsirkin" > wrote: > > On Thu, Jun 20, 2024 at 06:10:51AM -0400, Michael S. Tsirkin wrote: > > > On Thu, Jun 20, 2024 at 05:53:15PM +0800, Heng Qi wrote: &g

Re: [PATCH net 0/2] virtio_net: fix race on control_buf

2024-06-23 Thread Michael S. Tsirkin
On Tue, May 28, 2024 at 03:52:24PM +0800, Heng Qi wrote: > Patch 1 did a simple rename, leaving 'ret' for patch 2. > Patch 2 fixed a race between reading the device response and the > new command submission. Acked-by: Michael S. Tsirkin > Heng Qi (2): > virt

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

2024-06-24 Thread Michael S. Tsirkin
On Thu, Jun 20, 2024 at 12:19:05AM +0800, Heng Qi wrote: > If the device does not respond to a request for a long time, > then control vq polling elevates CPU utilization, a problem that > exacerbates with more command requests. > > Enabling control vq's irq is advantageous for the guest, and > th

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

2024-06-25 Thread Michael S. Tsirkin
On Tue, Jun 25, 2024 at 09:27:24AM +0800, Jason Wang wrote: > On Thu, Jun 20, 2024 at 6:12 PM Michael S. Tsirkin wrote: > > > > On Thu, Jun 20, 2024 at 06:10:51AM -0400, Michael S. Tsirkin wrote: > > > On Thu, Jun 20, 2024 at 05:53:15PM +0800, Heng Qi wrote: > > &g

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

2024-06-26 Thread Michael S. Tsirkin
On Wed, Jun 26, 2024 at 09:52:58AM +0200, Jiri Pirko wrote: > Thu, Jun 20, 2024 at 12:31:34PM CEST, hen...@linux.alibaba.com wrote: > >On Thu, 20 Jun 2024 06:11:40 -0400, "Michael S. Tsirkin" > >wrote: > >> On Thu, Jun 20, 2024 at 06:10:51AM -0400, Michael S. Ts

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

2024-06-26 Thread Michael S. Tsirkin
t;On Thu, 20 Jun 2024 06:11:40 -0400, "Michael S. Tsirkin" > >> > wrote: > >> >> On Thu, Jun 20, 2024 at 06:10:51AM -0400, Michael S. Tsirkin wrote: > >> >> > On Thu, Jun 20, 2024 at 05:53:15PM +0800, Heng Qi wrote: > >> >> > &

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

2024-07-09 Thread Michael S. Tsirkin
On Wed, Jun 19, 2024 at 10:55:29AM +0800, Li RongQing wrote: > 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 So I dropped this from my tree, if you think

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

2024-07-09 Thread Michael S. Tsirkin
et's start with the small mode. > 3. merge some commits and remove some not important commits Series: Acked-by: Michael S. Tsirkin > ## AF_XDP > > XDP socket(AF_XDP) is an excellent bypass kernel network framework. The zero > copy feature of xsk (XDP socket) needs to

Re: [PATCH net-next] net: virtio: fix virtnet_sq_free_stats initialization

2024-07-12 Thread Michael S. Tsirkin
s") > Reported-by: Aishwarya TCV > Signed-off-by: Jean-Philippe Brucker Acked-by: Michael S. Tsirkin > --- > Both these patches are still in next so it might be possible to fix it > up directly. I'd be fine with squashing but I don't think it's done in net-

Re: [PATCH net v2] virtio-net: unbreak vq resizing when coalescing is not negotiated

2024-07-31 Thread Michael S. Tsirkin
On Wed, Jul 31, 2024 at 08:07:17PM +0800, Heng Qi wrote: > >From the virtio spec: > > The driver MUST have negotiated the VIRTIO_NET_F_VQ_NOTF_COAL > feature when issuing commands VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET > and VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET. > > The driver must not se

Re: [PATCH net v2] virtio-net: unbreak vq resizing when coalescing is not negotiated

2024-07-31 Thread Michael S. Tsirkin
On Wed, Jul 31, 2024 at 08:25:23PM +0800, Heng Qi wrote: > On Wed, 31 Jul 2024 08:14:43 -0400, "Michael S. Tsirkin" > wrote: > > On Wed, Jul 31, 2024 at 08:07:17PM +0800, Heng Qi wrote: > > > >From the virtio spec: > > > > > > The drive

Re: [PATCH net v2] virtio-net: unbreak vq resizing when coalescing is not negotiated

2024-07-31 Thread Michael S. Tsirkin
On Thu, Aug 01, 2024 at 02:07:43PM +0800, Heng Qi wrote: > On Wed, 31 Jul 2024 08:46:42 -0400, "Michael S. Tsirkin" > wrote: > > On Wed, Jul 31, 2024 at 08:25:23PM +0800, Heng Qi wrote: > > > On Wed, 31 Jul 2024 08:14:43 -0400, "Michael S. Tsirkin" >

Re: [PATCH net v3 2/2] virtio-net: unbreak vq resizing when coalescing is not negotiated

2024-08-01 Thread Michael S. Tsirkin
On Thu, Aug 01, 2024 at 08:27:39PM +0800, Heng Qi wrote: > Don't break the resize action if the vq coalescing feature > named VIRTIO_NET_F_VQ_NOTF_COAL is not negotiated. > > Fixes: f61fe5f081cf ("virtio-net: fix the vq coalescing setting for vq > resize") > Signed-off-by: Heng Qi > Reviewed-by:

Re: [PATCH net-next V6 4/4] virtio-net: synchronize probe with ndo_set_features

2024-08-06 Thread Michael S. Tsirkin
On Tue, Aug 06, 2024 at 10:22:24AM +0800, Jason Wang wrote: > We calculate guest offloads during probe without the protection of > rtnl_lock. This lead to race between probe and ndo_set_features. Fix > this by moving the calculation under the rtnl_lock. > > Signed-off-by: Jason Wang Fixes tag pl

Re: [PATCH net-next V6 0/4] virtio-net: synchronize op/admin state

2024-08-07 Thread Michael S. Tsirkin
rrier during ndo_open/stop while doing > other necessary serialization about the carrier settings during probe. > > While at it, also fix a race between probe and ndo_set_features as we > didn't initalize the guest offload setting under rtnl lock. Acked-by: Michael S. Tsirkin

Re: [Patch net] vsock: fix recursive ->recvmsg calls

2024-08-12 Thread Michael S. Tsirkin
b4 ("vsock: support sockmap") > Reported-by: syzbot+bdb4bd87b5e22058e...@syzkaller.appspotmail.com > Tested-by: syzbot+bdb4bd87b5e22058e...@syzkaller.appspotmail.com > Cc: Bobby Eshleman > Cc: Michael S. Tsirkin > Cc: Stefano Garzarella > Signed-off-by: Cong Wang Acked-

Re: [PATCH net-next v5 1/4] virtio_ring: enable premapped mode whatever use_dma_api

2024-08-13 Thread Michael S. Tsirkin
On Tue, Aug 13, 2024 at 12:28:41PM -0700, Si-Wei Liu wrote: > > Turning out this below commit to unconditionally enable premapped > virtio-net: > > commit f9dac92ba9081062a6477ee015bd3b8c5914efc4 > Author: Xuan Zhuo > Date:   Sat May 11 11:14:01 2024 +0800 > > leads to regression on VM with no

Re: [PATCH net-next v5 1/4] virtio_ring: enable premapped mode whatever use_dma_api

2024-08-14 Thread Michael S. Tsirkin
Message-ID: <20240511031404.30903-1-xuanz...@linux.alibaba.com> > On 8/13/2024 12:46 PM, Michael S. Tsirkin wrote: > > Want to post a patchset to revert? > >

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

2024-08-14 Thread Michael S. Tsirkin
On Wed, Aug 14, 2024 at 10:17:15AM +0200, Jiri Pirko wrote: > >diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > >index 3f10c72743e9..c6af18948092 100644 > >--- a/drivers/net/virtio_net.c > >+++ b/drivers/net/virtio_net.c > >@@ -2867,8 +2867,8 @@ static int virtnet_enable_queue_pai

Re: [PATCH net] virtio_net: move netdev_tx_reset_queue() call before RX napi enable

2024-08-14 Thread Michael S. Tsirkin
BQL counters reset before RX > napi enable to avoid the issue. > > Reported-by: Marek Szyprowski > Closes: > https://lore.kernel.org/netdev/e632e378-d019-4de7-8f13-07c572ab3...@samsung.com/ > Fixes: c8bd1f7f3e61 ("virtio_net: add support for Byte Queue Limits") > T

Re: [PATCH net] virtio-net: fix overflow inside virtnet_rq_alloc

2024-08-20 Thread Michael S. Tsirkin
On Tue, Aug 20, 2024 at 03:19:13PM +0800, Xuan Zhuo wrote: > leads to regression on VM with the sysctl value of: > > - net.core.high_order_alloc_disable=1 > which could see reliable crashes or scp failure (scp a file 100M in size > to VM): > > The issue is that the virtnet_rq_dma takes up 16

Re: [PATCH net] virtio-net: fix overflow inside virtnet_rq_alloc

2024-08-20 Thread Michael S. Tsirkin
On Tue, Aug 20, 2024 at 12:44:46PM -0700, Si-Wei Liu wrote: > > > On 8/20/2024 12:19 AM, Xuan Zhuo wrote: > > leads to regression on VM with the sysctl value of: > > > > - net.core.high_order_alloc_disable=1 > > > > which could see reliable crashes or scp failure (scp a file 100M in size > > to

Re: [PATCH net] virtio-net: fix overflow inside virtnet_rq_alloc

2024-08-20 Thread Michael S. Tsirkin
On Tue, Aug 20, 2024 at 03:19:13PM +0800, Xuan Zhuo wrote: > leads to regression on VM with the sysctl value of: > > - net.core.high_order_alloc_disable=1 > > which could see reliable crashes or scp failure (scp a file 100M in size > to VM): > > The issue is that the virtnet_rq_dma takes up 16 b

Re: [PATCH net] virtio-net: fix overflow inside virtnet_rq_alloc

2024-08-29 Thread Michael S. Tsirkin
On Thu, Aug 29, 2024 at 03:26:00PM +0800, Xuan Zhuo wrote: > On Thu, 29 Aug 2024 12:51:31 +0800, Jason Wang wrote: > > On Wed, Aug 28, 2024 at 7:21 PM Xuan Zhuo > > wrote: > > > > > > On Tue, 27 Aug 2024 11:38:45 +0800, Jason Wang > > > wrote: > > > > On Tue, Aug 20, 2024 at 3:19 PM Xuan Zhuo

Re: [PATCH net] virtio-net: fix overflow inside virtnet_rq_alloc

2024-08-29 Thread Michael S. Tsirkin
On Thu, Aug 29, 2024 at 03:38:07PM +0800, Xuan Zhuo wrote: > On Thu, 29 Aug 2024 03:35:58 -0400, "Michael S. Tsirkin" > wrote: > > On Thu, Aug 29, 2024 at 03:26:00PM +0800, Xuan Zhuo wrote: > > > On Thu, 29 Aug 2024 12:51:31 +0800, Jason Wang > > >

Re: [PATCH net] virtio-net: fix overflow inside virtnet_rq_alloc

2024-09-06 Thread Michael S. Tsirkin
On Tue, Aug 20, 2024 at 03:19:13PM +0800, Xuan Zhuo wrote: > leads to regression on VM with the sysctl value of: > > - net.core.high_order_alloc_disable=1 > > which could see reliable crashes or scp failure (scp a file 100M in size > to VM): > > The issue is that the virtnet_rq_dma takes up 16 b

Re: [PATCH net] virtio-net: fix overflow inside virtnet_rq_alloc

2024-09-06 Thread Michael S. Tsirkin
On Fri, Sep 06, 2024 at 04:53:38PM +0800, Xuan Zhuo wrote: > On Fri, 6 Sep 2024 04:43:29 -0400, "Michael S. Tsirkin" > wrote: > > On Tue, Aug 20, 2024 at 03:19:13PM +0800, Xuan Zhuo wrote: > > > leads to regression on VM with the sysctl value of: > > > >

Re: [PATCH net] virtio-net: fix overflow inside virtnet_rq_alloc

2024-09-06 Thread Michael S. Tsirkin
On Fri, Sep 06, 2024 at 05:25:36PM +0800, Xuan Zhuo wrote: > On Fri, 6 Sep 2024 05:08:56 -0400, "Michael S. Tsirkin" > wrote: > > On Fri, Sep 06, 2024 at 04:53:38PM +0800, Xuan Zhuo wrote: > > > On Fri, 6 Sep 2024 04:43:29 -0400, "Michael S. Tsirkin"

<    1   2   3   4   5   6   7   8   9   10   >