aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_bd.c
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-04-09 01:53:01 -0700
committerJohn Lo <loj@cisco.com>2018-04-09 17:34:09 +0000
commit87dad11c8717735479e57cf6c065c7a7963c3aa3 (patch)
tree6fd6d9d49e0c3f2daa322afcadd9d6d3a62651fe /src/vnet/l2/l2_bd.c
parent72d2c4f3718ba5293e9e0fa8726406ee7d9f3940 (diff)
L2: no-flood interface type in the Bridge-Domain
Change-Id: I50ff0cacf88182f8e0be19840c50f4954de586e2 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vnet/l2/l2_bd.c')
-rw-r--r--src/vnet/l2/l2_bd.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/vnet/l2/l2_bd.c b/src/vnet/l2/l2_bd.c
index b1abb4c0fba..7c8aef1df65 100644
--- a/src/vnet/l2/l2_bd.c
+++ b/src/vnet/l2/l2_bd.c
@@ -128,38 +128,46 @@ bd_delete (bd_main_t * bdm, u32 bd_index)
static void
update_flood_count (l2_bridge_domain_t * bd_config)
{
- bd_config->flood_count = vec_len (bd_config->members) -
- (bd_config->tun_master_count ? bd_config->tun_normal_count : 0);
+ bd_config->flood_count = (vec_len (bd_config->members) -
+ (bd_config->tun_master_count ?
+ bd_config->tun_normal_count : 0));
+ bd_config->flood_count -= bd_config->no_flood_count;
}
void
bd_add_member (l2_bridge_domain_t * bd_config, l2_flood_member_t * member)
{
- u32 ix;
+ u32 ix = 0;
vnet_sw_interface_t *sw_if = vnet_get_sw_interface
(vnet_get_main (), member->sw_if_index);
/*
* Add one element to the vector
- * vector is ordered [ bvi, normal/tun_masters..., tun_normals... ]
+ * vector is ordered [ bvi, normal/tun_masters..., tun_normals... no_flood]
* When flooding, the bvi interface (if present) must be the last member
* processed due to how BVI processing can change the packet. To enable
* this order, we make the bvi interface the first in the vector and
- * flooding walks the vector in reverse.
+ * flooding walks the vector in reverse. The flood-count determines where
+ * in the member list to start the walk from.
*/
switch (sw_if->flood_class)
{
+ case VNET_FLOOD_CLASS_NO_FLOOD:
+ bd_config->no_flood_count++;
+ ix = vec_len (bd_config->members);
+ break;
+ case VNET_FLOOD_CLASS_BVI:
+ ix = 0;
+ break;
case VNET_FLOOD_CLASS_TUNNEL_MASTER:
bd_config->tun_master_count++;
/* Fall through */
- default:
- /* Fall through */
case VNET_FLOOD_CLASS_NORMAL:
- ix = (member->flags & L2_FLOOD_MEMBER_BVI) ? 0 :
- vec_len (bd_config->members) - bd_config->tun_normal_count;
+ ix = (vec_len (bd_config->members) -
+ bd_config->tun_normal_count - bd_config->no_flood_count);
break;
case VNET_FLOOD_CLASS_TUNNEL_NORMAL:
- ix = vec_len (bd_config->members);
+ ix = (vec_len (bd_config->members) - bd_config->no_flood_count);
bd_config->tun_normal_count++;
break;
}