-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle dual ToR neighbor miss scenario #2137
Merged
theasianpianist
merged 13 commits into
sonic-net:202012
from
theasianpianist:dualtor-neigh-miss-202012
Feb 16, 2022
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3a1805d
[neighsyncd]: Support dualtor neighbor miss
theasianpianist f925ba7
[orchagent]: Support dualtor neighbor miss
theasianpianist e6869f4
[neighorch]: Remove duplicate neighbor entry
theasianpianist 549e891
[swss]: Address review comments
theasianpianist 11f9589
Add VS test
7f4b0e9
[neighsyncd]: Handle dual ToR neighbor deletion
theasianpianist fb01e0c
[neighorch]: Reduce zero mac tunnel log level
theasianpianist 5ff5dd7
[muxorch]: Handle standalone tunnel neighbors
theasianpianist 1feea32
[tests]: Update fixture declarations
theasianpianist 7a0c3e7
[test_mux]: Dual ToR neighbor miss test scenarios
theasianpianist 193a00d
[test_mux]: Formatting fixes
theasianpianist dc04459
[tests]: Address lgtm
theasianpianist 499475e
[neighorch]: Remove unused include and define
theasianpianist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
#include "routeorch.h" | ||
#include "directory.h" | ||
#include "muxorch.h" | ||
#include "observer.h" | ||
|
||
extern sai_neighbor_api_t* sai_neighbor_api; | ||
extern sai_next_hop_api_t* sai_next_hop_api; | ||
|
@@ -17,6 +18,8 @@ extern RouteOrch *gRouteOrch; | |
extern FgNhgOrch *gFgNhgOrch; | ||
extern Directory<Orch*> gDirectory; | ||
|
||
#define MUX_TUNNEL "MuxTunnel0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove. Its unused and also not relevant to |
||
|
||
const int neighorch_pri = 30; | ||
|
||
NeighOrch::NeighOrch(DBConnector *appDb, string tableName, IntfsOrch *intfsOrch, FdbOrch *fdbOrch, PortsOrch *portsOrch) : | ||
|
@@ -547,7 +550,16 @@ void NeighOrch::doTask(Consumer &consumer) | |
if (m_syncdNeighbors.find(neighbor_entry) == m_syncdNeighbors.end() | ||
|| m_syncdNeighbors[neighbor_entry].mac != mac_address) | ||
{ | ||
if (addNeighbor(neighbor_entry, mac_address)) | ||
// only for unresolvable neighbors that are new | ||
if (!mac_address) | ||
{ | ||
if (m_syncdNeighbors.find(neighbor_entry) == m_syncdNeighbors.end()) | ||
{ | ||
addZeroMacTunnelRoute(neighbor_entry, mac_address); | ||
} | ||
it = consumer.m_toSync.erase(it); | ||
} | ||
else if (addNeighbor(neighbor_entry, mac_address)) | ||
{ | ||
it = consumer.m_toSync.erase(it); | ||
} | ||
|
@@ -954,3 +966,12 @@ bool NeighOrch::removeTunnelNextHop(const NextHopKey& nh) | |
return true; | ||
} | ||
|
||
void NeighOrch::addZeroMacTunnelRoute(const NeighborEntry& entry, const MacAddress& mac) | ||
{ | ||
SWSS_LOG_INFO("Creating tunnel route for neighbor %s", entry.ip_address.to_string().c_str()); | ||
MuxOrch* mux_orch = gDirectory.get<MuxOrch*>(); | ||
NeighborUpdate update = {entry, mac, true}; | ||
mux_orch->update(SUBJECT_TYPE_NEIGH_CHANGE, static_cast<void *>(&update)); | ||
m_syncdNeighbors[entry] = { mac, false }; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this. Its already in .h file