2021-01-05 18:32:00 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
|
|
|
|
/*
|
|
|
|
* vdpa device management interface
|
|
|
|
* Copyright (c) 2020 Mellanox Technologies Ltd. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _UAPI_LINUX_VDPA_H_
|
|
|
|
#define _UAPI_LINUX_VDPA_H_
|
|
|
|
|
|
|
|
#define VDPA_GENL_NAME "vdpa"
|
|
|
|
#define VDPA_GENL_VERSION 0x1
|
|
|
|
|
|
|
|
enum vdpa_command {
|
|
|
|
VDPA_CMD_UNSPEC,
|
|
|
|
VDPA_CMD_MGMTDEV_NEW,
|
|
|
|
VDPA_CMD_MGMTDEV_GET, /* can dump */
|
2021-01-05 18:32:01 +08:00
|
|
|
VDPA_CMD_DEV_NEW,
|
|
|
|
VDPA_CMD_DEV_DEL,
|
2021-01-05 18:32:02 +08:00
|
|
|
VDPA_CMD_DEV_GET, /* can dump */
|
2021-10-27 01:55:13 +08:00
|
|
|
VDPA_CMD_DEV_CONFIG_GET, /* can dump */
|
2021-01-05 18:32:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
enum vdpa_attr {
|
|
|
|
VDPA_ATTR_UNSPEC,
|
|
|
|
|
vdpa: Add support for returning device configuration information
Add netlink attribute to store the negotiated features. This can be used
by userspace to get the current state of the vdpa instance.
Examples:
$ vdpa dev config show vdpa-a
vdpa-a: mac 00:00:00:00:88:88 link up link_announce false max_vq_pairs 16 mtu 1500
negotiated_features CSUM GUEST_CSUM MTU MAC HOST_TSO4 HOST_TSO6 STATUS \
CTRL_VQ MQ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM
$ vdpa -j dev config show vdpa-a
{"config":{"vdpa-a":{"mac":"00:00:00:00:88:88","link ":"up","link_announce":false, \
"max_vq_pairs":16,"mtu":1500,"negotiated_features":["CSUM","GUEST_CSUM","MTU","MAC", \
"HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ","CTRL_MAC_ADDR","VERSION_1", \
"ACCESS_PLATFORM"]}}}
$ vdpa -jp dev config show vdpa-a
{
"config": {
"vdpa-a": {
"mac": "00:00:00:00:88:88",
"link ": "up",
"link_announce ": false,
"max_vq_pairs": 16,
"mtu": 1500,
"negotiated_features": [
"CSUM","GUEST_CSUM","MTU","MAC","HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ", \
"CTRL_MAC_ADDR","VERSION_1","ACCESS_PLATFORM"
]
}
}
}
Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20220105114646.577224-9-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
2022-01-05 19:46:40 +08:00
|
|
|
/* Pad attribute for 64b alignment */
|
|
|
|
VDPA_ATTR_PAD = VDPA_ATTR_UNSPEC,
|
|
|
|
|
2021-01-05 18:32:00 +08:00
|
|
|
/* bus name (optional) + dev name together make the parent device handle */
|
|
|
|
VDPA_ATTR_MGMTDEV_BUS_NAME, /* string */
|
|
|
|
VDPA_ATTR_MGMTDEV_DEV_NAME, /* string */
|
|
|
|
VDPA_ATTR_MGMTDEV_SUPPORTED_CLASSES, /* u64 */
|
|
|
|
|
2021-01-05 18:32:01 +08:00
|
|
|
VDPA_ATTR_DEV_NAME, /* string */
|
2021-01-05 18:32:02 +08:00
|
|
|
VDPA_ATTR_DEV_ID, /* u32 */
|
|
|
|
VDPA_ATTR_DEV_VENDOR_ID, /* u32 */
|
|
|
|
VDPA_ATTR_DEV_MAX_VQS, /* u32 */
|
|
|
|
VDPA_ATTR_DEV_MAX_VQ_SIZE, /* u16 */
|
2021-10-29 17:14:48 +08:00
|
|
|
VDPA_ATTR_DEV_MIN_VQ_SIZE, /* u16 */
|
2021-01-05 18:32:01 +08:00
|
|
|
|
2021-10-27 01:55:13 +08:00
|
|
|
VDPA_ATTR_DEV_NET_CFG_MACADDR, /* binary */
|
|
|
|
VDPA_ATTR_DEV_NET_STATUS, /* u8 */
|
|
|
|
VDPA_ATTR_DEV_NET_CFG_MAX_VQP, /* u16 */
|
|
|
|
VDPA_ATTR_DEV_NET_CFG_MTU, /* u16 */
|
|
|
|
|
vdpa: Add support for returning device configuration information
Add netlink attribute to store the negotiated features. This can be used
by userspace to get the current state of the vdpa instance.
Examples:
$ vdpa dev config show vdpa-a
vdpa-a: mac 00:00:00:00:88:88 link up link_announce false max_vq_pairs 16 mtu 1500
negotiated_features CSUM GUEST_CSUM MTU MAC HOST_TSO4 HOST_TSO6 STATUS \
CTRL_VQ MQ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM
$ vdpa -j dev config show vdpa-a
{"config":{"vdpa-a":{"mac":"00:00:00:00:88:88","link ":"up","link_announce":false, \
"max_vq_pairs":16,"mtu":1500,"negotiated_features":["CSUM","GUEST_CSUM","MTU","MAC", \
"HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ","CTRL_MAC_ADDR","VERSION_1", \
"ACCESS_PLATFORM"]}}}
$ vdpa -jp dev config show vdpa-a
{
"config": {
"vdpa-a": {
"mac": "00:00:00:00:88:88",
"link ": "up",
"link_announce ": false,
"max_vq_pairs": 16,
"mtu": 1500,
"negotiated_features": [
"CSUM","GUEST_CSUM","MTU","MAC","HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ", \
"CTRL_MAC_ADDR","VERSION_1","ACCESS_PLATFORM"
]
}
}
}
Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20220105114646.577224-9-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
2022-01-05 19:46:40 +08:00
|
|
|
VDPA_ATTR_DEV_NEGOTIATED_FEATURES, /* u64 */
|
vdpa: Support reporting max device capabilities
Add max_supported_vqs and supported_features fields to struct
vdpa_mgmt_dev. Upstream drivers need to feel these values according to
the device capabilities.
These values are reported back in a netlink message when showing management
devices.
Examples:
$ auxiliary/mlx5_core.sf.1:
supported_classes net
max_supported_vqs 257
dev_features CSUM GUEST_CSUM MTU HOST_TSO4 HOST_TSO6 STATUS CTRL_VQ MQ \
CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM
$ vdpa -j mgmtdev show
{"mgmtdev":{"auxiliary/mlx5_core.sf.1":{"supported_classes":["net"], \
"max_supported_vqs":257,"dev_features":["CSUM","GUEST_CSUM","MTU", \
"HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ","CTRL_MAC_ADDR", \
"VERSION_1","ACCESS_PLATFORM"]}}}
$ vdpa -jp mgmtdev show
{
"mgmtdev": {
"auxiliary/mlx5_core.sf.1": {
"supported_classes": [ "net" ],
"max_supported_vqs": 257,
"dev_features": ["CSUM","GUEST_CSUM","MTU","HOST_TSO4", \
"HOST_TSO6","STATUS","CTRL_VQ","MQ", \
"CTRL_MAC_ADDR","VERSION_1","ACCESS_PLATFORM"]
}
}
}
Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20220105114646.577224-11-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Si-Wei Liu<si-wei.liu@oracle.com>
2022-01-05 19:46:42 +08:00
|
|
|
VDPA_ATTR_DEV_MGMTDEV_MAX_VQS, /* u32 */
|
|
|
|
VDPA_ATTR_DEV_SUPPORTED_FEATURES, /* u64 */
|
2021-01-05 18:32:00 +08:00
|
|
|
/* new attributes must be added above here */
|
|
|
|
VDPA_ATTR_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|