diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index 498b7bc..218e2bc 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -28,11 +28,13 @@ control MyIngress(inout headers hdr, action controller_debug() { meta.task = TASK_DEBUG; + meta.ingress_port = standard_metadata.ingress_port; clone3(CloneType.I2E, 100, meta); } action controller_reply(task_t task) { meta.task = task; + meta.ingress_port = standard_metadata.ingress_port; clone3(CloneType.I2E, 100, meta); } @@ -206,6 +208,7 @@ control MyEgress(inout headers hdr, hdr.cpu.setValid(); hdr.cpu.task = meta.task; hdr.cpu.ethertype = hdr.ethernet.ethertype; + hdr.cpu.ingress_port = (bit<16>)meta.ingress_port; hdr.ethernet.ethertype = TYPE_CPU; }