From 1dd954216890653f30512187b90de6309c02020e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Mar 2019 18:10:24 +0100 Subject: [PATCH] Also expose ingrees port to controller --- p4src/static-mapping.p4 | 3 +++ 1 file changed, 3 insertions(+) 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; }