Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pfcwd]: add flag to enable pfc wd on start #1429

Merged
merged 4 commits into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
# * ENABLE_DHCP_GRAPH_SERVICE: Enables get-graph service to fetch minigraph files
# through http.
# * SHUTDOWN_BGP_ON_START: Sets admin-down state for all bgp peerings after restart.
# * ENABLE_PFC_WD_ON_START: Enable PFCWD on server-facing ports when starts.
# * ENABLE_PFCWD_ON_START: Enable PFC Watchdog (PFCWD) on server-facing ports
# * by default for TOR switch.
# * SONIC_ENABLE_SYNCD_RPC: Enables rpc-based syncd builds.
# * USERNAME: Desired username -- default at rules/config
# * PASSWORD: Desired password -- default at rules/config
Expand Down Expand Up @@ -63,7 +64,7 @@ SONIC_BUILD_INSTRUCTION := make \
BUILD_NUMBER=$(BUILD_NUMBER) \
ENABLE_DHCP_GRAPH_SERVICE=$(ENABLE_DHCP_GRAPH_SERVICE) \
SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \
ENABLE_PFC_WD_ON_START=$(ENABLE_PFC_WD_ON_START) \
ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will always rewrite value in config file

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this issue.

#1201

looks like joe has some suggestion to fix this problem.

ENABLE_SYNCD_RPC=$(ENABLE_SYNCD_RPC) \
PASSWORD=$(PASSWORD) \
USERNAME=$(USERNAME) \
Expand Down
2 changes: 1 addition & 1 deletion files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ sudo bash -c "echo enabled=false > $FILESYSTEM_ROOT/etc/sonic/updategraph.conf"
{% if shutdown_bgp_on_start == "y" %}
sudo bash -c "echo '{ \"DEVICE_METADATA\": { \"localhost\": { \"default_bgp_status\": \"down\" } } }' >> $FILESYSTEM_ROOT/etc/sonic/init_cfg.json"
{% endif %}
{% if enable_pfc_wd_on_start == "y" %}
{% if enable_pfcwd_on_start == "y" %}
sudo bash -c "echo '{ \"DEVICE_METADATA\": { \"localhost\": { \"default_pfc_wd_status\": \"enable\" } } }' >> $FILESYSTEM_ROOT/etc/sonic/init_cfg.json"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which agent is reading this DEVICE_METADATA default_pfc_wd_status, where is that code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the PR is related/depended to other PR, can you mark this information in the PR comments?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be consistent, this should also be default_pfcwd_status

{% endif %}

Expand Down
6 changes: 3 additions & 3 deletions rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ DEFAULT_PASSWORD = YourPaSsWoRd
# bgp service starts.
# SHUTDOWN_BGP_ON_START = y

# ENABLE_PFC_WD_ON_START - if set to y PFC WD will be enabled all server-facing ports when
# service starts.
# ENABLE_PFC_WD_ON_START = y
# ENABLE_PFCWD_ON_START - if set to y PFC Watchdog (PFCWD) will be enabled all server-facing ports
# by default for TOR switch
# ENABLE_PFCWD_ON_START = y

# SONIC_CONFIG_DEBUG - install debug packages
# Uncomment next line to enable:
Expand Down
4 changes: 2 additions & 2 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ $(info "DEFAULT_USERNAME" : "$(DEFAULT_USERNAME)")
$(info "DEFAULT_PASSWORD" : "$(DEFAULT_PASSWORD)")
$(info "ENABLE_DHCP_GRAPH_SERVICE" : "$(ENABLE_DHCP_GRAPH_SERVICE)")
$(info "SHUTDOWN_BGP_ON_START" : "$(SHUTDOWN_BGP_ON_START)")
$(info "ENABLE_PFC_WD_ON_START" : "$(ENABLE_PFC_WD_ON_START)")
$(info "ENABLE_PFCWD_ON_START" : "$(ENABLE_PFCWD_ON_START)")
$(info "SONIC_CONFIG_DEBUG" : "$(SONIC_CONFIG_DEBUG)")
$(info "ROUTING_STACK" : "$(SONIC_ROUTING_STACK)")
$(info "ENABLE_SYNCD_RPC" : "$(ENABLE_SYNCD_RPC)")
Expand Down Expand Up @@ -440,7 +440,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
export enable_organization_extensions="$(ENABLE_ORGANIZATION_EXTENSIONS)"
export enable_dhcp_graph_service="$(ENABLE_DHCP_GRAPH_SERVICE)"
export shutdown_bgp_on_start="$(SHUTDOWN_BGP_ON_START)"
export enable_pfc_wd_on_start="$(ENABLE_PFC_WD_ON_START)"
export enable_pfcwd_on_start="$(ENABLE_PFCWD_ON_START)"
export installer_debs="$(addprefix $(DEBS_PATH)/,$($*_INSTALLS))"
export lazy_installer_debs="$(foreach deb, $($*_LAZY_INSTALLS),$(foreach device, $($(deb)_PLATFORM),$(addprefix $(device)@, $(DEBS_PATH)/$(deb))))"
export installer_images="$(addprefix $(TARGET_PATH)/,$($*_DOCKERS))"
Expand Down