Skip to content

Commit

Permalink
Use concrete SNAT/DNAT to replace NAT in flow actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyzhai committed Oct 24, 2024
1 parent c6bc6fc commit cb6d2bf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
14 changes: 9 additions & 5 deletions dash-pipeline/SAI/specs/sai_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -348,25 +348,29 @@ enums:
description: ''
value: '8'
- !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember
name: NAT
name: SNAT
description: ''
value: '16'
- !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember
name: NAT46
name: DNAT
description: ''
value: '32'
- !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember
name: NAT64
name: NAT46
description: ''
value: '64'
- !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember
name: NAT_PORT
name: NAT64
description: ''
value: '128'
- !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember
name: REVERSE_TUNNEL
name: SNAT_PORT
description: ''
value: '256'
- !!python/object:utils.sai_spec.sai_enum_member.SaiEnumMember
name: DNAT_PORT
description: ''
value: '512'
- !!python/object:utils.sai_spec.sai_enum.SaiEnum
name: sai_dash_ha_state_t
description: ''
Expand Down
11 changes: 6 additions & 5 deletions dash-pipeline/bmv2/dash_headers.p4
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,12 @@ enum bit<32> dash_flow_action_t {
ENCAP_U1 = (1 << 1),
SET_SMAC = (1 << 2),
SET_DMAC = (1 << 3),
NAT = (1 << 4),
NAT46 = (1 << 5),
NAT64 = (1 << 6),
NAT_PORT = (1 << 7),
REVERSE_TUNNEL = (1 << 8)
SNAT = (1 << 4),
DNAT = (1 << 5),
NAT46 = (1 << 6),
NAT64 = (1 << 7),
SNAT_PORT = (1 << 8),
DNAT_PORT = (1 << 9)
}

enum bit<16> dash_flow_enabled_key_t {
Expand Down
2 changes: 0 additions & 2 deletions dash-pipeline/bmv2/dash_pipeline.p4
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ control dash_eni_stage(
meta.enable_reverse_tunnel_learning = enable_reverse_tunnel_learning;
meta.reverse_tunnel_sip = reverse_tunnel_sip;

meta.routing_actions = meta.routing_actions | dash_routing_actions_t.REVERSE_TUNNEL;

if (meta.is_overlay_ip_v6 == 1) {
if (meta.direction == dash_direction_t.OUTBOUND) {
ACL_GROUPS_COPY_TO_META(outbound_v6);
Expand Down

0 comments on commit cb6d2bf

Please sign in to comment.