diff options
author | Stefano Garzarella <sgarzare@redhat.com> | 2023-04-07 16:36:57 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-04-21 10:02:35 +0300 |
commit | 112f23cd72a2975e11986d73575e2c3651ea4c7e (patch) | |
tree | a4468732b77987ec9bb864516d7e98c3b804f4ef /drivers/vdpa/vdpa_sim/vdpa_sim.h | |
parent | 5b250fac7c76b670dd1b28b67f1a91a1907bc117 (diff) | |
download | linux-112f23cd72a2975e11986d73575e2c3651ea4c7e.tar.xz |
vdpa_sim: move buffer allocation in the devices
Currently, the vdpa_sim core does not use the buffer, but only
allocates it.
The buffer is used by devices differently, and some future devices
may not use it. So let's move all its management inside the devices.
Add a new `free` device callback called to clean up the resources
allocated by the device.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20230407133658.66339-2-sgarzare@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@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, 1 insertions, 2 deletions
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.h b/drivers/vdpa/vdpa_sim/vdpa_sim.h index 3a42887d05d9..bb137e479763 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.h +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.h @@ -39,7 +39,6 @@ struct vdpasim_dev_attr { u64 supported_features; size_t alloc_size; size_t config_size; - size_t buffer_size; int nvqs; u32 id; u32 ngroups; @@ -51,6 +50,7 @@ struct vdpasim_dev_attr { int (*get_stats)(struct vdpasim *vdpasim, u16 idx, struct sk_buff *msg, struct netlink_ext_ack *extack); + void (*free)(struct vdpasim *vdpasim); }; /* State of each vdpasim device */ @@ -67,7 +67,6 @@ struct vdpasim { void *config; struct vhost_iotlb *iommu; bool *iommu_pt; - void *buffer; u32 status; u32 generation; u64 features; |