Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 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 | |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 22 | option version = "2.1.0"; |
Jakub Grajciar | 3d1ef87 | 2019-08-26 12:55:15 +0200 | [diff] [blame] | 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 | }; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 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 |
Alexander Chernavin | ad9d528 | 2018-12-13 09:08:09 -0500 | [diff] [blame] | 49 | @param id - if non-~0, specifies a custom interface ID |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 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 |
Paul Vinciguerra | c0e9441 | 2020-04-28 01:12:04 -0400 | [diff] [blame] | 52 | @param mode - mode, required (1=round-robin, 2=active-backup, 3=xor, 4=broadcast, 5=lacp) |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 53 | @param lb - load balance, optional (0=l2, 1=l34, 2=l23) valid for xor and lacp modes. Otherwise ignored |
Zhiyong Yang | 751e3f3 | 2019-06-26 05:49:14 -0400 | [diff] [blame] | 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. |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 55 | */ |
| 56 | define bond_create |
| 57 | { |
| 58 | u32 client_index; |
| 59 | u32 context; |
Paul Vinciguerra | c0e9441 | 2020-04-28 01:12:04 -0400 | [diff] [blame] | 60 | u32 id [default=0xFFFFFFFF]; |
Jakub Grajciar | 3d1ef87 | 2019-08-26 12:55:15 +0200 | [diff] [blame] | 61 | 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; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 66 | }; |
| 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 | */ |
| 73 | define bond_create_reply |
| 74 | { |
| 75 | u32 context; |
| 76 | i32 retval; |
Jakub Grajciar | 3d1ef87 | 2019-08-26 12:55:15 +0200 | [diff] [blame] | 77 | vl_api_interface_index_t sw_if_index; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 78 | }; |
| 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 |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 83 | @param sw_if_index - interface index of member interface |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 84 | */ |
| 85 | autoreply define bond_delete |
| 86 | { |
| 87 | u32 client_index; |
| 88 | u32 context; |
Jakub Grajciar | 3d1ef87 | 2019-08-26 12:55:15 +0200 | [diff] [blame] | 89 | vl_api_interface_index_t sw_if_index; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 90 | }; |
| 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 | */ |
| 100 | define bond_enslave |
| 101 | { |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 102 | option deprecated="20.06"; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 103 | u32 client_index; |
| 104 | u32 context; |
Jakub Grajciar | 3d1ef87 | 2019-08-26 12:55:15 +0200 | [diff] [blame] | 105 | vl_api_interface_index_t sw_if_index; |
| 106 | vl_api_interface_index_t bond_sw_if_index; |
| 107 | bool is_passive; |
| 108 | bool is_long_timeout; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 109 | }; |
| 110 | |
| 111 | /** \brief Reply for bond enslave reply |
| 112 | @param context - returned sender context, to match reply w/ request |
| 113 | @param retval - return code |
| 114 | */ |
| 115 | define bond_enslave_reply |
| 116 | { |
| 117 | u32 context; |
| 118 | i32 retval; |
| 119 | }; |
| 120 | |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 121 | /** \brief Initialize a new bond interface with the given paramters |
| 122 | @param client_index - opaque cookie to identify the sender |
| 123 | @param context - sender context, to match reply w/ request |
| 124 | @param sw_if_index - member sw_if_index |
| 125 | @param bond_sw_if_index - bond sw_if_index |
| 126 | @param is_passive - interface does not initiate the lacp protocol, remote must be active speaker |
| 127 | @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout |
| 128 | */ |
| 129 | define bond_add_member |
| 130 | { |
| 131 | u32 client_index; |
| 132 | u32 context; |
| 133 | vl_api_interface_index_t sw_if_index; |
| 134 | vl_api_interface_index_t bond_sw_if_index; |
| 135 | bool is_passive; |
| 136 | bool is_long_timeout; |
| 137 | }; |
| 138 | |
| 139 | /** \brief Reply for bond add_member reply |
| 140 | @param context - returned sender context, to match reply w/ request |
| 141 | @param retval - return code |
| 142 | */ |
| 143 | define bond_add_member_reply |
| 144 | { |
| 145 | u32 context; |
| 146 | i32 retval; |
| 147 | }; |
| 148 | |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 149 | /** \brief bond detach slave |
| 150 | @param client_index - opaque cookie to identify the sender |
| 151 | @param context - sender context, to match reply w/ request |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 152 | @param sw_if_index - interface index of member interface |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 153 | */ |
| 154 | autoreply define bond_detach_slave |
| 155 | { |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 156 | option deprecated="20.06"; |
| 157 | u32 client_index; |
| 158 | u32 context; |
| 159 | vl_api_interface_index_t sw_if_index; |
| 160 | }; |
| 161 | |
| 162 | /** \brief bond detach member |
| 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 member interface |
| 166 | */ |
| 167 | autoreply define bond_detach_member |
| 168 | { |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 169 | u32 client_index; |
| 170 | u32 context; |
Jakub Grajciar | 3d1ef87 | 2019-08-26 12:55:15 +0200 | [diff] [blame] | 171 | vl_api_interface_index_t sw_if_index; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 172 | }; |
| 173 | |
| 174 | /** \brief Dump bond interfaces request */ |
| 175 | define sw_interface_bond_dump |
| 176 | { |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 177 | option deprecated="20.06"; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 178 | u32 client_index; |
| 179 | u32 context; |
| 180 | }; |
| 181 | |
| 182 | /** \brief Reply for bond dump request |
| 183 | @param sw_if_index - software index of bond interface |
Alexander Chernavin | ad9d528 | 2018-12-13 09:08:09 -0500 | [diff] [blame] | 184 | @param id - ID of interface |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 185 | @param interface_name - name of interface |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 186 | @param mode - bonding mode |
| 187 | @param lb - load balance algo |
Zhiyong Yang | 751e3f3 | 2019-06-26 05:49:14 -0400 | [diff] [blame] | 188 | @param numa_only - enable local numa TX for lacp mode |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 189 | @param active_slaves - active member count |
| 190 | @param slaves - config member count |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 191 | */ |
| 192 | define sw_interface_bond_details |
| 193 | { |
| 194 | u32 context; |
Jakub Grajciar | 3d1ef87 | 2019-08-26 12:55:15 +0200 | [diff] [blame] | 195 | vl_api_interface_index_t sw_if_index; |
Alexander Chernavin | ad9d528 | 2018-12-13 09:08:09 -0500 | [diff] [blame] | 196 | u32 id; |
Jakub Grajciar | 3d1ef87 | 2019-08-26 12:55:15 +0200 | [diff] [blame] | 197 | vl_api_bond_mode_t mode; |
| 198 | vl_api_bond_lb_algo_t lb; |
| 199 | bool numa_only; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 200 | u32 active_slaves; |
| 201 | u32 slaves; |
Jakub Grajciar | 3d1ef87 | 2019-08-26 12:55:15 +0200 | [diff] [blame] | 202 | string interface_name[64]; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 203 | }; |
| 204 | |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 205 | /** \brief Dump bond interfaces request */ |
| 206 | define sw_bond_interface_dump |
| 207 | { |
| 208 | u32 client_index; |
| 209 | u32 context; |
| 210 | vl_api_interface_index_t sw_if_index [default=0xffffffff]; |
| 211 | }; |
| 212 | |
| 213 | /** \brief Reply for bond dump request |
| 214 | @param sw_if_index - software index of bond interface |
| 215 | @param id - ID of interface |
| 216 | @param mode - bonding mode |
| 217 | @param lb - load balance algo |
| 218 | @param numa_only - enable local numa TX for lacp mode |
| 219 | @param active_members - active members count |
| 220 | @param members - config member count |
| 221 | @param interface_name - name of interface |
| 222 | */ |
| 223 | define sw_bond_interface_details |
| 224 | { |
| 225 | u32 context; |
| 226 | vl_api_interface_index_t sw_if_index; |
| 227 | u32 id; |
| 228 | vl_api_bond_mode_t mode; |
| 229 | vl_api_bond_lb_algo_t lb; |
| 230 | bool numa_only; |
| 231 | u32 active_members; |
| 232 | u32 members; |
| 233 | string interface_name[64]; |
| 234 | }; |
| 235 | |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 236 | /** \brief bond slave dump |
| 237 | @param client_index - opaque cookie to identify the sender |
| 238 | @param context - sender context, to match reply w/ request |
| 239 | @param sw_if_index - interface index of bond interface |
| 240 | */ |
| 241 | define sw_interface_slave_dump |
| 242 | { |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 243 | option deprecated="20.06"; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 244 | u32 client_index; |
| 245 | u32 context; |
Jakub Grajciar | 3d1ef87 | 2019-08-26 12:55:15 +0200 | [diff] [blame] | 246 | vl_api_interface_index_t sw_if_index; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 247 | }; |
| 248 | |
| 249 | /** \brief Reply for slave dump request |
| 250 | @param sw_if_index - software index of slave interface |
| 251 | @param interface_name - name of interface |
| 252 | @param is_passve - interface does not initiate the lacp protocol, remote must be active speaker |
| 253 | @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout |
Steven Luong | a1876b8 | 2019-08-20 16:58:00 -0700 | [diff] [blame] | 254 | @param is_local_numa - the slave interface is local numa |
| 255 | @param weight - the weight for the slave interface (active-backup mode only) |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 256 | */ |
| 257 | define sw_interface_slave_details |
| 258 | { |
| 259 | u32 context; |
Jakub Grajciar | 3d1ef87 | 2019-08-26 12:55:15 +0200 | [diff] [blame] | 260 | vl_api_interface_index_t sw_if_index; |
| 261 | string interface_name[64]; |
| 262 | bool is_passive; |
| 263 | bool is_long_timeout; |
| 264 | bool is_local_numa; |
Steven Luong | a1876b8 | 2019-08-20 16:58:00 -0700 | [diff] [blame] | 265 | u32 weight; |
| 266 | }; |
| 267 | |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 268 | /** \brief bond member dump |
| 269 | @param client_index - opaque cookie to identify the sender |
| 270 | @param context - sender context, to match reply w/ request |
| 271 | @param sw_if_index - interface index of bond interface |
| 272 | */ |
| 273 | define sw_member_interface_dump |
| 274 | { |
| 275 | u32 client_index; |
| 276 | u32 context; |
| 277 | vl_api_interface_index_t sw_if_index; |
| 278 | }; |
| 279 | |
| 280 | /** \brief Reply for member dump request |
| 281 | @param sw_if_index - software index of member interface |
| 282 | @param interface_name - name of interface |
| 283 | @param is_passve - interface does not initiate the lacp protocol, remote must be active speaker |
| 284 | @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout |
| 285 | @param is_local_numa - the member interface is local numa |
| 286 | @param weight - the weight for the member interface (active-backup mode only) |
| 287 | */ |
| 288 | define sw_member_interface_details |
| 289 | { |
| 290 | u32 context; |
| 291 | vl_api_interface_index_t sw_if_index; |
| 292 | string interface_name[64]; |
| 293 | bool is_passive; |
| 294 | bool is_long_timeout; |
| 295 | bool is_local_numa; |
| 296 | u32 weight; |
| 297 | }; |
| 298 | |
Steven Luong | a1876b8 | 2019-08-20 16:58:00 -0700 | [diff] [blame] | 299 | /** \brief Interface set bond weight |
| 300 | @param client_index - opaque cookie to identify the sender |
| 301 | @param context - sender context, to match reply w/ request |
Steven Luong | 4c4223e | 2020-07-15 08:44:54 -0700 | [diff] [blame] | 302 | @param sw_if_index - member interface for which to set the weight |
| 303 | @param weight - weight value to be set for the member interface |
Steven Luong | a1876b8 | 2019-08-20 16:58:00 -0700 | [diff] [blame] | 304 | */ |
| 305 | autoreply define sw_interface_set_bond_weight |
| 306 | { |
| 307 | u32 client_index; |
| 308 | u32 context; |
Jakub Grajciar | 3d1ef87 | 2019-08-26 12:55:15 +0200 | [diff] [blame] | 309 | vl_api_interface_index_t sw_if_index; |
Steven Luong | a1876b8 | 2019-08-20 16:58:00 -0700 | [diff] [blame] | 310 | u32 weight; |
Steven | 9cd2d7a | 2017-12-20 12:43:01 -0800 | [diff] [blame] | 311 | }; |
| 312 | |
| 313 | /* |
| 314 | * Local Variables: |
| 315 | * eval: (c-set-style "gnu") |
| 316 | * End: |
| 317 | */ |