Skip to content

Commit

Permalink
Add missing masks to PL action (#588)
Browse files Browse the repository at this point in the history
Signed-off-by: Marian Pritsak <[email protected]>
  • Loading branch information
marian-pritsak authored Jun 14, 2024
1 parent fafe00f commit 124c139
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
24 changes: 24 additions & 0 deletions dash-pipeline/SAI/specs/dash_outbound_ca_to_pa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,18 @@ sai_apis:
allow_null: false
valid_only: null
deprecated: null
- !!python/object:utils.sai_spec.sai_attribute.SaiAttribute
name: SAI_OUTBOUND_CA_TO_PA_ENTRY_OVERLAY_SIP_MASK
description: Action parameter OVERLAY_SIP_MASK
type: sai_ip_address_t
attr_value_field: ipaddr
default: 0.0.0.0
isresourcetype: false
flags: CREATE_AND_SET
object_name: null
allow_null: false
valid_only: null
deprecated: null
- !!python/object:utils.sai_spec.sai_attribute.SaiAttribute
name: SAI_OUTBOUND_CA_TO_PA_ENTRY_OVERLAY_DIP
description: Action parameter OVERLAY_DIP
Expand All @@ -145,6 +157,18 @@ sai_apis:
allow_null: false
valid_only: null
deprecated: null
- !!python/object:utils.sai_spec.sai_attribute.SaiAttribute
name: SAI_OUTBOUND_CA_TO_PA_ENTRY_OVERLAY_DIP_MASK
description: Action parameter OVERLAY_DIP_MASK
type: sai_ip_address_t
attr_value_field: ipaddr
default: 0.0.0.0
isresourcetype: false
flags: CREATE_AND_SET
object_name: null
allow_null: false
valid_only: null
deprecated: null
- !!python/object:utils.sai_spec.sai_attribute.SaiAttribute
name: SAI_OUTBOUND_CA_TO_PA_ENTRY_DASH_ENCAPSULATION
description: Action parameter DASH_ENCAPSULATION
Expand Down
6 changes: 4 additions & 2 deletions dash-pipeline/bmv2/dash_routing_types.p4
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ action set_private_link_mapping(
inout metadata_t meta,
@SaiVal[type="sai_ip_address_t"] IPv4Address underlay_dip,
IPv6Address overlay_sip,
IPv6Address overlay_sip_mask,
IPv6Address overlay_dip,
IPv6Address overlay_dip_mask,
@SaiVal[type="sai_dash_encapsulation_t"] dash_encapsulation_t dash_encapsulation,
bit<24> tunnel_key,
bit<32> meter_class_or,
Expand Down Expand Up @@ -197,8 +199,8 @@ action set_private_link_mapping(
push_action_nat46(hdr = hdr,
meta = meta,
dip = overlay_dip,
dip_mask = 0xffffffffffffffffffffffff,
sip = (overlay_sip & ~meta.eni_data.pl_sip_mask) | meta.eni_data.pl_sip | (IPv6Address)hdr.u0_ipv4.src_addr,
dip_mask = overlay_dip_mask,
sip = ((( (IPv6Address)hdr.u0_ipv4.src_addr & ~overlay_sip_mask) | overlay_sip) & ~meta.eni_data.pl_sip_mask) | meta.eni_data.pl_sip,
sip_mask = 0xffffffffffffffffffffffff);
#endif /* DISABLE_128BIT_ARITHMETIC */

Expand Down

0 comments on commit 124c139

Please sign in to comment.