On Wed, 30 Apr 2025 01:29:06 -0400 Michael S. Tsirkin wrote:
> > > @@ -3728,7 +3731,7 @@ static int virtnet_set_queues(struct virtnet_info 
> > > *vi, u16 queue_pairs)
> > >  succ:
> > >         vi->curr_queue_pairs = queue_pairs;
> > >         /* virtnet_open() will refill when device is going to up. */
> > > -       if (dev->flags & IFF_UP)
> > > +       if (dev->flags & IFF_UP && vi->refill_enabled)
> > >                 schedule_delayed_work(&vi->refill, 0);  
> > 
> > This has the assumption that the toggle of the refill_enabled is under
> > RTNL.

Yes, this line of code must be under rtnl_lock to be correct, since 
it is also checking flags & IFF_UP. I was thinking of moving it to
virtnet_restore(), AFAIU that's the only place that needs it.
But that's more of a -next change.

> > Though it's true now but it looks to me it's better to protect
> > it against refill_lock.
> 
> Good point.

Sure. I'll wrap the check and the call to schedule_.. with the lock.

Reply via email to