diff --git a/configure.ac b/configure.ac index 57a8eb693..fc16d55ad 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,10 @@ AX_ADD_AM_MACRO_STATIC([]) AM_CONDITIONAL(SONIC_ASIC_PLATFORM_BAREFOOT, test x$CONFIGURED_PLATFORM = xbarefoot) AM_CONDITIONAL(SONIC_ASIC_PLATFORM_BROADCOM, test x$CONFIGURED_PLATFORM = xbroadcom) +AM_CONDITIONAL(SONIC_ASIC_PLATFORM_MELLANOX, test x$CONFIGURED_PLATFORM = xmellanox) + +AM_COND_IF([SONIC_ASIC_PLATFORM_MELLANOX], + AC_DEFINE([MELLANOX], [1], [Define to 1 on Mellanox Platform])) AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging], diff --git a/syncd/Syncd.cpp b/syncd/Syncd.cpp index 78a1ea2d0..f6ebd904f 100644 --- a/syncd/Syncd.cpp +++ b/syncd/Syncd.cpp @@ -1,3 +1,4 @@ +#include "config.h" #include "Syncd.h" #include "VidManager.h" #include "NotificationHandler.h" @@ -4738,7 +4739,15 @@ void Syncd::run() m_mdioIpcServer->stopMdioThread(); - sai_status_t status = removeAllSwitches(); + sai_status_t status = SAI_STATUS_SUCCESS; +#ifdef MELLANOX + if (shutdownType != SYNCD_RESTART_TYPE_COLD) + { + status = removeAllSwitches(); + } +#else + status = removeAllSwitches(); +#endif // Stop notification thread after removing switch m_processor->stopNotificationsProcessingThread();