Skip to content

Commit bdada1e

Browse files
committed
ci: enable setting custom DPDK directory
1 parent f7f9fa6 commit bdada1e

4 files changed

+46
-11
lines changed

.ci/templates/job-uhd-streaming-tests-beauty.yml

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ parameters:
1414
type: string
1515
- name: testLength
1616
type: string
17+
- name: dpdkDir
18+
type: string
19+
default: '/'
1720

1821
jobs:
1922
- template: job-uhd-streaming-tests.yml
@@ -27,6 +30,7 @@ jobs:
2730
uhdFpgaArtifactSource: ${{ parameters.uhdFpgaArtifactSource }}
2831
fpga_imgs_source: ${{ parameters.fpga_imgs_source }}
2932
xilinxLocation: /opt/Xilinx/Vivado_Lab/2019.1
33+
dpdkDir: '${{ parameters.dpdkDir }}'
3034
dutMatrix:
3135
# beauty-N320-0 XG:
3236
# dutName: 'beauty-N320-0'

.ci/templates/job-uhd-streaming-tests-x440.yml

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ parameters:
1414
type: string
1515
- name: testLength
1616
type: string
17+
- name: dpdkDir
18+
type: string
19+
default: '/'
1720

1821
jobs:
1922
- template: job-uhd-streaming-tests.yml
@@ -28,6 +31,7 @@ jobs:
2831
uhdFpgaArtifactSource: ${{ parameters.uhdFpgaArtifactSource }}
2932
fpga_imgs_source: ${{ parameters.fpga_imgs_source }}
3033
xilinxLocation: /opt/Xilinx/Vivado_Lab/2023.2
34+
dpdkDir: '${{ parameters.dpdkDir }}'
3135
dutMatrix:
3236
X440-0 CG_400:
3337
dutName: 'streaming-X440-0'

.ci/templates/job-uhd-streaming-tests.yml

+32-11
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ parameters:
3232
type: string
3333
- name: xilinxLocation
3434
type: string
35+
- name: dpdkDir
36+
type: string
37+
default: '/'
3538

3639
jobs:
3740
- job: uhd_streaming_tests_${{ parameters.suiteName }}
@@ -316,28 +319,46 @@ jobs:
316319
# For example, if the streaming system uses a Mellanox NIC and thus needs Mellanox drivers installed but the agent used to build UHD doesn't
317320
# then you can get an access violation when using that version of UHD with dpdk on the streaming system
318321
- script: |
322+
set -e
319323
mkdir ${{ parameters.uhdSrcDir }}/host/build
320324
cd ${{ parameters.uhdSrcDir }}/host/build
325+
if [ "${{ parameters.dpdkDir }}" != "/" ]; then
326+
export PKG_CONFIG_PATH="${{ parameters.dpdkDir }}/lib/x86_64-linux-gnu/pkgconfig"
327+
export LD_LIBRARY_PATH="${{ parameters.dpdkDir }}/lib/x86_64-linux-gnu"
328+
else
329+
export LD_LIBRARY_PATH=""
330+
fi
331+
echo "##vso[task.setvariable variable=LD_LIBRARY_PATH;isOutput=true]$LD_LIBRARY_PATH"
321332
cmake -DCMAKE_INSTALL_PREFIX=$(Build.BinariesDirectory)/uhddev/build-installed ..
322-
make -j8 install
333+
make -j$(nproc) install
334+
sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH tests/dpdk_test || true
335+
utils/uhd_config_info --print-all
336+
name: dpdk_build
323337
displayName: build UHD for dpdk installed on test machine
324-
condition: succeeded()
338+
condition: and(succeeded(), not(eq(variables.dutType, 'B210')))
325339
326340
- script: |
327341
if [ "$(dutType)" = "x440" ]; then
328-
echo "##vso[task.setvariable variable=config_file]${{ parameters.uhdSrcDir }}/host/tests/pytests/uhd_configs/uhd_dpdk_100GbE_x440.conf"
329-
echo "Using x440 100 GbE UHD Config File"
342+
config_file="${{ parameters.uhdSrcDir }}/host/tests/pytests/uhd_configs/uhd_dpdk_100GbE_x440.conf"
343+
echo "Using x440 100 GbE UHD Config File ($config_file)"
330344
elif [ "$(dutFPGA)" = "CG_400" ]; then
331-
echo "##vso[task.setvariable variable=config_file]${{ parameters.uhdSrcDir }}/host/tests/pytests/uhd_configs/uhd_dpdk_100GbE.conf"
332-
echo "Using 100 GbE UHD Config File"
345+
config_file="${{ parameters.uhdSrcDir }}/host/tests/pytests/uhd_configs/uhd_dpdk_100GbE.conf"
346+
echo "Using 100 GbE UHD Config File ($config_file)"
333347
elif [ "$(dutFPGA)" = "UC_200" ]; then
334-
echo "##vso[task.setvariable variable=config_file]${{ parameters.uhdSrcDir }}/host/tests/pytests/uhd_configs/uhd_dpdk_100GbE_SFP1.conf"
335-
echo "Using 100 GbE SFP1 UHD Config File"
348+
config_file="${{ parameters.uhdSrcDir }}/host/tests/pytests/uhd_configs/uhd_dpdk_100GbE_SFP1.conf"
349+
echo "Using 100 GbE SFP1 UHD Config File ($config_file)"
336350
else
337-
echo "##vso[task.setvariable variable=config_file]${{ parameters.uhdSrcDir }}/host/tests/pytests/uhd_configs/uhd_dpdk_10GbE.conf"
338-
echo "Using 10 GbE UHD Config File"
351+
config_file="${{ parameters.uhdSrcDir }}/host/tests/pytests/uhd_configs/uhd_dpdk_10GbE.conf"
352+
echo "Using 10 GbE UHD Config File ($config_file)"
353+
fi
354+
echo "##vso[task.setvariable variable=config_file]$config_file"
355+
if [ "${{ parameters.dpdkDir }}" != "/" ]; then
356+
dpdk_driver=$(find "${{ parameters.dpdkDir }}/lib/x86_64-linux-gnu" -name "pmds-*" -type d)
357+
echo "Setting dpdk_driver to $dpdk_driver"
358+
sed -i "s|^dpdk_driver.*|dpdk_driver = $dpdk_driver|" $config_file
339359
fi
340360
displayName: select UHD config file for DPDK
361+
condition: and(succeeded(), not(eq(variables.dutType, 'B210')))
341362
342363
- script: |
343364
echo "##[group]Printing Environment"
@@ -354,7 +375,7 @@ jobs:
354375
env:
355376
UHD_CONFIG_FILE: $(config_file)
356377
PYTHONPATH: ${{ parameters.uhdSrcDir }}/host/tests/streaming_performance
357-
LD_LIBRARY_PATH: $(Build.BinariesDirectory)/uhddev/build-installed/lib
378+
LD_LIBRARY_PATH: $(Build.BinariesDirectory)/uhddev/build-installed/lib:$(dpdk_build.LD_LIBRARY_PATH)
358379
UHD_IMAGES_DIR: $(Build.BinariesDirectory)/uhddev/build-installed/share/uhd/images
359380
continueOnError: true
360381
displayName: Run streaming tests with DPDK on $(dutName)

.ci/uhd-hardware-test-dev.yml

+6
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ parameters:
5757
- 'smoke'
5858
- 'full'
5959
- 'stress'
60+
- name: dpdkDir
61+
type: string
62+
displayName: DPDK Directory on Agent
63+
default: '/'
6064

6165
resources:
6266
pipelines:
@@ -136,6 +140,7 @@ stages:
136140
uhdFpgaArtifactSource: uhd_fpga_pipeline
137141
fpga_imgs_source: ${{ parameters.fpga_imgs_source }}
138142
testLength: ${{ parameters.testLength }}
143+
dpdkDir: '${{ parameters.dpdkDir }}'
139144

140145
- stage: test_x440_streaming_stage
141146
displayName: Test X440 Streaming
@@ -153,6 +158,7 @@ stages:
153158
uhdFpgaArtifactSource: uhd_fpga_pipeline
154159
fpga_imgs_source: ${{ parameters.fpga_imgs_source }}
155160
testLength: ${{ parameters.testLength }}
161+
dpdkDir: '${{ parameters.dpdkDir }}'
156162

157163
- stage: test_uhd_devtest
158164
displayName: Test UHD Devtest

0 commit comments

Comments
 (0)