diff --git a/dockers/docker-orchagent/enable_counters.py b/dockers/docker-orchagent/enable_counters.py index bf0e2b3299..084e1deff4 100755 --- a/dockers/docker-orchagent/enable_counters.py +++ b/dockers/docker-orchagent/enable_counters.py @@ -45,6 +45,7 @@ def enable_counters(): enable_counter_group(db, 'QUEUE_WATERMARK') enable_counter_group(db, 'BUFFER_POOL_WATERMARK') enable_counter_group(db, 'PORT_BUFFER_DROP') + enable_counter_group(db, 'ACL') enable_rates() diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index 2ef6682d97..6ff6c56bfd 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -19,6 +19,13 @@ {% endfor %} } }, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_STATUS": "enable", + "FLEX_COUNTER_DELAY_STATUS": "true", + "POLL_INTERVAL": "10000" + } + }, {%- set features = [("bgp", "enabled", false, "enabled"), ("database", "always_enabled", false, "always_enabled"), ("lldp", "enabled", false, "enabled"), diff --git a/src/sonic-config-engine/config_samples.py b/src/sonic-config-engine/config_samples.py index f8dc4b1c13..0606c19056 100644 --- a/src/sonic-config-engine/config_samples.py +++ b/src/sonic-config-engine/config_samples.py @@ -10,6 +10,16 @@ if sys.version_info.major == 3: else: UNICODE_TYPE = unicode +def generate_common_config(data): + data['FLEX_COUNTER_TABLE'] = { + 'ACL': { + 'FLEX_COUNTER_STATUS': 'disable', + 'FLEX_COUNTER_DELAY_STATUS': 'true', + 'POLL_INTERVAL': '10000' + } + } + return data + # The following config generation methods exits: # 't1': generate_t1_sample_config, # 'l2': generate_l2_config, @@ -160,5 +170,6 @@ def get_available_config(): return list(_sample_generators.keys()) def generate_sample_config(data, setting_name): + data = generate_common_config(data) return _sample_generators[setting_name.lower()](data) diff --git a/src/sonic-config-engine/data/l1intf.j2 b/src/sonic-config-engine/data/l1intf.j2 index 06222632e0..68ffc3ee4e 100644 --- a/src/sonic-config-engine/data/l1intf.j2 +++ b/src/sonic-config-engine/data/l1intf.j2 @@ -1,8 +1,15 @@ { "DEVICE_METADATA": { "localhost" : { - "hwsku" : "{{ DEVICE_METADATA.localhost.hwsku }}" - } + "hwsku" : "{{ DEVICE_METADATA.localhost.hwsku }}" + } + }, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_STATUS": "disable", + "FLEX_COUNTER_DELAY_STATUS": "true", + "POLL_INTERVAL": "10000" + } }, {% set ns = {'firstPrinted': False} -%} "PORT": { diff --git a/src/sonic-config-engine/data/l2switch.j2 b/src/sonic-config-engine/data/l2switch.j2 index 22de3158c5..37c343867a 100644 --- a/src/sonic-config-engine/data/l2switch.j2 +++ b/src/sonic-config-engine/data/l2switch.j2 @@ -1,5 +1,12 @@ { "DEVICE_METADATA": {{ DEVICE_METADATA | tojson }}, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_STATUS": "disable", + "FLEX_COUNTER_DELAY_STATUS": "true", + "POLL_INTERVAL": "10000" + } + }, {% set ns = {'firstPrinted': False} -%} "PORT": { {%- for key, value in PORT.items() -%} diff --git a/src/sonic-config-engine/data/l3intf.j2 b/src/sonic-config-engine/data/l3intf.j2 index 255868eb82..45fba9f692 100644 --- a/src/sonic-config-engine/data/l3intf.j2 +++ b/src/sonic-config-engine/data/l3intf.j2 @@ -1,8 +1,15 @@ { "DEVICE_METADATA": { "localhost" : { - "hwsku" : "{{ DEVICE_METADATA.localhost.hwsku }}" - } + "hwsku" : "{{ DEVICE_METADATA.localhost.hwsku }}" + } + }, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_STATUS": "disable", + "FLEX_COUNTER_DELAY_STATUS": "true", + "POLL_INTERVAL": "10000" + } }, {% set ns = {'firstPrinted': False} -%} "PORT": { diff --git a/src/sonic-config-engine/tests/sample_output/py2/l1_intfs.json b/src/sonic-config-engine/tests/sample_output/py2/l1_intfs.json index bc2d533e87..634b936fed 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/l1_intfs.json +++ b/src/sonic-config-engine/tests/sample_output/py2/l1_intfs.json @@ -257,5 +257,12 @@ "mtu": "9100", "speed": "100000" } + }, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_STATUS": "disable", + "FLEX_COUNTER_DELAY_STATUS": "true", + "POLL_INTERVAL": "10000" + } } } diff --git a/src/sonic-config-engine/tests/sample_output/py2/l2switch.json b/src/sonic-config-engine/tests/sample_output/py2/l2switch.json index 1c9e0ebbcd..5c38ba7201 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/l2switch.json +++ b/src/sonic-config-engine/tests/sample_output/py2/l2switch.json @@ -264,5 +264,12 @@ "Vlan1000|Ethernet24": { "tagging_mode": "untagged" } + }, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_STATUS": "disable", + "FLEX_COUNTER_DELAY_STATUS": "true", + "POLL_INTERVAL": "10000" + } } } diff --git a/src/sonic-config-engine/tests/sample_output/py2/l2switch_dualtor.json b/src/sonic-config-engine/tests/sample_output/py2/l2switch_dualtor.json index 44edd892ab..606a30672d 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/l2switch_dualtor.json +++ b/src/sonic-config-engine/tests/sample_output/py2/l2switch_dualtor.json @@ -643,5 +643,12 @@ "server_ipv6": "fc02:1000::19/128", "state": "auto" } + }, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_STATUS": "disable", + "FLEX_COUNTER_DELAY_STATUS": "true", + "POLL_INTERVAL": "10000" + } } } diff --git a/src/sonic-config-engine/tests/sample_output/py2/l3_intfs.json b/src/sonic-config-engine/tests/sample_output/py2/l3_intfs.json index 9ca3183230..7357c28fbe 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/l3_intfs.json +++ b/src/sonic-config-engine/tests/sample_output/py2/l3_intfs.json @@ -297,5 +297,12 @@ "Ethernet29": {}, "Ethernet30": {}, "Ethernet31": {} + }, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_STATUS": "disable", + "FLEX_COUNTER_DELAY_STATUS": "true", + "POLL_INTERVAL": "10000" + } } } diff --git a/src/sonic-config-engine/tests/sample_output/py3/l1_intfs.json b/src/sonic-config-engine/tests/sample_output/py3/l1_intfs.json index bc2d533e87..634b936fed 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/l1_intfs.json +++ b/src/sonic-config-engine/tests/sample_output/py3/l1_intfs.json @@ -257,5 +257,12 @@ "mtu": "9100", "speed": "100000" } + }, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_STATUS": "disable", + "FLEX_COUNTER_DELAY_STATUS": "true", + "POLL_INTERVAL": "10000" + } } } diff --git a/src/sonic-config-engine/tests/sample_output/py3/l2switch.json b/src/sonic-config-engine/tests/sample_output/py3/l2switch.json index fd83589153..fa3363ab74 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/l2switch.json +++ b/src/sonic-config-engine/tests/sample_output/py3/l2switch.json @@ -264,5 +264,12 @@ "Vlan1000|Ethernet124": { "tagging_mode": "untagged" } + }, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_STATUS": "disable", + "FLEX_COUNTER_DELAY_STATUS": "true", + "POLL_INTERVAL": "10000" + } } } diff --git a/src/sonic-config-engine/tests/sample_output/py3/l2switch_dualtor.json b/src/sonic-config-engine/tests/sample_output/py3/l2switch_dualtor.json index 44edd892ab..606a30672d 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/l2switch_dualtor.json +++ b/src/sonic-config-engine/tests/sample_output/py3/l2switch_dualtor.json @@ -643,5 +643,12 @@ "server_ipv6": "fc02:1000::19/128", "state": "auto" } + }, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_STATUS": "disable", + "FLEX_COUNTER_DELAY_STATUS": "true", + "POLL_INTERVAL": "10000" + } } } diff --git a/src/sonic-config-engine/tests/sample_output/py3/l3_intfs.json b/src/sonic-config-engine/tests/sample_output/py3/l3_intfs.json index 9ca3183230..7357c28fbe 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/l3_intfs.json +++ b/src/sonic-config-engine/tests/sample_output/py3/l3_intfs.json @@ -297,5 +297,12 @@ "Ethernet29": {}, "Ethernet30": {}, "Ethernet31": {} + }, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_STATUS": "disable", + "FLEX_COUNTER_DELAY_STATUS": "true", + "POLL_INTERVAL": "10000" + } } }