Skip to content

Commit 7c06458

Browse files
vivierkuba-moo
authored andcommitted
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>
1 parent ca3daf4 commit 7c06458

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/virtio_net.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3813,6 +3813,12 @@ static int virtnet_validate(struct virtio_device *vdev)
38133813
__virtio_clear_bit(vdev, VIRTIO_NET_F_MTU);
38143814
}
38153815

3816+
if (virtio_has_feature(vdev, VIRTIO_NET_F_STANDBY) &&
3817+
!virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) {
3818+
dev_warn(&vdev->dev, "device advertises feature VIRTIO_NET_F_STANDBY but not VIRTIO_NET_F_MAC, disabling standby");
3819+
__virtio_clear_bit(vdev, VIRTIO_NET_F_STANDBY);
3820+
}
3821+
38163822
return 0;
38173823
}
38183824

0 commit comments

Comments
 (0)