Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 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 Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 23 | #define DEVLINK_GENL_MCGRP_CONFIG_NAME "config" |
| 24 | enum devlink_command { |
| 25 | DEVLINK_CMD_UNSPEC, |
| 26 | DEVLINK_CMD_GET, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 27 | DEVLINK_CMD_SET, |
| 28 | DEVLINK_CMD_NEW, |
| 29 | DEVLINK_CMD_DEL, |
| 30 | DEVLINK_CMD_PORT_GET, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 31 | DEVLINK_CMD_PORT_SET, |
| 32 | DEVLINK_CMD_PORT_NEW, |
| 33 | DEVLINK_CMD_PORT_DEL, |
| 34 | DEVLINK_CMD_PORT_SPLIT, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 35 | DEVLINK_CMD_PORT_UNSPLIT, |
| 36 | DEVLINK_CMD_SB_GET, |
| 37 | DEVLINK_CMD_SB_SET, |
| 38 | DEVLINK_CMD_SB_NEW, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 39 | DEVLINK_CMD_SB_DEL, |
| 40 | DEVLINK_CMD_SB_POOL_GET, |
| 41 | DEVLINK_CMD_SB_POOL_SET, |
| 42 | DEVLINK_CMD_SB_POOL_NEW, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 43 | 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 Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 47 | 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 Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 51 | DEVLINK_CMD_SB_TC_POOL_BIND_DEL, |
| 52 | DEVLINK_CMD_SB_OCC_SNAPSHOT, |
| 53 | DEVLINK_CMD_SB_OCC_MAX_CLEAR, |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 54 | DEVLINK_CMD_ESWITCH_MODE_GET, |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 55 | DEVLINK_CMD_ESWITCH_MODE_SET, |
| 56 | __DEVLINK_CMD_MAX, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 57 | DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1 |
| 58 | }; |
| 59 | enum devlink_port_type { |
| 60 | DEVLINK_PORT_TYPE_NOTSET, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 61 | DEVLINK_PORT_TYPE_AUTO, |
| 62 | DEVLINK_PORT_TYPE_ETH, |
| 63 | DEVLINK_PORT_TYPE_IB, |
| 64 | }; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 65 | enum devlink_sb_pool_type { |
| 66 | DEVLINK_SB_POOL_TYPE_INGRESS, |
| 67 | DEVLINK_SB_POOL_TYPE_EGRESS, |
| 68 | }; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 69 | enum devlink_sb_threshold_type { |
| 70 | DEVLINK_SB_THRESHOLD_TYPE_STATIC, |
| 71 | DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC, |
| 72 | }; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 73 | #define DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX 20 |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 74 | enum devlink_eswitch_mode { |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 75 | DEVLINK_ESWITCH_MODE_LEGACY, |
| 76 | DEVLINK_ESWITCH_MODE_SWITCHDEV, |
| 77 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 78 | enum devlink_eswitch_inline_mode { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 79 | DEVLINK_ESWITCH_INLINE_MODE_NONE, |
| 80 | DEVLINK_ESWITCH_INLINE_MODE_LINK, |
| 81 | DEVLINK_ESWITCH_INLINE_MODE_NETWORK, |
| 82 | DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 83 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 84 | enum devlink_attr { |
| 85 | DEVLINK_ATTR_UNSPEC, |
| 86 | DEVLINK_ATTR_BUS_NAME, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 87 | DEVLINK_ATTR_DEV_NAME, |
| 88 | DEVLINK_ATTR_PORT_INDEX, |
| 89 | DEVLINK_ATTR_PORT_TYPE, |
| 90 | DEVLINK_ATTR_PORT_DESIRED_TYPE, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 91 | DEVLINK_ATTR_PORT_NETDEV_IFINDEX, |
| 92 | DEVLINK_ATTR_PORT_NETDEV_NAME, |
| 93 | DEVLINK_ATTR_PORT_IBDEV_NAME, |
| 94 | DEVLINK_ATTR_PORT_SPLIT_COUNT, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 95 | DEVLINK_ATTR_PORT_SPLIT_GROUP, |
| 96 | DEVLINK_ATTR_SB_INDEX, |
| 97 | DEVLINK_ATTR_SB_SIZE, |
| 98 | DEVLINK_ATTR_SB_INGRESS_POOL_COUNT, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 99 | 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 Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 103 | DEVLINK_ATTR_SB_POOL_TYPE, |
| 104 | DEVLINK_ATTR_SB_POOL_SIZE, |
| 105 | DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE, |
| 106 | DEVLINK_ATTR_SB_THRESHOLD, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 107 | DEVLINK_ATTR_SB_TC_INDEX, |
| 108 | DEVLINK_ATTR_SB_OCC_CUR, |
| 109 | DEVLINK_ATTR_SB_OCC_MAX, |
| 110 | DEVLINK_ATTR_ESWITCH_MODE, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 111 | DEVLINK_ATTR_ESWITCH_INLINE_MODE, |
| 112 | __DEVLINK_ATTR_MAX, |
| 113 | DEVLINK_ATTR_MAX = __DEVLINK_ATTR_MAX - 1 |
| 114 | }; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 115 | #endif |