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

[swss]: Add switch.json.j2 to set the hash seed according to the switch type #1089

Merged
merged 1 commit into from
Oct 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 3 additions & 4 deletions dockers/docker-orchagent/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ RUN rm -rf /debs

COPY ["arp_update", "start.sh", "orchagent.sh", "swssconfig.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["ipinip.json.j2", "/usr/share/sonic/templates/"]
COPY ["mirror.json.j2", "/usr/share/sonic/templates/"]
COPY ["ports.json.j2", "/usr/share/sonic/templates/"]
COPY ["msn27xx.32ports.buffers.json.j2", "/usr/share/sonic/templates/"]

## Copy all Jinja2 template files into the templates folder
COPY ["*.j2", "/usr/share/sonic/templates/"]

ENTRYPOINT ["/usr/bin/supervisord"]
1 change: 1 addition & 0 deletions dockers/docker-orchagent/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

mkdir -p /etc/swss/config.d/

sonic-cfggen -m /etc/sonic/minigraph.xml -d -t /usr/share/sonic/templates/switch.json.j2 > /etc/swss/config.d/switch.json
sonic-cfggen -m /etc/sonic/minigraph.xml -d -t /usr/share/sonic/templates/ipinip.json.j2 > /etc/swss/config.d/ipinip.json
sonic-cfggen -m /etc/sonic/minigraph.xml -d -t /usr/share/sonic/templates/mirror.json.j2 > /etc/swss/config.d/mirror.json
sonic-cfggen -m /etc/sonic/minigraph.xml -d -t /usr/share/sonic/templates/ports.json.j2 > /etc/swss/config.d/ports.json
Expand Down
18 changes: 18 additions & 0 deletions dockers/docker-orchagent/switch.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{# set default hash seed to 0 #}
{% set hash_seed = 0 %}
{% if DEVICE_METADATA.localhost.type %}
{% if DEVICE_METADATA.localhost.type == "ToRRouter" %}
{% set hash_seed = 10 %}
{% elif DEVICE_METADATA.localhost.type == "LeafRouter" %}
{% set hash_seed = 20 %}
{% endif %}
{% endif %}
[
{
"SWITCH_TABLE:switch": {
"ecmp_hash_seed": "{{ hash_seed }}",
"lag_hash_seed": "{{ hash_seed }}"
},
"OP": "SET"
}
]
2 changes: 1 addition & 1 deletion dockers/docker-orchagent/swssconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fast_reboot

HWSKU=`sonic-cfggen -m /etc/sonic/minigraph.xml -d -v "DEVICE_METADATA['localhost']['hwsku']"`

SWSSCONFIG_ARGS="00-copp.config.json ipinip.json mirror.json ports.json "
SWSSCONFIG_ARGS="00-copp.config.json ipinip.json mirror.json ports.json switch.json "

if [ "$HWSKU" == "Force10-S6000" ]; then
SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json "
Expand Down