DPDK 22.11.6
Macros | Functions
rte_eth_bond.h File Reference
#include <rte_ether.h>

Go to the source code of this file.

Macros

#define BONDING_MODE_ROUND_ROBIN   (0)
 
#define BONDING_MODE_ACTIVE_BACKUP   (1)
 
#define BONDING_MODE_BALANCE   (2)
 
#define BONDING_MODE_BROADCAST   (3)
 
#define BONDING_MODE_8023AD   (4)
 
#define BONDING_MODE_TLB   (5)
 
#define BONDING_MODE_ALB   (6)
 
#define BALANCE_XMIT_POLICY_LAYER2   (0)
 
#define BALANCE_XMIT_POLICY_LAYER23   (1)
 
#define BALANCE_XMIT_POLICY_LAYER34   (2)
 

Functions

int rte_eth_bond_create (const char *name, uint8_t mode, uint8_t socket_id)
 
int rte_eth_bond_free (const char *name)
 
int rte_eth_bond_slave_add (uint16_t bonded_port_id, uint16_t slave_port_id)
 
int rte_eth_bond_slave_remove (uint16_t bonded_port_id, uint16_t slave_port_id)
 
int rte_eth_bond_mode_set (uint16_t bonded_port_id, uint8_t mode)
 
int rte_eth_bond_mode_get (uint16_t bonded_port_id)
 
int rte_eth_bond_primary_set (uint16_t bonded_port_id, uint16_t slave_port_id)
 
int rte_eth_bond_primary_get (uint16_t bonded_port_id)
 
int rte_eth_bond_slaves_get (uint16_t bonded_port_id, uint16_t slaves[], uint16_t len)
 
int rte_eth_bond_active_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 rte_ether_addr *mac_addr)
 
int rte_eth_bond_mac_address_reset (uint16_t bonded_port_id)
 
int rte_eth_bond_xmit_policy_set (uint16_t bonded_port_id, uint8_t policy)
 
int rte_eth_bond_xmit_policy_get (uint16_t bonded_port_id)
 
int rte_eth_bond_link_monitoring_set (uint16_t bonded_port_id, uint32_t internal_ms)
 
int rte_eth_bond_link_monitoring_get (uint16_t bonded_port_id)
 
int rte_eth_bond_link_down_prop_delay_set (uint16_t bonded_port_id, uint32_t delay_ms)
 
int rte_eth_bond_link_down_prop_delay_get (uint16_t bonded_port_id)
 
int rte_eth_bond_link_up_prop_delay_set (uint16_t bonded_port_id, uint32_t delay_ms)
 
int rte_eth_bond_link_up_prop_delay_get (uint16_t bonded_port_id)
 

Detailed Description

RTE Link Bonding Ethernet Device Link Bonding for 1GbE and 10GbE ports to allow the aggregation of multiple (slave) NICs into a single logical interface. The bonded device processes these interfaces based on the mode of operation specified and supported. This implementation supports 4 modes of operation round robin, active backup balance and broadcast. Providing redundant links, fault tolerance and/or load balancing of network ports

Definition in file rte_eth_bond.h.

Macro Definition Documentation

◆ BONDING_MODE_ROUND_ROBIN

#define BONDING_MODE_ROUND_ROBIN   (0)

Round Robin (Mode 0). In this mode all transmitted packets will be balanced equally across all active slaves of the bonded in a round robin fashion.

Definition at line 31 of file rte_eth_bond.h.

◆ BONDING_MODE_ACTIVE_BACKUP

#define BONDING_MODE_ACTIVE_BACKUP   (1)

Active Backup (Mode 1). In this mode all packets transmitted will be transmitted on the primary slave until such point as the primary slave is no longer available and then transmitted packets will be sent on the next available slaves. The primary slave can be defined by the user but defaults to the first active slave available if not specified.

Definition at line 38 of file rte_eth_bond.h.

◆ BONDING_MODE_BALANCE

#define BONDING_MODE_BALANCE   (2)

Balance (Mode 2). In this mode all packets transmitted will be balanced across the available slaves using one of three available transmit policies - l2, l2+3 or l3+4. See BALANCE_XMIT_POLICY macros definitions for further details on transmit policies.

Definition at line 44 of file rte_eth_bond.h.

◆ BONDING_MODE_BROADCAST

#define BONDING_MODE_BROADCAST   (3)

Broadcast (Mode 3). In this mode all transmitted packets will be transmitted on all available active slaves of the bonded.

Definition at line 48 of file rte_eth_bond.h.

◆ BONDING_MODE_8023AD

#define BONDING_MODE_8023AD   (4)

802.3AD (Mode 4).

This mode provides auto negotiation/configuration of peers and well as link status changes monitoring using out of band LACP (link aggregation control protocol) messages. For further details of LACP specification see the IEEE 802.3ad/802.1AX standards. It is also described here https://www.kernel.org/doc/Documentation/networking/bonding.txt.

Important Usage Notes:

  • for LACP mode to work the rx/tx burst functions must be invoked at least once every 100ms, otherwise the out-of-band LACP messages will not be handled with the expected latency and this may cause the link status to be incorrectly marked as down or failure to correctly negotiate with peers.
  • For optimal performance during initial handshaking the array of mbufs provided to rx_burst should be at least 2 times the slave count size.

Definition at line 67 of file rte_eth_bond.h.

◆ BONDING_MODE_TLB

#define BONDING_MODE_TLB   (5)

Adaptive TLB (Mode 5) This mode provides an adaptive transmit load balancing. It dynamically changes the transmitting slave, according to the computed load. Statistics are collected in 100ms intervals and scheduled every 10ms

Definition at line 72 of file rte_eth_bond.h.

◆ BONDING_MODE_ALB

#define BONDING_MODE_ALB   (6)

Adaptive Load Balancing (Mode 6) This mode includes adaptive TLB and receive load balancing (RLB). In RLB the bonding driver intercepts ARP replies send by local system and overwrites its source MAC address, so that different peers send data to the server on different slave interfaces. When local system sends ARP request, it saves IP information from it. When ARP reply from that peer is received, its MAC is stored, one of slave MACs assigned and ARP reply send to that peer.

Examples
examples/bond/main.c.

Definition at line 81 of file rte_eth_bond.h.

◆ BALANCE_XMIT_POLICY_LAYER2

#define BALANCE_XMIT_POLICY_LAYER2   (0)

Layer 2 (Ethernet MAC)

Definition at line 85 of file rte_eth_bond.h.

◆ BALANCE_XMIT_POLICY_LAYER23

#define BALANCE_XMIT_POLICY_LAYER23   (1)

Layer 2+3 (Ethernet MAC + IP Addresses) transmit load balancing

Definition at line 87 of file rte_eth_bond.h.

◆ BALANCE_XMIT_POLICY_LAYER34

#define BALANCE_XMIT_POLICY_LAYER34   (2)

Layer 3+4 (IP Addresses + UDP Ports) transmit load balancing

Definition at line 89 of file rte_eth_bond.h.

Function Documentation

◆ rte_eth_bond_create()

int rte_eth_bond_create ( const char *  name,
uint8_t  mode,
uint8_t  socket_id 
)

Create a bonded rte_eth_dev device

Parameters
nameName of new link bonding device.
modeMode to initialize bonding device in.
socket_idSocket Id on which to allocate eth_dev resources.
Returns
Port Id of created rte_eth_dev on success, negative value otherwise
Examples
examples/bond/main.c.

◆ rte_eth_bond_free()

int rte_eth_bond_free ( const char *  name)

Free a bonded rte_eth_dev device

Parameters
nameName of the link bonding device.
Returns
0 on success, negative value otherwise

◆ rte_eth_bond_slave_add()

int rte_eth_bond_slave_add ( uint16_t  bonded_port_id,
uint16_t  slave_port_id 
)

Add a rte_eth_dev device as a slave to the bonded device

Parameters
bonded_port_idPort ID of bonded device.
slave_port_idPort ID of slave device.
Returns
0 on success, negative value otherwise
Examples
examples/bond/main.c.

◆ rte_eth_bond_slave_remove()

int rte_eth_bond_slave_remove ( uint16_t  bonded_port_id,
uint16_t  slave_port_id 
)

Remove a slave rte_eth_dev device from the bonded device

Parameters
bonded_port_idPort ID of bonded device.
slave_port_idPort ID of slave device.
Returns
0 on success, negative value otherwise

◆ rte_eth_bond_mode_set()

int rte_eth_bond_mode_set ( uint16_t  bonded_port_id,
uint8_t  mode 
)

Set link bonding mode of bonded device

Parameters
bonded_port_idPort ID of bonded device.
modeBonding mode to set
Returns
0 on success, negative value otherwise

◆ rte_eth_bond_mode_get()

int rte_eth_bond_mode_get ( uint16_t  bonded_port_id)

Get link bonding mode of bonded device

Parameters
bonded_port_idPort ID of bonded device.
Returns
link bonding mode on success, negative value otherwise

◆ rte_eth_bond_primary_set()

int rte_eth_bond_primary_set ( uint16_t  bonded_port_id,
uint16_t  slave_port_id 
)

Set slave rte_eth_dev as primary slave of bonded device

Parameters
bonded_port_idPort ID of bonded device.
slave_port_idPort ID of slave device.
Returns
0 on success, negative value otherwise

◆ rte_eth_bond_primary_get()

int rte_eth_bond_primary_get ( uint16_t  bonded_port_id)

Get primary slave of bonded device

Parameters
bonded_port_idPort ID of bonded device.
Returns
Port Id of primary slave on success, -1 on failure

◆ rte_eth_bond_slaves_get()

int rte_eth_bond_slaves_get ( uint16_t  bonded_port_id,
uint16_t  slaves[],
uint16_t  len 
)

Populate an array with list of the slaves port id's of the bonded device

Parameters
bonded_port_idPort ID of bonded eth_dev to interrogate
slavesArray to be populated with the current active slaves
lenLength of slaves array
Returns
Number of slaves associated with bonded device on success, negative value otherwise

◆ rte_eth_bond_active_slaves_get()

int rte_eth_bond_active_slaves_get ( uint16_t  bonded_port_id,
uint16_t  slaves[],
uint16_t  len 
)

Populate an array with list of the active slaves port id's of the bonded device.

Parameters
bonded_port_idPort ID of bonded eth_dev to interrogate
slavesArray to be populated with the current active slaves
lenLength of slaves array
Returns
Number of active slaves associated with bonded device on success, negative value otherwise
Examples
examples/bond/main.c.

◆ rte_eth_bond_mac_address_set()

int rte_eth_bond_mac_address_set ( uint16_t  bonded_port_id,
struct rte_ether_addr mac_addr 
)

Set explicit MAC address to use on bonded device and it's slaves.

Parameters
bonded_port_idPort ID of bonded device.
mac_addrMAC Address to use on bonded device overriding slaves MAC addresses
Returns
0 on success, negative value otherwise

◆ rte_eth_bond_mac_address_reset()

int rte_eth_bond_mac_address_reset ( uint16_t  bonded_port_id)

Reset bonded device to use MAC from primary slave on bonded device and it's slaves.

Parameters
bonded_port_idPort ID of bonded device.
Returns
0 on success, negative value otherwise

◆ rte_eth_bond_xmit_policy_set()

int rte_eth_bond_xmit_policy_set ( uint16_t  bonded_port_id,
uint8_t  policy 
)

Set the transmit policy for bonded device to use when it is operating in balance mode, this parameter is otherwise ignored in other modes of operation.

Parameters
bonded_port_idPort ID of bonded device.
policyBalance mode transmission policy.
Returns
0 on success, negative value otherwise.

◆ rte_eth_bond_xmit_policy_get()

int rte_eth_bond_xmit_policy_get ( uint16_t  bonded_port_id)

Get the transmit policy set on bonded device for balance mode operation

Parameters
bonded_port_idPort ID of bonded device.
Returns
Balance transmit policy on success, negative value otherwise.

◆ rte_eth_bond_link_monitoring_set()

int rte_eth_bond_link_monitoring_set ( uint16_t  bonded_port_id,
uint32_t  internal_ms 
)

Set the link monitoring frequency (in ms) for monitoring the link status of slave devices

Parameters
bonded_port_idPort ID of bonded device.
internal_msMonitoring interval in milliseconds
Returns
0 on success, negative value otherwise.

◆ rte_eth_bond_link_monitoring_get()

int rte_eth_bond_link_monitoring_get ( uint16_t  bonded_port_id)

Get the current link monitoring frequency (in ms) for monitoring of the link status of slave devices

Parameters
bonded_port_idPort ID of bonded device.
Returns
Monitoring interval on success, negative value otherwise.

◆ rte_eth_bond_link_down_prop_delay_set()

int rte_eth_bond_link_down_prop_delay_set ( uint16_t  bonded_port_id,
uint32_t  delay_ms 
)

Set the period in milliseconds for delaying the disabling of a bonded link when the link down status has been detected

Parameters
bonded_port_idPort ID of bonded device.
delay_msDelay period in milliseconds.
Returns
0 on success, negative value otherwise.

◆ rte_eth_bond_link_down_prop_delay_get()

int rte_eth_bond_link_down_prop_delay_get ( uint16_t  bonded_port_id)

Get the period in milliseconds set for delaying the disabling of a bonded link when the link down status has been detected

Parameters
bonded_port_idPort ID of bonded device.
Returns
Delay period on success, negative value otherwise.

◆ rte_eth_bond_link_up_prop_delay_set()

int rte_eth_bond_link_up_prop_delay_set ( uint16_t  bonded_port_id,
uint32_t  delay_ms 
)

Set the period in milliseconds for delaying the enabling of a bonded link when the link up status has been detected

Parameters
bonded_port_idPort ID of bonded device.
delay_msDelay period in milliseconds.
Returns
0 on success, negative value otherwise.

◆ rte_eth_bond_link_up_prop_delay_get()

int rte_eth_bond_link_up_prop_delay_get ( uint16_t  bonded_port_id)

Get the period in milliseconds set for delaying the enabling of a bonded link when the link up status has been detected

Parameters
bonded_port_idPort ID of bonded device.
Returns
Delay period on success, negative value otherwise.