blob: 2542685f8b3ec5e1a93bcbcdbaadb2b69e462e32 [file] [log] [blame]
Alexander Duyck2f90b862008-11-20 20:52:10 -08001/*
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
Chris Leech5c252222009-02-27 10:01:36 +000023#include <linux/types.h>
24
John Fastabend3e290272010-12-30 09:25:46 +000025/* IEEE 802.1Qaz std supported values */
26#define IEEE_8021QAZ_MAX_TCS 8
27
John Fastabendd033d522011-02-10 14:40:01 +000028#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
John Fastabend3e290272010-12-30 09:25:46 +000033/* 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 */
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
John Fastabend9ab933a2010-12-30 09:26:31 +000090/* 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.
John Fastabend3e290272010-12-30 09:25:46 +000093 *
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 */
107struct dcb_app {
108 __u8 selector;
John Fastabend3e290272010-12-30 09:25:46 +0000109 __u8 priority;
John Fastabend226111d2011-02-18 13:30:17 +0000110 __u16 protocol;
John Fastabend3e290272010-12-30 09:25:46 +0000111};
112
Shmulik Ravideed84712011-02-27 05:04:31 +0000113/**
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 */
122struct dcb_peer_app_info {
123 __u8 willing;
124 __u8 error;
125};
126
Alexander Duyck2f90b862008-11-20 20:52:10 -0800127struct dcbmsg {
Chris Leech5c252222009-02-27 10:01:36 +0000128 __u8 dcb_family;
Alexander Duyck2f90b862008-11-20 20:52:10 -0800129 __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.
Alexander Duyck46132182008-11-20 21:05:08 -0800148 * @DCB_CMD_GCAP: request the DCB capabilities of the device
Alexander Duyck33dbabc2008-11-20 21:08:19 -0800149 * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
150 * @DCB_CMD_SNUMTCS: set the number of traffic classes
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800151 * @DCB_CMD_GBCN: set backward congestion notification configuration
152 * @DCB_CMD_SBCN: get backward congestion notification configration.
Yi Zou0f6f2902009-08-31 12:32:34 +0000153 * @DCB_CMD_GAPP: get application protocol configuration
154 * @DCB_CMD_SAPP: set application protocol configuration
John Fastabend3e290272010-12-30 09:25:46 +0000155 * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
156 * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
Shmulik Ravid6241b622010-12-30 06:26:48 +0000157 * @DCB_CMD_GDCBX: get DCBX engine configuration
158 * @DCB_CMD_SDCBX: set DCBX engine configuration
Shmulik Ravidea45fe42010-12-30 06:26:55 +0000159 * @DCB_CMD_GFEATCFG: get DCBX features flags
160 * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
Alexander Duyck2f90b862008-11-20 20:52:10 -0800161 */
162enum 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,
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800177
Alexander Duyck2f90b862008-11-20 20:52:10 -0800178 DCB_CMD_GPERM_HWADDR,
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800179
Alexander Duyck46132182008-11-20 21:05:08 -0800180 DCB_CMD_GCAP,
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800181
Alexander Duyck33dbabc2008-11-20 21:08:19 -0800182 DCB_CMD_GNUMTCS,
183 DCB_CMD_SNUMTCS,
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800184
Alexander Duyck0eb3aa92008-11-20 21:09:23 -0800185 DCB_CMD_PFC_GSTATE,
186 DCB_CMD_PFC_SSTATE,
Alexander Duyck2f90b862008-11-20 20:52:10 -0800187
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800188 DCB_CMD_BCN_GCFG,
189 DCB_CMD_BCN_SCFG,
190
Yi Zou0f6f2902009-08-31 12:32:34 +0000191 DCB_CMD_GAPP,
192 DCB_CMD_SAPP,
193
John Fastabend3e290272010-12-30 09:25:46 +0000194 DCB_CMD_IEEE_SET,
195 DCB_CMD_IEEE_GET,
196
Shmulik Ravid6241b622010-12-30 06:26:48 +0000197 DCB_CMD_GDCBX,
198 DCB_CMD_SDCBX,
199
Shmulik Ravidea45fe42010-12-30 06:26:55 +0000200 DCB_CMD_GFEATCFG,
201 DCB_CMD_SFEATCFG,
202
Alexander Duyck2f90b862008-11-20 20:52:10 -0800203 __DCB_CMD_ENUM_MAX,
204 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
205};
206
Alexander Duyck2f90b862008-11-20 20:52:10 -0800207/**
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)
Alexander Duyck46132182008-11-20 21:05:08 -0800219 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
Alexander Duyck33dbabc2008-11-20 21:08:19 -0800220 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800221 * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
John Fastabend3e290272010-12-30 09:25:46 +0000222 * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
Shmulik Ravid6241b622010-12-30 06:26:48 +0000223 * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
Shmulik Ravidea45fe42010-12-30 06:26:55 +0000224 * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
Alexander Duyck2f90b862008-11-20 20:52:10 -0800225 */
226enum 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,
Alexander Duyck46132182008-11-20 21:05:08 -0800237 DCB_ATTR_CAP,
Alexander Duyck33dbabc2008-11-20 21:08:19 -0800238 DCB_ATTR_NUMTCS,
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800239 DCB_ATTR_BCN,
Yi Zou0f6f2902009-08-31 12:32:34 +0000240 DCB_ATTR_APP,
Alexander Duyck2f90b862008-11-20 20:52:10 -0800241
John Fastabend3e290272010-12-30 09:25:46 +0000242 /* IEEE std attributes */
243 DCB_ATTR_IEEE,
244
Shmulik Ravid6241b622010-12-30 06:26:48 +0000245 DCB_ATTR_DCBX,
Shmulik Ravidea45fe42010-12-30 06:26:55 +0000246 DCB_ATTR_FEATCFG,
Shmulik Ravid6241b622010-12-30 06:26:48 +0000247
Alexander Duyck2f90b862008-11-20 20:52:10 -0800248 __DCB_ATTR_ENUM_MAX,
249 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
250};
251
Shmulik Ravideed84712011-02-27 05:04:31 +0000252/**
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 */
John Fastabend3e290272010-12-30 09:25:46 +0000263enum ieee_attrs {
264 DCB_ATTR_IEEE_UNSPEC,
265 DCB_ATTR_IEEE_ETS,
266 DCB_ATTR_IEEE_PFC,
267 DCB_ATTR_IEEE_APP_TABLE,
Shmulik Ravideed84712011-02-27 05:04:31 +0000268 DCB_ATTR_IEEE_PEER_ETS,
269 DCB_ATTR_IEEE_PEER_PFC,
270 DCB_ATTR_IEEE_PEER_APP,
John Fastabend3e290272010-12-30 09:25:46 +0000271 __DCB_ATTR_IEEE_MAX
272};
273#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
274
275enum 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
Alexander Duyck2f90b862008-11-20 20:52:10 -0800282/**
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 */
298enum 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 */
341enum 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 */
390enum 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
403/**
Alexander Duyck46132182008-11-20 21:05:08 -0800404 * 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
Shmulik Ravid6241b622010-12-30 06:26:48 +0000421 * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
422 *
Alexander Duyck46132182008-11-20 21:05:08 -0800423 */
424enum 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,
Shmulik Ravid6241b622010-12-30 06:26:48 +0000434 DCB_CAP_ATTR_DCBX,
Alexander Duyck46132182008-11-20 21:05:08 -0800435
436 __DCB_CAP_ATTR_ENUM_MAX,
437 DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
438};
Alexander Duyck33dbabc2008-11-20 21:08:19 -0800439
440/**
Shmulik Ravid6241b622010-12-30 06:26:48 +0000441 * 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
472/**
Alexander Duyck33dbabc2008-11-20 21:08:19 -0800473 * 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 */
482enum 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
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800492enum 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
Don Skidmoref4314e82008-12-21 20:10:29 -0800505 DCB_BCN_ATTR_BCNA_0,
506 DCB_BCN_ATTR_BCNA_1,
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800507 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
Alexander Duyck46132182008-11-20 21:05:08 -0800526/**
Alexander Duyck2f90b862008-11-20 20:52:10 -0800527 * 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 */
532enum dcb_general_attr_values {
533 DCB_ATTR_VALUE_UNDEFINED = 0xff
534};
535
Yi Zou0f6f2902009-08-31 12:32:34 +0000536#define DCB_APP_IDTYPE_ETHTYPE 0x00
537#define DCB_APP_IDTYPE_PORTNUM 0x01
538enum 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};
Alexander Duyck2f90b862008-11-20 20:52:10 -0800548
Shmulik Ravidea45fe42010-12-30 06:26:55 +0000549/**
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 */
564enum 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
Alexander Duyck2f90b862008-11-20 20:52:10 -0800575#endif /* __LINUX_DCBNL_H__ */