rte_eth_bond.h(3)
π©· rte_eth_bond.h β Library Functions Manual π©·
okay bestie, buckle UP, because this is the rte_eth_bond.h(3) page and it is lowkey a whole lifestyle. it's from the Library Functions Manual, it's header-file lore, and we are going to read every single line of it together. no skimming. we don't do that here. π
β¨ NAME β¨
rte_eth_bond.h
like... that's her. that's the header. iconic behavior tbh. π«Ά
π SYNOPSIS π
#include <rte_ether.h>
π§ 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_member_add (uint16_t bonding_port_id, uint16_t member_port_id)
int rte_eth_bond_member_remove (uint16_t bonding_port_id, uint16_t member_port_id)
int rte_eth_bond_mode_set (uint16_t bonding_port_id, uint8_t mode)
int rte_eth_bond_mode_get (uint16_t bonding_port_id)
int rte_eth_bond_primary_set (uint16_t bonding_port_id, uint16_t member_port_id)
int rte_eth_bond_primary_get (uint16_t bonding_port_id)
int rte_eth_bond_members_get (uint16_t bonding_port_id, uint16_t members[], uint16_t len)
int rte_eth_bond_active_members_get (uint16_t bonding_port_id, uint16_t members[], uint16_t len)
int rte_eth_bond_mac_address_set (uint16_t bonding_port_id, struct rte_ether_addr *mac_addr)
int rte_eth_bond_mac_address_reset (uint16_t bonding_port_id)
int rte_eth_bond_xmit_policy_set (uint16_t bonding_port_id, uint8_t policy)
int rte_eth_bond_xmit_policy_get (uint16_t bonding_port_id)
int rte_eth_bond_link_monitoring_set (uint16_t bonding_port_id, uint32_t internal_ms)
int rte_eth_bond_link_monitoring_get (uint16_t bonding_port_id)
int rte_eth_bond_link_down_prop_delay_set (uint16_t bonding_port_id, uint32_t delay_ms)
int rte_eth_bond_link_down_prop_delay_get (uint16_t bonding_port_id)
int rte_eth_bond_link_up_prop_delay_set (uint16_t bonding_port_id, uint32_t delay_ms)
int rte_eth_bond_link_up_prop_delay_get (uint16_t bonding_port_id)
π Detailed Description π
RTE Link Bonding Ethernet Device π
so basically, this is Link Bonding for 1GbE and 10GbE ports, and the whole point is that it lets you aggregate multiple (member) NICs into one single logical interface. yes queen, many ports, one vibe. β¨
The bonding device processes these interfaces based on the mode of operation you specified and it supports. This implementation supports 4 modes of operation: round robin, active backup, balance and broadcast. what does that get you? providing redundant links, fault tolerance and/or load balancing of network ports. say thank you. π
Definition in file rte_eth_bond.h.
π Macro Definition Documentation π
β #define BONDING_MODE_ROUND_ROBIN (0) β
Round Robin (Mode 0). In this mode all transmitted packets will be balanced equally across all active members of the bonding in a round robin fashion. taking turns, being fair, no favorites. we love an equitable queen. π
Definition at line 28 of file rte_eth_bond.h.
β #define BONDING_MODE_ACTIVE_BACKUP (1) β
Active Backup (Mode 1). In this mode all packets transmitted will be transmitted on the primary member until such point as the primary member is no longer available β and then transmitted packets will be sent on the next available members. so it's giving "main character until she's out, then the understudies go on." π
The primary member can be defined by the user, but it defaults to the first active member available if you don't specify one. cute of her.
Definition at line 33 of file rte_eth_bond.h.
β #define BONDING_MODE_BALANCE (2) β
Balance (Mode 2). In this mode all packets transmitted will be balanced across the available members using one of three available transmit policies: l2, l2+3 or l3+4. See the BALANCE_XMIT_POLICY macro definitions for further details on transmit policies. yes bestie, the lore continues further down this very page. keep scrolling. π₯
Definition at line 41 of file rte_eth_bond.h.
β #define BONDING_MODE_BROADCAST (3) β
Broadcast (Mode 3). In this mode all transmitted packets will be transmitted on all available active members of the bonding. every member gets the packet. no one gets left out. it's very "we're all going to the party" energy. π
Definition at line 48 of file rte_eth_bond.h.
β #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 the 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: π¨ (these are NOT optional gossip, they are real)
- for LACP mode to work the
rx/txburst 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. yes, timing matters, this one is dramatic. π - For optimal performance during initial handshaking the array of mbufs provided to
rx_burstshould be at least 2 times the member count size. double it. give the girl room to breathe. π«Ά
Definition at line 53 of file rte_eth_bond.h.
β #define BONDING_MODE_TLB (5) β
Adaptive TLB (Mode 5). This mode provides an adaptive transmit load balancing. It dynamically changes the transmitting member, according to the computed load. Statistics are collected in 100ms intervals and scheduled every 10ms. she's constantly checking in, monitoring her own vibe, adjusting. very self-aware. β¨
Definition at line 71 of file rte_eth_bond.h.
β #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 member 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 member MACs assigned and ARP reply send to that peer. okay so she's matchmaking β pairing peers with members so the traffic spreads out. utterly unhinged behavior and yet it slays. ππ
Definition at line 77 of file rte_eth_bond.h.
β #define BALANCE_XMIT_POLICY_LAYER2 (0) β
Layer 2 (Ethernet MAC)
Definition at line 88 of file rte_eth_bond.h.
β #define BALANCE_XMIT_POLICY_LAYER23 (1) β
Layer 2+3 (Ethernet MAC + IP Addresses) transmit load balancing
Definition at line 90 of file rte_eth_bond.h.
β #define BALANCE_XMIT_POLICY_LAYER34 (2) β
Layer 3+4 (IP Addresses + UDP Ports) transmit load balancing
Definition at line 92 of file rte_eth_bond.h.
β¨ FUNCTION DOCUMENTATION β¨
okay bestie, this is the whole roster β every single function the bonding library hands you. no skips, no shortcuts, all 20 of them lined up with their exact signatures, their exact params, and their exact return values. vibe check passed, let's go π
rte_eth_bond_create
int rte_eth_bond_create (const char * name, uint8_t mode, uint8_t socket_id)
The origin story. This one spins up a whole new bonding rte_eth_dev device for you. birth of a legend fr π¦
Parameters
- name β Name of new link bonding device.
- mode β Mode to initialize bonding device in.
- socket_id β Socket Id on which to allocate eth_dev resources.
Returns
Port Id of created rte_eth_dev on success, negative value otherwise
rte_eth_bond_free
int rte_eth_bond_free (const char * name)
Yeeting a bonding rte_eth_dev device out of existence. it's gone, it's free, bye bestie π
Parameters
- name β Name of the link bonding device.
Returns
0 on success, negative value otherwise
rte_eth_bond_member_add
int rte_eth_bond_member_add (uint16_t bonding_port_id, uint16_t member_port_id)
Adding an rte_eth_dev device as a member to the bonding device. congrats on the promotion, you're in the group chat now π«Ά
Parameters
- bonding_port_id β Port ID of bonding device.
- member_port_id β Port ID of member device.
Returns
0 on success, negative value otherwise
rte_eth_bond_member_remove
int rte_eth_bond_member_remove (uint16_t bonding_port_id, uint16_t member_port_id)
Removing a member rte_eth_dev device from the bonding device. it's giving "we need to talk" π
Parameters
- bonding_port_id β Port ID of bonding device.
- member_port_id β Port ID of member device.
Returns
0 on success, negative value otherwise
rte_eth_bond_mode_set
int rte_eth_bond_mode_set (uint16_t bonding_port_id, uint8_t mode)
Setting the link bonding mode on your bonding device. glow-up era β¨
Parameters
- bonding_port_id β Port ID of bonding device.
- mode β Bonding mode to set
Returns
0 on success, negative value otherwise
rte_eth_bond_mode_get
int rte_eth_bond_mode_get (uint16_t bonding_port_id)
Asking your bonding device which link bonding mode it's currently in.
Parameters
- bonding_port_id β Port ID of bonding device.
Returns
link bonding mode on success, negative value otherwise
rte_eth_bond_primary_set
int rte_eth_bond_primary_set (uint16_t bonding_port_id, uint16_t member_port_id)
Setting a member rte_eth_dev as the primary member of the bonding device. main character energy, honestly π
Parameters
- bonding_port_id β Port ID of bonding device.
- member_port_id β Port ID of member device.
Returns
0 on success, negative value otherwise
rte_eth_bond_primary_get
int rte_eth_bond_primary_get (uint16_t bonding_port_id)
Finding out which member is the primary one right now.
Parameters
- bonding_port_id β Port ID of bonding device.
Returns
Port Id of primary member on success, -1 on failure
rte_eth_bond_members_get
int rte_eth_bond_members_get (uint16_t bonding_port_id, uint16_t members[], uint16_t len)
Populates an array with the list of the members port id's of the bonding device. census time π
Parameters
- bonding_port_id β Port ID of bonding eth_dev to interrogate
- members β Array to be populated with the current active members
- len β Length of members array
Returns
Number of members associated with bonding device on success, negative value otherwise
rte_eth_bond_active_members_get
int rte_eth_bond_active_members_get (uint16_t bonding_port_id, uint16_t members[], uint16_t len)
Same energy as above, but β¨activeβ¨ only β populates an array with the list of the active members port id's of the bonding device.
Parameters
- bonding_port_id β Port ID of bonding eth_dev to interrogate
- members β Array to be populated with the current active members
- len β Length of members array
Returns
Number of active members associated with bonding device on success, negative value otherwise
rte_eth_bond_mac_address_set
int rte_eth_bond_mac_address_set (uint16_t bonding_port_id, struct rte_ether_addr * mac_addr)
Sets an explicit MAC address to use on the bonding device and it's members. heads up: this MAC overrides the members' own MAC addresses, no cap π«’
Parameters
- bonding_port_id β Port ID of bonding device.
- mac_addr β MAC Address to use on bonding device overriding members MAC addresses
Returns
0 on success, negative value otherwise
rte_eth_bond_mac_address_reset
int rte_eth_bond_mac_address_reset (uint16_t bonding_port_id)
Undoing all that β resets the bonding device to use the MAC from the primary member, on the bonding device and it's members. plot twist π
Parameters
- bonding_port_id β Port ID of bonding device.
Returns
0 on success, negative value otherwise
rte_eth_bond_xmit_policy_set
int rte_eth_bond_xmit_policy_set (uint16_t bonding_port_id, uint8_t policy)
Sets the transmit policy for the bonding device to use when it is operating in balance mode. important: this parameter is otherwise ignored in the other modes of operation, so don't come for it later π
Parameters
- bonding_port_id β Port ID of bonding device.
- policy β Balance 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 bonding_port_id)
Grabs the transmit policy that's been set on the bonding device for balance mode operation.
Parameters
- bonding_port_id β Port ID of bonding 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 bonding_port_id, uint32_t internal_ms)
Sets the link monitoring frequency (in ms) used for monitoring the link status of member devices. we're watching, always watching π
Parameters
- bonding_port_id β Port ID of bonding device.
- internal_ms β Monitoring 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 bonding_port_id)
Reads back the current link monitoring frequency (in ms) used for monitoring of the link status of member devices.
Parameters
- bonding_port_id β Port ID of bonding 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 bonding_port_id, uint32_t delay_ms)
Sets the period in milliseconds for delaying the disabling of a bonding link when the link down status has been detected. a lil grace period, a lil patience π
Parameters
- bonding_port_id β Port ID of bonding device.
- delay_ms β Delay 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 bonding_port_id)
Gets the period in milliseconds that's been set for delaying the disabling of a bonding link when the link down status has been detected.
Parameters
- bonding_port_id β Port ID of bonding 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 bonding_port_id, uint32_t delay_ms)
Sets the period in milliseconds for delaying the enabling of a bonding link when the link up status has been detected. same grace period energy, opposite direction π₯
Parameters
- bonding_port_id β Port ID of bonding device.
- delay_ms β Delay 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 bonding_port_id)
Gets the period in milliseconds that's been set for delaying the enabling of a bonding link when the link up status has been detected.
Parameters
- bonding_port_id β Port ID of bonding device.
Returns
Delay period on success, negative value otherwise.
πΈ AUTHOR πΈ
Generated automatically by Doxygen for DPDK from the source code. (not a human, just a very diligent little robot π§)
and that's the whole page, bestie β you ate that. this doc is from DPDK, version 25.11.3, page rte_eth_bond.h(3). go forth and bond responsibly π
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms