Skip to content

Commit

Permalink
[nvidia] Skip discovery on porrt
Browse files Browse the repository at this point in the history
Signed-off-by: Stepan Blyschak <[email protected]>
  • Loading branch information
stepanblyschak committed Dec 13, 2024
1 parent 98bb52e commit 6bdf9bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions syncd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
7 changes: 7 additions & 0 deletions syncd/SaiDiscovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 6bdf9bf

Please sign in to comment.