diff --git a/syncd/Makefile.am b/syncd/Makefile.am index 3c546fb74..1a969e73c 100644 --- a/syncd/Makefile.am +++ b/syncd/Makefile.am @@ -82,6 +82,10 @@ if SONIC_ASIC_PLATFORM_BROADCOM libSyncd_a_CXXFLAGS += -DMDIO_ACCESS_USE_NPU endif +if SONIC_ASIC_PLATFORM_MELLANOX +libSyncd_a_CPPFLAGS += -DSKIP_SAI_PORT_DISCOVERY +endif + libSyncdRequestShutdown_a_SOURCES = \ RequestShutdown.cpp \ RequestShutdownCommandLineOptions.cpp \ diff --git a/syncd/SaiDiscovery.cpp b/syncd/SaiDiscovery.cpp index 8615526bb..34b7f1d26 100644 --- a/syncd/SaiDiscovery.cpp +++ b/syncd/SaiDiscovery.cpp @@ -60,6 +60,13 @@ void SaiDiscovery::discover( sai_object_type_t ot = m_sai->objectTypeQuery(rid); +#ifdef SKIP_SAI_PORT_DISCOVERY + if (ot == SAI_OBJECT_TYPE_PORT) + { + return; + } +#endif + if (ot == SAI_OBJECT_TYPE_NULL) { SWSS_LOG_THROW("objectTypeQuery: rid %s returned NULL object type",