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

Select dst-ip based on platform #2191

Merged
merged 1 commit into from
Oct 25, 2018
Merged
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
16 changes: 11 additions & 5 deletions dockers/docker-orchagent/ipinip.json.j2
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{% set ipv4_addresses = [] %}
{% set ipv6_addresses = [] %}
{% set ipv4_loopback_addresses = [] %}
{% set ipv6_loopback_addresses = [] %}
{% for (name, prefix) in LOOPBACK_INTERFACE %}
{%- if prefix | ipv4 and name == 'Loopback0' %}
{%- set ipv4_addresses = ipv4_addresses.append(prefix) %}
{%- set ipv4_loopback_addresses = ipv4_loopback_addresses.append(prefix) %}
{%- endif %}
{%- if prefix | ipv6 and name == 'Loopback0' %}
{%- set ipv6_addresses = ipv6_addresses.append(prefix) %}
{%- set ipv6_loopback_addresses = ipv6_loopback_addresses.append(prefix) %}
{%- endif %}
{% endfor %}
{% for (name, prefix) in INTERFACE %}
Expand Down Expand Up @@ -33,15 +37,16 @@
{%- endif %}
{% endfor %}
[
{% if ipv4_addresses %}
{% if ipv4_loopback_addresses %}
{
"TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : {
"tunnel_type":"IPINIP",
"dst_ip":"{% for prefix in ipv4_addresses %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
{% if "mlnx" in DEVICE_METADATA.localhost.platform %}
"dst_ip":"{% for prefix in ipv4_loopback_addresses %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %},
"dscp_mode":"uniform",
"ecn_mode":"standard",
{% else %}
"dst_ip":"{% for prefix in ipv4_addresses %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
"dscp_mode":"pipe",
"ecn_mode":"copy_from_outer",
{% endif %}
Expand All @@ -50,17 +55,18 @@
"OP": "SET"
}
{% endif %}
{% if ipv4_addresses and ipv6_addresses %} ,
{% if ipv4_loopback_addresses and ipv6_loopback_addresses %} ,
{% endif %}
{% if ipv6_addresses %}
{% if ipv6_loopback_addresses %}
{
"TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : {
"tunnel_type":"IPINIP",
"dst_ip":"{% for prefix in ipv6_addresses %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
{% if "mlnx" in DEVICE_METADATA.localhost.platform %}
"dst_ip":"{% for prefix in ipv6_loopback_addresses %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %},
"dscp_mode":"uniform",
"ecn_mode":"standard",
{% else %}
"dst_ip":"{% for prefix in ipv6_addresses %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
"dscp_mode":"pipe",
"ecn_mode":"copy_from_outer",
{% endif %}
Expand Down