Skip to content

Commit 7639cc1

Browse files
sihuihan88lguohan
authored andcommitted
[pfcwd]: add flag to enable pfc wd on start (#1429)
1 parent b2518c8 commit 7639cc1

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
# * ENABLE_DHCP_GRAPH_SERVICE: Enables get-graph service to fetch minigraph files
99
# through http.
1010
# * SHUTDOWN_BGP_ON_START: Sets admin-down state for all bgp peerings after restart.
11+
# * ENABLE_PFCWD_ON_START: Enable PFC Watchdog (PFCWD) on server-facing ports
12+
# * by default for TOR switch.
1113
# * SONIC_ENABLE_SYNCD_RPC: Enables rpc-based syncd builds.
1214
# * USERNAME: Desired username -- default at rules/config
1315
# * PASSWORD: Desired password -- default at rules/config
@@ -62,6 +64,7 @@ SONIC_BUILD_INSTRUCTION := make \
6264
BUILD_NUMBER=$(BUILD_NUMBER) \
6365
ENABLE_DHCP_GRAPH_SERVICE=$(ENABLE_DHCP_GRAPH_SERVICE) \
6466
SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \
67+
SONIC_ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \
6568
ENABLE_SYNCD_RPC=$(ENABLE_SYNCD_RPC) \
6669
PASSWORD=$(PASSWORD) \
6770
USERNAME=$(USERNAME) \

files/build_templates/sonic_debian_extension.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ sudo bash -c "echo enabled=false > $FILESYSTEM_ROOT/etc/sonic/updategraph.conf"
168168
{% if shutdown_bgp_on_start == "y" %}
169169
sudo bash -c "echo '{ \"DEVICE_METADATA\": { \"localhost\": { \"default_bgp_status\": \"down\" } } }' >> $FILESYSTEM_ROOT/etc/sonic/init_cfg.json"
170170
{% endif %}
171+
{% if enable_pfcwd_on_start == "y" %}
172+
sudo bash -c "echo '{ \"DEVICE_METADATA\": { \"localhost\": { \"default_pfcwd_status\": \"enable\" } } }' >> $FILESYSTEM_ROOT/etc/sonic/init_cfg.json"
173+
{% endif %}
174+
171175
# Copy SNMP configuration files
172176
sudo cp $IMAGE_CONFIGS/snmp/snmp.yml $FILESYSTEM_ROOT/etc/sonic/
173177

rules/config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ DEFAULT_PASSWORD = YourPaSsWoRd
3636
# bgp service starts.
3737
# SHUTDOWN_BGP_ON_START = y
3838

39+
# ENABLE_PFCWD_ON_START - if set to y PFC Watchdog (PFCWD) will be enabled all server-facing ports
40+
# by default for TOR switch
41+
# ENABLE_PFCWD_ON_START = y
42+
3943
# SONIC_CONFIG_DEBUG - install debug packages
4044
# Uncomment next line to enable:
4145
# SONIC_CONFIG_DEBUG = y

slave.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ list :
5959
## Include other rules
6060
###############################################################################
6161

62+
ifeq ($(SONIC_ENABLE_PFCWD_ON_START),y)
63+
ENABLE_PFCWD_ON_START = y
64+
endif
65+
6266
include $(RULES_PATH)/config
6367
include $(RULES_PATH)/functions
6468
include $(RULES_PATH)/*.mk
@@ -96,6 +100,7 @@ $(info "DEFAULT_USERNAME" : "$(DEFAULT_USERNAME)")
96100
$(info "DEFAULT_PASSWORD" : "$(DEFAULT_PASSWORD)")
97101
$(info "ENABLE_DHCP_GRAPH_SERVICE" : "$(ENABLE_DHCP_GRAPH_SERVICE)")
98102
$(info "SHUTDOWN_BGP_ON_START" : "$(SHUTDOWN_BGP_ON_START)")
103+
$(info "ENABLE_PFCWD_ON_START" : "$(ENABLE_PFCWD_ON_START)")
99104
$(info "SONIC_CONFIG_DEBUG" : "$(SONIC_CONFIG_DEBUG)")
100105
$(info "ROUTING_STACK" : "$(SONIC_ROUTING_STACK)")
101106
$(info "ENABLE_SYNCD_RPC" : "$(ENABLE_SYNCD_RPC)")
@@ -439,6 +444,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
439444
export enable_organization_extensions="$(ENABLE_ORGANIZATION_EXTENSIONS)"
440445
export enable_dhcp_graph_service="$(ENABLE_DHCP_GRAPH_SERVICE)"
441446
export shutdown_bgp_on_start="$(SHUTDOWN_BGP_ON_START)"
447+
export enable_pfcwd_on_start="$(ENABLE_PFCWD_ON_START)"
442448
export installer_debs="$(addprefix $(DEBS_PATH)/,$($*_INSTALLS))"
443449
export lazy_installer_debs="$(foreach deb, $($*_LAZY_INSTALLS),$(foreach device, $($(deb)_PLATFORM),$(addprefix $(device)@, $(DEBS_PATH)/$(deb))))"
444450
export installer_images="$(addprefix $(TARGET_PATH)/,$($*_DOCKERS))"

0 commit comments

Comments
 (0)