2 * Copyright (c) 2008, Intel Corporation.
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.
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
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.
17 * Author: Lucy Liu <lucy.liu@intel.com>
20 #ifndef __LINUX_DCBNL_H__
21 #define __LINUX_DCBNL_H__
23 #include <linux/types.h>
25 #define DCB_PROTO_VERSION 1
34 * enum dcbnl_commands - supported DCB commands
36 * @DCB_CMD_UNDEFINED: unspecified command to catch errors
37 * @DCB_CMD_GSTATE: request the state of DCB in the device
38 * @DCB_CMD_SSTATE: set the state of DCB in the device
39 * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
40 * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
41 * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
42 * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
43 * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
44 * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
45 * @DCB_CMD_SET_ALL: apply all changes to the underlying device
46 * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
47 * device. Only useful when using bonding.
48 * @DCB_CMD_GCAP: request the DCB capabilities of the device
49 * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
50 * @DCB_CMD_SNUMTCS: set the number of traffic classes
51 * @DCB_CMD_GBCN: set backward congestion notification configuration
52 * @DCB_CMD_SBCN: get backward congestion notification configration.
84 DCB_CMD_MAX
= __DCB_CMD_ENUM_MAX
- 1,
88 * enum dcbnl_attrs - DCB top-level netlink attributes
90 * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
91 * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
92 * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
93 * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
94 * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
95 * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
96 * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
97 * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
98 * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
99 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
100 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
101 * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
113 DCB_ATTR_PERM_HWADDR
,
119 DCB_ATTR_MAX
= __DCB_ATTR_ENUM_MAX
- 1,
123 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
125 * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
126 * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
127 * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
128 * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
129 * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
130 * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
131 * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
132 * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
133 * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
134 * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
135 * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
138 enum dcbnl_pfc_up_attrs
{
139 DCB_PFC_UP_ATTR_UNDEFINED
,
151 __DCB_PFC_UP_ATTR_ENUM_MAX
,
152 DCB_PFC_UP_ATTR_MAX
= __DCB_PFC_UP_ATTR_ENUM_MAX
- 1,
156 * enum dcbnl_pg_attrs - DCB Priority Group attributes
158 * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
159 * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
160 * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
161 * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
162 * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
163 * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
164 * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
165 * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
166 * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
167 * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
168 * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
169 * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
170 * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
171 * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
172 * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
173 * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
174 * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
175 * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
176 * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
177 * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
178 * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
181 enum dcbnl_pg_attrs
{
182 DCB_PG_ATTR_UNDEFINED
,
203 DCB_PG_ATTR_BW_ID_MAX
,
204 DCB_PG_ATTR_BW_ID_ALL
,
206 __DCB_PG_ATTR_ENUM_MAX
,
207 DCB_PG_ATTR_MAX
= __DCB_PG_ATTR_ENUM_MAX
- 1,
211 * enum dcbnl_tc_attrs - DCB Traffic Class attributes
213 * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
214 * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
215 * Valid values are: 0-7
216 * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
217 * Some devices may not support changing the
218 * user priority map of a TC.
219 * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
223 * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
224 * not configured to use link strict priority,
225 * this is the percentage of bandwidth of the
226 * priority group this traffic class belongs to
227 * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
230 enum dcbnl_tc_attrs
{
231 DCB_TC_ATTR_PARAM_UNDEFINED
,
233 DCB_TC_ATTR_PARAM_PGID
,
234 DCB_TC_ATTR_PARAM_UP_MAPPING
,
235 DCB_TC_ATTR_PARAM_STRICT_PRIO
,
236 DCB_TC_ATTR_PARAM_BW_PCT
,
237 DCB_TC_ATTR_PARAM_ALL
,
239 __DCB_TC_ATTR_PARAM_ENUM_MAX
,
240 DCB_TC_ATTR_PARAM_MAX
= __DCB_TC_ATTR_PARAM_ENUM_MAX
- 1,
244 * enum dcbnl_cap_attrs - DCB Capability attributes
246 * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
247 * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
248 * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
249 * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
250 * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
251 * traffic class mapping
252 * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
253 * number of traffic classes the device
254 * can be configured to use for Priority Groups
255 * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
256 * number of traffic classes the device can be
257 * configured to use for Priority Flow Control
258 * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
259 * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
262 enum dcbnl_cap_attrs
{
263 DCB_CAP_ATTR_UNDEFINED
,
269 DCB_CAP_ATTR_PFC_TCS
,
273 __DCB_CAP_ATTR_ENUM_MAX
,
274 DCB_CAP_ATTR_MAX
= __DCB_CAP_ATTR_ENUM_MAX
- 1,
278 * enum dcbnl_numtcs_attrs - number of traffic classes
280 * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
281 * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
282 * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
284 * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
285 * support priority flow control
287 enum dcbnl_numtcs_attrs
{
288 DCB_NUMTCS_ATTR_UNDEFINED
,
293 __DCB_NUMTCS_ATTR_ENUM_MAX
,
294 DCB_NUMTCS_ATTR_MAX
= __DCB_NUMTCS_ATTR_ENUM_MAX
- 1,
297 enum dcbnl_bcn_attrs
{
298 DCB_BCN_ATTR_UNDEFINED
= 0,
327 __DCB_BCN_ATTR_ENUM_MAX
,
328 DCB_BCN_ATTR_MAX
= __DCB_BCN_ATTR_ENUM_MAX
- 1,
332 * enum dcb_general_attr_values - general DCB attribute values
334 * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
337 enum dcb_general_attr_values
{
338 DCB_ATTR_VALUE_UNDEFINED
= 0xff
342 #endif /* __LINUX_DCBNL_H__ */