Re: [PATCH net-next v2 17/21] virtio_net: xsk: rx: skip dma unmap when rq is bind with AF_XDP

2023-11-09 Thread Xuan Zhuo
On Fri, 10 Nov 2023 00:33:27 -0500, "Michael S. Tsirkin" wrote: > On Fri, Nov 10, 2023 at 09:47:16AM +0800, Xuan Zhuo wrote: > > On Thu, 9 Nov 2023 07:00:51 -0500, "Michael S. Tsirkin" > > wrote: > > > On Thu, Nov 09, 2023 at 07:10:02PM +0800, Xuan Zhuo wrote: > > > > On Thu, 9 Nov 2023 03:15:0

Re: [PATCH net-next v2 14/21] virtio_net: xsk: tx: virtnet_free_old_xmit() distinguishes xsk buffer

2023-11-09 Thread Xuan Zhuo
On Fri, 10 Nov 2023 00:32:50 -0500, "Michael S. Tsirkin" wrote: > On Fri, Nov 10, 2023 at 09:44:32AM +0800, Xuan Zhuo wrote: > > On Thu, 9 Nov 2023 06:59:48 -0500, "Michael S. Tsirkin" > > wrote: > > > On Thu, Nov 09, 2023 at 07:16:08PM +0800, Xuan Zhuo wrote: > > > > On Thu, 9 Nov 2023 06:11:4

Re: [PATCH net] virtio_net: fix missing dma unmap for resize

2023-11-09 Thread Xuan Zhuo
On Fri, 10 Nov 2023 00:37:32 -0500, "Michael S. Tsirkin" wrote: > On Fri, Nov 10, 2023 at 09:58:45AM +0800, Xuan Zhuo wrote: > > On Thu, 9 Nov 2023 07:06:16 -0500, "Michael S. Tsirkin" > > wrote: > > > On Mon, Nov 06, 2023 at 04:18:32PM +0800, Xuan Zhuo wrote: > > > > For rq, we have three case

Re: [PATCH net] virtio_net: fix missing dma unmap for resize

2023-11-09 Thread Michael S. Tsirkin
On Fri, Nov 10, 2023 at 09:58:45AM +0800, Xuan Zhuo wrote: > On Thu, 9 Nov 2023 07:06:16 -0500, "Michael S. Tsirkin" > wrote: > > On Mon, Nov 06, 2023 at 04:18:32PM +0800, Xuan Zhuo wrote: > > > For rq, we have three cases getting buffers from virtio core: > > > > > > 1. virtqueue_get_buf{,_ctx}

Re: [PATCH net-next v2 17/21] virtio_net: xsk: rx: skip dma unmap when rq is bind with AF_XDP

2023-11-09 Thread Michael S. Tsirkin
On Fri, Nov 10, 2023 at 09:47:16AM +0800, Xuan Zhuo wrote: > On Thu, 9 Nov 2023 07:00:51 -0500, "Michael S. Tsirkin" > wrote: > > On Thu, Nov 09, 2023 at 07:10:02PM +0800, Xuan Zhuo wrote: > > > On Thu, 9 Nov 2023 03:15:03 -0500, "Michael S. Tsirkin" > > > wrote: > > > > On Tue, Nov 07, 2023 at

Re: [PATCH net-next v2 14/21] virtio_net: xsk: tx: virtnet_free_old_xmit() distinguishes xsk buffer

2023-11-09 Thread Michael S. Tsirkin
On Fri, Nov 10, 2023 at 09:44:32AM +0800, Xuan Zhuo wrote: > On Thu, 9 Nov 2023 06:59:48 -0500, "Michael S. Tsirkin" > wrote: > > On Thu, Nov 09, 2023 at 07:16:08PM +0800, Xuan Zhuo wrote: > > > On Thu, 9 Nov 2023 06:11:49 -0500, "Michael S. Tsirkin" > > > wrote: > > > > On Tue, Nov 07, 2023 at

Re: [PATCH net-next v2 16/21] virtio_net: xsk: rx: introduce add_recvbuf_xsk()

2023-11-09 Thread Xuan Zhuo
On Thu, 9 Nov 2023 03:12:27 -0500, "Michael S. Tsirkin" wrote: > On Tue, Nov 07, 2023 at 11:12:22AM +0800, Xuan Zhuo wrote: > > Implement the logic of filling rq with XSK buffers. > > > > Signed-off-by: Xuan Zhuo > > --- > > drivers/net/virtio/main.c | 4 ++- > > drivers/net/virtio/virtio

Re: [PATCH net-next v2 16/21] virtio_net: xsk: rx: introduce add_recvbuf_xsk()

2023-11-09 Thread Xuan Zhuo
On Thu, 9 Nov 2023 17:26:33 +0100, Maciej Fijalkowski wrote: > On Thu, Nov 09, 2023 at 07:11:46PM +0800, Xuan Zhuo wrote: > > On Thu, 9 Nov 2023 03:12:27 -0500, "Michael S. Tsirkin" > > wrote: > > > On Tue, Nov 07, 2023 at 11:12:22AM +0800, Xuan Zhuo wrote: > > > > Implement the logic of fillin

Re: [PATCH net] virtio_net: fix missing dma unmap for resize

2023-11-09 Thread Xuan Zhuo
On Thu, 9 Nov 2023 07:06:16 -0500, "Michael S. Tsirkin" wrote: > On Mon, Nov 06, 2023 at 04:18:32PM +0800, Xuan Zhuo wrote: > > For rq, we have three cases getting buffers from virtio core: > > > > 1. virtqueue_get_buf{,_ctx} > > 2. virtqueue_detach_unused_buf > > 3. callback for virtqueue_resize

Re: [PATCH net-next v2 12/21] virtio_net: xsk: tx: support tx

2023-11-09 Thread Xuan Zhuo
On Thu, 9 Nov 2023 06:58:48 -0500, "Michael S. Tsirkin" wrote: > On Thu, Nov 09, 2023 at 07:06:23PM +0800, Xuan Zhuo wrote: > > On Thu, 9 Nov 2023 03:09:00 -0500, "Michael S. Tsirkin" > > wrote: > > > On Tue, Nov 07, 2023 at 11:12:18AM +0800, Xuan Zhuo wrote: > > > > The driver's tx napi is very

Re: [PATCH net-next v2 17/21] virtio_net: xsk: rx: skip dma unmap when rq is bind with AF_XDP

2023-11-09 Thread Xuan Zhuo
On Thu, 9 Nov 2023 07:00:51 -0500, "Michael S. Tsirkin" wrote: > On Thu, Nov 09, 2023 at 07:10:02PM +0800, Xuan Zhuo wrote: > > On Thu, 9 Nov 2023 03:15:03 -0500, "Michael S. Tsirkin" > > wrote: > > > On Tue, Nov 07, 2023 at 11:12:23AM +0800, Xuan Zhuo wrote: > > > > When rq is bound with AF_XDP

Re: [PATCH net-next v2 14/21] virtio_net: xsk: tx: virtnet_free_old_xmit() distinguishes xsk buffer

2023-11-09 Thread Xuan Zhuo
On Thu, 9 Nov 2023 06:59:48 -0500, "Michael S. Tsirkin" wrote: > On Thu, Nov 09, 2023 at 07:16:08PM +0800, Xuan Zhuo wrote: > > On Thu, 9 Nov 2023 06:11:49 -0500, "Michael S. Tsirkin" > > wrote: > > > On Tue, Nov 07, 2023 at 11:12:20AM +0800, Xuan Zhuo wrote: > > > > virtnet_free_old_xmit distin

Re: [PATCH net-next v2 16/21] virtio_net: xsk: rx: introduce add_recvbuf_xsk()

2023-11-09 Thread Maciej Fijalkowski
On Thu, Nov 09, 2023 at 07:11:46PM +0800, Xuan Zhuo wrote: > On Thu, 9 Nov 2023 03:12:27 -0500, "Michael S. Tsirkin" > wrote: > > On Tue, Nov 07, 2023 at 11:12:22AM +0800, Xuan Zhuo wrote: > > > Implement the logic of filling rq with XSK buffers. > > > > > > Signed-off-by: Xuan Zhuo > > > --- >

Re: [PATCH net] virtio_net: fix missing dma unmap for resize

2023-11-09 Thread Michael S. Tsirkin
On Mon, Nov 06, 2023 at 04:18:32PM +0800, Xuan Zhuo wrote: > For rq, we have three cases getting buffers from virtio core: > > 1. virtqueue_get_buf{,_ctx} > 2. virtqueue_detach_unused_buf > 3. callback for virtqueue_resize > > But in commit 295525e29a5b("virtio_net: merge dma operations when > fi

Re: [PATCH net-next v2 17/21] virtio_net: xsk: rx: skip dma unmap when rq is bind with AF_XDP

2023-11-09 Thread Michael S. Tsirkin
On Thu, Nov 09, 2023 at 07:10:02PM +0800, Xuan Zhuo wrote: > On Thu, 9 Nov 2023 03:15:03 -0500, "Michael S. Tsirkin" > wrote: > > On Tue, Nov 07, 2023 at 11:12:23AM +0800, Xuan Zhuo wrote: > > > When rq is bound with AF_XDP, the buffer dma is managed > > > by the AF_XDP APIs. So the buffer got fr

Re: [PATCH net-next v2 14/21] virtio_net: xsk: tx: virtnet_free_old_xmit() distinguishes xsk buffer

2023-11-09 Thread Michael S. Tsirkin
On Thu, Nov 09, 2023 at 07:16:08PM +0800, Xuan Zhuo wrote: > On Thu, 9 Nov 2023 06:11:49 -0500, "Michael S. Tsirkin" > wrote: > > On Tue, Nov 07, 2023 at 11:12:20AM +0800, Xuan Zhuo wrote: > > > virtnet_free_old_xmit distinguishes three type ptr(skb, xdp frame, xsk > > > buffer) by the last bits

Re: [PATCH net-next v2 12/21] virtio_net: xsk: tx: support tx

2023-11-09 Thread Michael S. Tsirkin
On Thu, Nov 09, 2023 at 07:06:23PM +0800, Xuan Zhuo wrote: > On Thu, 9 Nov 2023 03:09:00 -0500, "Michael S. Tsirkin" > wrote: > > On Tue, Nov 07, 2023 at 11:12:18AM +0800, Xuan Zhuo wrote: > > > The driver's tx napi is very important for XSK. It is responsible for > > > obtaining data from the XS

Re: [PATCH net] virtio_net: fix missing dma unmap for resize

2023-11-09 Thread Paolo Abeni
On Mon, 2023-11-06 at 16:18 +0800, Xuan Zhuo wrote: > For rq, we have three cases getting buffers from virtio core: > > 1. virtqueue_get_buf{,_ctx} > 2. virtqueue_detach_unused_buf > 3. callback for virtqueue_resize > > But in commit 295525e29a5b("virtio_net: merge dma operations when > filling m

Re: [PATCH net-next v2 14/21] virtio_net: xsk: tx: virtnet_free_old_xmit() distinguishes xsk buffer

2023-11-09 Thread Xuan Zhuo
On Thu, 9 Nov 2023 06:11:49 -0500, "Michael S. Tsirkin" wrote: > On Tue, Nov 07, 2023 at 11:12:20AM +0800, Xuan Zhuo wrote: > > virtnet_free_old_xmit distinguishes three type ptr(skb, xdp frame, xsk > > buffer) by the last bits of the pointer. > > > > Signed-off-by: Xuan Zhuo > > --- > > drivers

Re: [PATCH net-next v2 16/21] virtio_net: xsk: rx: introduce add_recvbuf_xsk()

2023-11-09 Thread Xuan Zhuo
On Thu, 9 Nov 2023 03:12:27 -0500, "Michael S. Tsirkin" wrote: > On Tue, Nov 07, 2023 at 11:12:22AM +0800, Xuan Zhuo wrote: > > Implement the logic of filling rq with XSK buffers. > > > > Signed-off-by: Xuan Zhuo > > --- > > drivers/net/virtio/main.c | 4 ++- > > drivers/net/virtio/virtio

Re: [PATCH net-next v2 14/21] virtio_net: xsk: tx: virtnet_free_old_xmit() distinguishes xsk buffer

2023-11-09 Thread Michael S. Tsirkin
On Tue, Nov 07, 2023 at 11:12:20AM +0800, Xuan Zhuo wrote: > virtnet_free_old_xmit distinguishes three type ptr(skb, xdp frame, xsk > buffer) by the last bits of the pointer. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio/virtio_net.h | 18 -- > drivers/net/virtio/xsk.h

Re: [PATCH net-next v2 17/21] virtio_net: xsk: rx: skip dma unmap when rq is bind with AF_XDP

2023-11-09 Thread Xuan Zhuo
On Thu, 9 Nov 2023 03:15:03 -0500, "Michael S. Tsirkin" wrote: > On Tue, Nov 07, 2023 at 11:12:23AM +0800, Xuan Zhuo wrote: > > When rq is bound with AF_XDP, the buffer dma is managed > > by the AF_XDP APIs. So the buffer got from the virtio core should > > skip the dma unmap operation. > > > > Si

Re: [PATCH net-next v2 12/21] virtio_net: xsk: tx: support tx

2023-11-09 Thread Xuan Zhuo
On Thu, 9 Nov 2023 03:09:00 -0500, "Michael S. Tsirkin" wrote: > On Tue, Nov 07, 2023 at 11:12:18AM +0800, Xuan Zhuo wrote: > > The driver's tx napi is very important for XSK. It is responsible for > > obtaining data from the XSK queue and sending it out. > > > > At the beginning, we need to trigg

Re: [PATCH net-next v2 08/21] virtio_net: sq support premapped mode

2023-11-09 Thread Xuan Zhuo
On Thu, 9 Nov 2023 14:37:38 +0800, Jason Wang wrote: > On Tue, Nov 7, 2023 at 11:12 AM 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. > >

Re: [PATCH net-next v2 00/21] virtio-net: support AF_XDP zero copy

2023-11-09 Thread Xuan Zhuo
On Thu, 9 Nov 2023 03:19:04 -0500, "Michael S. Tsirkin" wrote: > On Tue, Nov 07, 2023 at 11:12:06AM +0800, Xuan Zhuo wrote: > > ## AF_XDP > > > > XDP socket(AF_XDP) is an excellent bypass kernel network framework. The zero > > copy feature of xsk (XDP socket) needs to be supported by the driver. T

Re: [PATCH net-next v2 5/5] virtio-net: return -EOPNOTSUPP for adaptive-tx

2023-11-09 Thread Heng Qi
在 2023/11/9 下午12:45, Jason Wang 写道: On Thu, Nov 2, 2023 at 9:10 PM Heng Qi wrote: We do not currently support tx dim, so respond to -EOPNOTSUPP. Signed-off-by: Heng Qi --- v1->v2: - Use -EOPNOTSUPP instead of specific implementation. drivers/net/virtio_net.c | 29 +++

Re: [PATCH net-next v2 4/5] virtio-net: support rx netdim

2023-11-09 Thread Heng Qi
在 2023/11/9 下午12:43, Jason Wang 写道: On Thu, Nov 2, 2023 at 9:10 PM Heng Qi wrote: 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 --- v1->v

Re: [PATCH net-next v2 00/21] virtio-net: support AF_XDP zero copy

2023-11-09 Thread Michael S. Tsirkin
On Tue, Nov 07, 2023 at 11:12:06AM +0800, Xuan Zhuo wrote: > ## AF_XDP > > XDP socket(AF_XDP) is an excellent bypass kernel network framework. The zero > copy feature of xsk (XDP socket) needs to be supported by the driver. The > performance of zero copy is very good. mlx5 and intel ixgbe already

Re: [PATCH net-next v2 17/21] virtio_net: xsk: rx: skip dma unmap when rq is bind with AF_XDP

2023-11-09 Thread Michael S. Tsirkin
On Tue, Nov 07, 2023 at 11:12:23AM +0800, Xuan Zhuo wrote: > When rq is bound with AF_XDP, the buffer dma is managed > by the AF_XDP APIs. So the buffer got from the virtio core should > skip the dma unmap operation. > > Signed-off-by: Xuan Zhuo I don't get it - is this like a bugfix? And why d

Re: [PATCH net-next v2 16/21] virtio_net: xsk: rx: introduce add_recvbuf_xsk()

2023-11-09 Thread Michael S. Tsirkin
On Tue, Nov 07, 2023 at 11:12:22AM +0800, Xuan Zhuo wrote: > Implement the logic of filling rq with XSK buffers. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio/main.c | 4 ++- > drivers/net/virtio/virtio_net.h | 5 > drivers/net/virtio/xsk.c| 49

Re: [PATCH net-next v2 12/21] virtio_net: xsk: tx: support tx

2023-11-09 Thread Michael S. Tsirkin
On Tue, Nov 07, 2023 at 11:12:18AM +0800, Xuan Zhuo wrote: > The driver's tx napi is very important for XSK. It is responsible for > obtaining data from the XSK queue and sending it out. > > At the beginning, we need to trigger tx napi. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio/ma