Skip to content

Commit

Permalink
Move underlay SIP resolution to VIP table (#176)
Browse files Browse the repository at this point in the history
Signed-off-by: Marian Pritsak <[email protected]>
  • Loading branch information
marian-pritsak authored Aug 5, 2022
1 parent 6f4d802 commit 4722b09
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions dash-pipeline/bmv2/dash_pipeline.p4
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,12 @@ control dash_ingress(inout headers_t hdr,
}

action set_appliance(EthernetAddress neighbor_mac,
EthernetAddress mac,
IPv4Address ip) {
EthernetAddress mac) {
meta.encap_data.underlay_dmac = neighbor_mac;
meta.encap_data.underlay_smac = mac;
meta.encap_data.underlay_sip = ip;
}

/* This table API should be implemented manually using underlay SAI */
table appliance {
key = {
meta.appliance_id : ternary @name("meta.appliance_id:appliance_id");
Expand Down Expand Up @@ -232,7 +231,11 @@ control dash_ingress(inout headers_t hdr,
/* Send packet on same port it arrived (echo) by default */
standard_metadata.egress_spec = standard_metadata.ingress_port;

vip.apply();
if (vip.apply().hit) {
/* Use the same VIP that was in packet's destination if it's
present in the VIP table */
meta.encap_data.underlay_sip = hdr.ipv4.dst_addr;
}
// TODO [cs] shouldn't this also be called at end of ingress?
// Shouldn't it call mark_to_drop(standard_metadata);

Expand Down Expand Up @@ -311,4 +314,4 @@ V1Switch(dash_parser(),
dash_ingress(),
dash_egress(),
dash_compute_checksum(),
dash_deparser()) main;
dash_deparser()) main;

0 comments on commit 4722b09

Please sign in to comment.