Commit | Line | Data |
---|---|---|
2f90b865 AD |
1 | /* |
2 | * Copyright (c) 2008, 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 | ||
5c252221 CL |
23 | #include <linux/types.h> |
24 | ||
3e29027a JF |
25 | /* IEEE 802.1Qaz std supported values */ |
26 | #define IEEE_8021QAZ_MAX_TCS 8 | |
27 | ||
d033d526 JF |
28 | #define IEEE_8021QAZ_TSA_STRICT 0 |
29 | #define IEEE_8021QAZ_TSA_CB_SHABER 1 | |
30 | #define IEEE_8021QAZ_TSA_ETS 2 | |
31 | #define IEEE_8021QAZ_TSA_VENDOR 255 | |
32 | ||
3e29027a JF |
33 | /* This structure contains the IEEE 802.1Qaz ETS managed object |
34 | * | |
35 | * @willing: willing bit in ETS configuratin 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 | */ | |
57 | struct 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 | */ | |
81 | struct 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 | ||
9ab933ab JF |
90 | /* This structure contains the IEEE 802.1Qaz APP managed object. This |
91 | * object is also used for the CEE std as well. There is no difference | |
92 | * between the objects. | |
3e29027a JF |
93 | * |
94 | * @selector: protocol identifier type | |
95 | * @protocol: protocol of type indicated | |
96 | * @priority: 3-bit unsigned integer indicating priority | |
97 | * | |
98 | * ---- | |
99 | * Selector field values | |
100 | * 0 Reserved | |
101 | * 1 Ethertype | |
102 | * 2 Well known port number over TCP or SCTP | |
103 | * 3 Well known port number over UDP or DCCP | |
104 | * 4 Well known port number over TCP, SCTP, UDP, or DCCP | |
105 | * 5-7 Reserved | |
106 | */ | |
107 | struct dcb_app { | |
108 | __u8 selector; | |
3e29027a | 109 | __u8 priority; |
226111d1 | 110 | __u16 protocol; |
3e29027a JF |
111 | }; |
112 | ||
eed84713 SR |
113 | /** |
114 | * struct dcb_peer_app_info - APP feature information sent by the peer | |
115 | * | |
116 | * @willing: willing bit in the peer APP tlv | |
117 | * @error: error bit in the peer APP tlv | |
118 | * | |
119 | * In addition to this information the full peer APP tlv also contains | |
120 | * a table of 'app_count' APP objects defined above. | |
121 | */ | |
122 | struct dcb_peer_app_info { | |
123 | __u8 willing; | |
124 | __u8 error; | |
125 | }; | |
126 | ||
2f90b865 | 127 | struct dcbmsg { |
5c252221 | 128 | __u8 dcb_family; |
2f90b865 AD |
129 | __u8 cmd; |
130 | __u16 dcb_pad; | |
131 | }; | |
132 | ||
133 | /** | |
134 | * enum dcbnl_commands - supported DCB commands | |
135 | * | |
136 | * @DCB_CMD_UNDEFINED: unspecified command to catch errors | |
137 | * @DCB_CMD_GSTATE: request the state of DCB in the device | |
138 | * @DCB_CMD_SSTATE: set the state of DCB in the device | |
139 | * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx | |
140 | * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx | |
141 | * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx | |
142 | * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx | |
143 | * @DCB_CMD_PFC_GCFG: request the priority flow control configuration | |
144 | * @DCB_CMD_PFC_SCFG: set the priority flow control configuration | |
145 | * @DCB_CMD_SET_ALL: apply all changes to the underlying device | |
146 | * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying | |
147 | * device. Only useful when using bonding. | |
46132188 | 148 | * @DCB_CMD_GCAP: request the DCB capabilities of the device |
33dbabc4 AD |
149 | * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported |
150 | * @DCB_CMD_SNUMTCS: set the number of traffic classes | |
859ee3c4 AD |
151 | * @DCB_CMD_GBCN: set backward congestion notification configuration |
152 | * @DCB_CMD_SBCN: get backward congestion notification configration. | |
0f6f2902 YZ |
153 | * @DCB_CMD_GAPP: get application protocol configuration |
154 | * @DCB_CMD_SAPP: set application protocol configuration | |
3e29027a JF |
155 | * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration |
156 | * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration | |
6241b625 SR |
157 | * @DCB_CMD_GDCBX: get DCBX engine configuration |
158 | * @DCB_CMD_SDCBX: set DCBX engine configuration | |
ea45fe4e SR |
159 | * @DCB_CMD_GFEATCFG: get DCBX features flags |
160 | * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags | |
2f90b865 AD |
161 | */ |
162 | enum dcbnl_commands { | |
163 | DCB_CMD_UNDEFINED, | |
164 | ||
165 | DCB_CMD_GSTATE, | |
166 | DCB_CMD_SSTATE, | |
167 | ||
168 | DCB_CMD_PGTX_GCFG, | |
169 | DCB_CMD_PGTX_SCFG, | |
170 | DCB_CMD_PGRX_GCFG, | |
171 | DCB_CMD_PGRX_SCFG, | |
172 | ||
173 | DCB_CMD_PFC_GCFG, | |
174 | DCB_CMD_PFC_SCFG, | |
175 | ||
176 | DCB_CMD_SET_ALL, | |
859ee3c4 | 177 | |
2f90b865 | 178 | DCB_CMD_GPERM_HWADDR, |
859ee3c4 | 179 | |
46132188 | 180 | DCB_CMD_GCAP, |
859ee3c4 | 181 | |
33dbabc4 AD |
182 | DCB_CMD_GNUMTCS, |
183 | DCB_CMD_SNUMTCS, | |
859ee3c4 | 184 | |
0eb3aa9b AD |
185 | DCB_CMD_PFC_GSTATE, |
186 | DCB_CMD_PFC_SSTATE, | |
2f90b865 | 187 | |
859ee3c4 AD |
188 | DCB_CMD_BCN_GCFG, |
189 | DCB_CMD_BCN_SCFG, | |
190 | ||
0f6f2902 YZ |
191 | DCB_CMD_GAPP, |
192 | DCB_CMD_SAPP, | |
193 | ||
3e29027a JF |
194 | DCB_CMD_IEEE_SET, |
195 | DCB_CMD_IEEE_GET, | |
196 | ||
6241b625 SR |
197 | DCB_CMD_GDCBX, |
198 | DCB_CMD_SDCBX, | |
199 | ||
ea45fe4e SR |
200 | DCB_CMD_GFEATCFG, |
201 | DCB_CMD_SFEATCFG, | |
202 | ||
2f90b865 AD |
203 | __DCB_CMD_ENUM_MAX, |
204 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, | |
205 | }; | |
206 | ||
2f90b865 AD |
207 | /** |
208 | * enum dcbnl_attrs - DCB top-level netlink attributes | |
209 | * | |
210 | * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors | |
211 | * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING) | |
212 | * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8) | |
213 | * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8) | |
214 | * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED) | |
215 | * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8) | |
216 | * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED) | |
217 | * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8) | |
218 | * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED) | |
46132188 | 219 | * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED) |
33dbabc4 | 220 | * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED) |
859ee3c4 | 221 | * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED) |
3e29027a | 222 | * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED) |
6241b625 | 223 | * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8) |
ea45fe4e | 224 | * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED) |
2f90b865 AD |
225 | */ |
226 | enum dcbnl_attrs { | |
227 | DCB_ATTR_UNDEFINED, | |
228 | ||
229 | DCB_ATTR_IFNAME, | |
230 | DCB_ATTR_STATE, | |
231 | DCB_ATTR_PFC_STATE, | |
232 | DCB_ATTR_PFC_CFG, | |
233 | DCB_ATTR_NUM_TC, | |
234 | DCB_ATTR_PG_CFG, | |
235 | DCB_ATTR_SET_ALL, | |
236 | DCB_ATTR_PERM_HWADDR, | |
46132188 | 237 | DCB_ATTR_CAP, |
33dbabc4 | 238 | DCB_ATTR_NUMTCS, |
859ee3c4 | 239 | DCB_ATTR_BCN, |
0f6f2902 | 240 | DCB_ATTR_APP, |
2f90b865 | 241 | |
3e29027a JF |
242 | /* IEEE std attributes */ |
243 | DCB_ATTR_IEEE, | |
244 | ||
6241b625 | 245 | DCB_ATTR_DCBX, |
ea45fe4e | 246 | DCB_ATTR_FEATCFG, |
6241b625 | 247 | |
2f90b865 AD |
248 | __DCB_ATTR_ENUM_MAX, |
249 | DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, | |
250 | }; | |
251 | ||
eed84713 SR |
252 | /** |
253 | * enum ieee_attrs - IEEE 802.1Qaz get/set attributes | |
254 | * | |
255 | * @DCB_ATTR_IEEE_UNSPEC: unspecified | |
256 | * @DCB_ATTR_IEEE_ETS: negotiated ETS configuration | |
257 | * @DCB_ATTR_IEEE_PFC: negotiated PFC configuration | |
258 | * @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration | |
259 | * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only | |
260 | * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only | |
261 | * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only | |
262 | */ | |
3e29027a JF |
263 | enum ieee_attrs { |
264 | DCB_ATTR_IEEE_UNSPEC, | |
265 | DCB_ATTR_IEEE_ETS, | |
266 | DCB_ATTR_IEEE_PFC, | |
267 | DCB_ATTR_IEEE_APP_TABLE, | |
eed84713 SR |
268 | DCB_ATTR_IEEE_PEER_ETS, |
269 | DCB_ATTR_IEEE_PEER_PFC, | |
270 | DCB_ATTR_IEEE_PEER_APP, | |
3e29027a JF |
271 | __DCB_ATTR_IEEE_MAX |
272 | }; | |
273 | #define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1) | |
274 | ||
275 | enum ieee_attrs_app { | |
276 | DCB_ATTR_IEEE_APP_UNSPEC, | |
277 | DCB_ATTR_IEEE_APP, | |
278 | __DCB_ATTR_IEEE_APP_MAX | |
279 | }; | |
280 | #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1) | |
281 | ||
2f90b865 AD |
282 | /** |
283 | * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs | |
284 | * | |
285 | * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors | |
286 | * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8) | |
287 | * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8) | |
288 | * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8) | |
289 | * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8) | |
290 | * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8) | |
291 | * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8) | |
292 | * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8) | |
293 | * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8) | |
294 | * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined | |
295 | * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG) | |
296 | * | |
297 | */ | |
298 | enum dcbnl_pfc_up_attrs { | |
299 | DCB_PFC_UP_ATTR_UNDEFINED, | |
300 | ||
301 | DCB_PFC_UP_ATTR_0, | |
302 | DCB_PFC_UP_ATTR_1, | |
303 | DCB_PFC_UP_ATTR_2, | |
304 | DCB_PFC_UP_ATTR_3, | |
305 | DCB_PFC_UP_ATTR_4, | |
306 | DCB_PFC_UP_ATTR_5, | |
307 | DCB_PFC_UP_ATTR_6, | |
308 | DCB_PFC_UP_ATTR_7, | |
309 | DCB_PFC_UP_ATTR_ALL, | |
310 | ||
311 | __DCB_PFC_UP_ATTR_ENUM_MAX, | |
312 | DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1, | |
313 | }; | |
314 | ||
315 | /** | |
316 | * enum dcbnl_pg_attrs - DCB Priority Group attributes | |
317 | * | |
318 | * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors | |
319 | * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED) | |
320 | * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED) | |
321 | * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED) | |
322 | * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED) | |
323 | * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED) | |
324 | * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED) | |
325 | * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED) | |
326 | * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED) | |
327 | * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined | |
328 | * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED) | |
329 | * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8) | |
330 | * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8) | |
331 | * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8) | |
332 | * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8) | |
333 | * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8) | |
334 | * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8) | |
335 | * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8) | |
336 | * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8) | |
337 | * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined | |
338 | * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG) | |
339 | * | |
340 | */ | |
341 | enum dcbnl_pg_attrs { | |
342 | DCB_PG_ATTR_UNDEFINED, | |
343 | ||
344 | DCB_PG_ATTR_TC_0, | |
345 | DCB_PG_ATTR_TC_1, | |
346 | DCB_PG_ATTR_TC_2, | |
347 | DCB_PG_ATTR_TC_3, | |
348 | DCB_PG_ATTR_TC_4, | |
349 | DCB_PG_ATTR_TC_5, | |
350 | DCB_PG_ATTR_TC_6, | |
351 | DCB_PG_ATTR_TC_7, | |
352 | DCB_PG_ATTR_TC_MAX, | |
353 | DCB_PG_ATTR_TC_ALL, | |
354 | ||
355 | DCB_PG_ATTR_BW_ID_0, | |
356 | DCB_PG_ATTR_BW_ID_1, | |
357 | DCB_PG_ATTR_BW_ID_2, | |
358 | DCB_PG_ATTR_BW_ID_3, | |
359 | DCB_PG_ATTR_BW_ID_4, | |
360 | DCB_PG_ATTR_BW_ID_5, | |
361 | DCB_PG_ATTR_BW_ID_6, | |
362 | DCB_PG_ATTR_BW_ID_7, | |
363 | DCB_PG_ATTR_BW_ID_MAX, | |
364 | DCB_PG_ATTR_BW_ID_ALL, | |
365 | ||
366 | __DCB_PG_ATTR_ENUM_MAX, | |
367 | DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1, | |
368 | }; | |
369 | ||
370 | /** | |
371 | * enum dcbnl_tc_attrs - DCB Traffic Class attributes | |
372 | * | |
373 | * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors | |
374 | * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to | |
375 | * Valid values are: 0-7 | |
376 | * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map | |
377 | * Some devices may not support changing the | |
378 | * user priority map of a TC. | |
379 | * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting | |
380 | * 0 - none | |
381 | * 1 - group strict | |
382 | * 2 - link strict | |
383 | * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and | |
384 | * not configured to use link strict priority, | |
385 | * this is the percentage of bandwidth of the | |
386 | * priority group this traffic class belongs to | |
387 | * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters | |
388 | * | |
389 | */ | |
390 | enum dcbnl_tc_attrs { | |
391 | DCB_TC_ATTR_PARAM_UNDEFINED, | |
392 | ||
393 | DCB_TC_ATTR_PARAM_PGID, | |
394 | DCB_TC_ATTR_PARAM_UP_MAPPING, | |
395 | DCB_TC_ATTR_PARAM_STRICT_PRIO, | |
396 | DCB_TC_ATTR_PARAM_BW_PCT, | |
397 | DCB_TC_ATTR_PARAM_ALL, | |
398 | ||
399 | __DCB_TC_ATTR_PARAM_ENUM_MAX, | |
400 | DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1, | |
401 | }; | |
402 | ||
46132188 AD |
403 | /** |
404 | * enum dcbnl_cap_attrs - DCB Capability attributes | |
405 | * | |
406 | * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors | |
407 | * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters | |
408 | * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups | |
409 | * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control | |
410 | * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to | |
411 | * traffic class mapping | |
412 | * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a | |
413 | * number of traffic classes the device | |
414 | * can be configured to use for Priority Groups | |
415 | * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a | |
416 | * number of traffic classes the device can be | |
417 | * configured to use for Priority Flow Control | |
418 | * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority | |
419 | * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion | |
420 | * Notification | |
6241b625 SR |
421 | * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine |
422 | * | |
46132188 AD |
423 | */ |
424 | enum dcbnl_cap_attrs { | |
425 | DCB_CAP_ATTR_UNDEFINED, | |
426 | DCB_CAP_ATTR_ALL, | |
427 | DCB_CAP_ATTR_PG, | |
428 | DCB_CAP_ATTR_PFC, | |
429 | DCB_CAP_ATTR_UP2TC, | |
430 | DCB_CAP_ATTR_PG_TCS, | |
431 | DCB_CAP_ATTR_PFC_TCS, | |
432 | DCB_CAP_ATTR_GSP, | |
433 | DCB_CAP_ATTR_BCN, | |
6241b625 | 434 | DCB_CAP_ATTR_DCBX, |
46132188 AD |
435 | |
436 | __DCB_CAP_ATTR_ENUM_MAX, | |
437 | DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1, | |
438 | }; | |
33dbabc4 | 439 | |
6241b625 SR |
440 | /** |
441 | * DCBX capability flags | |
442 | * | |
443 | * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent. | |
444 | * 'set' routines are used to configure the device with | |
445 | * the negotiated parameters | |
446 | * | |
447 | * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but | |
448 | * by another entity | |
449 | * 'get' routines are used to retrieve the | |
450 | * negotiated parameters | |
451 | * 'set' routines can be used to set the initial | |
452 | * negotiation configuration | |
453 | * | |
454 | * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine | |
455 | * supports the CEE protocol flavor | |
456 | * | |
457 | * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine | |
458 | * supports the IEEE protocol flavor | |
459 | * | |
460 | * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine | |
461 | * supports static configuration (i.e no actual | |
462 | * negotiation is performed negotiated parameters equal | |
463 | * the initial configuration) | |
464 | * | |
465 | */ | |
466 | #define DCB_CAP_DCBX_HOST 0x01 | |
467 | #define DCB_CAP_DCBX_LLD_MANAGED 0x02 | |
468 | #define DCB_CAP_DCBX_VER_CEE 0x04 | |
469 | #define DCB_CAP_DCBX_VER_IEEE 0x08 | |
470 | #define DCB_CAP_DCBX_STATIC 0x10 | |
471 | ||
33dbabc4 AD |
472 | /** |
473 | * enum dcbnl_numtcs_attrs - number of traffic classes | |
474 | * | |
475 | * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors | |
476 | * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes | |
477 | * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for | |
478 | * priority groups | |
479 | * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can | |
480 | * support priority flow control | |
481 | */ | |
482 | enum dcbnl_numtcs_attrs { | |
483 | DCB_NUMTCS_ATTR_UNDEFINED, | |
484 | DCB_NUMTCS_ATTR_ALL, | |
485 | DCB_NUMTCS_ATTR_PG, | |
486 | DCB_NUMTCS_ATTR_PFC, | |
487 | ||
488 | __DCB_NUMTCS_ATTR_ENUM_MAX, | |
489 | DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1, | |
490 | }; | |
491 | ||
859ee3c4 AD |
492 | enum dcbnl_bcn_attrs{ |
493 | DCB_BCN_ATTR_UNDEFINED = 0, | |
494 | ||
495 | DCB_BCN_ATTR_RP_0, | |
496 | DCB_BCN_ATTR_RP_1, | |
497 | DCB_BCN_ATTR_RP_2, | |
498 | DCB_BCN_ATTR_RP_3, | |
499 | DCB_BCN_ATTR_RP_4, | |
500 | DCB_BCN_ATTR_RP_5, | |
501 | DCB_BCN_ATTR_RP_6, | |
502 | DCB_BCN_ATTR_RP_7, | |
503 | DCB_BCN_ATTR_RP_ALL, | |
504 | ||
f4314e81 DS |
505 | DCB_BCN_ATTR_BCNA_0, |
506 | DCB_BCN_ATTR_BCNA_1, | |
859ee3c4 AD |
507 | DCB_BCN_ATTR_ALPHA, |
508 | DCB_BCN_ATTR_BETA, | |
509 | DCB_BCN_ATTR_GD, | |
510 | DCB_BCN_ATTR_GI, | |
511 | DCB_BCN_ATTR_TMAX, | |
512 | DCB_BCN_ATTR_TD, | |
513 | DCB_BCN_ATTR_RMIN, | |
514 | DCB_BCN_ATTR_W, | |
515 | DCB_BCN_ATTR_RD, | |
516 | DCB_BCN_ATTR_RU, | |
517 | DCB_BCN_ATTR_WRTT, | |
518 | DCB_BCN_ATTR_RI, | |
519 | DCB_BCN_ATTR_C, | |
520 | DCB_BCN_ATTR_ALL, | |
521 | ||
522 | __DCB_BCN_ATTR_ENUM_MAX, | |
523 | DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1, | |
524 | }; | |
525 | ||
2f90b865 AD |
526 | /** |
527 | * enum dcb_general_attr_values - general DCB attribute values | |
528 | * | |
529 | * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported | |
530 | * | |
531 | */ | |
532 | enum dcb_general_attr_values { | |
533 | DCB_ATTR_VALUE_UNDEFINED = 0xff | |
534 | }; | |
535 | ||
0f6f2902 YZ |
536 | #define DCB_APP_IDTYPE_ETHTYPE 0x00 |
537 | #define DCB_APP_IDTYPE_PORTNUM 0x01 | |
538 | enum dcbnl_app_attrs { | |
539 | DCB_APP_ATTR_UNDEFINED, | |
540 | ||
541 | DCB_APP_ATTR_IDTYPE, | |
542 | DCB_APP_ATTR_ID, | |
543 | DCB_APP_ATTR_PRIORITY, | |
544 | ||
545 | __DCB_APP_ATTR_ENUM_MAX, | |
546 | DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1, | |
547 | }; | |
2f90b865 | 548 | |
ea45fe4e SR |
549 | /** |
550 | * enum dcbnl_featcfg_attrs - features conifiguration flags | |
551 | * | |
552 | * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors | |
553 | * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes | |
554 | * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups | |
555 | * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority | |
556 | * flow control | |
557 | * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV | |
558 | * | |
559 | */ | |
560 | #define DCB_FEATCFG_ERROR 0x01 /* error in feature resolution */ | |
561 | #define DCB_FEATCFG_ENABLE 0x02 /* enable feature */ | |
562 | #define DCB_FEATCFG_WILLING 0x04 /* feature is willing */ | |
563 | #define DCB_FEATCFG_ADVERTISE 0x08 /* advertise feature */ | |
564 | enum dcbnl_featcfg_attrs { | |
565 | DCB_FEATCFG_ATTR_UNDEFINED, | |
566 | DCB_FEATCFG_ATTR_ALL, | |
567 | DCB_FEATCFG_ATTR_PG, | |
568 | DCB_FEATCFG_ATTR_PFC, | |
569 | DCB_FEATCFG_ATTR_APP, | |
570 | ||
571 | __DCB_FEATCFG_ATTR_ENUM_MAX, | |
572 | DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1, | |
573 | }; | |
574 | ||
2f90b865 | 575 | #endif /* __LINUX_DCBNL_H__ */ |