diff options
author | Neale Ranns <nranns@cisco.com> | 2018-11-07 04:21:12 -0800 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-11-07 13:28:11 +0000 |
commit | c29c0af40eda76e382a63269bca9ff57c6ecf5d5 (patch) | |
tree | 3be3f4a3ff2047bcfe553719a0d87ae048ec1f11 /src/plugins/gbp/gbp_bridge_domain.c | |
parent | 7ac053b27fee8f9e437cf7b61357943356381061 (diff) |
GBP: Endpoints with VLAN tags and birdges that don't learn
Change-Id: I20192f3a8f4f01f47e775746f6fde7c685f185ee
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/plugins/gbp/gbp_bridge_domain.c')
-rw-r--r-- | src/plugins/gbp/gbp_bridge_domain.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/plugins/gbp/gbp_bridge_domain.c b/src/plugins/gbp/gbp_bridge_domain.c index b7812eb1645..1a1a7bd3383 100644 --- a/src/plugins/gbp/gbp_bridge_domain.c +++ b/src/plugins/gbp/gbp_bridge_domain.c @@ -31,12 +31,7 @@ gbp_bridge_domain_t *gbp_bridge_domain_pool; /** * DB of bridge_domains */ -typedef struct gbp_bridge_domain_db_t -{ - uword *gbd_by_bd_id; -} gbp_bridge_domain_db_t; - -static gbp_bridge_domain_db_t gbp_bridge_domain_db; +gbp_bridge_domain_db_t gbp_bridge_domain_db; /** * logger @@ -46,12 +41,6 @@ vlib_log_class_t gb_logger; #define GBP_BD_DBG(...) \ vlib_log_debug (gb_logger, __VA_ARGS__); -gbp_bridge_domain_t * -gbp_bridge_domain_get (index_t i) -{ - return (pool_elt_at_index (gbp_bridge_domain_pool, i)); -} - static void gbp_bridge_domain_lock (index_t i) { @@ -95,16 +84,21 @@ gbp_bridge_domain_db_add (gbp_bridge_domain_t * gb) index_t gbi = gb - gbp_bridge_domain_pool; hash_set (gbp_bridge_domain_db.gbd_by_bd_id, gb->gb_bd_id, gbi); + vec_validate_init_empty (gbp_bridge_domain_db.gbd_by_bd_index, + gb->gb_bd_index, INDEX_INVALID); + gbp_bridge_domain_db.gbd_by_bd_index[gb->gb_bd_index] = gbi; } static void gbp_bridge_domain_db_remove (gbp_bridge_domain_t * gb) { hash_unset (gbp_bridge_domain_db.gbd_by_bd_id, gb->gb_bd_id); + gbp_bridge_domain_db.gbd_by_bd_index[gb->gb_bd_index] = INDEX_INVALID; } int gbp_bridge_domain_add_and_lock (u32 bd_id, + gbp_bridge_domain_flags_t flags, u32 bvi_sw_if_index, u32 uu_fwd_sw_if_index) { gbp_bridge_domain_t *gb; @@ -134,6 +128,7 @@ gbp_bridge_domain_add_and_lock (u32 bd_id, gb->gb_uu_fwd_sw_if_index = uu_fwd_sw_if_index; gb->gb_bvi_sw_if_index = bvi_sw_if_index; gb->gb_locks = 1; + gb->gb_flags = flags; /* * Set the BVI and uu-flood interfaces into the BD @@ -269,7 +264,7 @@ gbp_bridge_domain_cli (vlib_main_t * vm, if (~0 == bvi_sw_if_index) return clib_error_return (0, "interface must be specified"); - gbp_bridge_domain_add_and_lock (bd_id, + gbp_bridge_domain_add_and_lock (bd_id, GBP_BD_FLAG_NONE, bvi_sw_if_index, uu_fwd_sw_if_index); } else |