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

2024-08-01 Thread Heng Qi
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: Xuan Zhuo Acked-by: Eugenio Pé rez Acked-by: Jason W

[PATCH net v4 0/2] virtio-net: unbreak vq resizing if vq coalescing is not supported

2024-08-01 Thread Heng Qi
;v4: - Add a comment for patch[2/2]. v2->v3: - Break out the feature check and the fix into separate patches. v1->v2: - Rephrase the subject. - Put the feature check inside the virtnet_send_{r,t}x_ctrl_coal_vq_cmd. Heng Qi (2): virtio-net: check feature before configuring the vq c

[PATCH net v4 1/2] virtio-net: check feature before configuring the vq coalescing command

2024-08-01 Thread Heng Qi
for the next bugfix patch. Suggested-by: Michael S. Tsirkin Signed-off-by: Heng Qi --- v2->v3: - Break out the feature check and the fix into separate patches. drivers/net/virtio_net.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/virtio_net.c b/drivers/

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

2024-08-01 Thread Heng Qi
On Thu, 1 Aug 2024 08:30:44 -0400, "Michael S. Tsirkin" wrote: > 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. > > > > Fi

[PATCH net v3 0/2] virtio-net: unbreak vq resizing if vq coalescing is not supported

2024-08-01 Thread Heng Qi
;v3: - Break out the feature check and the fix into separate patches. v1->v2: - Rephrase the subject. - Put the feature check inside the virtnet_send_{r,t}x_ctrl_coal_vq_cmd. Heng Qi (2): virtio-net: check feature before configuring the vq coalescing command virtio-net: unbreak vq re

[PATCH net v3 1/2] virtio-net: check feature before configuring the vq coalescing command

2024-08-01 Thread Heng Qi
for the next bugfix patch. Suggested-by: Michael S. Tsirkin Signed-off-by: Heng Qi --- v2->v3: - Break out the feature check and the fix into separate patches. drivers/net/virtio_net.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/virtio_net.c b/drivers/

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

2024-08-01 Thread Heng Qi
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: Xuan Zhuo Acked-by: Eugenio Pé rez Acked-by: Jason W

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

2024-07-31 Thread Heng Qi
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" > > wrote: > > > On Wed, Jul 31, 2024 at 08:07:17PM +0800,

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

2024-07-31 Thread Heng Qi
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 driver MUST have negotiated the VIRTIO_NET_F_VQ_NOTF_COAL > > feature when issuing c

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

2024-07-31 Thread Heng Qi
if VIRTIO_NET_F_VQ_NOTF_COAL is not negotiated. This limitation of course applies to vq resize. Fixes: f61fe5f081cf ("virtio-net: fix the vq coalescing setting for vq resize") Signed-off-by: Heng Qi Reviewed-by: Xuan Zhuo Acked-by: Eugenio Pé rez Acked-by: Jason Wang --- v1->v2: - Rephrase the sub

Re: [PATCH net] virtio_net: Avoid sending unnecessary vq coalescing commands

2024-07-31 Thread Heng Qi
On Tue, 30 Jul 2024 18:20:20 -0700, Jakub Kicinski wrote: > On Mon, 29 Jul 2024 20:47:55 +0800 Heng Qi wrote: > > Subject: [PATCH net] virtio_net: Avoid sending unnecessary vq coalescing > > commands > > subject currently reads like this is an optimization, could you

Re: [PATCH net] virtio_net: Avoid sending unnecessary vq coalescing commands

2024-07-31 Thread Heng Qi
On Wed, 31 Jul 2024 11:13:03 +0800, Jason Wang wrote: > On Wed, Jul 31, 2024 at 9:20 AM Jakub Kicinski wrote: > > > > On Mon, 29 Jul 2024 20:47:55 +0800 Heng Qi wrote: > > > Subject: [PATCH net] virtio_net: Avoid sending unnecessary vq coalescing > > > command

[PATCH net] virtio_net: Avoid sending unnecessary vq coalescing commands

2024-07-29 Thread Heng Qi
if VIRTIO_NET_F_VQ_NOTF_COAL is not negotiated. This limitation of course applies to vq resize. Fixes: f61fe5f081cf ("virtio-net: fix the vq coalescing setting for vq resize") Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 29 + 1 file changed, 17 insertions(+), 12 delet

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

2024-07-08 Thread Heng Qi
chael 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 2/2] virtio_net: fixing XDP for fully checksummed packets handling

2024-06-20 Thread Heng Qi
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: > > > On Thu, 20 Jun 2024 16:33:35 +0800, Jason Wang > > > wrote: >

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

2024-06-20 Thread Heng Qi
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: > > > On Thu, 20 Jun 2024 16:26:05 +0800, Jason Wang > > > wro

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

2024-06-20 Thread Heng Qi
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: > > On Thu, 20 Jun 2024 16:33:35 +0800, Jason Wang wrote: > > > On Tue, Jun 18, 2024 at 11:17 AM Heng Qi wrote: > > > > > >

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

2024-06-20 Thread Heng Qi
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: > > > > > > On Wed, 19 Jun 2024 17:19:12 -0400, "Michael S. Tsirkin" > > > wro

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

2024-06-20 Thread Heng Qi
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" > > wrote: > > > On Thu, Jun 20, 2024 at 12:19:05AM +0800, Heng Qi

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

2024-06-20 Thread Heng Qi
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 wrote: > > > > > > > >

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

2024-06-20 Thread Heng Qi
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) > > > > /* Parameters for control virtqueue, if

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

2024-06-20 Thread Heng Qi
On Wed, 19 Jun 2024 17:16:57 -0400, "Michael S. Tsirkin" wrote: > 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 > > all

[PATCH net-next v4 5/5] virtio_net: improve dim command request efficiency

2024-06-19 Thread Heng Qi
Currently, control vq handles commands synchronously, leading to increased delays for dim commands during multi-queue VM configuration and directly impacting dim performance. To address this, we are shifting to asynchronous processing of ctrlq's dim commands. Signed-off-by: Heng Qi --- dr

[PATCH net-next v4 4/5] virtio_net: refactor command sending and response handling

2024-06-19 Thread Heng Qi
Refactor the command handling logic by splitting virtnet_send_command_reply into virtnet_add_command_reply and virtnet_wait_command_response for better clarity and subsequent use. Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 53 1 file changed

[PATCH net-next v4 3/5] virtio_net: change the command token to completion

2024-06-19 Thread Heng Qi
Previously, control vq only allowed a single request to be sent, so using virtnet_info as a global token was fine. To support concurrent requests, the driver needs to use a command-level token to distinguish between requests that have been sent. Signed-off-by: Heng Qi --- drivers/net

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

2024-06-19 Thread Heng Qi
-by: Jason Wang Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index b45f58a902e3..ed10084997d3 100644 --- a/drivers/net/virtio_net.c +++ b/d

[PATCH net-next v4 1/5] virtio_net: passing control_buf explicitly

2024-06-19 Thread Heng Qi
In a later patch, the driver may send requests concurrently, in which case each command will have its own control buffer, so we refactor virtnet_send_command_reply() to pass the control buffer explicitly as a parameter. Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 22

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

2024-06-19 Thread Heng Qi
Add interrupt suppression. v2->v3: - Use the completion for dim cmds. v1->v2: - Refactor the patch 1 and rephase the commit log. Heng Qi (5): virtio_net: passing control_buf explicitly virtio_net: enable irq for the control vq virtio_net: change the command token to completion v

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

2024-06-19 Thread Heng Qi
在 2024/6/19 下午11:08, Jakub Kicinski 写道: On Wed, 19 Jun 2024 10:02:58 +0800 Heng Qi wrote: Currently we do not allow RXCUSM to be disabled. You don't have to disable checksuming in the device. Yes, it is up to the device itself to decide whether to validate checksum. What I mean is th

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

2024-06-19 Thread Heng Qi
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 Reviewed-by: Heng Qi Thanks! > > Fixes: 6208799553a8 ("virtio-net: support rx netdim") > Signed-off-by: Li R

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'

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: > > > > > > > > Curr

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

2024-06-17 Thread Heng Qi
On Tue, 18 Jun 2024 11:10:26 +0800, Jason Wang wrote: > On Mon, Jun 17, 2024 at 9:15 PM Heng Qi wrote: > > > > The XDP program can't correctly handle partially checksummed > > packets, but works fine with fully checksummed packets. > > Not sure this is ture, if

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

2024-06-17 Thread Heng Qi
On Tue, 18 Jun 2024 11:01:27 +0800, Jason Wang wrote: > On Mon, Jun 17, 2024 at 9:15 PM Heng Qi wrote: > > > > In virtio spec 0.95, VIRTIO_NET_F_GUEST_CSUM was designed to handle > > partially checksummed packets, and the validation of fully checksummed > > packets b

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

2024-06-17 Thread Heng Qi
t drop all partially checksummed packets when VIRTIO_NET_F_GUEST_CSUM is not negotiated. This is not a bug, as the driver has always done this. Fixes: 436c9453a1ac ("virtio-net: keep vnet header zeroed after processing XDP") Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 20

[PATCH 0/2] virtio_net: fixes for checksum offloading and XDP handling

2024-06-17 Thread Heng Qi
XDP program had no trouble with fully checksummed packets. Heng Qi (2): virtio_net: checksum offloading handling fix virtio_net: fixing XDP for fully checksummed packets handling drivers/net/virtio_net.c | 32 +--- 1 file changed, 29 insertions(+), 3 deletions

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

2024-06-17 Thread Heng Qi
d in the virtio TC vote. [1] https://lists.oasis-open.org/archives/virtio-comment/202401/msg00011.html Fixes: 4f49129be6fa ("virtio-net: Set RXCSUM feature if GUEST_CSUM is available") Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 12 ++-- 1 file changed, 10 insertions

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

2024-06-17 Thread Heng Qi
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, > > leading to increased delays for dim commands during multi-queue > > VM configuration and directl

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

2024-06-05 Thread Heng Qi
Currently, control vq handles commands synchronously, leading to increased delays for dim commands during multi-queue VM configuration and directly impacting dim performance. To address this, we are shifting to asynchronous processing of ctrlq's dim commands. Signed-off-by: Heng Qi --- dr

[PATCH net-next v3 2/4] virtio_net: enable irq for the control vq

2024-06-05 Thread Heng Qi
-by: Jason Wang Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 0f872936d6ed..823a9dca51c1 100644 --- a/drivers/net/virtio_net.c +++ b/d

[PATCH net-next v3 1/4] virtio_net: passing control_buf explicitly

2024-06-05 Thread Heng Qi
In a later patch, the driver may send requests concurrently, in which case each command will have its own control buffer, so we refactor virtnet_send_command_reply() to pass the control buffer explicitly as a parameter. Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 22

[PATCH net-next v3 3/4] virtio_net: change the command token to completion

2024-06-05 Thread Heng Qi
Previously, control vq only allowed a single request to be sent, so using virtnet_info as a global token was fine. To support concurrent requests, the driver needs to use a command-level token to distinguish between requests that have been sent. Signed-off-by: Heng Qi --- drivers/net

[PATCH net-next v3 0/4] virtio_net: enable the irq for ctrlq

2024-06-05 Thread Heng Qi
atch 1 and rephase the commit log. Heng Qi (4): virtio_net: passing control_buf explicitly virtio_net: enable irq for the control vq virtio_net: change the command token to completion virtio_net: improve dim command request efficiency drivers/net/virtio_net.c

Re: [PATCH net-next v2 2/2] virtio_net: improve dim command request efficiency

2024-06-05 Thread Heng Qi
On Thu, 6 Jun 2024 08:27:35 +0800, Jason Wang wrote: > On Wed, Jun 5, 2024 at 10:56 PM Heng Qi wrote: > > > > Currently, the control queue (ctrlq) handles commands synchronously, > > leading to increased delays for dim commands during multi-queue > > VM configuration

[PATCH net-next v2 2/2] virtio_net: improve dim command request efficiency

2024-06-05 Thread Heng Qi
Currently, the control queue (ctrlq) handles commands synchronously, leading to increased delays for dim commands during multi-queue VM configuration and directly impacting dim performance. To address this, we are shifting to asynchronous processing of ctrlq's dim commands. Signed-off-by:

[PATCH net-next v2 0/2] virtio_net: enable the irq for ctrlq

2024-06-05 Thread Heng Qi
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. Changelog = v1->v2: - Refactor the patch 1 and rephase the commit log. Heng Qi

[PATCH net-next v2 1/2] virtio_net: enable irq for the control vq

2024-06-05 Thread Heng Qi
is code is basically from Jason: https://lore.kernel.org/all/20230413064027.13267-3-jasow...@redhat.com/ Suggested-by: Jason Wang Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/net/virtio_net.c b/d

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

2024-06-05 Thread Heng Qi
On Wed, 5 Jun 2024 13:30:51 +0200, Jiri Pirko wrote: > Mon, May 20, 2024 at 02:48:15PM CEST, j...@resnulli.us wrote: > >Fri, May 10, 2024 at 09:11:16AM CEST, hen...@linux.alibaba.com wrote: > >>On Thu, 9 May 2024 13:46:15 +0200, Jiri Pirko wrote: > >>> From: Jiri Pirko > >>> > >>> Add support

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

2024-05-30 Thread Heng Qi
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;

[PATCH net v2] virtio_net: fix missing lock protection on control_buf access

2024-05-29 Thread Heng Qi
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 command VQ.") Signed-off-by: Heng Qi Reviewed-by: Haripr

Re: [PATCH net 1/2] virtio_net: rename ret to err

2024-05-29 Thread Heng Qi
On Wed, 29 May 2024 17:10:53 -0700, Jakub Kicinski wrote: > On Tue, 28 May 2024 15:52:25 +0800 Heng Qi wrote: > > The integer variable 'ret', denoting the return code, is mismatched with > > the boolean return type of virtnet_send_command_reply(); hence, it is > >

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

2024-05-28 Thread Heng Qi
On Tue, 28 May 2024 12:45:32 -0400, "Michael S. Tsirkin" wrote: > 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

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

2024-05-28 Thread Heng Qi
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 > > critical section, mitigating race conditions between reading device >

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

2024-05-28 Thread Heng Qi
x8a0 __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") Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 36 1 file changed, 16 in

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

2024-05-28 Thread Heng Qi
disabled or parameters have not been modified; 3. virtnet_rx_dim_work exits directly; Then, even if net_dim is invoked again, it cannot work because the state is not restored to DIM_START_MEASURE. Fixes: 6208799553a8 ("virtio-net: support rx netdim") Signed-off-by: Heng Qi Reviewe

[PATCH net v3 0/2] virtio_net: fix lock warning and unrecoverable state

2024-05-28 Thread Heng Qi
2): rephase the commit log. Heng Qi (2): virtio_net: fix possible dim status unrecoverable virtio_net: fix a spurious deadlock issue drivers/net/virtio_net.c | 38 +- 1 file changed, 17 insertions(+), 21 deletions(-) -- 2.32.0.3.g01195cf9f

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

2024-05-28 Thread Heng Qi
在 2024/5/28 下午6:04, Paolo Abeni 写道: On Tue, 2024-05-28 at 11:06 +0800, Heng Qi wrote: On Mon, 27 May 2024 12:42:43 +0200, Paolo Abeni wrote: On Thu, 2024-05-23 at 15:46 +0800, Heng Qi wrote: This reverts commit 4d4ac2ececd3c42a08dd32a6e3a4aaf25f7efe44. When the following snippet is run

[PATCH net 1/2] virtio_net: rename ret to err

2024-05-28 Thread Heng Qi
The integer variable 'ret', denoting the return code, is mismatched with the boolean return type of virtnet_send_command_reply(); hence, it is renamed to 'err'. The usage of 'ret' is deferred to the next patch. Signed-off-by: Heng Qi --- drivers/net/virtio_net.c |

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

2024-05-28 Thread Heng Qi
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. Heng Qi (2): virtio_net: rename ret to err virtio_net: fix missing lock protection on control_buf access drivers/net/virtio_

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

2024-05-28 Thread Heng Qi
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 command VQ.") Signed-off-by: Heng Qi --- drivers/net/virtio

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

2024-05-27 Thread Heng Qi
On Mon, 27 May 2024 12:42:43 +0200, Paolo Abeni wrote: > On Thu, 2024-05-23 at 15:46 +0800, Heng Qi wrote: > > This reverts commit 4d4ac2ececd3c42a08dd32a6e3a4aaf25f7efe44. > > > > When the following snippet is run, lockdep will report a deadlock[1]. > > > >

[PATCH net v2 0/2] virtio_net: fix lock warning and unrecoverable state

2024-05-23 Thread Heng Qi
gelog === v1->v2: Patch(2/2): rephase the commit log. Heng Qi (2): virtio_net: fix possible dim status unrecoverable Revert "virtio_net: Add a lock for per queue RX coalesce" drivers/net/virtio_net.c | 55 ++-- 1 file changed, 13 insertion

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

2024-05-23 Thread Heng Qi
5e/0x160 ? do_user_addr_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") Signed-off-by: Heng Q

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

2024-05-23 Thread Heng Qi
disabled or parameters have not been modified; 3. virtnet_rx_dim_work exits directly; Then, even if net_dim is invoked again, it cannot work because the state is not restored to DIM_START_MEASURE. Fixes: 6208799553a8 ("virtio-net: support rx netdim") Signed-off-by: Heng Qi Reviewe

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

2024-05-22 Thread Heng Qi
On Wed, 22 May 2024 05:44:43 -0400, "Michael S. Tsirkin" wrote: > 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

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

2024-05-22 Thread Heng Qi
0 > > genl_family_rcv_msg_doit+0xdc/0x130 > > genl_family_rcv_msg+0x154/0x230 > > ? __pfx_ethnl_default_set_doit+0x10/0x10 > > genl_rcv_msg+0x4b/0xa0 > > ? __pfx_genl_rcv_msg+0x10/0x10 > > netlink_rcv_skb+0x5a/0x110 > > genl_rcv+0x28/0x40 > > netlink_uni

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

2024-05-21 Thread Heng Qi
disabled or parameters have not been modified; 3. virtnet_rx_dim_work exits directly; Then, even if net_dim is invoked again, it cannot work because the state is not restored to DIM_START_MEASURE. Fixes: 6208799553a8 ("virtio-net: support rx netdim") Signed-off-by: Heng Qi --- d

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

2024-05-21 Thread Heng Qi
1fe/0x210 ? find_held_lock+0x2b/0x80 ? do_user_addr_fault+0x3a2/0x8a0 ? __lock_release+0x5e/0x160 ? do_user_addr_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 Signed-of

[PATCH net 0/2] virtio_net: fix lock warning and unrecoverable state

2024-05-21 Thread Heng Qi
Patch 1 describes and fixes an issue where dim cannot return to normal state in certain scenarios. Patch 2 attempts to resolve lockdep's complaints that holding many nested locks and when there is a maximum number of queues may also be problematic, so try to remove the dim_lock. Heng

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

2024-05-10 Thread Heng Qi
On Thu, 9 May 2024 13:46:15 +0200, Jiri Pirko wrote: > From: Jiri Pirko > > Add support for Byte Queue Limits (BQL). Historically both Jason and Michael have attempted to support BQL for virtio-net, for example: https://lore.kernel.org/netdev/21384cb5-99a6-7431-1039-b356521e1...@redhat.com/

Re: [PATCH net-next 1/3] virtio_net: enable irq for the control vq

2024-05-07 Thread Heng Qi
On Wed, 8 May 2024 10:19:06 +0800, Jason Wang wrote: > On Tue, May 7, 2024 at 2:33 PM Heng Qi wrote: > > > > On Tue, 7 May 2024 14:24:16 +0800, Jason Wang wrote: > > > On Tue, May 7, 2024 at 12:03 PM Heng Qi wrote: > > > > > > > > On Tue, 7 May

Re: [PATCH net-next v2 1/2] virtio_net: introduce ability to get reply info from device

2024-05-07 Thread Heng Qi
On Wed, 8 May 2024 10:20:05 +0800, Jason Wang wrote: > On Tue, May 7, 2024 at 2:56 PM Heng Qi wrote: > > > > On Tue, 7 May 2024 14:24:19 +0800, Jason Wang wrote: > > > On Fri, Apr 26, 2024 at 2:54 PM Heng Qi wrote: > > > > > > > > From: Xuan

Re: [PATCH net-next v2 2/2] virtio_net: get init coalesce value when probe

2024-05-07 Thread Heng Qi
On Wed, 8 May 2024 10:22:04 +0800, Jason Wang wrote: > On Tue, May 7, 2024 at 3:01 PM Heng Qi wrote: > > > > On Tue, 7 May 2024 14:24:12 +0800, Jason Wang wrote: > > > On Fri, Apr 26, 2024 at 2:54 PM Heng Qi wrote: > > > > > > > > Current

Re: [PATCH net-next v2 2/2] virtio_net: get init coalesce value when probe

2024-05-07 Thread Heng Qi
On Tue, 7 May 2024 14:24:12 +0800, Jason Wang wrote: > On Fri, Apr 26, 2024 at 2:54 PM Heng Qi wrote: > > > > Currently, virtio-net lacks a way to obtain the default coalesce > > values of the device during the probe phase. That is, the device > > may have default expe

Re: [PATCH net-next v2 1/2] virtio_net: introduce ability to get reply info from device

2024-05-06 Thread Heng Qi
On Tue, 7 May 2024 14:24:19 +0800, Jason Wang wrote: > On Fri, Apr 26, 2024 at 2:54 PM Heng Qi wrote: > > > > From: Xuan Zhuo > > > > As the spec > > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > > > > B

Re: [PATCH net-next 1/3] virtio_net: enable irq for the control vq

2024-05-06 Thread Heng Qi
On Tue, 7 May 2024 14:24:16 +0800, Jason Wang wrote: > On Tue, May 7, 2024 at 12:03 PM Heng Qi wrote: > > > > On Tue, 7 May 2024 11:15:22 +0800, Jason Wang wrote: > > > On Thu, Apr 25, 2024 at 8:59 PM Heng Qi wrote: > > > > > > > > Con

Re: [PATCH net-next 1/3] virtio_net: enable irq for the control vq

2024-05-06 Thread Heng Qi
On Tue, 7 May 2024 11:15:22 +0800, Jason Wang wrote: > On Thu, Apr 25, 2024 at 8:59 PM Heng Qi wrote: > > > > Control vq polling request results consume more CPU. > > Especially when dim issues more control requests to the device, > > it's beneficial to the

Re: [PATCH net-next v6 0/6] Remove RTNL lock protection of CVQ

2024-05-05 Thread Heng Qi
> addition of dynamic interrupt moderation the control VQ may be used > frequently during normal operation. > > This series removes the RNTL lock dependency by introducing a mutex > to protect the control buffer and writing SGs to the control VQ. > For the series, keep tags: Revie

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

2024-04-30 Thread Heng Qi
On Tue, 23 Apr 2024 06:57:42 +0300, 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 memory are shared between commands, which will allow using a > tighter lock tha

Re: [PATCH net-next v5 0/6] Remove RTNL lock protection of CVQ

2024-04-26 Thread Heng Qi
well. Please taking Paolo's tips into consideration. For the series: Reviewed-by: Heng Qi Tested-by: Heng Qi Thanks! v5: - Changed cvq_lock to a mutex. - Changed dim_lock to mutex, because it's held taking the cvq_lock. - Use spin/mutex_lock/unlock vs g

[PATCH net-next v2 2/2] virtio_net: get init coalesce value when probe

2024-04-25 Thread Heng Qi
_VQ_GET to complete the goal. Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 68 +++- 1 file changed, 61 insertions(+), 7 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 3bc9b1e621db..fe0c15819dd3 100644 --- a/drivers/net/vi

[PATCH net-next v2 1/2] virtio_net: introduce ability to get reply info from device

2024-04-25 Thread Heng Qi
From: Xuan Zhuo As the spec https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 Based on the description provided in the above specification, we have enabled the virtio-net driver to support acquiring some response information from the device via the CVQ (Co

[PATCH net-next v2 0/2] virtio_net: support getting initial value of irq coalesce

2024-04-25 Thread Heng Qi
Patch 1 from Xuan: the virtnet cvq supports to get result from the device. Patch 2 reuses the VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET cmd to get init coalesce value. Changelog == v1->v2: - Update patch1's commit log. Heng Qi (1): virtio_net: get init coalesce value when probe Xuan

Re: [PATCH net-next 2/3] virtio_net: fix possible dim status unrecoverable

2024-04-25 Thread Heng Qi
在 2024/4/26 上午10:21, Jakub Kicinski 写道: On Thu, 25 Apr 2024 20:58:54 +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

[PATCH net-next 3/3] virtio_net: improve dim command request efficiency

2024-04-25 Thread Heng Qi
mands. Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 229 +++ 1 file changed, 209 insertions(+), 20 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 8f05bcf1d37d..6cd72c0119e6 100644 --- a/drivers/net/virtio_net.c +++ b/dr

[PATCH net-next 0/3] virtio_net: enable the irq for ctrlq

2024-04-25 Thread Heng Qi
/ , so patchwork may cause warnings. Heng Qi (3): virtio_net: enable irq for the control vq virtio_net: fix possible dim status unrecoverable virtio_net: improve dim command request efficiency drivers/net/virtio_net.c | 268 +++ 1 file changed, 240

[PATCH net-next 1/3] virtio_net: enable irq for the control vq

2024-04-25 Thread Heng Qi
Control vq polling request results consume more CPU. Especially when dim issues more control requests to the device, it's beneficial to the guest to enable control vq's irq. Suggested-by: Jason Wang Signed-off-by: Heng Qi --- drivers/net/virtio_

[PATCH net-next 2/3] virtio_net: fix possible dim status unrecoverable

2024-04-25 Thread Heng Qi
disabled or parameters have not been modified; 3. virtnet_rx_dim_work exits directly; Then, even if net_dim is invoked again, it cannot work because the state is not restored to DIM_START_MEASURE. Fixes: 6208799553a8 ("virtio-net: support rx netdim") Signed-off-by: Heng Qi --- d

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

2024-04-24 Thread Heng Qi
在 2024/4/23 上午4:55, Michael S. Tsirkin 写道: On Mon, Apr 15, 2024 at 09:38:03PM +0800, Heng Qi wrote: The NetDIM library provides excellent acceleration for many modern network cards. However, the default profiles of DIM limits its maximum capabilities for different NICs, so providing a way

Re: [PATCH net-next 1/2] virtio_net: virtnet_send_command supports command-specific-result

2024-04-23 Thread Heng Qi
在 2024/4/23 下午6:17, Jiri Pirko 写道: Tue, Apr 23, 2024 at 10:42:25AM CEST, hen...@linux.alibaba.com wrote: From: Xuan Zhuo As the spec https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 The virtnet cvq supports to get result from the device. Is this a

[PATCH net-next 2/2] virtio_net: get init coalesce value when probe

2024-04-23 Thread Heng Qi
_VQ_GET to complete the goal. Signed-off-by: Heng Qi --- drivers/net/virtio_net.c | 68 +++- 1 file changed, 61 insertions(+), 7 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 3bc9b1e621db..fe0c15819dd3 100644 --- a/drivers/net/vi

[PATCH net-next 1/2] virtio_net: virtnet_send_command supports command-specific-result

2024-04-23 Thread Heng Qi
From: Xuan Zhuo As the spec https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 The virtnet cvq supports to get result from the device. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 24 +--- 1 file changed, 17 insertions(+),

[PATCH net-next 0/2] virtio_net: support getting initial value of irq coalesce

2024-04-23 Thread Heng Qi
Patch 1 from Xuan: the virtnet cvq supports to get result from the device. Patch 2 reuses the VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET cmd to get init coalesce value. Heng Qi (1): virtio_net: get init coalesce value when probe Xuan Zhuo (1): virtio_net: virtnet_send_command supports command

Re: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-18 Thread Heng Qi
在 2024/4/18 下午11:48, Paolo Abeni 写道: On Thu, 2024-04-18 at 15:38 +, Dan Jurgens wrote: From: Paolo Abeni Sent: Thursday, April 18, 2024 5:57 AM On Thu, 2024-04-18 at 15:36 +0800, Heng Qi wrote: 在 2024/4/18 下午2:42, Jason Wang 写道: On Wed, Apr 17, 2024 at 3:31 AM Daniel Jurgens wrote

Re: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-18 Thread Heng Qi
I didn't see any warnings with GCC or clang. This is used other places in the kernel as well. gcc version 13.2.1 20230918 (Red Hat 13.2.1-3) (GCC) clang version 17.0.6 (Fedora 17.0.6-2.fc39) I think Paolo is suggesting this[1][2], guard will mess with the sparse check and cause a warning: [

Re: [PATCH net-next v4 3/6] virtio_net: Add a lock for the command VQ.

2024-04-18 Thread Heng Qi
在 2024/4/18 下午2:42, Jason Wang 写道: On Wed, Apr 17, 2024 at 3:31 AM Daniel Jurgens wrote: The command VQ will no longer be protected by the RTNL lock. Use a spinlock to protect the control buffer header and the VQ. Signed-off-by: Daniel Jurgens Reviewed-by: Jiri Pirko --- drivers/net/vir

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

2024-04-17 Thread Heng Qi
在 2024/4/17 下午2:52, Jason Xing 写道: On Wed, Apr 17, 2024 at 2:35 PM Heng Qi wrote: 在 2024/4/17 上午10:53, Jason Xing 写道: Hello Jakub, On Wed, Apr 17, 2024 at 10:30 AM Jakub Kicinski wrote: On Wed, 17 Apr 2024 10:22:52 +0800 Heng Qi wrote: Have you encountered compilation problems in v8

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

2024-04-16 Thread Heng Qi
在 2024/4/17 上午10:53, Jason Xing 写道: Hello Jakub, On Wed, Apr 17, 2024 at 10:30 AM Jakub Kicinski wrote: On Wed, 17 Apr 2024 10:22:52 +0800 Heng Qi wrote: Have you encountered compilation problems in v8? Yes, please try building allmodconfig: make allmodconfig make .. there's

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

2024-04-16 Thread Heng Qi
在 2024/4/17 上午8:38, Jakub Kicinski 写道: On Tue, 16 Apr 2024 20:29:46 +0800 Heng Qi wrote: Please review, thank you very much! Please stop posting code which does not compile. The mailing list is for reviewing code, not build testing it. Sorry, three versions v7, RESEND v7, v8 in two days

[PATCH net-next v8 1/4] linux/dim: move useful macros to .h file

2024-04-16 Thread Heng Qi
These will be used in subsequent patches, including newly declared profile arrays. Signed-off-by: Heng Qi --- include/linux/dim.h | 13 + lib/dim/net_dim.c | 10 ++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/include/linux/dim.h b/include/linux/dim.h

  1   2   3   >