From 20c8dd2691b798206e841ec01c62b48d1b8c400f Mon Sep 17 00:00:00 2001 From: Prince Sunny Date: Wed, 7 Apr 2021 09:58:12 -0700 Subject: [PATCH] [IPinIP] Add Loopback2 interface, change dscp mode to uniform (#7234) Co-authored-by: Ubuntu --- dockers/docker-orchagent/ipinip.json.j2 | 8 +++----- .../tests/multi_npu_data/py2/ipinip.json | 4 ++-- .../tests/multi_npu_data/py3/ipinip.json | 4 ++-- .../tests/sample_output/py2/bgpd_quagga.conf | 2 +- .../tests/sample_output/py2/ipinip.json | 6 +++--- .../tests/sample_output/py3/ipinip.json | 6 +++--- .../tests/t0-sample-graph.xml | 16 ++++++++++++++++ 7 files changed, 30 insertions(+), 16 deletions(-) diff --git a/dockers/docker-orchagent/ipinip.json.j2 b/dockers/docker-orchagent/ipinip.json.j2 index cbfeb784b0..9cdf6857bd 100644 --- a/dockers/docker-orchagent/ipinip.json.j2 +++ b/dockers/docker-orchagent/ipinip.json.j2 @@ -5,7 +5,7 @@ {% if DEVICE_METADATA['localhost']['sub_role'] == 'FrontEnd' or DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd'%} {% set loopback_intf_names = ['Loopback0', 'Loopback4096'] %} {% else %} -{% set loopback_intf_names = ['Loopback0'] %} +{% set loopback_intf_names = ['Loopback0', 'Loopback2', 'Loopback3'] %} {% endif %} {% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {%- if prefix | ipv4 and name in loopback_intf_names %} @@ -47,11 +47,10 @@ "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "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 %} "dscp_mode":"uniform", +{% if "mlnx" in DEVICE_METADATA.localhost.platform %} "ecn_mode":"standard", {% else %} - "dscp_mode":"pipe", "ecn_mode":"copy_from_outer", {% endif %} "ttl_mode":"pipe" @@ -66,11 +65,10 @@ "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "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 %} "dscp_mode":"uniform", +{% if "mlnx" in DEVICE_METADATA.localhost.platform %} "ecn_mode":"standard", {% else %} - "dscp_mode":"pipe", "ecn_mode":"copy_from_outer", {% endif %} "ttl_mode":"pipe" diff --git a/src/sonic-config-engine/tests/multi_npu_data/py2/ipinip.json b/src/sonic-config-engine/tests/multi_npu_data/py2/ipinip.json index 3e8d4429d7..82d583de60 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/py2/ipinip.json +++ b/src/sonic-config-engine/tests/multi_npu_data/py2/ipinip.json @@ -3,7 +3,7 @@ "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", "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":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, @@ -14,7 +14,7 @@ "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", "dst_ip":"fc00:1::32,fc00::1,fd00:1::32", - "dscp_mode":"pipe", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, diff --git a/src/sonic-config-engine/tests/multi_npu_data/py3/ipinip.json b/src/sonic-config-engine/tests/multi_npu_data/py3/ipinip.json index 3e8d4429d7..82d583de60 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/py3/ipinip.json +++ b/src/sonic-config-engine/tests/multi_npu_data/py3/ipinip.json @@ -3,7 +3,7 @@ "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", "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":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, @@ -14,7 +14,7 @@ "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", "dst_ip":"fc00:1::32,fc00::1,fd00:1::32", - "dscp_mode":"pipe", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_quagga.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_quagga.conf index f5a4b22f0e..43e8ade6a3 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_quagga.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_quagga.conf @@ -23,10 +23,10 @@ router bgp 65100 bgp graceful-restart restart-time 240 bgp graceful-restart bgp router-id 10.1.0.32 + network 10.1.0.32/32 address-family ipv6 network fc00:1::32/64 exit-address-family - network 10.1.0.32/32 network 192.168.200.1/27 network 192.168.0.1/27 neighbor 10.0.0.59 remote-as 64600 diff --git a/src/sonic-config-engine/tests/sample_output/py2/ipinip.json b/src/sonic-config-engine/tests/sample_output/py2/ipinip.json index 62346451af..0a01058463 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/ipinip.json +++ b/src/sonic-config-engine/tests/sample_output/py2/ipinip.json @@ -2,8 +2,8 @@ { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", - "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,192.168.200.1", - "dscp_mode":"pipe", + "dst_ip":"10.0.0.56,10.0.0.58,10.0.0.60,10.0.0.62,10.1.0.32,10.21.0.64,10.21.64.2,192.168.0.1,192.168.200.1", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, @@ -14,7 +14,7 @@ "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", "dst_ip":"fc00:1::32,fc00::71,fc00::75,fc00::79,fc00::7d", - "dscp_mode":"pipe", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, diff --git a/src/sonic-config-engine/tests/sample_output/py3/ipinip.json b/src/sonic-config-engine/tests/sample_output/py3/ipinip.json index 62346451af..0a01058463 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/ipinip.json +++ b/src/sonic-config-engine/tests/sample_output/py3/ipinip.json @@ -2,8 +2,8 @@ { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", - "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,192.168.200.1", - "dscp_mode":"pipe", + "dst_ip":"10.0.0.56,10.0.0.58,10.0.0.60,10.0.0.62,10.1.0.32,10.21.0.64,10.21.64.2,192.168.0.1,192.168.200.1", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, @@ -14,7 +14,7 @@ "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", "dst_ip":"fc00:1::32,fc00::71,fc00::75,fc00::79,fc00::7d", - "dscp_mode":"pipe", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, diff --git a/src/sonic-config-engine/tests/t0-sample-graph.xml b/src/sonic-config-engine/tests/t0-sample-graph.xml index f847af1f90..266554dd33 100644 --- a/src/sonic-config-engine/tests/t0-sample-graph.xml +++ b/src/sonic-config-engine/tests/t0-sample-graph.xml @@ -185,6 +185,22 @@ 10.10.0.99/32 + + LoopbackIP2 + Loopback2 + + 10.21.0.64/32 + + 10.21.0.64/32 + + + LoopbackIP3 + Loopback3 + + 10.21.64.2/32 + + 10.21.64.2/32 +