mbox series

[net-next,V6,0/4] virtio-net: synchronize op/admin state

Message ID 20240806022224.71779-1-jasowang@redhat.com (mailing list archive)
Headers show
Series virtio-net: synchronize op/admin state | expand

Message

Jason Wang Aug. 6, 2024, 2:22 a.m. UTC
Hi All:

This series tries to synchronize the operstate with the admin state
which allows the lower virtio-net to propagate the link status to the
upper devices like macvlan.

This is done by toggling carrier during ndo_open/stop while doing
other necessary serialization about the carrier settings during probe.

While at it, also fix a race between probe and ndo_set_features as we
didn't initalize the guest offload setting under rtnl lock.

Changes since V5:

- Fix sevreal typos
- Include a new patch to synchronize probe with ndo_set_features

Changes since V4:

- do not update settings during ndo_open()
- do not try to canel config noticiation during probe() as core make
  sure the config notificaiton won't be triggered before probe is
  done.
- Tweak sevreal comments.

Changes since V3:

- when driver tries to enable config interrupt, check pending
  interrupt and execute the nofitication change callback if necessary
- do not unconditonally trigger the config space read
- do not set LINK_UP flag in ndo_open/close but depends on the
  notification change
- disable config change notification until ndo_open()
- read the link status under the rtnl_lock() to prevent a race with
  ndo_open()

Changes since V2:

- introduce config_driver_disabled and helpers
- schedule config change work unconditionally

Thanks

Jason Wang (4):
  virtio: rename virtio_config_enabled to virtio_config_core_enabled
  virtio: allow driver to disable the configure change notification
  virtio-net: synchronize operstate with admin state on up/down
  virtio-net: synchronize probe with ndo_set_features

 drivers/net/virtio_net.c | 78 +++++++++++++++++++++++++---------------
 drivers/virtio/virtio.c  | 59 +++++++++++++++++++++++-------
 include/linux/virtio.h   | 11 ++++--
 3 files changed, 105 insertions(+), 43 deletions(-)

Comments

Michael S. Tsirkin Aug. 7, 2024, 1:51 p.m. UTC | #1
On Tue, Aug 06, 2024 at 10:22:20AM +0800, Jason Wang wrote:
> Hi All:
> 
> This series tries to synchronize the operstate with the admin state
> which allows the lower virtio-net to propagate the link status to the
> upper devices like macvlan.
> 
> This is done by toggling carrier during ndo_open/stop while doing
> other necessary serialization about the carrier settings during probe.
> 
> While at it, also fix a race between probe and ndo_set_features as we
> didn't initalize the guest offload setting under rtnl lock.


Acked-by: Michael S. Tsirkin <mst@redhat.com>

> Changes since V5:
> 
> - Fix sevreal typos
> - Include a new patch to synchronize probe with ndo_set_features
> 
> Changes since V4:
> 
> - do not update settings during ndo_open()
> - do not try to canel config noticiation during probe() as core make
>   sure the config notificaiton won't be triggered before probe is
>   done.
> - Tweak sevreal comments.
> 
> Changes since V3:
> 
> - when driver tries to enable config interrupt, check pending
>   interrupt and execute the nofitication change callback if necessary
> - do not unconditonally trigger the config space read
> - do not set LINK_UP flag in ndo_open/close but depends on the
>   notification change
> - disable config change notification until ndo_open()
> - read the link status under the rtnl_lock() to prevent a race with
>   ndo_open()
> 
> Changes since V2:
> 
> - introduce config_driver_disabled and helpers
> - schedule config change work unconditionally
> 
> Thanks
> 
> Jason Wang (4):
>   virtio: rename virtio_config_enabled to virtio_config_core_enabled
>   virtio: allow driver to disable the configure change notification
>   virtio-net: synchronize operstate with admin state on up/down
>   virtio-net: synchronize probe with ndo_set_features
> 
>  drivers/net/virtio_net.c | 78 +++++++++++++++++++++++++---------------
>  drivers/virtio/virtio.c  | 59 +++++++++++++++++++++++-------
>  include/linux/virtio.h   | 11 ++++--
>  3 files changed, 105 insertions(+), 43 deletions(-)
> 
> -- 
> 2.31.1
Jason Wang Aug. 13, 2024, 3:43 a.m. UTC | #2
On Wed, Aug 7, 2024 at 9:51 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Tue, Aug 06, 2024 at 10:22:20AM +0800, Jason Wang wrote:
> > Hi All:
> >
> > This series tries to synchronize the operstate with the admin state
> > which allows the lower virtio-net to propagate the link status to the
> > upper devices like macvlan.
> >
> > This is done by toggling carrier during ndo_open/stop while doing
> > other necessary serialization about the carrier settings during probe.
> >
> > While at it, also fix a race between probe and ndo_set_features as we
> > didn't initalize the guest offload setting under rtnl lock.
>
>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>

Hello netdev maintainers.

Could we get this series merged?

Thanks
Jakub Kicinski Aug. 13, 2024, 2:40 p.m. UTC | #3
On Tue, 13 Aug 2024 11:43:43 +0800 Jason Wang wrote:
> Hello netdev maintainers.
> 
> Could we get this series merged?

Repost it with the Fixes tag correctly included.
Jason Wang Aug. 14, 2024, 5:23 a.m. UTC | #4
On Tue, Aug 13, 2024 at 10:40 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Tue, 13 Aug 2024 11:43:43 +0800 Jason Wang wrote:
> > Hello netdev maintainers.
> >
> > Could we get this series merged?
>
> Repost it with the Fixes tag correctly included.

Ok, I've posted a new version.

Thanks

>