Skip to content

Commit 4a6a42d

Browse files
viviermstsirkin
authored andcommitted
vdpasim: fix MAC address configuration
vdpa_sim generates a ramdom MAC address but it is never used by upper layers because the VIRTIO_NET_F_MAC bit is not set in the features list. Because of that, virtio-net always regenerates a random MAC address each time it is loaded whereas the address should only change on vdpa_sim load/unload. Fix that by adding VIRTIO_NET_F_MAC in the features list of vdpa_sim. Fixes: 2c53d0f ("vdpasim: vDPA device simulator") Cc: jasowang@redhat.com Signed-off-by: Laurent Vivier <lvivier@redhat.com> Link: https://lore.kernel.org/r/20201029122050.776445-2-lvivier@redhat.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
1 parent e01afe3 commit 4a6a42d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/vdpa/vdpa_sim/vdpa_sim.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ struct vdpasim_virtqueue {
6060

6161
static u64 vdpasim_features = (1ULL << VIRTIO_F_ANY_LAYOUT) |
6262
(1ULL << VIRTIO_F_VERSION_1) |
63-
(1ULL << VIRTIO_F_ACCESS_PLATFORM);
63+
(1ULL << VIRTIO_F_ACCESS_PLATFORM) |
64+
(1ULL << VIRTIO_NET_F_MAC);
6465

6566
/* State of each vdpasim device */
6667
struct vdpasim {

0 commit comments

Comments
 (0)