[ACL] enable ACL FC when genereting config from minigraph but disable by default (#8908)

* [ACL] enable ACL FC when genereting config from minigraph but disable by default
Why I did it
To support ACL counters on Flex Counter Infrastructure.

How I did it
Enable ACL FC in init_cfg and minigraph. Disable when genereting configuration from preset.

How to verify it
Together with depends PRs. Run ACL/Everflow test suite.

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
This commit is contained in:
Stepan Blyshchak 2021-11-11 03:07:54 +02:00 committed by GitHub
parent 5f11eb320e
commit a2c2d67098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 100 additions and 4 deletions

View File

@ -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()

View File

@ -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"),

View File

@ -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)

View File

@ -4,6 +4,13 @@
"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": {
{%- for key, value in PORT.items() -%}

View File

@ -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() -%}

View File

@ -4,6 +4,13 @@
"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": {
{%- for key, value in PORT.items() -%}

View File

@ -257,5 +257,12 @@
"mtu": "9100",
"speed": "100000"
}
},
"FLEX_COUNTER_TABLE": {
"ACL": {
"FLEX_COUNTER_STATUS": "disable",
"FLEX_COUNTER_DELAY_STATUS": "true",
"POLL_INTERVAL": "10000"
}
}
}

View File

@ -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"
}
}
}

View File

@ -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"
}
}
}

View File

@ -297,5 +297,12 @@
"Ethernet29": {},
"Ethernet30": {},
"Ethernet31": {}
},
"FLEX_COUNTER_TABLE": {
"ACL": {
"FLEX_COUNTER_STATUS": "disable",
"FLEX_COUNTER_DELAY_STATUS": "true",
"POLL_INTERVAL": "10000"
}
}
}

View File

@ -257,5 +257,12 @@
"mtu": "9100",
"speed": "100000"
}
},
"FLEX_COUNTER_TABLE": {
"ACL": {
"FLEX_COUNTER_STATUS": "disable",
"FLEX_COUNTER_DELAY_STATUS": "true",
"POLL_INTERVAL": "10000"
}
}
}

View File

@ -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"
}
}
}

View File

@ -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"
}
}
}

View File

@ -297,5 +297,12 @@
"Ethernet29": {},
"Ethernet30": {},
"Ethernet31": {}
},
"FLEX_COUNTER_TABLE": {
"ACL": {
"FLEX_COUNTER_STATUS": "disable",
"FLEX_COUNTER_DELAY_STATUS": "true",
"POLL_INTERVAL": "10000"
}
}
}