Re: [RFC 2/4] vduse: Introduce VDUSE - vDPA Device in Userspace

2020-10-19 Thread Randy Dunlap
On 10/19/20 8:08 AM, Michael S. Tsirkin wrote:
> On Mon, Oct 19, 2020 at 10:56:21PM +0800, Xie Yongji wrote:
>> diff --git a/include/uapi/linux/vduse.h b/include/uapi/linux/vduse.h

>> +#define VDUSE_BASE  'V'
>> +
> 
> Could we see some documentation about the user interface of this module 
> please?
> 

Also, the VDUSE_BASE value should be documented in
Documentation/userspace-api/ioctl/ioctl-number.rst.

thanks.
-- 
~Randy

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


Re: [RFC 2/4] vduse: Introduce VDUSE - vDPA Device in Userspace

2020-10-19 Thread Michael S. Tsirkin
On Mon, Oct 19, 2020 at 10:56:21PM +0800, Xie Yongji wrote:
> diff --git a/include/uapi/linux/vduse.h b/include/uapi/linux/vduse.h
> new file mode 100644
> index ..855d2116b3a6
> --- /dev/null
> +++ b/include/uapi/linux/vduse.h
> @@ -0,0 +1,85 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _UAPI_VDUSE_H_
> +#define _UAPI_VDUSE_H_
> +
> +#include 
> +
> +#define VDUSE_CONFIG_DATA_LEN8
> +
> +enum vduse_req_type {
> + VDUSE_SET_VQ_STATE,
> + VDUSE_SET_FEATURES,
> + VDUSE_GET_FEATURES,
> + VDUSE_SET_STATUS,
> + VDUSE_GET_STATUS,
> + VDUSE_SET_CONFIG,
> + VDUSE_GET_CONFIG,
> +};
> +
> +struct vduse_vq_state {
> + __u32 index;
> + __u32 num;
> + __u64 desc_addr;
> + __u64 driver_addr;
> + __u64 device_addr;
> + __u8 ready;
> +};
> +
> +struct vduse_dev_config_data {
> + __u32 offset;
> + __u32 len;
> + __u8 data[VDUSE_CONFIG_DATA_LEN];
> +};
> +
> +struct vduse_dev_request {
> + __u32 type;
> + __u32 unique;
> + __u32 flags;
> + __u32 size;
> + union {
> + struct vduse_vq_state vq_state;
> + struct vduse_dev_config_data config;
> + __u64 features;
> + __u8 status;
> + };
> +};
> +
> +struct vduse_dev_response {
> + __u32 unique;
> + __s32 result;
> + union {
> + struct vduse_dev_config_data config;
> + __u64 features;
> + __u8 status;
> + };
> +};
> +
> +/* ioctl */
> +
> +struct vduse_dev_config {
> + __u32 id;
> + __u32 vendor_id;
> + __u32 device_id;
> + __u64 iova_size;
> + __u16 vq_num;
> + __u16 vq_size_max;
> + __u32 vq_align;
> +};
> +
> +struct vduse_vq_eventfd {
> + __u32 index;
> + __u32 fd;
> +};
> +
> +#define VDUSE_BASE   'V'
> +
> +#define VDUSE_CREATE_DEV _IOW(VDUSE_BASE, 0x01, struct vduse_dev_config)
> +#define VDUSE_GET_DEV_IO(VDUSE_BASE, 0x02)
> +#define VDUSE_DESTROY_DEV_IO(VDUSE_BASE, 0x03)
> +
> +#define VDUSE_DEV_START  _IO(VDUSE_BASE, 0x04)
> +#define VDUSE_DEV_STOP   _IO(VDUSE_BASE, 0x05)
> +#define VDUSE_VQ_SETUP_KICKFD_IOW(VDUSE_BASE, 0x06, struct 
> vduse_vq_eventfd)
> +#define VDUSE_VQ_SETUP_IRQFD _IOW(VDUSE_BASE, 0x07, struct vduse_vq_eventfd)
> +
> +#endif /* _UAPI_VDUSE_H_ */


Could we see some documentation about the user interface of this module please?

> -- 
> 2.25.1

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization