[PATCH net-next v4 4/4] virtio_net: remove the misleading comment

2024-05-07 Thread Xuan Zhuo
We call the build_skb() actually without copying data. The comment is misleading. So remove it. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/net/virtio_net.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 070a6ed0d812..7

[PATCH net-next v4 3/4] virtio_net: rx remove premapped failover code

2024-05-07 Thread Xuan Zhuo
Now, the premapped mode can be enabled unconditionally. So we can remove the failover code for merge and small mode. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/net/virtio_net.c | 85 +--- 1 file changed, 35 insertions(+), 50 deletions(-) diff

[PATCH net-next v4 2/4] virtio_net: big mode skip the unmap check

2024-05-07 Thread Xuan Zhuo
The virtio-net big mode did not enable premapped mode, so we did not need to check the unmap. And the subsequent commit will remove the failover code for failing enable premapped for merge and small mode. So we need to remove the checking do_dma code in the big mode path. Signed-off-by: Xuan Zhuo

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

2024-05-07 Thread Xuan Zhuo
Now, we have virtio DMA APIs, the driver can be the premapped mode whatever the virtio core uses dma api or not. So remove the limit of checking use_dma_api from virtqueue_set_dma_premapped(). Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 7 +-- 1 file ch

[PATCH net-next v4 0/4] virtio_net: rx enable premapped mode by default

2024-05-07 Thread Xuan Zhuo
Actually, for the virtio drivers, we can enable premapped mode whatever the value of use_dma_api. Because we provide the virtio dma apis. So the driver can enable premapped mode unconditionally. This patch set makes the big mode of virtio-net to support premapped mode. And enable premapped mode fo

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 2024 11:15:22 +0800, Jason Wang > > > > wrote: >

Re: Virtio Net driver crash in latest version of kernel 6.8.4>

2024-05-07 Thread Jason Wang
On Sat, May 4, 2024 at 3:32 PM Martin Zaharinov wrote: > > Hi all > > This is bug report with lastes version of kernel 6.8.4 > start getting this > crash . How did you reproduce this and Could you reproduce this with the latest net.git? (I have a smoking test on net.git and it doesn't seem to tr

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 Zhuo > > > > > > > > As the spec > > > > https://gi

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: > > > > > > > > Currently, virtio-net lacks a way to obtain the default coalesce

[PATCH vhost 5/5] virtio_net: sq support premapped mode

2024-05-07 Thread Xuan Zhuo
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(sq, true) is used to enable premapped mode. In this mode, the dri

[PATCH vhost 4/5] virtio_ring: virtqueue_set_dma_premapped() support to disable

2024-05-07 Thread Xuan Zhuo
virtio-net sq will only enable premapped mode when the sq is bound to the af-xdp. So we need the helper (virtqueue_set_dma_premapped) to enable the premapped mode when af-xdp binds to the sq. And to disable the premapped mode when af-xdp unbinds to the sq. Signed-off-by: Xuan Zhuo --- drivers/n

[PATCH vhost 3/5] virtio_ring: introduce virtqueue_dma_map_sg_attrs

2024-05-07 Thread Xuan Zhuo
Introduce a helper to do dma map for scatterlist. That can be used by other drivers. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 32 include/linux/virtio.h | 3 +++ 2 files changed, 35 insertions(+) diff --git a/drivers/virtio/virtio_ring.

[PATCH vhost 2/5] virtio_ring: introduce dma map api for page

2024-05-07 Thread Xuan Zhuo
The virtio-net sq will use these APIs to map the scatterlist. For scatterlist, the page dma APIs are more appropriate. dma_addr_t virtqueue_dma_map_page_attrs(struct virtqueue *_vq, struct page *page, size_t offset, size_t size,

[PATCH vhost 1/5] virtio_ring: introduce vring_need_unmap_buffer

2024-05-07 Thread Xuan Zhuo
To make the code readable, introduce vring_need_unmap_buffer() to replace do_unmap. use_dma_api premapped -> vring_need_unmap_buffer() 1. false falsefalse 2. truefalsetrue 3. truetrue false Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drive

[PATCH vhost 0/5] virtio_net: introduce api to enable/disable premapped mode for sq

2024-05-07 Thread Xuan Zhuo
As discussed: http://lore.kernel.org/all/cacgkmevq0no8qgc46u4mgsmtud44fd_cflcpavmj3rhyqrz...@mail.gmail.com If virtio is in pre-mapped mode, the driver should manage the DMA info itself. However, due to the indirect feature, the virtio-net driver may need to maintain an excessive amount of DMA i

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

2024-05-07 Thread Jason Wang
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: > > > > > > Currently, virtio-net lacks a way to obtain the default coalesce > > > values of the device during the probe phase. That is, the d

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

2024-05-07 Thread Jason Wang
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 Zhuo > > > > > > As the spec > > > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0

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

2024-05-07 Thread Jason Wang
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 2024 11:15:22 +0800, Jason Wang wrote: > > > > On Thu, Apr 25, 2024 at 8:59 PM Heng Qi > > > > wrote: > > > > > >

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

2024-05-07 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Paolo Abeni : On Fri, 3 May 2024 23:24:39 +0300 you wrote: > Currently the buffer used for control VQ commands is protected by the > RTNL lock. Previously this wasn't a major concern because the control VQ > was only used during devi

Re: [PATCH net-next v2 2/3] vsock/virtio: add SIOCOUTQ support for all virtio based transports

2024-05-07 Thread Stefano Garzarella
On Thu, Apr 11, 2024 at 09:09:49AM GMT, Paolo Abeni wrote: On Mon, 2024-04-08 at 15:37 +0200, Luigi Leonardi wrote: This patch introduce support for stream_bytes_unsent and seqpacket_bytes_unsent ioctl for virtio_transport, vhost_vsock and vsock_loopback. For all transports the unsent bytes cou

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 experience values, but the user