-
Notifications
You must be signed in to change notification settings - Fork 689
EVPN VxLAN enhancement to support P2MP tunnel based programming for Layer2 extension #1858
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
Changes from 7 commits
d9e23ad
3b6620b
979860f
c458dba
67ca9cc
6cc06ec
beeb58a
04858de
e2061ec
d0c92ef
9e07e78
a74eb57
ffbf06a
c750f17
dd9781a
c0631dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -760,18 +760,35 @@ void FdbOrch::doTask(Consumer& consumer) | |
| } | ||
| } | ||
|
|
||
| /* FDB type is either dynamic or static */ | ||
| assert(type == "dynamic" || type == "dynamic_local" || type == "static" ); | ||
| bool check_vlan_member = true; | ||
|
|
||
| if(origin == FDB_ORIGIN_VXLAN_ADVERTIZED) | ||
| { | ||
| VxlanTunnelOrch* tunnel_orch = gDirectory.get<VxlanTunnelOrch*>(); | ||
|
|
||
| if(!remote_ip.length()) | ||
| if (tunnel_orch->dipTunnelsUsed()) | ||
| { | ||
| it = consumer.m_toSync.erase(it); | ||
| continue; | ||
| if(!remote_ip.length()) | ||
| { | ||
| it = consumer.m_toSync.erase(it); | ||
| continue; | ||
| } | ||
| port = tunnel_orch->getTunnelPortName(remote_ip); | ||
| } | ||
| else | ||
| { | ||
| EvpnNvoOrch* evpn_nvo_orch = gDirectory.get<EvpnNvoOrch*>(); | ||
| VxlanTunnel* sip_tunnel = evpn_nvo_orch->getEVPNVtep(); | ||
| check_vlan_member = false; | ||
| if (sip_tunnel == NULL) | ||
| { | ||
| it = consumer.m_toSync.erase(it); | ||
| continue; | ||
| } | ||
| port = tunnel_orch->getTunnelPortName(sip_tunnel->getSrcIP().to_string(), true); | ||
| } | ||
| port = tunnel_orch->getTunnelPortName(remote_ip); | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -782,7 +799,7 @@ void FdbOrch::doTask(Consumer& consumer) | |
| fdbData.remote_ip = remote_ip; | ||
| fdbData.esi = esi; | ||
| fdbData.vni = vni; | ||
| if (addFdbEntry(entry, port, fdbData)) | ||
| if (addFdbEntry(entry, port, fdbData, check_vlan_member)) | ||
| { | ||
| if (origin == FDB_ORIGIN_MCLAG_ADVERTIZED) | ||
| { | ||
|
|
@@ -804,9 +821,6 @@ void FdbOrch::doTask(Consumer& consumer) | |
| } | ||
| port = tunnel_orch->getTunnelPortName(remote_ip); | ||
| } | ||
|
|
||
|
|
||
| it = consumer.m_toSync.erase(it); | ||
| } | ||
| else | ||
| it++; | ||
|
|
@@ -1121,15 +1135,15 @@ void FdbOrch::updateVlanMember(const VlanMemberUpdate& update) | |
| } | ||
|
|
||
| bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name, | ||
| FdbData fdbData) | ||
| FdbData fdbData, bool check_vlan_member) | ||
|
||
| { | ||
| Port vlan; | ||
| Port port; | ||
|
|
||
| SWSS_LOG_ENTER(); | ||
| SWSS_LOG_INFO("mac=%s bv_id=0x%" PRIx64 " port_name=%s type=%s origin=%d", | ||
| SWSS_LOG_INFO("mac=%s bv_id=0x%" PRIx64 " port_name=%s type=%s origin=%d remote_ip=%s", | ||
| entry.mac.to_string().c_str(), entry.bv_id, port_name.c_str(), | ||
| fdbData.type.c_str(), fdbData.origin); | ||
| fdbData.type.c_str(), fdbData.origin, fdbData.remote_ip.c_str()); | ||
|
|
||
| if (!m_portsOrch->getPort(entry.bv_id, vlan)) | ||
| { | ||
|
|
@@ -1147,7 +1161,7 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name, | |
| } | ||
|
|
||
| /* Retry until port is member of vlan*/ | ||
| if (vlan.m_members.find(port_name) == vlan.m_members.end()) | ||
| if (check_vlan_member && vlan.m_members.find(port_name) == vlan.m_members.end()) | ||
|
||
| { | ||
| SWSS_LOG_INFO("Saving a fdb entry until port %s becomes vlan %s member", port_name.c_str(), vlan.m_alias.c_str()); | ||
| saved_fdb_entries[port_name].push_back({entry.mac, | ||
|
|
@@ -1163,6 +1177,7 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name, | |
|
|
||
| Port oldPort; | ||
| string oldType; | ||
| string oldRemoteIp; | ||
| FdbOrigin oldOrigin = FDB_ORIGIN_INVALID ; | ||
| bool macUpdate = false; | ||
|
|
||
|
|
@@ -1172,19 +1187,21 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name, | |
| /* get existing port and type */ | ||
| oldType = it->second.type; | ||
| oldOrigin = it->second.origin; | ||
| oldRemoteIp = it->second.remote_ip; | ||
|
|
||
| if (!m_portsOrch->getPortByBridgePortId(it->second.bridge_port_id, oldPort)) | ||
| { | ||
| SWSS_LOG_ERROR("Existing port 0x%" PRIx64 " details not found", it->second.bridge_port_id); | ||
| return false; | ||
| } | ||
|
|
||
| if ((oldOrigin == fdbData.origin) && (oldType == fdbData.type) && (port.m_bridge_port_id == it->second.bridge_port_id)) | ||
| if ((oldOrigin == fdbData.origin) && (oldType == fdbData.type) && (port.m_bridge_port_id == it->second.bridge_port_id) | ||
| && (oldRemoteIp == fdbData.remote_ip)) | ||
| { | ||
| /* Duplicate Mac */ | ||
| SWSS_LOG_INFO("FdbOrch: mac=%s %s port=%s type=%s origin=%d is duplicate", entry.mac.to_string().c_str(), | ||
| SWSS_LOG_INFO("FdbOrch: mac=%s %s port=%s type=%s origin=%d remote_ip=%s is duplicate", entry.mac.to_string().c_str(), | ||
| vlan.m_alias.c_str(), port_name.c_str(), | ||
| fdbData.type.c_str(), fdbData.origin); | ||
| fdbData.type.c_str(), fdbData.origin, fdbData.remote_ip.c_str()); | ||
| return true; | ||
| } | ||
| else if (fdbData.origin != oldOrigin) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,7 @@ sai_object_id_t gUnderlayIfId; | |
| sai_object_id_t gSwitchId = SAI_NULL_OBJECT_ID; | ||
| MacAddress gMacAddress; | ||
| MacAddress gVxlanMacAddress; | ||
| bool gP2PTunnelSupported; | ||
|
|
||
| extern size_t gMaxBulkSize; | ||
|
|
||
|
|
@@ -643,6 +644,32 @@ int main(int argc, char **argv) | |
| orchDaemon = make_shared<FabricOrchDaemon>(&appl_db, &config_db, &state_db, chassis_app_db.get()); | ||
| } | ||
|
|
||
| uint32_t max_tunnel_modes = 2; | ||
|
||
| vector<int32_t> tunnel_peer_modes(max_tunnel_modes, 0); | ||
| sai_s32_list_t values; | ||
| values.count = max_tunnel_modes; | ||
| values.list = tunnel_peer_modes.data(); | ||
|
|
||
| status = sai_query_attribute_enum_values_capability(gSwitchId, SAI_OBJECT_TYPE_TUNNEL, | ||
| SAI_TUNNEL_ATTR_PEER_MODE, &values); | ||
| if (status != SAI_STATUS_SUCCESS) | ||
| { | ||
| SWSS_LOG_WARN("Unable to get supported tunnel peer modes. Defaulting to P2P"); | ||
| gP2PTunnelSupported = true; | ||
| } | ||
| else | ||
| { | ||
| gP2PTunnelSupported = false; | ||
| for (uint32_t idx = 0; idx < values.count; idx++) | ||
| { | ||
| if (values.list[idx] == SAI_TUNNEL_PEER_MODE_P2P) | ||
| { | ||
| gP2PTunnelSupported = true; | ||
| break; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if (!orchDaemon->init()) | ||
| { | ||
| SWSS_LOG_ERROR("Failed to initialize orchestration daemon"); | ||
|
|
||
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.
Is this an intentional change ? By not removing this line the message will continue to remain in the m_tosync queue and be processed infinitely.
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.
That's a good catch. It got removed during a merge conflict. I have added it back.