From 5ad78abea0302585e646081898e1c3fa4ecd1aee Mon Sep 17 00:00:00 2001 From: Andriy Yurkiv <70649192+ayurkiv-nvda@users.noreply.github.com> Date: Wed, 22 Feb 2023 20:25:54 +0200 Subject: [PATCH] [Dual-ToR] add default value for ACL rule for mellanox platform (#13547) - Why I did it Need to add the possibility to choose between dropping packets (using ACL) on ingress or egress in Dual ToR scenario - How I did it Add new attribute "mux_tunnel_ingress_acl" to SYSTEM_DEFAULTS table - How to verify it check that new attribute exists in redis: admin@sonic:~$ redis-cli -n 4 127.0.0.1:6379[4]> HGETALL SYSTEM_DEFAULTS|mux_tunnel_ingress_acl 1."state" 2."false" Signed-off-by: Andriy Yurkiv --- files/build_templates/init_cfg.json.j2 | 11 +++++++++++ .../tests/files/sample_config_db.json | 4 ++++ .../tests_config/system_defaults.json | 8 ++++++++ 3 files changed, 23 insertions(+) diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index b490dc424b0a..39e180a1179d 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -133,5 +133,16 @@ "digits_class": "true", "special_class": "true" } + }, + "SYSTEM_DEFAULTS" : { +{%- if include_mux == "y" %} + "mux_tunnel_egress_acl": { +{%- if sonic_asic_platform == "mellanox" %} + "status": "enabled" +{% else %} + "status": "disabled" +{% endif %} + } +{% endif %} } } diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 1d0d04b3f9b5..a05b35c48295 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2227,6 +2227,10 @@ "SYSTEM_DEFAULTS": { "tunnel_qos_remap": { "status": "enabled" + }, + "mux_tunnel_egress_acl": + { + "status": "enabled" } }, "LOSSLESS_TRAFFIC_PATTERN": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/system_defaults.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/system_defaults.json index a8ccc13c099d..da9a3e752bf7 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/system_defaults.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/system_defaults.json @@ -6,6 +6,10 @@ { "name": "tunnel_qos_remap", "status": "enabled" + }, + { + "name": "mux_tunnel_egress_acl", + "status": "enabled" } ] } @@ -18,6 +22,10 @@ { "name": "tunnel_qos_remap", "status": "invalid_status" + }, + { + "name": "mux_tunnel_egress_acl", + "status": "invalid_status" } ] }