Skip to content

Commit

Permalink
Revert "Ignore removing switch for mellanox platform due to known lim…
Browse files Browse the repository at this point in the history
…itation (#1216)" (#1232)

What I did?

This reverts commit 62aa244.

Why I did this?

This commit introduces a race condition with would cause syncd crash. The issue happens when:

Syncd.m_sn has been freed
SAI send a port state change notification which will access Syncd.m_sn ===> causes crash
  • Loading branch information
Junchao-Mellanox authored May 1, 2023
1 parent 62aa244 commit 61cf1ce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
4 changes: 0 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ 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],
Expand Down
11 changes: 1 addition & 10 deletions syncd/Syncd.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "config.h"
#include "Syncd.h"
#include "VidManager.h"
#include "NotificationHandler.h"
Expand Down Expand Up @@ -4730,15 +4729,7 @@ void Syncd::run()

m_mdioIpcServer->stopMdioThread();

sai_status_t status = SAI_STATUS_SUCCESS;
#ifdef MELLANOX
if (shutdownType != SYNCD_RESTART_TYPE_COLD)
{
status = removeAllSwitches();
}
#else
status = removeAllSwitches();
#endif
sai_status_t status = removeAllSwitches();

// Stop notification thread after removing switch
m_processor->stopNotificationsProcessingThread();
Expand Down

0 comments on commit 61cf1ce

Please sign in to comment.