FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
bond.api
Go to the documentation of this file.
1 /*
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 
22 option version = "2.1.0";
23 
24 import "vnet/interface_types.api";
25 import "vnet/ethernet/ethernet_types.api";
26 
28 {
34 };
35 
37 {
44 };
45 
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.
55 */
56 define bond_create
57 {
58  option deprecated;
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;
66  bool numa_only;
67 };
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 */
74 define bond_create_reply
75 {
78  vl_api_interface_index_t sw_if_index;
79 };
80 
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)
91 */
92 define bond_create2
93 {
96  vl_api_bond_mode_t mode;
97  vl_api_bond_lb_algo_t lb;
98  bool numa_only;
99  bool enable_gso;
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 */
110 define bond_create2_reply
111 {
114  vl_api_interface_index_t sw_if_index;
115 };
116 
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
121 */
122 autoreply define bond_delete
123 {
126  vl_api_interface_index_t sw_if_index;
127 };
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 */
137 define bond_enslave
138 {
139  option deprecated;
142  vl_api_interface_index_t sw_if_index;
143  vl_api_interface_index_t bond_sw_if_index;
146 };
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 */
152 define bond_enslave_reply
153 {
156 };
157 
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
165 */
167 {
170  vl_api_interface_index_t sw_if_index;
171  vl_api_interface_index_t bond_sw_if_index;
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 */
180 define bond_add_member_reply
181 {
184 };
185 
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
190 */
191 autoreply define bond_detach_slave
192 {
193  option deprecated;
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 */
204 autoreply define bond_detach_member
205 {
208  vl_api_interface_index_t sw_if_index;
209 };
210 
211 /** \brief Dump bond interfaces request */
212 define sw_interface_bond_dump
213 {
214  option deprecated;
217 };
218 
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
228 */
229 define sw_interface_bond_details
230 {
232  vl_api_interface_index_t sw_if_index;
234  vl_api_bond_mode_t mode;
235  vl_api_bond_lb_algo_t lb;
236  bool numa_only;
239  string interface_name[64];
240 };
241 
242 /** \brief Dump bond interfaces request */
243 define sw_bond_interface_dump
244 {
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 */
260 define sw_bond_interface_details
261 {
263  vl_api_interface_index_t sw_if_index;
265  vl_api_bond_mode_t mode;
266  vl_api_bond_lb_algo_t lb;
267  bool numa_only;
270  string interface_name[64];
271 };
272 
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
277 */
278 define sw_interface_slave_dump
279 {
280  option deprecated;
283  vl_api_interface_index_t sw_if_index;
284 };
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
291  @param is_local_numa - the slave interface is local numa
292  @param weight - the weight for the slave interface (active-backup mode only)
293 */
294 define sw_interface_slave_details
295 {
297  vl_api_interface_index_t sw_if_index;
298  string interface_name[64];
303 };
304 
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
309 */
310 define sw_member_interface_dump
311 {
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 */
325 define sw_member_interface_details
326 {
328  vl_api_interface_index_t sw_if_index;
329  string interface_name[64];
334 };
335 
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
341 */
342 autoreply define sw_interface_set_bond_weight
343 {
346  vl_api_interface_index_t sw_if_index;
348 };
349 
350 /*
351  * Local Variables:
352  * eval: (c-set-style "gnu")
353  * End:
354  */
vl_api_bond_create_t::numa_only
bool numa_only
Definition: bond.api:66
vl_api_bond_add_member_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:170
vl_api_bond_create2_reply_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:114
vl_api_sw_interface_slave_details_t
Reply for slave dump request.
Definition: bond.api:294
vl_api_bond_enslave_reply_t::retval
i32 retval
Definition: bond.api:155
vl_api_sw_interface_bond_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:232
vl_api_bond_create_t::mode
vl_api_bond_mode_t mode
Definition: bond.api:64
vl_api_sw_member_interface_details_t::weight
u32 weight
Definition: bond.api:333
vl_api_bond_detach_slave_t
bond detach slave
Definition: bond.api:191
vl_api_sw_interface_bond_details_t::interface_name
string interface_name[64]
Definition: bond.api:239
vl_api_sw_interface_set_bond_weight_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:346
vl_api_bond_delete_t::client_index
u32 client_index
Definition: bond.api:124
vl_api_bond_create2_reply_t::retval
i32 retval
Definition: bond.api:113
vl_api_bond_detach_slave_t::context
u32 context
Definition: bond.api:195
vl_api_sw_interface_bond_details_t::active_slaves
u32 active_slaves
Definition: bond.api:237
vl_api_sw_bond_interface_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index[default=0xffffffff]
Definition: bond.api:247
vl_api_bond_create2_t::enable_gso
bool enable_gso
Definition: bond.api:99
vl_api_bond_enslave_t
Initialize a new bond interface with the given paramters.
Definition: bond.api:137
vl_api_bond_create_t::mac_address
vl_api_mac_address_t mac_address
Definition: bond.api:63
vl_api_sw_interface_slave_dump_t::deprecated
option deprecated
Definition: bond.api:280
vl_api_sw_member_interface_details_t::context
u32 context
Definition: bond.api:327
vl_api_bond_delete_t
Delete bond interface.
Definition: bond.api:122
vl_api_sw_interface_slave_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:297
vl_api_sw_bond_interface_details_t::interface_name
string interface_name[64]
Definition: bond.api:270
BOND_API_MODE_LACP
@ BOND_API_MODE_LACP
Definition: bond.api:33
vl_api_bond_enslave_t::context
u32 context
Definition: bond.api:141
BOND_API_LB_ALGO_L2
@ BOND_API_LB_ALGO_L2
Definition: bond.api:38
BOND_API_MODE_ROUND_ROBIN
@ BOND_API_MODE_ROUND_ROBIN
Definition: bond.api:29
vl_api_sw_bond_interface_dump_t::context
u32 context
Definition: bond.api:246
vl_api_bond_create2_t
Initialize a new bond interface with the given paramters.
Definition: bond.api:92
vl_api_sw_bond_interface_dump_t::client_index
u32 client_index
Definition: bond.api:245
vl_api_sw_member_interface_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:314
vl_api_bond_delete_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:126
vl_api_bond_create2_t::client_index
u32 client_index
Definition: bond.api:94
vl_api_sw_interface_bond_details_t::lb
vl_api_bond_lb_algo_t lb
Definition: bond.api:235
vl_api_bond_enslave_t::is_passive
bool is_passive
Definition: bond.api:144
vl_api_sw_interface_slave_dump_t::client_index
u32 client_index
Definition: bond.api:281
vl_api_bond_detach_slave_t::client_index
u32 client_index
Definition: bond.api:194
vl_api_sw_interface_slave_details_t::weight
u32 weight
Definition: bond.api:302
vl_api_sw_member_interface_dump_t::client_index
u32 client_index
Definition: bond.api:312
vl_api_sw_interface_slave_details_t::is_local_numa
bool is_local_numa
Definition: bond.api:301
vl_api_sw_interface_bond_details_t::context
u32 context
Definition: bond.api:231
vl_api_sw_interface_slave_details_t::interface_name
string interface_name[64]
Definition: bond.api:298
vl_api_sw_bond_interface_details_t::mode
vl_api_bond_mode_t mode
Definition: bond.api:265
BOND_API_LB_ALGO_BC
@ BOND_API_LB_ALGO_BC
Definition: bond.api:42
vl_api_bond_create_reply_t
Reply for bond create reply.
Definition: bond.api:74
i32
signed int i32
Definition: types.h:77
vl_api_sw_bond_interface_details_t::members
u32 members
Definition: bond.api:269
vl_api_sw_interface_bond_dump_t::context
u32 context
Definition: bond.api:216
bond_lb_algo
bond_lb_algo
Definition: bond.api:36
vl_api_bond_create_reply_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:78
vl_api_bond_add_member_t::context
u32 context
Definition: bond.api:169
vl_api_bond_create_t::use_custom_mac
bool use_custom_mac
Definition: bond.api:62
vl_api_sw_bond_interface_dump_t
Dump bond interfaces request.
Definition: bond.api:243
vl_api_sw_interface_set_bond_weight_t::client_index
u32 client_index
Definition: bond.api:344
BOND_API_LB_ALGO_AB
@ BOND_API_LB_ALGO_AB
Definition: bond.api:43
vl_api_bond_create2_t::mode
vl_api_bond_mode_t mode
Definition: bond.api:96
vl_api_sw_member_interface_dump_t
bond member dump
Definition: bond.api:310
vl_api_sw_member_interface_details_t::is_local_numa
bool is_local_numa
Definition: bond.api:332
vl_api_bond_detach_member_t::client_index
u32 client_index
Definition: bond.api:206
BOND_API_MODE_XOR
@ BOND_API_MODE_XOR
Definition: bond.api:31
vl_api_bond_create2_t::numa_only
bool numa_only
Definition: bond.api:98
vl_api_sw_interface_bond_dump_t::client_index
u32 client_index
Definition: bond.api:215
vl_api_sw_interface_bond_details_t::id
u32 id
Definition: bond.api:233
vl_api_sw_interface_set_bond_weight_t::weight
u32 weight
Definition: bond.api:347
bond_detach_member
void bond_detach_member(vlib_main_t *vm, bond_detach_member_args_t *args)
Definition: cli.c:830
vl_api_sw_bond_interface_details_t::numa_only
bool numa_only
Definition: bond.api:267
BOND_API_LB_ALGO_L34
@ BOND_API_LB_ALGO_L34
Definition: bond.api:39
vl_api_bond_create_t::context
u32 context
Definition: bond.api:60
vl_api_bond_create2_t::use_custom_mac
bool use_custom_mac
Definition: bond.api:100
vl_api_bond_enslave_reply_t::context
u32 context
Definition: bond.api:154
vl_api_sw_interface_slave_details_t::context
u32 context
Definition: bond.api:296
vl_api_sw_interface_slave_details_t::is_long_timeout
bool is_long_timeout
Definition: bond.api:300
vl_api_sw_bond_interface_details_t::id
u32 id
Definition: bond.api:264
bond_mode
bond_mode
Definition: bond.api:27
vl_api_sw_interface_bond_dump_t::deprecated
option deprecated
Definition: bond.api:214
version
option version
Definition: bond.api:22
vl_api_bond_detach_slave_t::deprecated
option deprecated
Definition: bond.api:193
vl_api_sw_interface_bond_dump_t
Dump bond interfaces request.
Definition: bond.api:212
vl_api_sw_bond_interface_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:263
vl_api_bond_add_member_t::bond_sw_if_index
vl_api_interface_index_t bond_sw_if_index
Definition: bond.api:171
vl_api_bond_create2_reply_t::context
u32 context
Definition: bond.api:112
vl_api_bond_detach_member_t
bond detach member
Definition: bond.api:204
vl_api_bond_detach_member_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:208
vl_api_bond_enslave_t::bond_sw_if_index
vl_api_interface_index_t bond_sw_if_index
Definition: bond.api:143
vl_api_bond_delete_t::context
u32 context
Definition: bond.api:125
vl_api_bond_create2_t::mac_address
vl_api_mac_address_t mac_address
Definition: bond.api:101
vl_api_bond_create_reply_t::retval
i32 retval
Definition: bond.api:77
vl_api_bond_add_member_reply_t::retval
i32 retval
Definition: bond.api:183
vl_api_sw_interface_slave_details_t::is_passive
bool is_passive
Definition: bond.api:299
vl_api_bond_detach_member_t::context
u32 context
Definition: bond.api:207
BOND_API_LB_ALGO_L23
@ BOND_API_LB_ALGO_L23
Definition: bond.api:40
vl_api_bond_add_member_t::is_passive
bool is_passive
Definition: bond.api:172
vl_api_sw_bond_interface_details_t
Reply for bond dump request.
Definition: bond.api:260
vl_api_bond_create2_reply_t
Reply for bond create2 reply.
Definition: bond.api:110
vl_api_sw_member_interface_details_t::interface_name
string interface_name[64]
Definition: bond.api:329
u32
unsigned int u32
Definition: types.h:88
vl_api_sw_interface_bond_details_t::numa_only
bool numa_only
Definition: bond.api:236
vl_api_bond_create_t::lb
vl_api_bond_lb_algo_t lb
Definition: bond.api:65
vl_api_sw_interface_slave_dump_t::context
u32 context
Definition: bond.api:282
BOND_API_MODE_ACTIVE_BACKUP
@ BOND_API_MODE_ACTIVE_BACKUP
Definition: bond.api:30
vl_api_sw_member_interface_details_t
Reply for member dump request.
Definition: bond.api:325
vl_api_bond_add_member_reply_t::context
u32 context
Definition: bond.api:182
vl_api_sw_interface_bond_details_t::mode
vl_api_bond_mode_t mode
Definition: bond.api:234
vl_api_sw_interface_slave_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:283
vl_api_bond_create2_t::context
u32 context
Definition: bond.api:95
vl_api_sw_interface_set_bond_weight_t::context
u32 context
Definition: bond.api:345
vl_api_bond_create2_t::lb
vl_api_bond_lb_algo_t lb
Definition: bond.api:97
vl_api_sw_bond_interface_details_t::active_members
u32 active_members
Definition: bond.api:268
vl_api_sw_bond_interface_details_t::lb
vl_api_bond_lb_algo_t lb
Definition: bond.api:266
vl_api_bond_create_t
Initialize a new bond interface with the given paramters.
Definition: bond.api:56
vl_api_bond_create_t::client_index
u32 client_index
Definition: bond.api:59
vl_api_sw_interface_slave_dump_t
bond slave dump
Definition: bond.api:278
vl_api_sw_member_interface_details_t::is_long_timeout
bool is_long_timeout
Definition: bond.api:331
vl_api_sw_interface_set_bond_weight_t
Interface set bond weight.
Definition: bond.api:342
vl_api_sw_member_interface_dump_t::context
u32 context
Definition: bond.api:313
vl_api_sw_member_interface_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:328
vl_api_bond_enslave_t::is_long_timeout
bool is_long_timeout
Definition: bond.api:145
vl_api_bond_enslave_t::deprecated
option deprecated
Definition: bond.api:139
vl_api_sw_member_interface_details_t::is_passive
bool is_passive
Definition: bond.api:330
vl_api_bond_add_member_reply_t
Reply for bond add_member reply.
Definition: bond.api:180
bond_add_member
void bond_add_member(vlib_main_t *vm, bond_add_member_args_t *args)
Definition: cli.c:600
vl_api_bond_add_member_t
Initialize a new bond interface with the given paramters.
Definition: bond.api:166
vl_api_bond_enslave_t::client_index
u32 client_index
Definition: bond.api:140
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
vl_api_bond_detach_slave_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:196
vl_api_sw_interface_bond_details_t::slaves
u32 slaves
Definition: bond.api:238
vl_api_bond_add_member_t::client_index
u32 client_index
Definition: bond.api:168
BOND_API_MODE_BROADCAST
@ BOND_API_MODE_BROADCAST
Definition: bond.api:32
vl_api_sw_interface_bond_details_t
Reply for bond dump request.
Definition: bond.api:229
vl_api_bond_create_reply_t::context
u32 context
Definition: bond.api:76
vl_api_bond_enslave_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: bond.api:142
vl_api_bond_create_t::deprecated
option deprecated
Definition: bond.api:58
vl_api_bond_add_member_t::is_long_timeout
bool is_long_timeout
Definition: bond.api:173
BOND_API_LB_ALGO_RR
@ BOND_API_LB_ALGO_RR
Definition: bond.api:41
vl_api_bond_enslave_reply_t
Reply for bond enslave reply.
Definition: bond.api:152
vl_api_sw_bond_interface_details_t::context
u32 context
Definition: bond.api:262