Skip to content

Commit

Permalink
dpapp_mac -> cpu_mac, host0_mac -> neighbor_mac
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyzhai committed Nov 14, 2024
1 parent 7614d49 commit 185f8b1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dash-pipeline/bmv2/dash_metadata.p4
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ struct metadata_t {
bit<16> dash_tunnel_next_hop_id;
bit<32> meter_class;
bit<8> local_region_id;
EthernetAddress dpapp_mac;
EthernetAddress cpu_mac;
}

#endif /* _SIRIUS_METADATA_P4_ */
2 changes: 1 addition & 1 deletion dash-pipeline/bmv2/stages/conntrack_lookup.p4
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ control conntrack_build_dash_header(inout headers_t hdr, in metadata_t meta,
hdr.packet_meta.length = length + PACKET_META_HDR_SIZE;

hdr.dp_ethernet.setValid();
hdr.dp_ethernet.dst_addr = meta.dpapp_mac;
hdr.dp_ethernet.dst_addr = meta.cpu_mac;
hdr.dp_ethernet.src_addr = meta.u0_encap_data.underlay_smac;
hdr.dp_ethernet.ether_type = DASH_ETHTYPE;
}
Expand Down
4 changes: 2 additions & 2 deletions dash-pipeline/bmv2/stages/pre_pipeline.p4
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ control pre_pipeline_stage(inout headers_t hdr,

action set_internal_config(EthernetAddress neighbor_mac,
EthernetAddress mac,
EthernetAddress dpapp_mac,
EthernetAddress cpu_mac,
bit<1> flow_enabled) {
meta.u0_encap_data.underlay_dmac = neighbor_mac;
meta.u0_encap_data.underlay_smac = mac;
meta.dpapp_mac = dpapp_mac;
meta.cpu_mac = cpu_mac;
meta.flow_enabled = (bool)flow_enabled;
}

Expand Down
24 changes: 12 additions & 12 deletions test/test-cases/functional/ptf/saidashvnet_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def setUp(self):
self.sai_ip_addr_family = SAI_IP_ADDR_FAMILY_IPV4

self.dut_mac = get_mac("veth0")
self.host0_mac = get_mac("veth1") # ptf port0
set_internal_config(neighbor_mac = mac_in_bytes(self.host0_mac),
self.neighbor_mac = get_mac("veth1")
set_internal_config(neighbor_mac = mac_in_bytes(self.neighbor_mac),
mac = mac_in_bytes(self.dut_mac))

# Flag to indicate whether configureVnet were successful or not.
Expand Down Expand Up @@ -170,7 +170,7 @@ def trafficTest(self):
ip_dst=self.dst_ca_ip,
ip_src=src_vm_ip)
vxlan_pkt = simple_vxlan_packet(eth_dst=self.dut_mac,
eth_src=self.host0_mac,
eth_src=self.neighbor_mac,
ip_dst=wrong_vip,
ip_src=self.src_vm_pa_ip,
udp_sport=11638,
Expand All @@ -189,7 +189,7 @@ def trafficTest(self):
ip_dst=wrong_dst_ca,
ip_src=src_vm_ip)
vxlan_pkt = simple_vxlan_packet(eth_dst=self.dut_mac,
eth_src=self.host0_mac,
eth_src=self.neighbor_mac,
ip_dst=self.vip,
ip_src=self.src_vm_pa_ip,
udp_sport=11638,
Expand All @@ -208,7 +208,7 @@ def trafficTest(self):
ip_dst=wrong_dst_ca,
ip_src=src_vm_ip)
vxlan_pkt = simple_vxlan_packet(eth_dst=self.dut_mac,
eth_src=self.host0_mac,
eth_src=self.neighbor_mac,
ip_dst=self.vip,
ip_src=self.src_vm_pa_ip,
udp_sport=11638,
Expand All @@ -226,7 +226,7 @@ def trafficTest(self):
ip_dst=self.dst_ca_ip,
ip_src=src_vm_ip)
vxlan_pkt = simple_vxlan_packet(eth_dst=self.dut_mac,
eth_src=self.host0_mac,
eth_src=self.neighbor_mac,
ip_dst=self.vip,
ip_src=self.src_vm_pa_ip,
udp_sport=11638,
Expand All @@ -238,7 +238,7 @@ def trafficTest(self):
eth_src=self.eni_mac,
ip_dst=self.dst_ca_ip,
ip_src=src_vm_ip)
vxlan_exp_pkt = simple_vxlan_packet(eth_dst=self.host0_mac,
vxlan_exp_pkt = simple_vxlan_packet(eth_dst=self.neighbor_mac,
eth_src=self.dut_mac,
ip_dst=self.dst_pa_ip,
ip_src=self.vip,
Expand Down Expand Up @@ -326,7 +326,7 @@ def trafficTest(self):
ipv6_dst=self.dst_ca_ip,
ipv6_src=src_vm_ip)
vxlan_pkt = simple_vxlan_packet(eth_dst=self.dut_mac,
eth_src=self.host0_mac,
eth_src=self.neighbor_mac,
ip_dst=wrong_vip,
ip_src=self.src_vm_pa_ip,
udp_sport=11638,
Expand All @@ -345,7 +345,7 @@ def trafficTest(self):
ipv6_dst=wrong_dst_ca,
ipv6_src=src_vm_ip)
vxlan_pkt = simple_vxlan_packet(eth_dst=self.dut_mac,
eth_src=self.host0_mac,
eth_src=self.neighbor_mac,
ip_dst=self.vip,
ip_src=self.src_vm_pa_ip,
udp_sport=11638,
Expand All @@ -364,7 +364,7 @@ def trafficTest(self):
ipv6_dst=wrong_dst_ca,
ipv6_src=src_vm_ip)
vxlan_pkt = simple_vxlan_packet(eth_dst=self.dut_mac,
eth_src=self.host0_mac,
eth_src=self.neighbor_mac,
ip_dst=self.vip,
ip_src=self.src_vm_pa_ip,
udp_sport=11638,
Expand All @@ -382,7 +382,7 @@ def trafficTest(self):
ipv6_dst=self.dst_ca_ip,
ipv6_src=src_vm_ip)
vxlan_pkt = simple_vxlan_packet(eth_dst=self.dut_mac,
eth_src=self.host0_mac,
eth_src=self.neighbor_mac,
ip_dst=self.vip,
ip_src=self.src_vm_pa_ip,
udp_sport=11638,
Expand All @@ -394,7 +394,7 @@ def trafficTest(self):
eth_src=self.eni_mac,
ipv6_dst=self.dst_ca_ip,
ipv6_src=src_vm_ip)
vxlan_exp_pkt = simple_vxlan_packet(eth_dst=self.host0_mac,
vxlan_exp_pkt = simple_vxlan_packet(eth_dst=self.neighbor_mac,
eth_src=self.dut_mac,
ip_dst=self.dst_pa_ip,
ip_src=self.vip,
Expand Down

0 comments on commit 185f8b1

Please sign in to comment.