Skip to content

Commit 4e4fe3a

Browse files
committed
Add table global_trusted_vni
1 parent 9e59f27 commit 4e4fe3a

File tree

3 files changed

+89
-1
lines changed

3 files changed

+89
-1
lines changed

dash-pipeline/SAI/specs/dash_trusted_vni.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,68 @@ sai_apis:
8282
name: SAI_TRUSTED_VNI_ENTRY_ACTION_PERMIT
8383
id: 24633826
8484
attr_params: {}
85+
- !!python/object:utils.sai_spec.sai_api.SaiApi
86+
name: global_trusted_vni_entry
87+
description: global trusted VNI entry
88+
is_object: false
89+
enums:
90+
- !!python/object:utils.sai_spec.sai_enum.SaiEnum
91+
name: sai_global_trusted_vni_entry_action_t
92+
description: 'Attribute data for #SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_ACTION'
93+
members:
94+
- !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember
95+
name: SAI_GLOBAL_TRUSTED_VNI_ENTRY_ACTION_PERMIT
96+
description: ''
97+
value: '0'
98+
structs:
99+
- !!python/object:utils.sai_spec.sai_struct.SaiStruct
100+
name: sai_global_trusted_vni_entry_t
101+
description: Entry for global_trusted_vni_entry
102+
members:
103+
- !!python/object:utils.sai_spec.sai_struct_entry.SaiStructEntry
104+
name: switch_id
105+
description: Switch ID
106+
type: sai_object_id_t
107+
objects: SAI_OBJECT_TYPE_SWITCH
108+
valid_only: null
109+
- !!python/object:utils.sai_spec.sai_struct_entry.SaiStructEntry
110+
name: vni_range
111+
description: Range matched key vni_range
112+
type: sai_u32_range_t
113+
objects: null
114+
valid_only: null
115+
attributes:
116+
- !!python/object:utils.sai_spec.sai_attribute.SaiAttribute
117+
name: SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_ACTION
118+
description: Action
119+
type: sai_global_trusted_vni_entry_action_t
120+
attr_value_field: null
121+
default: SAI_GLOBAL_TRUSTED_VNI_ENTRY_ACTION_PERMIT
122+
isresourcetype: false
123+
flags: CREATE_AND_SET
124+
object_name: null
125+
allow_null: false
126+
valid_only: null
127+
is_vlan: false
128+
deprecated: false
129+
stats: []
130+
p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta
131+
tables:
132+
- !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable
133+
id: 46906561
134+
single_match_priority: true
135+
stage: null
136+
keys:
137+
- !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaKey
138+
name: vni_range
139+
id: 1
140+
match_type: range
141+
field: u32range
142+
bitwidth: 24
143+
ip_is_v6_field_id: 0
144+
is_object_key: false
145+
actions:
146+
SAI_GLOBAL_TRUSTED_VNI_ENTRY_ACTION_PERMIT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction
147+
name: SAI_GLOBAL_TRUSTED_VNI_ENTRY_ACTION_PERMIT
148+
id: 24633826
149+
attr_params: {}

dash-pipeline/SAI/specs/sai_spec.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ object_types:
4848
- SAI_OBJECT_TYPE_OUTBOUND_PORT_MAP
4949
- SAI_OBJECT_TYPE_OUTBOUND_PORT_MAP_PORT_RANGE_ENTRY
5050
- SAI_OBJECT_TYPE_TRUSTED_VNI_ENTRY
51+
- SAI_OBJECT_TYPE_GLOBAL_TRUSTED_VNI_ENTRY
5152
object_entries:
5253
- !!python/object:utils.sai_spec.sai_struct_entry.SaiStructEntry
5354
name: direction_lookup_entry
@@ -121,6 +122,12 @@ object_entries:
121122
type: sai_trusted_vni_entry_t
122123
objects: null
123124
valid_only: object_type == SAI_OBJECT_TYPE_TRUSTED_VNI_ENTRY,
125+
- !!python/object:utils.sai_spec.sai_struct_entry.SaiStructEntry
126+
name: global_trusted_vni_entry
127+
description: Object entry for DASH API global_trusted_vni_entry
128+
type: sai_global_trusted_vni_entry_t
129+
objects: null
130+
valid_only: object_type == SAI_OBJECT_TYPE_GLOBAL_TRUSTED_VNI_ENTRY,
124131
enums:
125132
- !!python/object:utils.sai_spec.sai_enum.SaiEnum
126133
name: sai_dash_direction_t

dash-pipeline/bmv2/stages/trusted_vni.p4

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ control trusted_vni_stage(
1111
meta.dropped = true;
1212
}
1313

14+
@SaiTable[single_match_priority = "true", api = "dash_trusted_vni", order=1, isobject="false"]
15+
table global_trusted_vni {
16+
key = {
17+
meta.rx_encap.vni: range @SaiVal[name = "vni_range"];
18+
}
19+
20+
actions = {
21+
permit;
22+
@defaultonly deny;
23+
}
24+
const default_action = deny;
25+
}
26+
27+
1428
@SaiTable[single_match_priority = "true", api = "dash_trusted_vni"]
1529
table trusted_vni {
1630
key = {
@@ -26,7 +40,9 @@ control trusted_vni_stage(
2640
}
2741

2842
apply {
29-
trusted_vni.apply();
43+
if (global_trusted_vni.apply().hit) {
44+
trusted_vni.apply();
45+
}
3046
}
3147
}
3248

0 commit comments

Comments
 (0)