Merge full IPv6 handling code from BMV2 side
This commit is contained in:
parent
6b176fdc06
commit
dc7d78252e
2 changed files with 36 additions and 10 deletions
23
doc/plan.org
23
doc/plan.org
|
@ -3329,14 +3329,15 @@ https://en.wikipedia.org/wiki/IPv4_header_checksum
|
||||||
| eth2 <--> nf0 |
|
| eth2 <--> nf0 |
|
||||||
| eth1 <--> nf3 |
|
| eth1 <--> nf3 |
|
||||||
** Compile log - VERSIONS
|
** Compile log - VERSIONS
|
||||||
| 5.1. - 5.5 | failure due to variable renaming |
|
| 5.1. - 5.5 | failure due to variable renaming |
|
||||||
| 5.6 | subparser: compiled! |
|
| 5.6 | subparser: compiled! |
|
||||||
| 5.7 | subcontrol: [nsg] |
|
| 5.7 | subcontrol: [nsg] |
|
||||||
| 5.8 | nat64 actions/table: OK |
|
| 5.8 | nat64 actions/table: OK |
|
||||||
| 5.9 | nat64+headers [esprimo]: |
|
| 5.9 | nat64+headers [esprimo]: |
|
||||||
| 6.1 | ARP: mixed matches in table, ABORT |
|
| 6.1 | ARP: mixed matches in table, ABORT |
|
||||||
| 6.2 | No arp, Vivado Simulator kernel has encounted an exception |
|
| 6.2 | No arp, Vivado Simulator kernel has encounted an exception, ABORT |
|
||||||
| | |
|
| 6.3 | Fixed lpm bug, ABORT |
|
||||||
|
| 6.4 | table size = 64, [nsg] |
|
||||||
** TODO Benchmark/comparison
|
** TODO Benchmark/comparison
|
||||||
*** TODO Setup / Benchmark Jool
|
*** TODO Setup / Benchmark Jool
|
||||||
*** TODO Setup / Benchmark tayga
|
*** TODO Setup / Benchmark tayga
|
||||||
|
@ -6085,7 +6086,8 @@ def config_tables():
|
||||||
#+BEGIN_CENTER
|
#+BEGIN_CENTER
|
||||||
~/master-thesis/netpfga/minip4/simple_sume_switch/test/sim_switch_default/config_writes.py
|
~/master-thesis/netpfga/minip4/simple_sume_switch/test/sim_switch_default/config_writes.py
|
||||||
#+END_CENTER
|
#+END_CENTER
|
||||||
*** 2019-07-22: trying to "fix" the config_writes.py
|
*** DONE 2019-07-22: trying to "fix" the config_writes.py
|
||||||
|
CLOSED: [2019-07-24 Wed 22:44]
|
||||||
#+BEGIN_CENTER
|
#+BEGIN_CENTER
|
||||||
nico@nsg-System:~/master-thesis/netpfga/minip4/simple_sume_switch/test/sim_switch_default$ cat config_writes.py
|
nico@nsg-System:~/master-thesis/netpfga/minip4/simple_sume_switch/test/sim_switch_default$ cat config_writes.py
|
||||||
|
|
||||||
|
@ -6539,7 +6541,8 @@ s/sume-sdnet-switch/projects/minip4/nf_sume_sdnet_ip/SimpleSumeSwitch/realmain_l
|
||||||
FATAL_ERROR: Vivado Simulator kernel has encounted an exception from DPI C function: LPM_VerifyDataset(). Please correct.
|
FATAL_ERROR: Vivado Simulator kernel has encounted an exception from DPI C function: LPM_VerifyDataset(). Please correct.
|
||||||
Time: 2016466 ps Iteration: 0 Process: /SimpleSumeSwitch_tb/LPM_VerifyDataset
|
Time: 2016466 ps Iteration: 0 Process: /SimpleSumeSwitch_tb/LPM_VerifyDataset
|
||||||
File: /home/nico/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/projects/minip4/nf_sume_sdnet_ip/SimpleSumeSwitch/Testbench/SimpleSumeSwitch_tb.sv
|
File: /home/nico/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/projects/minip4/nf_sume_sdnet_ip/SimpleSumeSwitch/Testbench/SimpleSumeSwitch_tb.sv
|
||||||
*** 2019-07-24: table size too small
|
*** DONE 2019-07-24: table size too small
|
||||||
|
CLOSED: [2019-07-24 Wed 22:44]
|
||||||
- raising again - this is a total madness
|
- raising again - this is a total madness
|
||||||
|
|
||||||
#+BEGIN_CENTER
|
#+BEGIN_CENTER
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
#include <sume_switch.p4>
|
#include <sume_switch.p4>
|
||||||
#include "headers.p4"
|
#include "headers.p4"
|
||||||
|
|
||||||
|
/* required for netfpga */
|
||||||
|
#define USE_NICO_DELTA_CHECKSUM 1
|
||||||
|
|
||||||
|
|
||||||
// typedef bit<48> EthAddr_t;
|
// typedef bit<48> EthAddr_t;
|
||||||
// header Ethernet_h {
|
// header Ethernet_h {
|
||||||
// EthAddr_t dstAddr;
|
// EthAddr_t dstAddr;
|
||||||
|
@ -75,6 +79,7 @@ control RealMain(
|
||||||
|
|
||||||
#include "actions_nat64_generic.p4"
|
#include "actions_nat64_generic.p4"
|
||||||
#include "actions_egress.p4"
|
#include "actions_egress.p4"
|
||||||
|
#include "actions_delta_checksum.p4"
|
||||||
|
|
||||||
|
|
||||||
action swap_eth_addresses() {
|
action swap_eth_addresses() {
|
||||||
|
@ -126,6 +131,7 @@ control RealMain(
|
||||||
if(nat64.apply().hit) { /* generic / static nat64 done */
|
if(nat64.apply().hit) { /* generic / static nat64 done */
|
||||||
if(hdr.icmp6.isValid()) {
|
if(hdr.icmp6.isValid()) {
|
||||||
nat64_icmp6_generic();
|
nat64_icmp6_generic();
|
||||||
|
|
||||||
if(hdr.icmp6.type == ICMP6_ECHO_REPLY) {
|
if(hdr.icmp6.type == ICMP6_ECHO_REPLY) {
|
||||||
hdr.icmp.type = ICMP_ECHO_REPLY;
|
hdr.icmp.type = ICMP_ECHO_REPLY;
|
||||||
hdr.icmp.code = 0;
|
hdr.icmp.code = 0;
|
||||||
|
@ -134,7 +140,24 @@ control RealMain(
|
||||||
hdr.icmp.type = ICMP_ECHO_REQUEST;
|
hdr.icmp.type = ICMP_ECHO_REQUEST;
|
||||||
hdr.icmp.code = 0;
|
hdr.icmp.code = 0;
|
||||||
}
|
}
|
||||||
|
if(hdr.udp.isValid()) {
|
||||||
|
#ifdef USE_NICO_DELTA_CHECKSUM
|
||||||
|
delta_udp_from_v6_to_v4();
|
||||||
|
#else
|
||||||
|
meta.chk_udp_v4 = 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if(hdr.tcp.isValid()) {
|
||||||
|
#ifdef USE_NICO_DELTA_CHECKSUM
|
||||||
|
delta_tcp_from_v6_to_v4();
|
||||||
|
#else
|
||||||
|
|
||||||
|
meta.chk_tcp_v4 = 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
v4_networks.apply(); /* apply egress for IPv4 */
|
||||||
|
exit; /* no further v6 processing */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue