Skip to content

Commit

Permalink
[202211][swss.sh] optimize macsec feature state query (#12946) (#13509)
Browse files Browse the repository at this point in the history
backport of #12946

- Why I did it
There's a slowdown in bootup related to the execution of a show command during startup of swss service. show is a pretty heavy command and takes long time to execute ~2 sec.

- How I did it
I replaced show with sonic-db-cli which takes a ms to run.

- How to verify it
Boot the switch and verify swss is active.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
  • Loading branch information
stepanblyschak authored Jan 25, 2023
1 parent 65e080c commit e33b92f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/scripts/swss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function check_peer_gbsyncd()

function check_macsec()
{
MACSEC_STATE=`show feature status | grep macsec | awk '{print $2}'`
MACSEC_STATE=`$SONIC_DB_CLI CONFIG_DB hget 'FEATURE|macsec' state`

if [[ ${MACSEC_STATE} == 'enabled' ]]; then
if [ "$DEV" ]; then
Expand Down

0 comments on commit e33b92f

Please sign in to comment.