diff --git a/dash-pipeline/SAI/sai_api_gen.py b/dash-pipeline/SAI/sai_api_gen.py index 14111acfc..d06c0d217 100755 --- a/dash-pipeline/SAI/sai_api_gen.py +++ b/dash-pipeline/SAI/sai_api_gen.py @@ -481,7 +481,7 @@ def parse_p4rt(self, p4rt_table_action, sai_enums): ] } ''' - #print("Parsing table action: " + self.name) + # print("Parsing table action: " + self.name) _, self.name, _ = self.parse_sai_annotated_name(self.name) self.parse_action_params(p4rt_table_action, sai_enums) @@ -523,7 +523,7 @@ def parse_p4rt(self, p4rt_table_action_param, sai_enums, ip_is_v6_param_ids): self.id = p4rt_table_action_param['id'] self.name = p4rt_table_action_param[NAME_TAG] self.bitwidth = p4rt_table_action_param[BITWIDTH_TAG] - print("Parsing table action param: " + self.name) + # print("Parsing table action param: " + self.name) if STRUCTURED_ANNOTATIONS_TAG in p4rt_table_action_param: self._parse_sai_object_annotation(p4rt_table_action_param) @@ -592,21 +592,16 @@ def parse_p4rt(self, p4rt_table, program, all_actions, ignore_tables): "size": "1024" } ''' - - # The first part of full name is the top level control block name, which is removed for showing better comments as stage. - self.stage, self.name, self.api_name = self.parse_sai_annotated_name(self.name, full_name_part_start = 1) - self.stage = self.stage.replace('.', '_') - if "stage" not in self.stage: - self.stage = None + self.__parse_sai_table_annotations(p4rt_table[PREAMBLE_TAG]) # If tables are specified as ignored via CLI or annotations, skip them. if self.name in ignore_tables: self.ignored = True - return + elif self.ignored: + ignore_tables.append(self.name) - self.__parse_sai_table_annotations(p4rt_table[PREAMBLE_TAG]) if self.ignored: - ignore_tables.append(self.name) + print("Ignoring table: " + self.name) return print("Parsing table: " + self.name) @@ -634,7 +629,7 @@ def __parse_sai_table_annotations(self, p4rt_table_preamble): for kv in anno[KV_PAIR_LIST_TAG][KV_PAIRS_TAG]: if kv['key'] == 'isobject': self.is_object = kv['value']['stringValue'] - if kv['key'] == 'ignoretable': + if kv['key'] == 'ignored': self.ignored = True if kv['key'] == 'name': self.name = kv['value']['stringValue'] diff --git a/dash-pipeline/bmv2/README.md b/dash-pipeline/bmv2/README.md index 4a691d6bd..370582dbb 100644 --- a/dash-pipeline/bmv2/README.md +++ b/dash-pipeline/bmv2/README.md @@ -48,6 +48,6 @@ Available tags are: - `api_order`: Specify the order of the generated API in the SAI API header file. When multiple tables generates API entries in the same API set, e.g., acl group and acl rules. This explicit attribute helps us keep the order of the generated APIs to keep ABI compatibility. - `stage`: Specify which stage this table represents for the matching stage type, e.g. `acl.stage1`. - `isobject`: When set to "true", a top level objects in SAI that attached to switch will be generated. Otherwise, a new type of entry will be generated, if nothing else helps us to determine this table is an object table. -- `ignoretable`: When set to "true", we skip this table in SAI API generation. +- `ignored`: When set to "true", we skip this table in SAI API generation. For more details, please check the SAI API generation script: [sai_api_gen.py](../SAI/sai_api_gen.py). \ No newline at end of file diff --git a/dash-pipeline/bmv2/dash_pipeline.p4 b/dash-pipeline/bmv2/dash_pipeline.p4 index 3997fe5c5..e96375946 100644 --- a/dash-pipeline/bmv2/dash_pipeline.p4 +++ b/dash-pipeline/bmv2/dash_pipeline.p4 @@ -82,6 +82,7 @@ control dash_ingress( } /* This table API should be implemented manually using underlay SAI */ + @SaiTable[ignored = "true"] table appliance { key = { meta.appliance_id : ternary @name("meta.appliance_id:appliance_id"); @@ -185,6 +186,7 @@ control dash_ingress( #endif // DPDK_SUPPORTS_DIRECT_COUNTER_ON_WILDCARD_KEY_TABLE #endif // TARGET_DPDK_PNA + @SaiTable[ignored = "true"] table eni_meter { key = { meta.eni_id : exact @name("meta.eni_id:eni_id");