Skip to content

Commit

Permalink
Support newer versions of DPDK (kotekan#1084)
Browse files Browse the repository at this point in the history
* Adds support for DPDK 21.11 included in Ubuntu 22.04
* Removes the `-DUSE_DPDK=ON` cmake flag, and auto detects DPDK with `pkg-config`
* Keeps support for older versions of DPDK via the new `-DUSE_OLD_DPDK=ON` cmake flag
* Changes config file parameter:  `master_lcore_cpu` -> `main_lcore_cpu`
* Removes an old Jenkinsfile
* Adds check for UDP checksum failure in supporting hardware
* Tested on the Intel E810 NIC.
  • Loading branch information
andrerenard authored Mar 8, 2023
1 parent d6932d3 commit 292684d
Show file tree
Hide file tree
Showing 25 changed files with 164 additions and 218 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ jobs:
-DWERROR=ON \
-DCMAKE_LINK_WHAT_YOU_USE=ON \
-DCMAKE_BUILD_TYPE=Test \
-DUSE_DPDK=ON \
-DUSE_OLD_DPDK=ON \
-DUSE_HDF5=ON -DHIGHFIVE_PATH=/code/build/HighFive \
-DUSE_LAPACK=ON -DBLAZE_PATH=/code/build/blaze \
-DARCH=haswell \
Expand Down Expand Up @@ -364,7 +364,7 @@ jobs:
docker run "${OPTS[@]}" cmake -Wdev -Werror=dev -Wdeprecated -Werror=deprecated \
-DWERROR=ON \
-DCMAKE_LINK_WHAT_YOU_USE=ON \
-DUSE_DPDK=ON \
-DUSE_OLD_DPDK=ON \
-DCMAKE_BUILD_TYPE=Test \
-DUSE_HDF5=ON \
-DHIGHFIVE_PATH=/code/build/HighFive \
Expand Down Expand Up @@ -528,7 +528,7 @@ jobs:
-DWERROR=ON \
-DCMAKE_LINK_WHAT_YOU_USE=ON \
-DCMAKE_BUILD_TYPE=Test \
-DUSE_DPDK=ON \
-DUSE_OLD_DPDK=ON \
-DUSE_HDF5=ON -DHIGHFIVE_PATH=/code/build/HighFive \
-DUSE_LAPACK=ON -DBLAZE_PATH=/code/build/blaze \
-DARCH=haswell \
Expand Down
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ option(USE_CLOC "Use the CL offline compiler" OFF)
option(USE_OPENCL "Build OpenCL GPU Framework" OFF)
option(USE_CUDA "Build CUDA GPU Framework" OFF)
option(USE_HIP "Build HIP GPU Framework" OFF)
option(USE_DPDK "Enable DPDK Framework" OFF)
option(USE_OLD_DPDK "Enable old versions of DPDK (<19.11)" OFF)
option(USE_HDF5 "Build HDF5 output stages" OFF)
option(USE_OMP "Enable OpenMP" OFF)
option(USE_OLD_ROCM "Build for ROCm versions 2.3 or older" OFF)
Expand Down Expand Up @@ -239,10 +239,6 @@ endif()
message("GPU Modules Included: " ${GPU_MODULES})

set(INPUT_MODULES "")
if(${USE_DPDK})
set(INPUT_MODULES ${INPUT_MODULES} "DPDK ")
find_package(DPDK REQUIRED)
endif()
if(${USE_AIRSPY})
add_definitions(-DWITH_AIRSPY)
set(INPUT_MODULES ${INPUT_MODULES} "AIRSPY ")
Expand Down
138 changes: 0 additions & 138 deletions Jenkinsfile

This file was deleted.

22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ Cmake build options:

* `-DCMAKE_BUILD_TYPE=Debug` - Builds the project with asserts, debug logging and debug symbols.
* `-DCMAKE_BUILD_TYPE=Test` - Builds the project with asserts, debug logging, but without debug
symbols.
* `-DUSE_DPDK=ON` - Include DPDK support. Optional `-DRTE_SDK=<build-location>` and
`-DRTE_TARGET=x86_64-native-linuxapp-gcc` can be provided for non standard build locations.
symbols.
* `-DUSE_OLD_DPDK=ON` - Include DPDK support for older (<19.11) versions.
Optional `-DRTE_SDK=<build-location>` and `-DRTE_TARGET=x86_64-native-linuxapp-gcc`
can be provided for non standard build locations.
* `-DUSE_HSA=ON` - Build with HSA support if available. On by default.
* `-DUSE_OLD_ROCM=ON` - Build for ROCm versions 2.3 or older. Off by default.
* `-DUSE_CLOC=ON` - For HSA, use cloc.sh to compile .hsaco binaries.
Expand All @@ -49,13 +50,17 @@ symbols.

**Examples:**

To build with HSA, DPDK and debug symbols:
To build with OpenCL and debug symbols and logging:

cmake -DRTE_SDK=/opt/dpdk-stable-16.11.4/ -DRTE_TARGET=x86_64-native-linuxapp-gcc -DUSE_DPDK=ON -DUSE_HSA=ON -DCMAKE_BUILD_TYPE=Debug ..
cmake -DUSE_OPENCL=ON -DCMAKE_BUILD_TYPE=Debug ..

To build with OpenCL and DPDK:
To build with CUDA:

cmake -DRTE_SDK=/opt/dpdk-stable-16.11.4/ -DRTE_TARGET=x86_64-native-linuxapp-gcc -DUSE_DPDK=ON -DUSE_OPENCL=ON ..
cmake -DUSE_CUDA=ON ..

To build with HSA, old DPDK and debug symbols (CHIME):

cmake -DRTE_SDK=/opt/dpdk-stable-16.11.4/ -DRTE_TARGET=x86_64-native-linuxapp-gcc -DUSE_OLD_DPDK=ON -DUSE_HSA=ON -DCMAKE_BUILD_TYPE=Debug ..

To install kotekan (only works on CentOS at the moment):

Expand Down Expand Up @@ -83,4 +88,5 @@ For example:

When installed kotekan's config files are located at /etc/kotekan/

If running with no options then kotekan just starts a rest server, and waits for someone to send it a config in json format on port `12048`
If running with no options then kotekan just starts a rest server, and waits for someone to send it a config in json
format on port `12048`
2 changes: 1 addition & 1 deletion config/adc_record.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dpdk:
kotekan_stage: dpdkCore
# Format is index = lcore, value = cpu core
lcore_cpu_map: [0]
master_lcore_cpu: 1
main_lcore_cpu: 1
fpga_packet_size: 4680
samples_per_packet: 2
alignment: samples_per_data_set * 100
Expand Down
2 changes: 1 addition & 1 deletion config/adc_record_burst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dpdk:
kotekan_stage: dpdkCore
# Format is index = lcore, value = cpu core
lcore_cpu_map: [0]
master_lcore_cpu: 1
main_lcore_cpu: 1
fpga_packet_size: 4160
samples_per_packet: 2
capture_n_frames: buffer_depth
Expand Down
2 changes: 1 addition & 1 deletion config/aro_record.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dpdk:
kotekan_stage: dpdkCore
# Format is index = lcore, value = cpu core
lcore_cpu_map: [0,2,3,4,6,8,9,10]
master_lcore_cpu: 4
main_lcore_cpu: 4
fpga_packet_size: 4680
alignment: samples_per_data_set * 100
# Format is index = lcore, value = array of port IDs
Expand Down
2 changes: 1 addition & 1 deletion config/chime_science_run_gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ dpdk:
kotekan_stage: dpdkCore
# Format is index = lcore, value = cpu core
lcore_cpu_map: [0,1,6,7]
master_lcore_cpu: 2
main_lcore_cpu: 2
status_cadence: 60
alignment: samples_per_data_set * num_data_sets
# Format is index = lcore, value = array of port IDs
Expand Down
2 changes: 1 addition & 1 deletion config/chime_science_run_gpu_no_output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ dpdk:
kotekan_stage: dpdkCore
# Format is index = lcore, value = cpu core
lcore_cpu_map: [0,1,6,7]
master_lcore_cpu: 2
main_lcore_cpu: 2
status_cadence: 60
alignment: samples_per_data_set * num_data_sets
# Format is index = lcore, value = array of port IDs
Expand Down
2 changes: 1 addition & 1 deletion config/dpdk_test_32_ports_2_numa_nodes.j2
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dpdk:
kotekan_stage: dpdkCore
# Format is index = lcore, value = cpu core
lcore_cpu_map: [0,16,1,17,2,18,3,19,8,24,9,25,10,26,11,27]
master_lcore_cpu: 2
main_lcore_cpu: 2
fpga_packet_size: 4680
alignment: samples_per_data_set
mbuf_cache_size: 250
Expand Down
2 changes: 1 addition & 1 deletion config/examples/dpdk_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dpdk:
kotekan_stage: dpdkCore
# Format is index = lcore (logical core), value = cpu core
lcore_cpu_map: [2]
master_lcore_cpu: 3
main_lcore_cpu: 3
# Format is index = lcore, value = array of port IDs
# so [[0,1],[2,3]] maps lcore 0 to service ports 0 and 1,
# and lcore 1 to service ports 2 and 3.
Expand Down
2 changes: 1 addition & 1 deletion config/hartrao_reduced_links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ dpdk:
kotekan_stage: dpdkCore
# Format is index = lcore, value = cpu core
lcore_cpu_map: [0,1,4,5]
master_lcore_cpu: 3
main_lcore_cpu: 3
num_mem_channels: 3
fpga_packet_size: 4680
alignment: samples_per_data_set
Expand Down
2 changes: 1 addition & 1 deletion config/packet_capture.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dpdk:
kotekan_stage: dpdkCore
# Format is index = lcore, value = cpu core
lcore_cpu_map: [0,1,6,7]
master_lcore_cpu: 2
main_lcore_cpu: 2
# Format is index = lcore, value = array of port IDs
# so [[0,1],[2,3]] maps lcore 0 to service ports 0 and 1,
# and lcore 1 to service ports 2 and 3.
Expand Down
2 changes: 1 addition & 1 deletion config/single_iceboard_n2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ dpdk:
kotekan_stage: dpdkCore
# Format is index = lcore, value = cpu core
lcore_cpu_map: [0,1,2,3,4,5,6,7]
master_lcore_cpu: 8
main_lcore_cpu: 8
fpga_packet_size: 4680
alignment: samples_per_data_set
# Format is index = lcore, value = array of port IDs
Expand Down
2 changes: 1 addition & 1 deletion config/tests/chime_only_baseband.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ dpdk:
kotekan_stage: dpdkCore
# Format is index = lcore, value = cpu core
lcore_cpu_map: [0,1,6,7]
master_lcore_cpu: 2
main_lcore_cpu: 2
status_cadence: 60
alignment: samples_per_data_set * num_data_sets
# Format is index = lcore, value = array of port IDs
Expand Down
13 changes: 11 additions & 2 deletions docs/sphinx/compiling/dpdk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@ Configuring DPDK
Install
^^^^^^^

To install DPDK on Ubuntu 22.04 install run

.. code:: bash
sudo apt install dpdk dpdk-dev dpdk-kmods-dkms
Then CMake will automatically include it.

To install DPDK on ubuntu 18.04 simply run:

.. code:: bash
sudo apt install dpdk dpdk-dev dpdk-igb-uio-dkms
Then include ``-DUSE_DPDK=ON`` in the cmake options.
Then include ``-DUSE_OLD_DPDK=ON`` in the cmake options.


Setup
^^^^^
Expand Down Expand Up @@ -60,7 +69,7 @@ Unpack it in ``/opt/`` and run:
It will give a warning about install path being missing, just ingore it.

When running CMAKE include the following options ``-DUSE_DPDK=ON -DRTE_SDK=/opt/dpdk-stable-16.11.10/ -DRTE_TARGET=x86_64-native-linuxapp-gcc``
When running CMAKE include the following options ``-DUSE_OLD_DPDK=ON -DRTE_SDK=/opt/dpdk-stable-16.11.10/ -DRTE_TARGET=x86_64-native-linuxapp-gcc``

Startup scripts source install
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
5 changes: 3 additions & 2 deletions docs/sphinx/compiling/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ Cmake build options
Builds the project with asserts, debug logging and debug symbols.
* ``-DCMAKE_BUILD_TYPE=Test``
Builds the project with asserts and debug logging but without debug symbols.
* ``-DUSE_DPDK=ON``
Builds with DPDK support, for source installs requires: `-DRTE_SDK=<dir>`
* ``-DUSE_OLD_DPDK=ON``
Builds with DPDK support (<19.11), for source installs requires: `-DRTE_SDK=<dir>`
and `-DRTE_TARGET=x86_64-native-linuxapp-gcc`
Not needed for newer versions of DPDK on Ubuntu 22.04
See :ref:`dpdk` for more details.
* ``-DUSE_HSA=ON``
Build with HSA support if available. Off by default.
Expand Down
Loading

0 comments on commit 292684d

Please sign in to comment.