From 99b0b8f3091c32aee360f82b3b8ec1674a3439f5 Mon Sep 17 00:00:00 2001 From: Marian Pritsak Date: Sat, 1 Jul 2023 01:39:41 +0300 Subject: [PATCH] Fix ENI lookup ordering Signed-off-by: Marian Pritsak --- dash-pipeline/bmv2/dash_pipeline.p4 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dash-pipeline/bmv2/dash_pipeline.p4 b/dash-pipeline/bmv2/dash_pipeline.p4 index ea6575ada..bf1c45837 100644 --- a/dash-pipeline/bmv2/dash_pipeline.p4 +++ b/dash-pipeline/bmv2/dash_pipeline.p4 @@ -405,6 +405,12 @@ control dash_ingress( /* Outer header processing */ + /* Put VM's MAC in the direction agnostic metadata field */ + meta.eni_addr = meta.direction == dash_direction_t.OUTBOUND ? + hdr.inner_ethernet.src_addr : + hdr.inner_ethernet.dst_addr; + + eni_ether_address_map.apply(); if (meta.direction == dash_direction_t.OUTBOUND) { vxlan_decap(hdr); } else if (meta.direction == dash_direction_t.INBOUND) { @@ -416,6 +422,8 @@ control dash_ingress( } } + /* At this point the processing is done on customer headers */ + meta.is_overlay_ip_v6 = 0; meta.ip_protocol = 0; meta.dst_ip_addr = 0; @@ -439,13 +447,6 @@ control dash_ingress( meta.dst_l4_port = hdr.udp.dst_port; } - /* At this point the processing is done on customer headers */ - - /* Put VM's MAC in the direction agnostic metadata field */ - meta.eni_addr = meta.direction == dash_direction_t.OUTBOUND ? - hdr.ethernet.src_addr : - hdr.ethernet.dst_addr; - eni_ether_address_map.apply(); eni.apply(); if (meta.eni_data.admin_state == 0) { deny();