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>",
vnet_main_t * vnet_get_main(void)
static void show_lacp_details(vlib_main_t *vm, u32 *sw_if_indices)
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)
#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.
unformat_function_t unformat_vnet_sw_interface
u16 partner_system_priority
format_function_t format_vnet_sw_if_index_name
int lacp_dump_ifs(lacp_interface_details_t **out_lacpifs)
#define clib_memcpy(d, s, n)
static void show_lacp(vlib_main_t *vm, u32 *sw_if_indices)
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)
static clib_error_t * debug_lacp_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
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]
sll srl srl sll sra u16x4 i
#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
#define VLIB_CLI_COMMAND(x,...)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static bond_if_t * bond_get_master_by_dev_instance(u32 dev_instance)
static u8 * format_ptx_sm_state(u8 *s, va_list *args)
u16 actor_system_priority
static clib_error_t * show_lacp_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
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)
lacp_state_struct lacp_state_array[]
clib_error_t * lacp_cli_init(vlib_main_t *vm)
u64 marker_bad_pdu_received