include/linux/if_team.h
Source file repositories/reference/linux-study-clean/include/linux/if_team.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/if_team.h- Extension
.h- Size
- 8354 bytes
- Lines
- 328
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/netpoll.hnet/sch_generic.hlinux/types.huapi/linux/if_team.h
Detected Declarations
struct team_pcpu_statsstruct teamstruct team_portstruct team_mode_opsstruct team_option_inst_infostruct team_gsetter_ctxstruct team_optionstruct team_modestruct teamenum team_option_typefunction team_port_rx_enabledfunction team_port_tx_enabledfunction team_port_enabledfunction team_port_txablefunction team_port_dev_txablefunction team_netpoll_send_skbfunction team_netpoll_send_skbfunction team_dev_queue_xmitfunction team_num_to_port_indexfunction team_get_first_port_txable_rcu
Annotated Snippet
struct team_pcpu_stats {
u64_stats_t rx_packets;
u64_stats_t rx_bytes;
u64_stats_t rx_multicast;
u64_stats_t tx_packets;
u64_stats_t tx_bytes;
struct u64_stats_sync syncp;
u32 rx_dropped;
u32 tx_dropped;
u32 rx_nohandler;
};
struct team;
struct team_port {
struct net_device *dev;
struct hlist_node tx_hlist; /* node in tx-enabled ports hash list */
struct list_head list; /* node in ordinary list */
struct team *team;
int tx_index; /* index of tx enabled port. If disabled, -1 */
bool rx_enabled;
bool linkup; /* either state.linkup or user.linkup */
struct {
bool linkup;
u32 speed;
u8 duplex;
} state;
/* Values set by userspace */
struct {
bool linkup;
bool linkup_enabled;
} user;
/* Custom gennetlink interface related flags */
bool changed;
bool removed;
/*
* A place for storing original values of the device before it
* become a port.
*/
struct {
unsigned char dev_addr[MAX_ADDR_LEN];
unsigned int mtu;
} orig;
#ifdef CONFIG_NET_POLL_CONTROLLER
struct netpoll *np;
#endif
s32 priority; /* lower number ~ higher priority */
u16 queue_id;
struct list_head qom_list; /* node in queue override mapping list */
struct rcu_head rcu;
long mode_priv[];
};
static inline struct team_port *team_port_get_rcu(const struct net_device *dev)
{
return rcu_dereference(dev->rx_handler_data);
}
static inline bool team_port_rx_enabled(struct team_port *port)
{
return READ_ONCE(port->rx_enabled);
}
static inline bool team_port_tx_enabled(struct team_port *port)
{
return READ_ONCE(port->tx_index) != -1;
}
static inline bool team_port_enabled(struct team_port *port)
{
return team_port_rx_enabled(port) && team_port_tx_enabled(port);
}
static inline bool team_port_txable(struct team_port *port)
{
return port->linkup && team_port_tx_enabled(port);
}
static inline bool team_port_dev_txable(const struct net_device *port_dev)
{
struct team_port *port;
bool txable;
Annotation
- Immediate include surface: `linux/netpoll.h`, `net/sch_generic.h`, `linux/types.h`, `uapi/linux/if_team.h`.
- Detected declarations: `struct team_pcpu_stats`, `struct team`, `struct team_port`, `struct team_mode_ops`, `struct team_option_inst_info`, `struct team_gsetter_ctx`, `struct team_option`, `struct team_mode`, `struct team`, `enum team_option_type`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.