From 6636649be00df92224397cc129c83a5c2556edf2 Mon Sep 17 00:00:00 2001 From: yaqiangchen Date: Mon, 23 Oct 2023 16:25:28 +0800 Subject: [PATCH] fix build failure caused by dpdk upgrade --- ...host-Fix-compilation-with-dpdk-21.11.patch | 80 +++++++++++++++++++ spdk.spec | 16 ++-- 2 files changed, 87 insertions(+), 9 deletions(-) create mode 100644 0029-lib-vhost-Fix-compilation-with-dpdk-21.11.patch diff --git a/0029-lib-vhost-Fix-compilation-with-dpdk-21.11.patch b/0029-lib-vhost-Fix-compilation-with-dpdk-21.11.patch new file mode 100644 index 0000000..a775823 --- /dev/null +++ b/0029-lib-vhost-Fix-compilation-with-dpdk-21.11.patch @@ -0,0 +1,80 @@ +From f72cab94dd35d7b45ec5a4f35967adf3184ca616 Mon Sep 17 00:00:00 2001 +From: Alexey Marchuk +Date: Mon, 15 Nov 2021 11:01:14 +0300 +Subject: [PATCH] lib/vhost: Fix compilation with dpdk 21.11 + +Structure vhost_device_ops was renamed to +rte_vhost_device_ops + +Signed-off-by: Alexey Marchuk +Change-Id: Ie9601099d47465536500aa37fc113aeae03a8254 +Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10223 +Tested-by: SPDK CI Jenkins +Community-CI: Mellanox Build Bot +Community-CI: Broadcom CI +Reviewed-by: John Kariuki +Reviewed-by: Changpeng Liu +Reviewed-by: Tomasz Zawadzki +--- + lib/vhost/rte_vhost_compat.c | 5 +++++ + test/unit/lib/vhost/vhost.c/vhost_ut.c | 7 +++++++ + 2 files changed, 12 insertions(+) + +diff --git a/lib/vhost/rte_vhost_compat.c b/lib/vhost/rte_vhost_compat.c +index 3c9f691883a..08574cfad07 100644 +--- a/lib/vhost/rte_vhost_compat.c ++++ b/lib/vhost/rte_vhost_compat.c +@@ -3,6 +3,7 @@ + * + * Copyright (c) Intel Corporation. + * All rights reserved. ++ * Copyright (c) 2021 Mellanox Technologies LTD. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +@@ -134,7 +135,11 @@ destroy_connection(int vid) + vhost_destroy_connection_cb(vid); + } + ++#if RTE_VERSION >= RTE_VERSION_NUM(21, 11, 0, 0) ++static const struct rte_vhost_device_ops g_spdk_vhost_ops = { ++#else + static const struct vhost_device_ops g_spdk_vhost_ops = { ++#endif + .new_device = start_device, + .destroy_device = stop_device, + .new_connection = new_connection, +diff --git a/test/unit/lib/vhost/vhost.c/vhost_ut.c b/test/unit/lib/vhost/vhost.c/vhost_ut.c +index df1c32d28e6..e62da334688 100644 +--- a/test/unit/lib/vhost/vhost.c/vhost_ut.c ++++ b/test/unit/lib/vhost/vhost.c/vhost_ut.c +@@ -3,6 +3,7 @@ + * + * Copyright (c) Intel Corporation. + * All rights reserved. ++ * Copyright (c) 2021 Mellanox Technologies LTD. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +@@ -41,6 +42,7 @@ + #include "unit/lib/json_mock.c" + + #include "vhost/vhost.c" ++#include + + DEFINE_STUB(rte_vhost_set_vring_base, int, (int vid, uint16_t queue_id, + uint16_t last_avail_idx, uint16_t last_used_idx), 0); +@@ -65,8 +67,13 @@ DEFINE_STUB(rte_vhost_enable_guest_notification, int, + (int vid, uint16_t queue_id, int enable), 0); + DEFINE_STUB(rte_vhost_get_ifname, int, (int vid, char *buf, size_t len), 0); + DEFINE_STUB(rte_vhost_driver_start, int, (const char *name), 0); ++#if RTE_VERSION >= RTE_VERSION_NUM(21, 11, 0, 0) ++DEFINE_STUB(rte_vhost_driver_callback_register, int, ++ (const char *path, struct rte_vhost_device_ops const *const ops), 0); ++#else + DEFINE_STUB(rte_vhost_driver_callback_register, int, + (const char *path, struct vhost_device_ops const *const ops), 0); ++#endif + DEFINE_STUB(rte_vhost_driver_disable_features, int, (const char *path, uint64_t features), 0); + DEFINE_STUB(rte_vhost_driver_set_features, int, (const char *path, uint64_t features), 0); + DEFINE_STUB(rte_vhost_driver_register, int, (const char *path, uint64_t flags), 0); diff --git a/spdk.spec b/spdk.spec index 2e5ddea..8f59422 100644 --- a/spdk.spec +++ b/spdk.spec @@ -4,7 +4,7 @@ Name: spdk Version: 21.01 -Release: 6 +Release: 7 Summary: Set of libraries and utilities for high performance user-mode storage License: BSD and MIT URL: http://spdk.io @@ -37,6 +37,7 @@ Patch25: 0025-nvmf-fix-fd-leakage-problem-in-nvmf_vfio_user_listen.patch Patch26: 0026-posix-set-fd-to-1-after-close-fd-in-posix_sock_creat.patch Patch27: 0027-spdk_top-check-return-value-of-strdup-in-store_last_.patch Patch28: 0028-uring-set-fd-to-1-after-close-fd-in-uring_sock_creat.patch +Patch29: 0029-lib-vhost-Fix-compilation-with-dpdk-21.11.patch %define package_version %{version}-%{release} @@ -61,14 +62,8 @@ BuildRequires: libibverbs-devel, librdmacm-devel BuildRequires: doxygen mscgen graphviz %endif -%ifarch aarch64 -%global config arm64-armv8a-linux-gcc -%else -%global config x86_64-native-linux-gcc -%endif - # Install dependencies -Requires: dpdk >= 19.11, numactl-libs, openssl-libs +Requires: dpdk >= 21.11, numactl-libs, openssl-libs Requires: libiscsi, libaio, libuuid # NVMe over Fabrics Requires: librdmacm, librdmacm @@ -125,7 +120,7 @@ BuildArch: noarch --disable-unit-tests \ --without-crypto \ --without-isal \ - --with-dpdk=/usr/share/dpdk/%{config} \ + --with-dpdk=/usr/lib64/dpdk/pmds-22.0 \ --without-fio \ --with-vhost \ --without-pmdk \ @@ -209,6 +204,9 @@ mv doc/output/html/ %{install_docdir} %changelog +* Mon Oct 16 2023 chenyaqiang - 21.01-7 +- fix build failure caused by dpdk upgrade + * Fri Feb 03 2023 Hongtao Zhang - 21.01-6 - Add setup.sh scripts during installation -- Gitee