Skip to content

Commit

Permalink
[sai-gen] Parse P4 metadata into SAI spec for lib generation. (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
r12f authored Jun 18, 2024
1 parent 235e43b commit 26c9357
Show file tree
Hide file tree
Showing 23 changed files with 523 additions and 60 deletions.
131 changes: 128 additions & 3 deletions dash-pipeline/SAI/specs/dash_acl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand All @@ -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
Expand Down Expand Up @@ -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: {}
9 changes: 9 additions & 0 deletions dash-pipeline/SAI/specs/dash_direction_lookup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
55 changes: 55 additions & 0 deletions dash-pipeline/SAI/specs/dash_eni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: {}
18 changes: 18 additions & 0 deletions dash-pipeline/SAI/specs/dash_ha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand Down Expand Up @@ -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: {}
32 changes: 29 additions & 3 deletions dash-pipeline/SAI/specs/dash_inbound_routing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: {}
27 changes: 27 additions & 0 deletions dash-pipeline/SAI/specs/dash_meter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand All @@ -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: ''
Expand Down Expand Up @@ -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: {}
Loading

0 comments on commit 26c9357

Please sign in to comment.