Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ AM_PATH_PYTHON
AM_PATH_PYTHON3

AM_CONDITIONAL(sonic_asic_platform_barefoot, test x$CONFIGURED_PLATFORM = xbarefoot)
AM_CONDITIONAL(sonic_asic_platform_mellanox, test x$CONFIGURED_PLATFORM = xmellanox)

AC_ARG_ENABLE(debug,
[ --enable-debug turn on debugging],
Expand Down
5 changes: 0 additions & 5 deletions syncd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ syncd_CPPFLAGS += -DSAITHRIFT=yes
syncd_LDADD += -lrpcserver -lthrift
endif

if sonic_asic_platform_mellanox
syncd_CPPFLAGS += -DSAI_SUPPORT_UNINIT_DATA_PLANE_ON_REMOVAL
libSyncd_a_CPPFLAGS += -DSAI_SUPPORT_UNINIT_DATA_PLANE_ON_REMOVAL
endif

libSyncdRequestShutdown_a_SOURCES = \
RequestShutdown.cpp \
RequestShutdownCommandLineOptions.cpp \
Expand Down
37 changes: 27 additions & 10 deletions syncd/Syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4181,15 +4181,36 @@ sai_status_t Syncd::setUninitDataPlaneOnRemovalOnAllSwitches()

auto strRid = sai_serialize_object_id(rid);

auto status = m_vendorSai->set(SAI_OBJECT_TYPE_SWITCH, rid, &attr);
sai_attr_capability_t attr_capability = {};

if (status != SAI_STATUS_SUCCESS)
sai_status_t queryStatus;

queryStatus = sai_query_attribute_capability(rid,
SAI_OBJECT_TYPE_SWITCH,
SAI_SWITCH_ATTR_UNINIT_DATA_PLANE_ON_REMOVAL,
&attr_capability);
if (queryStatus != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to set SAI_SWITCH_ATTR_UNINIT_DATA_PLANE_ON_REMOVAL=false: %s:%s",
strRid.c_str(),
sai_serialize_status(status).c_str());
SWSS_LOG_ERROR("Failed to get SAI_SWITCH_ATTR_UNINIT_DATA_PLANE_ON_REMOVAL capabilities: %s:%s",
strRid.c_str(),
sai_serialize_status(queryStatus).c_str());

result = status;
result = queryStatus;
continue;
}

if (attr_capability.set_implemented)
{
auto status = m_vendorSai->set(SAI_OBJECT_TYPE_SWITCH, rid, &attr);

if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to set SAI_SWITCH_ATTR_UNINIT_DATA_PLANE_ON_REMOVAL=false: %s:%s",
strRid.c_str(),
sai_serialize_status(status).c_str());

result = status;
}
}
}

Expand Down Expand Up @@ -4424,15 +4445,11 @@ void Syncd::run()
}
}

#ifdef SAI_SUPPORT_UNINIT_DATA_PLANE_ON_REMOVAL

if (shutdownType == SYNCD_RESTART_TYPE_FAST || shutdownType == SYNCD_RESTART_TYPE_WARM)
{
setUninitDataPlaneOnRemovalOnAllSwitches();
}

#endif

m_manager->removeAllCounters();

sai_status_t status = removeAllSwitches();
Expand Down