try to emit on ANY other port

This commit is contained in:
Nico Schottelius 2019-07-29 09:37:01 +02:00
commit 62e0279b25
3 changed files with 41 additions and 2 deletions

View file

@ -6,6 +6,21 @@ action send_to_port1() {
sume_metadata.dst_port = 16;
}
action select_port_by_type() {
/*
>>> 0x86dd >> 11 v6
16
>>> 0x0800 >> 11 v4
1
>>> 0x0806 >> 11 ARP
1
*/
sume_metadata.dst_port = hdr.ethernet.ethertype >> 11;
}
table dummy_table_for_netpfga {
key = {
hdr.ethernet.dst_addr: exact;
@ -13,9 +28,10 @@ table dummy_table_for_netpfga {
actions = {
send_to_port1;
select_port_by_type;
}
size = 64;
default_action = send_to_port1;
default_action = select_port_by_type; //send_to_port1;
}
#endif

View file

@ -42,5 +42,5 @@ if(hdr.ipv6.isValid()) {
set_egress_port(v6_out);
} else {
set_egress_port(1);
set_egress_port(4);
}