++netpfga

This commit is contained in:
Nico Schottelius 2019-07-10 22:47:52 +02:00
parent ee3c594bf1
commit 35d824b7f3
3 changed files with 29 additions and 18 deletions

View File

@ -0,0 +1,25 @@
#ifndef DUMMY_NETPFGA
#define DUMMY_NETPFGA
action do_nothing() {
}
action send_to_port1() {
sume_metadata.dst_port = 1;
}
table dummy_table_for_netpfga {
key = {
hdr.ethernet.dst_addr: exact;
}
actions = {
do_nothing;
send_to_port1;
}
size = TEST_TABLE_SIZE;
default_action = do_nothing;
}
#endif

3
p4src/commands.txt Normal file
View File

@ -0,0 +1,3 @@
// only used on netpfga for dummy packet reply
table_cam_add_entry dummy_table_for_netpfga send_to_port1 0x00000000 => 0x00000001

View File

@ -70,25 +70,8 @@ control TopPipe(inout headers hdr,
#endif
}
table dummy_table_for_netpfga {
key = {
hdr.ethernet.dst_addr: exact;
}
actions = {
swap_eth_addresses;
do_nothing;
send_to_port1;
// send_to_all_ports;
}
size = TEST_TABLE_SIZE;
// default_action = swap_eth_addresses; // test_mirror(): in gen_testdata.py
default_action = send_to_port1; // test_port1()
// default_action = send_to_all_ports; // test_allports():
}
apply {
lookup_table.apply();
dummy_table_for_netpfga.apply();
}
}