blob: c51bf77f23b98a45112d3f333fbfeabf0236609c [file] [log] [blame]
Christopher Ferris106b3a82016-08-24 12:15:38 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_DEVLINK_H_
20#define _UAPI_LINUX_DEVLINK_H_
21#define DEVLINK_GENL_NAME "devlink"
22#define DEVLINK_GENL_VERSION 0x1
Christopher Ferris106b3a82016-08-24 12:15:38 -070023#define DEVLINK_GENL_MCGRP_CONFIG_NAME "config"
24enum devlink_command {
25 DEVLINK_CMD_UNSPEC,
26 DEVLINK_CMD_GET,
Christopher Ferris106b3a82016-08-24 12:15:38 -070027 DEVLINK_CMD_SET,
28 DEVLINK_CMD_NEW,
29 DEVLINK_CMD_DEL,
30 DEVLINK_CMD_PORT_GET,
Christopher Ferris106b3a82016-08-24 12:15:38 -070031 DEVLINK_CMD_PORT_SET,
32 DEVLINK_CMD_PORT_NEW,
33 DEVLINK_CMD_PORT_DEL,
34 DEVLINK_CMD_PORT_SPLIT,
Christopher Ferris106b3a82016-08-24 12:15:38 -070035 DEVLINK_CMD_PORT_UNSPLIT,
36 DEVLINK_CMD_SB_GET,
37 DEVLINK_CMD_SB_SET,
38 DEVLINK_CMD_SB_NEW,
Christopher Ferris106b3a82016-08-24 12:15:38 -070039 DEVLINK_CMD_SB_DEL,
40 DEVLINK_CMD_SB_POOL_GET,
41 DEVLINK_CMD_SB_POOL_SET,
42 DEVLINK_CMD_SB_POOL_NEW,
Christopher Ferris106b3a82016-08-24 12:15:38 -070043 DEVLINK_CMD_SB_POOL_DEL,
44 DEVLINK_CMD_SB_PORT_POOL_GET,
45 DEVLINK_CMD_SB_PORT_POOL_SET,
46 DEVLINK_CMD_SB_PORT_POOL_NEW,
Christopher Ferris106b3a82016-08-24 12:15:38 -070047 DEVLINK_CMD_SB_PORT_POOL_DEL,
48 DEVLINK_CMD_SB_TC_POOL_BIND_GET,
49 DEVLINK_CMD_SB_TC_POOL_BIND_SET,
50 DEVLINK_CMD_SB_TC_POOL_BIND_NEW,
Christopher Ferris106b3a82016-08-24 12:15:38 -070051 DEVLINK_CMD_SB_TC_POOL_BIND_DEL,
52 DEVLINK_CMD_SB_OCC_SNAPSHOT,
53 DEVLINK_CMD_SB_OCC_MAX_CLEAR,
Christopher Ferris49f525c2016-12-12 14:55:36 -080054 DEVLINK_CMD_ESWITCH_MODE_GET,
Christopher Ferris49f525c2016-12-12 14:55:36 -080055 DEVLINK_CMD_ESWITCH_MODE_SET,
56 __DEVLINK_CMD_MAX,
Christopher Ferris106b3a82016-08-24 12:15:38 -070057 DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1
58};
59enum devlink_port_type {
60 DEVLINK_PORT_TYPE_NOTSET,
Christopher Ferris106b3a82016-08-24 12:15:38 -070061 DEVLINK_PORT_TYPE_AUTO,
62 DEVLINK_PORT_TYPE_ETH,
63 DEVLINK_PORT_TYPE_IB,
64};
Christopher Ferris106b3a82016-08-24 12:15:38 -070065enum devlink_sb_pool_type {
66 DEVLINK_SB_POOL_TYPE_INGRESS,
67 DEVLINK_SB_POOL_TYPE_EGRESS,
68};
Christopher Ferris106b3a82016-08-24 12:15:38 -070069enum devlink_sb_threshold_type {
70 DEVLINK_SB_THRESHOLD_TYPE_STATIC,
71 DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC,
72};
Christopher Ferris106b3a82016-08-24 12:15:38 -070073#define DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX 20
Christopher Ferris49f525c2016-12-12 14:55:36 -080074enum devlink_eswitch_mode {
Christopher Ferris49f525c2016-12-12 14:55:36 -080075 DEVLINK_ESWITCH_MODE_LEGACY,
76 DEVLINK_ESWITCH_MODE_SWITCHDEV,
77};
Christopher Ferris48af7cb2017-02-21 12:35:09 -080078enum devlink_eswitch_inline_mode {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080079 DEVLINK_ESWITCH_INLINE_MODE_NONE,
80 DEVLINK_ESWITCH_INLINE_MODE_LINK,
81 DEVLINK_ESWITCH_INLINE_MODE_NETWORK,
82 DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT,
Christopher Ferris106b3a82016-08-24 12:15:38 -070083};
Christopher Ferris48af7cb2017-02-21 12:35:09 -080084enum devlink_attr {
85 DEVLINK_ATTR_UNSPEC,
86 DEVLINK_ATTR_BUS_NAME,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080087 DEVLINK_ATTR_DEV_NAME,
88 DEVLINK_ATTR_PORT_INDEX,
89 DEVLINK_ATTR_PORT_TYPE,
90 DEVLINK_ATTR_PORT_DESIRED_TYPE,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080091 DEVLINK_ATTR_PORT_NETDEV_IFINDEX,
92 DEVLINK_ATTR_PORT_NETDEV_NAME,
93 DEVLINK_ATTR_PORT_IBDEV_NAME,
94 DEVLINK_ATTR_PORT_SPLIT_COUNT,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080095 DEVLINK_ATTR_PORT_SPLIT_GROUP,
96 DEVLINK_ATTR_SB_INDEX,
97 DEVLINK_ATTR_SB_SIZE,
98 DEVLINK_ATTR_SB_INGRESS_POOL_COUNT,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080099 DEVLINK_ATTR_SB_EGRESS_POOL_COUNT,
100 DEVLINK_ATTR_SB_INGRESS_TC_COUNT,
101 DEVLINK_ATTR_SB_EGRESS_TC_COUNT,
102 DEVLINK_ATTR_SB_POOL_INDEX,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800103 DEVLINK_ATTR_SB_POOL_TYPE,
104 DEVLINK_ATTR_SB_POOL_SIZE,
105 DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE,
106 DEVLINK_ATTR_SB_THRESHOLD,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800107 DEVLINK_ATTR_SB_TC_INDEX,
108 DEVLINK_ATTR_SB_OCC_CUR,
109 DEVLINK_ATTR_SB_OCC_MAX,
110 DEVLINK_ATTR_ESWITCH_MODE,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800111 DEVLINK_ATTR_ESWITCH_INLINE_MODE,
112 __DEVLINK_ATTR_MAX,
113 DEVLINK_ATTR_MAX = __DEVLINK_ATTR_MAX - 1
114};
Christopher Ferris106b3a82016-08-24 12:15:38 -0700115#endif