include/net/bonding.h
Source file repositories/reference/linux-study-clean/include/net/bonding.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/bonding.h- Extension
.h- Size
- 22062 bytes
- Lines
- 820
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/timer.hlinux/proc_fs.hlinux/if_bonding.hlinux/cpumask.hlinux/in6.hlinux/netpoll.hlinux/inetdevice.hlinux/etherdevice.hlinux/reciprocal_div.hlinux/if_link.hnet/bond_3ad.hnet/bond_alb.hnet/bond_options.hnet/ipv6.hnet/addrconf.h
Detected Declarations
struct bond_paramsstruct slavestruct bond_up_slavestruct bond_ipsecstruct bondingstruct bond_vlan_tagstruct bond_netfunction block_netpoll_txfunction unblock_netpoll_txfunction is_netpoll_tx_blockedfunction bond_should_override_tx_queuefunction bond_is_lbfunction bond_needs_speed_duplexfunction bond_is_nondyn_tlbfunction bond_mode_can_use_xmit_hashfunction bond_mode_uses_xmit_hashfunction bond_mode_uses_arpfunction bond_mode_uses_primaryfunction bond_uses_primaryfunction bond_slave_is_upfunction bond_set_active_slavefunction bond_set_backup_slavefunction bond_set_slave_statefunction bond_slave_state_changefunction bond_for_each_slavefunction bond_slave_state_notifyfunction bond_for_each_slavefunction bond_slave_statefunction bond_is_active_slavefunction bond_slave_can_txfunction bond_is_active_slave_devfunction bond_hw_addr_copyfunction slave_do_arp_validatefunction slave_do_arp_validate_onlyfunction bond_is_ip_target_okfunction bond_is_ip6_target_okfunction slave_oldest_target_arp_rxfunction slave_last_rxfunction slave_update_last_txfunction slave_last_txfunction bond_netpoll_send_skbfunction bond_netpoll_send_skbfunction bond_set_slave_inactive_flagsfunction bond_set_slave_tx_disabled_flagsfunction bond_set_slave_active_flagsfunction bond_set_slave_rx_enabled_flagsfunction bond_is_slave_inactivefunction bond_is_slave_rx_disabled
Annotated Snippet
struct bond_params {
int mode;
int xmit_policy;
int miimon;
u8 num_peer_notif;
u8 missed_max;
int arp_interval;
int arp_validate;
int arp_all_targets;
int fail_over_mac;
int updelay;
int downdelay;
int peer_notif_delay;
int lacp_active;
int lacp_fast;
int lacp_strict;
unsigned int min_links;
int ad_select;
char primary[IFNAMSIZ];
int primary_reselect;
__be32 arp_targets[BOND_MAX_ARP_TARGETS];
int tx_queues;
int all_slaves_active;
int resend_igmp;
int lp_interval;
int packets_per_slave;
int tlb_dynamic_lb;
struct reciprocal_value reciprocal_packets_per_slave;
u16 ad_actor_sys_prio;
u16 ad_user_port_key;
#if IS_ENABLED(CONFIG_IPV6)
struct in6_addr ns_targets[BOND_MAX_NS_TARGETS];
#endif
int coupled_control;
int broadcast_neighbor;
/* 2 bytes of padding : see ether_addr_equal_64bits() */
u8 ad_actor_system[ETH_ALEN + 2];
};
struct slave {
struct net_device *dev; /* first - useful for panic debug */
struct bonding *bond; /* our master */
int delay;
/* all 4 in jiffies */
unsigned long last_link_up;
unsigned long last_tx;
unsigned long last_rx;
unsigned long target_last_arp_rx[BOND_MAX_ARP_TARGETS];
s8 link; /* one of BOND_LINK_XXXX */
s8 link_new_state; /* one of BOND_LINK_XXXX */
u8 backup:1, /* indicates backup slave. Value corresponds with
BOND_STATE_ACTIVE and BOND_STATE_BACKUP */
inactive:1, /* indicates inactive slave */
rx_disabled:1, /* indicates whether slave's Rx is disabled */
should_notify:1, /* indicates whether the state changed */
should_notify_link:1; /* indicates whether the link changed */
u8 duplex;
u32 original_mtu;
u32 link_failure_count;
u32 speed;
u16 queue_id;
u8 perm_hwaddr[MAX_ADDR_LEN];
int prio;
struct ad_slave_info *ad_info;
struct tlb_slave_info tlb_info;
#ifdef CONFIG_NET_POLL_CONTROLLER
struct netpoll *np;
#endif
struct delayed_work notify_work;
struct kobject kobj;
struct rtnl_link_stats64 slave_stats;
};
static inline struct slave *to_slave(struct kobject *kobj)
{
return container_of(kobj, struct slave, kobj);
}
struct bond_up_slave {
unsigned int count;
struct rcu_head rcu;
struct slave *arr[];
};
/*
* Link pseudo-state only used internally by monitors
*/
#define BOND_LINK_NOCHANGE -1
Annotation
- Immediate include surface: `linux/timer.h`, `linux/proc_fs.h`, `linux/if_bonding.h`, `linux/cpumask.h`, `linux/in6.h`, `linux/netpoll.h`, `linux/inetdevice.h`, `linux/etherdevice.h`.
- Detected declarations: `struct bond_params`, `struct slave`, `struct bond_up_slave`, `struct bond_ipsec`, `struct bonding`, `struct bond_vlan_tag`, `struct bond_net`, `function block_netpoll_tx`, `function unblock_netpoll_tx`, `function is_netpoll_tx_blocked`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.