blob: 34fa0204a39a62ce07d585712fd2859dcd86e647 [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
Jakub Grajciar3d1ef872019-08-26 12:55:15 +020022option version = "2.0.0";
23
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
52 @param mode - mode, required (1=round-robin, 2=active-backup, 3=xor, 4=broadcastcast, 5=lacp)
53 @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{
58 u32 client_index;
59 u32 context;
Alexander Chernavinad9d5282018-12-13 09:08:09 -050060 u32 id;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +020061 bool use_custom_mac;
62 vl_api_mac_address_t mac_address;
63 vl_api_bond_mode_t mode;
64 vl_api_bond_lb_algo_t lb;
65 bool numa_only;
Steven9cd2d7a2017-12-20 12:43:01 -080066};
67
68/** \brief Reply for bond create reply
69 @param context - returned sender context, to match reply w/ request
70 @param retval - return code
71 @param sw_if_index - software index allocated for the new tap interface
72*/
73define bond_create_reply
74{
75 u32 context;
76 i32 retval;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +020077 vl_api_interface_index_t sw_if_index;
Steven9cd2d7a2017-12-20 12:43:01 -080078};
79
80/** \brief Delete bond interface
81 @param client_index - opaque cookie to identify the sender
82 @param context - sender context, to match reply w/ request
83 @param sw_if_index - interface index of slave interface
84*/
85autoreply define bond_delete
86{
87 u32 client_index;
88 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +020089 vl_api_interface_index_t sw_if_index;
Steven9cd2d7a2017-12-20 12:43:01 -080090};
91
92/** \brief Initialize a new bond interface with the given paramters
93 @param client_index - opaque cookie to identify the sender
94 @param context - sender context, to match reply w/ request
95 @param sw_if_index - slave sw_if_index
96 @param bond_sw_if_index - bond sw_if_index
97 @param is_passive - interface does not initiate the lacp protocol, remote must be active speaker
98 @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout
99*/
100define bond_enslave
101{
102 u32 client_index;
103 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200104 vl_api_interface_index_t sw_if_index;
105 vl_api_interface_index_t bond_sw_if_index;
106 bool is_passive;
107 bool is_long_timeout;
Steven9cd2d7a2017-12-20 12:43:01 -0800108};
109
110/** \brief Reply for bond enslave reply
111 @param context - returned sender context, to match reply w/ request
112 @param retval - return code
113*/
114define bond_enslave_reply
115{
116 u32 context;
117 i32 retval;
118};
119
120/** \brief bond detach slave
121 @param client_index - opaque cookie to identify the sender
122 @param context - sender context, to match reply w/ request
123 @param sw_if_index - interface index of slave interface
124*/
125autoreply define bond_detach_slave
126{
127 u32 client_index;
128 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200129 vl_api_interface_index_t sw_if_index;
Steven9cd2d7a2017-12-20 12:43:01 -0800130};
131
132/** \brief Dump bond interfaces request */
133define sw_interface_bond_dump
134{
135 u32 client_index;
136 u32 context;
137};
138
139/** \brief Reply for bond dump request
140 @param sw_if_index - software index of bond interface
Alexander Chernavinad9d5282018-12-13 09:08:09 -0500141 @param id - ID of interface
Steven9cd2d7a2017-12-20 12:43:01 -0800142 @param mode - bonding mode
143 @param lb - load balance algo
Zhiyong Yang751e3f32019-06-26 05:49:14 -0400144 @param numa_only - enable local numa TX for lacp mode
Steven9cd2d7a2017-12-20 12:43:01 -0800145 @param active_slaves - active slaves count
146 @param slaves - config slave count
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200147 @param interface_name - name of interface
Steven9cd2d7a2017-12-20 12:43:01 -0800148*/
149define sw_interface_bond_details
150{
151 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200152 vl_api_interface_index_t sw_if_index;
Alexander Chernavinad9d5282018-12-13 09:08:09 -0500153 u32 id;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200154 vl_api_bond_mode_t mode;
155 vl_api_bond_lb_algo_t lb;
156 bool numa_only;
Steven9cd2d7a2017-12-20 12:43:01 -0800157 u32 active_slaves;
158 u32 slaves;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200159 string interface_name[64];
Steven9cd2d7a2017-12-20 12:43:01 -0800160};
161
162/** \brief bond slave dump
163 @param client_index - opaque cookie to identify the sender
164 @param context - sender context, to match reply w/ request
165 @param sw_if_index - interface index of bond interface
166*/
167define sw_interface_slave_dump
168{
169 u32 client_index;
170 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200171 vl_api_interface_index_t sw_if_index;
Steven9cd2d7a2017-12-20 12:43:01 -0800172};
173
174/** \brief Reply for slave dump request
175 @param sw_if_index - software index of slave interface
176 @param interface_name - name of interface
177 @param is_passve - interface does not initiate the lacp protocol, remote must be active speaker
178 @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout
Steven Luonga1876b82019-08-20 16:58:00 -0700179 @param is_local_numa - the slave interface is local numa
180 @param weight - the weight for the slave interface (active-backup mode only)
Steven9cd2d7a2017-12-20 12:43:01 -0800181*/
182define sw_interface_slave_details
183{
184 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200185 vl_api_interface_index_t sw_if_index;
186 string interface_name[64];
187 bool is_passive;
188 bool is_long_timeout;
189 bool is_local_numa;
Steven Luonga1876b82019-08-20 16:58:00 -0700190 u32 weight;
191};
192
193/** \brief Interface set bond weight
194 @param client_index - opaque cookie to identify the sender
195 @param context - sender context, to match reply w/ request
196 @param sw_if_index - slave interface for which to set the weight
197 @param weight - weight value to be set for the slave interface
198*/
199autoreply define sw_interface_set_bond_weight
200{
201 u32 client_index;
202 u32 context;
Jakub Grajciar3d1ef872019-08-26 12:55:15 +0200203 vl_api_interface_index_t sw_if_index;
Steven Luonga1876b82019-08-20 16:58:00 -0700204 u32 weight;
Steven9cd2d7a2017-12-20 12:43:01 -0800205};
206
207/*
208 * Local Variables:
209 * eval: (c-set-style "gnu")
210 * End:
211 */