lacp: partner may time us out if fast-rate is configured [VPP-1247]
We should be sending LACP PDU every second if the partner has LACP_TIMEOUT flag set which means it will time us out in 3 seconds. Add interface name for lacp trace Change-Id: If7d816c062d03e80cc0dd7d10dba0b76ace0664a Signed-off-by: Steven <sluong@cisco.com>
This commit is contained in:
@@ -249,6 +249,8 @@ lacp_input_format_trace (u8 * s, va_list * args)
|
||||
u8 *p;
|
||||
lacp_state_struct *state_entry;
|
||||
|
||||
s = format (s, "%U:\n", format_vnet_sw_if_index_name, vnet_get_main (),
|
||||
t->sw_if_index);
|
||||
s = format (s, "Length: %d\n", t->len);
|
||||
if (t->len >= sizeof (lacp_pdu_t))
|
||||
{
|
||||
|
||||
@@ -101,6 +101,7 @@ lacp_node_fn (vlib_main_t * vm,
|
||||
len = (b0->current_length < sizeof (t0->pkt))
|
||||
? b0->current_length : sizeof (t0->pkt);
|
||||
t0->len = len;
|
||||
t0->sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_RX];
|
||||
clib_memcpy (&t0->pkt, vlib_buffer_get_current (b0), len);
|
||||
}
|
||||
/* push this pkt to the next graph node, always error-drop */
|
||||
|
||||
@@ -77,6 +77,7 @@ typedef enum
|
||||
/* lacp packet trace capture */
|
||||
typedef struct
|
||||
{
|
||||
u32 sw_if_index;
|
||||
u32 len;
|
||||
union
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ typedef enum
|
||||
} lacp_state_t;
|
||||
|
||||
#define foreach_lacp_state_flag \
|
||||
_(0, LACP_STATE_LACP_ACTIViTY, "activity") \
|
||||
_(0, LACP_STATE_LACP_ACTIVITY, "activity") \
|
||||
_(1, LACP_STATE_LACP_TIMEOUT, "lacp timeout") \
|
||||
_(2, LACP_STATE_AGGREGATION, "aggregation") \
|
||||
_(3, LACP_STATE_SYNCHRONIZATION, "synchronization") \
|
||||
|
||||
@@ -72,13 +72,15 @@ lacp_start_periodic_timer (vlib_main_t * vm, slave_if_t * sif, u8 expiration)
|
||||
static inline void
|
||||
lacp_schedule_periodic_timer (vlib_main_t * vm, slave_if_t * sif)
|
||||
{
|
||||
// do fast rate if we are not yet synchronized
|
||||
if (((sif->actor.state & (LACP_STATE_SYNCHRONIZATION |
|
||||
LACP_STATE_COLLECTING |
|
||||
LACP_STATE_DISTRIBUTING)) !=
|
||||
(LACP_STATE_SYNCHRONIZATION | LACP_STATE_COLLECTING |
|
||||
LACP_STATE_DISTRIBUTING))
|
||||
&& (sif->partner.state & LACP_STATE_AGGREGATION))
|
||||
// do fast rate if partner is in short timeout or
|
||||
// we are not yet synchronized
|
||||
if ((sif->partner.state & LACP_STATE_LACP_TIMEOUT) ||
|
||||
(((sif->actor.state & (LACP_STATE_SYNCHRONIZATION |
|
||||
LACP_STATE_COLLECTING |
|
||||
LACP_STATE_DISTRIBUTING)) !=
|
||||
(LACP_STATE_SYNCHRONIZATION | LACP_STATE_COLLECTING |
|
||||
LACP_STATE_DISTRIBUTING))
|
||||
&& (sif->partner.state & LACP_STATE_AGGREGATION)))
|
||||
lacp_start_periodic_timer (vm, sif, LACP_FAST_PERIODIC_TIMER);
|
||||
else
|
||||
lacp_start_periodic_timer (vm, sif, LACP_SLOW_PERIODIC_TIMER);
|
||||
|
||||
Reference in New Issue
Block a user