Skip to content

Commit a643a29

Browse files
committed
virtio_net: disable VIRTIO_NET_F_STANDBY if VIRTIO_NET_F_MAC is not set
Bugzilla: http://bugzilla.redhat.com/2153210 commit 7c06458 Author: Laurent Vivier <lvivier@redhat.com> Date: Fri Jan 27 21:44:59 2023 +0100 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> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
1 parent 557602e commit a643a29

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
@@ -3100,6 +3100,12 @@ static int virtnet_validate(struct virtio_device *vdev)
31003100
__virtio_clear_bit(vdev, VIRTIO_NET_F_MTU);
31013101
}
31023102

3103+
if (virtio_has_feature(vdev, VIRTIO_NET_F_STANDBY) &&
3104+
!virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) {
3105+
dev_warn(&vdev->dev, "device advertises feature VIRTIO_NET_F_STANDBY but not VIRTIO_NET_F_MAC, disabling standby");
3106+
__virtio_clear_bit(vdev, VIRTIO_NET_F_STANDBY);
3107+
}
3108+
31033109
return 0;
31043110
}
31053111

0 commit comments

Comments
 (0)