Skip to content

Commit

Permalink
Fix set_tunnel (#467)
Browse files Browse the repository at this point in the history
* Fix set_tunnel

Pass encapsulation type as parameter to set_tunnel instead of overriding what upper functions got.

* Update dash_outbound.p4

* Update dash_outbound.p4
  • Loading branch information
marian-pritsak authored Dec 6, 2023
1 parent 056d03e commit 2b1584b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dash-pipeline/bmv2/dash_outbound.p4
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ control outbound(inout headers_t hdr,
}

action set_tunnel(IPv4Address underlay_dip,
dash_encapsulation_t dash_encapsulation,
bit<16> meter_class,
bit<1> meter_class_override) {
meta.encap_data.underlay_dip = underlay_dip;
meta.mapping_meter_class = meter_class;
meta.mapping_meter_class_override = meter_class_override;
meta.encap_data.dash_encapsulation = dash_encapsulation_t.VXLAN;
meta.encap_data.dash_encapsulation = dash_encapsulation;
}

action set_tunnel_mapping(IPv4Address underlay_dip,
Expand All @@ -137,6 +138,7 @@ control outbound(inout headers_t hdr,
meta.encap_data.overlay_dmac = overlay_dmac;

set_tunnel(underlay_dip,
dash_encapsulation_t.VXLAN,
meter_class,
meter_class_override);
}
Expand All @@ -149,7 +151,6 @@ control outbound(inout headers_t hdr,
bit<16> meter_class,
bit<1> meter_class_override) {
meta.encap_data.overlay_dmac = hdr.ethernet.dst_addr;
meta.encap_data.dash_encapsulation = dash_encapsulation;
meta.encap_data.vni = tunnel_key;

service_tunnel_encode(hdr,
Expand All @@ -159,6 +160,7 @@ control outbound(inout headers_t hdr,
0xffffffffffffffffffffffff);

set_tunnel(underlay_dip,
dash_encapsulation,
meter_class,
meter_class_override);
}
Expand Down

0 comments on commit 2b1584b

Please sign in to comment.