DPDK  17.02.1
rte_eth_bond.h
Go to the documentation of this file.
1 /*-
2  * BSD LICENSE
3  *
4  * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  * * Neither the name of Intel Corporation nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef _RTE_ETH_BOND_H_
35 #define _RTE_ETH_BOND_H_
36 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 #include <rte_ether.h>
54 
55 /* Supported modes of operation of link bonding library */
56 
57 #define BONDING_MODE_ROUND_ROBIN (0)
58 
61 #define BONDING_MODE_ACTIVE_BACKUP (1)
62 
68 #define BONDING_MODE_BALANCE (2)
69 
74 #define BONDING_MODE_BROADCAST (3)
75 
78 #define BONDING_MODE_8023AD (4)
79 
97 #define BONDING_MODE_TLB (5)
98 
102 #define BONDING_MODE_ALB (6)
103 
112 /* Balance Mode Transmit Policies */
113 #define BALANCE_XMIT_POLICY_LAYER2 (0)
114 
115 #define BALANCE_XMIT_POLICY_LAYER23 (1)
116 
117 #define BALANCE_XMIT_POLICY_LAYER34 (2)
118 
130 int
131 rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id);
132 
141 int
142 rte_eth_bond_free(const char *name);
143 
153 int
154 rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id);
155 
165 int
166 rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id);
167 
177 int
178 rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode);
179 
188 int
189 rte_eth_bond_mode_get(uint8_t bonded_port_id);
190 
200 int
201 rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id);
202 
211 int
212 rte_eth_bond_primary_get(uint8_t bonded_port_id);
213 
225 int
226 rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len);
227 
240 int
241 rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[],
242  uint8_t len);
243 
254 int
255 rte_eth_bond_mac_address_set(uint8_t bonded_port_id,
256  struct ether_addr *mac_addr);
257 
267 int
268 rte_eth_bond_mac_address_reset(uint8_t bonded_port_id);
269 
281 int
282 rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy);
283 
292 int
293 rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id);
294 
306 int
307 rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms);
308 
318 int
319 rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id);
320 
321 
332 int
333 rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms);
334 
344 int
345 rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id);
346 
357 int
358 rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms);
359 
369 int
370 rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id);
371 
372 
373 #ifdef __cplusplus
374 }
375 #endif
376 
377 #endif