aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2018-04-19 21:59:09 -0700
committerChris Luke <chris_luke@comcast.com>2018-04-23 18:33:59 +0000
commitb2ffc697570f17f413fb4f2748760c44f8f21661 (patch)
treeed685d9d8be0a735625d102ffe1502f6c02be511 /src/plugins
parent62166004a9f0861e9ea50101b2194881ef1a35aa (diff)
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>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lacp/input.c2
-rw-r--r--src/plugins/lacp/node.c1
-rw-r--r--src/plugins/lacp/node.h1
-rw-r--r--src/plugins/lacp/protocol.h2
-rw-r--r--src/plugins/lacp/ptx_machine.h16
5 files changed, 14 insertions, 8 deletions
diff --git a/src/plugins/lacp/input.c b/src/plugins/lacp/input.c
index 45db3b8455b..9b1f3b68abf 100644
--- a/src/plugins/lacp/input.c
+++ b/src/plugins/lacp/input.c
@@ -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))
{
diff --git a/src/plugins/lacp/node.c b/src/plugins/lacp/node.c
index 8eb78876461..447e85fd373 100644
--- a/src/plugins/lacp/node.c
+++ b/src/plugins/lacp/node.c
@@ -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 */
diff --git a/src/plugins/lacp/node.h b/src/plugins/lacp/node.h
index 26cf7a36ccc..ebc6704eb56 100644
--- a/src/plugins/lacp/node.h
+++ b/src/plugins/lacp/node.h
@@ -77,6 +77,7 @@ typedef enum
/* lacp packet trace capture */
typedef struct
{
+ u32 sw_if_index;
u32 len;
union
{
diff --git a/src/plugins/lacp/protocol.h b/src/plugins/lacp/protocol.h
index 05a3f04a227..9fc2f35fd38 100644
--- a/src/plugins/lacp/protocol.h
+++ b/src/plugins/lacp/protocol.h
@@ -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") \
diff --git a/src/plugins/lacp/ptx_machine.h b/src/plugins/lacp/ptx_machine.h
index 6183b633ae1..9b4f2805ee4 100644
--- a/src/plugins/lacp/ptx_machine.h
+++ b/src/plugins/lacp/ptx_machine.h
@@ -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);