diff options
author | Laurent Vivier <lvivier@redhat.com> | 2023-01-27 21:44:59 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-02-01 20:53:04 -0800 |
commit | 7c06458c102ee66068c03780527fcfc9b954ad91 (patch) | |
tree | 6457f019bfdccba42249b3f44d3c31d3eed35098 /drivers/net/virtio_net.c | |
parent | ca3daf437d9c261ca498f518090c3ddbf1bf824f (diff) | |
download | lwn-7c06458c102ee66068c03780527fcfc9b954ad91.tar.gz lwn-7c06458c102ee66068c03780527fcfc9b954ad91.zip |
virtio_net: disable VIRTIO_NET_F_STANDBY if VIRTIO_NET_F_MAC is not set
failover relies on the MAC address to pair the primary and the standby
devices:
"[...] the hypervisor needs to enable VIRTIO_NET_F_STANDBY
feature on the virtio-net interface and assign the same MAC address
to both virtio-net and VF interfaces."
Documentation/networking/net_failover.rst
This patch disables the STANDBY feature if the MAC address is not
provided by the hypervisor.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7e1a98430190..a2fad99b06ad 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -3813,6 +3813,12 @@ static int virtnet_validate(struct virtio_device *vdev) __virtio_clear_bit(vdev, VIRTIO_NET_F_MTU); } + if (virtio_has_feature(vdev, VIRTIO_NET_F_STANDBY) && + !virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) { + dev_warn(&vdev->dev, "device advertises feature VIRTIO_NET_F_STANDBY but not VIRTIO_NET_F_MAC, disabling standby"); + __virtio_clear_bit(vdev, VIRTIO_NET_F_STANDBY); + } + return 0; } |