#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/pkt_sched.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/timer.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/if_arp.h>
#include <linux/if_ether.h>
#include <linux/if_bonding.h>
#include <linux/if_vlan.h>
#include <linux/in.h>
#include <net/arp.h>
#include <net/ipv6.h>
#include <net/ndisc.h>
#include <asm/byteorder.h>
#include <net/bonding.h>
#include <net/bond_alb.h>
static const u8 mac_v6_allmcast[ETH_ALEN + 2] __long_aligned = …;
static const int alb_delta_in_ticks = …;
#pragma pack(1)
struct learning_pkt { … };
struct arp_pkt { … };
#pragma pack()
static void alb_send_learning_packets(struct slave *slave, const u8 mac_addr[],
bool strict_match);
static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp);
static void rlb_src_unlink(struct bonding *bond, u32 index);
static void rlb_src_link(struct bonding *bond, u32 ip_src_hash,
u32 ip_dst_hash);
static inline u8 _simple_hash(const u8 *hash_start, int hash_size)
{ … }
static inline void tlb_init_table_entry(struct tlb_client_info *entry, int save_load)
{ … }
static inline void tlb_init_slave(struct slave *slave)
{ … }
static void __tlb_clear_slave(struct bonding *bond, struct slave *slave,
int save_load)
{ … }
static void tlb_clear_slave(struct bonding *bond, struct slave *slave,
int save_load)
{ … }
static int tlb_initialize(struct bonding *bond)
{ … }
static void tlb_deinitialize(struct bonding *bond)
{ … }
static long long compute_gap(struct slave *slave)
{ … }
static struct slave *tlb_get_least_loaded_slave(struct bonding *bond)
{ … }
static struct slave *__tlb_choose_channel(struct bonding *bond, u32 hash_index,
u32 skb_len)
{ … }
static struct slave *tlb_choose_channel(struct bonding *bond, u32 hash_index,
u32 skb_len)
{ … }
static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
{ … }
static int rlb_arp_recv(const struct sk_buff *skb, struct bonding *bond,
struct slave *slave)
{ … }
static struct slave *__rlb_next_rx_slave(struct bonding *bond)
{ … }
static struct slave *rlb_next_rx_slave(struct bonding *bond)
{ … }
static void rlb_teach_disabled_mac_on_primary(struct bonding *bond,
const u8 addr[])
{ … }
static void rlb_clear_slave(struct bonding *bond, struct slave *slave)
{ … }
static void rlb_update_client(struct rlb_client_info *client_info)
{ … }
static void rlb_update_rx_clients(struct bonding *bond)
{ … }
static void rlb_req_update_slave_clients(struct bonding *bond, struct slave *slave)
{ … }
static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip)
{ … }
static struct slave *rlb_choose_channel(struct sk_buff *skb,
struct bonding *bond,
const struct arp_pkt *arp)
{ … }
static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
{ … }
static void rlb_rebalance(struct bonding *bond)
{ … }
static void rlb_init_table_entry_dst(struct rlb_client_info *entry)
{ … }
static void rlb_init_table_entry_src(struct rlb_client_info *entry)
{ … }
static void rlb_init_table_entry(struct rlb_client_info *entry)
{ … }
static void rlb_delete_table_entry_dst(struct bonding *bond, u32 index)
{ … }
static void rlb_src_unlink(struct bonding *bond, u32 index)
{ … }
static void rlb_delete_table_entry(struct bonding *bond, u32 index)
{ … }
static void rlb_src_link(struct bonding *bond, u32 ip_src_hash, u32 ip_dst_hash)
{ … }
static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp)
{ … }
static int rlb_initialize(struct bonding *bond)
{ … }
static void rlb_deinitialize(struct bonding *bond)
{ … }
static void rlb_clear_vlan(struct bonding *bond, unsigned short vlan_id)
{ … }
static void alb_send_lp_vid(struct slave *slave, const u8 mac_addr[],
__be16 vlan_proto, u16 vid)
{ … }
struct alb_walk_data { … };
static int alb_upper_dev_walk(struct net_device *upper,
struct netdev_nested_priv *priv)
{ … }
static void alb_send_learning_packets(struct slave *slave, const u8 mac_addr[],
bool strict_match)
{ … }
static int alb_set_slave_mac_addr(struct slave *slave, const u8 addr[],
unsigned int len)
{ … }
static void alb_swap_mac_addr(struct slave *slave1, struct slave *slave2)
{ … }
static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1,
struct slave *slave2)
{ … }
static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *slave)
{ … }
static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slave *slave)
{ … }
static int alb_set_mac_address(struct bonding *bond, void *addr)
{ … }
static bool alb_determine_nd(struct sk_buff *skb, struct bonding *bond)
{ … }
int bond_alb_initialize(struct bonding *bond, int rlb_enabled)
{ … }
void bond_alb_deinitialize(struct bonding *bond)
{ … }
static netdev_tx_t bond_do_alb_xmit(struct sk_buff *skb, struct bonding *bond,
struct slave *tx_slave)
{ … }
struct slave *bond_xmit_tlb_slave_get(struct bonding *bond,
struct sk_buff *skb)
{ … }
netdev_tx_t bond_tlb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
{ … }
struct slave *bond_xmit_alb_slave_get(struct bonding *bond,
struct sk_buff *skb)
{ … }
netdev_tx_t bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
{ … }
void bond_alb_monitor(struct work_struct *work)
{ … }
int bond_alb_init_slave(struct bonding *bond, struct slave *slave)
{ … }
void bond_alb_deinit_slave(struct bonding *bond, struct slave *slave)
{ … }
void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char link)
{ … }
void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave)
{ … }
int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
{ … }
void bond_alb_clear_vlan(struct bonding *bond, unsigned short vlan_id)
{ … }