linux/include/linux/dcbnl.h
<<
>>
Prefs
   1/*
   2 * Copyright (c) 2008-2011, Intel Corporation.
   3 *
   4 * This program is free software; you can redistribute it and/or modify it
   5 * under the terms and conditions of the GNU General Public License,
   6 * version 2, as published by the Free Software Foundation.
   7 *
   8 * This program is distributed in the hope it will be useful, but WITHOUT
   9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  11 * more details.
  12 *
  13 * You should have received a copy of the GNU General Public License along with
  14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  15 * Place - Suite 330, Boston, MA 02111-1307 USA.
  16 *
  17 * Author: Lucy Liu <lucy.liu@intel.com>
  18 */
  19
  20#ifndef __LINUX_DCBNL_H__
  21#define __LINUX_DCBNL_H__
  22
  23#include <linux/types.h>
  24
  25/* IEEE 802.1Qaz std supported values */
  26#define IEEE_8021QAZ_MAX_TCS    8
  27
  28#define IEEE_8021QAZ_TSA_STRICT         0
  29#define IEEE_8021QAZ_TSA_CB_SHAPER      1
  30#define IEEE_8021QAZ_TSA_ETS            2
  31#define IEEE_8021QAZ_TSA_VENDOR         255
  32
  33/* This structure contains the IEEE 802.1Qaz ETS managed object
  34 *
  35 * @willing: willing bit in ETS configuration TLV
  36 * @ets_cap: indicates supported capacity of ets feature
  37 * @cbs: credit based shaper ets algorithm supported
  38 * @tc_tx_bw: tc tx bandwidth indexed by traffic class
  39 * @tc_rx_bw: tc rx bandwidth indexed by traffic class
  40 * @tc_tsa: TSA Assignment table, indexed by traffic class
  41 * @prio_tc: priority assignment table mapping 8021Qp to traffic class
  42 * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV
  43 * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV
  44 * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV
  45 *
  46 * Recommended values are used to set fields in the ETS recommendation TLV
  47 * with hardware offloaded LLDP.
  48 *
  49 * ----
  50 *  TSA Assignment 8 bit identifiers
  51 *      0       strict priority
  52 *      1       credit-based shaper
  53 *      2       enhanced transmission selection
  54 *      3-254   reserved
  55 *      255     vendor specific
  56 */
  57struct ieee_ets {
  58        __u8    willing;
  59        __u8    ets_cap;
  60        __u8    cbs;
  61        __u8    tc_tx_bw[IEEE_8021QAZ_MAX_TCS];
  62        __u8    tc_rx_bw[IEEE_8021QAZ_MAX_TCS];
  63        __u8    tc_tsa[IEEE_8021QAZ_MAX_TCS];
  64        __u8    prio_tc[IEEE_8021QAZ_MAX_TCS];
  65        __u8    tc_reco_bw[IEEE_8021QAZ_MAX_TCS];
  66        __u8    tc_reco_tsa[IEEE_8021QAZ_MAX_TCS];
  67        __u8    reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
  68};
  69
  70/* This structure contains rate limit extension to the IEEE 802.1Qaz ETS
  71 * managed object.
  72 * Values are 64 bits long and specified in Kbps to enable usage over both
  73 * slow and very fast networks.
  74 *
  75 * @tc_maxrate: maximal tc tx bandwidth indexed by traffic class
  76 */
  77struct ieee_maxrate {
  78        __u64   tc_maxrate[IEEE_8021QAZ_MAX_TCS];
  79};
  80
  81/* This structure contains the IEEE 802.1Qaz PFC managed object
  82 *
  83 * @pfc_cap: Indicates the number of traffic classes on the local device
  84 *           that may simultaneously have PFC enabled.
  85 * @pfc_en: bitmap indicating pfc enabled traffic classes
  86 * @mbc: enable macsec bypass capability
  87 * @delay: the allowance made for a round-trip propagation delay of the
  88 *         link in bits.
  89 * @requests: count of the sent pfc frames
  90 * @indications: count of the received pfc frames
  91 */
  92struct ieee_pfc {
  93        __u8    pfc_cap;
  94        __u8    pfc_en;
  95        __u8    mbc;
  96        __u16   delay;
  97        __u64   requests[IEEE_8021QAZ_MAX_TCS];
  98        __u64   indications[IEEE_8021QAZ_MAX_TCS];
  99};
 100
 101/* CEE DCBX std supported values */
 102#define CEE_DCBX_MAX_PGS        8
 103#define CEE_DCBX_MAX_PRIO       8
 104
 105/**
 106 * struct cee_pg - CEE Priority-Group managed object
 107 *
 108 * @willing: willing bit in the PG tlv
 109 * @error: error bit in the PG tlv
 110 * @pg_en: enable bit of the PG feature
 111 * @tcs_supported: number of traffic classes supported
 112 * @pg_bw: bandwidth percentage for each priority group
 113 * @prio_pg: priority to PG mapping indexed by priority
 114 */
 115struct cee_pg {
 116        __u8    willing;
 117        __u8    error;
 118        __u8    pg_en;
 119        __u8    tcs_supported;
 120        __u8    pg_bw[CEE_DCBX_MAX_PGS];
 121        __u8    prio_pg[CEE_DCBX_MAX_PGS];
 122};
 123
 124/**
 125 * struct cee_pfc - CEE PFC managed object
 126 *
 127 * @willing: willing bit in the PFC tlv
 128 * @error: error bit in the PFC tlv
 129 * @pfc_en: bitmap indicating pfc enabled traffic classes
 130 * @tcs_supported: number of traffic classes supported
 131 */
 132struct cee_pfc {
 133        __u8    willing;
 134        __u8    error;
 135        __u8    pfc_en;
 136        __u8    tcs_supported;
 137};
 138
 139/* IEEE 802.1Qaz std supported values */
 140#define IEEE_8021QAZ_APP_SEL_ETHERTYPE  1
 141#define IEEE_8021QAZ_APP_SEL_STREAM     2
 142#define IEEE_8021QAZ_APP_SEL_DGRAM      3
 143#define IEEE_8021QAZ_APP_SEL_ANY        4
 144
 145/* This structure contains the IEEE 802.1Qaz APP managed object. This
 146 * object is also used for the CEE std as well. There is no difference
 147 * between the objects.
 148 *
 149 * @selector: protocol identifier type
 150 * @protocol: protocol of type indicated
 151 * @priority: 3-bit unsigned integer indicating priority
 152 *
 153 * ----
 154 *  Selector field values
 155 *      0       Reserved
 156 *      1       Ethertype
 157 *      2       Well known port number over TCP or SCTP
 158 *      3       Well known port number over UDP or DCCP
 159 *      4       Well known port number over TCP, SCTP, UDP, or DCCP
 160 *      5-7     Reserved
 161 */
 162struct dcb_app {
 163        __u8    selector;
 164        __u8    priority;
 165        __u16   protocol;
 166};
 167
 168/**
 169 * struct dcb_peer_app_info - APP feature information sent by the peer
 170 *
 171 * @willing: willing bit in the peer APP tlv
 172 * @error: error bit in the peer APP tlv
 173 *
 174 * In addition to this information the full peer APP tlv also contains
 175 * a table of 'app_count' APP objects defined above.
 176 */
 177struct dcb_peer_app_info {
 178        __u8    willing;
 179        __u8    error;
 180};
 181
 182struct dcbmsg {
 183        __u8               dcb_family;
 184        __u8               cmd;
 185        __u16              dcb_pad;
 186};
 187
 188/**
 189 * enum dcbnl_commands - supported DCB commands
 190 *
 191 * @DCB_CMD_UNDEFINED: unspecified command to catch errors
 192 * @DCB_CMD_GSTATE: request the state of DCB in the device
 193 * @DCB_CMD_SSTATE: set the state of DCB in the device
 194 * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
 195 * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
 196 * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
 197 * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
 198 * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
 199 * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
 200 * @DCB_CMD_SET_ALL: apply all changes to the underlying device
 201 * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
 202 *                        device.  Only useful when using bonding.
 203 * @DCB_CMD_GCAP: request the DCB capabilities of the device
 204 * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
 205 * @DCB_CMD_SNUMTCS: set the number of traffic classes
 206 * @DCB_CMD_GBCN: set backward congestion notification configuration
 207 * @DCB_CMD_SBCN: get backward congestion notification configration.
 208 * @DCB_CMD_GAPP: get application protocol configuration
 209 * @DCB_CMD_SAPP: set application protocol configuration
 210 * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
 211 * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
 212 * @DCB_CMD_GDCBX: get DCBX engine configuration
 213 * @DCB_CMD_SDCBX: set DCBX engine configuration
 214 * @DCB_CMD_GFEATCFG: get DCBX features flags
 215 * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
 216 * @DCB_CMD_CEE_GET: get CEE aggregated configuration
 217 * @DCB_CMD_IEEE_DEL: delete IEEE 802.1Qaz configuration
 218 */
 219enum dcbnl_commands {
 220        DCB_CMD_UNDEFINED,
 221
 222        DCB_CMD_GSTATE,
 223        DCB_CMD_SSTATE,
 224
 225        DCB_CMD_PGTX_GCFG,
 226        DCB_CMD_PGTX_SCFG,
 227        DCB_CMD_PGRX_GCFG,
 228        DCB_CMD_PGRX_SCFG,
 229
 230        DCB_CMD_PFC_GCFG,
 231        DCB_CMD_PFC_SCFG,
 232
 233        DCB_CMD_SET_ALL,
 234
 235        DCB_CMD_GPERM_HWADDR,
 236
 237        DCB_CMD_GCAP,
 238
 239        DCB_CMD_GNUMTCS,
 240        DCB_CMD_SNUMTCS,
 241
 242        DCB_CMD_PFC_GSTATE,
 243        DCB_CMD_PFC_SSTATE,
 244
 245        DCB_CMD_BCN_GCFG,
 246        DCB_CMD_BCN_SCFG,
 247
 248        DCB_CMD_GAPP,
 249        DCB_CMD_SAPP,
 250
 251        DCB_CMD_IEEE_SET,
 252        DCB_CMD_IEEE_GET,
 253
 254        DCB_CMD_GDCBX,
 255        DCB_CMD_SDCBX,
 256
 257        DCB_CMD_GFEATCFG,
 258        DCB_CMD_SFEATCFG,
 259
 260        DCB_CMD_CEE_GET,
 261        DCB_CMD_IEEE_DEL,
 262
 263        __DCB_CMD_ENUM_MAX,
 264        DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
 265};
 266
 267/**
 268 * enum dcbnl_attrs - DCB top-level netlink attributes
 269 *
 270 * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
 271 * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
 272 * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
 273 * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
 274 * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
 275 * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
 276 * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
 277 * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
 278 * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
 279 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
 280 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
 281 * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
 282 * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
 283 * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
 284 * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
 285 * @DCB_ATTR_CEE: CEE std supported attributes (NLA_NESTED)
 286 */
 287enum dcbnl_attrs {
 288        DCB_ATTR_UNDEFINED,
 289
 290        DCB_ATTR_IFNAME,
 291        DCB_ATTR_STATE,
 292        DCB_ATTR_PFC_STATE,
 293        DCB_ATTR_PFC_CFG,
 294        DCB_ATTR_NUM_TC,
 295        DCB_ATTR_PG_CFG,
 296        DCB_ATTR_SET_ALL,
 297        DCB_ATTR_PERM_HWADDR,
 298        DCB_ATTR_CAP,
 299        DCB_ATTR_NUMTCS,
 300        DCB_ATTR_BCN,
 301        DCB_ATTR_APP,
 302
 303        /* IEEE std attributes */
 304        DCB_ATTR_IEEE,
 305
 306        DCB_ATTR_DCBX,
 307        DCB_ATTR_FEATCFG,
 308
 309        /* CEE nested attributes */
 310        DCB_ATTR_CEE,
 311
 312        __DCB_ATTR_ENUM_MAX,
 313        DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
 314};
 315
 316/**
 317 * enum ieee_attrs - IEEE 802.1Qaz get/set attributes
 318 *
 319 * @DCB_ATTR_IEEE_UNSPEC: unspecified
 320 * @DCB_ATTR_IEEE_ETS: negotiated ETS configuration
 321 * @DCB_ATTR_IEEE_PFC: negotiated PFC configuration
 322 * @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration
 323 * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
 324 * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
 325 * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
 326 */
 327enum ieee_attrs {
 328        DCB_ATTR_IEEE_UNSPEC,
 329        DCB_ATTR_IEEE_ETS,
 330        DCB_ATTR_IEEE_PFC,
 331        DCB_ATTR_IEEE_APP_TABLE,
 332        DCB_ATTR_IEEE_PEER_ETS,
 333        DCB_ATTR_IEEE_PEER_PFC,
 334        DCB_ATTR_IEEE_PEER_APP,
 335        DCB_ATTR_IEEE_MAXRATE,
 336        __DCB_ATTR_IEEE_MAX
 337};
 338#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
 339
 340enum ieee_attrs_app {
 341        DCB_ATTR_IEEE_APP_UNSPEC,
 342        DCB_ATTR_IEEE_APP,
 343        __DCB_ATTR_IEEE_APP_MAX
 344};
 345#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
 346
 347/**
 348 * enum cee_attrs - CEE DCBX get attributes.
 349 *
 350 * @DCB_ATTR_CEE_UNSPEC: unspecified
 351 * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
 352 * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
 353 * @DCB_ATTR_CEE_PEER_APP_TABLE: peer APP tlv - get only
 354 * @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG)
 355 * @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG)
 356 * @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG)
 357 * @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP)
 358 * @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG)
 359 *
 360 * An aggregated collection of the cee std negotiated parameters.
 361 */
 362enum cee_attrs {
 363        DCB_ATTR_CEE_UNSPEC,
 364        DCB_ATTR_CEE_PEER_PG,
 365        DCB_ATTR_CEE_PEER_PFC,
 366        DCB_ATTR_CEE_PEER_APP_TABLE,
 367        DCB_ATTR_CEE_TX_PG,
 368        DCB_ATTR_CEE_RX_PG,
 369        DCB_ATTR_CEE_PFC,
 370        DCB_ATTR_CEE_APP_TABLE,
 371        DCB_ATTR_CEE_FEAT,
 372        __DCB_ATTR_CEE_MAX
 373};
 374#define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
 375
 376enum peer_app_attr {
 377        DCB_ATTR_CEE_PEER_APP_UNSPEC,
 378        DCB_ATTR_CEE_PEER_APP_INFO,
 379        DCB_ATTR_CEE_PEER_APP,
 380        __DCB_ATTR_CEE_PEER_APP_MAX
 381};
 382#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
 383
 384enum cee_attrs_app {
 385        DCB_ATTR_CEE_APP_UNSPEC,
 386        DCB_ATTR_CEE_APP,
 387        __DCB_ATTR_CEE_APP_MAX
 388};
 389#define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1)
 390
 391/**
 392 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
 393 *
 394 * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
 395 * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
 396 * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
 397 * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
 398 * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
 399 * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
 400 * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
 401 * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
 402 * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
 403 * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
 404 * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
 405 *
 406 */
 407enum dcbnl_pfc_up_attrs {
 408        DCB_PFC_UP_ATTR_UNDEFINED,
 409
 410        DCB_PFC_UP_ATTR_0,
 411        DCB_PFC_UP_ATTR_1,
 412        DCB_PFC_UP_ATTR_2,
 413        DCB_PFC_UP_ATTR_3,
 414        DCB_PFC_UP_ATTR_4,
 415        DCB_PFC_UP_ATTR_5,
 416        DCB_PFC_UP_ATTR_6,
 417        DCB_PFC_UP_ATTR_7,
 418        DCB_PFC_UP_ATTR_ALL,
 419
 420        __DCB_PFC_UP_ATTR_ENUM_MAX,
 421        DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
 422};
 423
 424/**
 425 * enum dcbnl_pg_attrs - DCB Priority Group attributes
 426 *
 427 * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
 428 * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
 429 * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
 430 * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
 431 * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
 432 * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
 433 * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
 434 * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
 435 * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
 436 * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
 437 * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
 438 * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
 439 * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
 440 * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
 441 * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
 442 * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
 443 * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
 444 * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
 445 * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
 446 * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
 447 * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
 448 *
 449 */
 450enum dcbnl_pg_attrs {
 451        DCB_PG_ATTR_UNDEFINED,
 452
 453        DCB_PG_ATTR_TC_0,
 454        DCB_PG_ATTR_TC_1,
 455        DCB_PG_ATTR_TC_2,
 456        DCB_PG_ATTR_TC_3,
 457        DCB_PG_ATTR_TC_4,
 458        DCB_PG_ATTR_TC_5,
 459        DCB_PG_ATTR_TC_6,
 460        DCB_PG_ATTR_TC_7,
 461        DCB_PG_ATTR_TC_MAX,
 462        DCB_PG_ATTR_TC_ALL,
 463
 464        DCB_PG_ATTR_BW_ID_0,
 465        DCB_PG_ATTR_BW_ID_1,
 466        DCB_PG_ATTR_BW_ID_2,
 467        DCB_PG_ATTR_BW_ID_3,
 468        DCB_PG_ATTR_BW_ID_4,
 469        DCB_PG_ATTR_BW_ID_5,
 470        DCB_PG_ATTR_BW_ID_6,
 471        DCB_PG_ATTR_BW_ID_7,
 472        DCB_PG_ATTR_BW_ID_MAX,
 473        DCB_PG_ATTR_BW_ID_ALL,
 474
 475        __DCB_PG_ATTR_ENUM_MAX,
 476        DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
 477};
 478
 479/**
 480 * enum dcbnl_tc_attrs - DCB Traffic Class attributes
 481 *
 482 * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
 483 * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
 484 *                          Valid values are:  0-7
 485 * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
 486 *                                Some devices may not support changing the
 487 *                                user priority map of a TC.
 488 * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
 489 *                                 0 - none
 490 *                                 1 - group strict
 491 *                                 2 - link strict
 492 * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
 493 *                            not configured to use link strict priority,
 494 *                            this is the percentage of bandwidth of the
 495 *                            priority group this traffic class belongs to
 496 * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
 497 *
 498 */
 499enum dcbnl_tc_attrs {
 500        DCB_TC_ATTR_PARAM_UNDEFINED,
 501
 502        DCB_TC_ATTR_PARAM_PGID,
 503        DCB_TC_ATTR_PARAM_UP_MAPPING,
 504        DCB_TC_ATTR_PARAM_STRICT_PRIO,
 505        DCB_TC_ATTR_PARAM_BW_PCT,
 506        DCB_TC_ATTR_PARAM_ALL,
 507
 508        __DCB_TC_ATTR_PARAM_ENUM_MAX,
 509        DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
 510};
 511
 512/**
 513 * enum dcbnl_cap_attrs - DCB Capability attributes
 514 *
 515 * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
 516 * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
 517 * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
 518 * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
 519 * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
 520 *                               traffic class mapping
 521 * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
 522 *                                number of traffic classes the device
 523 *                                can be configured to use for Priority Groups
 524 * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
 525 *                                 number of traffic classes the device can be
 526 *                                 configured to use for Priority Flow Control
 527 * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
 528 * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
 529 *                             Notification
 530 * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
 531 *
 532 */
 533enum dcbnl_cap_attrs {
 534        DCB_CAP_ATTR_UNDEFINED,
 535        DCB_CAP_ATTR_ALL,
 536        DCB_CAP_ATTR_PG,
 537        DCB_CAP_ATTR_PFC,
 538        DCB_CAP_ATTR_UP2TC,
 539        DCB_CAP_ATTR_PG_TCS,
 540        DCB_CAP_ATTR_PFC_TCS,
 541        DCB_CAP_ATTR_GSP,
 542        DCB_CAP_ATTR_BCN,
 543        DCB_CAP_ATTR_DCBX,
 544
 545        __DCB_CAP_ATTR_ENUM_MAX,
 546        DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
 547};
 548
 549/**
 550 * DCBX capability flags
 551 *
 552 * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
 553 *                     'set' routines are used to configure the device with
 554 *                     the negotiated parameters
 555 *
 556 * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
 557 *                            by another entity
 558 *                            'get' routines are used to retrieve the
 559 *                            negotiated parameters
 560 *                            'set' routines can be used to set the initial
 561 *                            negotiation configuration
 562 *
 563 * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
 564 *                        supports the CEE protocol flavor
 565 *
 566 * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
 567 *                         supports the IEEE protocol flavor
 568 *
 569 * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
 570 *                       supports static configuration (i.e no actual
 571 *                       negotiation is performed negotiated parameters equal
 572 *                       the initial configuration)
 573 *
 574 */
 575#define DCB_CAP_DCBX_HOST               0x01
 576#define DCB_CAP_DCBX_LLD_MANAGED        0x02
 577#define DCB_CAP_DCBX_VER_CEE            0x04
 578#define DCB_CAP_DCBX_VER_IEEE           0x08
 579#define DCB_CAP_DCBX_STATIC             0x10
 580
 581/**
 582 * enum dcbnl_numtcs_attrs - number of traffic classes
 583 *
 584 * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
 585 * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
 586 * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
 587 *                               priority groups
 588 * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
 589 *                                support priority flow control
 590 */
 591enum dcbnl_numtcs_attrs {
 592        DCB_NUMTCS_ATTR_UNDEFINED,
 593        DCB_NUMTCS_ATTR_ALL,
 594        DCB_NUMTCS_ATTR_PG,
 595        DCB_NUMTCS_ATTR_PFC,
 596
 597        __DCB_NUMTCS_ATTR_ENUM_MAX,
 598        DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
 599};
 600
 601enum dcbnl_bcn_attrs{
 602        DCB_BCN_ATTR_UNDEFINED = 0,
 603
 604        DCB_BCN_ATTR_RP_0,
 605        DCB_BCN_ATTR_RP_1,
 606        DCB_BCN_ATTR_RP_2,
 607        DCB_BCN_ATTR_RP_3,
 608        DCB_BCN_ATTR_RP_4,
 609        DCB_BCN_ATTR_RP_5,
 610        DCB_BCN_ATTR_RP_6,
 611        DCB_BCN_ATTR_RP_7,
 612        DCB_BCN_ATTR_RP_ALL,
 613
 614        DCB_BCN_ATTR_BCNA_0,
 615        DCB_BCN_ATTR_BCNA_1,
 616        DCB_BCN_ATTR_ALPHA,
 617        DCB_BCN_ATTR_BETA,
 618        DCB_BCN_ATTR_GD,
 619        DCB_BCN_ATTR_GI,
 620        DCB_BCN_ATTR_TMAX,
 621        DCB_BCN_ATTR_TD,
 622        DCB_BCN_ATTR_RMIN,
 623        DCB_BCN_ATTR_W,
 624        DCB_BCN_ATTR_RD,
 625        DCB_BCN_ATTR_RU,
 626        DCB_BCN_ATTR_WRTT,
 627        DCB_BCN_ATTR_RI,
 628        DCB_BCN_ATTR_C,
 629        DCB_BCN_ATTR_ALL,
 630
 631        __DCB_BCN_ATTR_ENUM_MAX,
 632        DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
 633};
 634
 635/**
 636 * enum dcb_general_attr_values - general DCB attribute values
 637 *
 638 * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
 639 *
 640 */
 641enum dcb_general_attr_values {
 642        DCB_ATTR_VALUE_UNDEFINED = 0xff
 643};
 644
 645#define DCB_APP_IDTYPE_ETHTYPE  0x00
 646#define DCB_APP_IDTYPE_PORTNUM  0x01
 647enum dcbnl_app_attrs {
 648        DCB_APP_ATTR_UNDEFINED,
 649
 650        DCB_APP_ATTR_IDTYPE,
 651        DCB_APP_ATTR_ID,
 652        DCB_APP_ATTR_PRIORITY,
 653
 654        __DCB_APP_ATTR_ENUM_MAX,
 655        DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
 656};
 657
 658/**
 659 * enum dcbnl_featcfg_attrs - features conifiguration flags
 660 *
 661 * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
 662 * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
 663 * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
 664 * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
 665 *                                 flow control
 666 * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
 667 *
 668 */
 669#define DCB_FEATCFG_ERROR       0x01    /* error in feature resolution */
 670#define DCB_FEATCFG_ENABLE      0x02    /* enable feature */
 671#define DCB_FEATCFG_WILLING     0x04    /* feature is willing */
 672#define DCB_FEATCFG_ADVERTISE   0x08    /* advertise feature */
 673enum dcbnl_featcfg_attrs {
 674        DCB_FEATCFG_ATTR_UNDEFINED,
 675        DCB_FEATCFG_ATTR_ALL,
 676        DCB_FEATCFG_ATTR_PG,
 677        DCB_FEATCFG_ATTR_PFC,
 678        DCB_FEATCFG_ATTR_APP,
 679
 680        __DCB_FEATCFG_ATTR_ENUM_MAX,
 681        DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
 682};
 683
 684#endif /* __LINUX_DCBNL_H__ */
 685
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.