2 * include/uapi/linux/devlink.h - Network physical device Netlink interface
3 * Copyright (c) 2016 Mellanox Technologies. All rights reserved.
4 * Copyright (c) 2016 Jiri Pirko <jiri@mellanox.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
12 #ifndef _UAPI_LINUX_DEVLINK_H_
13 #define _UAPI_LINUX_DEVLINK_H_
15 #define DEVLINK_GENL_NAME "devlink"
16 #define DEVLINK_GENL_VERSION 0x1
17 #define DEVLINK_GENL_MCGRP_CONFIG_NAME "config"
19 enum devlink_command {
20 /* don't change the order or add anything between, this is ABI! */
23 DEVLINK_CMD_GET, /* can dump */
28 DEVLINK_CMD_PORT_GET, /* can dump */
33 DEVLINK_CMD_PORT_SPLIT,
34 DEVLINK_CMD_PORT_UNSPLIT,
36 /* add new commands above here */
39 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1
42 enum devlink_port_type {
43 DEVLINK_PORT_TYPE_NOTSET,
44 DEVLINK_PORT_TYPE_AUTO,
45 DEVLINK_PORT_TYPE_ETH,
50 /* don't change the order or add anything between, this is ABI! */
53 /* bus name + dev name together are a handle for devlink entity */
54 DEVLINK_ATTR_BUS_NAME, /* string */
55 DEVLINK_ATTR_DEV_NAME, /* string */
57 DEVLINK_ATTR_PORT_INDEX, /* u32 */
58 DEVLINK_ATTR_PORT_TYPE, /* u16 */
59 DEVLINK_ATTR_PORT_DESIRED_TYPE, /* u16 */
60 DEVLINK_ATTR_PORT_NETDEV_IFINDEX, /* u32 */
61 DEVLINK_ATTR_PORT_NETDEV_NAME, /* string */
62 DEVLINK_ATTR_PORT_IBDEV_NAME, /* string */
63 DEVLINK_ATTR_PORT_SPLIT_COUNT, /* u32 */
64 DEVLINK_ATTR_PORT_SPLIT_GROUP, /* u32 */
66 /* add new attributes above here, update the policy in devlink.c */
69 DEVLINK_ATTR_MAX = __DEVLINK_ATTR_MAX - 1
72 #endif /* _UAPI_LINUX_DEVLINK_H_ */