From 525a57fab294e02e0a013e0170eaefb91bc37d00 Mon Sep 17 00:00:00 2001 From: skeesara-nokia <60406151+skeesara-nokia@users.noreply.github.com> Date: Wed, 27 Jul 2022 14:40:34 -0400 Subject: [PATCH] Fix for remote system interface not getting created (#2364) Signed-off-by: keesara --- orchagent/intfsorch.cpp | 18 +++++++++++++++++- orchagent/intfsorch.h | 1 + orchagent/neighorch.cpp | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/orchagent/intfsorch.cpp b/orchagent/intfsorch.cpp index 3b83b0d90635..73ab335cc258 100644 --- a/orchagent/intfsorch.cpp +++ b/orchagent/intfsorch.cpp @@ -678,7 +678,7 @@ void IntfsOrch::doTask(Consumer &consumer) if(table_name == CHASSIS_APP_SYSTEM_INTERFACE_TABLE_NAME) { - if(!isRemoteSystemPortIntf(alias)) + if(isLocalSystemPortIntf(alias)) { //Synced local interface. Skip it = consumer.m_toSync.erase(it); @@ -1623,6 +1623,22 @@ bool IntfsOrch::isRemoteSystemPortIntf(string alias) return false; } +bool IntfsOrch::isLocalSystemPortIntf(string alias) +{ + Port port; + if(gPortsOrch->getPort(alias, port)) + { + if (port.m_type == Port::LAG) + { + return(port.m_system_lag_info.switch_id == gVoqMySwitchId); + } + + return(port.m_system_port_info.type != SAI_SYSTEM_PORT_TYPE_REMOTE); + } + //Given alias is system port alias of the local port/LAG + return false; +} + void IntfsOrch::voqSyncAddIntf(string &alias) { //Sync only local interface. Confirm for the local interface and diff --git a/orchagent/intfsorch.h b/orchagent/intfsorch.h index 77c8efe75212..ba28c8dde6f5 100644 --- a/orchagent/intfsorch.h +++ b/orchagent/intfsorch.h @@ -70,6 +70,7 @@ class IntfsOrch : public Orch bool updateSyncdIntfPfx(const string &alias, const IpPrefix &ip_prefix, bool add = true); bool isRemoteSystemPortIntf(string alias); + bool isLocalSystemPortIntf(string alias); private: diff --git a/orchagent/neighorch.cpp b/orchagent/neighorch.cpp index 42bf06436799..cd2dc4cd2cf3 100644 --- a/orchagent/neighorch.cpp +++ b/orchagent/neighorch.cpp @@ -1203,7 +1203,7 @@ void NeighOrch::doVoqSystemNeighTask(Consumer &consumer) string alias = key.substr(0, found); - if(!gIntfsOrch->isRemoteSystemPortIntf(alias)) + if(gIntfsOrch->isLocalSystemPortIntf(alias)) { //Synced local neighbor. Skip it = consumer.m_toSync.erase(it);