mbox series

[vhost,0/2] virtio_net: fix for stuck when change ring size with dev down

Message ID 20220811080258.79398-1-xuanzhuo@linux.alibaba.com (mailing list archive)
Headers show
Series virtio_net: fix for stuck when change ring size with dev down | expand

Message

Xuan Zhuo Aug. 11, 2022, 8:02 a.m. UTC
When dev is set to DOWN state, napi has been disabled, if we modify the
ring size at this time, we should not call napi_disable() again, which
will cause stuck.

And all operations are under the protection of rtnl_lock, so there is no
need to consider concurrency issues.

PS.
Hi Michael, I don't know which way is more convenient for you, so I split the
commit into two commits, so you can fixup to my previous commit:

    virtio_net: support tx queue resize
	virtio_net: support rx queue resize

Xuan Zhuo (2):
  virtio_net: fix for stuck when change rx ring size with dev down
  virtio_net: fix for stuck when change tx ring size with dev down

 drivers/net/virtio_net.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

--
2.31.0

Comments

Michael S. Tsirkin Aug. 11, 2022, 8:11 a.m. UTC | #1
On Thu, Aug 11, 2022 at 04:02:56PM +0800, Xuan Zhuo wrote:
> When dev is set to DOWN state, napi has been disabled, if we modify the
> ring size at this time, we should not call napi_disable() again, which
> will cause stuck.
> 
> And all operations are under the protection of rtnl_lock, so there is no
> need to consider concurrency issues.
> 
> PS.
> Hi Michael, I don't know which way is more convenient for you, so I split the
> commit into two commits, so you can fixup to my previous commit:
> 
>     virtio_net: support tx queue resize
> 	virtio_net: support rx queue resize
> 
> Xuan Zhuo (2):
>   virtio_net: fix for stuck when change rx ring size with dev down
>   virtio_net: fix for stuck when change tx ring size with dev down
> 
>  drivers/net/virtio_net.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)


Which patches does this fix?
Maybe I should squash.

> --
> 2.31.0
Xuan Zhuo Aug. 11, 2022, 8:12 a.m. UTC | #2
On Thu, 11 Aug 2022 04:11:22 -0400, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> On Thu, Aug 11, 2022 at 04:02:56PM +0800, Xuan Zhuo wrote:
> > When dev is set to DOWN state, napi has been disabled, if we modify the
> > ring size at this time, we should not call napi_disable() again, which
> > will cause stuck.
> >
> > And all operations are under the protection of rtnl_lock, so there is no
> > need to consider concurrency issues.
> >
> > PS.
> > Hi Michael, I don't know which way is more convenient for you, so I split the
> > commit into two commits, so you can fixup to my previous commit:
> >
> >     virtio_net: support tx queue resize
> > 	virtio_net: support rx queue resize
> >
> > Xuan Zhuo (2):
> >   virtio_net: fix for stuck when change rx ring size with dev down
> >   virtio_net: fix for stuck when change tx ring size with dev down
> >
> >  drivers/net/virtio_net.c | 14 ++++++++++----
> >  1 file changed, 10 insertions(+), 4 deletions(-)
>
>
> Which patches does this fix?
> Maybe I should squash.

These two:
     virtio_net: support tx queue resize
     virtio_net: support rx queue resize

Thanks.


>
> > --
> > 2.31.0
>
Jakub Kicinski Aug. 11, 2022, 5:37 p.m. UTC | #3
On Thu, 11 Aug 2022 04:11:22 -0400 Michael S. Tsirkin wrote:
> Which patches does this fix?
> Maybe I should squash.

Side question to make sure I understand the terminology - this 
is *not* a vhost patch, right? vhost is the host side of virtio?
Is the work going via the vhost tree because of some dependencies?
Xuan Zhuo Aug. 12, 2022, 1:30 a.m. UTC | #4
On Thu, 11 Aug 2022 10:37:30 -0700, Jakub Kicinski <kuba@kernel.org> wrote:
> On Thu, 11 Aug 2022 04:11:22 -0400 Michael S. Tsirkin wrote:
> > Which patches does this fix?
> > Maybe I should squash.
>
> Side question to make sure I understand the terminology - this
> is *not* a vhost patch, right? vhost is the host side of virtio?
> Is the work going via the vhost tree because of some dependencies?


Yes, the commits fixed by this patch are currently in Michael's vhost branch.

  https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git/log/?h=linux-next

So I mean that by "vhost" here, not into the net/net-next branch. Or should I use
a more accurate term next time?

Thanks.
Jakub Kicinski Aug. 12, 2022, 7:47 p.m. UTC | #5
On Fri, 12 Aug 2022 09:30:38 +0800 Xuan Zhuo wrote:
> Yes, the commits fixed by this patch are currently in Michael's vhost branch.
> 
>   https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git/log/?h=linux-next
> 
> So I mean that by "vhost" here, not into the net/net-next branch. Or should I use
> a more accurate term next time?

The tagging seems good, perhaps add a note to the commit message next
time. Maybe a lore link to the series you are fixing up?
The virtio_net.c patches usually go via netdev AFAIU and we're lacking
the vhost context.