Skip to content

Commit ce49ffd

Browse files
committed
Add table global_trusted_vni
1 parent 9e59f27 commit ce49ffd

File tree

5 files changed

+96
-7
lines changed

5 files changed

+96
-7
lines changed

dash-pipeline/SAI/specs/dash_eni.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ sai_apis:
660660
attr_value_field: s32
661661
default: SAI_DASH_ENI_MODE_VM
662662
isresourcetype: false
663-
flags: CREATE_AND_SET
663+
flags: CREATE_ONLY
664664
object_name: null
665665
allow_null: false
666666
valid_only: null

dash-pipeline/SAI/specs/dash_trusted_vni.yaml

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ sai_apis:
5757
p4_meta: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4Meta
5858
tables:
5959
- !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaTable
60-
id: 38326132
60+
id: 49370429
6161
single_match_priority: true
6262
stage: null
6363
keys:
@@ -80,5 +80,70 @@ sai_apis:
8080
actions:
8181
SAI_TRUSTED_VNI_ENTRY_ACTION_PERMIT: !!python/object:utils.sai_spec.sai_api_p4_meta.SaiApiP4MetaAction
8282
name: SAI_TRUSTED_VNI_ENTRY_ACTION_PERMIT
83-
id: 24633826
83+
id: 29028174
84+
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: 45800410
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: 29028174
84149
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/dash_pipeline.p4

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ control dash_eni_stage(
6969
@SaiVal[type="sai_ip_address_t"] IPv4Address reverse_tunnel_sip,
7070
bit<1> is_ha_flow_owner,
7171
@SaiVal[type="sai_object_id_t"] bit<16> flow_table_id,
72-
@SaiVal[type="sai_dash_eni_mode_t"] dash_eni_mode_t dash_eni_mode)
72+
@SaiVal[type="sai_dash_eni_mode_t", create_only="true"] dash_eni_mode_t dash_eni_mode)
7373
{
7474
meta.eni_data.cps = cps;
7575
meta.eni_data.pps = pps;
@@ -137,9 +137,6 @@ control dash_eni_stage(
137137
if (!eni.apply().hit) {
138138
UPDATE_COUNTER(eni_miss_drop, 0);
139139
}
140-
else if (meta.eni_data.eni_mode == dash_eni_mode_t.FNIC) {
141-
trusted_vni_stage.apply(hdr, meta);
142-
}
143140
}
144141
}
145142

@@ -208,6 +205,10 @@ control dash_match_stage(
208205
}
209206

210207
apply {
208+
if (meta.dropped) {
209+
return;
210+
}
211+
211212
acl_group.apply();
212213

213214
if (meta.direction == dash_direction_t.OUTBOUND) {
@@ -284,6 +285,7 @@ control dash_ingress(
284285
(meta.flow_sync_state == dash_flow_sync_state_t.FLOW_MISS &&
285286
hdr.packet_meta.packet_source == dash_packet_source_t.EXTERNAL))
286287
{
288+
trusted_vni_stage.apply(hdr, meta);
287289
dash_match_stage.apply(hdr, meta);
288290
if (meta.dropped) {
289291
drop_action();

dash-pipeline/bmv2/stages/trusted_vni.p4

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ 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+
}
23+
}
24+
1425
@SaiTable[single_match_priority = "true", api = "dash_trusted_vni"]
1526
table trusted_vni {
1627
key = {
@@ -26,6 +37,10 @@ control trusted_vni_stage(
2637
}
2738

2839
apply {
40+
if (global_trusted_vni.apply().hit) {
41+
return;
42+
}
43+
2944
trusted_vni.apply();
3045
}
3146
}

0 commit comments

Comments
 (0)