blob: 3a882b4f172e3fcd50b8d619e71f480077aa750c [file] [log] [blame]
Steven9cd2d7a2017-12-20 12:43:01 -08001/*
2 * Copyright (c) 2017 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/** \file
17
18 This file defines vpe control-plane API messages for
19 the bonding device driver
20*/
21
Steven Luong4c4223e2020-07-15 08:44:54 -070022option version = "2.1.0";
Jakub Grajciar3d1ef872019-08-26 12:55:15 +020023
24import "vnet/interface_types.api";
25import "vnet/ethernet/ethernet_types.api";
26
27enum bond_mode
28{
29 BOND_API_MODE_ROUND_ROBIN = 1,
30 BOND_API_MODE_ACTIVE_BACKUP = 2,
31 BOND_API_MODE_XOR = 3,
32 BOND_API_MODE_BROADCAST = 4,
33 BOND_API_MODE_LACP = 5,
34};
35
36enum bond_lb_algo
37{
38 BOND_API_LB_ALGO_L2 = 0,
39 BOND_API_LB_ALGO_L34 = 1,
40 BOND_API_LB_ALGO_L23 = 2,
41 BOND_API_LB_ALGO_RR = 3,
42 BOND_API_LB_ALGO_BC = 4,
43 BOND_API_LB_ALGO_AB = 5,
44};
Steven9cd2d7a2017-12-20 12:43:01 -080045
46/** \brief Initialize a new bond interface with the given paramters
47 @param client_index - opaque cookie to identify the sender
48 @param context - sender context, to match reply w/ request
Alexander Chernavinad9d5282018-12-13 09:08:09 -050049 @param id - if non-~0, specifies a custom interface ID
Steven9cd2d7a2017-12-20 12:43:01 -080050 @param use_custom_mac - if set, mac_address is valid
51 @param mac_address - mac addr to assign to the interface if use_custom_mac is set
Paul Vinciguerrac0e94412020-04-28 01:12:04 -040052 @param mode - mode, required (1=round-robin, 2=active-backup, 3=xor, 4=broadcast, 5=lacp)
Steven9cd2d7a2017-12-20 12:43:01 -080053 @param lb - load balance, optional (0=l2, 1=l34, 2=l23) valid for xor and lacp modes. Otherwise ignored
Zhiyong Yang751e3f32019-06-26 05:49:14 -040054 @param numa_only - if numa_only is set, pkts will be transmitted by LAG members on local numa node only if have at least one, otherwise it works as usual.
Steven9cd2d7a2017-12-20 12:43:01 -080055*/
56define bond_create
57{
Steven Luongea717862020-07-30 07:31:40 -070058 option deprecated;
Steven9cd2d7a2017-12-20 12:43:01 -080059 u32 client_index;
60 u32 context;
Paul Vinciguerrac0e94412020-04-28 01:12:04 -040061 u32 id [default=0xFFFFFFFF];
Jakub Grajciar3d1ef872019-08-26 12:55:15 +020062 bool use_custom_mac;
63 vl_api_mac_address_t mac_address;
64 vl_api_bond_mode_t mode;
65 vl_api_bond_lb_algo_t lb;
66 bool numa_only;
Steven9cd2d7a2017-12-20 12:43:01 -080067};
68
69/** \brief Reply for bond create reply
70 @param context - returned sender context, to match reply w/ request
71 @param retval - return code
72 @param sw_if_index - software index allocated for the new tap interface
73*/
74define bond_create_reply
75{
76 u32 context;
77 i32 retval;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +020078 vl_api_interface_index_t sw_if_index;
Steven9cd2d7a2017-12-20 12:43:01 -080079};
80
Steven Luongea717862020-07-30 07:31:40 -070081/** \brief Initialize a new bond interface with the given paramters
82 @param client_index - opaque cookie to identify the sender
83 @param context - sender context, to match reply w/ request
84 @param mode - mode, required (1=round-robin, 2=active-backup, 3=xor, 4=broadcast, 5=lacp)
85 @param lb - load balance, optional (0=l2, 1=l34, 2=l23) valid for xor and lacp modes. Otherwise ignored (default=l2)
86 @param numa_only - if numa_only is set, pkts will be transmitted by LAG members on local numa node only if have at least one, otherwise it works as usual.
87 @param enable_gso - enable gso support (default 0)
88 @param use_custom_mac - if set, mac_address is valid
89 @param mac_address - mac addr to assign to the interface if use_custom_mac is set
90 @param id - if non-~0, specifies a custom interface ID (default=0xFFFFFFFF)
91*/
92define bond_create2
93{
94 u32 client_index;
95 u32 context;
96 vl_api_bond_mode_t mode;
97 vl_api_bond_lb_algo_t lb;
98 bool numa_only;
99 bool enable_gso;
100 bool use_custom_mac;
101 vl_api_mac_address_t mac_address;
102 u32 id [default=0xFFFFFFFF];
103};
104
105/** \brief Reply for bond create2 reply
106 @param context - returned sender context, to match reply w/ request
107 @param retval - return code
108 @param sw_if_index - software index allocated for the new tap interface
109*/
110define bond_create2_reply
111{
112 u32 context;
113 i32 retval;
114 vl_api_interface_index_t sw_if_index;
115};
116
Steven9cd2d7a2017-12-20 12:43:01 -0800117/** \brief Delete bond interface
118 @param client_index - opaque cookie to identify the sender
119 @param context - sender context, to match reply w/ request
Steven Luong4c4223e2020-07-15 08:44:54 -0700120 @param sw_if_index - interface index of member interface
Steven9cd2d7a2017-12-20 12:43:01 -0800121*/
122autoreply define bond_delete
123{
124 u32 client_index;
125 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200126 vl_api_interface_index_t sw_if_index;
Steven9cd2d7a2017-12-20 12:43:01 -0800127};
128
129/** \brief Initialize a new bond interface with the given paramters
130 @param client_index - opaque cookie to identify the sender
131 @param context - sender context, to match reply w/ request
132 @param sw_if_index - slave sw_if_index
133 @param bond_sw_if_index - bond sw_if_index
134 @param is_passive - interface does not initiate the lacp protocol, remote must be active speaker
135 @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout
136*/
137define bond_enslave
138{
Steven Luongea717862020-07-30 07:31:40 -0700139 option deprecated;
Steven9cd2d7a2017-12-20 12:43:01 -0800140 u32 client_index;
141 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200142 vl_api_interface_index_t sw_if_index;
143 vl_api_interface_index_t bond_sw_if_index;
144 bool is_passive;
145 bool is_long_timeout;
Steven9cd2d7a2017-12-20 12:43:01 -0800146};
147
148/** \brief Reply for bond enslave reply
149 @param context - returned sender context, to match reply w/ request
150 @param retval - return code
151*/
152define bond_enslave_reply
153{
154 u32 context;
155 i32 retval;
156};
157
Steven Luong4c4223e2020-07-15 08:44:54 -0700158/** \brief Initialize a new bond interface with the given paramters
159 @param client_index - opaque cookie to identify the sender
160 @param context - sender context, to match reply w/ request
161 @param sw_if_index - member sw_if_index
162 @param bond_sw_if_index - bond sw_if_index
163 @param is_passive - interface does not initiate the lacp protocol, remote must be active speaker
164 @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout
165*/
166define bond_add_member
167{
168 u32 client_index;
169 u32 context;
170 vl_api_interface_index_t sw_if_index;
171 vl_api_interface_index_t bond_sw_if_index;
172 bool is_passive;
173 bool is_long_timeout;
174};
175
176/** \brief Reply for bond add_member reply
177 @param context - returned sender context, to match reply w/ request
178 @param retval - return code
179*/
180define bond_add_member_reply
181{
182 u32 context;
183 i32 retval;
184};
185
Steven9cd2d7a2017-12-20 12:43:01 -0800186/** \brief bond detach slave
187 @param client_index - opaque cookie to identify the sender
188 @param context - sender context, to match reply w/ request
Steven Luong4c4223e2020-07-15 08:44:54 -0700189 @param sw_if_index - interface index of member interface
Steven9cd2d7a2017-12-20 12:43:01 -0800190*/
191autoreply define bond_detach_slave
192{
Steven Luongea717862020-07-30 07:31:40 -0700193 option deprecated;
Steven Luong4c4223e2020-07-15 08:44:54 -0700194 u32 client_index;
195 u32 context;
196 vl_api_interface_index_t sw_if_index;
197};
198
199/** \brief bond detach member
200 @param client_index - opaque cookie to identify the sender
201 @param context - sender context, to match reply w/ request
202 @param sw_if_index - interface index of member interface
203*/
204autoreply define bond_detach_member
205{
Steven9cd2d7a2017-12-20 12:43:01 -0800206 u32 client_index;
207 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200208 vl_api_interface_index_t sw_if_index;
Steven9cd2d7a2017-12-20 12:43:01 -0800209};
210
211/** \brief Dump bond interfaces request */
212define sw_interface_bond_dump
213{
Steven Luongea717862020-07-30 07:31:40 -0700214 option deprecated;
Steven9cd2d7a2017-12-20 12:43:01 -0800215 u32 client_index;
216 u32 context;
217};
218
219/** \brief Reply for bond dump request
220 @param sw_if_index - software index of bond interface
Alexander Chernavinad9d5282018-12-13 09:08:09 -0500221 @param id - ID of interface
Steven Luong4c4223e2020-07-15 08:44:54 -0700222 @param interface_name - name of interface
Steven9cd2d7a2017-12-20 12:43:01 -0800223 @param mode - bonding mode
224 @param lb - load balance algo
Zhiyong Yang751e3f32019-06-26 05:49:14 -0400225 @param numa_only - enable local numa TX for lacp mode
Steven Luong4c4223e2020-07-15 08:44:54 -0700226 @param active_slaves - active member count
227 @param slaves - config member count
Steven9cd2d7a2017-12-20 12:43:01 -0800228*/
229define sw_interface_bond_details
230{
231 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200232 vl_api_interface_index_t sw_if_index;
Alexander Chernavinad9d5282018-12-13 09:08:09 -0500233 u32 id;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200234 vl_api_bond_mode_t mode;
235 vl_api_bond_lb_algo_t lb;
236 bool numa_only;
Steven9cd2d7a2017-12-20 12:43:01 -0800237 u32 active_slaves;
238 u32 slaves;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200239 string interface_name[64];
Steven9cd2d7a2017-12-20 12:43:01 -0800240};
241
Steven Luong4c4223e2020-07-15 08:44:54 -0700242/** \brief Dump bond interfaces request */
243define sw_bond_interface_dump
244{
245 u32 client_index;
246 u32 context;
247 vl_api_interface_index_t sw_if_index [default=0xffffffff];
248};
249
250/** \brief Reply for bond dump request
251 @param sw_if_index - software index of bond interface
252 @param id - ID of interface
253 @param mode - bonding mode
254 @param lb - load balance algo
255 @param numa_only - enable local numa TX for lacp mode
256 @param active_members - active members count
257 @param members - config member count
258 @param interface_name - name of interface
259*/
260define sw_bond_interface_details
261{
262 u32 context;
263 vl_api_interface_index_t sw_if_index;
264 u32 id;
265 vl_api_bond_mode_t mode;
266 vl_api_bond_lb_algo_t lb;
267 bool numa_only;
268 u32 active_members;
269 u32 members;
270 string interface_name[64];
271};
272
Steven9cd2d7a2017-12-20 12:43:01 -0800273/** \brief bond slave dump
274 @param client_index - opaque cookie to identify the sender
275 @param context - sender context, to match reply w/ request
276 @param sw_if_index - interface index of bond interface
277*/
278define sw_interface_slave_dump
279{
Steven Luongea717862020-07-30 07:31:40 -0700280 option deprecated;
Steven9cd2d7a2017-12-20 12:43:01 -0800281 u32 client_index;
282 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200283 vl_api_interface_index_t sw_if_index;
Steven9cd2d7a2017-12-20 12:43:01 -0800284};
285
286/** \brief Reply for slave dump request
287 @param sw_if_index - software index of slave interface
288 @param interface_name - name of interface
289 @param is_passve - interface does not initiate the lacp protocol, remote must be active speaker
290 @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout
Steven Luonga1876b82019-08-20 16:58:00 -0700291 @param is_local_numa - the slave interface is local numa
292 @param weight - the weight for the slave interface (active-backup mode only)
Steven9cd2d7a2017-12-20 12:43:01 -0800293*/
294define sw_interface_slave_details
295{
296 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200297 vl_api_interface_index_t sw_if_index;
298 string interface_name[64];
299 bool is_passive;
300 bool is_long_timeout;
301 bool is_local_numa;
Steven Luonga1876b82019-08-20 16:58:00 -0700302 u32 weight;
303};
304
Steven Luong4c4223e2020-07-15 08:44:54 -0700305/** \brief bond member dump
306 @param client_index - opaque cookie to identify the sender
307 @param context - sender context, to match reply w/ request
308 @param sw_if_index - interface index of bond interface
309*/
310define sw_member_interface_dump
311{
312 u32 client_index;
313 u32 context;
314 vl_api_interface_index_t sw_if_index;
315};
316
317/** \brief Reply for member dump request
318 @param sw_if_index - software index of member interface
319 @param interface_name - name of interface
320 @param is_passve - interface does not initiate the lacp protocol, remote must be active speaker
321 @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout
322 @param is_local_numa - the member interface is local numa
323 @param weight - the weight for the member interface (active-backup mode only)
324*/
325define sw_member_interface_details
326{
327 u32 context;
328 vl_api_interface_index_t sw_if_index;
329 string interface_name[64];
330 bool is_passive;
331 bool is_long_timeout;
332 bool is_local_numa;
333 u32 weight;
334};
335
Steven Luonga1876b82019-08-20 16:58:00 -0700336/** \brief Interface set bond weight
337 @param client_index - opaque cookie to identify the sender
338 @param context - sender context, to match reply w/ request
Steven Luong4c4223e2020-07-15 08:44:54 -0700339 @param sw_if_index - member interface for which to set the weight
340 @param weight - weight value to be set for the member interface
Steven Luonga1876b82019-08-20 16:58:00 -0700341*/
342autoreply define sw_interface_set_bond_weight
343{
344 u32 client_index;
345 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200346 vl_api_interface_index_t sw_if_index;
Steven Luonga1876b82019-08-20 16:58:00 -0700347 u32 weight;
Steven9cd2d7a2017-12-20 12:43:01 -0800348};
349
350/*
351 * Local Variables:
352 * eval: (c-set-style "gnu")
353 * End:
354 */