From 034c99214bc6157712b52ab88a690db8f4e5e6a3 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Mon, 27 Jun 2022 15:42:35 -0400 Subject: [PATCH] Proposed changes to pna.p4 and one example PNA P4 program The others would need to be changed similarly if this proposal goes forward. --- examples/pna-demo-L2-two-tables.p4 | 2 +- pna.p4 | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/pna-demo-L2-two-tables.p4 b/examples/pna-demo-L2-two-tables.p4 index fe0025f..03ce216 100644 --- a/examples/pna-demo-L2-two-tables.p4 +++ b/examples/pna-demo-L2-two-tables.p4 @@ -77,7 +77,7 @@ control MainControlImpl( drop_packet(); } action L2_send_to_port (PortId_t port_id) { - send_to_port(port_id); + ostd.egress_port = port_id; } // In this demo program, I have chosen to use the same action diff --git a/pna.p4 b/pna.p4 index 98c50fe..78c6dfc 100644 --- a/pna.p4 +++ b/pna.p4 @@ -623,6 +623,7 @@ struct pna_main_output_metadata_t { // common fields used by the architecture to decide what to do with // the packet next, after the main parser, control, and deparser // have finished executing one pass, regardless of the direction. + PortId_t egress_port; ClassOfService_t class_of_service; // 0 } // END:Metadata_main_output @@ -636,7 +637,6 @@ struct pna_main_output_metadata_t { // actually take effect for the packet. // + drop_packet -// + send_to_port // drop_packet() - Cause the packet to be dropped when it finishes @@ -646,8 +646,6 @@ struct pna_main_output_metadata_t { extern void drop_packet(); -extern void send_to_port(PortId_t dest_port); - extern void mirror_packet(MirrorSlotId_t mirror_slot_id, MirrorSessionId_t mirror_session_id);