From e71ae46797f3b317d56b49d76710b6b2427c4507 Mon Sep 17 00:00:00 2001 From: Alexey Marchuk Date: Mon, 23 Aug 2021 15:37:06 +0300 Subject: [PATCH] configure: Check if DPDK support mlx5_pci PMD Since SPDK supports DPDK version older than 21.02 which introduces mlx5_pci PMD, we should check DPDK version in use before enabling build of DPDK libraries. Signed-off-by: Alexey Marchuk Change-Id: Ie86a055bfd079f0b0595649a5d6f60d23e1b1185 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9257 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Ben Walker --- configure | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/configure b/configure index def3e85ca..7a0d5b8e4 100755 --- a/configure +++ b/configure @@ -734,13 +734,36 @@ if [[ "${CONFIG[REDUCE]}" = "y" ]]; then exit 1 fi - if echo -e '#include \n' \ + CONFIG[REDUCE_MLX5]="y" + # Check if libmlx5 exists to enable mlx5_pci compress PMD + if ! echo -e '#include \n' \ '#include \n' \ '#include \n' \ 'int main(void) { return 0; }\n' \ | "${BUILD_CMD[@]}" -lmlx5 -I${rootdir}/include -c - 2> /dev/null; then - CONFIG[REDUCE_MLX5]="y" - echo "mlx5 available so enabling DPDK mlx5_pci compress PMD" + echo "libmlx5 is not found, so disabling DPDK mlx5_pci compress PMD" + CONFIG[REDUCE_MLX5]="n" + fi + + if [[ "${CONFIG[DPDK_PKG_CONFIG]}" = "y" ]]; then + # Check if librte_compress_mlx5 exists in DPDK package + if [ ! -f "${CONFIG[DPDK_LIB_DIR]}"/librte_compress_mlx5.so ]; then + echo "librte_compress_mlx5 is not found, so disabling DPDK mlx5_pci compress PMD" + CONFIG[REDUCE_MLX5]="n" + fi + else + # Check DPDK version to determine if mlx5_pci driver is supported + if [ ! -f "${CONFIG[DPDK_DIR]}"/../VERSION ]; then + echo "Can get DPDK version, so disabling DPDK mlx5_pci compress PMD" + CONFIG[REDUCE_MLX5]="n" + else + # mlx5_pci is supported by DPDK >- 21.02.0 + dpdk_ver=$(cat "${CONFIG[DPDK_DIR]}"/../VERSION) + if lt "$dpdk_ver" 21.02.0; then + echo "DPDK version ${dpdk_ver} doesn't support mlx5_pci compress PMD" + CONFIG[REDUCE_MLX5]="n" + fi + fi fi fi