integrate netpfga/p4 generic

This commit is contained in:
Nico Schottelius 2019-07-10 22:28:37 +02:00
commit ff1688e3b2
13 changed files with 214 additions and 897 deletions

View file

@ -3,19 +3,30 @@
/********************** GENERAL ACTIONS ***********************************/
action controller_reply(task_t task) {
meta.task = task;
meta.ingress_port = standard_metadata.ingress_port;
clone3(CloneType.I2E, 100, meta);
}
#ifndef _SUME_SWITCH_P4_
action controller_reply(task_t task) {
meta.task = task;
meta.ingress_port = sume_metadata.src_port;
clone3(CloneType.I2E, 100, meta);
}
action controller_debug_table_id(table_t table_id) {
meta.table_id = table_id;
controller_reply(TASK_DEBUG);
}
#else
#include "action_egress.p4"
action controller_debug() {
controller_reply(TASK_DEBUG);
}
action controller_reply(task_t task) {
meta.task = task;
meta.ingress_port = standard_metadata.ingress_port;
set_egress_port(4); /* port1 = 1, port2 = 2, port3=4 */
}
#endif /* _SUME_SWITCH_P4_ */
action controller_debug_table_id(table_t table_id) {
meta.table_id = table_id;
controller_reply(TASK_DEBUG);
}
action controller_debug() {
controller_reply(TASK_DEBUG);
}
#endif