aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-04-13 03:01:25 -0700
committerNeale Ranns <nranns@cisco.com>2018-04-13 14:14:58 +0000
commit609b5d41b02c950f942b5382992c6c7937f91f8f (patch)
tree76e706a9740db34c94bb90e322d5af16dd54fcd4 /src/vpp-api/vom
parent70083ee74c3141bbefb185525315f1b34497dcaa (diff)
VOM: GBP: update subnet is type changes
Change-Id: Ic04f419b9c09be34afc390e672793180d56c4665 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vpp-api/vom')
-rw-r--r--src/vpp-api/vom/gbp_subnet.cpp17
-rw-r--r--src/vpp-api/vom/gbp_subnet.hpp4
2 files changed, 16 insertions, 5 deletions
diff --git a/src/vpp-api/vom/gbp_subnet.cpp b/src/vpp-api/vom/gbp_subnet.cpp
index 84dbd227ed9..1a9ee86e06b 100644
--- a/src/vpp-api/vom/gbp_subnet.cpp
+++ b/src/vpp-api/vom/gbp_subnet.cpp
@@ -77,10 +77,10 @@ gbp_subnet::key() const
}
bool
-gbp_subnet::operator==(const gbp_subnet& gbpe) const
+gbp_subnet::operator==(const gbp_subnet& gs) const
{
- return ((key() == gbpe.key()) && (m_recirc == gbpe.m_recirc) &&
- (m_epg == gbpe.m_epg));
+ return ((key() == gs.key()) && (m_type == gs.m_type) &&
+ (m_recirc == gs.m_recirc) && (m_epg == gs.m_epg));
}
void
@@ -128,6 +128,17 @@ gbp_subnet::update(const gbp_subnet& r)
m_hw, m_rd->table_id(), m_prefix, (m_type == type_t::INTERNAL),
(m_recirc ? m_recirc->handle() : handle_t::INVALID),
(m_epg ? m_epg->id() : ~0)));
+ } else {
+ if (m_type != r.m_type) {
+ m_epg = r.m_epg;
+ m_recirc = r.m_recirc;
+ m_type = r.m_type;
+
+ HW::enqueue(new gbp_subnet_cmds::create_cmd(
+ m_hw, m_rd->table_id(), m_prefix, (m_type == type_t::INTERNAL),
+ (m_recirc ? m_recirc->handle() : handle_t::INVALID),
+ (m_epg ? m_epg->id() : ~0)));
+ }
}
}
diff --git a/src/vpp-api/vom/gbp_subnet.hpp b/src/vpp-api/vom/gbp_subnet.hpp
index 9c9166ec018..b4adb40ae45 100644
--- a/src/vpp-api/vom/gbp_subnet.hpp
+++ b/src/vpp-api/vom/gbp_subnet.hpp
@@ -177,7 +177,7 @@ private:
/**
* the route domain the prefix is in
*/
- std::shared_ptr<route_domain> m_rd;
+ const std::shared_ptr<route_domain> m_rd;
/**
* prefix to match
@@ -187,7 +187,7 @@ private:
/*
* Subnet type
*/
- const type_t m_type;
+ type_t m_type;
/**
* The interface the prefix is reachable through