drivers/net/bonding/bond_procfs.c
Source file repositories/reference/linux-study-clean/drivers/net/bonding/bond_procfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/bonding/bond_procfs.c- Extension
.c- Size
- 9952 bytes
- Lines
- 341
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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
generated/utsrelease.hlinux/proc_fs.hlinux/ethtool.hlinux/export.hnet/net_namespace.hnet/netns/generic.hnet/bonding.h
Detected Declarations
function bond_for_each_slave_rcufunction bond_info_seq_stopfunction bond_info_show_masterfunction bond_info_show_slavefunction bond_info_seq_showfunction bond_create_proc_entryfunction bond_remove_proc_entryfunction bond_create_proc_dirfunction bond_destroy_proc_dir
Annotated Snippet
if (primary) {
optval = bond_opt_get_val(BOND_OPT_PRIMARY_RESELECT,
READ_ONCE(bond->params.primary_reselect));
seq_printf(seq, " (primary_reselect %s)",
optval->string);
}
seq_printf(seq, "\nCurrently Active Slave: %s\n",
(curr) ? curr->dev->name : "None");
}
seq_printf(seq, "MII Status: %s\n", netif_carrier_ok(bond->dev) ?
"up" : "down");
miimon = READ_ONCE(bond->params.miimon);
seq_printf(seq, "MII Polling Interval (ms): %d\n", miimon);
seq_printf(seq, "Up Delay (ms): %d\n",
READ_ONCE(bond->params.updelay) * miimon);
seq_printf(seq, "Down Delay (ms): %d\n",
READ_ONCE(bond->params.downdelay) * miimon);
seq_printf(seq, "Peer Notification Delay (ms): %d\n",
READ_ONCE(bond->params.peer_notif_delay) * miimon);
/* ARP information */
arp_interval = READ_ONCE(bond->params.arp_interval);
if (arp_interval > 0) {
int printed = 0;
seq_printf(seq, "ARP Polling Interval (ms): %d\n",
arp_interval);
seq_printf(seq, "ARP Missed Max: %u\n",
READ_ONCE(bond->params.missed_max));
seq_printf(seq, "ARP IP target/s (n.n.n.n form):");
for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) {
__be32 t = READ_ONCE(bond->params.arp_targets[i]);
if (!t)
break;
if (printed)
seq_printf(seq, ",");
seq_printf(seq, " %pI4", &t);
printed = 1;
}
seq_printf(seq, "\n");
#if IS_ENABLED(CONFIG_IPV6)
printed = 0;
seq_printf(seq, "NS IPv6 target/s (xx::xx form):");
for (i = 0; (i < BOND_MAX_NS_TARGETS); i++) {
if (ipv6_addr_any(&bond->params.ns_targets[i]))
break;
if (printed)
seq_printf(seq, ",");
seq_printf(seq, " %pI6c", &bond->params.ns_targets[i]);
printed = 1;
}
seq_printf(seq, "\n");
#endif
}
if (BOND_MODE(bond) == BOND_MODE_8023AD) {
struct ad_info ad_info;
seq_puts(seq, "\n802.3ad info\n");
seq_printf(seq, "LACP active: %s\n",
READ_ONCE(bond->params.lacp_active) ? "on" : "off");
seq_printf(seq, "LACP rate: %s\n",
READ_ONCE(bond->params.lacp_fast) ? "fast" : "slow");
seq_printf(seq, "Min links: %d\n",
READ_ONCE(bond->params.min_links));
optval = bond_opt_get_val(BOND_OPT_AD_SELECT,
READ_ONCE(bond->params.ad_select));
seq_printf(seq, "Aggregator selection policy (ad_select): %s\n",
optval->string);
if (capable(CAP_NET_ADMIN)) {
seq_printf(seq, "System priority: %d\n",
BOND_AD_INFO(bond).system.sys_priority);
seq_printf(seq, "System MAC address: %pM\n",
&BOND_AD_INFO(bond).system.sys_mac_addr);
if (__bond_3ad_get_active_agg_info(bond, &ad_info)) {
seq_printf(seq,
"bond %s has no active aggregator\n",
bond->dev->name);
} else {
seq_printf(seq, "Active Aggregator Info:\n");
Annotation
- Immediate include surface: `generated/utsrelease.h`, `linux/proc_fs.h`, `linux/ethtool.h`, `linux/export.h`, `net/net_namespace.h`, `net/netns/generic.h`, `net/bonding.h`.
- Detected declarations: `function bond_for_each_slave_rcu`, `function bond_info_seq_stop`, `function bond_info_show_master`, `function bond_info_show_slave`, `function bond_info_seq_show`, `function bond_create_proc_entry`, `function bond_remove_proc_entry`, `function bond_create_proc_dir`, `function bond_destroy_proc_dir`.
- Atlas domain: Driver Families / drivers/net.
- 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.