Skip to content

Commit

Permalink
[swss.sh] optimize macsec feature state query (sonic-net#12946)
Browse files Browse the repository at this point in the history
- 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 Dec 6, 2022
1 parent 586d715 commit 8ca0530
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 8ca0530

Please sign in to comment.