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.

Dependency Surface

Detected Declarations

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

Implementation Notes