#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/filter.h>
#include <linux/if_team.h>
static rx_handler_result_t lb_receive(struct team *team, struct team_port *port,
struct sk_buff *skb)
{ … }
struct lb_priv;
lb_select_tx_port_func_t;
#define LB_TX_HASHTABLE_SIZE …
struct lb_stats { … };
struct lb_pcpu_stats { … };
struct lb_stats_info { … };
struct lb_port_mapping { … };
struct lb_priv_ex { … };
struct lb_priv { … };
static struct lb_priv *get_lb_priv(struct team *team)
{ … }
struct lb_port_priv { … };
static struct lb_port_priv *get_lb_port_priv(struct team_port *port)
{ … }
#define LB_HTPM_PORT_BY_HASH(lp_priv, hash) …
#define LB_HTPM_OPT_INST_INFO_BY_HASH(lp_priv, hash) …
static void lb_tx_hash_to_port_mapping_null_port(struct team *team,
struct team_port *port)
{ … }
static struct team_port *lb_hash_select_tx_port(struct team *team,
unsigned char hash)
{ … }
static struct team_port *lb_htpm_select_tx_port(struct team *team,
unsigned char hash)
{ … }
struct lb_select_tx_port { … };
static const struct lb_select_tx_port lb_select_tx_port_list[] = …;
#define LB_SELECT_TX_PORT_LIST_COUNT …
static char *lb_select_tx_port_get_name(lb_select_tx_port_func_t *func)
{ … }
static lb_select_tx_port_func_t *lb_select_tx_port_get_func(const char *name)
{ … }
static unsigned int lb_get_skb_hash(struct lb_priv *lb_priv,
struct sk_buff *skb)
{ … }
static void lb_update_tx_stats(unsigned int tx_bytes, struct lb_priv *lb_priv,
struct lb_port_priv *lb_port_priv,
unsigned char hash)
{ … }
static bool lb_transmit(struct team *team, struct sk_buff *skb)
{ … }
static void lb_bpf_func_get(struct team *team, struct team_gsetter_ctx *ctx)
{ … }
static int __fprog_create(struct sock_fprog_kern **pfprog, u32 data_len,
const void *data)
{ … }
static void __fprog_destroy(struct sock_fprog_kern *fprog)
{ … }
static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx)
{ … }
static void lb_bpf_func_free(struct team *team)
{ … }
static void lb_tx_method_get(struct team *team, struct team_gsetter_ctx *ctx)
{ … }
static int lb_tx_method_set(struct team *team, struct team_gsetter_ctx *ctx)
{ … }
static void lb_tx_hash_to_port_mapping_init(struct team *team,
struct team_option_inst_info *info)
{ … }
static void lb_tx_hash_to_port_mapping_get(struct team *team,
struct team_gsetter_ctx *ctx)
{ … }
static int lb_tx_hash_to_port_mapping_set(struct team *team,
struct team_gsetter_ctx *ctx)
{ … }
static void lb_hash_stats_init(struct team *team,
struct team_option_inst_info *info)
{ … }
static void lb_hash_stats_get(struct team *team, struct team_gsetter_ctx *ctx)
{ … }
static void lb_port_stats_init(struct team *team,
struct team_option_inst_info *info)
{ … }
static void lb_port_stats_get(struct team *team, struct team_gsetter_ctx *ctx)
{ … }
static void __lb_stats_info_refresh_prepare(struct lb_stats_info *s_info)
{ … }
static bool __lb_stats_info_refresh_check(struct lb_stats_info *s_info,
struct team *team)
{ … }
static void __lb_one_cpu_stats_add(struct lb_stats *acc_stats,
struct lb_stats *cpu_stats,
struct u64_stats_sync *syncp)
{ … }
static void lb_stats_refresh(struct work_struct *work)
{ … }
static void lb_stats_refresh_interval_get(struct team *team,
struct team_gsetter_ctx *ctx)
{ … }
static int lb_stats_refresh_interval_set(struct team *team,
struct team_gsetter_ctx *ctx)
{ … }
static const struct team_option lb_options[] = …;
static int lb_init(struct team *team)
{ … }
static void lb_exit(struct team *team)
{ … }
static int lb_port_enter(struct team *team, struct team_port *port)
{ … }
static void lb_port_leave(struct team *team, struct team_port *port)
{ … }
static void lb_port_disabled(struct team *team, struct team_port *port)
{ … }
static const struct team_mode_ops lb_mode_ops = …;
static const struct team_mode lb_mode = …;
static int __init lb_init_module(void)
{ … }
static void __exit lb_cleanup_module(void)
{ … }
module_init(…) …;
module_exit(lb_cleanup_module);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS_TEAM_MODE(…) …;