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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 This file defines vpe control-plane API messages for
19 the bonding device driver
22 option version = "2.1.0";
24 import "vnet/interface_types.api";
25 import "vnet/ethernet/ethernet_types.api";
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,
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,
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
49 @param id - if non-~0, specifies a custom interface ID
50 @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
52 @param mode - mode, required (1=round-robin, 2=active-backup, 3=xor, 4=broadcast, 5=lacp)
53 @param lb - load balance, optional (0=l2, 1=l34, 2=l23) valid for xor and lacp modes. Otherwise ignored
54 @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.
61 u32 id [default=0xFFFFFFFF];
63 vl_api_mac_address_t mac_address;
64 vl_api_bond_mode_t mode;
65 vl_api_bond_lb_algo_t lb;
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
74 define bond_create_reply
78 vl_api_interface_index_t sw_if_index;
81 /** \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)
96 vl_api_bond_mode_t mode;
97 vl_api_bond_lb_algo_t lb;
101 vl_api_mac_address_t mac_address;
102 u32 id [default=0xFFFFFFFF];
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
110 define bond_create2_reply
114 vl_api_interface_index_t sw_if_index;
117 /** \brief Delete bond interface
118 @param client_index - opaque cookie to identify the sender
119 @param context - sender context, to match reply w/ request
120 @param sw_if_index - interface index of member interface
122 autoreply define bond_delete
126 vl_api_interface_index_t sw_if_index;
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
142 vl_api_interface_index_t sw_if_index;
143 vl_api_interface_index_t bond_sw_if_index;
145 bool is_long_timeout;
148 /** \brief Reply for bond enslave reply
149 @param context - returned sender context, to match reply w/ request
150 @param retval - return code
152 define bond_enslave_reply
158 /** \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
166 define bond_add_member
170 vl_api_interface_index_t sw_if_index;
171 vl_api_interface_index_t bond_sw_if_index;
173 bool is_long_timeout;
176 /** \brief Reply for bond add_member reply
177 @param context - returned sender context, to match reply w/ request
178 @param retval - return code
180 define bond_add_member_reply
186 /** \brief bond detach slave
187 @param client_index - opaque cookie to identify the sender
188 @param context - sender context, to match reply w/ request
189 @param sw_if_index - interface index of member interface
191 autoreply define bond_detach_slave
196 vl_api_interface_index_t sw_if_index;
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
204 autoreply define bond_detach_member
208 vl_api_interface_index_t sw_if_index;
211 /** \brief Dump bond interfaces request */
212 define sw_interface_bond_dump
219 /** \brief Reply for bond dump request
220 @param sw_if_index - software index of bond interface
221 @param id - ID of interface
222 @param interface_name - name of interface
223 @param mode - bonding mode
224 @param lb - load balance algo
225 @param numa_only - enable local numa TX for lacp mode
226 @param active_slaves - active member count
227 @param slaves - config member count
229 define sw_interface_bond_details
232 vl_api_interface_index_t sw_if_index;
234 vl_api_bond_mode_t mode;
235 vl_api_bond_lb_algo_t lb;
239 string interface_name[64];
242 /** \brief Dump bond interfaces request */
243 define sw_bond_interface_dump
247 vl_api_interface_index_t sw_if_index [default=0xffffffff];
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
260 define sw_bond_interface_details
263 vl_api_interface_index_t sw_if_index;
265 vl_api_bond_mode_t mode;
266 vl_api_bond_lb_algo_t lb;
270 string interface_name[64];
273 /** \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
278 define sw_interface_slave_dump
283 vl_api_interface_index_t sw_if_index;
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
291 @param is_local_numa - the slave interface is local numa
292 @param weight - the weight for the slave interface (active-backup mode only)
294 define sw_interface_slave_details
297 vl_api_interface_index_t sw_if_index;
298 string interface_name[64];
300 bool is_long_timeout;
305 /** \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
310 define sw_member_interface_dump
314 vl_api_interface_index_t sw_if_index;
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)
325 define sw_member_interface_details
328 vl_api_interface_index_t sw_if_index;
329 string interface_name[64];
331 bool is_long_timeout;
336 /** \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
339 @param sw_if_index - member interface for which to set the weight
340 @param weight - weight value to be set for the member interface
342 autoreply define sw_interface_set_bond_weight
346 vl_api_interface_index_t sw_if_index;
352 * eval: (c-set-style "gnu")