From c5c77ae50a2483fc3d7dbdb495d55f8a4f0aba5a Mon Sep 17 00:00:00 2001 From: John Lo Date: Tue, 3 Oct 2017 17:39:00 -0400 Subject: Update L2FIB entry timestamp only if BD aging enabled (VPP-1002) Change L2 learning path so it update stale timestamp in MAC entry only if aging is enabled on the BD for the MAC entry. Change-Id: I849154fe7ad2c6c68d6a94a66ca9345f6a98bc07 Signed-off-by: John Lo --- src/vnet/buffer.h | 1 + src/vnet/l2/l2_input.c | 1 + src/vnet/l2/l2_learn.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h index 9aba34da930..8d414fcec1e 100644 --- a/src/vnet/buffer.h +++ b/src/vnet/buffer.h @@ -177,6 +177,7 @@ typedef struct u8 l2_len; /* ethernet header length */ u8 shg; /* split-horizon group */ u16 l2fib_sn; /* l2fib bd/int seq_num */ + u8 bd_age; /* aging enabled */ } l2; /* l2tpv3 softwire encap, only valid there */ diff --git a/src/vnet/l2/l2_input.c b/src/vnet/l2/l2_input.c index 9a3148c533a..c32f0352c0a 100644 --- a/src/vnet/l2/l2_input.c +++ b/src/vnet/l2/l2_input.c @@ -210,6 +210,7 @@ classify_and_dispatch (vlib_main_t * vm, }; /* *INDENT-ON* */ vnet_buffer (b0)->l2.l2fib_sn = sn.as_u16;; + vnet_buffer (b0)->l2.bd_age = bd_config->mac_age; /* * Process bridge domain feature enables. diff --git a/src/vnet/l2/l2_learn.c b/src/vnet/l2/l2_learn.c index 488ea1ad992..1b86310c016 100644 --- a/src/vnet/l2/l2_learn.c +++ b/src/vnet/l2/l2_learn.c @@ -136,7 +136,7 @@ l2learn_process (vlib_node_runtime_t * node, /* Entry in L2FIB with matching sw_if_index matched - normal fast path */ u32 dtime = timestamp - result0->fields.timestamp; u32 dsn = result0->fields.sn.as_u16 - vnet_buffer (b0)->l2.l2fib_sn; - u32 check = dtime | dsn; + u32 check = (dtime && vnet_buffer (b0)->l2.bd_age) || dsn; if (PREDICT_TRUE (check == 0)) return; -- cgit 1.2.3-korg