diff options
author | Laurent Vivier <lvivier@redhat.com> | 2020-10-29 13:20:49 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-10-30 09:04:35 +0100 |
commit | 4a6a42db53aae049a8a64d4b273761bc80c46ebf (patch) | |
tree | 5583779821b479100e39f4034a791ccd092cdd0f /drivers/vdpa | |
parent | vdpa: handle irq bypass register failure case (diff) | |
download | linux-4a6a42db53aae049a8a64d4b273761bc80c46ebf.tar.xz linux-4a6a42db53aae049a8a64d4b273761bc80c46ebf.zip |
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: 2c53d0f64c06 ("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>
Diffstat (limited to 'drivers/vdpa')
-rw-r--r-- | drivers/vdpa/vdpa_sim/vdpa_sim.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index c76f7277cea4..3192ce47e029 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c @@ -60,7 +60,8 @@ struct vdpasim_virtqueue { static u64 vdpasim_features = (1ULL << VIRTIO_F_ANY_LAYOUT) | (1ULL << VIRTIO_F_VERSION_1) | - (1ULL << VIRTIO_F_ACCESS_PLATFORM); + (1ULL << VIRTIO_F_ACCESS_PLATFORM) | + (1ULL << VIRTIO_NET_F_MAC); /* State of each vdpasim device */ struct vdpasim { |