1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
3 * vdpa device management interface
4 * Copyright (c) 2020 Mellanox Technologies Ltd. All rights reserved.
7 #ifndef _UAPI_LINUX_VDPA_H_
8 #define _UAPI_LINUX_VDPA_H_
10 #define VDPA_GENL_NAME "vdpa"
11 #define VDPA_GENL_VERSION 0x1
16 VDPA_CMD_MGMTDEV_GET, /* can dump */
19 VDPA_CMD_DEV_GET, /* can dump */
20 VDPA_CMD_DEV_CONFIG_GET, /* can dump */
21 VDPA_CMD_DEV_VSTATS_GET,
27 /* Pad attribute for 64b alignment */
28 VDPA_ATTR_PAD = VDPA_ATTR_UNSPEC,
30 /* bus name (optional) + dev name together make the parent device handle */
31 VDPA_ATTR_MGMTDEV_BUS_NAME, /* string */
32 VDPA_ATTR_MGMTDEV_DEV_NAME, /* string */
33 VDPA_ATTR_MGMTDEV_SUPPORTED_CLASSES, /* u64 */
35 VDPA_ATTR_DEV_NAME, /* string */
36 VDPA_ATTR_DEV_ID, /* u32 */
37 VDPA_ATTR_DEV_VENDOR_ID, /* u32 */
38 VDPA_ATTR_DEV_MAX_VQS, /* u32 */
39 VDPA_ATTR_DEV_MAX_VQ_SIZE, /* u16 */
40 VDPA_ATTR_DEV_MIN_VQ_SIZE, /* u16 */
42 VDPA_ATTR_DEV_NET_CFG_MACADDR, /* binary */
43 VDPA_ATTR_DEV_NET_STATUS, /* u8 */
44 VDPA_ATTR_DEV_NET_CFG_MAX_VQP, /* u16 */
45 VDPA_ATTR_DEV_NET_CFG_MTU, /* u16 */
47 VDPA_ATTR_DEV_NEGOTIATED_FEATURES, /* u64 */
48 VDPA_ATTR_DEV_MGMTDEV_MAX_VQS, /* u32 */
49 /* virtio features that are supported by the vDPA management device */
50 VDPA_ATTR_DEV_SUPPORTED_FEATURES, /* u64 */
52 VDPA_ATTR_DEV_QUEUE_INDEX, /* u32 */
53 VDPA_ATTR_DEV_VENDOR_ATTR_NAME, /* string */
54 VDPA_ATTR_DEV_VENDOR_ATTR_VALUE, /* u64 */
56 /* virtio features that are provisioned to the vDPA device */
57 VDPA_ATTR_DEV_FEATURES, /* u64 */
59 VDPA_ATTR_DEV_BLK_CFG_CAPACITY, /* u64 */
60 VDPA_ATTR_DEV_BLK_CFG_SIZE_MAX, /* u32 */
61 VDPA_ATTR_DEV_BLK_CFG_BLK_SIZE, /* u32 */
62 VDPA_ATTR_DEV_BLK_CFG_SEG_MAX, /* u32 */
63 VDPA_ATTR_DEV_BLK_CFG_NUM_QUEUES, /* u16 */
64 VDPA_ATTR_DEV_BLK_CFG_PHY_BLK_EXP, /* u8 */
65 VDPA_ATTR_DEV_BLK_CFG_ALIGN_OFFSET, /* u8 */
66 VDPA_ATTR_DEV_BLK_CFG_MIN_IO_SIZE, /* u16 */
67 VDPA_ATTR_DEV_BLK_CFG_OPT_IO_SIZE, /* u32 */
68 VDPA_ATTR_DEV_BLK_CFG_MAX_DISCARD_SEC, /* u32 */
69 VDPA_ATTR_DEV_BLK_CFG_MAX_DISCARD_SEG, /* u32 */
70 VDPA_ATTR_DEV_BLK_CFG_DISCARD_SEC_ALIGN,/* u32 */
71 VDPA_ATTR_DEV_BLK_CFG_MAX_WRITE_ZEROES_SEC, /* u32 */
72 VDPA_ATTR_DEV_BLK_CFG_MAX_WRITE_ZEROES_SEG, /* u32 */
73 VDPA_ATTR_DEV_BLK_READ_ONLY, /* u8 */
74 VDPA_ATTR_DEV_BLK_FLUSH, /* u8 */
76 /* new attributes must be added above here */