Skip to content

Commit c695964

Browse files
eugpermarmstsirkin
authored andcommitted
mlx5_vdpa: offer VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK
Offer this backend feature as mlx5 is compatible with it. It allows it to do live migration with CVQ, dynamically switching between passthrough and shadow virtqueue. Signed-off-by: Eugenio Pérez <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 5dc31bd commit c695964

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/vdpa/mlx5/net/mlx5_vnet.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <uapi/linux/virtio_net.h>
88
#include <uapi/linux/virtio_ids.h>
99
#include <uapi/linux/vdpa.h>
10+
#include <uapi/linux/vhost_types.h>
1011
#include <linux/virtio_config.h>
1112
#include <linux/auxiliary_bus.h>
1213
#include <linux/mlx5/cq.h>
@@ -2559,6 +2560,11 @@ static void unregister_link_notifier(struct mlx5_vdpa_net *ndev)
25592560
flush_workqueue(ndev->mvdev.wq);
25602561
}
25612562

2563+
static u64 mlx5_vdpa_get_backend_features(const struct vdpa_device *vdpa)
2564+
{
2565+
return BIT_ULL(VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK);
2566+
}
2567+
25622568
static int mlx5_vdpa_set_driver_features(struct vdpa_device *vdev, u64 features)
25632569
{
25642570
struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
@@ -3234,6 +3240,7 @@ static const struct vdpa_config_ops mlx5_vdpa_ops = {
32343240
.get_vq_group = mlx5_vdpa_get_vq_group,
32353241
.get_vq_desc_group = mlx5_vdpa_get_vq_desc_group, /* Op disabled if not supported. */
32363242
.get_device_features = mlx5_vdpa_get_device_features,
3243+
.get_backend_features = mlx5_vdpa_get_backend_features,
32373244
.set_driver_features = mlx5_vdpa_set_driver_features,
32383245
.get_driver_features = mlx5_vdpa_get_driver_features,
32393246
.set_config_cb = mlx5_vdpa_set_config_cb,

0 commit comments

Comments
 (0)