-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mellanox|FFB]: Add support for Mellanox fast-fast boot in syncd #389
Conversation
Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
Signed-off-by: Volodymyr Samotiy <volodymyrs@mellanox.com>
WARNING: Word 'Mellanox' is misspelled ../syncd/syncd.cpp please add Mellanox to aspell dict and correct requires |
Signed-off-by: Volodymyr Samotiy <volodymyrs@mellanox.com>
syncd/syncd.cpp
Outdated
@@ -2919,7 +2919,7 @@ void printUsage() | |||
{ | |||
SWSS_LOG_ENTER(); | |||
|
|||
std::cout << "Usage: syncd [-N] [-U] [-d] [-p profile] [-i interval] [-t [cold|warm|fast]] [-h] [-u] [-S]" << std::endl; | |||
std::cout << "Usage: syncd [-N] [-U] [-d] [-p profile] [-i interval] [-t [cold|warm|fast|fast-fast]] [-h] [-u] [-S]" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->fastfast. prefer not to have - here.
syncd/syncd.cpp
Outdated
@@ -2929,7 +2929,7 @@ void printUsage() | |||
std::cout << " -i --countersInterval interval" << std::endl; | |||
std::cout << " Provide counter thread interval" << std::endl; | |||
std::cout << " -t --startType type" << std::endl; | |||
std::cout << " Specify cold|warm|fast start type" << std::endl; | |||
std::cout << " Specify cold|warm|fast|fast-fast start type" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fastfast
syncd/syncd.cpp
Outdated
@@ -3028,6 +3028,10 @@ void handleCmdLine(int argc, char **argv) | |||
{ | |||
options.startType = SAI_FAST_BOOT; | |||
} | |||
else if (std::string(optarg) == "fast-fast") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fastfast
syncd/syncd.cpp
Outdated
@@ -3028,6 +3028,10 @@ void handleCmdLine(int argc, char **argv) | |||
{ | |||
options.startType = SAI_FAST_BOOT; | |||
} | |||
else if (std::string(optarg) == "fast-fast") | |||
{ | |||
options.startType = SAI_FAST_FAST_BOOT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SAI_FASTFAST_BOOT
@@ -24,12 +24,20 @@ fi | |||
# Use temporary view between init and apply | |||
CMD_ARGS+=" -u" | |||
|
|||
case "$(cat /proc/cmdline)" in | |||
*fast-reboot*) | |||
BOOT_TYPE="$(cat /proc/cmdline | grep -o 'SONIC_BOOT_TYPE=\S*' | cut -d'=' -f2)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can cause compatibility issue. image you are on old image and want to fastfast boot into new image. We need to be aware of this issue.
BOOT_TYPE="$(cat /proc/cmdline | grep -o 'SONIC_BOOT_TYPE=\S*' | cut -d'=' -f2)" | ||
|
||
case "$BOOT_TYPE" in | ||
fast-reboot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you are breaking backward compatibility, I suggest to you to change to fast and remove -reboot.
syncd/scripts/syncd_init_common.sh
Outdated
FAST_REBOOT='yes' | ||
;; | ||
fast-fast) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-> fastfast
FAST_REBOOT='yes' | ||
;; | ||
fast-fast) | ||
if [ -e /var/warmboot/issu_started ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this flag? why kernel cmdline is not enough?
syncd/scripts/syncd_init_common.sh
Outdated
FAST_REBOOT='yes' | ||
;; | ||
fast-fast) | ||
if [ -e /var/warmboot/issu_started ]; then | ||
FAST_FAST_REBOOT='yes' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FASTFAST_BOOT
syncd/scripts/syncd_init_common.sh
Outdated
*) | ||
FAST_REBOOT='no' | ||
FAST_FAST_REBOOT='no' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FASTFAST_BOOT
@@ -55,6 +63,8 @@ function set_start_type() | |||
CMD_ARGS+=" -t warm" | |||
elif [ $FAST_REBOOT == "yes" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-> FAST_BOOT
syncd/scripts/syncd_init_common.sh
Outdated
@@ -55,6 +63,8 @@ function set_start_type() | |||
CMD_ARGS+=" -t warm" | |||
elif [ $FAST_REBOOT == "yes" ]; then | |||
CMD_ARGS+=" -t fast" | |||
elif [ $FAST_FAST_REBOOT == "yes" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FASTFAST_BOOT
syncd/scripts/syncd_init_common.sh
Outdated
@@ -55,6 +63,8 @@ function set_start_type() | |||
CMD_ARGS+=" -t warm" | |||
elif [ $FAST_REBOOT == "yes" ]; then | |||
CMD_ARGS+=" -t fast" | |||
elif [ $FAST_FAST_REBOOT == "yes" ]; then | |||
CMD_ARGS+=" -t fast-fast" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fastfast
* Change naming convention from "fast-fast" to "fastfast" Signed-off-by: Volodymyr Samotiy <volodymyrs@mellanox.com>
retest this please |
@@ -24,12 +24,20 @@ fi | |||
# Use temporary view between init and apply | |||
CMD_ARGS+=" -u" | |||
|
|||
case "$(cat /proc/cmdline)" in | |||
*fast-reboot*) | |||
BOOT_TYPE="$(cat /proc/cmdline | grep -o 'SONIC_BOOT_TYPE=\S*' | cut -d'=' -f2)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SONIC_BOOT_TYPE= [](start = 42, length = 16)
We should handle both cases for backward-compatible with 201803:
fast-reboot
SONIC_BOOT_TYPE=fast-reboot
Otherwise we cannot fast-reboot from 201803 into 201811.
…ic-net#389) * [mlnx|ffb] Add fast-fast boot option in syncd Signed-off-by: Stepan Blyschak <stepanb@mellanox.com> * [mlnx|ffb]: Add support of "config end" event for mlnx fast-fast boot Signed-off-by: Volodymyr Samotiy <volodymyrs@mellanox.com> * [mlnx|ffb]: Fix misspelled words for aspell check Signed-off-by: Volodymyr Samotiy <volodymyrs@mellanox.com> * [Mellanox|FFB]: Fix review comments * Change naming convention from "fast-fast" to "fastfast" Signed-off-by: Volodymyr Samotiy <volodymyrs@mellanox.com> * [Mellanox|FFB]: Add misspelled word 'fastfast' to aspellcheck dictionary
…ic-net#389) * [mlnx|ffb] Add fast-fast boot option in syncd Signed-off-by: Stepan Blyschak <stepanb@mellanox.com> * [mlnx|ffb]: Add support of "config end" event for mlnx fast-fast boot Signed-off-by: Volodymyr Samotiy <volodymyrs@mellanox.com> * [mlnx|ffb]: Fix misspelled words for aspell check Signed-off-by: Volodymyr Samotiy <volodymyrs@mellanox.com> * [Mellanox|FFB]: Fix review comments * Change naming convention from "fast-fast" to "fastfast" Signed-off-by: Volodymyr Samotiy <volodymyrs@mellanox.com> * [Mellanox|FFB]: Add misspelled word 'fastfast' to aspellcheck dictionary
Signed-off-by: Stepan Blyschak stepanb@mellanox.com
Signed-off-by: Volodymyr Samotiy volodymyrs@mellanox.com