Skip to content

Commit f35e743

Browse files
authored
[nvidia] Skip SAI discovery on ports (sonic-net#1524)
Given that modern systems have lots of ports, performing SAI discovery takes very long time, e.g. (8 sec) for 256 port system. This has a big impact of fast-boot downtime and the discovery itself is not required for Nvidia platform fast-boot. Same applies to Nvidia fastfast-boot (aka warm-boot), yet needs to be tested separately.
1 parent bf049ed commit f35e743

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

syncd/Makefile.am

+4
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ if SONIC_ASIC_PLATFORM_BROADCOM
8282
libSyncd_a_CXXFLAGS += -DMDIO_ACCESS_USE_NPU
8383
endif
8484

85+
if SONIC_ASIC_PLATFORM_MELLANOX
86+
libSyncd_a_CPPFLAGS += -DSKIP_SAI_PORT_DISCOVERY
87+
endif
88+
8589
libSyncdRequestShutdown_a_SOURCES = \
8690
RequestShutdown.cpp \
8791
RequestShutdownCommandLineOptions.cpp \

syncd/SaiDiscovery.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ void SaiDiscovery::discover(
8787
discovered.insert(rid);
8888
}
8989

90+
#ifdef SKIP_SAI_PORT_DISCOVERY
91+
if (ot == SAI_OBJECT_TYPE_PORT)
92+
{
93+
return;
94+
}
95+
#endif
96+
9097
const sai_object_type_info_t *info = sai_metadata_get_object_type_info(ot);
9198

9299
/*

syncd/Syncd.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ Syncd::Syncd(
223223

224224
m_breakConfig = BreakConfigParser::parseBreakConfig(m_commandLineOptions->m_breakConfig);
225225

226+
#ifdef SKIP_SAI_PORT_DISCOVERY
227+
SWSS_LOG_WARN("SAI discovery is skipped on ports");
228+
#endif
229+
226230
SWSS_LOG_NOTICE("syncd started");
227231
}
228232

0 commit comments

Comments
 (0)