summaryrefslogtreecommitdiffstats
path: root/include/linux/vdpa.h
diff options
context:
space:
mode:
authorEli Cohen <elic@nvidia.com>2022-01-05 13:46:33 +0200
committerMichael S. Tsirkin <mst@redhat.com>2022-01-14 18:50:53 -0500
commita64917bc2e9b1e0aa716b783c4ec879fdd280300 (patch)
tree63b04363f3e8d383b1273899916c5fcc26f97f64 /include/linux/vdpa.h
parent870aaff92e959e29d40f9cfdb5ed06ba2fc2dae0 (diff)
downloadlinux-a64917bc2e9b1e0aa716b783c4ec879fdd280300.tar.bz2
vdpa: Provide interface to read driver features
Provide an interface to read the negotiated features. This is needed when building the netlink message in vdpa_dev_net_config_fill(). Also fix the implementation of vdpa_dev_net_config_fill() to use the negotiated features instead of the device features. To make APIs clearer, make the following name changes to struct vdpa_config_ops so they better describe their operations: get_features -> get_device_features set_features -> set_driver_features Finally, add get_driver_features to return the negotiated features and add implementation to all the upstream drivers. Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Eli Cohen <elic@nvidia.com> Link: https://lore.kernel.org/r/20220105114646.577224-2-elic@nvidia.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/linux/vdpa.h')
-rw-r--r--include/linux/vdpa.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index 2b7db96bb7d3..9cc4291a79b3 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -171,14 +171,17 @@ struct vdpa_map_file {
* for the device
* @vdev: vdpa device
* Returns virtqueue algin requirement
- * @get_features: Get virtio features supported by the device
+ * @get_device_features: Get virtio features supported by the device
* @vdev: vdpa device
* Returns the virtio features support by the
* device
- * @set_features: Set virtio features supported by the driver
+ * @set_driver_features: Set virtio features supported by the driver
* @vdev: vdpa device
* @features: feature support by the driver
* Returns integer: success (0) or error (< 0)
+ * @get_driver_features: Get the virtio driver features in action
+ * @vdev: vdpa device
+ * Returns the virtio features accepted
* @set_config_cb: Set the config interrupt callback
* @vdev: vdpa device
* @cb: virtio-vdev interrupt callback structure
@@ -278,8 +281,9 @@ struct vdpa_config_ops {
/* Device ops */
u32 (*get_vq_align)(struct vdpa_device *vdev);
- u64 (*get_features)(struct vdpa_device *vdev);
- int (*set_features)(struct vdpa_device *vdev, u64 features);
+ u64 (*get_device_features)(struct vdpa_device *vdev);
+ int (*set_driver_features)(struct vdpa_device *vdev, u64 features);
+ u64 (*get_driver_features)(struct vdpa_device *vdev);
void (*set_config_cb)(struct vdpa_device *vdev,
struct vdpa_callback *cb);
u16 (*get_vq_num_max)(struct vdpa_device *vdev);
@@ -397,7 +401,7 @@ static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features)
const struct vdpa_config_ops *ops = vdev->config;
vdev->features_valid = true;
- return ops->set_features(vdev, features);
+ return ops->set_driver_features(vdev, features);
}
void vdpa_get_config(struct vdpa_device *vdev, unsigned int offset,