From 4afbf053af1f164692e4e5929d7e0377e823dd2f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 24 Jul 2019 22:38:55 +0200 Subject: [PATCH] [netpfga] change table key to exact instead of LPM Known bug of netpfga not correctly supporting LPM. Current bug might be triggered by it: --- doc/plan.org | 20 +++++++++++++------- p4src/actions_egress.p4 | 8 ++++++++ p4src/actions_nat64_generic.p4 | 14 +++++++++++--- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/doc/plan.org b/doc/plan.org index 9d8d95b..dfc791a 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -3328,12 +3328,15 @@ https://en.wikipedia.org/wiki/IPv4_header_checksum CLOSED: [2019-07-21 Sun 14:01] | eth2 <--> nf0 | | eth1 <--> nf3 | -** Compile log -| 5.1. - 5.5 | failure due to variable renaming | -| 5.6 | subparser: compiled! | -| 5.7 | subcontrol: [nsg] | -| 5.8 | nat64 actions/table: -- | -| 5.9 | nat64+headers [esprimo]: | +** Compile log - VERSIONS +| 5.1. - 5.5 | failure due to variable renaming | +| 5.6 | subparser: compiled! | +| 5.7 | subcontrol: [nsg] | +| 5.8 | nat64 actions/table: OK | +| 5.9 | nat64+headers [esprimo]: | +| 6.1 | ARP: mixed matches in table, ABORT | +| 6.2 | No arp, Vivado Simulator kernel has encounted an exception | +| | | ** TODO Benchmark/comparison *** TODO Setup / Benchmark Jool *** TODO Setup / Benchmark tayga @@ -6471,7 +6474,8 @@ nico@nsg-System:~/master-thesis/netpfga/log$ #+END_CENTER -*** TODO 2019-07-24: table match types are not the same error +*** DONE 2019-07-24: table match types are not the same error + CLOSED: [2019-07-24 Wed 22:35] - Missing feature in https://cs344-stanford.github.io/documentation/p4c-sdnet-missing-features.pdf - disabling arp for the moment @@ -6523,6 +6527,8 @@ ARP disabled: } #+END_CENTER +*** TODO 2019-07-24: Vivado Simulator kernel has encounted an exception from DPI C function: LPM_VerifyDataset + - maybe LPM problem -> rewrite tables ** The NetPFGA saga Problems encountered: - The logfile for a compile run is 10k+ lines diff --git a/p4src/actions_egress.p4 b/p4src/actions_egress.p4 index 953f4c9..b0d8661 100644 --- a/p4src/actions_egress.p4 +++ b/p4src/actions_egress.p4 @@ -51,7 +51,11 @@ action controller_debug() { table v6_networks { key = { + #ifndef _SUME_SWITCH_P4_ hdr.ipv6.dst_addr: lpm; + #else + hdr.ipv6.dst_addr: exact; + #endif } actions = { set_egress_port; @@ -68,7 +72,11 @@ table v6_networks { table v4_networks { key = { + #ifndef _SUME_SWITCH_P4_ hdr.ipv4.dst_addr: lpm; + #else + hdr.ipv4.dst_addr: exact; + #endif } actions = { set_egress_port; diff --git a/p4src/actions_nat64_generic.p4 b/p4src/actions_nat64_generic.p4 index 1ade5c7..789b1fd 100644 --- a/p4src/actions_nat64_generic.p4 +++ b/p4src/actions_nat64_generic.p4 @@ -157,8 +157,12 @@ action nat46_icmp_generic() } table nat64 { - key = { - hdr.ipv6.dst_addr: lpm; + key = { + #ifndef _SUME_SWITCH_P4_ + hdr.ipv6.dst_addr: lpm; + #else + hdr.ipv6.dst_addr: exact; + #endif } actions = { controller_debug; @@ -173,7 +177,11 @@ action nat46_icmp_generic() table nat46 { key = { - hdr.ipv4.dst_addr: lpm; + #ifndef _SUME_SWITCH_P4_ + hdr.ipv4.dst_addr: lpm; + #else + hdr.ipv4.dst_addr: exact; + #endif } actions = { controller_debug;