++netpfga
This commit is contained in:
parent
ee3c594bf1
commit
35d824b7f3
3 changed files with 29 additions and 18 deletions
25
p4src/action_netpfga_dummy.p4
Normal file
25
p4src/action_netpfga_dummy.p4
Normal 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
3
p4src/commands.txt
Normal 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
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue