Skip to content

Commit

Permalink
Make sure action param id is unique for all params of table actions.
Browse files Browse the repository at this point in the history
This avoids the impaction of a bug in dash sai api implementation (saiapi.cpp.j2).
  • Loading branch information
jimmyzhai committed Sep 27, 2024
1 parent 7953ea8 commit fa37fd6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions dash-pipeline/SAI/specs/dash_inbound_routing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ sai_apis:
name: SAI_INBOUND_ROUTING_ENTRY_ACTION_TUNNEL_DECAP_PA_VALIDATE
id: 27987616
attr_param_id:
SAI_INBOUND_ROUTING_ENTRY_ATTR_SRC_VNET_ID: 1
SAI_INBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_OR: 2
SAI_INBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_AND: 3
SAI_INBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_OR: 1
SAI_INBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_AND: 2
SAI_INBOUND_ROUTING_ENTRY_ATTR_SRC_VNET_ID: 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
Expand Down
8 changes: 4 additions & 4 deletions dash-pipeline/SAI/specs/dash_outbound_routing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@ sai_apis:
attr_param_id:
SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID: 1
SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DASH_TUNNEL_ID: 2
SAI_OUTBOUND_ROUTING_ENTRY_ATTR_OVERLAY_IP: 4
SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_OR: 5
SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_AND: 6
SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ROUTING_ACTIONS_DISABLED_IN_FLOW_RESIMULATION: 7
SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_OR: 3
SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_AND: 4
SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ROUTING_ACTIONS_DISABLED_IN_FLOW_RESIMULATION: 5
SAI_OUTBOUND_ROUTING_ENTRY_ATTR_OVERLAY_IP: 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
Expand Down
4 changes: 2 additions & 2 deletions dash-pipeline/bmv2/dash_pipeline.p4
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ control dash_ingress(

action tunnel_decap_pa_validate(inout headers_t hdr,
inout metadata_t meta,
@SaiVal[type="sai_object_id_t"] bit<16> src_vnet_id,
bit<32> meter_class_or,
@SaiVal[default_value="4294967295"] bit<32> meter_class_and) {
@SaiVal[default_value="4294967295"] bit<32> meter_class_and,
@SaiVal[type="sai_object_id_t"] bit<16> src_vnet_id) {
meta.vnet_id = src_vnet_id;
set_meter_attrs(meta, meter_class_or, meter_class_and);
}
Expand Down
9 changes: 4 additions & 5 deletions dash-pipeline/bmv2/dash_routing_types.p4
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@ action route_vnet(
action route_vnet_direct(
inout headers_t hdr,
inout metadata_t meta,
bit<16> dst_vnet_id,
@SaiVal[type="sai_object_id_t"] bit<16> dst_vnet_id,
@SaiVal[type="sai_object_id_t"] bit<16> dash_tunnel_id,
bit<1> overlay_ip_is_v6,
@SaiVal[type="sai_ip_address_t"]
IPv4ORv6Address overlay_ip,
bit<32> meter_class_or,
@SaiVal[default_value="4294967295"] bit<32> meter_class_and,
dash_routing_actions_t routing_actions_disabled_in_flow_resimulation)
dash_routing_actions_t routing_actions_disabled_in_flow_resimulation,
bit<1> overlay_ip_is_v6,
@SaiVal[type="sai_ip_address_t"] IPv4ORv6Address overlay_ip)
{
meta.dash_tunnel_id = dash_tunnel_id;

Expand Down

0 comments on commit fa37fd6

Please sign in to comment.