diff --git a/dash-pipeline/SAI/specs/dash_acl.yaml b/dash-pipeline/SAI/specs/dash_acl.yaml index 9203b9acd..c3167dd27 100644 --- a/dash-pipeline/SAI/specs/dash_acl.yaml +++ b/dash-pipeline/SAI/specs/dash_acl.yaml @@ -22,6 +22,15 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 50200087 + actions: + default: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: default + id: 25655048 + attr_param_id: {} - !!python/object:utils.sai_spec.sai_api.SaiApi name: dash_acl_rule description: '' @@ -38,15 +47,15 @@ sai_apis: - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember name: SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE description: '' - value: '0' + value: '1' - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember name: SAI_DASH_ACL_RULE_ACTION_DENY description: '' - value: '0' + value: '2' - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember name: SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE description: '' - value: '0' + value: '3' structs: [] attributes: - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute @@ -98,3 +107,119 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 41950136 + actions: + SAI_DASH_ACL_RULE_ACTION_PERMIT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_PERMIT + id: 32161567 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE + id: 20706700 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_DENY: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_DENY + id: 28146588 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE + id: 31424218 + attr_param_id: {} + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 43016664 + actions: + SAI_DASH_ACL_RULE_ACTION_PERMIT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_PERMIT + id: 32161567 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE + id: 20706700 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_DENY: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_DENY + id: 28146588 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE + id: 31424218 + attr_param_id: {} + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 49695908 + actions: + SAI_DASH_ACL_RULE_ACTION_PERMIT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_PERMIT + id: 32161567 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE + id: 20706700 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_DENY: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_DENY + id: 28146588 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE + id: 31424218 + attr_param_id: {} + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 49209582 + actions: + SAI_DASH_ACL_RULE_ACTION_PERMIT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_PERMIT + id: 18858683 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE + id: 24263137 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_DENY: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_DENY + id: 29962337 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE + id: 26077229 + attr_param_id: {} + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 36478314 + actions: + SAI_DASH_ACL_RULE_ACTION_PERMIT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_PERMIT + id: 18858683 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE + id: 24263137 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_DENY: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_DENY + id: 29962337 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE + id: 26077229 + attr_param_id: {} + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 39012793 + actions: + SAI_DASH_ACL_RULE_ACTION_PERMIT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_PERMIT + id: 18858683 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_PERMIT_AND_CONTINUE + id: 24263137 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_DENY: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_DENY + id: 29962337 + attr_param_id: {} + SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DASH_ACL_RULE_ACTION_DENY_AND_CONTINUE + id: 26077229 + attr_param_id: {} diff --git a/dash-pipeline/SAI/specs/dash_direction_lookup.yaml b/dash-pipeline/SAI/specs/dash_direction_lookup.yaml index f0bcf2869..c86c48a26 100644 --- a/dash-pipeline/SAI/specs/dash_direction_lookup.yaml +++ b/dash-pipeline/SAI/specs/dash_direction_lookup.yaml @@ -40,3 +40,12 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 44703784 + actions: + SAI_DIRECTION_LOOKUP_ENTRY_ACTION_SET_OUTBOUND_DIRECTION: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_DIRECTION_LOOKUP_ENTRY_ACTION_SET_OUTBOUND_DIRECTION + id: 17408972 + attr_param_id: {} diff --git a/dash-pipeline/SAI/specs/dash_eni.yaml b/dash-pipeline/SAI/specs/dash_eni.yaml index 69aa2df26..7627077bf 100644 --- a/dash-pipeline/SAI/specs/dash_eni.yaml +++ b/dash-pipeline/SAI/specs/dash_eni.yaml @@ -52,6 +52,16 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 36648123 + actions: + SAI_ENI_ETHER_ADDRESS_MAP_ENTRY_ACTION_SET_ENI: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_ENI_ETHER_ADDRESS_MAP_ENTRY_ACTION_SET_ENI + id: 24618133 + attr_param_id: + SAI_ENI_ETHER_ADDRESS_MAP_ENTRY_ENI_ID: 1 - !!python/object:utils.sai_spec.sai_api.SaiApi name: eni description: '' @@ -515,6 +525,18 @@ sai_apis: allow_null: false valid_only: null deprecated: null + - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute + name: SAI_ENI_ROUTING_GROUP_ID + description: Action parameter ROUTING_GROUP_ID + type: sai_object_id_t + attr_value_field: u16 + default: SAI_NULL_OBJECT_ID + isresourcetype: false + flags: CREATE_AND_SET + object_name: SAI_OBJECT_TYPE_ROUTING_GROUP + allow_null: true + valid_only: null + deprecated: null stats: - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute name: SAI_ENI_STAT_RX_BYTES @@ -1428,3 +1450,36 @@ sai_apis: allow_null: false valid_only: null deprecated: null + - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute + name: SAI_ENI_STAT_OUTBOUND_ROUTING_GROUP_MISS_DROP_PACKETS + description: DASH ENI OUTBOUND_ROUTING_GROUP_MISS_DROP_PACKETS stat count + type: sai_uint64_t + attr_value_field: u64 + default: null + isresourcetype: false + flags: READ_ONLY + object_name: null + allow_null: false + valid_only: null + deprecated: null + - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute + name: SAI_ENI_STAT_OUTBOUND_ROUTING_GROUP_ADMIN_DOWN_DROP_PACKETS + description: DASH ENI OUTBOUND_ROUTING_GROUP_ADMIN_DOWN_DROP_PACKETS stat count + type: sai_uint64_t + attr_value_field: u64 + default: null + isresourcetype: false + flags: READ_ONLY + object_name: null + allow_null: false + valid_only: null + deprecated: null + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 45859274 + actions: + default: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: default + id: 27167550 + attr_param_id: {} diff --git a/dash-pipeline/SAI/specs/dash_ha.yaml b/dash-pipeline/SAI/specs/dash_ha.yaml index 89815406f..d3de42be4 100644 --- a/dash-pipeline/SAI/specs/dash_ha.yaml +++ b/dash-pipeline/SAI/specs/dash_ha.yaml @@ -358,6 +358,15 @@ sai_apis: allow_null: false valid_only: null deprecated: null + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 45319666 + actions: + default: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: default + id: 21324178 + attr_param_id: {} - !!python/object:utils.sai_spec.sai_api.SaiApi name: ha_scope description: '' @@ -426,3 +435,12 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 49681752 + actions: + default: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: default + id: 25507507 + attr_param_id: {} diff --git a/dash-pipeline/SAI/specs/dash_inbound_routing.yaml b/dash-pipeline/SAI/specs/dash_inbound_routing.yaml index b4cb8e784..263215a35 100644 --- a/dash-pipeline/SAI/specs/dash_inbound_routing.yaml +++ b/dash-pipeline/SAI/specs/dash_inbound_routing.yaml @@ -18,15 +18,15 @@ sai_apis: - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember name: SAI_INBOUND_ROUTING_ENTRY_ACTION_TUNNEL_DECAP_PA_VALIDATE description: '' - value: '0' + value: '1' - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember name: SAI_INBOUND_ROUTING_ENTRY_ACTION_VXLAN_DECAP description: '' - value: '0' + value: '2' - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember name: SAI_INBOUND_ROUTING_ENTRY_ACTION_VXLAN_DECAP_PA_VALIDATE description: '' - value: '0' + value: '3' structs: - !!python/object:utils.sai_spec.sai_struct.SaiStruct name: sai_inbound_routing_entry_entry_t @@ -112,3 +112,29 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 38920290 + actions: + SAI_INBOUND_ROUTING_ENTRY_ACTION_TUNNEL_DECAP: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_INBOUND_ROUTING_ENTRY_ACTION_TUNNEL_DECAP + id: 22253429 + attr_param_id: + SAI_INBOUND_ROUTING_ENTRY_METER_CLASS_OR: 1 + SAI_INBOUND_ROUTING_ENTRY_METER_CLASS_AND: 2 + SAI_INBOUND_ROUTING_ENTRY_ACTION_TUNNEL_DECAP_PA_VALIDATE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_INBOUND_ROUTING_ENTRY_ACTION_TUNNEL_DECAP_PA_VALIDATE + id: 27987616 + attr_param_id: + SAI_INBOUND_ROUTING_ENTRY_SRC_VNET_ID: 1 + SAI_INBOUND_ROUTING_ENTRY_METER_CLASS_OR: 2 + SAI_INBOUND_ROUTING_ENTRY_METER_CLASS_AND: 3 + SAI_INBOUND_ROUTING_ENTRY_ACTION_VXLAN_DECAP: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_INBOUND_ROUTING_ENTRY_ACTION_VXLAN_DECAP + id: 32581635 + attr_param_id: {} + SAI_INBOUND_ROUTING_ENTRY_ACTION_VXLAN_DECAP_PA_VALIDATE: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_INBOUND_ROUTING_ENTRY_ACTION_VXLAN_DECAP_PA_VALIDATE + id: 22711915 + attr_param_id: {} diff --git a/dash-pipeline/SAI/specs/dash_meter.yaml b/dash-pipeline/SAI/specs/dash_meter.yaml index 9fd7df0ec..79f57238a 100644 --- a/dash-pipeline/SAI/specs/dash_meter.yaml +++ b/dash-pipeline/SAI/specs/dash_meter.yaml @@ -34,6 +34,15 @@ sai_apis: allow_null: false valid_only: null deprecated: null + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 45482818 + actions: + default: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: default + id: 21630451 + attr_param_id: {} - !!python/object:utils.sai_spec.sai_api.SaiApi name: meter_policy description: '' @@ -54,6 +63,15 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 40733610 + actions: + default: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: default + id: 20564717 + attr_param_id: {} - !!python/object:utils.sai_spec.sai_api.SaiApi name: meter_rule description: '' @@ -98,3 +116,12 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 44484556 + actions: + default: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: default + id: 19652160 + attr_param_id: {} diff --git a/dash-pipeline/SAI/specs/dash_outbound_ca_to_pa.yaml b/dash-pipeline/SAI/specs/dash_outbound_ca_to_pa.yaml index 41a7489bf..7b94c2e2a 100644 --- a/dash-pipeline/SAI/specs/dash_outbound_ca_to_pa.yaml +++ b/dash-pipeline/SAI/specs/dash_outbound_ca_to_pa.yaml @@ -18,7 +18,7 @@ sai_apis: - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember name: SAI_OUTBOUND_CA_TO_PA_ENTRY_ACTION_SET_PRIVATE_LINK_MAPPING description: '' - value: '0' + value: '1' structs: - !!python/object:utils.sai_spec.sai_struct.SaiStruct name: sai_outbound_ca_to_pa_entry_entry_t @@ -230,3 +230,34 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 43335456 + actions: + SAI_OUTBOUND_CA_TO_PA_ENTRY_ACTION_SET_TUNNEL_MAPPING: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_OUTBOUND_CA_TO_PA_ENTRY_ACTION_SET_TUNNEL_MAPPING + id: 25614729 + attr_param_id: + SAI_OUTBOUND_CA_TO_PA_ENTRY_UNDERLAY_DIP: 1 + SAI_OUTBOUND_CA_TO_PA_ENTRY_OVERLAY_DMAC: 2 + SAI_OUTBOUND_CA_TO_PA_ENTRY_USE_DST_VNET_VNI: 3 + SAI_OUTBOUND_CA_TO_PA_ENTRY_METER_CLASS_OR: 4 + SAI_OUTBOUND_CA_TO_PA_ENTRY_DASH_TUNNEL_ID: 5 + SAI_OUTBOUND_CA_TO_PA_ENTRY_FLOW_RESIMULATION_REQUESTED: 6 + SAI_OUTBOUND_CA_TO_PA_ENTRY_ROUTING_ACTIONS_DISABLED_IN_FLOW_RESIMULATION: 7 + SAI_OUTBOUND_CA_TO_PA_ENTRY_ACTION_SET_PRIVATE_LINK_MAPPING: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_OUTBOUND_CA_TO_PA_ENTRY_ACTION_SET_PRIVATE_LINK_MAPPING + id: 31441909 + attr_param_id: + SAI_OUTBOUND_CA_TO_PA_ENTRY_UNDERLAY_DIP: 1 + SAI_OUTBOUND_CA_TO_PA_ENTRY_OVERLAY_SIP: 2 + SAI_OUTBOUND_CA_TO_PA_ENTRY_OVERLAY_SIP_MASK: 3 + SAI_OUTBOUND_CA_TO_PA_ENTRY_OVERLAY_DIP: 4 + SAI_OUTBOUND_CA_TO_PA_ENTRY_OVERLAY_DIP_MASK: 5 + SAI_OUTBOUND_CA_TO_PA_ENTRY_DASH_ENCAPSULATION: 6 + SAI_OUTBOUND_CA_TO_PA_ENTRY_TUNNEL_KEY: 7 + SAI_OUTBOUND_CA_TO_PA_ENTRY_METER_CLASS_OR: 8 + SAI_OUTBOUND_CA_TO_PA_ENTRY_DASH_TUNNEL_ID: 9 + SAI_OUTBOUND_CA_TO_PA_ENTRY_FLOW_RESIMULATION_REQUESTED: 10 + SAI_OUTBOUND_CA_TO_PA_ENTRY_ROUTING_ACTIONS_DISABLED_IN_FLOW_RESIMULATION: 11 diff --git a/dash-pipeline/SAI/specs/dash_outbound_routing.yaml b/dash-pipeline/SAI/specs/dash_outbound_routing.yaml index 10ff530f2..ac5eb90a8 100644 --- a/dash-pipeline/SAI/specs/dash_outbound_routing.yaml +++ b/dash-pipeline/SAI/specs/dash_outbound_routing.yaml @@ -18,19 +18,19 @@ sai_apis: - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember name: SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET_DIRECT description: '' - value: '0' + value: '1' - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember name: SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_DIRECT description: '' - value: '0' + value: '2' - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember name: SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_SERVICE_TUNNEL description: '' - value: '0' + value: '3' - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember name: SAI_OUTBOUND_ROUTING_ENTRY_ACTION_DROP description: '' - value: '0' + value: '4' structs: - !!python/object:utils.sai_spec.sai_struct.SaiStruct name: sai_outbound_routing_entry_entry_t @@ -48,6 +48,12 @@ sai_apis: type: sai_ip_prefix_t objects: null valid_only: null + - !!python/object:utils.sai_spec.sai_struct_entry.SaiStructEntry + name: routing_group_id + description: Exact matched key routing_group_id + type: sai_object_id_t + objects: SAI_OBJECT_TYPE_ROUTING_GROUP + valid_only: null attributes: - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute name: SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION @@ -254,3 +260,55 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 44010720 + actions: + SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET + id: 21392322 + attr_param_id: + SAI_OUTBOUND_ROUTING_ENTRY_DST_VNET_ID: 1 + SAI_OUTBOUND_ROUTING_ENTRY_DASH_TUNNEL_ID: 2 + SAI_OUTBOUND_ROUTING_ENTRY_METER_CLASS_OR: 3 + SAI_OUTBOUND_ROUTING_ENTRY_METER_CLASS_AND: 4 + SAI_OUTBOUND_ROUTING_ENTRY_ROUTING_ACTIONS_DISABLED_IN_FLOW_RESIMULATION: 5 + SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET_DIRECT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET_DIRECT + id: 24813914 + attr_param_id: + SAI_OUTBOUND_ROUTING_ENTRY_DST_VNET_ID: 1 + SAI_OUTBOUND_ROUTING_ENTRY_DASH_TUNNEL_ID: 2 + SAI_OUTBOUND_ROUTING_ENTRY_OVERLAY_IP: 4 + SAI_OUTBOUND_ROUTING_ENTRY_METER_CLASS_OR: 5 + SAI_OUTBOUND_ROUTING_ENTRY_METER_CLASS_AND: 6 + SAI_OUTBOUND_ROUTING_ENTRY_ROUTING_ACTIONS_DISABLED_IN_FLOW_RESIMULATION: 7 + SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_DIRECT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_DIRECT + id: 31102279 + attr_param_id: + SAI_OUTBOUND_ROUTING_ENTRY_DASH_TUNNEL_ID: 1 + SAI_OUTBOUND_ROUTING_ENTRY_METER_CLASS_OR: 2 + SAI_OUTBOUND_ROUTING_ENTRY_METER_CLASS_AND: 3 + SAI_OUTBOUND_ROUTING_ENTRY_ROUTING_ACTIONS_DISABLED_IN_FLOW_RESIMULATION: 4 + SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_SERVICE_TUNNEL: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_SERVICE_TUNNEL + id: 26982790 + attr_param_id: + SAI_OUTBOUND_ROUTING_ENTRY_OVERLAY_DIP: 2 + SAI_OUTBOUND_ROUTING_ENTRY_OVERLAY_DIP_MASK: 4 + SAI_OUTBOUND_ROUTING_ENTRY_OVERLAY_SIP: 6 + SAI_OUTBOUND_ROUTING_ENTRY_OVERLAY_SIP_MASK: 8 + SAI_OUTBOUND_ROUTING_ENTRY_UNDERLAY_DIP: 10 + SAI_OUTBOUND_ROUTING_ENTRY_UNDERLAY_SIP: 12 + SAI_OUTBOUND_ROUTING_ENTRY_DASH_ENCAPSULATION: 13 + SAI_OUTBOUND_ROUTING_ENTRY_TUNNEL_KEY: 14 + SAI_OUTBOUND_ROUTING_ENTRY_DASH_TUNNEL_ID: 15 + SAI_OUTBOUND_ROUTING_ENTRY_METER_CLASS_OR: 16 + SAI_OUTBOUND_ROUTING_ENTRY_METER_CLASS_AND: 17 + SAI_OUTBOUND_ROUTING_ENTRY_ROUTING_ACTIONS_DISABLED_IN_FLOW_RESIMULATION: 18 + SAI_OUTBOUND_ROUTING_ENTRY_ACTION_DROP: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_OUTBOUND_ROUTING_ENTRY_ACTION_DROP + id: 18759588 + attr_param_id: {} diff --git a/dash-pipeline/SAI/specs/dash_pa_validation.yaml b/dash-pipeline/SAI/specs/dash_pa_validation.yaml index 2c3f9ba6c..88240ff6d 100644 --- a/dash-pipeline/SAI/specs/dash_pa_validation.yaml +++ b/dash-pipeline/SAI/specs/dash_pa_validation.yaml @@ -58,3 +58,12 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 35526612 + actions: + SAI_PA_VALIDATION_ENTRY_ACTION_PERMIT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_PA_VALIDATION_ENTRY_ACTION_PERMIT + id: 32591400 + attr_param_id: {} diff --git a/dash-pipeline/SAI/specs/dash_routing_group.yaml b/dash-pipeline/SAI/specs/dash_routing_group.yaml new file mode 100644 index 000000000..3bdfd096e --- /dev/null +++ b/dash-pipeline/SAI/specs/dash_routing_group.yaml @@ -0,0 +1,33 @@ +!!python/object:utils.sai_spec.sai_api_group.SaiApiGroup +name: dash_routing_group +description: '' +sai_apis: +- !!python/object:utils.sai_spec.sai_api.SaiApi + name: routing_group + description: '' + is_object: true + enums: [] + structs: [] + attributes: + - !!python/object:utils.sai_spec.sai_attribute.SaiAttribute + name: SAI_ROUTING_GROUP_ADMIN_STATE + description: Action parameter ADMIN_STATE + type: bool + attr_value_field: booldata + default: 'false' + isresourcetype: false + flags: CREATE_AND_SET + object_name: null + allow_null: false + valid_only: null + deprecated: null + stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 44952888 + actions: + default: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: default + id: 20912324 + attr_param_id: {} diff --git a/dash-pipeline/SAI/specs/dash_tunnel.yaml b/dash-pipeline/SAI/specs/dash_tunnel.yaml index 524ff8210..6d7c225aa 100644 --- a/dash-pipeline/SAI/specs/dash_tunnel.yaml +++ b/dash-pipeline/SAI/specs/dash_tunnel.yaml @@ -46,3 +46,12 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 44400659 + actions: + default: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: default + id: 27891720 + attr_param_id: {} diff --git a/dash-pipeline/SAI/specs/dash_vip.yaml b/dash-pipeline/SAI/specs/dash_vip.yaml index b97418a0b..79472acec 100644 --- a/dash-pipeline/SAI/specs/dash_vip.yaml +++ b/dash-pipeline/SAI/specs/dash_vip.yaml @@ -52,3 +52,12 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 45245089 + actions: + SAI_VIP_ENTRY_ACTION_ACCEPT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_VIP_ENTRY_ACTION_ACCEPT + id: 26041632 + attr_param_id: {} diff --git a/dash-pipeline/SAI/specs/dash_vnet.yaml b/dash-pipeline/SAI/specs/dash_vnet.yaml index 297c8365e..ef055b4ae 100644 --- a/dash-pipeline/SAI/specs/dash_vnet.yaml +++ b/dash-pipeline/SAI/specs/dash_vnet.yaml @@ -22,3 +22,12 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 49590243 + actions: + default: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: default + id: 20510911 + attr_param_id: {} diff --git a/dash-pipeline/SAI/specs/route.yaml b/dash-pipeline/SAI/specs/route.yaml index a8a76551a..802138137 100644 --- a/dash-pipeline/SAI/specs/route.yaml +++ b/dash-pipeline/SAI/specs/route.yaml @@ -76,3 +76,14 @@ sai_apis: valid_only: null deprecated: null stats: [] + p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta + tables: + - !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable + id: 49279256 + actions: + SAI_ROUTE_ENTRY_ACTION_PKT_ACT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction + name: SAI_ROUTE_ENTRY_ACTION_PKT_ACT + id: 32404057 + attr_param_id: + SAI_ROUTE_ENTRY_PACKET_ACTION: 1 + SAI_ROUTE_ENTRY_NEXT_HOP_ID: 2 diff --git a/dash-pipeline/SAI/specs/sai_spec.yaml b/dash-pipeline/SAI/specs/sai_spec.yaml index 76e5b6129..27e0b385c 100644 --- a/dash-pipeline/SAI/specs/sai_spec.yaml +++ b/dash-pipeline/SAI/specs/sai_spec.yaml @@ -13,6 +13,7 @@ api_types: - SAI_API_ROUTE - SAI_API_DASH_VIP - SAI_API_DASH_TUNNEL +- SAI_API_DASH_ROUTING_GROUP object_types: - SAI_OBJECT_TYPE_DASH_ACL_GROUP - SAI_OBJECT_TYPE_DASH_ACL_RULE @@ -32,6 +33,7 @@ object_types: - SAI_OBJECT_TYPE_ROUTE_ENTRY - SAI_OBJECT_TYPE_VIP_ENTRY - SAI_OBJECT_TYPE_DASH_TUNNEL +- SAI_OBJECT_TYPE_ROUTING_GROUP object_entries: - !!python/object:utils.sai_spec.sai_struct_entry.SaiStructEntry name: direction_lookup_entry @@ -83,23 +85,19 @@ object_entries: valid_only: object_type == SAI_OBJECT_TYPE_VIP_ENTRY, enums: - !!python/object:utils.sai_spec.sai_enum.SaiEnum - name: sai_dash_direction_t + name: sai_dash_tunnel_dscp_mode_t description: '' members: - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember - name: INVALID + name: PRESERVE_MODEL description: '' value: '0' - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember - name: OUTBOUND + name: PIPE_MODEL description: '' value: '1' - - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember - name: INBOUND - description: '' - value: '2' - !!python/object:utils.sai_spec.sai_enum.SaiEnum - name: sai_dash_encapsulation_t + name: sai_dash_direction_t description: '' members: - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember @@ -107,11 +105,11 @@ enums: description: '' value: '0' - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember - name: VXLAN + name: OUTBOUND description: '' value: '1' - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember - name: NVGRE + name: INBOUND description: '' value: '2' - !!python/object:utils.sai_spec.sai_enum.SaiEnum @@ -138,18 +136,6 @@ enums: name: NAT_PORT description: '' value: '16' -- !!python/object:utils.sai_spec.sai_enum.SaiEnum - name: sai_dash_tunnel_dscp_mode_t - description: '' - members: - - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember - name: PRESERVE_MODEL - description: '' - value: '0' - - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember - name: PIPE_MODEL - description: '' - value: '1' - !!python/object:utils.sai_spec.sai_enum.SaiEnum name: sai_dash_ha_role_t description: '' @@ -174,6 +160,22 @@ enums: name: SWITCHING_TO_ACTIVE description: '' value: '4' +- !!python/object:utils.sai_spec.sai_enum.SaiEnum + name: sai_dash_encapsulation_t + description: '' + members: + - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember + name: INVALID + description: '' + value: '0' + - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember + name: VXLAN + description: '' + value: '1' + - !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember + name: NVGRE + description: '' + value: '2' port_extenstion: !!python/object:utils.sai_spec.sai_api_extension.SaiApiExtension attributes: [] stats: @@ -263,3 +265,4 @@ api_groups: - !inc '/SAI/specs/route.yaml' - !inc '/SAI/specs/dash_vip.yaml' - !inc '/SAI/specs/dash_tunnel.yaml' +- !inc '/SAI/specs/dash_routing_group.yaml' diff --git a/dash-pipeline/SAI/utils/dash_p4/dash_p4_counter.py b/dash-pipeline/SAI/utils/dash_p4/dash_p4_counter.py index 88ef46b62..bb20c8bfa 100644 --- a/dash-pipeline/SAI/utils/dash_p4/dash_p4_counter.py +++ b/dash-pipeline/SAI/utils/dash_p4/dash_p4_counter.py @@ -147,13 +147,13 @@ def generate_counter_sai_attributes(self) -> "Iterator[DashP4Counter]": # # Functions for generating SAI specs. # - def _get_sai_name(self, table_name: str) -> str: + def get_sai_name(self, table_name: str) -> str: if self.attr_type == "stats": return f"SAI_{table_name.upper()}_STAT_{self.name.upper()}" return f"SAI_{table_name.upper()}_{self.name.upper()}" - def _get_sai_description(self, table_name: str): + def get_sai_description(self, table_name: str): if self.attr_type == "stats": return f"DASH {table_name.upper()} {self.name.upper()} stat count" diff --git a/dash-pipeline/SAI/utils/dash_p4/dash_p4_table.py b/dash-pipeline/SAI/utils/dash_p4/dash_p4_table.py index 1fff37500..6b4a2ff71 100644 --- a/dash-pipeline/SAI/utils/dash_p4/dash_p4_table.py +++ b/dash-pipeline/SAI/utils/dash_p4/dash_p4_table.py @@ -5,7 +5,7 @@ from .dash_p4_table_action_param import * from .dash_p4_table_key import * from .dash_p4_table_action import * -from ..sai_spec import SaiApi, SaiStruct, SaiEnum, SaiEnumMember, SaiAttribute +from ..sai_spec import SaiApi, SaiStruct, SaiEnum, SaiEnumMember, SaiAttribute, SaiApiP4MetaAction, SaiApiP4MetaTable @dash_p4rt_parser @@ -264,6 +264,7 @@ def __build_sai_attributes_after_parsing(self): # def to_sai(self) -> SaiApi: sai_api = SaiApi(self.name, "", self.is_object != "false") + sai_api.p4_meta.tables.append(SaiApiP4MetaTable(self.id)) self.create_sai_action_enum(sai_api) self.create_sai_structs(sai_api) @@ -276,19 +277,36 @@ def create_sai_action_enum(self, sai_api: SaiApi) -> None: # If the table represents an SAI object, it should not have an action enum. # If the table has only 1 action, we don't need to create the action enum. if len(self.actions) <= 1 and self.is_object != "false": + # We still need to create the p4 meta action here for generating default action code in libsai. + if len(self.actions) == 1: + sai_api.p4_meta.tables[0].actions["default"] = SaiApiP4MetaAction("default", self.actions[0].id) return action_enum_member_value = 0 action_enum_members: List[SaiEnumMember] = [] for action in self.actions: + action_enum_member_name = f"SAI_{self.name.upper()}_ACTION_{action.name.upper()}" + action_enum_members.append( SaiEnumMember( - name=f"SAI_{self.name.upper()}_ACTION_{action.name.upper()}", + name=action_enum_member_name, description="", value=str(action_enum_member_value), ) ) + p4_meta_action = SaiApiP4MetaAction( + name=action_enum_member_name, + id=action.id, + ) + + for action_param in action.params: + p4_meta_action.attr_param_id[action_param.get_sai_name(self.name)] = action_param.id + + sai_api.p4_meta.tables[0].actions[action_enum_member_name] = p4_meta_action + + action_enum_member_value += 1 + action_enum_type_name = f"sai_{self.name.lower()}_action_t" action_enum = SaiEnum( @@ -307,6 +325,7 @@ def create_sai_action_enum(self, sai_api: SaiApi) -> None: ) sai_api.attributes.append(sai_attr_action) + def create_sai_structs(self, sai_api: SaiApi) -> None: # The entry struct is only needed for non-object tables. if self.is_object != "false": @@ -329,9 +348,9 @@ def create_sai_stats(self, sai_api: SaiApi) -> None: ] def create_sai_attributes(self, sai_api: SaiApi) -> None: - sai_api.attributes.extend( - [attr.to_sai_attribute(self.name) for attr in self.sai_attributes if attr.skipattr != "true"] - ) + for attr in self.sai_attributes: + if attr.skipattr != "true": + sai_api.attributes.append(attr.to_sai_attribute(self.name)) # If the table has an counter attached, we need to create a counter attribute for it. # The counter attribute only counts that packets that hits any entry, but not the packet that misses all entries. diff --git a/dash-pipeline/SAI/utils/dash_p4/dash_p4_table_attribute.py b/dash-pipeline/SAI/utils/dash_p4/dash_p4_table_attribute.py index 9563f3d51..74487d5c1 100644 --- a/dash-pipeline/SAI/utils/dash_p4/dash_p4_table_attribute.py +++ b/dash-pipeline/SAI/utils/dash_p4/dash_p4_table_attribute.py @@ -95,8 +95,8 @@ def set_sai_type(self, sai_type_info: SAITypeInfo) -> None: # Functions for generating SAI specs. # def to_sai_struct_entry(self, table_name: str) -> SaiStructEntry: - name = self._get_sai_name(table_name) - description = self._get_sai_description(table_name) + name = self.get_sai_name(table_name) + description = self.get_sai_description(table_name) object_name = f"SAI_OBJECT_TYPE_{self.object_name.upper()}" if self.object_name else None return SaiStructEntry( @@ -108,8 +108,8 @@ def to_sai_struct_entry(self, table_name: str) -> SaiStructEntry: ) def to_sai_attribute(self, table_name: str) -> SaiAttribute: - name = self._get_sai_name(table_name) - description = self._get_sai_description(table_name) + name = self.get_sai_name(table_name) + description = self.get_sai_description(table_name) default_value = None if self.isreadonly == "true" else self.default object_name = f"SAI_OBJECT_TYPE_{self.object_name.upper()}" if self.object_name else None @@ -129,8 +129,8 @@ def to_sai_attribute(self, table_name: str) -> SaiAttribute: valid_only = self.validonly, ) - def _get_sai_name(self, table_name: str) -> str: + def get_sai_name(self, table_name: str) -> str: return f"SAI_{table_name.upper()}_{self.name.upper()}" - def _get_sai_description(self, table_name: str): + def get_sai_description(self, table_name: str): return f"Action parameter {self.name.upper()}" \ No newline at end of file diff --git a/dash-pipeline/SAI/utils/dash_p4/dash_p4_table_group.py b/dash-pipeline/SAI/utils/dash_p4/dash_p4_table_group.py index c6db8c07d..e2c232a8c 100644 --- a/dash-pipeline/SAI/utils/dash_p4/dash_p4_table_group.py +++ b/dash-pipeline/SAI/utils/dash_p4/dash_p4_table_group.py @@ -1,7 +1,7 @@ from typing import List, Optional from .common import * from .dash_p4_table import DashP4Table -from ..sai_spec import SaiApiGroup +from ..sai_spec import SaiApiGroup, SaiApi class DashP4TableGroup(DashP4Object): @@ -25,20 +25,23 @@ def add_table(self, table: DashP4Table) -> None: self.tables.append(table) def post_parsing_process(self, all_table_names: List[str]) -> None: - self.__ignore_duplicated_tables_in_headers() - for table in self.tables: table.post_parsing_process(all_table_names) - - def __ignore_duplicated_tables_in_headers(self) -> None: - table_names = set() + + def to_sai(self) -> SaiApiGroup: + sai_api_list: List[SaiApi] = [] + sai_api_map: Dict[str, SaiApi] = {} for table in self.tables: - if table.name in table_names: + sai_api = table.to_sai() + + if table.name in sai_api_map: table.ignored_in_header = True - table_names.add(table.name) + sai_api_map[table.name].p4_meta.tables.extend(sai_api.p4_meta.tables) + else: + sai_api_map[table.name] = sai_api + sai_api_list.append(sai_api) - def to_sai(self) -> SaiApiGroup: sai_api_group = SaiApiGroup(self.app_name, "") - sai_api_group.sai_apis = [table.to_sai() for table in self.tables if not table.ignored_in_header] - return sai_api_group \ No newline at end of file + sai_api_group.sai_apis = sai_api_list + return sai_api_group diff --git a/dash-pipeline/SAI/utils/dash_p4/dash_p4_table_key.py b/dash-pipeline/SAI/utils/dash_p4/dash_p4_table_key.py index ec2c26f20..6dc1c58d4 100644 --- a/dash-pipeline/SAI/utils/dash_p4/dash_p4_table_key.py +++ b/dash-pipeline/SAI/utils/dash_p4/dash_p4_table_key.py @@ -61,11 +61,11 @@ def parse_p4rt(self, p4rt_table_key: Dict[str, Any]) -> None: # # Functions for generating SAI specs. # - def _get_sai_name(self, table_name: str) -> str: + def get_sai_name(self, table_name: str) -> str: if self.is_entry_key: return self.name return f"SAI_{table_name.upper()}_{self.name.upper()}" - def _get_sai_description(self, table_name: str): + def get_sai_description(self, table_name: str): return f"{self.match_type.capitalize()} matched key {self.name}" \ No newline at end of file diff --git a/dash-pipeline/SAI/utils/dash_p4/dash_sai_extensions.py b/dash-pipeline/SAI/utils/dash_p4/dash_sai_extensions.py index 19ae5bf26..897d99fbd 100644 --- a/dash-pipeline/SAI/utils/dash_p4/dash_sai_extensions.py +++ b/dash-pipeline/SAI/utils/dash_p4/dash_sai_extensions.py @@ -119,12 +119,14 @@ def post_parsing_process(self) -> None: # def to_sai(self) -> SaiSpec: sai_spec = SaiSpec() + sai_spec.api_groups = [api_group.to_sai() for api_group in self.table_groups] + self.create_sai_api_types(sai_spec) self.create_sai_object_types(sai_spec) self.create_sai_object_entries(sai_spec) self.create_sai_enums(sai_spec) self.create_sai_port_counters(sai_spec.port_extenstion) - sai_spec.api_groups = [api_group.to_sai() for api_group in self.table_groups] + return sai_spec def create_sai_api_types(self, sai_spec: SaiSpec): diff --git a/dash-pipeline/SAI/utils/sai_spec/__init__.py b/dash-pipeline/SAI/utils/sai_spec/__init__.py index e79348a72..3542b4756 100644 --- a/dash-pipeline/SAI/utils/sai_spec/__init__.py +++ b/dash-pipeline/SAI/utils/sai_spec/__init__.py @@ -7,3 +7,4 @@ from .sai_struct import SaiStruct from .sai_struct_entry import SaiStructEntry from .sai_attribute import SaiAttribute +from .sai_api_p4_meta import SaiApiP4Meta, SaiApiP4MetaTable, SaiApiP4MetaAction \ No newline at end of file diff --git a/dash-pipeline/SAI/utils/sai_spec/sai_api.py b/dash-pipeline/SAI/utils/sai_spec/sai_api.py index 494c11bc5..19f10f405 100644 --- a/dash-pipeline/SAI/utils/sai_spec/sai_api.py +++ b/dash-pipeline/SAI/utils/sai_spec/sai_api.py @@ -3,6 +3,7 @@ from .sai_attribute import SaiAttribute from .sai_enum import SaiEnum from .sai_struct import SaiStruct +from .sai_api_p4_meta import SaiApiP4Meta from . import sai_spec_utils @@ -18,6 +19,7 @@ def __init__(self, name: str, description: str, is_object: bool = False): self.structs: List[SaiStruct] = [] self.attributes: List[SaiAttribute] = [] self.stats: List[SaiAttribute] = [] + self.p4_meta: SaiApiP4Meta = SaiApiP4Meta() def merge(self, other: "SaiCommon"): super().merge(other) @@ -27,3 +29,7 @@ def merge(self, other: "SaiCommon"): sai_spec_utils.merge_sai_common_lists(self.structs, other.structs) sai_spec_utils.merge_sai_common_lists(self.attributes, other.attributes) sai_spec_utils.merge_sai_common_lists(self.stats, other.stats) + + # The P4 meta can be merged by replacing the old one, since it doesn't affect the ABI, + # and the new one is always more up-to-date. + self.p4_meta = other.p4_meta