summaryrefslogtreecommitdiffstats
path: root/src/vnet/bonding/bond.api
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2017-12-20 12:43:01 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2018-03-21 21:02:15 +0000
commit9cd2d7a5a4fafadb65d772c48109d55d1e19d425 (patch)
tree4a9e0665be0096ee6bfc2235388f90b276b23814 /src/vnet/bonding/bond.api
parent43ebe29b6ea1107c30311cfb3dbd8190282903d0 (diff)
bond: Add bonding driver and LACP protocol
Add bonding driver to support creation of bond interface which composes of multiple slave interfaces. The slave interfaces could be physical interfaces, or just any virtual interfaces. For example, memif interfaces. The syntax to create a bond interface is create bond mode <lacp | xor | acitve-backup | broadcast | round-robin> To enslave an interface to the bond interface, enslave interface TenGigabitEthernet6/0/0 to BondEthernet0 Please see src/plugins/lacp/lacp_doc.md for more examples and additional options. LACP is a control plane protocol which manages and monitors the status of the slave interfaces. The protocol is part of 802.3ad standard. This patch implements LACPv1. LACPv2 is not supported. To enable LACP on the bond interface, specify "mode lacp" when the bond interface is created. The syntax to enslave a slave interface is the same as other bonding modes. Change-Id: I06581d3b87635972f9f0e1ec50b67560fc13e26c Signed-off-by: Steven <sluong@cisco.com>
Diffstat (limited to 'src/vnet/bonding/bond.api')
-rw-r--r--src/vnet/bonding/bond.api163
1 files changed, 163 insertions, 0 deletions
diff --git a/src/vnet/bonding/bond.api b/src/vnet/bonding/bond.api
new file mode 100644
index 00000000000..e8919e14904
--- /dev/null
+++ b/src/vnet/bonding/bond.api
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2017 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** \file
+
+ This file defines vpe control-plane API messages for
+ the bonding device driver
+*/
+
+option version = "1.0.0";
+
+/** \brief Initialize a new bond interface with the given paramters
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param use_custom_mac - if set, mac_address is valid
+ @param mac_address - mac addr to assign to the interface if use_custom_mac is set
+ @param mode - mode, required (1=round-robin, 2=active-backup, 3=xor, 4=broadcastcast, 5=lacp)
+ @param lb - load balance, optional (0=l2, 1=l34, 2=l23) valid for xor and lacp modes. Otherwise ignored
+*/
+define bond_create
+{
+ u32 client_index;
+ u32 context;
+ u8 use_custom_mac;
+ u8 mac_address[6];
+ u8 mode;
+ u8 lb;
+};
+
+/** \brief Reply for bond create reply
+ @param context - returned sender context, to match reply w/ request
+ @param retval - return code
+ @param sw_if_index - software index allocated for the new tap interface
+*/
+define bond_create_reply
+{
+ u32 context;
+ i32 retval;
+ u32 sw_if_index;
+};
+
+/** \brief Delete bond interface
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param sw_if_index - interface index of slave interface
+*/
+autoreply define bond_delete
+{
+ u32 client_index;
+ u32 context;
+ u32 sw_if_index;
+};
+
+/** \brief Initialize a new bond interface with the given paramters
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param sw_if_index - slave sw_if_index
+ @param bond_sw_if_index - bond sw_if_index
+ @param is_passive - interface does not initiate the lacp protocol, remote must be active speaker
+ @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout
+*/
+define bond_enslave
+{
+ u32 client_index;
+ u32 context;
+ u32 sw_if_index;
+ u32 bond_sw_if_index;
+ u8 is_passive;
+ u8 is_long_timeout;
+};
+
+/** \brief Reply for bond enslave reply
+ @param context - returned sender context, to match reply w/ request
+ @param retval - return code
+*/
+define bond_enslave_reply
+{
+ u32 context;
+ i32 retval;
+};
+
+/** \brief bond detach slave
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param sw_if_index - interface index of slave interface
+*/
+autoreply define bond_detach_slave
+{
+ u32 client_index;
+ u32 context;
+ u32 sw_if_index;
+};
+
+/** \brief Dump bond interfaces request */
+define sw_interface_bond_dump
+{
+ u32 client_index;
+ u32 context;
+};
+
+/** \brief Reply for bond dump request
+ @param sw_if_index - software index of bond interface
+ @param interface_name - name of interface
+ @param mode - bonding mode
+ @param lb - load balance algo
+ @param active_slaves - active slaves count
+ @param slaves - config slave count
+*/
+define sw_interface_bond_details
+{
+ u32 context;
+ u32 sw_if_index;
+ u8 interface_name[64];
+ u8 mode;
+ u8 lb;
+ u32 active_slaves;
+ u32 slaves;
+};
+
+/** \brief bond slave dump
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param sw_if_index - interface index of bond interface
+*/
+define sw_interface_slave_dump
+{
+ u32 client_index;
+ u32 context;
+ u32 sw_if_index;
+};
+
+/** \brief Reply for slave dump request
+ @param sw_if_index - software index of slave interface
+ @param interface_name - name of interface
+ @param is_passve - interface does not initiate the lacp protocol, remote must be active speaker
+ @param is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout
+*/
+define sw_interface_slave_details
+{
+ u32 context;
+ u32 sw_if_index;
+ u8 interface_name[64];
+ u8 is_passive;
+ u8 is_long_timeout;
+};
+
+/*
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */