From 185f8b1f47625c6629c84849cf24eb913809665f Mon Sep 17 00:00:00 2001 From: Junhua Zhai Date: Thu, 14 Nov 2024 05:28:30 +0000 Subject: [PATCH] dpapp_mac -> cpu_mac, host0_mac -> neighbor_mac --- dash-pipeline/bmv2/dash_metadata.p4 | 2 +- dash-pipeline/bmv2/stages/conntrack_lookup.p4 | 2 +- dash-pipeline/bmv2/stages/pre_pipeline.p4 | 4 ++-- .../functional/ptf/saidashvnet_sanity.py | 24 +++++++++---------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/dash-pipeline/bmv2/dash_metadata.p4 b/dash-pipeline/bmv2/dash_metadata.p4 index a166ef3e3..bcbbe8ba6 100644 --- a/dash-pipeline/bmv2/dash_metadata.p4 +++ b/dash-pipeline/bmv2/dash_metadata.p4 @@ -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_ */ diff --git a/dash-pipeline/bmv2/stages/conntrack_lookup.p4 b/dash-pipeline/bmv2/stages/conntrack_lookup.p4 index 9f8a18d54..805076dcc 100644 --- a/dash-pipeline/bmv2/stages/conntrack_lookup.p4 +++ b/dash-pipeline/bmv2/stages/conntrack_lookup.p4 @@ -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; } diff --git a/dash-pipeline/bmv2/stages/pre_pipeline.p4 b/dash-pipeline/bmv2/stages/pre_pipeline.p4 index a2c0d3cd0..a3b6f3610 100644 --- a/dash-pipeline/bmv2/stages/pre_pipeline.p4 +++ b/dash-pipeline/bmv2/stages/pre_pipeline.p4 @@ -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; } diff --git a/test/test-cases/functional/ptf/saidashvnet_sanity.py b/test/test-cases/functional/ptf/saidashvnet_sanity.py index ae35e2258..6b2ab9a65 100644 --- a/test/test-cases/functional/ptf/saidashvnet_sanity.py +++ b/test/test-cases/functional/ptf/saidashvnet_sanity.py @@ -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. @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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,