diff options
author | Mike Christie <michael.christie@oracle.com> | 2023-06-26 18:23:04 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-07-03 12:15:14 -0400 |
commit | 1cdaafa1b8b4ef6052869c86ba2b41c0cff05957 (patch) | |
tree | f11c02f6ad2beec29a856a35379ccf13c2999c6d /drivers/vhost/vhost.h | |
parent | cef25866f41c45a01a933adb032b0dcfb25b847a (diff) |
vhost: replace single worker pointer with xarray
The next patch allows userspace to create multiple workers per device,
so this patch replaces the vhost_worker pointer with an xarray so we
can store mupltiple workers and look them up.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Message-Id: <20230626232307.97930-15-michael.christie@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost/vhost.h')
-rw-r--r-- | drivers/vhost/vhost.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index b850f534bc9a..31937e98c01b 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -30,6 +30,7 @@ struct vhost_worker { struct vhost_task *vtsk; struct llist_head work_list; u64 kcov_handle; + u32 id; }; /* Poll a file (eventfd or socket) */ @@ -159,7 +160,6 @@ struct vhost_dev { struct vhost_virtqueue **vqs; int nvqs; struct eventfd_ctx *log_ctx; - struct vhost_worker *worker; struct vhost_iotlb *umem; struct vhost_iotlb *iotlb; spinlock_t iotlb_lock; @@ -169,6 +169,7 @@ struct vhost_dev { int iov_limit; int weight; int byte_weight; + struct xarray worker_xa; bool use_worker; int (*msg_handler)(struct vhost_dev *dev, u32 asid, struct vhost_iotlb_msg *msg); |