blob: 13f0c638a6959b771d86343144d19c851499d4e1 [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
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.
Alexander Duyck46132182008-11-20 21:05:08 -080046 * @DCB_CMD_GCAP: request the DCB capabilities of the device
Alexander Duyck2f90b862008-11-20 20:52:10 -080047 */
48enum dcbnl_commands {
49 DCB_CMD_UNDEFINED,
50
51 DCB_CMD_GSTATE,
52 DCB_CMD_SSTATE,
53
54 DCB_CMD_PGTX_GCFG,
55 DCB_CMD_PGTX_SCFG,
56 DCB_CMD_PGRX_GCFG,
57 DCB_CMD_PGRX_SCFG,
58
59 DCB_CMD_PFC_GCFG,
60 DCB_CMD_PFC_SCFG,
61
62 DCB_CMD_SET_ALL,
63 DCB_CMD_GPERM_HWADDR,
Alexander Duyck46132182008-11-20 21:05:08 -080064 DCB_CMD_GCAP,
Alexander Duyck2f90b862008-11-20 20:52:10 -080065
66 __DCB_CMD_ENUM_MAX,
67 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
68};
69
70
71/**
72 * enum dcbnl_attrs - DCB top-level netlink attributes
73 *
74 * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
75 * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
76 * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
77 * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
78 * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
79 * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
80 * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
81 * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
82 * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
Alexander Duyck46132182008-11-20 21:05:08 -080083 * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
Alexander Duyck2f90b862008-11-20 20:52:10 -080084 */
85enum dcbnl_attrs {
86 DCB_ATTR_UNDEFINED,
87
88 DCB_ATTR_IFNAME,
89 DCB_ATTR_STATE,
90 DCB_ATTR_PFC_STATE,
91 DCB_ATTR_PFC_CFG,
92 DCB_ATTR_NUM_TC,
93 DCB_ATTR_PG_CFG,
94 DCB_ATTR_SET_ALL,
95 DCB_ATTR_PERM_HWADDR,
Alexander Duyck46132182008-11-20 21:05:08 -080096 DCB_ATTR_CAP,
Alexander Duyck2f90b862008-11-20 20:52:10 -080097
98 __DCB_ATTR_ENUM_MAX,
99 DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
100};
101
102/**
103 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
104 *
105 * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
106 * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
107 * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
108 * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
109 * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
110 * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
111 * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
112 * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
113 * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
114 * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
115 * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
116 *
117 */
118enum dcbnl_pfc_up_attrs {
119 DCB_PFC_UP_ATTR_UNDEFINED,
120
121 DCB_PFC_UP_ATTR_0,
122 DCB_PFC_UP_ATTR_1,
123 DCB_PFC_UP_ATTR_2,
124 DCB_PFC_UP_ATTR_3,
125 DCB_PFC_UP_ATTR_4,
126 DCB_PFC_UP_ATTR_5,
127 DCB_PFC_UP_ATTR_6,
128 DCB_PFC_UP_ATTR_7,
129 DCB_PFC_UP_ATTR_ALL,
130
131 __DCB_PFC_UP_ATTR_ENUM_MAX,
132 DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
133};
134
135/**
136 * enum dcbnl_pg_attrs - DCB Priority Group attributes
137 *
138 * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
139 * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
140 * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
141 * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
142 * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
143 * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
144 * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
145 * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
146 * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
147 * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
148 * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
149 * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
150 * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
151 * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
152 * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
153 * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
154 * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
155 * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
156 * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
157 * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
158 * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
159 *
160 */
161enum dcbnl_pg_attrs {
162 DCB_PG_ATTR_UNDEFINED,
163
164 DCB_PG_ATTR_TC_0,
165 DCB_PG_ATTR_TC_1,
166 DCB_PG_ATTR_TC_2,
167 DCB_PG_ATTR_TC_3,
168 DCB_PG_ATTR_TC_4,
169 DCB_PG_ATTR_TC_5,
170 DCB_PG_ATTR_TC_6,
171 DCB_PG_ATTR_TC_7,
172 DCB_PG_ATTR_TC_MAX,
173 DCB_PG_ATTR_TC_ALL,
174
175 DCB_PG_ATTR_BW_ID_0,
176 DCB_PG_ATTR_BW_ID_1,
177 DCB_PG_ATTR_BW_ID_2,
178 DCB_PG_ATTR_BW_ID_3,
179 DCB_PG_ATTR_BW_ID_4,
180 DCB_PG_ATTR_BW_ID_5,
181 DCB_PG_ATTR_BW_ID_6,
182 DCB_PG_ATTR_BW_ID_7,
183 DCB_PG_ATTR_BW_ID_MAX,
184 DCB_PG_ATTR_BW_ID_ALL,
185
186 __DCB_PG_ATTR_ENUM_MAX,
187 DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
188};
189
190/**
191 * enum dcbnl_tc_attrs - DCB Traffic Class attributes
192 *
193 * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
194 * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
195 * Valid values are: 0-7
196 * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
197 * Some devices may not support changing the
198 * user priority map of a TC.
199 * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
200 * 0 - none
201 * 1 - group strict
202 * 2 - link strict
203 * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
204 * not configured to use link strict priority,
205 * this is the percentage of bandwidth of the
206 * priority group this traffic class belongs to
207 * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
208 *
209 */
210enum dcbnl_tc_attrs {
211 DCB_TC_ATTR_PARAM_UNDEFINED,
212
213 DCB_TC_ATTR_PARAM_PGID,
214 DCB_TC_ATTR_PARAM_UP_MAPPING,
215 DCB_TC_ATTR_PARAM_STRICT_PRIO,
216 DCB_TC_ATTR_PARAM_BW_PCT,
217 DCB_TC_ATTR_PARAM_ALL,
218
219 __DCB_TC_ATTR_PARAM_ENUM_MAX,
220 DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
221};
222
223/**
Alexander Duyck46132182008-11-20 21:05:08 -0800224 * enum dcbnl_cap_attrs - DCB Capability attributes
225 *
226 * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
227 * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
228 * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
229 * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
230 * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
231 * traffic class mapping
232 * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
233 * number of traffic classes the device
234 * can be configured to use for Priority Groups
235 * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
236 * number of traffic classes the device can be
237 * configured to use for Priority Flow Control
238 * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
239 * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
240 * Notification
241 */
242enum dcbnl_cap_attrs {
243 DCB_CAP_ATTR_UNDEFINED,
244 DCB_CAP_ATTR_ALL,
245 DCB_CAP_ATTR_PG,
246 DCB_CAP_ATTR_PFC,
247 DCB_CAP_ATTR_UP2TC,
248 DCB_CAP_ATTR_PG_TCS,
249 DCB_CAP_ATTR_PFC_TCS,
250 DCB_CAP_ATTR_GSP,
251 DCB_CAP_ATTR_BCN,
252
253 __DCB_CAP_ATTR_ENUM_MAX,
254 DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
255};
256/**
Alexander Duyck2f90b862008-11-20 20:52:10 -0800257 * enum dcb_general_attr_values - general DCB attribute values
258 *
259 * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
260 *
261 */
262enum dcb_general_attr_values {
263 DCB_ATTR_VALUE_UNDEFINED = 0xff
264};
265
266
267#endif /* __LINUX_DCBNL_H__ */