2 * Copyright (c) 2008, Intel Corporation.
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.
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
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.
17 * Author: Lucy Liu <lucy.liu@intel.com>
20 #ifndef __LINUX_DCBNL_H__
21 #define __LINUX_DCBNL_H__
23 #include <linux/types.h>
25 /* IEEE 802.1Qaz std supported values */
26 #define IEEE_8021QAZ_MAX_TCS 8
28 /* This structure contains the IEEE 802.1Qaz ETS managed object
30 * @willing: willing bit in ETS configuratin TLV
31 * @ets_cap: indicates supported capacity of ets feature
32 * @cbs: credit based shaper ets algorithm supported
33 * @tc_tx_bw: tc tx bandwidth indexed by traffic class
34 * @tc_rx_bw: tc rx bandwidth indexed by traffic class
35 * @tc_tsa: TSA Assignment table, indexed by traffic class
36 * @prio_tc: priority assignment table mapping 8021Qp to traffic class
37 * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV
38 * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV
39 * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV
41 * Recommended values are used to set fields in the ETS recommendation TLV
42 * with hardware offloaded LLDP.
45 * TSA Assignment 8 bit identifiers
47 * 1 credit-based shaper
48 * 2 enhanced transmission selection
56 __u8 tc_tx_bw[IEEE_8021QAZ_MAX_TCS];
57 __u8 tc_rx_bw[IEEE_8021QAZ_MAX_TCS];
58 __u8 tc_tsa[IEEE_8021QAZ_MAX_TCS];
59 __u8 prio_tc[IEEE_8021QAZ_MAX_TCS];
60 __u8 tc_reco_bw[IEEE_8021QAZ_MAX_TCS];
61 __u8 tc_reco_tsa[IEEE_8021QAZ_MAX_TCS];
62 __u8 reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
65 /* This structure contains the IEEE 802.1Qaz PFC managed object
67 * @pfc_cap: Indicates the number of traffic classes on the local device
68 * that may simultaneously have PFC enabled.
69 * @pfc_en: bitmap indicating pfc enabled traffic classes
70 * @mbc: enable macsec bypass capability
71 * @delay: the allowance made for a round-trip propagation delay of the
73 * @requests: count of the sent pfc frames
74 * @indications: count of the received pfc frames
81 __u64 requests[IEEE_8021QAZ_MAX_TCS];
82 __u64 indications[IEEE_8021QAZ_MAX_TCS];
85 /* This structure contains the IEEE 802.1Qaz APP managed object. This
86 * object is also used for the CEE std as well. There is no difference
87 * between the objects.
89 * @selector: protocol identifier type
90 * @protocol: protocol of type indicated
91 * @priority: 3-bit unsigned integer indicating priority
94 * Selector field values
97 * 2 Well known port number over TCP or SCTP
98 * 3 Well known port number over UDP or DCCP
99 * 4 Well known port number over TCP, SCTP, UDP, or DCCP
115 * enum dcbnl_commands - supported DCB commands
117 * @DCB_CMD_UNDEFINED: unspecified command to catch errors
118 * @DCB_CMD_GSTATE: request the state of DCB in the device
119 * @DCB_CMD_SSTATE: set the state of DCB in the device
120 * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
121 * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
122 * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
123 * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
124 * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
125 * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
126 * @DCB_CMD_SET_ALL: apply all changes to the underlying device
127 * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
128 * device. Only useful when using bonding.
129 * @DCB_CMD_GCAP: request the DCB capabilities of the device
130 * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
131 * @DCB_CMD_SNUMTCS: set the number of traffic classes
132 * @DCB_CMD_GBCN: set backward congestion notification configuration
133 * @DCB_CMD_SBCN: get backward congestion notification configration.
134 * @DCB_CMD_GAPP: get application protocol configuration
135 * @DCB_CMD_SAPP: set application protocol configuration
136 * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
137 * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
138 * @DCB_CMD_GDCBX: get DCBX engine configuration
139 * @DCB_CMD_SDCBX: set DCBX engine configuration
141 enum dcbnl_commands {
157 DCB_CMD_GPERM_HWADDR,
180 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
184 * enum dcbnl_attrs - DCB top-level netlink attributes
186 * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
187 * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
188 * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
189 * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
190 * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
191 * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
192 * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
193 * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
194 * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
195 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
196 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
197 * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
198 * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
199 * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
211 DCB_ATTR_PERM_HWADDR,
217 /* IEEE std attributes */
223 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
227 DCB_ATTR_IEEE_UNSPEC,
230 DCB_ATTR_IEEE_APP_TABLE,
233 #define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
235 enum ieee_attrs_app {
236 DCB_ATTR_IEEE_APP_UNSPEC,
238 __DCB_ATTR_IEEE_APP_MAX
240 #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
243 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
245 * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
246 * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
247 * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
248 * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
249 * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
250 * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
251 * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
252 * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
253 * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
254 * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
255 * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
258 enum dcbnl_pfc_up_attrs {
259 DCB_PFC_UP_ATTR_UNDEFINED,
271 __DCB_PFC_UP_ATTR_ENUM_MAX,
272 DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
276 * enum dcbnl_pg_attrs - DCB Priority Group attributes
278 * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
279 * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
280 * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
281 * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
282 * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
283 * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
284 * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
285 * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
286 * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
287 * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
288 * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
289 * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
290 * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
291 * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
292 * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
293 * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
294 * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
295 * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
296 * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
297 * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
298 * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
301 enum dcbnl_pg_attrs {
302 DCB_PG_ATTR_UNDEFINED,
323 DCB_PG_ATTR_BW_ID_MAX,
324 DCB_PG_ATTR_BW_ID_ALL,
326 __DCB_PG_ATTR_ENUM_MAX,
327 DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
331 * enum dcbnl_tc_attrs - DCB Traffic Class attributes
333 * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
334 * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
335 * Valid values are: 0-7
336 * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
337 * Some devices may not support changing the
338 * user priority map of a TC.
339 * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
343 * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
344 * not configured to use link strict priority,
345 * this is the percentage of bandwidth of the
346 * priority group this traffic class belongs to
347 * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
350 enum dcbnl_tc_attrs {
351 DCB_TC_ATTR_PARAM_UNDEFINED,
353 DCB_TC_ATTR_PARAM_PGID,
354 DCB_TC_ATTR_PARAM_UP_MAPPING,
355 DCB_TC_ATTR_PARAM_STRICT_PRIO,
356 DCB_TC_ATTR_PARAM_BW_PCT,
357 DCB_TC_ATTR_PARAM_ALL,
359 __DCB_TC_ATTR_PARAM_ENUM_MAX,
360 DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
364 * enum dcbnl_cap_attrs - DCB Capability attributes
366 * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
367 * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
368 * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
369 * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
370 * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
371 * traffic class mapping
372 * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
373 * number of traffic classes the device
374 * can be configured to use for Priority Groups
375 * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
376 * number of traffic classes the device can be
377 * configured to use for Priority Flow Control
378 * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
379 * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
381 * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
384 enum dcbnl_cap_attrs {
385 DCB_CAP_ATTR_UNDEFINED,
391 DCB_CAP_ATTR_PFC_TCS,
396 __DCB_CAP_ATTR_ENUM_MAX,
397 DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
401 * DCBX capability flags
403 * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
404 * 'set' routines are used to configure the device with
405 * the negotiated parameters
407 * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
409 * 'get' routines are used to retrieve the
410 * negotiated parameters
411 * 'set' routines can be used to set the initial
412 * negotiation configuration
414 * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
415 * supports the CEE protocol flavor
417 * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
418 * supports the IEEE protocol flavor
420 * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
421 * supports static configuration (i.e no actual
422 * negotiation is performed negotiated parameters equal
423 * the initial configuration)
426 #define DCB_CAP_DCBX_HOST 0x01
427 #define DCB_CAP_DCBX_LLD_MANAGED 0x02
428 #define DCB_CAP_DCBX_VER_CEE 0x04
429 #define DCB_CAP_DCBX_VER_IEEE 0x08
430 #define DCB_CAP_DCBX_STATIC 0x10
433 * enum dcbnl_numtcs_attrs - number of traffic classes
435 * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
436 * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
437 * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
439 * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
440 * support priority flow control
442 enum dcbnl_numtcs_attrs {
443 DCB_NUMTCS_ATTR_UNDEFINED,
448 __DCB_NUMTCS_ATTR_ENUM_MAX,
449 DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
452 enum dcbnl_bcn_attrs{
453 DCB_BCN_ATTR_UNDEFINED = 0,
482 __DCB_BCN_ATTR_ENUM_MAX,
483 DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
487 * enum dcb_general_attr_values - general DCB attribute values
489 * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
492 enum dcb_general_attr_values {
493 DCB_ATTR_VALUE_UNDEFINED = 0xff
496 #define DCB_APP_IDTYPE_ETHTYPE 0x00
497 #define DCB_APP_IDTYPE_PORTNUM 0x01
498 enum dcbnl_app_attrs {
499 DCB_APP_ATTR_UNDEFINED,
503 DCB_APP_ATTR_PRIORITY,
505 __DCB_APP_ATTR_ENUM_MAX,
506 DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
509 #endif /* __LINUX_DCBNL_H__ */