summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-03-04 01:14:24 -0800
committerDamjan Marion <dmarion@me.com>2019-03-04 11:16:23 +0000
commit4689da0c6104435f86fab19e6bb4d1342ce4dcaf (patch)
tree5499b3785d20f85871843c2f009b548d14ffa2aa
parent19223e03fe768df3fc995a5d38a5de9f2c5acf27 (diff)
GBP: fix and print GBP BD flags
Change-Id: If3fe2752c9339049123ff4674e3a29449b520374 Signed-off-by: Neale Ranns <nranns@cisco.com>
-rw-r--r--extras/vom/vom/gbp_bridge_domain.cpp5
-rw-r--r--extras/vom/vom/gbp_bridge_domain_cmds.cpp3
-rw-r--r--src/plugins/gbp/gbp_bridge_domain.c21
-rw-r--r--src/plugins/gbp/gbp_bridge_domain.h1
-rw-r--r--src/plugins/gbp/gbp_learn_node.c8
5 files changed, 31 insertions, 7 deletions
diff --git a/extras/vom/vom/gbp_bridge_domain.cpp b/extras/vom/vom/gbp_bridge_domain.cpp
index 78f7d8d270f..c8d42d264a3 100644
--- a/extras/vom/vom/gbp_bridge_domain.cpp
+++ b/extras/vom/vom/gbp_bridge_domain.cpp
@@ -23,7 +23,7 @@ namespace VOM {
const gbp_bridge_domain::flags_t gbp_bridge_domain::flags_t::NONE(0, "none");
const gbp_bridge_domain::flags_t gbp_bridge_domain::flags_t::DO_NOT_LEARN(
- 0,
+ 1,
"do-not-learn");
gbp_bridge_domain::flags_t::flags_t(int v, const std::string& s)
@@ -200,7 +200,8 @@ std::string
gbp_bridge_domain::to_string() const
{
std::ostringstream s;
- s << "gbp-bridge-domain:[" << m_bd->to_string();
+ s << "gbp-bridge-domain:[" << m_bd->to_string()
+ << " flags:" << m_flags.to_string();
if (m_bvi)
s << " bvi:" << m_bvi->to_string();
diff --git a/extras/vom/vom/gbp_bridge_domain_cmds.cpp b/extras/vom/vom/gbp_bridge_domain_cmds.cpp
index f5a6888b8a7..6fa8c49f9e5 100644
--- a/extras/vom/vom/gbp_bridge_domain_cmds.cpp
+++ b/extras/vom/vom/gbp_bridge_domain_cmds.cpp
@@ -65,7 +65,8 @@ create_cmd::to_string() const
{
std::ostringstream s;
s << "gbp-bridge-domain: " << m_hw_item.to_string()
- << " bvi:" << m_bvi.to_string() << " uu-fwd:" << m_uu_fwd.to_string();
+ << " flags:" << m_flags.to_string() << " bvi:" << m_bvi.to_string()
+ << " uu-fwd:" << m_uu_fwd.to_string();
return (s.str());
}
diff --git a/src/plugins/gbp/gbp_bridge_domain.c b/src/plugins/gbp/gbp_bridge_domain.c
index 049c89bebab..261b5683903 100644
--- a/src/plugins/gbp/gbp_bridge_domain.c
+++ b/src/plugins/gbp/gbp_bridge_domain.c
@@ -113,6 +113,23 @@ gbp_bridge_domain_db_remove (gbp_bridge_domain_t * gb)
gbp_bridge_domain_db.gbd_by_bd_index[gb->gb_bd_index] = INDEX_INVALID;
}
+u8 *
+format_gbp_bridge_domain_flags (u8 * s, va_list * args)
+{
+ gbp_bridge_domain_flags_t gf = va_arg (*args, gbp_bridge_domain_flags_t);
+
+ if (gf)
+ {
+ if (gf & GBP_BD_FLAG_DO_NOT_LEARN)
+ s = format (s, "do-not-learn");
+ }
+ else
+ {
+ s = format (s, "noe");
+ }
+ return (s);
+}
+
static u8 *
format_gbp_bridge_domain_ptr (u8 * s, va_list * args)
{
@@ -120,13 +137,13 @@ format_gbp_bridge_domain_ptr (u8 * s, va_list * args)
vnet_main_t *vnm = vnet_get_main ();
if (NULL != gb)
- s = format (s, "[%d] bd:[%d,%d], bvi:%U uu-flood:%U locks:%d",
+ s = format (s, "[%d] bd:[%d,%d], bvi:%U uu-flood:%U flags:%U locks:%d",
gb - gbp_bridge_domain_pool,
gb->gb_bd_id,
gb->gb_bd_index,
format_vnet_sw_if_index_name, vnm, gb->gb_bvi_sw_if_index,
format_vnet_sw_if_index_name, vnm, gb->gb_uu_fwd_sw_if_index,
- gb->gb_locks);
+ format_gbp_bridge_domain_flags, gb->gb_flags, gb->gb_locks);
else
s = format (s, "NULL");
diff --git a/src/plugins/gbp/gbp_bridge_domain.h b/src/plugins/gbp/gbp_bridge_domain.h
index 95b53dc2088..25498eee5fe 100644
--- a/src/plugins/gbp/gbp_bridge_domain.h
+++ b/src/plugins/gbp/gbp_bridge_domain.h
@@ -91,6 +91,7 @@ typedef int (*gbp_bridge_domain_cb_t) (gbp_bridge_domain_t * gb, void *ctx);
extern void gbp_bridge_domain_walk (gbp_bridge_domain_cb_t bgpe, void *ctx);
extern u8 *format_gbp_bridge_domain (u8 * s, va_list * args);
+extern u8 *format_gbp_bridge_domain_flags (u8 * s, va_list * args);
/**
* DB of bridge_domains
diff --git a/src/plugins/gbp/gbp_learn_node.c b/src/plugins/gbp/gbp_learn_node.c
index d7a70bb1991..ebb121716b2 100644
--- a/src/plugins/gbp/gbp_learn_node.c
+++ b/src/plugins/gbp/gbp_learn_node.c
@@ -162,6 +162,7 @@ typedef struct gbp_learn_l2_trace_t_
u32 throttled;
u32 epg;
u32 d_bit;
+ gbp_bridge_domain_flags_t gb_flags;
} gbp_learn_l2_trace_t;
always_inline void
@@ -317,6 +318,7 @@ VLIB_NODE_FN (gbp_learn_l2_node) (vlib_main_t * vm,
t->throttled = t0;
t->sw_if_index = sw_if_index0;
t->epg = epg0;
+ t->gb_flags = gb0->gb_flags;
t->d_bit = ! !(vnet_buffer2 (b0)->gbp.flags &
VXLAN_GBP_GPFLAGS_D);
}
@@ -341,9 +343,11 @@ format_gbp_learn_l2_trace (u8 * s, va_list * args)
CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
gbp_learn_l2_trace_t *t = va_arg (*args, gbp_learn_l2_trace_t *);
- s = format (s, "new:%d throttled:%d d-bit:%d mac:%U itf:%d epg:%d",
+ s = format (s, "new:%d throttled:%d d-bit:%d mac:%U itf:%d epg:%d"
+ " gb-flags:%U",
t->new, t->throttled, t->d_bit,
- format_mac_address_t, &t->mac, t->sw_if_index, t->epg);
+ format_mac_address_t, &t->mac, t->sw_if_index, t->epg,
+ format_gbp_bridge_domain_flags, t->gb_flags);
return s;
}