@@ -312,71 +312,98 @@ jobs:
312312 key : ${{ steps.ccache-restore.outputs.cache-primary-key }}
313313
314314 dpdk :
315- runs-on : ubuntu-latest
316- container : seladb/${{ matrix.image }}
315+ runs-on : ubuntu-24.04
317316 strategy :
318317 matrix :
319318 include :
320- - image : ubuntu2404-dpdk2411
321- - image : ubuntu2404-dpdk2311
322- - image : ubuntu2204-dpdk2211
323-
319+ - dpdk_version : 24.11.5
320+ - dpdk_version : 23.11.6
324321 steps :
325- - name : Check AVX-512 support
326- run : |
327- echo "::debug::$(grep flags /proc/cpuinfo)"
328- if grep -q avx512 /proc/cpuinfo; then
329- echo "avx512=true" >> $GITHUB_ENV
330- else
331- echo "avx512=false" >> $GITHUB_ENV
332- fi
333-
334322 - name : Checkout code
335323 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
336324
337- - name : Restore Ccache
338- id : ccache-restore
325+ - name : Install dependencies
326+ run : |
327+ sudo apt update && sudo apt -y install meson libnuma-dev libpcap-dev tcpreplay
328+ pip install --break-system-packages pyelftools
329+
330+ - name : Restore DPDK cache
331+ id : cache-dpdk
339332 uses : actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
340333 with :
341- path : ${{ env.CCACHE_DIR }}
342- key : ${{ matrix.image }}-ccache-${{ github.run_id }}
343- restore-keys : |
344- ${{ matrix.image }}-ccache
334+ path : dpdk/install
335+ key : dpdk-${{ runner.os }}-${{ matrix.dpdk_version }}
336+
337+ - name : Install DPDK
338+ if : steps.cache-dpdk.outputs.cache-hit != 'true'
339+ run : |
340+ wget https://fast.dpdk.org/rel/dpdk-${{ matrix.dpdk_version }}.tar.xz \
341+ && tar -xvf dpdk-${{ matrix.dpdk_version }}.tar.xz \
342+ && rm -rf dpdk-${{ matrix.dpdk_version }}.tar.xz \
343+ && mv dpdk-stable-${{ matrix.dpdk_version }} dpdk && cd dpdk \
344+ && meson setup build --prefix=${{ github.workspace }}/dpdk/install \
345+ && ninja -C build \
346+ && ninja -C build install
347+
348+ - name : Cache DPDK
349+ if : steps.cache-dpdk.outputs.cache-hit != 'true'
350+ uses : actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
351+ with :
352+ path : dpdk/install
353+ key : dpdk-${{ runner.os }}-${{ matrix.dpdk_version }}
345354
346355 - name : Configure PcapPlusPlus
347- run : cmake -DPCAPPP_USE_DPDK=ON ${{ matrix.additional-flags }} -S . -B "$BUILD_DIR"
356+ run : cmake -DPCAPPP_BUILD_COVERAGE=ON - DPCAPPP_USE_DPDK=ON -DDPDK_ROOT= ${{ github.workspace }}/dpdk/install -S . -B "$BUILD_DIR"
348357
349358 - name : Build PcapPlusPlus
350359 run : cmake --build "$BUILD_DIR" -j
351360
352- - name : Test Packet++
353- if : env.avx512 == 'true'
354- run : ./Packet++Test
355- working-directory : ${{ github.workspace }}/${{ env.BUILD_DIR }}/Tests/Packet++Test
361+ - name : Setup veth pair
362+ run : |
363+ sudo ip link add veth0 type veth peer name veth1
364+ sudo ip link set veth0 up
365+ sudo ip link set veth1 up
366+ sudo ip addr add 192.168.100.1/24 dev veth0
367+ sudo ip addr add 192.168.100.2/24 dev veth1
356368
357- - name : Tests skipped (no AVX-512 hardware support)
358- if : env.avx512 == 'false'
359- run : echo "Skipping tests since AVX-512 is not supported on the current runner"
369+ - name : Register DPDK library path
370+ run : |
371+ echo "${{ github.workspace }}/dpdk/install/lib/x86_64-linux-gnu" | sudo tee /etc/ld.so.conf.d/dpdk.conf
372+ sudo ldconfig
360373
361- - name : Check installation
374+ - name : Setup hugepages
362375 run : |
363- cmake -DPCAPPP_BUILD_COVERAGE=OFF -S . -B "$BUILD_DIR"
364- cmake --build "$BUILD_DIR" -j
365- cmake --install "$BUILD_DIR"
376+ sudo mkdir -p /mnt/huge
377+ sudo mount -t hugetlbfs nodev /mnt/huge
378+ echo 512 | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
379+ grep HugePages /proc/meminfo
366380
367- - name : Build Tutorials
381+ - name : Prepare environment for tests
368382 run : |
369- cmake -DPCAPPP_BUILD_TUTORIALS=ON -S Examples -B build_examples
370- cmake --build build_examples -j
383+ python3 -m venv .venv
384+ . .venv/bin/activate
385+ python3 -m pip install -r ci/run_tests/requirements.txt
371386
372- - name : Test Tutorials
373- run : cd build_examples/tutorials_bin && ./Tutorial-HelloWorld
387+ - name : Test PcapPlusPlus
388+ run : |
389+ . .venv/bin/activate
390+ python3 ci/run_tests/run_tests.py --interface eth0 --tcpreplay-interface veth1 --use-sudo --test-suites pcap --pcap-test-args "-t dpdk -d 0 -a --no-pci -a --vdev=net_af_packet0,iface=veth0" --build-dir "$BUILD_DIR"
374391
375- - name : Save Ccache
376- uses : actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
392+ - name : Create Cobertura Report
393+ run : |
394+ . .venv/bin/activate
395+ python3 -m pip install gcovr==${{ matrix.gcovr-version || '8.6' }}
396+ gcovr -v -r . ${{ matrix.additional-gcov-flags }} $GCOVR_FLAGS -o coverage.xml
397+
398+ - name : Upload Coverage Results
399+ uses : codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
377400 with :
378- path : ${{ env.CCACHE_DIR }}
379- key : ${{ steps.ccache-restore.outputs.cache-primary-key }}
401+ files : ./coverage.xml
402+ flags : ${{ matrix.dpdk_version }},unittest
403+ fail_ci_if_error : false
404+ verbose : true
405+ env :
406+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
380407
381408 pfring :
382409 runs-on : ubuntu-latest
0 commit comments