From 6bdf9bfe2672ae409df74a35952f13db4863810d Mon Sep 17 00:00:00 2001 From: Stepan Blyschak Date: Fri, 13 Dec 2024 16:02:11 +0000 Subject: [PATCH] [nvidia] Skip discovery on porrt Signed-off-by: Stepan Blyschak --- syncd/Makefile.am | 4 ++++ syncd/SaiDiscovery.cpp | 7 +++++++ 2 files changed, 11 insertions(+) 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",