diff --git a/doc/plan.org b/doc/plan.org index 83b944b..f96c8c1 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -2670,7 +2670,6 @@ root@rainbow:~/master-thesis/netpfga/minip4/simple_sume_switch/bitfiles# #+END_CENTER - ***** DONE Step 14: test the card / switch ****** try1: adding ips, using tcpdump ******* testing enp16s0 @@ -2953,6 +2952,45 @@ root@rainbow:/home/nico/master-thesis/bin# -> only shows up on the interface that we send, not on nf0 if sending on nf1 +***** TODO Trying to add explicit table entry +#+BEGIN_CENTER +>> table_cam_add_entry lookup_table send_to_port1 ff:ff:ff:ff:ff:ff => +CAM_Init_ValidateContext() - done +WROTE 0x44020050 = 0xffffffff +WROTE 0x44020054 = 0xffff +WROTE 0x44020080 = 0x0003 +python: ioctl: Unknown error 512 +[20:27] rainbow:CLI% +#+END_CENTER +***** TODO Trying to read a table entry +#+BEGIN_CENTER +>> table_cam_read_entry lookup_table 0 +CAM_Init_ValidateContext() - done +WROTE 0x44020050 = 0x0000 +WROTE 0x44020054 = 0x0000 +python: ioctl: Unknown error 512 +[20:31] rainbow:CLI% python P4_SWITCH_CLI.py +loading libsume.. +loading libsume.. +loading libcam.. +The SimpleSumeSwitch interactive command line tool + type help to see all commands +>> table_cam_read_entry lookup_table 1 +CAM_Init_ValidateContext() - done +WROTE 0x44020050 = 0x0001 +WROTE 0x44020054 = 0x0000 +python: ioctl: Unknown error 512 +[20:31] rainbow:CLI% python P4_SWITCH_CLI.py +loading libsume.. +loading libsume.. +loading libcam.. +The SimpleSumeSwitch interactive command line tool + type help to see all commands +>> table_cam_read_entry lookup_table p.ethernet.dstAddr +ERROR: failed to convert p.ethernet.dstAddr of type to an integer + +#+END_CENTER + *** TODO Create either HDL or PX for supporting payload checksum https://github.com/NetFPGA/P4-NetFPGA-public/issues/13 https://github.com/NetFPGA/P4-NetFPGA-public/issues/13#issuecomment-490431016 @@ -3740,7 +3778,7 @@ RUN loading image file. minip4.bit attempting to launch hw_server -****** Xilinx hw_server v2018.2 + ****** Xilinx hw_server v2018.2 **** Build date : Jun 14 2018-20:18:37 ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved. @@ -3768,6 +3806,217 @@ nf3: ERROR while getting interface flags: No such device root@rainbow:~/master-thesis/netpfga/minip4/simple_sume_switch/bitfiles# #+END_CENTER +Full run, messages are the same: + +#+BEGIN_CENTER ++ xsct /home/nico/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/tools/run_xsct.tcl -tclargs minip4.bit +rlwrap: warning: your $TERM is 'screen' but rlwrap couldn't find it in the terminfo database. Expect some problems. +RUN loading image file. +minip4.bit +attempting to launch hw_server + + ****** Xilinx hw_server v2018.2 + **** Build date : Jun 14 2018-20:18:37 + ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved. + +INFO: hw_server application started +INFO: Use Ctrl-C to exit hw_server application + +INFO: To connect to this hw_server instance use url: TCP:127.0.0.1:3121 + +100% 10MB 1.7MB/s 00:06 ++ bash /home/nico/projects/P4-NetFPGA/contrib-projects/sume-sdnet-switch/tools/pci_rescan_run.sh +Check programming FPGA or Reboot machine ! ++ rmmod sume_riffa +rmmod: ERROR: Module sume_riffa is not currently loaded ++ modprobe sume_riffa ++ ifconfig nf0 up +nf0: ERROR while getting interface flags: No such device ++ ifconfig nf1 up +nf1: ERROR while getting interface flags: No such device ++ ifconfig nf2 up +nf2: ERROR while getting interface flags: No such device ++ ifconfig nf3 up +nf3: ERROR while getting interface flags: No such device ++ bash config_writes.sh +[0:33] rainbow:minip4% sudo reboot + +#+END_CENTER +*** 2019-06-07: exec format error +Trying to load kernel module now gives an error: + +#+BEGIN_CENTER +[7:05] rainbow:netpfga% . ./bashinit +[7:05] rainbow:netpfga% bash build-load-drivers.sh ++ cd /home/nico/projects/P4-NetFPGA/lib/sw/std/driver/sume_riffa_v1_0_0 ++ make all +make -C /lib/modules/5.0.0-16-generic/build M=/home/nico/projects/P4-NetFPGA/lib/sw/std/driver/sume_riffa_v1_0_0 modules +make[1]: Entering directory '/usr/src/linux-headers-5.0.0-16-generic' + Building modules, stage 2. + MODPOST 1 modules +make[1]: Leaving directory '/usr/src/linux-headers-5.0.0-16-generic' ++ sudo make install +make -C /lib/modules/5.0.0-16-generic/build M=/home/nico/projects/P4-NetFPGA/lib/sw/std/driver/sume_riffa_v1_0_0 modules +make[1]: Entering directory '/usr/src/linux-headers-5.0.0-16-generic' + Building modules, stage 2. + MODPOST 1 modules +make[1]: Leaving directory '/usr/src/linux-headers-5.0.0-16-generic' +install -o root -g root -m 0755 -d /lib/modules/5.0.0-16-generic/extra/sume_riffa/ +install -o root -g root -m 0755 sume_riffa.ko /lib/modules/5.0.0-16-generic/extra/sume_riffa/ +depmod -a 5.0.0-16-generic ++ sudo modprobe sume_riffa +modprobe: ERROR: could not insert 'sume_riffa': Exec format error +[7:06] rainbow:netpfga% + +#+END_CENTER + +dmesg: + +#+BEGIN_CENTER +[ 257.356321] sume_riffa: version magic '5.0.0-15-generic SMP mod_unload ' should be '5.0.0-16-generic SMP mod_unload ' + +#+END_CENTER + +Rebuilding module: + +#+BEGIN_CENTER +[7:08] rainbow:sume_riffa_v1_0_0% make clean +make -C /lib/modules/5.0.0-16-generic/build M=/home/nico/projects/P4-NetFPGA/lib/sw/std/driver/sume_riffa_v1_0_0 clean +make[1]: Entering directory '/usr/src/linux-headers-5.0.0-16-generic' + CLEAN /home/nico/projects/P4-NetFPGA/lib/sw/std/driver/sume_riffa_v1_0_0/.tmp_versions + CLEAN /home/nico/projects/P4-NetFPGA/lib/sw/std/driver/sume_riffa_v1_0_0/Module.symvers +make[1]: Leaving directory '/usr/src/linux-headers-5.0.0-16-generic' +[7:08] rainbow:sume_riffa_v1_0_0% make all +make -C /lib/modules/5.0.0-16-generic/build M=/home/nico/projects/P4-NetFPGA/lib/sw/std/driver/sume_riffa_v1_0_0 modules +make[1]: Entering directory '/usr/src/linux-headers-5.0.0-16-generic' + CC [M] /home/nico/projects/P4-NetFPGA/lib/sw/std/driver/sume_riffa_v1_0_0/sume_riffa.o + Building modules, stage 2. + MODPOST 1 modules + CC /home/nico/projects/P4-NetFPGA/lib/sw/std/driver/sume_riffa_v1_0_0/sume_riffa.mod.o + LD [M] /home/nico/projects/P4-NetFPGA/lib/sw/std/driver/sume_riffa_v1_0_0/sume_riffa.ko +make[1]: Leaving directory '/usr/src/linux-headers-5.0.0-16-generic' +[7:08] rainbow:sume_riffa_v1_0_0% sudo make install +sudo modprobe sume_riffa + +make -C /lib/modules/5.0.0-16-generic/build M=/home/nico/projects/P4-NetFPGA/lib/sw/std/driver/sume_riffa_v1_0_0 modules +make[1]: Entering directory '/usr/src/linux-headers-5.0.0-16-generic' + Building modules, stage 2. + MODPOST 1 modules +make[1]: Leaving directory '/usr/src/linux-headers-5.0.0-16-generic' +install -o root -g root -m 0755 -d /lib/modules/5.0.0-16-generic/extra/sume_riffa/ +install -o root -g root -m 0755 sume_riffa.ko /lib/modules/5.0.0-16-generic/extra/sume_riffa/ +depmod -a 5.0.0-16-generic +[7:08] rainbow:sume_riffa_v1_0_0% + +#+END_CENTER + +The devices are back: + +#+BEGIN_CENTER +[7:08] rainbow:sume_riffa_v1_0_0% ip l +1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 +2: eth0: mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 + link/ether 70:85:c2:ad:62:79 brd ff:ff:ff:ff:ff:ff +3: wlan0: mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000 + link/ether dc:8b:28:47:5c:f7 brd ff:ff:ff:ff:ff:ff +4: nf0: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 + link/ether 02:53:55:4d:45:00 brd ff:ff:ff:ff:ff:ff +5: nf1: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 + link/ether 02:53:55:4d:45:01 brd ff:ff:ff:ff:ff:ff +6: nf2: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 + link/ether 02:53:55:4d:45:02 brd ff:ff:ff:ff:ff:ff +7: nf3: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 + link/ether 02:53:55:4d:45:03 brd ff:ff:ff:ff:ff:ff +[7:09] rainbow:sume_riffa_v1_0_0% + +#+END_CENTER +*** 2019-06-08: adding table entries + +mac = 02:53:55:42:45:01 (from send_packet.py) + +#+BEGIN_CENTER +>> list_cam_tables +------------ +lookup_table : +------------ +{u'action_ids': {u'TopPipe.do_nothing': 2, + u'TopPipe.send_to_port1': 3, + u'TopPipe.swap_eth_addresses': 1}, + u'annotations': {u'Xilinx_ExternallyConnected': [u'0'], + u'Xilinx_LookupEngineType': [u'EM'], + u'name': [u'TopPipe.lookup_table']}, + u'match_type': u'EM', + u'p4_name': u'lookup_table', + u'px_class': u'LookupEngine', + u'px_name': u'lookup_table', + u'px_type_name': u'lookup_table_t', + u'request_fields': [{u'p4_name': u'p.ethernet.dstAddr', + u'px_name': u'lookup_request_key', + u'size': 48, + u'type': u'bits'}], + u'response_fields': [{u'px_name': u'hit', u'size': 1, u'type': u'bits'}, + {u'px_name': u'action_run', + u'size': 2, + u'type': u'bits'}]} +>> + +root@rainbow:~# ip l s nf0 up + +>> table_cam_add_entry +ERROR: +table_cam_add_entry => +DESCRIPTION: Add an entry to the specified table +PARAMS: + : name of the table to add an entry to + : name of the action to use in the entry (must be listed in the table's actions list) + : space separated list of keys to use as the entry key (must correspond to table's keys in the order defined in the P4 program) + : space separated list of values to provide as input to the action + +[''] + +>> table_cam_add_entry lookup_table send_to_port1 ff:ff:ff:ff:ff:ff +ERROR: +table_cam_add_entry => +DESCRIPTION: Add an entry to the specified table +PARAMS: + : name of the table to add an entry to + : name of the action to use in the entry (must be listed in the table's actions list) + : space separated list of keys to use as the entry key (must correspond to table's keys in the order defined in the P4 program) + : space separated list of values to provide as input to the action + +['lookup_table send_to_port1 ff:ff:ff:ff:ff:ff'] +[20:09] rainbow:CLI% python P4_SWITCH_CLI.py +loading libsume.. +loading libsume.. +loading libcam.. +The SimpleSumeSwitch interactive command line tool + type help to see all commands +>> table_cam_add_entry lookup_table send_to_port1 => ff:ff:ff:ff:ff:ff +ERROR: +table_cam_add_entry => +DESCRIPTION: Add an entry to the specified table +PARAMS: + : name of the table to add an entry to + : name of the action to use in the entry (must be listed in the table's actions list) + : space separated list of keys to use as the entry key (must correspond to table's keys in the order defined in the P4 program) + : space separated list of values to provide as input to the action + +[20:10] rainbow:CLI% + + +table_cam_add_entry lookup_table send_to_port1 ff:ff:ff:ff:ff:ff => "" + +>> table_cam_add_entry lookup_table send_to_port1 ff:ff:ff:ff:ff:ff => +CAM_Init_ValidateContext() - done +WROTE 0x44020050 = 0xffffffff +WROTE 0x44020054 = 0xffff +WROTE 0x44020080 = 0x0003 +python: ioctl: Unknown error 512 +[20:27] rainbow:CLI% + +#+END_CENTER + ** References / Follow up diff --git a/netpfga/do-all-steps.sh b/netpfga/do-all-steps.sh index e1cfc52..014e675 100755 --- a/netpfga/do-all-steps.sh +++ b/netpfga/do-all-steps.sh @@ -25,13 +25,13 @@ if [ "$expected_line" != "$actual_line" ]; then exit 1 fi -# Step 6 +# Step 6: calls ${SUME_SDNET}/bin/gen_config_writes.py and generates SOMETHING cd $P4_PROJECT_DIR && make config_writes -# Step 7 +# Step 7: copies directory SDNET_OUT_DIR to TARGET and copies other dirs cd $P4_PROJECT_DIR && make uninstall_sdnet && make install_sdnet -# Step 8 +# Step 8: copies "config_writes.py" to the current dir - related to step 6 cd $NF_DESIGN_DIR/test/sim_switch_default && make # Step 9