blob: cd8d518efa3b007163f3411ff06e54748e75cd0a [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;
109 __u32 protocol;
110 __u8 priority;
111};
112
Alexander Duyck2f90b862008-11-20 20:52:10 -0800113struct dcbmsg {
Chris Leech5c252222009-02-27 10:01:36 +0000114 __u8 dcb_family;
Alexander Duyck2f90b862008-11-20 20:52:10 -0800115 __u8 cmd;
116 __u16 dcb_pad;
117};
118
119/**
120 * enum dcbnl_commands - supported DCB commands
121 *
122 * @DCB_CMD_UNDEFINED: unspecified command to catch errors
123 * @DCB_CMD_GSTATE: request the state of DCB in the device
124 * @DCB_CMD_SSTATE: set the state of DCB in the device
125 * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
126 * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
127 * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
128 * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
129 * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
130 * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
131 * @DCB_CMD_SET_ALL: apply all changes to the underlying device
132 * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
133 * device. Only useful when using bonding.
Alexander Duyck46132182008-11-20 21:05:08 -0800134 * @DCB_CMD_GCAP: request the DCB capabilities of the device
Alexander Duyck33dbabc2008-11-20 21:08:19 -0800135 * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
136 * @DCB_CMD_SNUMTCS: set the number of traffic classes
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800137 * @DCB_CMD_GBCN: set backward congestion notification configuration
138 * @DCB_CMD_SBCN: get backward congestion notification configration.
Yi Zou0f6f2902009-08-31 12:32:34 +0000139 * @DCB_CMD_GAPP: get application protocol configuration
140 * @DCB_CMD_SAPP: set application protocol configuration
John Fastabend3e290272010-12-30 09:25:46 +0000141 * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
142 * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
Shmulik Ravid6241b622010-12-30 06:26:48 +0000143 * @DCB_CMD_GDCBX: get DCBX engine configuration
144 * @DCB_CMD_SDCBX: set DCBX engine configuration
Shmulik Ravidea45fe42010-12-30 06:26:55 +0000145 * @DCB_CMD_GFEATCFG: get DCBX features flags
146 * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
Alexander Duyck2f90b862008-11-20 20:52:10 -0800147 */
148enum dcbnl_commands {
149 DCB_CMD_UNDEFINED,
150
151 DCB_CMD_GSTATE,
152 DCB_CMD_SSTATE,
153
154 DCB_CMD_PGTX_GCFG,
155 DCB_CMD_PGTX_SCFG,
156 DCB_CMD_PGRX_GCFG,
157 DCB_CMD_PGRX_SCFG,
158
159 DCB_CMD_PFC_GCFG,
160 DCB_CMD_PFC_SCFG,
161
162 DCB_CMD_SET_ALL,
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800163
Alexander Duyck2f90b862008-11-20 20:52:10 -0800164 DCB_CMD_GPERM_HWADDR,
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800165
Alexander Duyck46132182008-11-20 21:05:08 -0800166 DCB_CMD_GCAP,
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800167
Alexander Duyck33dbabc2008-11-20 21:08:19 -0800168 DCB_CMD_GNUMTCS,
169 DCB_CMD_SNUMTCS,
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800170
Alexander Duyck0eb3aa92008-11-20 21:09:23 -0800171 DCB_CMD_PFC_GSTATE,
172 DCB_CMD_PFC_SSTATE,
Alexander Duyck2f90b862008-11-20 20:52:10 -0800173
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800174 DCB_CMD_BCN_GCFG,
175 DCB_CMD_BCN_SCFG,
176
Yi Zou0f6f2902009-08-31 12:32:34 +0000177 DCB_CMD_GAPP,
178 DCB_CMD_SAPP,
179
John Fastabend3e290272010-12-30 09:25:46 +0000180 DCB_CMD_IEEE_SET,
181 DCB_CMD_IEEE_GET,
182
Shmulik Ravid6241b622010-12-30 06:26:48 +0000183 DCB_CMD_GDCBX,
184 DCB_CMD_SDCBX,
185
Shmulik Ravidea45fe42010-12-30 06:26:55 +0000186 DCB_CMD_GFEATCFG,
187 DCB_CMD_SFEATCFG,
188
Alexander Duyck2f90b862008-11-20 20:52:10 -0800189 __DCB_CMD_ENUM_MAX,
190 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
191};
192
Alexander Duyck2f90b862008-11-20 20:52:10 -0800193/**
194 * enum dcbnl_attrs - DCB top-level netlink attributes
195 *
196 * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
197 * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
198 * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
199 * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
200 * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
201 * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
202 * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
203 * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
204 * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
Alexander Duyck46132182008-11-20 21:05:08 -0800205 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
Alexander Duyck33dbabc2008-11-20 21:08:19 -0800206 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800207 * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
John Fastabend3e290272010-12-30 09:25:46 +0000208 * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
Shmulik Ravid6241b622010-12-30 06:26:48 +0000209 * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
Shmulik Ravidea45fe42010-12-30 06:26:55 +0000210 * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
Alexander Duyck2f90b862008-11-20 20:52:10 -0800211 */
212enum dcbnl_attrs {
213 DCB_ATTR_UNDEFINED,
214
215 DCB_ATTR_IFNAME,
216 DCB_ATTR_STATE,
217 DCB_ATTR_PFC_STATE,
218 DCB_ATTR_PFC_CFG,
219 DCB_ATTR_NUM_TC,
220 DCB_ATTR_PG_CFG,
221 DCB_ATTR_SET_ALL,
222 DCB_ATTR_PERM_HWADDR,
Alexander Duyck46132182008-11-20 21:05:08 -0800223 DCB_ATTR_CAP,
Alexander Duyck33dbabc2008-11-20 21:08:19 -0800224 DCB_ATTR_NUMTCS,
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800225 DCB_ATTR_BCN,
Yi Zou0f6f2902009-08-31 12:32:34 +0000226 DCB_ATTR_APP,
Alexander Duyck2f90b862008-11-20 20:52:10 -0800227
John Fastabend3e290272010-12-30 09:25:46 +0000228 /* IEEE std attributes */
229 DCB_ATTR_IEEE,
230
Shmulik Ravid6241b622010-12-30 06:26:48 +0000231 DCB_ATTR_DCBX,
Shmulik Ravidea45fe42010-12-30 06:26:55 +0000232 DCB_ATTR_FEATCFG,
Shmulik Ravid6241b622010-12-30 06:26:48 +0000233
Alexander Duyck2f90b862008-11-20 20:52:10 -0800234 __DCB_ATTR_ENUM_MAX,
235 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
236};
237
John Fastabend3e290272010-12-30 09:25:46 +0000238enum ieee_attrs {
239 DCB_ATTR_IEEE_UNSPEC,
240 DCB_ATTR_IEEE_ETS,
241 DCB_ATTR_IEEE_PFC,
242 DCB_ATTR_IEEE_APP_TABLE,
243 __DCB_ATTR_IEEE_MAX
244};
245#define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
246
247enum ieee_attrs_app {
248 DCB_ATTR_IEEE_APP_UNSPEC,
249 DCB_ATTR_IEEE_APP,
250 __DCB_ATTR_IEEE_APP_MAX
251};
252#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
253
Alexander Duyck2f90b862008-11-20 20:52:10 -0800254/**
255 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
256 *
257 * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
258 * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
259 * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
260 * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
261 * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
262 * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
263 * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
264 * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
265 * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
266 * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
267 * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
268 *
269 */
270enum dcbnl_pfc_up_attrs {
271 DCB_PFC_UP_ATTR_UNDEFINED,
272
273 DCB_PFC_UP_ATTR_0,
274 DCB_PFC_UP_ATTR_1,
275 DCB_PFC_UP_ATTR_2,
276 DCB_PFC_UP_ATTR_3,
277 DCB_PFC_UP_ATTR_4,
278 DCB_PFC_UP_ATTR_5,
279 DCB_PFC_UP_ATTR_6,
280 DCB_PFC_UP_ATTR_7,
281 DCB_PFC_UP_ATTR_ALL,
282
283 __DCB_PFC_UP_ATTR_ENUM_MAX,
284 DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
285};
286
287/**
288 * enum dcbnl_pg_attrs - DCB Priority Group attributes
289 *
290 * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
291 * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
292 * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
293 * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
294 * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
295 * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
296 * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
297 * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
298 * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
299 * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
300 * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
301 * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
302 * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
303 * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
304 * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
305 * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
306 * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
307 * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
308 * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
309 * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
310 * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
311 *
312 */
313enum dcbnl_pg_attrs {
314 DCB_PG_ATTR_UNDEFINED,
315
316 DCB_PG_ATTR_TC_0,
317 DCB_PG_ATTR_TC_1,
318 DCB_PG_ATTR_TC_2,
319 DCB_PG_ATTR_TC_3,
320 DCB_PG_ATTR_TC_4,
321 DCB_PG_ATTR_TC_5,
322 DCB_PG_ATTR_TC_6,
323 DCB_PG_ATTR_TC_7,
324 DCB_PG_ATTR_TC_MAX,
325 DCB_PG_ATTR_TC_ALL,
326
327 DCB_PG_ATTR_BW_ID_0,
328 DCB_PG_ATTR_BW_ID_1,
329 DCB_PG_ATTR_BW_ID_2,
330 DCB_PG_ATTR_BW_ID_3,
331 DCB_PG_ATTR_BW_ID_4,
332 DCB_PG_ATTR_BW_ID_5,
333 DCB_PG_ATTR_BW_ID_6,
334 DCB_PG_ATTR_BW_ID_7,
335 DCB_PG_ATTR_BW_ID_MAX,
336 DCB_PG_ATTR_BW_ID_ALL,
337
338 __DCB_PG_ATTR_ENUM_MAX,
339 DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
340};
341
342/**
343 * enum dcbnl_tc_attrs - DCB Traffic Class attributes
344 *
345 * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
346 * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
347 * Valid values are: 0-7
348 * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
349 * Some devices may not support changing the
350 * user priority map of a TC.
351 * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
352 * 0 - none
353 * 1 - group strict
354 * 2 - link strict
355 * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
356 * not configured to use link strict priority,
357 * this is the percentage of bandwidth of the
358 * priority group this traffic class belongs to
359 * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
360 *
361 */
362enum dcbnl_tc_attrs {
363 DCB_TC_ATTR_PARAM_UNDEFINED,
364
365 DCB_TC_ATTR_PARAM_PGID,
366 DCB_TC_ATTR_PARAM_UP_MAPPING,
367 DCB_TC_ATTR_PARAM_STRICT_PRIO,
368 DCB_TC_ATTR_PARAM_BW_PCT,
369 DCB_TC_ATTR_PARAM_ALL,
370
371 __DCB_TC_ATTR_PARAM_ENUM_MAX,
372 DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
373};
374
375/**
Alexander Duyck46132182008-11-20 21:05:08 -0800376 * enum dcbnl_cap_attrs - DCB Capability attributes
377 *
378 * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
379 * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
380 * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
381 * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
382 * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
383 * traffic class mapping
384 * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
385 * number of traffic classes the device
386 * can be configured to use for Priority Groups
387 * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
388 * number of traffic classes the device can be
389 * configured to use for Priority Flow Control
390 * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
391 * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
392 * Notification
Shmulik Ravid6241b622010-12-30 06:26:48 +0000393 * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
394 *
Alexander Duyck46132182008-11-20 21:05:08 -0800395 */
396enum dcbnl_cap_attrs {
397 DCB_CAP_ATTR_UNDEFINED,
398 DCB_CAP_ATTR_ALL,
399 DCB_CAP_ATTR_PG,
400 DCB_CAP_ATTR_PFC,
401 DCB_CAP_ATTR_UP2TC,
402 DCB_CAP_ATTR_PG_TCS,
403 DCB_CAP_ATTR_PFC_TCS,
404 DCB_CAP_ATTR_GSP,
405 DCB_CAP_ATTR_BCN,
Shmulik Ravid6241b622010-12-30 06:26:48 +0000406 DCB_CAP_ATTR_DCBX,
Alexander Duyck46132182008-11-20 21:05:08 -0800407
408 __DCB_CAP_ATTR_ENUM_MAX,
409 DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
410};
Alexander Duyck33dbabc2008-11-20 21:08:19 -0800411
412/**
Shmulik Ravid6241b622010-12-30 06:26:48 +0000413 * DCBX capability flags
414 *
415 * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
416 * 'set' routines are used to configure the device with
417 * the negotiated parameters
418 *
419 * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
420 * by another entity
421 * 'get' routines are used to retrieve the
422 * negotiated parameters
423 * 'set' routines can be used to set the initial
424 * negotiation configuration
425 *
426 * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
427 * supports the CEE protocol flavor
428 *
429 * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
430 * supports the IEEE protocol flavor
431 *
432 * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
433 * supports static configuration (i.e no actual
434 * negotiation is performed negotiated parameters equal
435 * the initial configuration)
436 *
437 */
438#define DCB_CAP_DCBX_HOST 0x01
439#define DCB_CAP_DCBX_LLD_MANAGED 0x02
440#define DCB_CAP_DCBX_VER_CEE 0x04
441#define DCB_CAP_DCBX_VER_IEEE 0x08
442#define DCB_CAP_DCBX_STATIC 0x10
443
444/**
Alexander Duyck33dbabc2008-11-20 21:08:19 -0800445 * enum dcbnl_numtcs_attrs - number of traffic classes
446 *
447 * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
448 * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
449 * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
450 * priority groups
451 * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
452 * support priority flow control
453 */
454enum dcbnl_numtcs_attrs {
455 DCB_NUMTCS_ATTR_UNDEFINED,
456 DCB_NUMTCS_ATTR_ALL,
457 DCB_NUMTCS_ATTR_PG,
458 DCB_NUMTCS_ATTR_PFC,
459
460 __DCB_NUMTCS_ATTR_ENUM_MAX,
461 DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
462};
463
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800464enum dcbnl_bcn_attrs{
465 DCB_BCN_ATTR_UNDEFINED = 0,
466
467 DCB_BCN_ATTR_RP_0,
468 DCB_BCN_ATTR_RP_1,
469 DCB_BCN_ATTR_RP_2,
470 DCB_BCN_ATTR_RP_3,
471 DCB_BCN_ATTR_RP_4,
472 DCB_BCN_ATTR_RP_5,
473 DCB_BCN_ATTR_RP_6,
474 DCB_BCN_ATTR_RP_7,
475 DCB_BCN_ATTR_RP_ALL,
476
Don Skidmoref4314e82008-12-21 20:10:29 -0800477 DCB_BCN_ATTR_BCNA_0,
478 DCB_BCN_ATTR_BCNA_1,
Alexander Duyck859ee3c2008-11-20 21:10:23 -0800479 DCB_BCN_ATTR_ALPHA,
480 DCB_BCN_ATTR_BETA,
481 DCB_BCN_ATTR_GD,
482 DCB_BCN_ATTR_GI,
483 DCB_BCN_ATTR_TMAX,
484 DCB_BCN_ATTR_TD,
485 DCB_BCN_ATTR_RMIN,
486 DCB_BCN_ATTR_W,
487 DCB_BCN_ATTR_RD,
488 DCB_BCN_ATTR_RU,
489 DCB_BCN_ATTR_WRTT,
490 DCB_BCN_ATTR_RI,
491 DCB_BCN_ATTR_C,
492 DCB_BCN_ATTR_ALL,
493
494 __DCB_BCN_ATTR_ENUM_MAX,
495 DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
496};
497
Alexander Duyck46132182008-11-20 21:05:08 -0800498/**
Alexander Duyck2f90b862008-11-20 20:52:10 -0800499 * enum dcb_general_attr_values - general DCB attribute values
500 *
501 * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
502 *
503 */
504enum dcb_general_attr_values {
505 DCB_ATTR_VALUE_UNDEFINED = 0xff
506};
507
Yi Zou0f6f2902009-08-31 12:32:34 +0000508#define DCB_APP_IDTYPE_ETHTYPE 0x00
509#define DCB_APP_IDTYPE_PORTNUM 0x01
510enum dcbnl_app_attrs {
511 DCB_APP_ATTR_UNDEFINED,
512
513 DCB_APP_ATTR_IDTYPE,
514 DCB_APP_ATTR_ID,
515 DCB_APP_ATTR_PRIORITY,
516
517 __DCB_APP_ATTR_ENUM_MAX,
518 DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
519};
Alexander Duyck2f90b862008-11-20 20:52:10 -0800520
Shmulik Ravidea45fe42010-12-30 06:26:55 +0000521/**
522 * enum dcbnl_featcfg_attrs - features conifiguration flags
523 *
524 * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
525 * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
526 * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
527 * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
528 * flow control
529 * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
530 *
531 */
532#define DCB_FEATCFG_ERROR 0x01 /* error in feature resolution */
533#define DCB_FEATCFG_ENABLE 0x02 /* enable feature */
534#define DCB_FEATCFG_WILLING 0x04 /* feature is willing */
535#define DCB_FEATCFG_ADVERTISE 0x08 /* advertise feature */
536enum dcbnl_featcfg_attrs {
537 DCB_FEATCFG_ATTR_UNDEFINED,
538 DCB_FEATCFG_ATTR_ALL,
539 DCB_FEATCFG_ATTR_PG,
540 DCB_FEATCFG_ATTR_PFC,
541 DCB_FEATCFG_ATTR_APP,
542
543 __DCB_FEATCFG_ATTR_ENUM_MAX,
544 DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
545};
546
Alexander Duyck2f90b862008-11-20 20:52:10 -0800547#endif /* __LINUX_DCBNL_H__ */