Skip to content

Commit

Permalink
Keep sending ARP probes at regular interval.
Browse files Browse the repository at this point in the history
Continue to send regular ARP probes irrespective of the VM wait_for_traffic
state, with a decreased frequency after some probes.

Change-Id: Iad510b6d02603875a37b754b0a898e1759cc92c6
closes-bug: #1655416
  • Loading branch information
haripk committed Jan 11, 2017
1 parent ee813b1 commit 212b84b
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 212b84b

Please sign in to comment.