Skip to content

Commit

Permalink
[load_minigraph] Delay pfcwd start until the buffer templates are ren…
Browse files Browse the repository at this point in the history
…dered (sonic-net#1937)

Signed-off-by: Neetha John <nejo@microsoft.com>

Fixes sonic-net#9292

What I did
Pfcwd was not getting started after executing load_minigraph after the changes done in sonic-net#1508. This was because the PORT_QOS_MAP table is not yet present in config db (this gets populated only after the buffer templates are rendered) at the time we try to start pfcwd and hence the 'pfc_enable' field will always be empty and we skip writing PFC_WD table entries to config db.

How I did it
Delay pfcwd start until the buffer templates are rendered

How to verify it
Issue "config load_minigraph" with the changes and ensure that pfcwd is started on all active ports
  • Loading branch information
neethajohn authored Nov 24, 2021
1 parent f5e5a56 commit ef82f00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,11 +1515,6 @@ def load_minigraph(db, no_service_restart):
clicommon.run_command(command, display_cmd=True)
client.set(config_db.INIT_INDICATOR, 1)

# get the device type
device_type = _get_device_type()
if device_type != 'MgmtToRRouter' and device_type != 'MgmtTsToR' and device_type != 'EPMS':
clicommon.run_command("pfcwd start_default", display_cmd=True)

# Update SONiC environmnet file
update_sonic_environment()

Expand All @@ -1535,6 +1530,11 @@ def load_minigraph(db, no_service_restart):
# generate QoS and Buffer configs
clicommon.run_command("config qos reload --no-dynamic-buffer", display_cmd=True)

# get the device type
device_type = _get_device_type()
if device_type != 'MgmtToRRouter' and device_type != 'MgmtTsToR' and device_type != 'EPMS':
clicommon.run_command("pfcwd start_default", display_cmd=True)

# Write latest db version string into db
db_migrator='/usr/local/bin/db_migrator.py'
if os.path.isfile(db_migrator) and os.access(db_migrator, os.X_OK):
Expand Down
2 changes: 1 addition & 1 deletion tests/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
load_minigraph_command_output="""\
Stopping SONiC target ...
Running command: /usr/local/bin/sonic-cfggen -H -m --write-to-db
Running command: pfcwd start_default
Running command: config qos reload --no-dynamic-buffer
Running command: pfcwd start_default
Restarting SONiC target ...
Reloading Monit configuration ...
Please note setting loaded from minigraph will be lost after system reboot. To preserve setting, run `config save`.
Expand Down

0 comments on commit ef82f00

Please sign in to comment.