|
235 | 235 | */
|
236 | 236 | #define VHOST_VDPA_GET_VRING_SIZE _IOWR(VHOST_VIRTIO, 0x82, \
|
237 | 237 | struct vhost_vring_state)
|
| 238 | + |
| 239 | +/* Extended features manipulation */ |
| 240 | +#define VHOST_GET_FEATURES_ARRAY _IOR(VHOST_VIRTIO, 0x83, \ |
| 241 | + struct vhost_features_array) |
| 242 | +#define VHOST_SET_FEATURES_ARRAY _IOW(VHOST_VIRTIO, 0x83, \ |
| 243 | + struct vhost_features_array) |
| 244 | + |
| 245 | +/* fork_owner values for vhost */ |
| 246 | +#define VHOST_FORK_OWNER_KTHREAD 0 |
| 247 | +#define VHOST_FORK_OWNER_TASK 1 |
| 248 | + |
| 249 | +/** |
| 250 | + * VHOST_SET_FORK_FROM_OWNER - Set the fork_owner flag for the vhost device, |
| 251 | + * This ioctl must called before VHOST_SET_OWNER. |
| 252 | + * Only available when CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL=y |
| 253 | + * |
| 254 | + * @param fork_owner: An 8-bit value that determines the vhost thread mode |
| 255 | + * |
| 256 | + * When fork_owner is set to VHOST_FORK_OWNER_TASK(default value): |
| 257 | + * - Vhost will create vhost worker as tasks forked from the owner, |
| 258 | + * inheriting all of the owner's attributes. |
| 259 | + * |
| 260 | + * When fork_owner is set to VHOST_FORK_OWNER_KTHREAD: |
| 261 | + * - Vhost will create vhost workers as kernel threads. |
| 262 | + */ |
| 263 | +#define VHOST_SET_FORK_FROM_OWNER _IOW(VHOST_VIRTIO, 0x84, __u8) |
| 264 | + |
| 265 | +/** |
| 266 | + * VHOST_GET_FORK_OWNER - Get the current fork_owner flag for the vhost device. |
| 267 | + * Only available when CONFIG_VHOST_ENABLE_FORK_OWNER_CONTROL=y |
| 268 | + * |
| 269 | + * @return: An 8-bit value indicating the current thread mode. |
| 270 | + */ |
| 271 | +#define VHOST_GET_FORK_FROM_OWNER _IOR(VHOST_VIRTIO, 0x85, __u8) |
| 272 | + |
238 | 273 | #endif
|
0 commit comments