diff options
author | Jason Wang <jasowang@redhat.com> | 2022-09-27 10:48:09 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2022-10-07 16:32:40 +0300 |
commit | 477f71971422fb225337b30f7b79363387b1d78c (patch) | |
tree | 7fe1d2b79eee34e195293e47854d5cc2cf9e1211 /drivers/vdpa/vdpa_sim/vdpa_sim.h | |
parent | 90fea5a800c3dd80fb8ad9a02929bcef5fde42b8 (diff) | |
download | linux-477f71971422fb225337b30f7b79363387b1d78c.tar.xz |
vdpa_sim_net: support feature provisioning
This patch implements features provisioning for vdpa_sim_net.
1) validating the provisioned features to be a subset of the parent
features.
2) clearing the features that is not wanted by the userspace
For example:
vdpasim_net:
supported_classes net
max_supported_vqs 3
dev_features MTU MAC CTRL_VQ CTRL_MAC_ADDR ANY_LAYOUT VERSION_1 ACCESS_PLATFORM
1) provision vDPA device with all features that are supported by the
net simulator
dev1: mac 00:00:00:00:00:00 link up link_announce false mtu 1500
negotiated_features MTU MAC CTRL_VQ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM
2) provision vDPA device with a subset of the features
dev1: mac 00:00:00:00:00:00 link up link_announce false mtu 1500
negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM
Reviewed-by: Eli Cohen <elic@nvidia.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20220927074810.28627-3-jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Diffstat (limited to 'drivers/vdpa/vdpa_sim/vdpa_sim.h')
-rw-r--r-- | drivers/vdpa/vdpa_sim/vdpa_sim.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.h b/drivers/vdpa/vdpa_sim/vdpa_sim.h index 061986f30911..0e78737dcc16 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.h +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.h @@ -71,7 +71,8 @@ struct vdpasim { spinlock_t iommu_lock; }; -struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *attr); +struct vdpasim *vdpasim_create(struct vdpasim_dev_attr *attr, + const struct vdpa_dev_set_config *config); /* TODO: cross-endian support */ static inline bool vdpasim_is_little_endian(struct vdpasim *vdpasim) |