aboutsummaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-01-21 23:34:18 -0800
committerDamjan Marion <dmarion@me.com>2019-01-22 14:37:51 +0000
commit879d11c250a4710759ddefe22afd7fc05bda2946 (patch)
tree86f1984cf7324e05d8b100f9201ea69df83edc56 /extras
parent03ae24b97498bcc9265d4650efe3ddaa5e1d3255 (diff)
GBP: Sclass to src-epg conversions
Change-Id: Ica88268fd6a6ee01da7e9219bb4e81f22ed2fd4b Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'extras')
-rw-r--r--extras/vom/vom/gbp_bridge_domain.cpp34
-rw-r--r--extras/vom/vom/gbp_bridge_domain.hpp4
-rw-r--r--extras/vom/vom/gbp_bridge_domain_cmds.cpp5
-rw-r--r--extras/vom/vom/gbp_bridge_domain_cmds.hpp2
-rw-r--r--extras/vom/vom/gbp_endpoint_group.cpp48
-rw-r--r--extras/vom/vom/gbp_endpoint_group.hpp14
-rw-r--r--extras/vom/vom/gbp_endpoint_group_cmds.cpp3
-rw-r--r--extras/vom/vom/gbp_endpoint_group_cmds.hpp2
8 files changed, 96 insertions, 16 deletions
diff --git a/extras/vom/vom/gbp_bridge_domain.cpp b/extras/vom/vom/gbp_bridge_domain.cpp
index 101209fc2c7..e370a6abb0c 100644
--- a/extras/vom/vom/gbp_bridge_domain.cpp
+++ b/extras/vom/vom/gbp_bridge_domain.cpp
@@ -47,6 +47,8 @@ gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd,
: m_id(bd.id())
, m_bd(bd.singular())
, m_bvi(bvi.singular())
+ , m_uu_fwd()
+ , m_bm_flood()
, m_flags(flags)
{
}
@@ -54,11 +56,13 @@ gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd,
gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd,
const interface& bvi,
const interface& uu_fwd,
+ const interface& bm_flood,
const flags_t& flags)
: m_id(bd.id())
, m_bd(bd.singular())
, m_bvi(bvi.singular())
, m_uu_fwd(uu_fwd.singular())
+ , m_bm_flood(bm_flood.singular())
, m_flags(flags)
{
}
@@ -66,11 +70,13 @@ gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd,
gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd,
const std::shared_ptr<interface> bvi,
const std::shared_ptr<interface> uu_fwd,
+ const std::shared_ptr<interface> bm_flood,
const flags_t& flags)
: m_id(bd.id())
, m_bd(bd.singular())
- , m_bvi(bvi->singular())
- , m_uu_fwd(uu_fwd->singular())
+ , m_bvi(bvi)
+ , m_uu_fwd(uu_fwd)
+ , m_bm_flood(bm_flood)
, m_flags(flags)
{
}
@@ -78,11 +84,13 @@ gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd,
gbp_bridge_domain::gbp_bridge_domain(const bridge_domain& bd,
const interface& bvi,
const std::shared_ptr<interface> uu_fwd,
+ const std::shared_ptr<interface> bm_flood,
const flags_t& flags)
: m_id(bd.id())
, m_bd(bd.singular())
, m_bvi(bvi.singular())
- , m_uu_fwd(uu_fwd->singular())
+ , m_uu_fwd(uu_fwd)
+ , m_bm_flood(bm_flood)
, m_flags(flags)
{
}
@@ -92,6 +100,7 @@ gbp_bridge_domain::gbp_bridge_domain(const gbp_bridge_domain& bd)
, m_bd(bd.m_bd)
, m_bvi(bd.m_bvi)
, m_uu_fwd(bd.m_uu_fwd)
+ , m_bm_flood(bd.m_bm_flood)
, m_flags(bd.m_flags)
{
}
@@ -139,6 +148,13 @@ gbp_bridge_domain::operator==(const gbp_bridge_domain& b) const
else
equal = false;
+ if (m_bm_flood && b.m_bm_flood)
+ equal &= (m_bm_flood->key() == b.m_bm_flood->key());
+ else if (!m_bm_flood && !b.m_bm_flood)
+ ;
+ else
+ equal = false;
+
return ((m_bd->key() == b.m_bd->key()) && equal);
}
@@ -157,7 +173,8 @@ gbp_bridge_domain::replay()
if (rc_t::OK == m_id.rc()) {
HW::enqueue(new gbp_bridge_domain_cmds::create_cmd(
m_id, (m_bvi ? m_bvi->handle() : handle_t::INVALID),
- (m_uu_fwd ? m_uu_fwd->handle() : handle_t::INVALID), m_flags));
+ (m_uu_fwd ? m_uu_fwd->handle() : handle_t::INVALID),
+ (m_bm_flood ? m_bm_flood->handle() : handle_t::INVALID), m_flags));
}
}
@@ -200,7 +217,8 @@ gbp_bridge_domain::update(const gbp_bridge_domain& desired)
if (rc_t::OK != m_id.rc()) {
HW::enqueue(new gbp_bridge_domain_cmds::create_cmd(
m_id, (m_bvi ? m_bvi->handle() : handle_t::INVALID),
- (m_uu_fwd ? m_uu_fwd->handle() : handle_t::INVALID), m_flags));
+ (m_uu_fwd ? m_uu_fwd->handle() : handle_t::INVALID),
+ (m_bm_flood ? m_bm_flood->handle() : handle_t::INVALID), m_flags));
}
}
@@ -239,11 +257,13 @@ gbp_bridge_domain::event_handler::handle_populate(const client_db::key_t& key)
std::shared_ptr<interface> uu_fwd =
interface::find(payload.bd.uu_fwd_sw_if_index);
+ std::shared_ptr<interface> bm_flood =
+ interface::find(payload.bd.bm_flood_sw_if_index);
std::shared_ptr<interface> bvi =
interface::find(payload.bd.bvi_sw_if_index);
- if (uu_fwd && bvi) {
- gbp_bridge_domain bd(payload.bd.bd_id, bvi, uu_fwd);
+ if (uu_fwd && bm_flood && bvi) {
+ gbp_bridge_domain bd(payload.bd.bd_id, bvi, uu_fwd, bm_flood);
OM::commit(key, bd);
VOM_LOG(log_level_t::DEBUG) << "dump: " << bd.to_string();
} else if (bvi) {
diff --git a/extras/vom/vom/gbp_bridge_domain.hpp b/extras/vom/vom/gbp_bridge_domain.hpp
index 3fcb24cf07b..2c470aa3a6e 100644
--- a/extras/vom/vom/gbp_bridge_domain.hpp
+++ b/extras/vom/vom/gbp_bridge_domain.hpp
@@ -55,14 +55,17 @@ public:
gbp_bridge_domain(const bridge_domain& bd,
const interface& bvi,
const interface& uu_fwd,
+ const interface& bm_flood,
const flags_t& flags = flags_t::NONE);
gbp_bridge_domain(const bridge_domain& bd,
const std::shared_ptr<interface> bvi,
const std::shared_ptr<interface> uu_fwd,
+ const std::shared_ptr<interface> bm_flood,
const flags_t& flags = flags_t::NONE);
gbp_bridge_domain(const bridge_domain& bd,
const interface& bvi,
const std::shared_ptr<interface> uu_fwd,
+ const std::shared_ptr<interface> bm_flood,
const flags_t& flags = flags_t::NONE);
/**
@@ -188,6 +191,7 @@ private:
std::shared_ptr<bridge_domain> m_bd;
std::shared_ptr<interface> m_bvi;
std::shared_ptr<interface> m_uu_fwd;
+ std::shared_ptr<interface> m_bm_flood;
const flags_t& m_flags;
/**
diff --git a/extras/vom/vom/gbp_bridge_domain_cmds.cpp b/extras/vom/vom/gbp_bridge_domain_cmds.cpp
index 8fc5250f192..f5a6888b8a7 100644
--- a/extras/vom/vom/gbp_bridge_domain_cmds.cpp
+++ b/extras/vom/vom/gbp_bridge_domain_cmds.cpp
@@ -21,10 +21,12 @@ namespace gbp_bridge_domain_cmds {
create_cmd::create_cmd(HW::item<uint32_t>& item,
const handle_t bvi,
const handle_t uu_fwd,
+ const handle_t bm_flood,
const gbp_bridge_domain::flags_t& flags)
: rpc_cmd(item)
, m_bvi(bvi)
, m_uu_fwd(uu_fwd)
+ , m_bm_flood(bm_flood)
, m_flags(flags)
{
}
@@ -34,7 +36,7 @@ create_cmd::operator==(const create_cmd& other) const
{
return ((m_hw_item.data() == other.m_hw_item.data()) &&
(m_bvi == other.m_bvi) && (m_uu_fwd == other.m_uu_fwd) &&
- (m_flags == other.m_flags));
+ (m_bm_flood == other.m_bm_flood) && (m_flags == other.m_flags));
}
rc_t
@@ -47,6 +49,7 @@ create_cmd::issue(connection& con)
payload.bd.bd_id = m_hw_item.data();
payload.bd.bvi_sw_if_index = m_bvi.value();
payload.bd.uu_fwd_sw_if_index = m_uu_fwd.value();
+ payload.bd.bm_flood_sw_if_index = m_bm_flood.value();
payload.bd.flags = GBP_BD_API_FLAG_NONE;
if (gbp_bridge_domain::flags_t::DO_NOT_LEARN == m_flags)
diff --git a/extras/vom/vom/gbp_bridge_domain_cmds.hpp b/extras/vom/vom/gbp_bridge_domain_cmds.hpp
index ec6b0a443fe..a4fd0d51b45 100644
--- a/extras/vom/vom/gbp_bridge_domain_cmds.hpp
+++ b/extras/vom/vom/gbp_bridge_domain_cmds.hpp
@@ -37,6 +37,7 @@ public:
create_cmd(HW::item<uint32_t>& item,
const handle_t bvi,
const handle_t uu_fwd,
+ const handle_t bm_flood,
const gbp_bridge_domain::flags_t& flags);
/**
@@ -56,6 +57,7 @@ public:
private:
const handle_t m_bvi;
const handle_t m_uu_fwd;
+ const handle_t m_bm_flood;
const gbp_bridge_domain::flags_t& m_flags;
};
diff --git a/extras/vom/vom/gbp_endpoint_group.cpp b/extras/vom/vom/gbp_endpoint_group.cpp
index e63b09f7c1b..44bdcdb3524 100644
--- a/extras/vom/vom/gbp_endpoint_group.cpp
+++ b/extras/vom/vom/gbp_endpoint_group.cpp
@@ -30,6 +30,7 @@ gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id,
const gbp_bridge_domain& bd)
: m_hw(false)
, m_epg_id(epg_id)
+ , m_sclass(0xffff)
, m_itf(itf.singular())
, m_rd(rd.singular())
, m_bd(bd.singular())
@@ -41,6 +42,34 @@ gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id,
const gbp_bridge_domain& bd)
: m_hw(false)
, m_epg_id(epg_id)
+ , m_sclass(0xffff)
+ , m_itf()
+ , m_rd(rd.singular())
+ , m_bd(bd.singular())
+{
+}
+
+gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id,
+ uint16_t sclass,
+ const interface& itf,
+ const gbp_route_domain& rd,
+ const gbp_bridge_domain& bd)
+ : m_hw(false)
+ , m_epg_id(epg_id)
+ , m_sclass(sclass)
+ , m_itf(itf.singular())
+ , m_rd(rd.singular())
+ , m_bd(bd.singular())
+{
+}
+
+gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id,
+ uint16_t sclass,
+ const gbp_route_domain& rd,
+ const gbp_bridge_domain& bd)
+ : m_hw(false)
+ , m_epg_id(epg_id)
+ , m_sclass(sclass)
, m_itf()
, m_rd(rd.singular())
, m_bd(bd.singular())
@@ -50,6 +79,7 @@ gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id,
gbp_endpoint_group::gbp_endpoint_group(const gbp_endpoint_group& epg)
: m_hw(epg.m_hw)
, m_epg_id(epg.m_epg_id)
+ , m_sclass(epg.m_sclass)
, m_itf(epg.m_itf)
, m_rd(epg.m_rd)
, m_bd(epg.m_bd)
@@ -77,8 +107,8 @@ gbp_endpoint_group::id() const
bool
gbp_endpoint_group::operator==(const gbp_endpoint_group& gg) const
{
- return (key() == gg.key() && (m_itf == gg.m_itf) && (m_rd == gg.m_rd) &&
- (m_bd == gg.m_bd));
+ return (key() == gg.key() && (m_sclass == gg.m_sclass) &&
+ (m_itf == gg.m_itf) && (m_rd == gg.m_rd) && (m_bd == gg.m_bd));
}
void
@@ -95,7 +125,7 @@ gbp_endpoint_group::replay()
{
if (m_hw) {
HW::enqueue(new gbp_endpoint_group_cmds::create_cmd(
- m_hw, m_epg_id, m_bd->id(), m_rd->id(),
+ m_hw, m_epg_id, m_sclass, m_bd->id(), m_rd->id(),
(m_itf ? m_itf->handle() : handle_t::INVALID)));
}
}
@@ -105,8 +135,9 @@ gbp_endpoint_group::to_string() const
{
std::ostringstream s;
s << "gbp-endpoint-group:["
- << "epg:" << m_epg_id << ", " << (m_itf ? m_itf->to_string() : "NULL")
- << ", " << m_bd->to_string() << ", " << m_rd->to_string() << "]";
+ << "epg:" << m_epg_id << ", sclass:" << m_sclass << ", "
+ << (m_itf ? m_itf->to_string() : "NULL") << ", " << m_bd->to_string()
+ << ", " << m_rd->to_string() << "]";
return (s.str());
}
@@ -116,7 +147,7 @@ gbp_endpoint_group::update(const gbp_endpoint_group& r)
{
if (rc_t::OK != m_hw.rc()) {
HW::enqueue(new gbp_endpoint_group_cmds::create_cmd(
- m_hw, m_epg_id, m_bd->id(), m_rd->id(),
+ m_hw, m_epg_id, m_sclass, m_bd->id(), m_rd->id(),
(m_itf ? m_itf->handle() : handle_t::INVALID)));
}
}
@@ -194,12 +225,13 @@ gbp_endpoint_group::event_handler::handle_populate(const client_db::key_t& key)
<< payload.epg.bd_id << "]";
if (itf && bd && rd) {
- gbp_endpoint_group gbpe(payload.epg.epg_id, *itf, *rd, *bd);
+ gbp_endpoint_group gbpe(payload.epg.epg_id, payload.epg.sclass, *itf, *rd,
+ *bd);
OM::commit(key, gbpe);
VOM_LOG(log_level_t::DEBUG) << "read: " << gbpe.to_string();
} else if (bd && rd) {
- gbp_endpoint_group gbpe(payload.epg.epg_id, *rd, *bd);
+ gbp_endpoint_group gbpe(payload.epg.epg_id, payload.epg.sclass, *rd, *bd);
OM::commit(key, gbpe);
VOM_LOG(log_level_t::DEBUG) << "read: " << gbpe.to_string();
diff --git a/extras/vom/vom/gbp_endpoint_group.hpp b/extras/vom/vom/gbp_endpoint_group.hpp
index 49578007361..b60b1553e3f 100644
--- a/extras/vom/vom/gbp_endpoint_group.hpp
+++ b/extras/vom/vom/gbp_endpoint_group.hpp
@@ -51,6 +51,15 @@ public:
gbp_endpoint_group(epg_id_t epg_id,
const gbp_route_domain& rd,
const gbp_bridge_domain& bd);
+ gbp_endpoint_group(epg_id_t epg_id,
+ uint16_t sclass,
+ const interface& itf,
+ const gbp_route_domain& rd,
+ const gbp_bridge_domain& bd);
+ gbp_endpoint_group(epg_id_t epg_id,
+ uint16_t sclass,
+ const gbp_route_domain& rd,
+ const gbp_bridge_domain& bd);
/**
* Copy Construct
@@ -178,6 +187,11 @@ private:
epg_id_t m_epg_id;
/**
+ * The SClass on the wire
+ */
+ uint16_t m_sclass;
+
+ /**
* The uplink interface for the endpoint group
*/
std::shared_ptr<interface> m_itf;
diff --git a/extras/vom/vom/gbp_endpoint_group_cmds.cpp b/extras/vom/vom/gbp_endpoint_group_cmds.cpp
index 45523a6326e..8d0e48e5c2f 100644
--- a/extras/vom/vom/gbp_endpoint_group_cmds.cpp
+++ b/extras/vom/vom/gbp_endpoint_group_cmds.cpp
@@ -20,11 +20,13 @@ namespace gbp_endpoint_group_cmds {
create_cmd::create_cmd(HW::item<bool>& item,
epg_id_t epg_id,
+ uint16_t sclass,
uint32_t bd_id,
route::table_id_t rd_id,
const handle_t& itf)
: rpc_cmd(item)
, m_epg_id(epg_id)
+ , m_sclass(sclass)
, m_bd_id(bd_id)
, m_rd_id(rd_id)
, m_itf(itf)
@@ -46,6 +48,7 @@ create_cmd::issue(connection& con)
auto& payload = req.get_request().get_payload();
payload.epg.uplink_sw_if_index = m_itf.value();
payload.epg.epg_id = m_epg_id;
+ payload.epg.sclass = m_sclass;
payload.epg.bd_id = m_bd_id;
payload.epg.rd_id = m_rd_id;
diff --git a/extras/vom/vom/gbp_endpoint_group_cmds.hpp b/extras/vom/vom/gbp_endpoint_group_cmds.hpp
index 39f69e081ef..2294629ee16 100644
--- a/extras/vom/vom/gbp_endpoint_group_cmds.hpp
+++ b/extras/vom/vom/gbp_endpoint_group_cmds.hpp
@@ -35,6 +35,7 @@ public:
*/
create_cmd(HW::item<bool>& item,
epg_id_t epg_id,
+ uint16_t sclass,
uint32_t bd_id,
route::table_id_t rd_id,
const handle_t& itf);
@@ -56,6 +57,7 @@ public:
private:
const epg_id_t m_epg_id;
+ const uint16_t m_sclass;
const uint32_t m_bd_id;
const route::table_id_t m_rd_id;
const handle_t m_itf;