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

Add port speed configuration #787

Merged
merged 3 commits into from
Aug 9, 2017
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
1 change: 1 addition & 0 deletions dockers/docker-orchagent/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ 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/"]

ENTRYPOINT ["/usr/bin/supervisord"]

10 changes: 10 additions & 0 deletions dockers/docker-orchagent/ports.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{% for port in port_properties %}
{
"PORT_TABLE:{{ port['name'] }}": {
"speed": "{{ port['speed'] }}",
},
"OP": "SET"
}{% if not loop.last %},{% endif %}
{% endfor %}
]
1 change: 1 addition & 0 deletions dockers/docker-orchagent/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mkdir -p /etc/swss/config.d/

sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/ipinip.json.j2 > /etc/swss/config.d/ipinip.json
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/mirror.json.j2 > /etc/swss/config.d/mirror.json
sonic-cfggen -m /etc/sonic/minigraph.xml -t /usr/share/sonic/templates/ports.json.j2 > /etc/swss/config.d/ports.json

export platform=`sonic-cfggen -m /etc/sonic/minigraph.xml -v platform`

Expand Down
2 changes: 1 addition & 1 deletion dockers/docker-orchagent/swssconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fast_reboot

HWSKU=`sonic-cfggen -m /etc/sonic/minigraph.xml -v minigraph_hwsku`

SWSSCONFIG_ARGS="00-copp.config.json ipinip.json mirror.json "
SWSSCONFIG_ARGS="00-copp.config.json ipinip.json mirror.json ports.json "
Copy link
Contributor

Choose a reason for hiding this comment

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

if the port speed is configured here, what's the default port speed? what about adding port speed to port_config.ini file as a separate column?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In comments to the design @lguohan suggested to make port speed mandatory in the minigraph. If for some reason it is not specified, switch will remain with the value from the SAI profile.


if [ "$HWSKU" == "Force10-S6000" ]; then
SWSSCONFIG_ARGS+="td2.32ports.buffers.json td2.32ports.qos.json "
Expand Down
2 changes: 1 addition & 1 deletion platform/mellanox/mlnx-sai.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Mellanox SAI

MLNX_SAI_VERSION = 161120
MLNX_SAI_REVISION = b57b458ff060adb2b1df629e330431a391a3b83e
MLNX_SAI_REVISION = 7e6598d231285f406096a50ad605d00371815004

export MLNX_SAI_VERSION MLNX_SAI_REVISION

Expand Down