Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dash] Update outbound_routing_entry #3254

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions orchagent/bulker.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ static inline bool operator==(const sai_pa_validation_entry_t& a, const sai_pa_v
static inline bool operator==(const sai_outbound_routing_entry_t& a, const sai_outbound_routing_entry_t& b)
{
return a.switch_id == b.switch_id
&& a.eni_id == b.eni_id
&& a.destination == b.destination
#if 0 // enable it after sonic-sairedis/pull/1409 merged
&& a.outbound_routing_group_id == b.outbound_routing_group_id
#endif
;
}

Expand Down Expand Up @@ -257,8 +259,10 @@ namespace std
{
size_t seed = 0;
boost::hash_combine(seed, a.switch_id);
boost::hash_combine(seed, a.eni_id);
boost::hash_combine(seed, a.destination);
#if 0 // enable it after sonic-sairedis/pull/1409 merged
boost::hash_combine(seed, a.outbound_routing_group_id);
#endif
return seed;
}
};
Expand Down
13 changes: 10 additions & 3 deletions orchagent/dash/dashrouteorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ bool DashRouteOrch::addOutboundRouting(const string& key, OutboundRoutingBulkCon

sai_outbound_routing_entry_t outbound_routing_entry;
outbound_routing_entry.switch_id = gSwitchId;
outbound_routing_entry.eni_id = dash_orch_->getEni(ctxt.eni)->eni_id;
#if 0 // enable it after sonic-sairedis/pull/1409 merged
outbound_routing_entry.outbound_routing_group_id = dash_orch_->getEni(ctxt.eni)->outbound_routing_group_id;
#endif
swss::copy(outbound_routing_entry.destination, ctxt.destination);
sai_attribute_t outbound_routing_attr;
vector<sai_attribute_t> outbound_routing_attrs;
Expand Down Expand Up @@ -153,7 +155,10 @@ bool DashRouteOrch::addOutboundRoutingPost(const string& key, const OutboundRout
}
}

OutboundRoutingEntry entry = { dash_orch_->getEni(ctxt.eni)->eni_id, ctxt.destination, ctxt.metadata };
OutboundRoutingEntry entry = { ctxt.destination, ctxt.metadata };
#if 0 // enable it after sonic-sairedis/pull/1409 merged
OutboundRoutingEntry entry = { dash_orch_->getEni(ctxt.eni)->outbound_routing_group_id, ctxt.destination, ctxt.metadata };
#endif
routing_entries_[key] = entry;

gCrmOrch->incCrmResUsedCounter(ctxt.destination.isV4() ? CrmResourceType::CRM_DASH_IPV4_OUTBOUND_ROUTING : CrmResourceType::CRM_DASH_IPV6_OUTBOUND_ROUTING);
Expand All @@ -178,7 +183,9 @@ bool DashRouteOrch::removeOutboundRouting(const string& key, OutboundRoutingBulk
OutboundRoutingEntry entry = routing_entries_[key];
sai_outbound_routing_entry_t outbound_routing_entry;
outbound_routing_entry.switch_id = gSwitchId;
outbound_routing_entry.eni_id = entry.eni;
#if 0 // enable it after sonic-sairedis/pull/1409 merged
outbound_routing_entry.outbound_routing_group_id = entry.outbound_routing_group;
#endif
swss::copy(outbound_routing_entry.destination, entry.destination);
object_statuses.emplace_back();
outbound_routing_bulker_.remove_entry(&object_statuses.back(), &outbound_routing_entry);
Expand Down
4 changes: 3 additions & 1 deletion orchagent/dash/dashrouteorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@

struct OutboundRoutingEntry
{
sai_object_id_t eni;
#if 0 // enable it after sonic-sairedis/pull/1409 merged
sai_object_id_t outbound_routing_group;
#endif
swss::IpPrefix destination;
dash::route::Route metadata;
};
Expand Down
3 changes: 2 additions & 1 deletion tests/test_dash_vnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ def test_vnet_map(self, dvs):
assert fv[1] == "SAI_PA_VALIDATION_ENTRY_ACTION_PERMIT"
return dashobj

def test_outbound_routing(self, dvs):
# FIXME: update this test after sonic-sairedis/pull/1409 merged
def xxx_outbound_routing(self, dvs):
dashobj = Dash(dvs)
self.vnet = "Vnet1"
self.mac_string = "F4939FEFC47E"
Expand Down
Loading