15 #ifndef __included_vnet_bonding_node_h__ 16 #define __included_vnet_bonding_node_h__ 25 #define LACP_FAST_PERIODIC_TIMER 1.0 26 #define LACP_SHORT_TIMOUT_TIME (LACP_FAST_PERIODIC_TIMER * 3) 27 #define LACP_SLOW_PERIODIC_TIMER 30.0 28 #define LACP_LONG_TIMOUT_TIME (LACP_SLOW_PERIODIC_TIMER * 3) 31 #define MIN(x,y) (((x)<(y))?(x):(y)) 34 #define BOND_MODULO_SHORTCUT(a) \ 37 #define foreach_bond_mode \ 38 _ (1, ROUND_ROBIN, "round-robin") \ 39 _ (2, ACTIVE_BACKUP, "active-backup") \ 41 _ (4, BROADCAST, "broadcast") \ 46 #define _(v, f, s) BOND_MODE_##f = v, 52 #define foreach_bond_lb \ 53 _ (2, L23, "l23", l23) \ 54 _ (1, L34 , "l34", l34) \ 58 #define foreach_bond_lb_algo \ 60 _ (1, L34 , "l34", l34) \ 61 _ (2, L23, "l23", l23) \ 62 _ (3, RR, "round-robin", round_robin) \ 63 _ (4, BC, "broadcast", broadcast) \ 64 _ (5, AB, "active-backup", active_backup) 68 #define _(v, f, s, p) BOND_LB_##f = v, 128 u8 interface_name[64];
140 u8 interface_name[64];
215 u8 persistent_hw_address[6];
258 lacp_port_info_t actor;
426 u32 bond_sw_if_index);
431 u8 *r = va_arg (*args,
u8 *);
434 #define _(v, f, s) else if (unformat (input, s)) *r = BOND_MODE_##f; 451 #define _(v, f, s) case BOND_MODE_##f: t = (u8 *) s; break; 455 return format (s,
"unknown");
457 return format (s,
"%s", t);
463 u8 *r = va_arg (*args,
u8 *);
466 #define _(v, f, s, p) else if (unformat (input, s)) *r = BOND_LB_##f; 483 #define _(v, f, s, p) case BOND_LB_##f: t = (u8 *) s; break; 487 return format (s,
"unknown");
489 return format (s,
"%s", t);
void bond_set_intf_weight(vlib_main_t *vm, bond_set_intf_weight_args_t *args)
static uword unformat_bond_mode(unformat_input_t *input, va_list *args)
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
u8 last_packet_signature_valid
f64 last_lacpdu_recd_time
static bond_if_t * bond_get_master_by_sw_if_index(u32 sw_if_index)
void(* lacp_enable_disable_func)(vlib_main_t *vm, bond_if_t *bif, slave_if_t *sif, u8 enable)
lacp_enable_disable_func lacp_enable_disable
struct _vnet_device_class vnet_device_class_t
bond_per_thread_data_t * per_thread_data
u32(* load_balance_func)(vlib_main_t *vm, vlib_node_runtime_t *node, bond_if_t *bif, vlib_buffer_t *b0, uword slave_count)
static void bond_register_callback(lacp_enable_disable_func func)
vl_api_interface_index_t sw_if_index
f64 last_marker_pdu_recd_time
void bond_create_if(vlib_main_t *vm, bond_create_if_args_t *args)
vnet_device_class_t bond_dev_class
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
int bond_delete_if(vlib_main_t *vm, u32 sw_if_index)
f64 last_marker_pdu_sent_time
static uword unformat_bond_load_balance(unformat_input_t *input, va_list *args)
vlib_node_registration_t bond_input_node
(constructor) VLIB_REGISTER_NODE (bond_input_node)
uword * bond_by_sw_if_index
ethernet_header_t ethernet
void bond_detach_slave(vlib_main_t *vm, bond_detach_slave_args_t *args)
f64 last_lacpdu_sent_time
BOND interface details struct.
vlib_main_t vlib_node_runtime_t * node
#define foreach_bond_lb_algo
void bond_enable_collecting_distributing(vlib_main_t *vm, slave_if_t *sif)
typedef CLIB_PACKED(struct { u16 system_priority;u8 system[6];u16 key;u16 port_priority;u16 port_number;u8 state;}) lacp_port_info_t
uword * slave_by_sw_if_index
static bond_if_t * bond_get_master_by_dev_instance(u32 dev_instance)
bond_send_garp_na_process_event_t
int bond_dump_ifs(bond_interface_details_t **out_bondids)
struct _vlib_node_registration vlib_node_registration_t
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u8 * format_bond_interface_name(u8 *s, va_list *args)
VLIB buffer representation.
uword * port_number_bitmap
lacp_port_info_t partner_admin
static u8 * format_bond_mode(u8 *s, va_list *args)
slave interface details struct
#define foreach_bond_mode
void bond_disable_collecting_distributing(vlib_main_t *vm, slave_if_t *sif)
vl_api_dhcp_client_state_t state
static u8 * format_bond_load_balance(u8 *s, va_list *args)
vlib_node_registration_t bond_process_node
(constructor) VLIB_REGISTER_NODE (bond_process_node)
static slave_if_t * bond_get_slave_by_sw_if_index(u32 sw_if_index)
void bond_enslave(vlib_main_t *vm, bond_enslave_args_t *args)
lacp_port_info_t actor_admin
uword last_packet_signature
int bond_dump_slave_ifs(slave_interface_details_t **out_slaveids, u32 bond_sw_if_index)
load_balance_func load_balance
u64 marker_bad_pdu_received
bond_per_port_queue_t * per_port_queue