Skip to content

Commit ef82f00

Browse files
authored
[load_minigraph] Delay pfcwd start until the buffer templates are rendered (#1937)
Signed-off-by: Neetha John <[email protected]> Fixes #9292 What I did Pfcwd was not getting started after executing load_minigraph after the changes done in #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
1 parent f5e5a56 commit ef82f00

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

config/main.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1515,11 +1515,6 @@ def load_minigraph(db, no_service_restart):
15151515
clicommon.run_command(command, display_cmd=True)
15161516
client.set(config_db.INIT_INDICATOR, 1)
15171517

1518-
# get the device type
1519-
device_type = _get_device_type()
1520-
if device_type != 'MgmtToRRouter' and device_type != 'MgmtTsToR' and device_type != 'EPMS':
1521-
clicommon.run_command("pfcwd start_default", display_cmd=True)
1522-
15231518
# Update SONiC environmnet file
15241519
update_sonic_environment()
15251520

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

1533+
# get the device type
1534+
device_type = _get_device_type()
1535+
if device_type != 'MgmtToRRouter' and device_type != 'MgmtTsToR' and device_type != 'EPMS':
1536+
clicommon.run_command("pfcwd start_default", display_cmd=True)
1537+
15381538
# Write latest db version string into db
15391539
db_migrator='/usr/local/bin/db_migrator.py'
15401540
if os.path.isfile(db_migrator) and os.access(db_migrator, os.X_OK):

tests/config_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
load_minigraph_command_output="""\
2222
Stopping SONiC target ...
2323
Running command: /usr/local/bin/sonic-cfggen -H -m --write-to-db
24-
Running command: pfcwd start_default
2524
Running command: config qos reload --no-dynamic-buffer
25+
Running command: pfcwd start_default
2626
Restarting SONiC target ...
2727
Reloading Monit configuration ...
2828
Please note setting loaded from minigraph will be lost after system reboot. To preserve setting, run `config save`.

0 commit comments

Comments
 (0)