From a98381e5db207364f4a7ffb0dc6fe1fe0d0e40a0 Mon Sep 17 00:00:00 2001 From: Aryeh Feigin <101218333+arfeigin@users.noreply.github.com> Date: Wed, 14 Sep 2022 21:39:12 +0300 Subject: [PATCH] Use warm-boot infrastructure for fast-boot (#1121) This PR is similar to #1100 This PR should be merged together with sonic-utilities PR (sonic-net/sonic-utilities#2365) and sonic-buildimage PR (sonic-net/sonic-buildimage#12026). Fast-reboot is utilizing warm-reboot infrastructure to improve its performance, but it should ignore warm-boot logic when syncd starts in fast-boot. As well it shouldn't use temporary view between init and apply. --- syncd/Syncd.cpp | 4 ++-- syncd/scripts/syncd_init_common.sh | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/syncd/Syncd.cpp b/syncd/Syncd.cpp index cdbcda445..20eedda8d 100644 --- a/syncd/Syncd.cpp +++ b/syncd/Syncd.cpp @@ -204,9 +204,9 @@ void Syncd::performStartupLogic() { SWSS_LOG_ENTER(); - // ignore warm logic here if syncd starts in Mellanox fastfast boot mode + // ignore warm logic here if syncd starts in fast-boot or Mellanox fastfast boot mode - if (m_isWarmStart && (m_commandLineOptions->m_startType != SAI_START_TYPE_FASTFAST_BOOT)) + if (m_isWarmStart && m_commandLineOptions->m_startType != SAI_START_TYPE_FASTFAST_BOOT && m_commandLineOptions->m_startType != SAI_START_TYPE_FAST_BOOT) { SWSS_LOG_WARN("override command line startType=%s via SAI_START_TYPE_WARM_BOOT", CommandLineOptions::startTypeToString(m_commandLineOptions->m_startType).c_str()); diff --git a/syncd/scripts/syncd_init_common.sh b/syncd/scripts/syncd_init_common.sh index b4c9739fb..9c64341cb 100644 --- a/syncd/scripts/syncd_init_common.sh +++ b/syncd/scripts/syncd_init_common.sh @@ -26,8 +26,10 @@ else CMD_ARGS= fi -# Use temporary view between init and apply -CMD_ARGS+=" -u" +# Use temporary view between init and apply except when in fast-reboot +if [[ "$(cat /proc/cmdline)" != *"SONIC_BOOT_TYPE=fast-reboot"* ]]; then + CMD_ARGS+=" -u" +fi # Use bulk APIs in SAI # currently disabled since most vendors don't support that yet