• Shannon Nelson's avatar
    pds_vdpa: always allow offering VIRTIO_NET_F_MAC · abdf31bd
    Shannon Nelson authored
    Our driver sets a mac if the HW is 00:..:00 so we need to be sure to
    advertise VIRTIO_NET_F_MAC even if the HW doesn't.  We also need to be
    sure that virtio_net sees the VIRTIO_NET_F_MAC and doesn't rewrite the
    mac address that a user may have set with the vdpa utility.
    
    After reading the hw_feature bits, add the VIRTIO_NET_F_MAC to the driver's
    supported_features and use that for reporting what is available.  If the
    HW is not advertising it, be sure to strip the VIRTIO_NET_F_MAC before
    finishing the feature negotiation.  If the user specifies a device_features
    bitpattern in the vdpa utility without the VIRTIO_NET_F_MAC set, then
    don't set the mac.
    
    Fixes: 151cc834 ("pds_vdpa: add support for vdpa and vdpamgmt interfaces")
    Signed-off-by: default avatarShannon Nelson <shannon.nelson@amd.com>
    Message-Id: <20230711042437.69381-3-shannon.nelson@amd.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Acked-by: default avatarJason Wang <jasowang@redhat.com>
    abdf31bd
vdpa_dev.h 1.12 KB