!34 Rebase to spdk v21.01.1 Maintenance Release
From: @swf504 Reviewed-by: @liuzhiqiang26 Signed-off-by: @liuzhiqiang26
This commit is contained in:
commit
ef270196f5
@ -1,65 +0,0 @@
|
||||
From 5932cd76b357acbfcd9bfa56f4e7f5b3225815e9 Mon Sep 17 00:00:00 2001
|
||||
From: sunshihao520 <sunshihao@huawei.com>
|
||||
Date: Thu, 4 Feb 2021 14:52:43 +0800
|
||||
Subject: [PATCH 01/15] lib:env_dpdk fix the enum rte_kernel_driver definition
|
||||
deference between dpdk 19.11 and 20.11
|
||||
|
||||
In dpdk 19.11, rte_kernel_driver is the old version, add version check before use the members.
|
||||
Signed-off-by: sunshihao <sunshihao@huawei.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6252 (master)
|
||||
|
||||
(cherry picked from commit b1687cd45680d1573be9f66e748014fd9c5e9e4e)
|
||||
Change-Id: Ic1db37cc0760c7d03692fd2cdcbb6ff1e41f872d
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6321
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: sunshihao <sunshihao@huawei.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
---
|
||||
lib/env_dpdk/memory.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/lib/env_dpdk/memory.c b/lib/env_dpdk/memory.c
|
||||
index f49dcf4..c923483 100644
|
||||
--- a/lib/env_dpdk/memory.c
|
||||
+++ b/lib/env_dpdk/memory.c
|
||||
@@ -1238,7 +1238,11 @@ vtophys_iommu_device_event(const char *device_name,
|
||||
RTE_DEV_FOREACH(dev, "bus=pci", &dev_iter) {
|
||||
if (strcmp(dev->name, device_name) == 0) {
|
||||
struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(dev);
|
||||
+#if RTE_VERSION < RTE_VERSION_NUM(20, 11, 0, 0)
|
||||
+ if (pci_dev->kdrv == RTE_KDRV_VFIO) {
|
||||
+#else
|
||||
if (pci_dev->kdrv == RTE_PCI_KDRV_VFIO) {
|
||||
+#endif
|
||||
/* This is a new PCI device using vfio */
|
||||
g_vfio.device_ref++;
|
||||
}
|
||||
@@ -1267,7 +1271,11 @@ vtophys_iommu_device_event(const char *device_name,
|
||||
RTE_DEV_FOREACH(dev, "bus=pci", &dev_iter) {
|
||||
if (strcmp(dev->name, device_name) == 0) {
|
||||
struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(dev);
|
||||
+#if RTE_VERSION < RTE_VERSION_NUM(20, 11, 0, 0)
|
||||
+ if (pci_dev->kdrv == RTE_KDRV_VFIO) {
|
||||
+#else
|
||||
if (pci_dev->kdrv == RTE_PCI_KDRV_VFIO) {
|
||||
+#endif
|
||||
/* This is a PCI device using vfio */
|
||||
g_vfio.device_ref--;
|
||||
}
|
||||
@@ -1362,7 +1370,11 @@ vtophys_iommu_init(void)
|
||||
RTE_DEV_FOREACH(dev, "bus=pci", &dev_iter) {
|
||||
struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(dev);
|
||||
|
||||
+#if RTE_VERSION < RTE_VERSION_NUM(20, 11, 0, 0)
|
||||
+ if (pci_dev->kdrv == RTE_KDRV_VFIO) {
|
||||
+#else
|
||||
if (pci_dev->kdrv == RTE_PCI_KDRV_VFIO) {
|
||||
+#endif
|
||||
/* This is a PCI device using vfio */
|
||||
g_vfio.device_ref++;
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
From bf8f81bc254642110b009e802e479be1ea149423 Mon Sep 17 00:00:00 2001
|
||||
From: Jim Harris <james.r.harris@intel.com>
|
||||
Date: Mon, 1 Feb 2021 14:28:30 +0000
|
||||
Subject: [PATCH 02/15] env_dpdk: add rte_ethdev dependency
|
||||
|
||||
As of DPDK main commit 682a6454 ("power: add ethdev
|
||||
power management"), rte_power depends on rte_ethdev.
|
||||
So add rte_ethdev library, but only on Linux since
|
||||
that is the only place where we use rte_power.
|
||||
|
||||
Signed-off-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6210 (master)
|
||||
|
||||
(cherry picked from commit 710838103bb8ba6e9938dd6aa66c72c6ecb3e928)
|
||||
Change-Id: Ibc3473d6ec75c14a8c0c5517616950017cb2ea96
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6320
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
---
|
||||
lib/env_dpdk/env.mk | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/env_dpdk/env.mk b/lib/env_dpdk/env.mk
|
||||
index 6dae04e..f44f515 100644
|
||||
--- a/lib/env_dpdk/env.mk
|
||||
+++ b/lib/env_dpdk/env.mk
|
||||
@@ -51,7 +51,7 @@ DPDK_INC := -I$(DPDK_INC_DIR)
|
||||
DPDK_LIB_LIST = rte_eal rte_mempool rte_ring rte_mbuf rte_pci rte_bus_pci rte_mempool_ring
|
||||
|
||||
ifeq ($(OS),Linux)
|
||||
-DPDK_LIB_LIST += rte_power
|
||||
+DPDK_LIB_LIST += rte_power rte_ethdev
|
||||
endif
|
||||
|
||||
# DPDK 20.05 eal dependency
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
From fa2ceb127060000d26758db36e5e13c4c7d97f77 Mon Sep 17 00:00:00 2001
|
||||
From: sunshihao520 <sunshihao@huawei.com>
|
||||
Date: Thu, 4 Feb 2021 19:49:03 +0800
|
||||
Subject: [PATCH 03/15] pkg:spdk.spec Add ncurses-devel to BuildRequires
|
||||
|
||||
ncurses.h is needed in spdk_top, add ncurses-devel to BuildRequires.
|
||||
|
||||
Signed-off-by: sunshihao <sunshihao@huawei.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6258 (master)
|
||||
|
||||
(cherry picked from commit ccbdd1750f3da9be85b2018896fab5c88cb7f686)
|
||||
Change-Id: I22754838788fe237a29ab74a675a94ab7007bd33
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6388
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: sunshihao <sunshihao@huawei.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
---
|
||||
pkg/spdk.spec | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/pkg/spdk.spec b/pkg/spdk.spec
|
||||
index 2237635..23de4f8 100644
|
||||
--- a/pkg/spdk.spec
|
||||
+++ b/pkg/spdk.spec
|
||||
@@ -22,7 +22,7 @@ License: BSD
|
||||
ExclusiveArch: x86_64
|
||||
|
||||
BuildRequires: gcc gcc-c++ make
|
||||
-BuildRequires: dpdk-devel, numactl-devel
|
||||
+BuildRequires: dpdk-devel, numactl-devel, ncurses-devel
|
||||
BuildRequires: libiscsi-devel, libaio-devel, openssl-devel, libuuid-devel
|
||||
BuildRequires: libibverbs-devel, librdmacm-devel
|
||||
%if %{with doc}
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
From 0c08337dd060fd42390c6fab26f5a08d0d6269bf Mon Sep 17 00:00:00 2001
|
||||
From: sunshihao520 <sunshihao@huawei.com>
|
||||
Date: Tue, 9 Feb 2021 15:17:24 +0800
|
||||
Subject: [PATCH 04/15] lib:vhost Add version check when use
|
||||
RTE_VHOST_USER_ASYNC_COPY in 21.01
|
||||
|
||||
In dpdk 19.11 version, RTE_VHOST_USER_ASYNC_COPY is not define.
|
||||
After dpdk 20.08, we can use RTE_VHOST_USER_ASYNC_COPY.
|
||||
Use version check to avoid this problem.
|
||||
|
||||
Signed-off-by: sunshihao <sunshihao@huawei.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6274 (master)
|
||||
|
||||
(cherry picked from commit 9529803fe0f32d69752cf01eeed590056bd43637)
|
||||
Change-Id: Iaf9914e8380f3d54cded1e2f16af6a7dc3504f95
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6255
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
---
|
||||
lib/vhost/rte_vhost_compat.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/lib/vhost/rte_vhost_compat.c b/lib/vhost/rte_vhost_compat.c
|
||||
index 85cce3d..3c9f691 100644
|
||||
--- a/lib/vhost/rte_vhost_compat.c
|
||||
+++ b/lib/vhost/rte_vhost_compat.c
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "spdk/barrier.h"
|
||||
#include "spdk/vhost.h"
|
||||
#include "vhost_internal.h"
|
||||
+#include <rte_version.h>
|
||||
|
||||
#include "spdk_internal/vhost_user.h"
|
||||
|
||||
@@ -331,7 +332,11 @@ vhost_register_unix_socket(const char *path, const char *ctrl_name,
|
||||
}
|
||||
}
|
||||
|
||||
+#if RTE_VERSION < RTE_VERSION_NUM(20, 8, 0, 0)
|
||||
+ if (rte_vhost_driver_register(path, 0) != 0) {
|
||||
+#else
|
||||
if (rte_vhost_driver_register(path, RTE_VHOST_USER_ASYNC_COPY) != 0) {
|
||||
+#endif
|
||||
SPDK_ERRLOG("Could not register controller %s with vhost library\n", ctrl_name);
|
||||
SPDK_ERRLOG("Check if domain socket %s already exists\n", path);
|
||||
return -EIO;
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,89 +0,0 @@
|
||||
From d889786d0044daff1344ed919bc7bab7d88da6ab Mon Sep 17 00:00:00 2001
|
||||
From: Vasuki Manikarnike <vasuki.manikarnike@hpe.com>
|
||||
Date: Thu, 4 Feb 2021 15:54:37 +0000
|
||||
Subject: [PATCH 05/15] lib/nvme: Remove qpair from all lists before freeing
|
||||
it.
|
||||
|
||||
Fixes #1777.
|
||||
|
||||
When a qpair cannot be allocated because the transport connection fails,
|
||||
the qpair was freed without unlinking it from the other structures.
|
||||
This was leading to a segfault when attempting to create and free other
|
||||
qpairs.
|
||||
Also added a unit test to cover this case.
|
||||
|
||||
Signed-off-by: Vasuki Manikarnike <vasuki.manikarnike@hpe.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6272 (master)
|
||||
|
||||
(cherry picked from commit d92c2f118aa9ccbd242538a01b2ce0e2cf0c6b04)
|
||||
Change-Id: I74b78d1847f90117248b07203b43a11ff5cfa5d6
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6393
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
---
|
||||
lib/nvme/nvme_ctrlr.c | 4 ++++
|
||||
test/unit/lib/nvme/nvme_ctrlr.c/nvme_ctrlr_ut.c | 22 ++++++++++++++++++++++
|
||||
2 files changed, 26 insertions(+)
|
||||
|
||||
diff --git a/lib/nvme/nvme_ctrlr.c b/lib/nvme/nvme_ctrlr.c
|
||||
index 1960b0a..ff27771 100644
|
||||
--- a/lib/nvme/nvme_ctrlr.c
|
||||
+++ b/lib/nvme/nvme_ctrlr.c
|
||||
@@ -418,8 +418,12 @@ spdk_nvme_ctrlr_alloc_io_qpair(struct spdk_nvme_ctrlr *ctrlr,
|
||||
rc = spdk_nvme_ctrlr_connect_io_qpair(ctrlr, qpair);
|
||||
if (rc != 0) {
|
||||
SPDK_ERRLOG("nvme_transport_ctrlr_connect_io_qpair() failed\n");
|
||||
+ nvme_robust_mutex_lock(&ctrlr->ctrlr_lock);
|
||||
+ nvme_ctrlr_proc_remove_io_qpair(qpair);
|
||||
TAILQ_REMOVE(&ctrlr->active_io_qpairs, qpair, tailq);
|
||||
+ spdk_bit_array_set(ctrlr->free_io_qids, qpair->id);
|
||||
nvme_transport_ctrlr_delete_io_qpair(ctrlr, qpair);
|
||||
+ nvme_robust_mutex_unlock(&ctrlr->ctrlr_lock);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
diff --git a/test/unit/lib/nvme/nvme_ctrlr.c/nvme_ctrlr_ut.c b/test/unit/lib/nvme/nvme_ctrlr.c/nvme_ctrlr_ut.c
|
||||
index 3e2321d..16a4c1b 100644
|
||||
--- a/test/unit/lib/nvme/nvme_ctrlr.c/nvme_ctrlr_ut.c
|
||||
+++ b/test/unit/lib/nvme/nvme_ctrlr.c/nvme_ctrlr_ut.c
|
||||
@@ -2162,6 +2162,27 @@ test_nvme_ctrlr_init_set_keep_alive_timeout(void)
|
||||
nvme_ctrlr_destruct(&ctrlr);
|
||||
}
|
||||
|
||||
+static void
|
||||
+test_alloc_io_qpair_fail(void)
|
||||
+{
|
||||
+ struct spdk_nvme_ctrlr ctrlr = {};
|
||||
+ struct spdk_nvme_qpair *q0;
|
||||
+
|
||||
+ setup_qpairs(&ctrlr, 1);
|
||||
+
|
||||
+ /* Modify the connect_qpair return code to inject a failure */
|
||||
+ g_connect_qpair_return_code = 1;
|
||||
+
|
||||
+ /* Attempt to allocate a qpair, this should fail */
|
||||
+ q0 = spdk_nvme_ctrlr_alloc_io_qpair(&ctrlr, NULL, 0);
|
||||
+ SPDK_CU_ASSERT_FATAL(q0 == NULL);
|
||||
+
|
||||
+ /* Verify that the qpair is removed from the lists */
|
||||
+ SPDK_CU_ASSERT_FATAL(TAILQ_EMPTY(&ctrlr.active_io_qpairs));
|
||||
+
|
||||
+ cleanup_qpairs(&ctrlr);
|
||||
+}
|
||||
+
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CU_pSuite suite = NULL;
|
||||
@@ -2200,6 +2221,7 @@ int main(int argc, char **argv)
|
||||
CU_ADD_TEST(suite, test_nvme_ctrlr_init_set_nvmf_ioccsz);
|
||||
CU_ADD_TEST(suite, test_nvme_ctrlr_init_set_num_queues);
|
||||
CU_ADD_TEST(suite, test_nvme_ctrlr_init_set_keep_alive_timeout);
|
||||
+ CU_ADD_TEST(suite, test_alloc_io_qpair_fail);
|
||||
|
||||
CU_basic_set_mode(CU_BRM_VERBOSE);
|
||||
CU_basic_run_tests();
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
From f8acbbb0ac154fa812e6297e86fad58381d4a163 Mon Sep 17 00:00:00 2001
|
||||
From: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Date: Fri, 12 Feb 2021 03:45:16 -0500
|
||||
Subject: [PATCH 06/15] lib/env_dpdk: add rte_net dependency
|
||||
|
||||
Vhost is enabled by default, so rte_net was always included.
|
||||
When disabled, rte_power failed as it depends on rte_ethdev and rte_net.
|
||||
|
||||
rte_vhost was only possible to enable on Linux, so there
|
||||
is no conflict with adding it next to rte_power under this condition.
|
||||
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6398 (master)
|
||||
|
||||
(cherry picked from commit 232f34d754e08b9673fd3585786ca8cd55653b85)
|
||||
Change-Id: I2e183004d6457e404471740a0540dcb08aa738d8
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6430
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
|
||||
---
|
||||
lib/env_dpdk/env.mk | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/env_dpdk/env.mk b/lib/env_dpdk/env.mk
|
||||
index f44f515..292dd91 100644
|
||||
--- a/lib/env_dpdk/env.mk
|
||||
+++ b/lib/env_dpdk/env.mk
|
||||
@@ -51,7 +51,7 @@ DPDK_INC := -I$(DPDK_INC_DIR)
|
||||
DPDK_LIB_LIST = rte_eal rte_mempool rte_ring rte_mbuf rte_pci rte_bus_pci rte_mempool_ring
|
||||
|
||||
ifeq ($(OS),Linux)
|
||||
-DPDK_LIB_LIST += rte_power rte_ethdev
|
||||
+DPDK_LIB_LIST += rte_power rte_ethdev rte_net
|
||||
endif
|
||||
|
||||
# DPDK 20.05 eal dependency
|
||||
@@ -101,7 +101,7 @@ endif
|
||||
LINK_HASH=n
|
||||
|
||||
ifeq ($(CONFIG_VHOST),y)
|
||||
-DPDK_LIB_LIST += rte_vhost rte_net
|
||||
+DPDK_LIB_LIST += rte_vhost
|
||||
LINK_HASH=y
|
||||
ifneq ($(DPDK_FRAMEWORK),y)
|
||||
DPDK_LIB_LIST += rte_cryptodev
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
From 4eca99edc2e23b4d6250907b62e8feda66414fd9 Mon Sep 17 00:00:00 2001
|
||||
From: sunshihao520 <sunshihao@huawei.com>
|
||||
Date: Tue, 9 Feb 2021 15:45:30 +0800
|
||||
Subject: [PATCH 07/15] pkg: add python3 requires in spdk.spec
|
||||
|
||||
When use rpm -i to install spdk-tools, it requires python3-configshell
|
||||
and python3-pexpect. Add this requires to spec to avoid install failure.
|
||||
|
||||
Signed-off-by: sunshihao <sunshihao@huawei.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6336 (master)
|
||||
|
||||
(cherry picked from commit a4ee18886d728de55070fd8c08f947be4004c207)
|
||||
Change-Id: I7fc7e9aab35c3fd730401282b72b1604f765a73f
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6431
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: sunshihao <sunshihao@huawei.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
|
||||
---
|
||||
pkg/spdk.spec | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/pkg/spdk.spec b/pkg/spdk.spec
|
||||
index 23de4f8..0fc46e7 100644
|
||||
--- a/pkg/spdk.spec
|
||||
+++ b/pkg/spdk.spec
|
||||
@@ -32,6 +32,7 @@ BuildRequires: doxygen mscgen graphviz
|
||||
# Install dependencies
|
||||
Requires: dpdk >= 19.11, numactl-libs, openssl-libs
|
||||
Requires: libiscsi, libaio, libuuid
|
||||
+Requires: python3-configshell, python3-pexpect
|
||||
# NVMe over Fabrics
|
||||
Requires: librdmacm, librdmacm
|
||||
Requires(post): /sbin/ldconfig
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
From 830f0bab074f397bd13eec39fbef63b550a302b2 Mon Sep 17 00:00:00 2001
|
||||
From: Richael Zhuang <richael.zhuang@arm.com>
|
||||
Date: Thu, 28 Jan 2021 17:19:15 +0800
|
||||
Subject: [PATCH 08/15] sock: add enable_quickack and enable_placement_id when
|
||||
writing json config
|
||||
|
||||
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6144 (master)
|
||||
|
||||
(cherry picked from commit c0a3cf7b88851cf51dff8145546dd3c7e2741c9d)
|
||||
Change-Id: If67dcb6bf7b9742d2c96481057b472e31e87e87d
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6392
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
|
||||
---
|
||||
lib/sock/sock.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/lib/sock/sock.c b/lib/sock/sock.c
|
||||
index ef4678f..8aa2817 100644
|
||||
--- a/lib/sock/sock.c
|
||||
+++ b/lib/sock/sock.c
|
||||
@@ -832,6 +832,8 @@ spdk_sock_write_config_json(struct spdk_json_write_ctx *w)
|
||||
spdk_json_write_named_uint32(w, "send_buf_size", opts.send_buf_size);
|
||||
spdk_json_write_named_bool(w, "enable_recv_pipe", opts.enable_recv_pipe);
|
||||
spdk_json_write_named_bool(w, "enable_zerocopy_send", opts.enable_zerocopy_send);
|
||||
+ spdk_json_write_named_bool(w, "enable_quickack", opts.enable_quickack);
|
||||
+ spdk_json_write_named_bool(w, "enable_placement_id", opts.enable_placement_id);
|
||||
spdk_json_write_object_end(w);
|
||||
spdk_json_write_object_end(w);
|
||||
} else {
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
From 66ce3d8005f9a37f55c36146bb73476c6f6f1d22 Mon Sep 17 00:00:00 2001
|
||||
From: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
|
||||
Date: Wed, 17 Feb 2021 20:57:38 +0900
|
||||
Subject: [PATCH 09/15] bdev/ocssd: Fix the bug that no media event is pushed
|
||||
to the target bdev
|
||||
|
||||
Recent refactoring added a critical bug that no media event is pushed
|
||||
to the target bdev.
|
||||
|
||||
Fix the bug by changing return to break.
|
||||
|
||||
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6455 (master)
|
||||
|
||||
(cherry picked from commit bd8de45801cc0b45dedddef6534cd35493163b29)
|
||||
Change-Id: Ia674ea2c9c21d08dd23b50a0f726da55011d4be4
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6616
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
---
|
||||
module/bdev/nvme/bdev_ocssd.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/module/bdev/nvme/bdev_ocssd.c b/module/bdev/nvme/bdev_ocssd.c
|
||||
index 1cf1705..748b454 100644
|
||||
--- a/module/bdev/nvme/bdev_ocssd.c
|
||||
+++ b/module/bdev/nvme/bdev_ocssd.c
|
||||
@@ -967,7 +967,7 @@ bdev_ocssd_push_media_events(struct nvme_bdev_ns *nvme_ns,
|
||||
TAILQ_FOREACH(nvme_bdev, &nvme_ns->bdevs, tailq) {
|
||||
ocssd_bdev = SPDK_CONTAINEROF(nvme_bdev, struct ocssd_bdev, nvme_bdev);
|
||||
if (bdev_ocssd_lba_in_range(ocssd_bdev, ocssd_ns, chunk_entry->lba)) {
|
||||
- return;
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,128 +0,0 @@
|
||||
From c2c8b7d986c86ff2ec031873d3b08e7e5eae22ea Mon Sep 17 00:00:00 2001
|
||||
From: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Date: Mon, 8 Feb 2021 10:28:44 -0500
|
||||
Subject: [PATCH 10/15] lib/iscsi: return immediately from iscsi_parse_params
|
||||
if len is 0
|
||||
|
||||
The spec does not disallow TEXT PDUs with no data. In that
|
||||
case, just return immediately from iscsi_parse_params.
|
||||
|
||||
This avoids a NULL pointer dereference with a TEXT PDU that has
|
||||
no data, but CONTINUE flag is set.
|
||||
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Signed-off-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6319 (master)
|
||||
|
||||
(cherry picked from commit f3fd56fc3c73ee7595bbe7c69cf8048fe2577e1a)
|
||||
Change-Id: I2605293daf171633a45132d7b5532fdfc9128aff
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6601
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
---
|
||||
lib/iscsi/param.c | 10 +++++++++
|
||||
test/unit/lib/iscsi/iscsi.c/iscsi_ut.c | 38 ++++++++++++++++++++++++++++++++++
|
||||
test/unit/lib/iscsi/param.c/param_ut.c | 8 +++++++
|
||||
3 files changed, 56 insertions(+)
|
||||
|
||||
diff --git a/lib/iscsi/param.c b/lib/iscsi/param.c
|
||||
index 1a353c4..ab2c9cd 100644
|
||||
--- a/lib/iscsi/param.c
|
||||
+++ b/lib/iscsi/param.c
|
||||
@@ -315,6 +315,16 @@ iscsi_parse_params(struct iscsi_param **params, const uint8_t *data,
|
||||
char *p;
|
||||
int i;
|
||||
|
||||
+ /* Spec does not disallow TEXT PDUs with zero length, just return
|
||||
+ * immediately in that case, since there is no param data to parse
|
||||
+ * and any existing partial parameter would remain as-is.
|
||||
+ */
|
||||
+ if (len == 0) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ assert(data != NULL);
|
||||
+
|
||||
/* strip the partial text parameters if previous PDU have C enabled */
|
||||
if (partial_parameter && *partial_parameter) {
|
||||
for (i = 0; i < len && data[i] != '\0'; i++) {
|
||||
diff --git a/test/unit/lib/iscsi/iscsi.c/iscsi_ut.c b/test/unit/lib/iscsi/iscsi.c/iscsi_ut.c
|
||||
index c901e9e..56082a0 100644
|
||||
--- a/test/unit/lib/iscsi/iscsi.c/iscsi_ut.c
|
||||
+++ b/test/unit/lib/iscsi/iscsi.c/iscsi_ut.c
|
||||
@@ -1993,6 +1993,43 @@ pdu_hdr_op_data_test(void)
|
||||
g_task_pool_is_empty = false;
|
||||
}
|
||||
|
||||
+/* Test an ISCSI_OP_TEXT PDU with CONTINUE bit set but
|
||||
+ * no data.
|
||||
+ */
|
||||
+static void
|
||||
+empty_text_with_cbit_test(void)
|
||||
+{
|
||||
+ struct spdk_iscsi_sess sess = {};
|
||||
+ struct spdk_iscsi_conn conn = {};
|
||||
+ struct spdk_scsi_dev dev = {};
|
||||
+ struct spdk_iscsi_pdu *req_pdu;
|
||||
+ int rc;
|
||||
+
|
||||
+ req_pdu = iscsi_get_pdu(&conn);
|
||||
+
|
||||
+ sess.ExpCmdSN = 0;
|
||||
+ sess.MaxCmdSN = 64;
|
||||
+ sess.session_type = SESSION_TYPE_NORMAL;
|
||||
+ sess.MaxBurstLength = 1024;
|
||||
+
|
||||
+ conn.full_feature = 1;
|
||||
+ conn.sess = &sess;
|
||||
+ conn.dev = &dev;
|
||||
+ conn.state = ISCSI_CONN_STATE_RUNNING;
|
||||
+
|
||||
+ memset(&req_pdu->bhs, 0, sizeof(req_pdu->bhs));
|
||||
+ req_pdu->bhs.opcode = ISCSI_OP_TEXT;
|
||||
+ req_pdu->bhs.flags = ISCSI_TEXT_CONTINUE;
|
||||
+
|
||||
+ rc = iscsi_pdu_hdr_handle(&conn, req_pdu);
|
||||
+ CU_ASSERT(rc == 0);
|
||||
+ CU_ASSERT(!req_pdu->is_rejected);
|
||||
+ rc = iscsi_pdu_payload_handle(&conn, req_pdu);
|
||||
+ CU_ASSERT(rc == 0);
|
||||
+
|
||||
+ iscsi_put_pdu(req_pdu);
|
||||
+}
|
||||
+
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
@@ -2024,6 +2061,7 @@ main(int argc, char **argv)
|
||||
CU_ADD_TEST(suite, pdu_hdr_op_task_mgmt_test);
|
||||
CU_ADD_TEST(suite, pdu_hdr_op_nopout_test);
|
||||
CU_ADD_TEST(suite, pdu_hdr_op_data_test);
|
||||
+ CU_ADD_TEST(suite, empty_text_with_cbit_test);
|
||||
|
||||
CU_basic_set_mode(CU_BRM_VERBOSE);
|
||||
CU_basic_run_tests();
|
||||
diff --git a/test/unit/lib/iscsi/param.c/param_ut.c b/test/unit/lib/iscsi/param.c/param_ut.c
|
||||
index ccf6264..9b3e820 100644
|
||||
--- a/test/unit/lib/iscsi/param.c/param_ut.c
|
||||
+++ b/test/unit/lib/iscsi/param.c/param_ut.c
|
||||
@@ -264,6 +264,14 @@ parse_valid_test(void)
|
||||
EXPECT_VAL("F", "IIII");
|
||||
CU_ASSERT_PTR_NULL(partial_parameter);
|
||||
|
||||
+ /* partial parameter: NULL data */
|
||||
+ /* It is technically allowed to have a TEXT PDU with no data, yet
|
||||
+ * CONTINUE bit is enabled - make sure we handle that case correctly.
|
||||
+ */
|
||||
+ rc = iscsi_parse_params(¶ms, NULL, 0, true, &partial_parameter);
|
||||
+ CU_ASSERT(rc == 0);
|
||||
+ CU_ASSERT_PTR_NULL(partial_parameter);
|
||||
+
|
||||
/* Second partial parameter is the only parameter */
|
||||
PARSE("OOOO", true, &partial_parameter);
|
||||
CU_ASSERT_STRING_EQUAL(partial_parameter, "OOOO");
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,57 +0,0 @@
|
||||
From b7a8bc02e3530adc92f5287285330d926f999b5a Mon Sep 17 00:00:00 2001
|
||||
From: Liu Xiaodong <xiaodong.liu@intel.com>
|
||||
Date: Mon, 1 Feb 2021 08:19:14 -0500
|
||||
Subject: [PATCH 11/15] nbd: set io timeout
|
||||
|
||||
After setting io timeout, host can avoid nbd io
|
||||
stuck or kernel hang occasionally caused by nbd
|
||||
stop or underlying bdev removal.
|
||||
|
||||
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6191 (master)
|
||||
|
||||
(cherry picked from commit b7c33b5e610fd8894a0d4a67894f71c750f357d1)
|
||||
Change-Id: I4ba2a0af7ff7bed369cdaf86121f082136dc1a0b
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6394
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
|
||||
Reviewed-by: <dongx.yi@intel.com>
|
||||
---
|
||||
lib/nbd/nbd.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/lib/nbd/nbd.c b/lib/nbd/nbd.c
|
||||
index 2da9066..3a9299d 100644
|
||||
--- a/lib/nbd/nbd.c
|
||||
+++ b/lib/nbd/nbd.c
|
||||
@@ -50,6 +50,7 @@
|
||||
#define GET_IO_LOOP_COUNT 16
|
||||
#define NBD_BUSY_WAITING_MS 1000
|
||||
#define NBD_BUSY_POLLING_INTERVAL_US 20000
|
||||
+#define NBD_IO_TIMEOUT_S 60
|
||||
|
||||
enum nbd_io_state_t {
|
||||
/* Receiving or ready to receive nbd request header */
|
||||
@@ -922,6 +923,17 @@ nbd_start_complete(struct spdk_nbd_start_ctx *ctx)
|
||||
goto err;
|
||||
}
|
||||
|
||||
+#ifdef NBD_SET_TIMEOUT
|
||||
+ rc = ioctl(ctx->nbd->dev_fd, NBD_SET_TIMEOUT, NBD_IO_TIMEOUT_S);
|
||||
+ if (rc == -1) {
|
||||
+ SPDK_ERRLOG("ioctl(NBD_SET_TIMEOUT) failed: %s\n", spdk_strerror(errno));
|
||||
+ rc = -errno;
|
||||
+ goto err;
|
||||
+ }
|
||||
+#else
|
||||
+ SPDK_NOTICELOG("ioctl(NBD_SET_TIMEOUT) is not supported.\n");
|
||||
+#endif
|
||||
+
|
||||
#ifdef NBD_FLAG_SEND_TRIM
|
||||
rc = ioctl(ctx->nbd->dev_fd, NBD_SET_FLAGS, NBD_FLAG_SEND_TRIM);
|
||||
if (rc == -1) {
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
From 0765bbc3fbfa06a511eaf931468e813dfd787697 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Chang <rui.chang@arm.com>
|
||||
Date: Tue, 2 Feb 2021 10:18:47 +0800
|
||||
Subject: [PATCH 12/15] lib/util: Fix valgrind error reported on ARM platform
|
||||
|
||||
Signed-off-by: Rui Chang <rui.chang@arm.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6214 (master)
|
||||
|
||||
(cherry picked from commit 1293377629ad9ae95373178c919dcbe7d0fc2a95)
|
||||
Change-Id: I244a1b0350b4426666e390781b500de65d250c09
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6391
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Reviewed-by: Rui Chang <rui.chang@arm.com>
|
||||
---
|
||||
lib/util/fd_group.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/util/fd_group.c b/lib/util/fd_group.c
|
||||
index d3f9104..217ca43 100644
|
||||
--- a/lib/util/fd_group.c
|
||||
+++ b/lib/util/fd_group.c
|
||||
@@ -85,8 +85,8 @@ int
|
||||
spdk_fd_group_add(struct spdk_fd_group *fgrp,
|
||||
int efd, spdk_fd_fn fn, void *arg)
|
||||
{
|
||||
- struct event_handler *ehdlr;
|
||||
- struct epoll_event epevent;
|
||||
+ struct event_handler *ehdlr = NULL;
|
||||
+ struct epoll_event epevent = {0};
|
||||
int rc;
|
||||
|
||||
/* parameter checking */
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,104 +0,0 @@
|
||||
From c5bf8a0423325b96d7ede271965c117cd3790cde Mon Sep 17 00:00:00 2001
|
||||
From: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Date: Mon, 1 Feb 2021 07:32:46 -0500
|
||||
Subject: [PATCH 13/15] lib/vhost: force cpumask to be subset of application's
|
||||
CPU mask
|
||||
|
||||
Documentation for vhost target states that CPU mask must be a subset
|
||||
of application CPU mask. This wasn't enforced right now and allowed
|
||||
the cpumask on controller creation so long as at least single
|
||||
CPU core overlapped with application's CPU mask.
|
||||
|
||||
This might have been misleading and covered up user configuration errors.
|
||||
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6212 (master)
|
||||
|
||||
(cherry picked from commit b74363bcdfb6c0925dd01a24574c4fc82b22e58f)
|
||||
Change-Id: I03f959ec37efd0be9b98cff9c93c5f996b04af35
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6390
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
|
||||
---
|
||||
lib/vhost/vhost.c | 11 +++++++++++
|
||||
test/unit/lib/vhost/vhost.c/vhost_ut.c | 4 ++++
|
||||
test/vhost/other/negative.sh | 10 ++++++++++
|
||||
3 files changed, 25 insertions(+)
|
||||
|
||||
diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
|
||||
index b3aee72..18c17b3 100644
|
||||
--- a/lib/vhost/vhost.c
|
||||
+++ b/lib/vhost/vhost.c
|
||||
@@ -888,6 +888,7 @@ static int
|
||||
vhost_parse_core_mask(const char *mask, struct spdk_cpuset *cpumask)
|
||||
{
|
||||
int rc;
|
||||
+ struct spdk_cpuset negative_vhost_mask;
|
||||
|
||||
if (cpumask == NULL) {
|
||||
return -1;
|
||||
@@ -904,6 +905,16 @@ vhost_parse_core_mask(const char *mask, struct spdk_cpuset *cpumask)
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ spdk_cpuset_copy(&negative_vhost_mask, &g_vhost_core_mask);
|
||||
+ spdk_cpuset_negate(&negative_vhost_mask);
|
||||
+ spdk_cpuset_and(&negative_vhost_mask, cpumask);
|
||||
+
|
||||
+ if (spdk_cpuset_count(&negative_vhost_mask) != 0) {
|
||||
+ SPDK_ERRLOG("one of selected cpu is outside of core mask(=%s)\n",
|
||||
+ spdk_cpuset_fmt(&g_vhost_core_mask));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
spdk_cpuset_and(cpumask, &g_vhost_core_mask);
|
||||
|
||||
if (spdk_cpuset_count(cpumask) == 0) {
|
||||
diff --git a/test/unit/lib/vhost/vhost.c/vhost_ut.c b/test/unit/lib/vhost/vhost.c/vhost_ut.c
|
||||
index 79a6d20..45ce0a4 100644
|
||||
--- a/test/unit/lib/vhost/vhost.c/vhost_ut.c
|
||||
+++ b/test/unit/lib/vhost/vhost.c/vhost_ut.c
|
||||
@@ -269,6 +269,10 @@ create_controller_test(void)
|
||||
|
||||
spdk_cpuset_set_cpu(&g_vhost_core_mask, 0, true);
|
||||
|
||||
+ /* Create device with incorrect cpumask partially outside of application cpumask */
|
||||
+ ret = alloc_vdev(&vdev, "vdev_name_0", "0xff");
|
||||
+ SPDK_CU_ASSERT_FATAL(ret != 0);
|
||||
+
|
||||
/* Create device with no name */
|
||||
ret = alloc_vdev(&vdev, NULL, "0x1");
|
||||
CU_ASSERT(ret != 0);
|
||||
diff --git a/test/vhost/other/negative.sh b/test/vhost/other/negative.sh
|
||||
index ab7fa9d..2c219e7 100755
|
||||
--- a/test/vhost/other/negative.sh
|
||||
+++ b/test/vhost/other/negative.sh
|
||||
@@ -93,6 +93,11 @@ if $rpc_py vhost_create_scsi_controller vhost.invalid.cpumask --cpumask 0x2; the
|
||||
error "Creating scsi controller with incorrect cpumask succeeded, but it shouldn't"
|
||||
fi
|
||||
|
||||
+notice "Trying to create scsi controller with incorrect cpumask partially outside of application cpumask"
|
||||
+if $rpc_py vhost_create_scsi_controller vhost.invalid.cpumask --cpumask 0xff; then
|
||||
+ error "Creating scsi controller with incorrect cpumask succeeded, but it shouldn't"
|
||||
+fi
|
||||
+
|
||||
notice "Trying to remove device from nonexistent scsi controller"
|
||||
if $rpc_py vhost_scsi_controller_remove_target vhost.nonexistent.name 0; then
|
||||
error "Removing device from nonexistent scsi controller succeeded, but it shouldn't"
|
||||
@@ -172,6 +177,11 @@ if $rpc_py vhost_create_blk_controller vhost.invalid.cpumask Malloc0 --cpumask 0
|
||||
error "Creating block controller with incorrect cpumask succeeded, but it shouldn't"
|
||||
fi
|
||||
|
||||
+notice "Trying to create block controller with incorrect cpumask partially outside of application cpumask"
|
||||
+if $rpc_py vhost_create_blk_controller vhost.invalid.cpumask Malloc0 --cpumask 0xff; then
|
||||
+ error "Creating block controller with incorrect cpumask succeeded, but it shouldn't"
|
||||
+fi
|
||||
+
|
||||
notice "Trying to remove nonexistent block controller"
|
||||
if $rpc_py vhost_delete_controller vhost.nonexistent.name; then
|
||||
error "Removing nonexistent block controller succeeded, but it shouldn't"
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
From 7cbc04ea01fd56bac975bf4c1a1634ff7e1a75f1 Mon Sep 17 00:00:00 2001
|
||||
From: Pawel Piatek <pawelx.piatek@intel.com>
|
||||
Date: Wed, 10 Feb 2021 05:47:39 +0100
|
||||
Subject: [PATCH 14/15] autorun: allow pass configuration file path
|
||||
|
||||
Allow to pass configuration file as first parameter with
|
||||
fallback to previous behaviour where config file is read
|
||||
from home directory.
|
||||
|
||||
Signed-off-by: Pawel Piatek <pawelx.piatek@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6361 (master)
|
||||
|
||||
(cherry picked from commit 23c8f667a22e0a6a79099765bfdf8256497a5028)
|
||||
Change-Id: I45972b04fe5fc978bf3b2bede45aae363be3069c
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6545
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: <dongx.yi@intel.com>
|
||||
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
|
||||
---
|
||||
autorun.sh | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/autorun.sh b/autorun.sh
|
||||
index cdc27a3..c85fdb2 100755
|
||||
--- a/autorun.sh
|
||||
+++ b/autorun.sh
|
||||
@@ -4,7 +4,8 @@ set -e
|
||||
|
||||
rootdir=$(readlink -f $(dirname $0))
|
||||
|
||||
-conf=~/autorun-spdk.conf
|
||||
+default_conf=~/autorun-spdk.conf
|
||||
+conf=${1:-${default_conf}}
|
||||
|
||||
# If the configuration of tests is not provided, no tests will be carried out.
|
||||
if [[ ! -f $conf ]]; then
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
From d1bc0054cdebc60d469e570610590c13c2234591 Mon Sep 17 00:00:00 2001
|
||||
From: Krzysztof Karas <krzysztof.karas@intel.com>
|
||||
Date: Thu, 4 Feb 2021 10:30:00 +0100
|
||||
Subject: [PATCH 15/15] spdk_top: fix app crashing on tab selection with TAB
|
||||
key
|
||||
|
||||
Fixes spdk_top crashing problem upon selecting a row in one tab,
|
||||
then switching with TAB key to a different tab with fewer rows
|
||||
and calling pop-up details window with ENTER key.
|
||||
|
||||
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6367 (master)
|
||||
|
||||
(cherry picked from commit 6a343482193bf728d3e82bd5b1994bf767533aef)
|
||||
Change-Id: I52c5729eca0ce0eaad88767ff3add471a780140a
|
||||
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6729
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
|
||||
---
|
||||
app/spdk_top/spdk_top.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/app/spdk_top/spdk_top.c b/app/spdk_top/spdk_top.c
|
||||
index c996235..402c2a5 100644
|
||||
--- a/app/spdk_top/spdk_top.c
|
||||
+++ b/app/spdk_top/spdk_top.c
|
||||
@@ -2027,6 +2027,7 @@ show_thread(uint8_t current_page)
|
||||
|
||||
get_data();
|
||||
|
||||
+ assert(thread_number < g_threads_stats.threads.threads_count);
|
||||
for (i = 0; i < g_threads_stats.threads.threads_count; i++) {
|
||||
thread_info[i] = &g_threads_stats.threads.thread_info[i];
|
||||
}
|
||||
@@ -2067,6 +2068,7 @@ show_core(uint8_t current_page)
|
||||
|
||||
get_data();
|
||||
|
||||
+ assert(core_number < g_cores_stats.cores.cores_count);
|
||||
for (i = 0; i < g_cores_stats.cores.cores_count; i++) {
|
||||
core_info[i] = &g_cores_stats.cores.core[i];
|
||||
}
|
||||
@@ -2178,6 +2180,7 @@ show_poller(uint8_t current_page)
|
||||
get_data();
|
||||
|
||||
prepare_poller_data(current_page, pollers, &count, current_page);
|
||||
+ assert(poller_number < count);
|
||||
|
||||
poller_win = newwin(POLLER_WIN_HEIGHT, POLLER_WIN_WIDTH,
|
||||
(g_max_row - poller_counter) / 2, (g_max_col - POLLER_WIN_HOR_POS) / 2);
|
||||
@@ -2300,6 +2303,7 @@ show_stats(void)
|
||||
} else {
|
||||
active_tab = THREADS_TAB;
|
||||
}
|
||||
+ g_selected_row = 0;
|
||||
current_page = 0;
|
||||
switch_tab(active_tab);
|
||||
break;
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
From 65f41dc6b49cb2d8b7bb9e3951f6f4fcf5c93eee Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Sun, 13 Jun 2021 18:25:14 +0800
|
||||
Subject: [PATCH 16/28] blobfs: check return value of strdup in
|
||||
blobfs_fuse_start()
|
||||
|
||||
In blobfs_fuse_start(), bfuse->bdev_name and bfuse->mountpoint
|
||||
are allocated by calling strdup(), which may return NULL.
|
||||
Here, we will go to err if strdup() returns NULL.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: I0599254b3436a310ddd26732312281f07a4972ec
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8303
|
||||
Community-CI: Mellanox Build Bot
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
---
|
||||
module/blobfs/bdev/blobfs_fuse.c | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/module/blobfs/bdev/blobfs_fuse.c b/module/blobfs/bdev/blobfs_fuse.c
|
||||
index 1666549..176f81e 100644
|
||||
--- a/module/blobfs/bdev/blobfs_fuse.c
|
||||
+++ b/module/blobfs/bdev/blobfs_fuse.c
|
||||
@@ -301,15 +301,19 @@ blobfs_fuse_start(const char *bdev_name, const char *mountpoint, struct spdk_fil
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
- rc = fuse_parse_cmdline(&args, &opts);
|
||||
- assert(rc == 0);
|
||||
-
|
||||
bfuse->bdev_name = strdup(bdev_name);
|
||||
bfuse->mountpoint = strdup(mountpoint);
|
||||
+ if (!bfuse->bdev_name || !bfuse->mountpoint) {
|
||||
+ rc = -ENOMEM;
|
||||
+ goto err;
|
||||
+ }
|
||||
bfuse->fs = fs;
|
||||
bfuse->cb_fn = cb_fn;
|
||||
bfuse->cb_arg = cb_arg;
|
||||
|
||||
+ rc = fuse_parse_cmdline(&args, &opts);
|
||||
+ assert(rc == 0);
|
||||
+
|
||||
fuse_handle = fuse_new(&args, &spdk_fuse_oper, sizeof(spdk_fuse_oper), NULL);
|
||||
fuse_opt_free_args(&args);
|
||||
if (fuse_handle == NULL) {
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
From 199309e555028889c4cf5bb02d3d5b1278bb3ce5 Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Sun, 13 Jun 2021 16:17:32 +0800
|
||||
Subject: [PATCH 17/28] blobfs: check return value of strdup in
|
||||
spdk_fs_create_file_async()
|
||||
|
||||
In spdk_fs_create_file_async(), file->name is set to strdup(name).
|
||||
We should check whether file->name is equal to NULL.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: I2219cc353eb4711290aee2599505f57af9088bb2
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8302
|
||||
Community-CI: Mellanox Build Bot
|
||||
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
---
|
||||
lib/blobfs/blobfs.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/lib/blobfs/blobfs.c b/lib/blobfs/blobfs.c
|
||||
index c9bcde8..65c92a9 100644
|
||||
--- a/lib/blobfs/blobfs.c
|
||||
+++ b/lib/blobfs/blobfs.c
|
||||
@@ -1100,6 +1100,8 @@ spdk_fs_create_file_async(struct spdk_filesystem *fs, const char *name,
|
||||
req = alloc_fs_request(fs->md_target.md_fs_channel);
|
||||
if (req == NULL) {
|
||||
SPDK_ERRLOG("Cannot allocate create async req for file=%s\n", name);
|
||||
+ TAILQ_REMOVE(&fs->files, file, tailq);
|
||||
+ file_free(file);
|
||||
cb_fn(cb_arg, -ENOMEM);
|
||||
return;
|
||||
}
|
||||
@@ -1110,6 +1112,14 @@ spdk_fs_create_file_async(struct spdk_filesystem *fs, const char *name,
|
||||
args->arg = cb_arg;
|
||||
|
||||
file->name = strdup(name);
|
||||
+ if (!file->name) {
|
||||
+ SPDK_ERRLOG("Cannot allocate file->name for file=%s\n", name);
|
||||
+ free_fs_request(req);
|
||||
+ TAILQ_REMOVE(&fs->files, file, tailq);
|
||||
+ file_free(file);
|
||||
+ cb_fn(cb_arg, -ENOMEM);
|
||||
+ return;
|
||||
+ }
|
||||
_file_build_trace_arg_name(file);
|
||||
spdk_bs_create_blob(fs->bs, fs_create_blob_create_cb, args);
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
49
spdk.spec
49
spdk.spec
@ -2,40 +2,23 @@
|
||||
%bcond_with doc
|
||||
|
||||
Name: spdk
|
||||
Version: 21.01
|
||||
Release: 4
|
||||
Version: 21.01.1
|
||||
Release: 1
|
||||
Summary: Set of libraries and utilities for high performance user-mode storage
|
||||
License: BSD and MIT
|
||||
URL: http://spdk.io
|
||||
Source0: https://github.com/spdk/spdk/archive/v%{version}.tar.gz
|
||||
Patch1: 0001-lib-env_dpdk-fix-the-enum-rte_kernel_driver-definiti.patch
|
||||
Patch2: 0002-env_dpdk-add-rte_ethdev-dependency.patch
|
||||
Patch3: 0003-pkg-spdk.spec-Add-ncurses-devel-to-BuildRequires.patch
|
||||
Patch4: 0004-lib-vhost-Add-version-check-when-use-RTE_VHOST_USER_.patch
|
||||
Patch5: 0005-lib-nvme-Remove-qpair-from-all-lists-before-freeing-.patch
|
||||
Patch6: 0006-lib-env_dpdk-add-rte_net-dependency.patch
|
||||
Patch7: 0007-pkg-add-python3-requires-in-spdk.spec.patch
|
||||
Patch8: 0008-sock-add-enable_quickack-and-enable_placement_id-whe.patch
|
||||
Patch9: 0009-bdev-ocssd-Fix-the-bug-that-no-media-event-is-pushed.patch
|
||||
Patch10: 0010-lib-iscsi-return-immediately-from-iscsi_parse_params.patch
|
||||
Patch11: 0011-nbd-set-io-timeout.patch
|
||||
Patch12: 0012-lib-util-Fix-valgrind-error-reported-on-ARM-platform.patch
|
||||
Patch13: 0013-lib-vhost-force-cpumask-to-be-subset-of-application-.patch
|
||||
Patch14: 0014-autorun-allow-pass-configuration-file-path.patch
|
||||
Patch15: 0015-spdk_top-fix-app-crashing-on-tab-selection-with-TAB-.patch
|
||||
Patch16: 0016-blobfs-check-return-value-of-strdup-in-blobfs_fuse_s.patch
|
||||
Patch17: 0017-blobfs-check-return-value-of-strdup-in-spdk_fs_creat.patch
|
||||
Patch18: 0018-blobstore-fix-memleak-problem-in-blob_load_cpl.patch
|
||||
Patch19: 0019-blobstore-fix-potential-memleak-problem-in-blob_seri.patch
|
||||
Patch20: 0020-idxd-fix-memleak-problem-in-spdk_idxd_configure_chan.patch
|
||||
Patch21: 0021-idxd-fix-one-memleak-problem-in-spdk_idxd_get_channe.patch
|
||||
Patch22: 0022-ioat-fix-potential-double-free-problem-in-ioat_chann.patch
|
||||
Patch23: 0023-nvmf-check-return-value-of-strdup-in-spdk_nvmf_subsy.patch
|
||||
Patch24: 0024-nvmf-check-return-value-of-strdup-in-spdk_nvmf_subsy.patch
|
||||
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
|
||||
Source0: https://github.com/spdk/spdk/archive/refs/tags/v%{version}.tar.gz
|
||||
Patch1: 0001-blobstore-fix-memleak-problem-in-blob_load_cpl.patch
|
||||
Patch2: 0002-blobstore-fix-potential-memleak-problem-in-blob_seri.patch
|
||||
Patch3: 0003-idxd-fix-memleak-problem-in-spdk_idxd_configure_chan.patch
|
||||
Patch4: 0004-idxd-fix-one-memleak-problem-in-spdk_idxd_get_channe.patch
|
||||
Patch5: 0005-ioat-fix-potential-double-free-problem-in-ioat_chann.patch
|
||||
Patch6: 0006-nvmf-check-return-value-of-strdup-in-spdk_nvmf_subsy.patch
|
||||
Patch7: 0007-nvmf-check-return-value-of-strdup-in-spdk_nvmf_subsy.patch
|
||||
Patch8: 0008-nvmf-fix-fd-leakage-problem-in-nvmf_vfio_user_listen.patch
|
||||
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
|
||||
Patch11: 0011-uring-set-fd-to-1-after-close-fd-in-uring_sock_creat.patch
|
||||
|
||||
%define package_version %{version}-%{release}
|
||||
|
||||
@ -117,7 +100,6 @@ BuildArch: noarch
|
||||
# add -q
|
||||
%autosetup -n spdk-%{version} -p1
|
||||
|
||||
|
||||
%build
|
||||
./configure --prefix=%{_usr} \
|
||||
--disable-tests \
|
||||
@ -196,6 +178,9 @@ mv doc/output/html/ %{install_docdir}
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Nov 23 2021 Weifeng Su <suweifeng1@huawei.com> - 21.01.1-1
|
||||
- rebase to v21.01.1 Maintenance LTS Version
|
||||
|
||||
* Sat Jul 24 2021 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 21.01-4
|
||||
- backport 13 bugfix from upstream
|
||||
|
||||
|
||||
BIN
v21.01.1.tar.gz
Normal file
BIN
v21.01.1.tar.gz
Normal file
Binary file not shown.
BIN
v21.01.tar.gz
BIN
v21.01.tar.gz
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user