Home | History | Annotate | Download | only in linux
      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
     23 #define DEVLINK_GENL_MCGRP_CONFIG_NAME "config"
     24 enum devlink_command {
     25   DEVLINK_CMD_UNSPEC,
     26   DEVLINK_CMD_GET,
     27   DEVLINK_CMD_SET,
     28   DEVLINK_CMD_NEW,
     29   DEVLINK_CMD_DEL,
     30   DEVLINK_CMD_PORT_GET,
     31   DEVLINK_CMD_PORT_SET,
     32   DEVLINK_CMD_PORT_NEW,
     33   DEVLINK_CMD_PORT_DEL,
     34   DEVLINK_CMD_PORT_SPLIT,
     35   DEVLINK_CMD_PORT_UNSPLIT,
     36   DEVLINK_CMD_SB_GET,
     37   DEVLINK_CMD_SB_SET,
     38   DEVLINK_CMD_SB_NEW,
     39   DEVLINK_CMD_SB_DEL,
     40   DEVLINK_CMD_SB_POOL_GET,
     41   DEVLINK_CMD_SB_POOL_SET,
     42   DEVLINK_CMD_SB_POOL_NEW,
     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,
     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,
     51   DEVLINK_CMD_SB_TC_POOL_BIND_DEL,
     52   DEVLINK_CMD_SB_OCC_SNAPSHOT,
     53   DEVLINK_CMD_SB_OCC_MAX_CLEAR,
     54   DEVLINK_CMD_ESWITCH_GET,
     55 #define DEVLINK_CMD_ESWITCH_MODE_GET DEVLINK_CMD_ESWITCH_GET
     56   DEVLINK_CMD_ESWITCH_SET,
     57 #define DEVLINK_CMD_ESWITCH_MODE_SET DEVLINK_CMD_ESWITCH_SET
     58   DEVLINK_CMD_DPIPE_TABLE_GET,
     59   DEVLINK_CMD_DPIPE_ENTRIES_GET,
     60   DEVLINK_CMD_DPIPE_HEADERS_GET,
     61   DEVLINK_CMD_DPIPE_TABLE_COUNTERS_SET,
     62   DEVLINK_CMD_RESOURCE_SET,
     63   DEVLINK_CMD_RESOURCE_DUMP,
     64   DEVLINK_CMD_RELOAD,
     65   DEVLINK_CMD_PARAM_GET,
     66   DEVLINK_CMD_PARAM_SET,
     67   DEVLINK_CMD_PARAM_NEW,
     68   DEVLINK_CMD_PARAM_DEL,
     69   DEVLINK_CMD_REGION_GET,
     70   DEVLINK_CMD_REGION_SET,
     71   DEVLINK_CMD_REGION_NEW,
     72   DEVLINK_CMD_REGION_DEL,
     73   DEVLINK_CMD_REGION_READ,
     74   __DEVLINK_CMD_MAX,
     75   DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1
     76 };
     77 enum devlink_port_type {
     78   DEVLINK_PORT_TYPE_NOTSET,
     79   DEVLINK_PORT_TYPE_AUTO,
     80   DEVLINK_PORT_TYPE_ETH,
     81   DEVLINK_PORT_TYPE_IB,
     82 };
     83 enum devlink_sb_pool_type {
     84   DEVLINK_SB_POOL_TYPE_INGRESS,
     85   DEVLINK_SB_POOL_TYPE_EGRESS,
     86 };
     87 enum devlink_sb_threshold_type {
     88   DEVLINK_SB_THRESHOLD_TYPE_STATIC,
     89   DEVLINK_SB_THRESHOLD_TYPE_DYNAMIC,
     90 };
     91 #define DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX 20
     92 enum devlink_eswitch_mode {
     93   DEVLINK_ESWITCH_MODE_LEGACY,
     94   DEVLINK_ESWITCH_MODE_SWITCHDEV,
     95 };
     96 enum devlink_eswitch_inline_mode {
     97   DEVLINK_ESWITCH_INLINE_MODE_NONE,
     98   DEVLINK_ESWITCH_INLINE_MODE_LINK,
     99   DEVLINK_ESWITCH_INLINE_MODE_NETWORK,
    100   DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT,
    101 };
    102 enum devlink_eswitch_encap_mode {
    103   DEVLINK_ESWITCH_ENCAP_MODE_NONE,
    104   DEVLINK_ESWITCH_ENCAP_MODE_BASIC,
    105 };
    106 enum devlink_port_flavour {
    107   DEVLINK_PORT_FLAVOUR_PHYSICAL,
    108   DEVLINK_PORT_FLAVOUR_CPU,
    109   DEVLINK_PORT_FLAVOUR_DSA,
    110 };
    111 enum devlink_param_cmode {
    112   DEVLINK_PARAM_CMODE_RUNTIME,
    113   DEVLINK_PARAM_CMODE_DRIVERINIT,
    114   DEVLINK_PARAM_CMODE_PERMANENT,
    115   __DEVLINK_PARAM_CMODE_MAX,
    116   DEVLINK_PARAM_CMODE_MAX = __DEVLINK_PARAM_CMODE_MAX - 1
    117 };
    118 enum devlink_param_fw_load_policy_value {
    119   DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER,
    120   DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH,
    121 };
    122 enum devlink_attr {
    123   DEVLINK_ATTR_UNSPEC,
    124   DEVLINK_ATTR_BUS_NAME,
    125   DEVLINK_ATTR_DEV_NAME,
    126   DEVLINK_ATTR_PORT_INDEX,
    127   DEVLINK_ATTR_PORT_TYPE,
    128   DEVLINK_ATTR_PORT_DESIRED_TYPE,
    129   DEVLINK_ATTR_PORT_NETDEV_IFINDEX,
    130   DEVLINK_ATTR_PORT_NETDEV_NAME,
    131   DEVLINK_ATTR_PORT_IBDEV_NAME,
    132   DEVLINK_ATTR_PORT_SPLIT_COUNT,
    133   DEVLINK_ATTR_PORT_SPLIT_GROUP,
    134   DEVLINK_ATTR_SB_INDEX,
    135   DEVLINK_ATTR_SB_SIZE,
    136   DEVLINK_ATTR_SB_INGRESS_POOL_COUNT,
    137   DEVLINK_ATTR_SB_EGRESS_POOL_COUNT,
    138   DEVLINK_ATTR_SB_INGRESS_TC_COUNT,
    139   DEVLINK_ATTR_SB_EGRESS_TC_COUNT,
    140   DEVLINK_ATTR_SB_POOL_INDEX,
    141   DEVLINK_ATTR_SB_POOL_TYPE,
    142   DEVLINK_ATTR_SB_POOL_SIZE,
    143   DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE,
    144   DEVLINK_ATTR_SB_THRESHOLD,
    145   DEVLINK_ATTR_SB_TC_INDEX,
    146   DEVLINK_ATTR_SB_OCC_CUR,
    147   DEVLINK_ATTR_SB_OCC_MAX,
    148   DEVLINK_ATTR_ESWITCH_MODE,
    149   DEVLINK_ATTR_ESWITCH_INLINE_MODE,
    150   DEVLINK_ATTR_DPIPE_TABLES,
    151   DEVLINK_ATTR_DPIPE_TABLE,
    152   DEVLINK_ATTR_DPIPE_TABLE_NAME,
    153   DEVLINK_ATTR_DPIPE_TABLE_SIZE,
    154   DEVLINK_ATTR_DPIPE_TABLE_MATCHES,
    155   DEVLINK_ATTR_DPIPE_TABLE_ACTIONS,
    156   DEVLINK_ATTR_DPIPE_TABLE_COUNTERS_ENABLED,
    157   DEVLINK_ATTR_DPIPE_ENTRIES,
    158   DEVLINK_ATTR_DPIPE_ENTRY,
    159   DEVLINK_ATTR_DPIPE_ENTRY_INDEX,
    160   DEVLINK_ATTR_DPIPE_ENTRY_MATCH_VALUES,
    161   DEVLINK_ATTR_DPIPE_ENTRY_ACTION_VALUES,
    162   DEVLINK_ATTR_DPIPE_ENTRY_COUNTER,
    163   DEVLINK_ATTR_DPIPE_MATCH,
    164   DEVLINK_ATTR_DPIPE_MATCH_VALUE,
    165   DEVLINK_ATTR_DPIPE_MATCH_TYPE,
    166   DEVLINK_ATTR_DPIPE_ACTION,
    167   DEVLINK_ATTR_DPIPE_ACTION_VALUE,
    168   DEVLINK_ATTR_DPIPE_ACTION_TYPE,
    169   DEVLINK_ATTR_DPIPE_VALUE,
    170   DEVLINK_ATTR_DPIPE_VALUE_MASK,
    171   DEVLINK_ATTR_DPIPE_VALUE_MAPPING,
    172   DEVLINK_ATTR_DPIPE_HEADERS,
    173   DEVLINK_ATTR_DPIPE_HEADER,
    174   DEVLINK_ATTR_DPIPE_HEADER_NAME,
    175   DEVLINK_ATTR_DPIPE_HEADER_ID,
    176   DEVLINK_ATTR_DPIPE_HEADER_FIELDS,
    177   DEVLINK_ATTR_DPIPE_HEADER_GLOBAL,
    178   DEVLINK_ATTR_DPIPE_HEADER_INDEX,
    179   DEVLINK_ATTR_DPIPE_FIELD,
    180   DEVLINK_ATTR_DPIPE_FIELD_NAME,
    181   DEVLINK_ATTR_DPIPE_FIELD_ID,
    182   DEVLINK_ATTR_DPIPE_FIELD_BITWIDTH,
    183   DEVLINK_ATTR_DPIPE_FIELD_MAPPING_TYPE,
    184   DEVLINK_ATTR_PAD,
    185   DEVLINK_ATTR_ESWITCH_ENCAP_MODE,
    186   DEVLINK_ATTR_RESOURCE_LIST,
    187   DEVLINK_ATTR_RESOURCE,
    188   DEVLINK_ATTR_RESOURCE_NAME,
    189   DEVLINK_ATTR_RESOURCE_ID,
    190   DEVLINK_ATTR_RESOURCE_SIZE,
    191   DEVLINK_ATTR_RESOURCE_SIZE_NEW,
    192   DEVLINK_ATTR_RESOURCE_SIZE_VALID,
    193   DEVLINK_ATTR_RESOURCE_SIZE_MIN,
    194   DEVLINK_ATTR_RESOURCE_SIZE_MAX,
    195   DEVLINK_ATTR_RESOURCE_SIZE_GRAN,
    196   DEVLINK_ATTR_RESOURCE_UNIT,
    197   DEVLINK_ATTR_RESOURCE_OCC,
    198   DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_ID,
    199   DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_UNITS,
    200   DEVLINK_ATTR_PORT_FLAVOUR,
    201   DEVLINK_ATTR_PORT_NUMBER,
    202   DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER,
    203   DEVLINK_ATTR_PARAM,
    204   DEVLINK_ATTR_PARAM_NAME,
    205   DEVLINK_ATTR_PARAM_GENERIC,
    206   DEVLINK_ATTR_PARAM_TYPE,
    207   DEVLINK_ATTR_PARAM_VALUES_LIST,
    208   DEVLINK_ATTR_PARAM_VALUE,
    209   DEVLINK_ATTR_PARAM_VALUE_DATA,
    210   DEVLINK_ATTR_PARAM_VALUE_CMODE,
    211   DEVLINK_ATTR_REGION_NAME,
    212   DEVLINK_ATTR_REGION_SIZE,
    213   DEVLINK_ATTR_REGION_SNAPSHOTS,
    214   DEVLINK_ATTR_REGION_SNAPSHOT,
    215   DEVLINK_ATTR_REGION_SNAPSHOT_ID,
    216   DEVLINK_ATTR_REGION_CHUNKS,
    217   DEVLINK_ATTR_REGION_CHUNK,
    218   DEVLINK_ATTR_REGION_CHUNK_DATA,
    219   DEVLINK_ATTR_REGION_CHUNK_ADDR,
    220   DEVLINK_ATTR_REGION_CHUNK_LEN,
    221   __DEVLINK_ATTR_MAX,
    222   DEVLINK_ATTR_MAX = __DEVLINK_ATTR_MAX - 1
    223 };
    224 enum devlink_dpipe_field_mapping_type {
    225   DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE,
    226   DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX,
    227 };
    228 enum devlink_dpipe_match_type {
    229   DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT,
    230 };
    231 enum devlink_dpipe_action_type {
    232   DEVLINK_DPIPE_ACTION_TYPE_FIELD_MODIFY,
    233 };
    234 enum devlink_dpipe_field_ethernet_id {
    235   DEVLINK_DPIPE_FIELD_ETHERNET_DST_MAC,
    236 };
    237 enum devlink_dpipe_field_ipv4_id {
    238   DEVLINK_DPIPE_FIELD_IPV4_DST_IP,
    239 };
    240 enum devlink_dpipe_field_ipv6_id {
    241   DEVLINK_DPIPE_FIELD_IPV6_DST_IP,
    242 };
    243 enum devlink_dpipe_header_id {
    244   DEVLINK_DPIPE_HEADER_ETHERNET,
    245   DEVLINK_DPIPE_HEADER_IPV4,
    246   DEVLINK_DPIPE_HEADER_IPV6,
    247 };
    248 enum devlink_resource_unit {
    249   DEVLINK_RESOURCE_UNIT_ENTRY,
    250 };
    251 #endif
    252