Skip to content

Commit

Permalink
Ecmp path should publish community
Browse files Browse the repository at this point in the history
In case of service scaling with service VMs launched in same compute node, agent
publishes ecmp path. This path should contain the community set to individual VM
path. Logic was missing to copy the community attribute.

Fix the AllocateEcmpPath & ModifyEcmpPath to copy the individual path's community

TODO: This only fixes the case of allocation of ecmp path.
InetUnicastRouteEntry::EcmpAddPath  is missing logic to update the attributes of
ecmp path when individual path is updated

Change-Id: I0ac37689e380bacef40b16a714ed11bba3565658
Partial-Bug: 1549541
  • Loading branch information
bailkeri committed Feb 25, 2016
1 parent 1088614 commit 4252716
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/vnsw/agent/controller/controller_route_path.cc
Expand Up @@ -72,6 +72,7 @@ bool ControllerEcmpRoute::AddChangePath(Agent *agent, AgentPath *path,
return InetUnicastRouteEntry::ModifyEcmpPath(dest_addr_, plen_, vn_list_,
label_, local_ecmp_nh_,
vrf_name_, sg_list_,
CommunityList(),
path_preference_,
tunnel_bmap_,
ecmp_load_balance_,
Expand Down
15 changes: 13 additions & 2 deletions src/vnsw/agent/oper/inet_unicast_route.cc
Expand Up @@ -334,6 +334,7 @@ bool InetUnicastRouteEntry::ModifyEcmpPath(const IpAddress &dest_addr,
uint32_t label, bool local_ecmp_nh,
const string &vrf_name,
SecurityGroupList sg_list,
const CommunityList &communities,
const PathPreference &path_preference,
TunnelType::TypeBmap tunnel_bmap,
const EcmpLoadBalance &ecmp_load_balance,
Expand Down Expand Up @@ -366,6 +367,13 @@ bool InetUnicastRouteEntry::ModifyEcmpPath(const IpAddress &dest_addr,
ret = true;
}

CommunityList path_communities;
path_communities = path->communities();
if (path_communities != communities) {
path->set_communities(communities);
ret = true;
}

if (path_preference != path->path_preference()) {
path->set_path_preference(path_preference);
ret = true;
Expand Down Expand Up @@ -428,6 +436,7 @@ AgentPath *InetUnicastRouteEntry::AllocateEcmpPath(Agent *agent,
InetUnicastRouteEntry::ModifyEcmpPath(addr_, plen_, path2->dest_vn_list(),
label, true, vrf()->GetName(),
path2->sg_list(),
path2->communities(),
path2->path_preference(),
path2->tunnel_bmap(),
path2->ecmp_load_balance(),
Expand Down Expand Up @@ -651,7 +660,8 @@ void InetUnicastRouteEntry::AppendEcmpPath(Agent *agent,

InetUnicastRouteEntry::ModifyEcmpPath(addr_, plen_, path->dest_vn_list(),
ecmp_path->label(), true, vrf()->GetName(),
path->sg_list(), path->path_preference(),
path->sg_list(), path->communities(),
path->path_preference(),
path->tunnel_bmap(),
path->ecmp_load_balance(),
nh_req, agent, ecmp_path);
Expand Down Expand Up @@ -694,7 +704,8 @@ void InetUnicastRouteEntry::DeleteComponentNH(Agent *agent, AgentPath *path) {
InetUnicastRouteEntry::ModifyEcmpPath(addr_, plen_,
ecmp_path->dest_vn_list(),
ecmp_path->label(), true, vrf()->GetName(),
ecmp_path->sg_list(), ecmp_path->path_preference(),
ecmp_path->sg_list(), ecmp_path->communities(),
ecmp_path->path_preference(),
ecmp_path->tunnel_bmap(),
ecmp_path->ecmp_load_balance(),
nh_req, agent, ecmp_path);
Expand Down
1 change: 1 addition & 0 deletions src/vnsw/agent/oper/inet_unicast_route.h
Expand Up @@ -81,6 +81,7 @@ class InetUnicastRouteEntry : public AgentRoute {
uint32_t label, bool local_ecmp_nh,
const string &vrf_name,
SecurityGroupList sg_list,
const CommunityList &communities,
const PathPreference &path_preference,
TunnelType::TypeBmap tunnel_bmap,
const EcmpLoadBalance &ecmp_ecmp_load_balance,
Expand Down

0 comments on commit 4252716

Please sign in to comment.