Skip to content

Commit

Permalink
Merge "Keep sending ARP probes at regular interval." into R2.21.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jan 24, 2017
2 parents b38450d + 212b84b commit dd95435
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
27 changes: 13 additions & 14 deletions src/vnsw/agent/services/arp_proto.cc
Expand Up @@ -140,10 +140,6 @@ bool ArpPathPreferenceState::SendArpRequest(WaitForTrafficIntfMap

WaitForTrafficIntfMap::iterator it = wait_for_traffic_map.begin();
for (;it != wait_for_traffic_map.end(); it++) {
if (it->second >= kMaxRetry) {
continue;
}

const VmInterface *vm_intf = static_cast<const VmInterface *>(
vrf_state_->agent->interface_table()->FindInterface(it->first));
if (!vm_intf) {
Expand All @@ -161,6 +157,12 @@ bool ArpPathPreferenceState::SendArpRequest(WaitForTrafficIntfMap
MacAddress(), vm_ip_.to_v4().to_ulong(),
it->first, vrf_id_);
vrf_state_->arp_proto->IncrementStatsVmArpReq();

// reduce the frequency of ARP requests after some tries
if (it->second >= kMaxRetry) {
arp_req_timer_->Reschedule(kTimeout * 5);
}

ret = true;
}
return ret;
Expand Down Expand Up @@ -222,17 +224,14 @@ void ArpPathPreferenceState::SendArpRequestForAllIntf(const AgentRoute *route) {
gw_ip_ = path->subnet_service_ip();
}
uint32_t intf_id = intf->id();
bool wait_for_traffic = path->path_preference().wait_for_traffic();
//Build new list of interfaces in active state
if (wait_for_traffic == true) {
WaitForTrafficIntfMap::const_iterator wait_for_traffic_it =
wait_for_traffic_map.find(intf_id);
if (wait_for_traffic_it == wait_for_traffic_map.end()) {
new_wait_for_traffic_map.insert(std::make_pair(intf_id, 0));
} else {
new_wait_for_traffic_map.insert(std::make_pair(intf_id,
wait_for_traffic_it->second));
}
WaitForTrafficIntfMap::const_iterator wait_for_traffic_it =
wait_for_traffic_map.find(intf_id);
if (wait_for_traffic_it == wait_for_traffic_map.end()) {
new_wait_for_traffic_map.insert(std::make_pair(intf_id, 0));
} else {
new_wait_for_traffic_map.insert(std::make_pair(intf_id,
wait_for_traffic_it->second));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/vnsw/agent/services/test/arp_path_preference_test.cc
Expand Up @@ -143,7 +143,7 @@ TEST_F(ArpPathPreferenceTest, Test3) {
MacAddress::ZeroMac());
client->WaitForIdle();

EXPECT_FALSE(CheckIpMap(vrf_id, intf_id, ip));
EXPECT_TRUE(CheckIpMap(vrf_id, intf_id, ip));
EXPECT_TRUE(CheckEvpnMap(vrf_id, intf_id, ip));
EXPECT_TRUE(GetEvpnMapRetryCount(vrf_id, intf_id, ip) >= 2);
}
Expand Down

0 comments on commit dd95435

Please sign in to comment.