DPDK  17.11.10
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(uint16_t bonded_port_id, uint16_t slave_port_id);
155 
165 int
166 rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id);
167 
177 int
178 rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode);
179 
188 int
189 rte_eth_bond_mode_get(uint16_t bonded_port_id);
190 
200 int
201 rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id);
202 
211 int
212 rte_eth_bond_primary_get(uint16_t bonded_port_id);
213 
225 int
226 rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[],
227  uint16_t len);
228 
241 int
242 rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[],
243  uint16_t len);
244 
255 int
256 rte_eth_bond_mac_address_set(uint16_t bonded_port_id,
257  struct ether_addr *mac_addr);
258 
268 int
269 rte_eth_bond_mac_address_reset(uint16_t bonded_port_id);
270 
282 int
283 rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy);
284 
293 int
294 rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id);
295 
307 int
308 rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms);
309 
319 int
320 rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id);
321 
322 
333 int
334 rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id,
335  uint32_t delay_ms);
336 
346 int
347 rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id);
348 
359 int
360 rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id,
361  uint32_t delay_ms);
362 
372 int
373 rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id);
374 
375 
376 #ifdef __cplusplus
377 }
378 #endif
379 
380 #endif
int rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id)
int rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id)
int rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)
int rte_eth_bond_mac_address_reset(uint16_t bonded_port_id)
int rte_eth_bond_free(const char *name)
int rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], uint16_t len)
int rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr)
int rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms)
int rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, uint32_t delay_ms)
int rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, uint32_t delay_ms)
int rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], uint16_t len)
int rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id)
int rte_eth_bond_mode_get(uint16_t bonded_port_id)
int rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode)
int rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id)
int rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id)
int rte_eth_bond_primary_get(uint16_t bonded_port_id)
int rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id)
int rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id)
int rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy)