Skip to content

Commit

Permalink
Limit the number of ECMP paths to 128.
Browse files Browse the repository at this point in the history
While processing received nexthops from control node, limit the number
to 128. Also, calculate the ksync buffer length based on number of components
in the composite NH.

Change-Id: I58e3d297d5f719ed1be245c6021c579bba3a9ea3
closes-bug: #1664896
(cherry picked from commit b3196b2)
  • Loading branch information
haripk committed Feb 28, 2017
1 parent 35ac4ac commit 40a0559
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 40a0559

Please sign in to comment.