/* *INDENT-OFF* */
pool_foreach (sif, bm->neighbors,
- if ((sif->port_enabled == 0) || (sif->lacp_enabled == 0))
+ if (sif->lacp_enabled == 0)
continue;
vec_add2(r_lacpifs, lacpif, 1);
- memset (lacpif, 0, sizeof (*lacpif));
+ clib_memset (lacpif, 0, sizeof (*lacpif));
lacpif->sw_if_index = sif->sw_if_index;
hi = vnet_get_hw_interface (vnm, sif->hw_if_index);
clib_memcpy(lacpif->interface_name, hi->name,
for (i = 0; i < vec_len (sw_if_indices); i++)
{
sif = bond_get_slave_by_sw_if_index (sw_if_indices[i]);
- if (!sif || (sif->port_enabled == 0) || (sif->lacp_enabled == 0))
+ if (!sif || (sif->lacp_enabled == 0))
continue;
bif = bond_get_master_by_dev_instance (sif->bif_dev_instance);
vlib_cli_output (vm,
static void
show_lacp_details (vlib_main_t * vm, u32 * sw_if_indices)
{
+ lacp_main_t *lm = &lacp_main;
slave_if_t *sif;
lacp_state_struct *state_entry;
int i;
f64 now;
+ vlib_cli_output (vm, "Number of interfaces: %d", lm->lacp_int);
if (!sw_if_indices)
return;
for (i = 0; i < vec_len (sw_if_indices); i++)
{
sif = bond_get_slave_by_sw_if_index (sw_if_indices[i]);
- if (!sif || (sif->port_enabled == 0) || (sif->lacp_enabled == 0))
+ if (!sif || (sif->lacp_enabled == 0))
continue;
vlib_cli_output (vm, " %U", format_vnet_sw_if_index_name,
vnet_get_main (), sif->sw_if_index);
+ vlib_cli_output (vm, " Good LACP PDUs received: %llu",
+ sif->pdu_received);
+ vlib_cli_output (vm, " Bad LACP PDUs received: %llu",
+ sif->bad_pdu_received);
+ vlib_cli_output (vm, " LACP PDUs sent: %llu", sif->pdu_sent);
+ if (lacp_timer_is_running (sif->last_lacpdu_recd_time))
+ vlib_cli_output (vm,
+ " last LACP PDU received: %10.2f seconds ago",
+ now - sif->last_lacpdu_recd_time);
+ if (lacp_timer_is_running (sif->last_lacpdu_sent_time))
+ vlib_cli_output (vm, " last LACP PDU sent: %10.2f seconds ago",
+ now - sif->last_lacpdu_sent_time);
+ vlib_cli_output (vm, " Good Marker PDUs received: %llu",
+ sif->marker_pdu_received);
+ vlib_cli_output (vm, " Bad Marker PDUs received: %llu",
+ sif->marker_bad_pdu_received);
+ if (lacp_timer_is_running (sif->last_marker_pdu_recd_time))
+ vlib_cli_output (vm,
+ " last Marker PDU received: %10.2f seconds ago",
+ now - sif->last_marker_pdu_recd_time);
+ if (lacp_timer_is_running (sif->last_marker_pdu_sent_time))
+ vlib_cli_output (vm, " last Marker PDU sent: %10.2f seconds ago",
+ now - sif->last_marker_pdu_sent_time);
vlib_cli_output (vm, " debug: %d", sif->debug);
vlib_cli_output (vm, " loopback port: %d", sif->loopback_port);
+ vlib_cli_output (vm, " port_enabled: %d", sif->port_enabled);
vlib_cli_output (vm, " port moved: %d", sif->port_moved);
vlib_cli_output (vm, " ready_n: %d", sif->ready_n);
vlib_cli_output (vm, " ready: %d", sif->ready);
if (!lacp_timer_is_running (sif->wait_while_timer))
vlib_cli_output (vm, " wait while timer: not running");
else
- vlib_cli_output (vm, " wait while timer: %=10.2f seconds",
+ vlib_cli_output (vm, " wait while timer: %10.2f seconds",
sif->wait_while_timer - now);
if (!lacp_timer_is_running (sif->current_while_timer))
vlib_cli_output (vm, " current while timer: not running");
else
- vlib_cli_output (vm, " current while timer: %=10.2f seconds",
+ vlib_cli_output (vm, " current while timer: %10.2f seconds",
sif->current_while_timer - now);
if (!lacp_timer_is_running (sif->periodic_timer))
vlib_cli_output (vm, " periodic timer: not running");
else
- vlib_cli_output (vm, " periodic timer: %=10.2f seconds",
+ vlib_cli_output (vm, " periodic timer: %10.2f seconds",
sif->periodic_timer - now);
vlib_cli_output (vm, " RX-state: %U", format_rx_sm_state,
sif->rx_state);
slave_if_t *sif;
clib_error_t *error = 0;
u8 details = 0;
- u32 hw_if_index, *sw_if_indices = 0;
- vnet_interface_main_t *im = &vnm->interface_main;
- vnet_sw_interface_t *sw;
+ u32 sw_if_index, *sw_if_indices = 0;
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
if (unformat
- (input, "%U", unformat_vnet_hw_interface, vnm, &hw_if_index))
+ (input, "%U", unformat_vnet_sw_interface, vnm, &sw_if_index))
{
- sw = pool_elt_at_index (im->sw_interfaces, hw_if_index);
- sif = bond_get_slave_by_sw_if_index (sw->sw_if_index);
+ sif = bond_get_slave_by_sw_if_index (sw_if_index);
if (!sif)
{
error = clib_error_return (0, "interface is not enslaved");
.path = "show lacp",
.short_help = "show lacp [<interface>] [details]",
.function = show_lacp_fn,
+ .is_mp_safe = 1,
};
/* *INDENT-ON* */
lacp_main_t *lm = &lacp_main;
u8 onoff = 0;
u8 input_found = 0;
- u32 hw_if_index = ~0;
+ u32 sw_if_index = ~0;
slave_if_t *sif;
vnet_main_t *vnm = vnet_get_main ();
- vnet_interface_main_t *im = &vnm->interface_main;
- vnet_sw_interface_t *sw;
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
if (unformat (line_input, "%U",
- unformat_vnet_hw_interface, vnm, &hw_if_index))
+ unformat_vnet_sw_interface, vnm, &sw_if_index))
;
if (input_found)
{
if (!input_found)
return clib_error_return (0, "must specify on or off");
- if (hw_if_index != ~0)
+ if (sw_if_index != ~0)
{
- sw = pool_elt_at_index (im->sw_interfaces, hw_if_index);
- sif = bond_get_slave_by_sw_if_index (sw->sw_if_index);
+ sif = bond_get_slave_by_sw_if_index (sw_if_index);
if (!sif)
return (clib_error_return (0, "Please enslave the interface first"));
sif->debug = onoff;