36 memset (lacpif, 0,
sizeof (*lacpif));
41 strlen ((
const char *) hi->
name)));
46 strlen ((
const char *) hi->
name)));
66 *out_lacpifs = r_lacpifs;
84 "sw_if_index",
"bond interface",
85 "exp/def/dis/col/syn/agg/tim/act",
86 "exp/def/dis/col/syn/agg/tim/act");
88 for (i = 0; i <
vec_len (sw_if_indices); i++)
95 "%-25U %-12d %-16U %3x %3x %3x %3x %3x %3x %3x %3x " 96 "%4x %3x %3x %3x %3x %3x %3x %3x",
118 "[(%04x,%02x-%02x-%02x-%02x-%02x-%02x,%04x,%04x,%04x), " 119 "(%04x,%02x-%02x-%02x-%02x-%02x-%02x,%04x,%04x,%04x)]",
120 ntohs (sif->
actor.system_priority),
124 ntohs (sif->
actor.key),
125 ntohs (sif->
actor.port_priority),
126 ntohs (sif->
actor.port_number),
127 ntohs (sif->
partner.system_priority),
132 ntohs (sif->
partner.port_priority),
133 ntohs (sif->
partner.port_number));
135 " RX-state: %U, TX-state: %U, " 136 "MUX-state: %U, PTX-state: %U",
155 for (i = 0; i <
vec_len (sw_if_indices); i++)
171 ntohs (sif->
actor.system_priority));
174 ntohs (sif->
actor.port_priority));
176 ntohs (sif->
actor.port_number));
180 while (state_entry->
str)
182 if (sif->
actor.state & (1 << state_entry->
bit))
192 ntohs (sif->
partner.system_priority));
195 ntohs (sif->
partner.port_priority));
197 ntohs (sif->
partner.port_number));
201 while (state_entry->
str)
203 if (sif->
partner.state & (1 << state_entry->
bit))
260 else if (
unformat (input,
"details"))
270 if (
vec_len (sw_if_indices) == 0)
290 .short_help =
"show lacp [<interface>] [details]",
323 else if (
unformat (line_input,
"on"))
328 else if (
unformat (line_input,
"off"))
344 if (sw_if_index != ~0)
362 .path =
"debug lacp",
363 .short_help =
"debug lacp <interface> <on | off>",
static void show_lacp_details(vlib_main_t *vm, u32 *sw_if_indices)
vnet_main_t * vnet_get_main(void)
static f64 vlib_time_now(vlib_main_t *vm)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
int lacp_dump_ifs(lacp_interface_details_t **out_lacpifs)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
lacp_state_struct lacp_state_array[]
unformat_function_t unformat_vnet_sw_interface
u16 partner_system_priority
format_function_t format_vnet_sw_if_index_name
static clib_error_t * show_lacp_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
memset(h->entries, 0, sizeof(h->entries[0])*entries)
static u8 * format_rx_sm_state(u8 *s, va_list *args)
u8 * format_ethernet_address(u8 *s, va_list *args)
static u8 lacp_timer_is_running(f64 timer)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
#define clib_error_return(e, args...)
u16 partner_port_priority
LACP interface details struct.
u8 bond_interface_name[64]
#define vec_free(V)
Free vector's memory (no header).
static u8 * format_mux_sm_state(u8 *s, va_list *args)
#define clib_memcpy(a, b, c)
static clib_error_t * debug_lacp_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_CLI_COMMAND(x,...)
static bond_if_t * bond_get_master_by_dev_instance(u32 dev_instance)
static u8 * format_ptx_sm_state(u8 *s, va_list *args)
clib_error_t * lacp_cli_init(vlib_main_t *vm)
u16 actor_system_priority
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void show_lacp(vlib_main_t *vm, u32 *sw_if_indices)
static int lacp_bit_test(u8 val, u8 bit)
static u8 * format_tx_sm_state(u8 *s, va_list *args)
static slave_if_t * bond_get_slave_by_sw_if_index(u32 sw_if_index)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)