[PATCH net-next v7 3/4] virtio-net: extract virtqueue coalescig cmd for reuse

2023-12-06 Thread Heng Qi
Extract commands to set virtqueue coalescing parameters for reuse by ethtool -Q, vq resize and netdim. Signed-off-by: Heng Qi Acked-by: Jason Wang --- drivers/net/virtio_net.c | 106 +++ 1 file changed, 64 insertions(+), 42 deletions(-) diff --git a/drivers/

[PATCH net-next v7 4/4] virtio-net: support rx netdim

2023-12-06 Thread Heng Qi
By comparing the traffic information in the complete napi processes, let the virtio-net driver automatically adjust the coalescing moderation parameters of each receive queue. Signed-off-by: Heng Qi --- v6->v7: - Drop the patch titled "spin lock for ctrl cmd access" - Use rtnl_trylock to avoid th

[PATCH net-next v7 0/4] virtio-net: support dynamic coalescing moderation

2023-12-06 Thread Heng Qi
Now, virtio-net already supports per-queue moderation parameter setting. Based on this, we use the linux dimlib to support dynamic coalescing moderation for virtio-net. Due to some scheduling issues, we only support and test the rx dim. Some test results: I. Sockperf UDP

[PATCH net-next v7 2/4] virtio-net: separate rx/tx coalescing moderation cmds

2023-12-06 Thread Heng Qi
This patch separates the rx and tx global coalescing moderation commands to support netdim switches in subsequent patches. Signed-off-by: Heng Qi Acked-by: Jason Wang --- drivers/net/virtio_net.c | 31 --- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git

[PATCH net-next v7 1/4] virtio-net: returns whether napi is complete

2023-12-06 Thread Heng Qi
rx netdim needs to count the traffic during a complete napi process, and start updating and comparing samples to make decisions after the napi ends. Let virtqueue_napi_complete() return true if napi is done, otherwise vice versa. Signed-off-by: Heng Qi Acked-by: Jason Wang --- drivers/net/virti

Re: [PATCH net-next v6 4/5] virtio-net: add spin lock for ctrl cmd access

2023-12-06 Thread Jason Wang
On Thu, Dec 7, 2023 at 12:47 PM Heng Qi wrote: > > > > 在 2023/12/7 下午12:19, Jason Wang 写道: > > On Wed, Dec 6, 2023 at 9:03 PM Heng Qi wrote: > >> > >> > >> 在 2023/12/6 下午8:27, Paolo Abeni 写道: > >>> On Tue, 2023-12-05 at 19:05 +0800, Heng Qi wrote: > 在 2023/12/5 下午4:35, Jason Wang 写道: > >

Re: [PATCH net-next v6 4/5] virtio-net: add spin lock for ctrl cmd access

2023-12-06 Thread Heng Qi
在 2023/12/7 下午12:19, Jason Wang 写道: On Wed, Dec 6, 2023 at 9:03 PM Heng Qi wrote: 在 2023/12/6 下午8:27, Paolo Abeni 写道: On Tue, 2023-12-05 at 19:05 +0800, Heng Qi wrote: 在 2023/12/5 下午4:35, Jason Wang 写道: On Tue, Dec 5, 2023 at 4:02 PM Heng Qi wrote: Currently access to ctrl cmd is glob

Re: [PATCH net-next v6 4/5] virtio-net: add spin lock for ctrl cmd access

2023-12-06 Thread Jason Wang
On Wed, Dec 6, 2023 at 9:03 PM Heng Qi wrote: > > > > 在 2023/12/6 下午8:27, Paolo Abeni 写道: > > On Tue, 2023-12-05 at 19:05 +0800, Heng Qi wrote: > >> 在 2023/12/5 下午4:35, Jason Wang 写道: > >>> On Tue, Dec 5, 2023 at 4:02 PM Heng Qi wrote: > Currently access to ctrl cmd is globally protected via

Re: [PATCH net-next v6 4/5] virtio-net: add spin lock for ctrl cmd access

2023-12-06 Thread Heng Qi
在 2023/12/6 下午8:27, Paolo Abeni 写道: On Tue, 2023-12-05 at 19:05 +0800, Heng Qi wrote: 在 2023/12/5 下午4:35, Jason Wang 写道: On Tue, Dec 5, 2023 at 4:02 PM Heng Qi wrote: Currently access to ctrl cmd is globally protected via rtnl_lock and works fine. But if dim work's access to ctrl cmd also

Re: [PATCH net-next v6 4/5] virtio-net: add spin lock for ctrl cmd access

2023-12-06 Thread Paolo Abeni
On Tue, 2023-12-05 at 19:05 +0800, Heng Qi wrote: > > 在 2023/12/5 下午4:35, Jason Wang 写道: > > On Tue, Dec 5, 2023 at 4:02 PM Heng Qi wrote: > > > Currently access to ctrl cmd is globally protected via rtnl_lock and works > > > fine. But if dim work's access to ctrl cmd also holds rtnl_lock, deadlo

Re: [PATCH net-next v6 4/5] virtio-net: add spin lock for ctrl cmd access

2023-12-06 Thread Jason Wang
On Tue, Dec 5, 2023 at 7:06 PM Heng Qi wrote: > > > > 在 2023/12/5 下午4:35, Jason Wang 写道: > > On Tue, Dec 5, 2023 at 4:02 PM Heng Qi wrote: > >> Currently access to ctrl cmd is globally protected via rtnl_lock and works > >> fine. But if dim work's access to ctrl cmd also holds rtnl_lock, deadlock