aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dcbnl.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/linux/dcbnl.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'include/linux/dcbnl.h')
-rw-r--r--include/linux/dcbnl.h295
1 files changed, 294 insertions, 1 deletions
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index 8723491f7dfd..c52280047e2c 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2008, Intel Corporation. 2 * Copyright (c) 2008-2011, Intel Corporation.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 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, 5 * under the terms and conditions of the GNU General Public License,
@@ -22,6 +22,152 @@
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#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 the IEEE 802.1Qaz PFC managed object
71 *
72 * @pfc_cap: Indicates the number of traffic classes on the local device
73 * that may simultaneously have PFC enabled.
74 * @pfc_en: bitmap indicating pfc enabled traffic classes
75 * @mbc: enable macsec bypass capability
76 * @delay: the allowance made for a round-trip propagation delay of the
77 * link in bits.
78 * @requests: count of the sent pfc frames
79 * @indications: count of the received pfc frames
80 */
81struct ieee_pfc {
82 __u8 pfc_cap;
83 __u8 pfc_en;
84 __u8 mbc;
85 __u16 delay;
86 __u64 requests[IEEE_8021QAZ_MAX_TCS];
87 __u64 indications[IEEE_8021QAZ_MAX_TCS];
88};
89
90/* CEE DCBX std supported values */
91#define CEE_DCBX_MAX_PGS 8
92#define CEE_DCBX_MAX_PRIO 8
93
94/**
95 * struct cee_pg - CEE Priority-Group managed object
96 *
97 * @willing: willing bit in the PG tlv
98 * @error: error bit in the PG tlv
99 * @pg_en: enable bit of the PG feature
100 * @tcs_supported: number of traffic classes supported
101 * @pg_bw: bandwidth percentage for each priority group
102 * @prio_pg: priority to PG mapping indexed by priority
103 */
104struct cee_pg {
105 __u8 willing;
106 __u8 error;
107 __u8 pg_en;
108 __u8 tcs_supported;
109 __u8 pg_bw[CEE_DCBX_MAX_PGS];
110 __u8 prio_pg[CEE_DCBX_MAX_PGS];
111};
112
113/**
114 * struct cee_pfc - CEE PFC managed object
115 *
116 * @willing: willing bit in the PFC tlv
117 * @error: error bit in the PFC tlv
118 * @pfc_en: bitmap indicating pfc enabled traffic classes
119 * @tcs_supported: number of traffic classes supported
120 */
121struct cee_pfc {
122 __u8 willing;
123 __u8 error;
124 __u8 pfc_en;
125 __u8 tcs_supported;
126};
127
128/* IEEE 802.1Qaz std supported values */
129#define IEEE_8021QAZ_APP_SEL_ETHERTYPE 1
130#define IEEE_8021QAZ_APP_SEL_STREAM 2
131#define IEEE_8021QAZ_APP_SEL_DGRAM 3
132#define IEEE_8021QAZ_APP_SEL_ANY 4
133
134/* This structure contains the IEEE 802.1Qaz APP managed object. This
135 * object is also used for the CEE std as well. There is no difference
136 * between the objects.
137 *
138 * @selector: protocol identifier type
139 * @protocol: protocol of type indicated
140 * @priority: 3-bit unsigned integer indicating priority
141 *
142 * ----
143 * Selector field values
144 * 0 Reserved
145 * 1 Ethertype
146 * 2 Well known port number over TCP or SCTP
147 * 3 Well known port number over UDP or DCCP
148 * 4 Well known port number over TCP, SCTP, UDP, or DCCP
149 * 5-7 Reserved
150 */
151struct dcb_app {
152 __u8 selector;
153 __u8 priority;
154 __u16 protocol;
155};
156
157/**
158 * struct dcb_peer_app_info - APP feature information sent by the peer
159 *
160 * @willing: willing bit in the peer APP tlv
161 * @error: error bit in the peer APP tlv
162 *
163 * In addition to this information the full peer APP tlv also contains
164 * a table of 'app_count' APP objects defined above.
165 */
166struct dcb_peer_app_info {
167 __u8 willing;
168 __u8 error;
169};
170
25struct dcbmsg { 171struct dcbmsg {
26 __u8 dcb_family; 172 __u8 dcb_family;
27 __u8 cmd; 173 __u8 cmd;
@@ -50,6 +196,13 @@ struct dcbmsg {
50 * @DCB_CMD_SBCN: get backward congestion notification configration. 196 * @DCB_CMD_SBCN: get backward congestion notification configration.
51 * @DCB_CMD_GAPP: get application protocol configuration 197 * @DCB_CMD_GAPP: get application protocol configuration
52 * @DCB_CMD_SAPP: set application protocol configuration 198 * @DCB_CMD_SAPP: set application protocol configuration
199 * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
200 * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
201 * @DCB_CMD_GDCBX: get DCBX engine configuration
202 * @DCB_CMD_SDCBX: set DCBX engine configuration
203 * @DCB_CMD_GFEATCFG: get DCBX features flags
204 * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
205 * @DCB_CMD_CEE_GET: get CEE aggregated configuration
53 */ 206 */
54enum dcbnl_commands { 207enum dcbnl_commands {
55 DCB_CMD_UNDEFINED, 208 DCB_CMD_UNDEFINED,
@@ -83,6 +236,17 @@ enum dcbnl_commands {
83 DCB_CMD_GAPP, 236 DCB_CMD_GAPP,
84 DCB_CMD_SAPP, 237 DCB_CMD_SAPP,
85 238
239 DCB_CMD_IEEE_SET,
240 DCB_CMD_IEEE_GET,
241
242 DCB_CMD_GDCBX,
243 DCB_CMD_SDCBX,
244
245 DCB_CMD_GFEATCFG,
246 DCB_CMD_SFEATCFG,
247
248 DCB_CMD_CEE_GET,
249
86 __DCB_CMD_ENUM_MAX, 250 __DCB_CMD_ENUM_MAX,
87 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, 251 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
88}; 252};
@@ -102,6 +266,10 @@ enum dcbnl_commands {
102 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED) 266 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
103 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED) 267 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
104 * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED) 268 * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
269 * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
270 * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
271 * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
272 * @DCB_ATTR_CEE: CEE std supported attributes (NLA_NESTED)
105 */ 273 */
106enum dcbnl_attrs { 274enum dcbnl_attrs {
107 DCB_ATTR_UNDEFINED, 275 DCB_ATTR_UNDEFINED,
@@ -119,11 +287,75 @@ enum dcbnl_attrs {
119 DCB_ATTR_BCN, 287 DCB_ATTR_BCN,
120 DCB_ATTR_APP, 288 DCB_ATTR_APP,
121 289
290 /* IEEE std attributes */
291 DCB_ATTR_IEEE,
292
293 DCB_ATTR_DCBX,
294 DCB_ATTR_FEATCFG,
295
296 /* CEE nested attributes */
297 DCB_ATTR_CEE,
298
122 __DCB_ATTR_ENUM_MAX, 299 __DCB_ATTR_ENUM_MAX,
123 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, 300 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
124}; 301};
125 302
126/** 303/**
304 * enum ieee_attrs - IEEE 802.1Qaz get/set attributes
305 *
306 * @DCB_ATTR_IEEE_UNSPEC: unspecified
307 * @DCB_ATTR_IEEE_ETS: negotiated ETS configuration
308 * @DCB_ATTR_IEEE_PFC: negotiated PFC configuration
309 * @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration
310 * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
311 * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
312 * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
313 */
314enum ieee_attrs {
315 DCB_ATTR_IEEE_UNSPEC,
316 DCB_ATTR_IEEE_ETS,
317 DCB_ATTR_IEEE_PFC,
318 DCB_ATTR_IEEE_APP_TABLE,
319 DCB_ATTR_IEEE_PEER_ETS,
320 DCB_ATTR_IEEE_PEER_PFC,
321 DCB_ATTR_IEEE_PEER_APP,
322 __DCB_ATTR_IEEE_MAX
323};
324#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
325
326enum ieee_attrs_app {
327 DCB_ATTR_IEEE_APP_UNSPEC,
328 DCB_ATTR_IEEE_APP,
329 __DCB_ATTR_IEEE_APP_MAX
330};
331#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
332
333/**
334 * enum cee_attrs - CEE DCBX get attributes
335 *
336 * @DCB_ATTR_CEE_UNSPEC: unspecified
337 * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
338 * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
339 * @DCB_ATTR_CEE_PEER_APP: peer APP tlv - get only
340 */
341enum cee_attrs {
342 DCB_ATTR_CEE_UNSPEC,
343 DCB_ATTR_CEE_PEER_PG,
344 DCB_ATTR_CEE_PEER_PFC,
345 DCB_ATTR_CEE_PEER_APP_TABLE,
346 __DCB_ATTR_CEE_MAX
347};
348#define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
349
350enum peer_app_attr {
351 DCB_ATTR_CEE_PEER_APP_UNSPEC,
352 DCB_ATTR_CEE_PEER_APP_INFO,
353 DCB_ATTR_CEE_PEER_APP,
354 __DCB_ATTR_CEE_PEER_APP_MAX
355};
356#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
357
358/**
127 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs 359 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
128 * 360 *
129 * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors 361 * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
@@ -262,6 +494,8 @@ enum dcbnl_tc_attrs {
262 * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority 494 * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
263 * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion 495 * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
264 * Notification 496 * Notification
497 * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
498 *
265 */ 499 */
266enum dcbnl_cap_attrs { 500enum dcbnl_cap_attrs {
267 DCB_CAP_ATTR_UNDEFINED, 501 DCB_CAP_ATTR_UNDEFINED,
@@ -273,12 +507,45 @@ enum dcbnl_cap_attrs {
273 DCB_CAP_ATTR_PFC_TCS, 507 DCB_CAP_ATTR_PFC_TCS,
274 DCB_CAP_ATTR_GSP, 508 DCB_CAP_ATTR_GSP,
275 DCB_CAP_ATTR_BCN, 509 DCB_CAP_ATTR_BCN,
510 DCB_CAP_ATTR_DCBX,
276 511
277 __DCB_CAP_ATTR_ENUM_MAX, 512 __DCB_CAP_ATTR_ENUM_MAX,
278 DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1, 513 DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
279}; 514};
280 515
281/** 516/**
517 * DCBX capability flags
518 *
519 * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
520 * 'set' routines are used to configure the device with
521 * the negotiated parameters
522 *
523 * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
524 * by another entity
525 * 'get' routines are used to retrieve the
526 * negotiated parameters
527 * 'set' routines can be used to set the initial
528 * negotiation configuration
529 *
530 * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
531 * supports the CEE protocol flavor
532 *
533 * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
534 * supports the IEEE protocol flavor
535 *
536 * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
537 * supports static configuration (i.e no actual
538 * negotiation is performed negotiated parameters equal
539 * the initial configuration)
540 *
541 */
542#define DCB_CAP_DCBX_HOST 0x01
543#define DCB_CAP_DCBX_LLD_MANAGED 0x02
544#define DCB_CAP_DCBX_VER_CEE 0x04
545#define DCB_CAP_DCBX_VER_IEEE 0x08
546#define DCB_CAP_DCBX_STATIC 0x10
547
548/**
282 * enum dcbnl_numtcs_attrs - number of traffic classes 549 * enum dcbnl_numtcs_attrs - number of traffic classes
283 * 550 *
284 * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors 551 * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
@@ -355,4 +622,30 @@ enum dcbnl_app_attrs {
355 DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1, 622 DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
356}; 623};
357 624
625/**
626 * enum dcbnl_featcfg_attrs - features conifiguration flags
627 *
628 * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
629 * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
630 * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
631 * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
632 * flow control
633 * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
634 *
635 */
636#define DCB_FEATCFG_ERROR 0x01 /* error in feature resolution */
637#define DCB_FEATCFG_ENABLE 0x02 /* enable feature */
638#define DCB_FEATCFG_WILLING 0x04 /* feature is willing */
639#define DCB_FEATCFG_ADVERTISE 0x08 /* advertise feature */
640enum dcbnl_featcfg_attrs {
641 DCB_FEATCFG_ATTR_UNDEFINED,
642 DCB_FEATCFG_ATTR_ALL,
643 DCB_FEATCFG_ATTR_PG,
644 DCB_FEATCFG_ATTR_PFC,
645 DCB_FEATCFG_ATTR_APP,
646
647 __DCB_FEATCFG_ATTR_ENUM_MAX,
648 DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
649};
650
358#endif /* __LINUX_DCBNL_H__ */ 651#endif /* __LINUX_DCBNL_H__ */