summaryrefslogtreecommitdiff
path: root/drivers/vdpa/pds/vdpa_dev.h
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@amd.com>2023-07-11 07:24:34 +0300
committerMichael S. Tsirkin <mst@redhat.com>2023-08-10 22:51:45 +0300
commitabdf31bd91120035172dc58e2e87064a72e9e087 (patch)
tree7358bc7f176880e727fa27b22fa6a815f43aaee7 /drivers/vdpa/pds/vdpa_dev.h
parent0cd2c13b1c15dbbdf1e2ae5b7160537f97df06b5 (diff)
downloadlinux-abdf31bd91120035172dc58e2e87064a72e9e087.tar.xz
pds_vdpa: always allow offering VIRTIO_NET_F_MAC
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: 151cc834f3dd ("pds_vdpa: add support for vdpa and vdpamgmt interfaces") Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Message-Id: <20230711042437.69381-3-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'drivers/vdpa/pds/vdpa_dev.h')
-rw-r--r--drivers/vdpa/pds/vdpa_dev.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/vdpa/pds/vdpa_dev.h b/drivers/vdpa/pds/vdpa_dev.h
index cf02df287fc4..d984ba24a7da 100644
--- a/drivers/vdpa/pds/vdpa_dev.h
+++ b/drivers/vdpa/pds/vdpa_dev.h
@@ -35,8 +35,8 @@ struct pds_vdpa_device {
struct pds_vdpa_aux *vdpa_aux;
struct pds_vdpa_vq_info vqs[PDS_VDPA_MAX_QUEUES];
- u64 supported_features; /* specified device features */
- u64 req_features; /* features requested by vdpa */
+ u64 supported_features; /* supported device features */
+ u64 negotiated_features; /* negotiated features */
u8 vdpa_index; /* rsvd for future subdevice use */
u8 num_vqs; /* num vqs in use */
u8 mac[ETH_ALEN]; /* mac selected when the device was added */