• Eli Cohen's avatar
    vdpa/mlx5: Avoid losing link state updates · c384c240
    Eli Cohen authored
    Current code ignores link state updates if VIRTIO_NET_F_STATUS was not
    negotiated. However, link state updates could be received before feature
    negotiation was completed , therefore causing link state events to be
    lost, possibly leaving the link state down.
    
    Modify the code so link state notifier is registered after DRIVER_OK was
    negotiated and carry the registration only if
    VIRTIO_NET_F_STATUS was negotiated.  Unregister the notifier when the
    device is reset.
    
    Fixes: 033779a7 ("vdpa/mlx5: make MTU/STATUS presence conditional on feature bits")
    Acked-by: default avatarJason Wang <jasowang@redhat.com>
    Signed-off-by: default avatarEli Cohen <elic@nvidia.com>
    Message-Id: <20230417110343.138319-1-elic@nvidia.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    c384c240
mlx5_vnet.c 89.7 KB