!36 Adapt for dpdk 21.11
Merge pull request !36 from swf504/openEuler-22.03-LTS-Next
This commit is contained in:
commit
b9b48cb435
80
0013-lib-vhost-Fix-compilation-with-dpdk-21.11.patch
Normal file
80
0013-lib-vhost-Fix-compilation-with-dpdk-21.11.patch
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
From f72cab94dd35d7b45ec5a4f35967adf3184ca616 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Alexey Marchuk <alexeymar@mellanox.com>
|
||||||
|
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 <alexeymar@mellanox.com>
|
||||||
|
Change-Id: Ie9601099d47465536500aa37fc113aeae03a8254
|
||||||
|
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10223
|
||||||
|
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||||
|
Community-CI: Mellanox Build Bot
|
||||||
|
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
|
||||||
|
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
|
||||||
|
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||||
|
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||||
|
---
|
||||||
|
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 <rte_version.h>
|
||||||
|
|
||||||
|
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);
|
||||||
16
spdk.spec
16
spdk.spec
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Name: spdk
|
Name: spdk
|
||||||
Version: 21.01.1
|
Version: 21.01.1
|
||||||
Release: 1
|
Release: 2
|
||||||
Summary: Set of libraries and utilities for high performance user-mode storage
|
Summary: Set of libraries and utilities for high performance user-mode storage
|
||||||
License: BSD and MIT
|
License: BSD and MIT
|
||||||
URL: http://spdk.io
|
URL: http://spdk.io
|
||||||
@ -20,6 +20,7 @@ Patch9: 0009-posix-set-fd-to-1-after-close-fd-in-posix_sock_creat.patch
|
|||||||
Patch10: 0010-spdk_top-check-return-value-of-strdup-in-store_last_.patch
|
Patch10: 0010-spdk_top-check-return-value-of-strdup-in-store_last_.patch
|
||||||
Patch11: 0011-uring-set-fd-to-1-after-close-fd-in-uring_sock_creat.patch
|
Patch11: 0011-uring-set-fd-to-1-after-close-fd-in-uring_sock_creat.patch
|
||||||
Patch12: 0012-spdk-use-fstack-protector-strong-instead-of-fstack-p.patch
|
Patch12: 0012-spdk-use-fstack-protector-strong-instead-of-fstack-p.patch
|
||||||
|
Patch13: 0013-lib-vhost-Fix-compilation-with-dpdk-21.11.patch
|
||||||
|
|
||||||
%define package_version %{version}-%{release}
|
%define package_version %{version}-%{release}
|
||||||
|
|
||||||
@ -44,14 +45,8 @@ BuildRequires: libibverbs-devel, librdmacm-devel
|
|||||||
BuildRequires: doxygen mscgen graphviz
|
BuildRequires: doxygen mscgen graphviz
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%ifarch aarch64
|
|
||||||
%global config arm64-armv8a-linux-gcc
|
|
||||||
%else
|
|
||||||
%global config x86_64-native-linux-gcc
|
|
||||||
%endif
|
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
Requires: dpdk >= 19.11, numactl-libs, openssl-libs
|
Requires: dpdk >= 21.11, numactl-libs, openssl-libs
|
||||||
Requires: libiscsi, libaio, libuuid
|
Requires: libiscsi, libaio, libuuid
|
||||||
# NVMe over Fabrics
|
# NVMe over Fabrics
|
||||||
Requires: librdmacm, librdmacm
|
Requires: librdmacm, librdmacm
|
||||||
@ -107,7 +102,7 @@ BuildArch: noarch
|
|||||||
--disable-unit-tests \
|
--disable-unit-tests \
|
||||||
--without-crypto \
|
--without-crypto \
|
||||||
--without-isal \
|
--without-isal \
|
||||||
--with-dpdk=/usr/share/dpdk/%{config} \
|
--with-dpdk=/usr/lib64/dpdk/pmds-22.0 \
|
||||||
--without-fio \
|
--without-fio \
|
||||||
--with-vhost \
|
--with-vhost \
|
||||||
--without-pmdk \
|
--without-pmdk \
|
||||||
@ -179,6 +174,9 @@ mv doc/output/html/ %{install_docdir}
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jan 10 2022 Weifeng Su <suweifeng1@huawei.com> - 21.01.1-2
|
||||||
|
- Adapt for dpdk 21.11
|
||||||
|
|
||||||
* Tue Nov 23 2021 Weifeng Su <suweifeng1@huawei.com> - 21.01.1-1
|
* Tue Nov 23 2021 Weifeng Su <suweifeng1@huawei.com> - 21.01.1-1
|
||||||
- rebase to v21.01.1 Maintenance LTS Version
|
- rebase to v21.01.1 Maintenance LTS Version
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user