Skip to content

Commit 2c9c637

Browse files
eugpermarmstsirkin
authored andcommitted
vdpa_sim: offer VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK
Start offering the feature in the simulator. Other parent drivers can follow this code to offer it too. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Acked-by: Shannon Nelson <shannon.nelson@amd.com> Message-Id: <20230609092127.170673-5-eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent b63e5c7 commit 2c9c637

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/vdpa/vdpa_sim/vdpa_sim.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/vdpa.h>
1919
#include <linux/vhost_iotlb.h>
2020
#include <uapi/linux/vdpa.h>
21+
#include <uapi/linux/vhost_types.h>
2122

2223
#include "vdpa_sim.h"
2324

@@ -410,6 +411,11 @@ static u64 vdpasim_get_device_features(struct vdpa_device *vdpa)
410411
return vdpasim->dev_attr.supported_features;
411412
}
412413

414+
static u64 vdpasim_get_backend_features(const struct vdpa_device *vdpa)
415+
{
416+
return BIT_ULL(VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK);
417+
}
418+
413419
static int vdpasim_set_driver_features(struct vdpa_device *vdpa, u64 features)
414420
{
415421
struct vdpasim *vdpasim = vdpa_to_sim(vdpa);
@@ -733,6 +739,7 @@ static const struct vdpa_config_ops vdpasim_config_ops = {
733739
.get_vq_align = vdpasim_get_vq_align,
734740
.get_vq_group = vdpasim_get_vq_group,
735741
.get_device_features = vdpasim_get_device_features,
742+
.get_backend_features = vdpasim_get_backend_features,
736743
.set_driver_features = vdpasim_set_driver_features,
737744
.get_driver_features = vdpasim_get_driver_features,
738745
.set_config_cb = vdpasim_set_config_cb,
@@ -770,6 +777,7 @@ static const struct vdpa_config_ops vdpasim_batch_config_ops = {
770777
.get_vq_align = vdpasim_get_vq_align,
771778
.get_vq_group = vdpasim_get_vq_group,
772779
.get_device_features = vdpasim_get_device_features,
780+
.get_backend_features = vdpasim_get_backend_features,
773781
.set_driver_features = vdpasim_set_driver_features,
774782
.get_driver_features = vdpasim_get_driver_features,
775783
.set_config_cb = vdpasim_set_config_cb,

0 commit comments

Comments
 (0)