aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dcbnl.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/dcbnl.h')
-rw-r--r--include/linux/dcbnl.h184
1 files changed, 184 insertions, 0 deletions
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index 8723491f7dfd..68cd248f6d3e 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -22,6 +22,89 @@
22 22
23#include <linux/types.h> 23#include <linux/types.h>
24 24
25/* IEEE 802.1Qaz std supported values */
26#define IEEE_8021QAZ_MAX_TCS 8
27
28/* This structure contains the IEEE 802.1Qaz ETS managed object
29 *
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
40 *
41 * Recommended values are used to set fields in the ETS recommendation TLV
42 * with hardware offloaded LLDP.
43 *
44 * ----
45 * TSA Assignment 8 bit identifiers
46 * 0 strict priority
47 * 1 credit-based shaper
48 * 2 enhanced transmission selection
49 * 3-254 reserved
50 * 255 vendor specific
51 */
52struct ieee_ets {
53 __u8 willing;
54 __u8 ets_cap;
55 __u8 cbs;
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];
63};
64
65/* This structure contains the IEEE 802.1Qaz PFC managed object
66 *
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
72 * link in bits.
73 * @requests: count of the sent pfc frames
74 * @indications: count of the received pfc frames
75 */
76struct ieee_pfc {
77 __u8 pfc_cap;
78 __u8 pfc_en;
79 __u8 mbc;
80 __u16 delay;
81 __u64 requests[IEEE_8021QAZ_MAX_TCS];
82 __u64 indications[IEEE_8021QAZ_MAX_TCS];
83};
84
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.
88 *
89 * @selector: protocol identifier type
90 * @protocol: protocol of type indicated
91 * @priority: 3-bit unsigned integer indicating priority
92 *
93 * ----
94 * Selector field values
95 * 0 Reserved
96 * 1 Ethertype
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
100 * 5-7 Reserved
101 */
102struct dcb_app {
103 __u8 selector;
104 __u32 protocol;
105 __u8 priority;
106};
107
25struct dcbmsg { 108struct dcbmsg {
26 __u8 dcb_family; 109 __u8 dcb_family;
27 __u8 cmd; 110 __u8 cmd;
@@ -50,6 +133,12 @@ struct dcbmsg {
50 * @DCB_CMD_SBCN: get backward congestion notification configration. 133 * @DCB_CMD_SBCN: get backward congestion notification configration.
51 * @DCB_CMD_GAPP: get application protocol configuration 134 * @DCB_CMD_GAPP: get application protocol configuration
52 * @DCB_CMD_SAPP: set 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
140 * @DCB_CMD_GFEATCFG: get DCBX features flags
141 * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
53 */ 142 */
54enum dcbnl_commands { 143enum dcbnl_commands {
55 DCB_CMD_UNDEFINED, 144 DCB_CMD_UNDEFINED,
@@ -83,6 +172,15 @@ enum dcbnl_commands {
83 DCB_CMD_GAPP, 172 DCB_CMD_GAPP,
84 DCB_CMD_SAPP, 173 DCB_CMD_SAPP,
85 174
175 DCB_CMD_IEEE_SET,
176 DCB_CMD_IEEE_GET,
177
178 DCB_CMD_GDCBX,
179 DCB_CMD_SDCBX,
180
181 DCB_CMD_GFEATCFG,
182 DCB_CMD_SFEATCFG,
183
86 __DCB_CMD_ENUM_MAX, 184 __DCB_CMD_ENUM_MAX,
87 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, 185 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
88}; 186};
@@ -102,6 +200,9 @@ enum dcbnl_commands {
102 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED) 200 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
103 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED) 201 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
104 * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED) 202 * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
203 * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
204 * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
205 * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
105 */ 206 */
106enum dcbnl_attrs { 207enum dcbnl_attrs {
107 DCB_ATTR_UNDEFINED, 208 DCB_ATTR_UNDEFINED,
@@ -119,10 +220,32 @@ enum dcbnl_attrs {
119 DCB_ATTR_BCN, 220 DCB_ATTR_BCN,
120 DCB_ATTR_APP, 221 DCB_ATTR_APP,
121 222
223 /* IEEE std attributes */
224 DCB_ATTR_IEEE,
225
226 DCB_ATTR_DCBX,
227 DCB_ATTR_FEATCFG,
228
122 __DCB_ATTR_ENUM_MAX, 229 __DCB_ATTR_ENUM_MAX,
123 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, 230 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
124}; 231};
125 232
233enum ieee_attrs {
234 DCB_ATTR_IEEE_UNSPEC,
235 DCB_ATTR_IEEE_ETS,
236 DCB_ATTR_IEEE_PFC,
237 DCB_ATTR_IEEE_APP_TABLE,
238 __DCB_ATTR_IEEE_MAX
239};
240#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
241
242enum ieee_attrs_app {
243 DCB_ATTR_IEEE_APP_UNSPEC,
244 DCB_ATTR_IEEE_APP,
245 __DCB_ATTR_IEEE_APP_MAX
246};
247#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
248
126/** 249/**
127 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs 250 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
128 * 251 *
@@ -262,6 +385,8 @@ enum dcbnl_tc_attrs {
262 * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority 385 * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
263 * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion 386 * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
264 * Notification 387 * Notification
388 * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
389 *
265 */ 390 */
266enum dcbnl_cap_attrs { 391enum dcbnl_cap_attrs {
267 DCB_CAP_ATTR_UNDEFINED, 392 DCB_CAP_ATTR_UNDEFINED,
@@ -273,12 +398,45 @@ enum dcbnl_cap_attrs {
273 DCB_CAP_ATTR_PFC_TCS, 398 DCB_CAP_ATTR_PFC_TCS,
274 DCB_CAP_ATTR_GSP, 399 DCB_CAP_ATTR_GSP,
275 DCB_CAP_ATTR_BCN, 400 DCB_CAP_ATTR_BCN,
401 DCB_CAP_ATTR_DCBX,
276 402
277 __DCB_CAP_ATTR_ENUM_MAX, 403 __DCB_CAP_ATTR_ENUM_MAX,
278 DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1, 404 DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
279}; 405};
280 406
281/** 407/**
408 * DCBX capability flags
409 *
410 * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
411 * 'set' routines are used to configure the device with
412 * the negotiated parameters
413 *
414 * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
415 * by another entity
416 * 'get' routines are used to retrieve the
417 * negotiated parameters
418 * 'set' routines can be used to set the initial
419 * negotiation configuration
420 *
421 * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
422 * supports the CEE protocol flavor
423 *
424 * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
425 * supports the IEEE protocol flavor
426 *
427 * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
428 * supports static configuration (i.e no actual
429 * negotiation is performed negotiated parameters equal
430 * the initial configuration)
431 *
432 */
433#define DCB_CAP_DCBX_HOST 0x01
434#define DCB_CAP_DCBX_LLD_MANAGED 0x02
435#define DCB_CAP_DCBX_VER_CEE 0x04
436#define DCB_CAP_DCBX_VER_IEEE 0x08
437#define DCB_CAP_DCBX_STATIC 0x10
438
439/**
282 * enum dcbnl_numtcs_attrs - number of traffic classes 440 * enum dcbnl_numtcs_attrs - number of traffic classes
283 * 441 *
284 * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors 442 * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
@@ -355,4 +513,30 @@ enum dcbnl_app_attrs {
355 DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1, 513 DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
356}; 514};
357 515
516/**
517 * enum dcbnl_featcfg_attrs - features conifiguration flags
518 *
519 * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
520 * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
521 * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
522 * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
523 * flow control
524 * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
525 *
526 */
527#define DCB_FEATCFG_ERROR 0x01 /* error in feature resolution */
528#define DCB_FEATCFG_ENABLE 0x02 /* enable feature */
529#define DCB_FEATCFG_WILLING 0x04 /* feature is willing */
530#define DCB_FEATCFG_ADVERTISE 0x08 /* advertise feature */
531enum dcbnl_featcfg_attrs {
532 DCB_FEATCFG_ATTR_UNDEFINED,
533 DCB_FEATCFG_ATTR_ALL,
534 DCB_FEATCFG_ATTR_PG,
535 DCB_FEATCFG_ATTR_PFC,
536 DCB_FEATCFG_ATTR_APP,
537
538 __DCB_FEATCFG_ATTR_ENUM_MAX,
539 DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
540};
541
358#endif /* __LINUX_DCBNL_H__ */ 542#endif /* __LINUX_DCBNL_H__ */