Skip to content

Commit

Permalink
Merge "Limit the number of ECMP paths to 128." into R3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Mar 3, 2017
2 parents d4348c9 + 40a0559 commit c206fd8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
10 changes: 10 additions & 0 deletions src/vnsw/agent/controller/controller_peer.cc
Expand Up @@ -674,6 +674,16 @@ void AgentXmppChannel::AddEcmpRoute(string vrf_name, IpAddress prefix_addr,
continue;
}

if (comp_nh_list.size() >= maximum_ecmp_paths) {
std::stringstream msg;
msg << "Nexthop paths for prefix "
<< prefix_addr.to_string() << "/" << prefix_len
<< " (" << item->entry.next_hops.next_hop.size()
<< ") exceed the maximum supported, ignoring them";
CONTROLLER_TRACE(Trace, GetBgpPeerName(), vrf_name, msg.str());
break;
}

uint32_t label = item->entry.next_hops.next_hop[i].label;
if (agent_->router_id() == addr.to_v4()) {
//Get local list of interface and append to the list
Expand Down
2 changes: 2 additions & 0 deletions src/vnsw/agent/controller/controller_peer.h
Expand Up @@ -28,6 +28,8 @@ class EcmpLoadBalance;

class AgentXmppChannel {
public:
static const uint32_t maximum_ecmp_paths = 128;

AgentXmppChannel(Agent *agent,
const std::string &xmpp_server,
const std::string &label_range, uint8_t xs_idx);
Expand Down
5 changes: 1 addition & 4 deletions src/vnsw/agent/vrouter/ksync/nexthop_ksync.h
Expand Up @@ -50,10 +50,7 @@ class NHKSyncEntry : public KSyncNetlinkDBEntry {

int MsgLen() {
// for larger component NH lists, increase message length
if (component_nh_list_.size() < 256)
return kDefaultNhMsgSize;
else
return 2 * kDefaultNhMsgSize;
return kDefaultNhMsgSize * ((component_nh_list_.size() / 128) + 1);
}
private:
class KSyncComponentNH {
Expand Down

0 comments on commit c206fd8

Please sign in to comment.