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",
157 for (i = 0; i <
vec_len (sw_if_indices); i++)
171 " last LACP PDU received: %10.2f seconds ago",
182 " last Marker PDU received: %10.2f seconds ago",
197 ntohs (sif->
actor.system_priority));
200 ntohs (sif->
actor.port_priority));
202 ntohs (sif->
actor.port_number));
206 while (state_entry->
str)
208 if (sif->
actor.state & (1 << state_entry->
bit))
218 ntohs (sif->
partner.system_priority));
221 ntohs (sif->
partner.port_priority));
223 ntohs (sif->
partner.port_number));
227 while (state_entry->
str)
229 if (sif->
partner.state & (1 << state_entry->
bit))
286 else if (
unformat (input,
"details"))
296 if (
vec_len (sw_if_indices) == 0)
316 .short_help =
"show lacp [<interface>] [details]",
350 else if (
unformat (line_input,
"on"))
355 else if (
unformat (line_input,
"off"))
371 if (sw_if_index != ~0)
389 .path =
"debug lacp",
390 .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)
f64 last_lacpdu_recd_time
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
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)
#define clib_memcpy(d, s, n)
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.
vl_api_interface_index_t sw_if_index
#define VLIB_INIT_FUNCTION(x)
f64 last_marker_pdu_recd_time
#define clib_error_return(e, args...)
u16 partner_port_priority
LACP interface details struct.
f64 last_marker_pdu_sent_time
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)
f64 last_lacpdu_sent_time
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,...)
u64 marker_bad_pdu_received