bonding: add bond_create2 API to include gso option
[vpp.git] / src / vnet / bonding / bond.api
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
27 enum 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
36 enum 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 };
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;
59   u32 client_index;
60   u32 context;
61   u32 id [default=0xFFFFFFFF];
62   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;
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 {
76   u32 context;
77   i32 retval;
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 {
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 */
110 define bond_create2_reply
111 {
112   u32 context;
113   i32 retval;
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 {
124   u32 client_index;
125   u32 context;
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;
140   u32 client_index;
141   u32 context;
142   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;
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 {
154   u32 context;
155   i32 retval;
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 */
166 define 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 */
180 define bond_add_member_reply
181 {
182   u32 context;
183   i32 retval;
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;
194   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 */
204 autoreply define bond_detach_member
205 {
206   u32 client_index;
207   u32 context;
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;
215   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
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 {
231   u32 context;
232   vl_api_interface_index_t sw_if_index;
233   u32 id;
234   vl_api_bond_mode_t mode;
235   vl_api_bond_lb_algo_t lb;
236   bool numa_only;
237   u32 active_slaves;
238   u32 slaves;
239   string interface_name[64];
240 };
241
242 /** \brief Dump bond interfaces request */
243 define 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 */
260 define 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
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;
281   u32 client_index;
282   u32 context;
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 {
296   u32 context;
297   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;
302   u32 weight;
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 {
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 */
325 define 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
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 {
344   u32 client_index;
345   u32 context;
346   vl_api_interface_index_t sw_if_index;
347   u32 weight;
348 };
349
350 /*
351  * Local Variables:
352  * eval: (c-set-style "gnu")
353  * End:
354  */