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

2024-06-20 Thread Li,Rongqing
> Did you by any chance use an automated tool of any sort to find this issue or > generate the fix? > > I don't think this is actually necessary here, you're in the same context as > the > updater of the stats, you don't need any protection. > You can remove u64_stats_update_begin() / end() (in n

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] virtio_net: Use u64_stats_fetch_begin() for stats fetch

2024-06-20 Thread Jakub Kicinski
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") > Signed-off-by: Li RongQing > --- > drivers/net/virtio_net.c | 14 -

Re: [PATCH net-next v6 09/10] virtio_net: xsk: rx: support recv merge mode

2024-06-20 Thread Xuan Zhuo
On Thu, 20 Jun 2024 12:37:43 +0200, Paolo Abeni wrote: > On Tue, 2024-06-18 at 15:56 +0800, Xuan Zhuo wrote: > > Support AF-XDP for merge mode. > > > > Signed-off-by: Xuan Zhuo > > --- > > drivers/net/virtio_net.c | 139 +++ > > 1 file changed, 139 insertions(

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

2024-06-20 Thread Xuan Zhuo
On Thu, 20 Jun 2024 12:46:24 +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 changed,

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 net-next v6 10/10] virtio_net: xsk: rx: free the unused xsk buffer

2024-06-20 Thread Paolo Abeni
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 changed, 5 insertions(+) > > diff --git a/drivers/net/virtio_net.c b/drivers/ne

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: > > > > On Thu, 20 Jun 2024 16:33:35 +0800, Jason W

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: > > > > On Tue, Jun 18, 2024 at 11:17 AM Heng Qi

Re: [PATCH net-next v6 09/10] virtio_net: xsk: rx: support recv merge mode

2024-06-20 Thread Paolo Abeni
On Tue, 2024-06-18 at 15:56 +0800, Xuan Zhuo wrote: > Support AF-XDP for merge mode. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio_net.c | 139 +++ > 1 file changed, 139 insertions(+) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_ne

Re: [PATCH net-next v6 07/10] virtio_net: xsk: rx: support fill with xsk buffer

2024-06-20 Thread Xuan Zhuo
On Thu, 20 Jun 2024 12:20:44 +0200, Paolo Abeni wrote: > Hi, > > On Tue, 2024-06-18 at 15:56 +0800, Xuan Zhuo wrote: > > @@ -1032,6 +1034,53 @@ static void check_sq_full_and_disable(struct > > virtnet_info *vi, > > } > > } > > > > +static void sg_fill_dma(struct scatterlist *sg, dma_addr_t a

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 > > > wrote: > > > > On Thu, Jun 20, 2024 at 4:

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: > > > > > > > > On Tue, 18 Jun 2024 11:10:26 +0800, Jason Wa

Re: [PATCH net-next v6 07/10] virtio_net: xsk: rx: support fill with xsk buffer

2024-06-20 Thread Paolo Abeni
Hi, On Tue, 2024-06-18 at 15:56 +0800, Xuan Zhuo wrote: > @@ -1032,6 +1034,53 @@ static void check_sq_full_and_disable(struct > virtnet_info *vi, > } > } > > +static void sg_fill_dma(struct scatterlist *sg, dma_addr_t addr, u32 len) > +{ > + sg->dma_address = addr; > + sg->length

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 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: > > > > > > > > On Thu, Jun 20, 2024 at 3:35 PM Heng Qi

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: > > > > > > > > On Wed, 19 Jun 2024 17:19:12 -0400, "Michael S. Tsirki

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" > > > wrote: > > > > On Thu, Jun 20, 2024 at 1

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

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 wrote: > > > > @@ -5312,7 +5315,7 @@ static

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: > > > > > > > > The XDP program can't correctly handle partially checksummed

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

2024-06-20 Thread Jason Wang
On Thu, Jun 20, 2024 at 4:32 PM 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 wrote: > > > > @@ -5312,7 +5315,7 @@ static int v

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

2024-06-20 Thread Jason Wang
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: > > > > > > The XDP program can't correctly handle partially checksummed > > > packets, but works fine with fully checksummed packets. > >

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) > > > > > > /* Parameters

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

2024-06-20 Thread Jason Wang
On Wed, Jun 19, 2024 at 11:44 PM Heng Qi wrote: > > > 在 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 it

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

2024-06-20 Thread Jason Wang
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" > > wrote: > > > On Thu, Jun 20, 2024 at 12:19:05AM +0800, Heng Qi wrote: > > > > @@ -5312,7 +5315,7 @@ static int virtnet_find_v

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

2024-06-20 Thread Jason Wang
On Thu, Jun 20, 2024 at 3:35 PM 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) > > > > > > /* Parameters for con

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

2024-06-20 Thread Michael S. Tsirkin
On Wed, Jun 19, 2024 at 12:09:45PM +0200, Jiri Pirko wrote: > Wed, Jun 19, 2024 at 10:23:25AM CEST, m...@redhat.com wrote: > >On Wed, Jun 19, 2024 at 10:05:41AM +0200, Jiri Pirko wrote: > >> >Oh. Right of course. Worth a comment maybe? Just to make sure > >> >we remember not to call __free_old_xmit

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 any */ > > if (vi->has_cvq) { > > -

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 > > alleviates this problem and allows com