diff options
author | 2017-03-24 20:11:15 -0400 | |
---|---|---|
committer | 2017-03-28 22:36:13 +0000 | |
commit | 58f061dca4cb049410a72bb21a9643f7acffa738 (patch) | |
tree | 3871125ca8e4df0809f06e9fad66badce823d78f /src/vnet/l2/l2_learn.c | |
parent | 45e526f36fb43f0b2c86d136ab563a3c5c412546 (diff) |
Implement MAC Flush for BD or Interface from the L2FIB
Allow non-static MACs in the L2FIB which is associated with an
interface or a bridge domain (BD) be flushed. MAC flush are
initiated automatically when an interface is removed from a BD
or when a BD is deleted. MAC flush can also be invoked manually
via the following CLI:
l2fib mac-flush interface <if-name>
l2fib mac-flush bridge-domain <bd-id>
Change-Id: Ie33243622834810a765f48ebcd22bdb8e8fc87a4
Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vnet/l2/l2_learn.c')
-rw-r--r-- | src/vnet/l2/l2_learn.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vnet/l2/l2_learn.c b/src/vnet/l2/l2_learn.c index afe7f478f8c..faed0d6609d 100644 --- a/src/vnet/l2/l2_learn.c +++ b/src/vnet/l2/l2_learn.c @@ -140,7 +140,11 @@ l2learn_process (vlib_node_runtime_t * node, counter_base[L2LEARN_ERROR_HIT] += 1; if (PREDICT_FALSE (result0->fields.timestamp != timestamp)) result0->fields.timestamp = timestamp; - + if (PREDICT_FALSE + (result0->fields.int_sn != vnet_buffer (b0)->l2.int_sn)) + result0->fields.int_sn = vnet_buffer (b0)->l2.int_sn; + if (PREDICT_FALSE (result0->fields.bd_sn != vnet_buffer (b0)->l2.bd_sn)) + result0->fields.bd_sn = vnet_buffer (b0)->l2.bd_sn; } else if (result0->raw == ~0) { @@ -167,6 +171,8 @@ l2learn_process (vlib_node_runtime_t * node, result0->raw = 0; /* clear all fields */ result0->fields.sw_if_index = sw_if_index0; result0->fields.timestamp = timestamp; + result0->fields.bd_sn = vnet_buffer (b0)->l2.bd_sn; + result0->fields.int_sn = vnet_buffer (b0)->l2.int_sn; kv.key = key0->raw; kv.value = result0->raw; @@ -204,6 +210,8 @@ l2learn_process (vlib_node_runtime_t * node, result0->raw = 0; /* clear all fields */ result0->fields.sw_if_index = sw_if_index0; result0->fields.timestamp = timestamp; + result0->fields.bd_sn = vnet_buffer (b0)->l2.bd_sn; + result0->fields.int_sn = vnet_buffer (b0)->l2.int_sn; kv.key = key0->raw; kv.value = result0->raw; |