DCB: Add interface to query # of TCs supported by device
[deliverable/linux.git] / include / linux / dcbnl.h
CommitLineData
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
23#define DCB_PROTO_VERSION 1
24
25struct dcbmsg {
26 unsigned char dcb_family;
27 __u8 cmd;
28 __u16 dcb_pad;
29};
30
31/**
32 * enum dcbnl_commands - supported DCB commands
33 *
34 * @DCB_CMD_UNDEFINED: unspecified command to catch errors
35 * @DCB_CMD_GSTATE: request the state of DCB in the device
36 * @DCB_CMD_SSTATE: set the state of DCB in the device
37 * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
38 * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
39 * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
40 * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
41 * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
42 * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
43 * @DCB_CMD_SET_ALL: apply all changes to the underlying device
44 * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
45 * device. Only useful when using bonding.
46132188 46 * @DCB_CMD_GCAP: request the DCB capabilities of the device
33dbabc4
AD
47 * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
48 * @DCB_CMD_SNUMTCS: set the number of traffic classes
2f90b865
AD
49 */
50enum dcbnl_commands {
51 DCB_CMD_UNDEFINED,
52
53 DCB_CMD_GSTATE,
54 DCB_CMD_SSTATE,
55
56 DCB_CMD_PGTX_GCFG,
57 DCB_CMD_PGTX_SCFG,
58 DCB_CMD_PGRX_GCFG,
59 DCB_CMD_PGRX_SCFG,
60
61 DCB_CMD_PFC_GCFG,
62 DCB_CMD_PFC_SCFG,
63
64 DCB_CMD_SET_ALL,
65 DCB_CMD_GPERM_HWADDR,
46132188 66 DCB_CMD_GCAP,
33dbabc4
AD
67 DCB_CMD_GNUMTCS,
68 DCB_CMD_SNUMTCS,
2f90b865
AD
69
70 __DCB_CMD_ENUM_MAX,
71 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
72};
73
74
75/**
76 * enum dcbnl_attrs - DCB top-level netlink attributes
77 *
78 * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
79 * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
80 * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
81 * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
82 * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
83 * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
84 * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
85 * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
86 * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
46132188 87 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
33dbabc4 88 * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
2f90b865
AD
89 */
90enum dcbnl_attrs {
91 DCB_ATTR_UNDEFINED,
92
93 DCB_ATTR_IFNAME,
94 DCB_ATTR_STATE,
95 DCB_ATTR_PFC_STATE,
96 DCB_ATTR_PFC_CFG,
97 DCB_ATTR_NUM_TC,
98 DCB_ATTR_PG_CFG,
99 DCB_ATTR_SET_ALL,
100 DCB_ATTR_PERM_HWADDR,
46132188 101 DCB_ATTR_CAP,
33dbabc4 102 DCB_ATTR_NUMTCS,
2f90b865
AD
103
104 __DCB_ATTR_ENUM_MAX,
105 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
106};
107
108/**
109 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
110 *
111 * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
112 * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
113 * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
114 * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
115 * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
116 * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
117 * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
118 * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
119 * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
120 * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
121 * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
122 *
123 */
124enum dcbnl_pfc_up_attrs {
125 DCB_PFC_UP_ATTR_UNDEFINED,
126
127 DCB_PFC_UP_ATTR_0,
128 DCB_PFC_UP_ATTR_1,
129 DCB_PFC_UP_ATTR_2,
130 DCB_PFC_UP_ATTR_3,
131 DCB_PFC_UP_ATTR_4,
132 DCB_PFC_UP_ATTR_5,
133 DCB_PFC_UP_ATTR_6,
134 DCB_PFC_UP_ATTR_7,
135 DCB_PFC_UP_ATTR_ALL,
136
137 __DCB_PFC_UP_ATTR_ENUM_MAX,
138 DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
139};
140
141/**
142 * enum dcbnl_pg_attrs - DCB Priority Group attributes
143 *
144 * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
145 * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
146 * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
147 * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
148 * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
149 * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
150 * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
151 * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
152 * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
153 * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
154 * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
155 * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
156 * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
157 * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
158 * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
159 * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
160 * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
161 * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
162 * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
163 * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
164 * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
165 *
166 */
167enum dcbnl_pg_attrs {
168 DCB_PG_ATTR_UNDEFINED,
169
170 DCB_PG_ATTR_TC_0,
171 DCB_PG_ATTR_TC_1,
172 DCB_PG_ATTR_TC_2,
173 DCB_PG_ATTR_TC_3,
174 DCB_PG_ATTR_TC_4,
175 DCB_PG_ATTR_TC_5,
176 DCB_PG_ATTR_TC_6,
177 DCB_PG_ATTR_TC_7,
178 DCB_PG_ATTR_TC_MAX,
179 DCB_PG_ATTR_TC_ALL,
180
181 DCB_PG_ATTR_BW_ID_0,
182 DCB_PG_ATTR_BW_ID_1,
183 DCB_PG_ATTR_BW_ID_2,
184 DCB_PG_ATTR_BW_ID_3,
185 DCB_PG_ATTR_BW_ID_4,
186 DCB_PG_ATTR_BW_ID_5,
187 DCB_PG_ATTR_BW_ID_6,
188 DCB_PG_ATTR_BW_ID_7,
189 DCB_PG_ATTR_BW_ID_MAX,
190 DCB_PG_ATTR_BW_ID_ALL,
191
192 __DCB_PG_ATTR_ENUM_MAX,
193 DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
194};
195
196/**
197 * enum dcbnl_tc_attrs - DCB Traffic Class attributes
198 *
199 * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
200 * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
201 * Valid values are: 0-7
202 * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
203 * Some devices may not support changing the
204 * user priority map of a TC.
205 * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
206 * 0 - none
207 * 1 - group strict
208 * 2 - link strict
209 * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
210 * not configured to use link strict priority,
211 * this is the percentage of bandwidth of the
212 * priority group this traffic class belongs to
213 * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
214 *
215 */
216enum dcbnl_tc_attrs {
217 DCB_TC_ATTR_PARAM_UNDEFINED,
218
219 DCB_TC_ATTR_PARAM_PGID,
220 DCB_TC_ATTR_PARAM_UP_MAPPING,
221 DCB_TC_ATTR_PARAM_STRICT_PRIO,
222 DCB_TC_ATTR_PARAM_BW_PCT,
223 DCB_TC_ATTR_PARAM_ALL,
224
225 __DCB_TC_ATTR_PARAM_ENUM_MAX,
226 DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
227};
228
46132188
AD
229/**
230 * enum dcbnl_cap_attrs - DCB Capability attributes
231 *
232 * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
233 * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
234 * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
235 * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
236 * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
237 * traffic class mapping
238 * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
239 * number of traffic classes the device
240 * can be configured to use for Priority Groups
241 * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
242 * number of traffic classes the device can be
243 * configured to use for Priority Flow Control
244 * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
245 * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
246 * Notification
247 */
248enum dcbnl_cap_attrs {
249 DCB_CAP_ATTR_UNDEFINED,
250 DCB_CAP_ATTR_ALL,
251 DCB_CAP_ATTR_PG,
252 DCB_CAP_ATTR_PFC,
253 DCB_CAP_ATTR_UP2TC,
254 DCB_CAP_ATTR_PG_TCS,
255 DCB_CAP_ATTR_PFC_TCS,
256 DCB_CAP_ATTR_GSP,
257 DCB_CAP_ATTR_BCN,
258
259 __DCB_CAP_ATTR_ENUM_MAX,
260 DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
261};
33dbabc4
AD
262
263/**
264 * enum dcbnl_numtcs_attrs - number of traffic classes
265 *
266 * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
267 * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
268 * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
269 * priority groups
270 * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
271 * support priority flow control
272 */
273enum dcbnl_numtcs_attrs {
274 DCB_NUMTCS_ATTR_UNDEFINED,
275 DCB_NUMTCS_ATTR_ALL,
276 DCB_NUMTCS_ATTR_PG,
277 DCB_NUMTCS_ATTR_PFC,
278
279 __DCB_NUMTCS_ATTR_ENUM_MAX,
280 DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
281};
282
2f90b865
AD
283/**
284 * enum dcb_general_attr_values - general DCB attribute values
285 *
286 * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
287 *
288 */
289enum dcb_general_attr_values {
290 DCB_ATTR_VALUE_UNDEFINED = 0xff
291};
292
293
294#endif /* __LINUX_DCBNL_H__ */
This page took 0.038886 seconds and 5 git commands to generate.