[ipinip.json.j2] align mellanox configuration dst_ip with other platforms (#6304)

Mellanox already supports multiple destination IPs in IPinIP tunnel configuration, thus removing mellanox
exception for IPinIP configuration.

- How I did it

Removed "dst_ip" field generation in mellanox platform condition.
Sorted the "dst_ip" list, so that it is easier to test against sample configuration in unit tests.
Aligned unit test sample.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
This commit is contained in:
Stepan Blyshchak 2020-12-29 06:53:12 +02:00 committed by GitHub
parent 6efc0a885f
commit 23f1d51de3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 16 deletions

View File

@ -46,19 +46,18 @@
{ {
"TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : {
"tunnel_type":"IPINIP", "tunnel_type":"IPINIP",
"dst_ip":"{% for prefix in ipv4_addresses|sort %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
{% if "mlnx" in DEVICE_METADATA.localhost.platform %} {% 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", "dscp_mode":"uniform",
"ecn_mode":"standard", "ecn_mode":"standard",
{% else %} {% else %}
"dst_ip":"{% for prefix in ipv4_addresses %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
"dscp_mode":"pipe", "dscp_mode":"pipe",
"ecn_mode":"copy_from_outer", "ecn_mode":"copy_from_outer",
{% endif %} {% endif %}
"ttl_mode":"pipe" "ttl_mode":"pipe"
}, },
"OP": "SET" "OP": "SET"
} }
{% endif %} {% endif %}
{% if ipv4_loopback_addresses and ipv6_loopback_addresses %} , {% if ipv4_loopback_addresses and ipv6_loopback_addresses %} ,
{% endif %} {% endif %}
@ -66,12 +65,11 @@
{ {
"TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : {
"tunnel_type":"IPINIP", "tunnel_type":"IPINIP",
"dst_ip":"{% for prefix in ipv6_addresses|sort %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
{% if "mlnx" in DEVICE_METADATA.localhost.platform %} {% 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", "dscp_mode":"uniform",
"ecn_mode":"standard", "ecn_mode":"standard",
{% else %} {% else %}
"dst_ip":"{% for prefix in ipv6_addresses %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}",
"dscp_mode":"pipe", "dscp_mode":"pipe",
"ecn_mode":"copy_from_outer", "ecn_mode":"copy_from_outer",
{% endif %} {% endif %}

View File

@ -2,18 +2,18 @@
{ {
"TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : {
"tunnel_type":"IPINIP", "tunnel_type":"IPINIP",
"dst_ip":"8.0.0.0,10.1.0.32,10.1.0.3,10.0.0.0,10.1.0.1", "dst_ip":"10.0.0.0,10.1.0.1,10.1.0.3,10.1.0.32,8.0.0.0",
"dscp_mode":"pipe", "dscp_mode":"pipe",
"ecn_mode":"copy_from_outer", "ecn_mode":"copy_from_outer",
"ttl_mode":"pipe" "ttl_mode":"pipe"
}, },
"OP": "SET" "OP": "SET"
} }
, ,
{ {
"TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : {
"tunnel_type":"IPINIP", "tunnel_type":"IPINIP",
"dst_ip":"fc00:1::32,fd00:1::32,fc00::1", "dst_ip":"fc00:1::32,fc00::1,fd00:1::32",
"dscp_mode":"pipe", "dscp_mode":"pipe",
"ecn_mode":"copy_from_outer", "ecn_mode":"copy_from_outer",
"ttl_mode":"pipe" "ttl_mode":"pipe"

View File

@ -2,18 +2,18 @@
{ {
"TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : {
"tunnel_type":"IPINIP", "tunnel_type":"IPINIP",
"dst_ip":"8.0.0.0,10.1.0.32,10.1.0.1,10.1.0.3,10.0.0.0", "dst_ip":"10.0.0.0,10.1.0.1,10.1.0.3,10.1.0.32,8.0.0.0",
"dscp_mode":"pipe", "dscp_mode":"pipe",
"ecn_mode":"copy_from_outer", "ecn_mode":"copy_from_outer",
"ttl_mode":"pipe" "ttl_mode":"pipe"
}, },
"OP": "SET" "OP": "SET"
} }
, ,
{ {
"TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : {
"tunnel_type":"IPINIP", "tunnel_type":"IPINIP",
"dst_ip":"fd00:1::32,fc00:1::32,fc00::1", "dst_ip":"fc00:1::32,fc00::1,fd00:1::32",
"dscp_mode":"pipe", "dscp_mode":"pipe",
"ecn_mode":"copy_from_outer", "ecn_mode":"copy_from_outer",
"ttl_mode":"pipe" "ttl_mode":"pipe"

View File

@ -2,18 +2,18 @@
{ {
"TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : {
"tunnel_type":"IPINIP", "tunnel_type":"IPINIP",
"dst_ip":"10.1.0.32,10.0.0.58,10.0.0.60,10.0.0.62,10.0.0.56,192.168.0.1", "dst_ip":"10.0.0.56,10.0.0.58,10.0.0.60,10.0.0.62,10.1.0.32,192.168.0.1",
"dscp_mode":"pipe", "dscp_mode":"pipe",
"ecn_mode":"copy_from_outer", "ecn_mode":"copy_from_outer",
"ttl_mode":"pipe" "ttl_mode":"pipe"
}, },
"OP": "SET" "OP": "SET"
} }
, ,
{ {
"TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : {
"tunnel_type":"IPINIP", "tunnel_type":"IPINIP",
"dst_ip":"fc00:1::32,fc00::7d,fc00::79,fc00::71,fc00::75", "dst_ip":"fc00:1::32,fc00::71,fc00::75,fc00::79,fc00::7d",
"dscp_mode":"pipe", "dscp_mode":"pipe",
"ecn_mode":"copy_from_outer", "ecn_mode":"copy_from_outer",
"ttl_mode":"pipe" "ttl_mode":"pipe"

View File

@ -2,13 +2,13 @@
{ {
"TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : {
"tunnel_type":"IPINIP", "tunnel_type":"IPINIP",
"dst_ip":"10.1.0.32,10.0.0.56,10.0.0.58,10.0.0.60,10.0.0.62,192.168.0.1", "dst_ip":"10.0.0.56,10.0.0.58,10.0.0.60,10.0.0.62,10.1.0.32,192.168.0.1",
"dscp_mode":"pipe", "dscp_mode":"pipe",
"ecn_mode":"copy_from_outer", "ecn_mode":"copy_from_outer",
"ttl_mode":"pipe" "ttl_mode":"pipe"
}, },
"OP": "SET" "OP": "SET"
} }
, ,
{ {
"TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : {