Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * Copyright (c) 2008-2011, Intel Corporation.
0004  *
0005  * This program is free software; you can redistribute it and/or modify it
0006  * under the terms and conditions of the GNU General Public License,
0007  * version 2, as published by the Free Software Foundation.
0008  *
0009  * This program is distributed in the hope it will be useful, but WITHOUT
0010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0011  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
0012  * more details.
0013  *
0014  * You should have received a copy of the GNU General Public License along with
0015  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
0016  * Place - Suite 330, Boston, MA 02111-1307 USA.
0017  *
0018  * Author: Lucy Liu <lucy.liu@intel.com>
0019  */
0020 
0021 #ifndef __LINUX_DCBNL_H__
0022 #define __LINUX_DCBNL_H__
0023 
0024 #include <linux/types.h>
0025 
0026 /* IEEE 802.1Qaz std supported values */
0027 #define IEEE_8021QAZ_MAX_TCS    8
0028 
0029 #define IEEE_8021QAZ_TSA_STRICT     0
0030 #define IEEE_8021QAZ_TSA_CB_SHAPER  1
0031 #define IEEE_8021QAZ_TSA_ETS        2
0032 #define IEEE_8021QAZ_TSA_VENDOR     255
0033 
0034 /* This structure contains the IEEE 802.1Qaz ETS managed object
0035  *
0036  * @willing: willing bit in ETS configuration TLV
0037  * @ets_cap: indicates supported capacity of ets feature
0038  * @cbs: credit based shaper ets algorithm supported
0039  * @tc_tx_bw: tc tx bandwidth indexed by traffic class
0040  * @tc_rx_bw: tc rx bandwidth indexed by traffic class
0041  * @tc_tsa: TSA Assignment table, indexed by traffic class
0042  * @prio_tc: priority assignment table mapping 8021Qp to traffic class
0043  * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV
0044  * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV
0045  * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV
0046  *
0047  * Recommended values are used to set fields in the ETS recommendation TLV
0048  * with hardware offloaded LLDP.
0049  *
0050  * ----
0051  *  TSA Assignment 8 bit identifiers
0052  *  0   strict priority
0053  *  1   credit-based shaper
0054  *  2   enhanced transmission selection
0055  *  3-254   reserved
0056  *  255 vendor specific
0057  */
0058 struct ieee_ets {
0059     __u8    willing;
0060     __u8    ets_cap;
0061     __u8    cbs;
0062     __u8    tc_tx_bw[IEEE_8021QAZ_MAX_TCS];
0063     __u8    tc_rx_bw[IEEE_8021QAZ_MAX_TCS];
0064     __u8    tc_tsa[IEEE_8021QAZ_MAX_TCS];
0065     __u8    prio_tc[IEEE_8021QAZ_MAX_TCS];
0066     __u8    tc_reco_bw[IEEE_8021QAZ_MAX_TCS];
0067     __u8    tc_reco_tsa[IEEE_8021QAZ_MAX_TCS];
0068     __u8    reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
0069 };
0070 
0071 /* This structure contains rate limit extension to the IEEE 802.1Qaz ETS
0072  * managed object.
0073  * Values are 64 bits long and specified in Kbps to enable usage over both
0074  * slow and very fast networks.
0075  *
0076  * @tc_maxrate: maximal tc tx bandwidth indexed by traffic class
0077  */
0078 struct ieee_maxrate {
0079     __u64   tc_maxrate[IEEE_8021QAZ_MAX_TCS];
0080 };
0081 
0082 enum dcbnl_cndd_states {
0083     DCB_CNDD_RESET = 0,
0084     DCB_CNDD_EDGE,
0085     DCB_CNDD_INTERIOR,
0086     DCB_CNDD_INTERIOR_READY,
0087 };
0088 
0089 /* This structure contains the IEEE 802.1Qau QCN managed object.
0090  *
0091  *@rpg_enable: enable QCN RP
0092  *@rppp_max_rps: maximum number of RPs allowed for this CNPV on this port
0093  *@rpg_time_reset: time between rate increases if no CNMs received.
0094  *         given in u-seconds
0095  *@rpg_byte_reset: transmitted data between rate increases if no CNMs received.
0096  *         given in Bytes
0097  *@rpg_threshold: The number of times rpByteStage or rpTimeStage can count
0098  *         before RP rate control state machine advances states
0099  *@rpg_max_rate: the maxinun rate, in Mbits per second,
0100  *       at which an RP can transmit
0101  *@rpg_ai_rate: The rate, in Mbits per second,
0102  *      used to increase rpTargetRate in the RPR_ACTIVE_INCREASE
0103  *@rpg_hai_rate: The rate, in Mbits per second,
0104  *       used to increase rpTargetRate in the RPR_HYPER_INCREASE state
0105  *@rpg_gd: Upon CNM receive, flow rate is limited to (Fb/Gd)*CurrentRate.
0106  *     rpgGd is given as log2(Gd), where Gd may only be powers of 2
0107  *@rpg_min_dec_fac: The minimum factor by which the current transmit rate
0108  *          can be changed by reception of a CNM.
0109  *          value is given as percentage (1-100)
0110  *@rpg_min_rate: The minimum value, in bits per second, for rate to limit
0111  *@cndd_state_machine: The state of the congestion notification domain
0112  *             defense state machine, as defined by IEEE 802.3Qau
0113  *             section 32.1.1. In the interior ready state,
0114  *             the QCN capable hardware may add CN-TAG TLV to the
0115  *             outgoing traffic, to specifically identify outgoing
0116  *             flows.
0117  */
0118 
0119 struct ieee_qcn {
0120     __u8 rpg_enable[IEEE_8021QAZ_MAX_TCS];
0121     __u32 rppp_max_rps[IEEE_8021QAZ_MAX_TCS];
0122     __u32 rpg_time_reset[IEEE_8021QAZ_MAX_TCS];
0123     __u32 rpg_byte_reset[IEEE_8021QAZ_MAX_TCS];
0124     __u32 rpg_threshold[IEEE_8021QAZ_MAX_TCS];
0125     __u32 rpg_max_rate[IEEE_8021QAZ_MAX_TCS];
0126     __u32 rpg_ai_rate[IEEE_8021QAZ_MAX_TCS];
0127     __u32 rpg_hai_rate[IEEE_8021QAZ_MAX_TCS];
0128     __u32 rpg_gd[IEEE_8021QAZ_MAX_TCS];
0129     __u32 rpg_min_dec_fac[IEEE_8021QAZ_MAX_TCS];
0130     __u32 rpg_min_rate[IEEE_8021QAZ_MAX_TCS];
0131     __u32 cndd_state_machine[IEEE_8021QAZ_MAX_TCS];
0132 };
0133 
0134 /* This structure contains the IEEE 802.1Qau QCN statistics.
0135  *
0136  *@rppp_rp_centiseconds: the number of RP-centiseconds accumulated
0137  *           by RPs at this priority level on this Port
0138  *@rppp_created_rps: number of active RPs(flows) that react to CNMs
0139  */
0140 
0141 struct ieee_qcn_stats {
0142     __u64 rppp_rp_centiseconds[IEEE_8021QAZ_MAX_TCS];
0143     __u32 rppp_created_rps[IEEE_8021QAZ_MAX_TCS];
0144 };
0145 
0146 /* This structure contains the IEEE 802.1Qaz PFC managed object
0147  *
0148  * @pfc_cap: Indicates the number of traffic classes on the local device
0149  *       that may simultaneously have PFC enabled.
0150  * @pfc_en: bitmap indicating pfc enabled traffic classes
0151  * @mbc: enable macsec bypass capability
0152  * @delay: the allowance made for a round-trip propagation delay of the
0153  *     link in bits.
0154  * @requests: count of the sent pfc frames
0155  * @indications: count of the received pfc frames
0156  */
0157 struct ieee_pfc {
0158     __u8    pfc_cap;
0159     __u8    pfc_en;
0160     __u8    mbc;
0161     __u16   delay;
0162     __u64   requests[IEEE_8021QAZ_MAX_TCS];
0163     __u64   indications[IEEE_8021QAZ_MAX_TCS];
0164 };
0165 
0166 #define IEEE_8021Q_MAX_PRIORITIES 8
0167 #define DCBX_MAX_BUFFERS  8
0168 struct dcbnl_buffer {
0169     /* priority to buffer mapping */
0170     __u8    prio2buffer[IEEE_8021Q_MAX_PRIORITIES];
0171     /* buffer size in Bytes */
0172     __u32   buffer_size[DCBX_MAX_BUFFERS];
0173     __u32   total_size;
0174 };
0175 
0176 /* CEE DCBX std supported values */
0177 #define CEE_DCBX_MAX_PGS    8
0178 #define CEE_DCBX_MAX_PRIO   8
0179 
0180 /**
0181  * struct cee_pg - CEE Priority-Group managed object
0182  *
0183  * @willing: willing bit in the PG tlv
0184  * @error: error bit in the PG tlv
0185  * @pg_en: enable bit of the PG feature
0186  * @tcs_supported: number of traffic classes supported
0187  * @pg_bw: bandwidth percentage for each priority group
0188  * @prio_pg: priority to PG mapping indexed by priority
0189  */
0190 struct cee_pg {
0191     __u8    willing;
0192     __u8    error;
0193     __u8    pg_en;
0194     __u8    tcs_supported;
0195     __u8    pg_bw[CEE_DCBX_MAX_PGS];
0196     __u8    prio_pg[CEE_DCBX_MAX_PGS];
0197 };
0198 
0199 /**
0200  * struct cee_pfc - CEE PFC managed object
0201  *
0202  * @willing: willing bit in the PFC tlv
0203  * @error: error bit in the PFC tlv
0204  * @pfc_en: bitmap indicating pfc enabled traffic classes
0205  * @tcs_supported: number of traffic classes supported
0206  */
0207 struct cee_pfc {
0208     __u8    willing;
0209     __u8    error;
0210     __u8    pfc_en;
0211     __u8    tcs_supported;
0212 };
0213 
0214 /* IEEE 802.1Qaz std supported values */
0215 #define IEEE_8021QAZ_APP_SEL_ETHERTYPE  1
0216 #define IEEE_8021QAZ_APP_SEL_STREAM 2
0217 #define IEEE_8021QAZ_APP_SEL_DGRAM  3
0218 #define IEEE_8021QAZ_APP_SEL_ANY    4
0219 #define IEEE_8021QAZ_APP_SEL_DSCP       5
0220 
0221 /* This structure contains the IEEE 802.1Qaz APP managed object. This
0222  * object is also used for the CEE std as well.
0223  *
0224  * @selector: protocol identifier type
0225  * @protocol: protocol of type indicated
0226  * @priority: 3-bit unsigned integer indicating priority for IEEE
0227  *            8-bit 802.1p user priority bitmap for CEE
0228  *
0229  * ----
0230  *  Selector field values for IEEE 802.1Qaz
0231  *  0   Reserved
0232  *  1   Ethertype
0233  *  2   Well known port number over TCP or SCTP
0234  *  3   Well known port number over UDP or DCCP
0235  *  4   Well known port number over TCP, SCTP, UDP, or DCCP
0236  *  5   Differentiated Services Code Point (DSCP) value
0237  *  6-7 Reserved
0238  *
0239  *  Selector field values for CEE
0240  *  0   Ethertype
0241  *  1   Well known port number over TCP or UDP
0242  *  2-3 Reserved
0243  */
0244 struct dcb_app {
0245     __u8    selector;
0246     __u8    priority;
0247     __u16   protocol;
0248 };
0249 
0250 /**
0251  * struct dcb_peer_app_info - APP feature information sent by the peer
0252  *
0253  * @willing: willing bit in the peer APP tlv
0254  * @error: error bit in the peer APP tlv
0255  *
0256  * In addition to this information the full peer APP tlv also contains
0257  * a table of 'app_count' APP objects defined above.
0258  */
0259 struct dcb_peer_app_info {
0260     __u8    willing;
0261     __u8    error;
0262 };
0263 
0264 struct dcbmsg {
0265     __u8               dcb_family;
0266     __u8               cmd;
0267     __u16              dcb_pad;
0268 };
0269 
0270 /**
0271  * enum dcbnl_commands - supported DCB commands
0272  *
0273  * @DCB_CMD_UNDEFINED: unspecified command to catch errors
0274  * @DCB_CMD_GSTATE: request the state of DCB in the device
0275  * @DCB_CMD_SSTATE: set the state of DCB in the device
0276  * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
0277  * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
0278  * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
0279  * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
0280  * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
0281  * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
0282  * @DCB_CMD_SET_ALL: apply all changes to the underlying device
0283  * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
0284  *                        device.  Only useful when using bonding.
0285  * @DCB_CMD_GCAP: request the DCB capabilities of the device
0286  * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
0287  * @DCB_CMD_SNUMTCS: set the number of traffic classes
0288  * @DCB_CMD_GBCN: set backward congestion notification configuration
0289  * @DCB_CMD_SBCN: get backward congestion notification configuration.
0290  * @DCB_CMD_GAPP: get application protocol configuration
0291  * @DCB_CMD_SAPP: set application protocol configuration
0292  * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
0293  * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
0294  * @DCB_CMD_GDCBX: get DCBX engine configuration
0295  * @DCB_CMD_SDCBX: set DCBX engine configuration
0296  * @DCB_CMD_GFEATCFG: get DCBX features flags
0297  * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
0298  * @DCB_CMD_CEE_GET: get CEE aggregated configuration
0299  * @DCB_CMD_IEEE_DEL: delete IEEE 802.1Qaz configuration
0300  */
0301 enum dcbnl_commands {
0302     DCB_CMD_UNDEFINED,
0303 
0304     DCB_CMD_GSTATE,
0305     DCB_CMD_SSTATE,
0306 
0307     DCB_CMD_PGTX_GCFG,
0308     DCB_CMD_PGTX_SCFG,
0309     DCB_CMD_PGRX_GCFG,
0310     DCB_CMD_PGRX_SCFG,
0311 
0312     DCB_CMD_PFC_GCFG,
0313     DCB_CMD_PFC_SCFG,
0314 
0315     DCB_CMD_SET_ALL,
0316 
0317     DCB_CMD_GPERM_HWADDR,
0318 
0319     DCB_CMD_GCAP,
0320 
0321     DCB_CMD_GNUMTCS,
0322     DCB_CMD_SNUMTCS,
0323 
0324     DCB_CMD_PFC_GSTATE,
0325     DCB_CMD_PFC_SSTATE,
0326 
0327     DCB_CMD_BCN_GCFG,
0328     DCB_CMD_BCN_SCFG,
0329 
0330     DCB_CMD_GAPP,
0331     DCB_CMD_SAPP,
0332 
0333     DCB_CMD_IEEE_SET,
0334     DCB_CMD_IEEE_GET,
0335 
0336     DCB_CMD_GDCBX,
0337     DCB_CMD_SDCBX,
0338 
0339     DCB_CMD_GFEATCFG,
0340     DCB_CMD_SFEATCFG,
0341 
0342     DCB_CMD_CEE_GET,
0343     DCB_CMD_IEEE_DEL,
0344 
0345     __DCB_CMD_ENUM_MAX,
0346     DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
0347 };
0348 
0349 /**
0350  * enum dcbnl_attrs - DCB top-level netlink attributes
0351  *
0352  * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
0353  * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
0354  * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
0355  * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
0356  * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
0357  * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
0358  * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
0359  * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
0360  * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
0361  * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
0362  * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
0363  * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
0364  * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
0365  * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
0366  * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
0367  * @DCB_ATTR_CEE: CEE std supported attributes (NLA_NESTED)
0368  */
0369 enum dcbnl_attrs {
0370     DCB_ATTR_UNDEFINED,
0371 
0372     DCB_ATTR_IFNAME,
0373     DCB_ATTR_STATE,
0374     DCB_ATTR_PFC_STATE,
0375     DCB_ATTR_PFC_CFG,
0376     DCB_ATTR_NUM_TC,
0377     DCB_ATTR_PG_CFG,
0378     DCB_ATTR_SET_ALL,
0379     DCB_ATTR_PERM_HWADDR,
0380     DCB_ATTR_CAP,
0381     DCB_ATTR_NUMTCS,
0382     DCB_ATTR_BCN,
0383     DCB_ATTR_APP,
0384 
0385     /* IEEE std attributes */
0386     DCB_ATTR_IEEE,
0387 
0388     DCB_ATTR_DCBX,
0389     DCB_ATTR_FEATCFG,
0390 
0391     /* CEE nested attributes */
0392     DCB_ATTR_CEE,
0393 
0394     __DCB_ATTR_ENUM_MAX,
0395     DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
0396 };
0397 
0398 /**
0399  * enum ieee_attrs - IEEE 802.1Qaz get/set attributes
0400  *
0401  * @DCB_ATTR_IEEE_UNSPEC: unspecified
0402  * @DCB_ATTR_IEEE_ETS: negotiated ETS configuration
0403  * @DCB_ATTR_IEEE_PFC: negotiated PFC configuration
0404  * @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration
0405  * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
0406  * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
0407  * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
0408  */
0409 enum ieee_attrs {
0410     DCB_ATTR_IEEE_UNSPEC,
0411     DCB_ATTR_IEEE_ETS,
0412     DCB_ATTR_IEEE_PFC,
0413     DCB_ATTR_IEEE_APP_TABLE,
0414     DCB_ATTR_IEEE_PEER_ETS,
0415     DCB_ATTR_IEEE_PEER_PFC,
0416     DCB_ATTR_IEEE_PEER_APP,
0417     DCB_ATTR_IEEE_MAXRATE,
0418     DCB_ATTR_IEEE_QCN,
0419     DCB_ATTR_IEEE_QCN_STATS,
0420     DCB_ATTR_DCB_BUFFER,
0421     __DCB_ATTR_IEEE_MAX
0422 };
0423 #define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
0424 
0425 enum ieee_attrs_app {
0426     DCB_ATTR_IEEE_APP_UNSPEC,
0427     DCB_ATTR_IEEE_APP,
0428     __DCB_ATTR_IEEE_APP_MAX
0429 };
0430 #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
0431 
0432 /**
0433  * enum cee_attrs - CEE DCBX get attributes.
0434  *
0435  * @DCB_ATTR_CEE_UNSPEC: unspecified
0436  * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
0437  * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
0438  * @DCB_ATTR_CEE_PEER_APP_TABLE: peer APP tlv - get only
0439  * @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG)
0440  * @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG)
0441  * @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG)
0442  * @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP)
0443  * @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG)
0444  *
0445  * An aggregated collection of the cee std negotiated parameters.
0446  */
0447 enum cee_attrs {
0448     DCB_ATTR_CEE_UNSPEC,
0449     DCB_ATTR_CEE_PEER_PG,
0450     DCB_ATTR_CEE_PEER_PFC,
0451     DCB_ATTR_CEE_PEER_APP_TABLE,
0452     DCB_ATTR_CEE_TX_PG,
0453     DCB_ATTR_CEE_RX_PG,
0454     DCB_ATTR_CEE_PFC,
0455     DCB_ATTR_CEE_APP_TABLE,
0456     DCB_ATTR_CEE_FEAT,
0457     __DCB_ATTR_CEE_MAX
0458 };
0459 #define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
0460 
0461 enum peer_app_attr {
0462     DCB_ATTR_CEE_PEER_APP_UNSPEC,
0463     DCB_ATTR_CEE_PEER_APP_INFO,
0464     DCB_ATTR_CEE_PEER_APP,
0465     __DCB_ATTR_CEE_PEER_APP_MAX
0466 };
0467 #define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
0468 
0469 enum cee_attrs_app {
0470     DCB_ATTR_CEE_APP_UNSPEC,
0471     DCB_ATTR_CEE_APP,
0472     __DCB_ATTR_CEE_APP_MAX
0473 };
0474 #define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1)
0475 
0476 /**
0477  * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
0478  *
0479  * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
0480  * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
0481  * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
0482  * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
0483  * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
0484  * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
0485  * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
0486  * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
0487  * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
0488  * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
0489  * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
0490  *
0491  */
0492 enum dcbnl_pfc_up_attrs {
0493     DCB_PFC_UP_ATTR_UNDEFINED,
0494 
0495     DCB_PFC_UP_ATTR_0,
0496     DCB_PFC_UP_ATTR_1,
0497     DCB_PFC_UP_ATTR_2,
0498     DCB_PFC_UP_ATTR_3,
0499     DCB_PFC_UP_ATTR_4,
0500     DCB_PFC_UP_ATTR_5,
0501     DCB_PFC_UP_ATTR_6,
0502     DCB_PFC_UP_ATTR_7,
0503     DCB_PFC_UP_ATTR_ALL,
0504 
0505     __DCB_PFC_UP_ATTR_ENUM_MAX,
0506     DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
0507 };
0508 
0509 /**
0510  * enum dcbnl_pg_attrs - DCB Priority Group attributes
0511  *
0512  * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
0513  * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
0514  * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
0515  * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
0516  * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
0517  * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
0518  * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
0519  * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
0520  * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
0521  * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
0522  * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
0523  * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
0524  * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
0525  * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
0526  * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
0527  * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
0528  * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
0529  * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
0530  * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
0531  * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
0532  * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
0533  *
0534  */
0535 enum dcbnl_pg_attrs {
0536     DCB_PG_ATTR_UNDEFINED,
0537 
0538     DCB_PG_ATTR_TC_0,
0539     DCB_PG_ATTR_TC_1,
0540     DCB_PG_ATTR_TC_2,
0541     DCB_PG_ATTR_TC_3,
0542     DCB_PG_ATTR_TC_4,
0543     DCB_PG_ATTR_TC_5,
0544     DCB_PG_ATTR_TC_6,
0545     DCB_PG_ATTR_TC_7,
0546     DCB_PG_ATTR_TC_MAX,
0547     DCB_PG_ATTR_TC_ALL,
0548 
0549     DCB_PG_ATTR_BW_ID_0,
0550     DCB_PG_ATTR_BW_ID_1,
0551     DCB_PG_ATTR_BW_ID_2,
0552     DCB_PG_ATTR_BW_ID_3,
0553     DCB_PG_ATTR_BW_ID_4,
0554     DCB_PG_ATTR_BW_ID_5,
0555     DCB_PG_ATTR_BW_ID_6,
0556     DCB_PG_ATTR_BW_ID_7,
0557     DCB_PG_ATTR_BW_ID_MAX,
0558     DCB_PG_ATTR_BW_ID_ALL,
0559 
0560     __DCB_PG_ATTR_ENUM_MAX,
0561     DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
0562 };
0563 
0564 /**
0565  * enum dcbnl_tc_attrs - DCB Traffic Class attributes
0566  *
0567  * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
0568  * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
0569  *                          Valid values are:  0-7
0570  * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
0571  *                                Some devices may not support changing the
0572  *                                user priority map of a TC.
0573  * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
0574  *                                 0 - none
0575  *                                 1 - group strict
0576  *                                 2 - link strict
0577  * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
0578  *                            not configured to use link strict priority,
0579  *                            this is the percentage of bandwidth of the
0580  *                            priority group this traffic class belongs to
0581  * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
0582  *
0583  */
0584 enum dcbnl_tc_attrs {
0585     DCB_TC_ATTR_PARAM_UNDEFINED,
0586 
0587     DCB_TC_ATTR_PARAM_PGID,
0588     DCB_TC_ATTR_PARAM_UP_MAPPING,
0589     DCB_TC_ATTR_PARAM_STRICT_PRIO,
0590     DCB_TC_ATTR_PARAM_BW_PCT,
0591     DCB_TC_ATTR_PARAM_ALL,
0592 
0593     __DCB_TC_ATTR_PARAM_ENUM_MAX,
0594     DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
0595 };
0596 
0597 /**
0598  * enum dcbnl_cap_attrs - DCB Capability attributes
0599  *
0600  * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
0601  * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
0602  * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
0603  * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
0604  * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
0605  *                               traffic class mapping
0606  * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
0607  *                                number of traffic classes the device
0608  *                                can be configured to use for Priority Groups
0609  * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
0610  *                                 number of traffic classes the device can be
0611  *                                 configured to use for Priority Flow Control
0612  * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
0613  * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
0614  *                             Notification
0615  * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
0616  *
0617  */
0618 enum dcbnl_cap_attrs {
0619     DCB_CAP_ATTR_UNDEFINED,
0620     DCB_CAP_ATTR_ALL,
0621     DCB_CAP_ATTR_PG,
0622     DCB_CAP_ATTR_PFC,
0623     DCB_CAP_ATTR_UP2TC,
0624     DCB_CAP_ATTR_PG_TCS,
0625     DCB_CAP_ATTR_PFC_TCS,
0626     DCB_CAP_ATTR_GSP,
0627     DCB_CAP_ATTR_BCN,
0628     DCB_CAP_ATTR_DCBX,
0629 
0630     __DCB_CAP_ATTR_ENUM_MAX,
0631     DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
0632 };
0633 
0634 /**
0635  * DCBX capability flags
0636  *
0637  * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
0638  *                     'set' routines are used to configure the device with
0639  *                     the negotiated parameters
0640  *
0641  * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
0642  *                            by another entity
0643  *                            'get' routines are used to retrieve the
0644  *                            negotiated parameters
0645  *                            'set' routines can be used to set the initial
0646  *                            negotiation configuration
0647  *
0648  * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
0649  *                        supports the CEE protocol flavor
0650  *
0651  * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
0652  *                         supports the IEEE protocol flavor
0653  *
0654  * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
0655  *                       supports static configuration (i.e no actual
0656  *                       negotiation is performed negotiated parameters equal
0657  *                       the initial configuration)
0658  *
0659  */
0660 #define DCB_CAP_DCBX_HOST       0x01
0661 #define DCB_CAP_DCBX_LLD_MANAGED    0x02
0662 #define DCB_CAP_DCBX_VER_CEE        0x04
0663 #define DCB_CAP_DCBX_VER_IEEE       0x08
0664 #define DCB_CAP_DCBX_STATIC     0x10
0665 
0666 /**
0667  * enum dcbnl_numtcs_attrs - number of traffic classes
0668  *
0669  * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
0670  * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
0671  * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
0672  *                               priority groups
0673  * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
0674  *                                support priority flow control
0675  */
0676 enum dcbnl_numtcs_attrs {
0677     DCB_NUMTCS_ATTR_UNDEFINED,
0678     DCB_NUMTCS_ATTR_ALL,
0679     DCB_NUMTCS_ATTR_PG,
0680     DCB_NUMTCS_ATTR_PFC,
0681 
0682     __DCB_NUMTCS_ATTR_ENUM_MAX,
0683     DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
0684 };
0685 
0686 enum dcbnl_bcn_attrs{
0687     DCB_BCN_ATTR_UNDEFINED = 0,
0688 
0689     DCB_BCN_ATTR_RP_0,
0690     DCB_BCN_ATTR_RP_1,
0691     DCB_BCN_ATTR_RP_2,
0692     DCB_BCN_ATTR_RP_3,
0693     DCB_BCN_ATTR_RP_4,
0694     DCB_BCN_ATTR_RP_5,
0695     DCB_BCN_ATTR_RP_6,
0696     DCB_BCN_ATTR_RP_7,
0697     DCB_BCN_ATTR_RP_ALL,
0698 
0699     DCB_BCN_ATTR_BCNA_0,
0700     DCB_BCN_ATTR_BCNA_1,
0701     DCB_BCN_ATTR_ALPHA,
0702     DCB_BCN_ATTR_BETA,
0703     DCB_BCN_ATTR_GD,
0704     DCB_BCN_ATTR_GI,
0705     DCB_BCN_ATTR_TMAX,
0706     DCB_BCN_ATTR_TD,
0707     DCB_BCN_ATTR_RMIN,
0708     DCB_BCN_ATTR_W,
0709     DCB_BCN_ATTR_RD,
0710     DCB_BCN_ATTR_RU,
0711     DCB_BCN_ATTR_WRTT,
0712     DCB_BCN_ATTR_RI,
0713     DCB_BCN_ATTR_C,
0714     DCB_BCN_ATTR_ALL,
0715 
0716     __DCB_BCN_ATTR_ENUM_MAX,
0717     DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
0718 };
0719 
0720 /**
0721  * enum dcb_general_attr_values - general DCB attribute values
0722  *
0723  * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
0724  *
0725  */
0726 enum dcb_general_attr_values {
0727     DCB_ATTR_VALUE_UNDEFINED = 0xff
0728 };
0729 
0730 #define DCB_APP_IDTYPE_ETHTYPE  0x00
0731 #define DCB_APP_IDTYPE_PORTNUM  0x01
0732 enum dcbnl_app_attrs {
0733     DCB_APP_ATTR_UNDEFINED,
0734 
0735     DCB_APP_ATTR_IDTYPE,
0736     DCB_APP_ATTR_ID,
0737     DCB_APP_ATTR_PRIORITY,
0738 
0739     __DCB_APP_ATTR_ENUM_MAX,
0740     DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
0741 };
0742 
0743 /**
0744  * enum dcbnl_featcfg_attrs - features conifiguration flags
0745  *
0746  * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
0747  * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
0748  * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
0749  * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
0750  *                                 flow control
0751  * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
0752  *
0753  */
0754 #define DCB_FEATCFG_ERROR   0x01    /* error in feature resolution */
0755 #define DCB_FEATCFG_ENABLE  0x02    /* enable feature */
0756 #define DCB_FEATCFG_WILLING 0x04    /* feature is willing */
0757 #define DCB_FEATCFG_ADVERTISE   0x08    /* advertise feature */
0758 enum dcbnl_featcfg_attrs {
0759     DCB_FEATCFG_ATTR_UNDEFINED,
0760     DCB_FEATCFG_ATTR_ALL,
0761     DCB_FEATCFG_ATTR_PG,
0762     DCB_FEATCFG_ATTR_PFC,
0763     DCB_FEATCFG_ATTR_APP,
0764 
0765     __DCB_FEATCFG_ATTR_ENUM_MAX,
0766     DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
0767 };
0768 
0769 #endif /* __LINUX_DCBNL_H__ */