Update to 24.01 LTS version
This commit is contained in:
parent
a6810b671c
commit
2faa7a7e1f
43
0001-Add-without-ISA-L-option-and-disabled-by-default.patch
Normal file
43
0001-Add-without-ISA-L-option-and-disabled-by-default.patch
Normal file
@ -0,0 +1,43 @@
|
||||
From 14b5ef92c2d3e9c9ffda1938ce9640b9f3698ddc Mon Sep 17 00:00:00 2001
|
||||
From: Hongtao Zhang <zhanghongtao22@huawei.com>
|
||||
Date: Tue, 20 Feb 2024 20:20:07 +0800
|
||||
Subject: [PATCH] Add without ISA-L option and disabled by default
|
||||
|
||||
---
|
||||
configure | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index ed91a3d..86a6ab3 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -130,6 +130,7 @@ function usage() {
|
||||
echo " --without-avahi No path required."
|
||||
echo " --with-golang Build with components written in Go"
|
||||
echo " --without-golang No path required."
|
||||
+ echo " --without-isal Build with ISAL-L. DIsabled by default"
|
||||
echo ""
|
||||
echo "Environment variables:"
|
||||
echo ""
|
||||
@@ -674,6 +675,9 @@ for i in "$@"; do
|
||||
CONFIG[MAX_LCORES]="${i#*=}"
|
||||
CONFIG["MAX_LCORES"]=${CONFIG["MAX_LCORES"],,}
|
||||
;;
|
||||
+ --without-isal)
|
||||
+ CONFIG[ISAL]=n
|
||||
+ ;;
|
||||
--)
|
||||
break
|
||||
;;
|
||||
@@ -1173,7 +1177,7 @@ if [[ "${CONFIG[FUZZER]}" = "y" && "$CC_TYPE" != "clang" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
-if [[ $arch == x86_64* ]] || [[ $arch == aarch64* ]]; then
|
||||
+if [[ "${CONFIG[ISAL]}" != "n" ]] && ([[ $arch == x86_64* ]] || [[ $arch == aarch64* ]]); then
|
||||
CONFIG[ISAL]=y
|
||||
# make sure the submodule is initialized
|
||||
if [ ! -f "$rootdir"/isa-l/autogen.sh ]; then
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
From 7c4665e485e764f4fee069e60bdeffa387b15a4b Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Sun, 13 Jun 2021 19:53:08 +0800
|
||||
Subject: [PATCH 18/28] blobstore:fix memleak problem in blob_load_cpl()
|
||||
|
||||
In blob_load_cpl(), spdk_realloc() is called to realloc
|
||||
memory of ctx->pages. If spdk_realloc() return NULL,
|
||||
the ctx->pages is set to NULL without being freed,
|
||||
and then a memleak problem occurs.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: Idf21b690e89beab0245ba57a5de66a4f506d54fb
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8308
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Community-CI: Mellanox Build Bot
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
---
|
||||
lib/blob/blobstore.c | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/blob/blobstore.c b/lib/blob/blobstore.c
|
||||
index 08483fc..1f7d224 100644
|
||||
--- a/lib/blob/blobstore.c
|
||||
+++ b/lib/blob/blobstore.c
|
||||
@@ -1490,16 +1490,18 @@ blob_load_cpl(spdk_bs_sequence_t *seq, void *cb_arg, int bserrno)
|
||||
}
|
||||
|
||||
if (page->next != SPDK_INVALID_MD_PAGE) {
|
||||
+ struct spdk_blob_md_page *tmp_pages;
|
||||
uint32_t next_page = page->next;
|
||||
uint64_t next_lba = bs_md_page_to_lba(blob->bs, next_page);
|
||||
|
||||
/* Read the next page */
|
||||
- ctx->num_pages++;
|
||||
- ctx->pages = spdk_realloc(ctx->pages, (sizeof(*page) * ctx->num_pages), 0);
|
||||
- if (ctx->pages == NULL) {
|
||||
+ tmp_pages = spdk_realloc(ctx->pages, (sizeof(*page) * (ctx->num_pages + 1)), 0);
|
||||
+ if (tmp_pages == NULL) {
|
||||
blob_load_final(ctx, -ENOMEM);
|
||||
return;
|
||||
}
|
||||
+ ctx->num_pages++;
|
||||
+ ctx->pages = tmp_pages;
|
||||
|
||||
bs_sequence_read_dev(seq, &ctx->pages[ctx->num_pages - 1],
|
||||
next_lba,
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
From 94f83ca86169a3b5971c8edf99e3a4ff8e6d2d51 Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Sun, 13 Jun 2021 19:42:14 +0800
|
||||
Subject: [PATCH 19/28] blobstore: fix potential memleak problem in
|
||||
blob_serialize_add_page()
|
||||
|
||||
In blob_serialize_add_page(), *pages is set to spdk_realloc(*pages).
|
||||
If spdk_realloc() returns NULL, the *pages pointer will be
|
||||
overridden, whose memory will leak.
|
||||
|
||||
Here, we introduce a new var (tmp_pages) for checking the return
|
||||
value of spdk_realloc(*pages).
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: Ib2ead3f3b5d5e44688d1f0568816f483aa9e101f
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8307
|
||||
Community-CI: Mellanox Build Bot
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
---
|
||||
lib/blob/blobstore.c | 20 +++++++++++---------
|
||||
1 file changed, 11 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/lib/blob/blobstore.c b/lib/blob/blobstore.c
|
||||
index 1f7d224..551e615 100644
|
||||
--- a/lib/blob/blobstore.c
|
||||
+++ b/lib/blob/blobstore.c
|
||||
@@ -874,26 +874,28 @@ blob_serialize_add_page(const struct spdk_blob *blob,
|
||||
uint32_t *page_count,
|
||||
struct spdk_blob_md_page **last_page)
|
||||
{
|
||||
- struct spdk_blob_md_page *page;
|
||||
+ struct spdk_blob_md_page *page, *tmp_pages;
|
||||
|
||||
assert(pages != NULL);
|
||||
assert(page_count != NULL);
|
||||
|
||||
+ *last_page = NULL;
|
||||
if (*page_count == 0) {
|
||||
assert(*pages == NULL);
|
||||
- *page_count = 1;
|
||||
*pages = spdk_malloc(SPDK_BS_PAGE_SIZE, 0,
|
||||
NULL, SPDK_ENV_SOCKET_ID_ANY, SPDK_MALLOC_DMA);
|
||||
+ if (*pages == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+ *page_count = 1;
|
||||
} else {
|
||||
assert(*pages != NULL);
|
||||
+ tmp_pages = spdk_realloc(*pages, SPDK_BS_PAGE_SIZE * (*page_count + 1), 0);
|
||||
+ if (tmp_pages == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
(*page_count)++;
|
||||
- *pages = spdk_realloc(*pages, SPDK_BS_PAGE_SIZE * (*page_count), 0);
|
||||
- }
|
||||
-
|
||||
- if (*pages == NULL) {
|
||||
- *page_count = 0;
|
||||
- *last_page = NULL;
|
||||
- return -ENOMEM;
|
||||
+ *pages = tmp_pages;
|
||||
}
|
||||
|
||||
page = &(*pages)[*page_count - 1];
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,72 +0,0 @@
|
||||
From 7e571efc4d6b726b645cd7dc32bab7231bdf543c Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Fri, 18 Jun 2021 17:11:16 +0800
|
||||
Subject: [PATCH 20/28] idxd: fix memleak problem in spdk_idxd_configure_chan()
|
||||
|
||||
In spdk_idxd_configure_chan(), if memory allocation fails in
|
||||
TAILQ_FOREACH() {} code range, we will goto err_user_comp and
|
||||
err_user_desc tag, in which we donot free chan->completions
|
||||
and confused batch->user_completions with chan->completions.
|
||||
Memleak problem and double free problem may occurs.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: I0e588a35184d97cab0ea6b6c013ca8b3342f940a
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8432
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Community-CI: Mellanox Build Bot
|
||||
---
|
||||
lib/idxd/idxd.c | 16 +++++++++-------
|
||||
1 file changed, 9 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c
|
||||
index f240225..4f76f09 100644
|
||||
--- a/lib/idxd/idxd.c
|
||||
+++ b/lib/idxd/idxd.c
|
||||
@@ -194,7 +194,7 @@ spdk_idxd_configure_chan(struct spdk_idxd_io_channel *chan)
|
||||
if (batch->user_desc == NULL) {
|
||||
SPDK_ERRLOG("Failed to allocate batch descriptor memory\n");
|
||||
rc = -ENOMEM;
|
||||
- goto err_user_desc;
|
||||
+ goto err_user_desc_or_comp;
|
||||
}
|
||||
|
||||
batch->user_completions = spdk_zmalloc(DESC_PER_BATCH * sizeof(struct idxd_comp),
|
||||
@@ -203,7 +203,7 @@ spdk_idxd_configure_chan(struct spdk_idxd_io_channel *chan)
|
||||
if (batch->user_completions == NULL) {
|
||||
SPDK_ERRLOG("Failed to allocate user completion memory\n");
|
||||
rc = -ENOMEM;
|
||||
- goto err_user_comp;
|
||||
+ goto err_user_desc_or_comp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,16 +212,18 @@ spdk_idxd_configure_chan(struct spdk_idxd_io_channel *chan)
|
||||
|
||||
return 0;
|
||||
|
||||
-err_user_comp:
|
||||
+err_user_desc_or_comp:
|
||||
TAILQ_FOREACH(batch, &chan->batch_pool, link) {
|
||||
spdk_free(batch->user_desc);
|
||||
+ batch->user_desc = NULL;
|
||||
+ spdk_free(batch->user_completions);
|
||||
+ batch->user_completions = NULL;
|
||||
}
|
||||
-err_user_desc:
|
||||
- TAILQ_FOREACH(batch, &chan->batch_pool, link) {
|
||||
- spdk_free(chan->completions);
|
||||
- }
|
||||
+ spdk_free(chan->completions);
|
||||
+ chan->completions = NULL;
|
||||
err_comp:
|
||||
spdk_free(chan->desc);
|
||||
+ chan->desc = NULL;
|
||||
err_desc:
|
||||
spdk_bit_array_free(&chan->ring_slots);
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
From b4c40bfdf47efc027330a805947db521df8b8959 Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Sun, 13 Jun 2021 14:53:27 +0800
|
||||
Subject: [PATCH 21/28] idxd: fix one memleak problem in
|
||||
spdk_idxd_get_channel()
|
||||
|
||||
In spdk_idxd_get_channel(), if chan->batch_base is allocated
|
||||
faild, we should free chan before returning NULL.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: Ia652c334aead592429c1171da73d67160879686d
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8301
|
||||
Community-CI: Mellanox Build Bot
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
---
|
||||
lib/idxd/idxd.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/lib/idxd/idxd.c b/lib/idxd/idxd.c
|
||||
index 4f76f09..d2fad12 100644
|
||||
--- a/lib/idxd/idxd.c
|
||||
+++ b/lib/idxd/idxd.c
|
||||
@@ -121,6 +121,7 @@ spdk_idxd_get_channel(struct spdk_idxd_device *idxd)
|
||||
chan->batch_base = calloc(NUM_BATCHES_PER_CHANNEL, sizeof(struct idxd_batch));
|
||||
if (chan->batch_base == NULL) {
|
||||
SPDK_ERRLOG("Failed to allocate batch pool\n");
|
||||
+ free(chan);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
From 46dd4eea588780d082ff0ce002a1dc0ad6e3e7eb Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Sun, 13 Jun 2021 12:23:58 +0800
|
||||
Subject: [PATCH 22/28] ioat: fix potential double free problem in
|
||||
ioat_channel_start()
|
||||
|
||||
In ioat_channel_start(), if spdk_vtophys(ioat->comp_update) returns
|
||||
SPDK_VTOPHYS_ERROR, spdk_free is called to free ioat->comp_update,
|
||||
and ioat->comp_update is not set to NULL. However, the caller
|
||||
ioat_attach() will also call ioat_channel_destruct() to free
|
||||
ioat->comp_update, then double-free problem occurs.
|
||||
|
||||
Here, we will not free ioat->comp_update in ioat_channel_start(),
|
||||
ioat_channel_destruct() will do that.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: I3be19a3feec5c2188051ee67820bfd1e61de9b48
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8300
|
||||
Community-CI: Mellanox Build Bot
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
---
|
||||
lib/ioat/ioat.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/lib/ioat/ioat.c b/lib/ioat/ioat.c
|
||||
index 27ac0a0..af83c42 100644
|
||||
--- a/lib/ioat/ioat.c
|
||||
+++ b/lib/ioat/ioat.c
|
||||
@@ -429,7 +429,6 @@ ioat_channel_start(struct spdk_ioat_chan *ioat)
|
||||
|
||||
comp_update_bus_addr = spdk_vtophys((void *)ioat->comp_update, NULL);
|
||||
if (comp_update_bus_addr == SPDK_VTOPHYS_ERROR) {
|
||||
- spdk_free((void *)ioat->comp_update);
|
||||
return -1;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
From 7441bfb0394c6cc54ddcd270a86685b9dad16474 Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Sun, 13 Jun 2021 18:37:02 +0800
|
||||
Subject: [PATCH 23/28] nvmf: check return value of strdup in
|
||||
spdk_nvmf_subsystem_disconnect_host()
|
||||
|
||||
In spdk_nvmf_subsystem_disconnect_host(), we should check
|
||||
whether strdup() return NULL.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: I29cb6b2499ecd2a2367001c0d21ac95da4e10e20
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8304
|
||||
Community-CI: Mellanox Build Bot
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
---
|
||||
lib/nvmf/subsystem.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/nvmf/subsystem.c b/lib/nvmf/subsystem.c
|
||||
index 8a3dd3b..5fc1813 100644
|
||||
--- a/lib/nvmf/subsystem.c
|
||||
+++ b/lib/nvmf/subsystem.c
|
||||
@@ -831,8 +831,13 @@ spdk_nvmf_subsystem_disconnect_host(struct spdk_nvmf_subsystem *subsystem,
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
- ctx->subsystem = subsystem;
|
||||
ctx->hostnqn = strdup(hostnqn);
|
||||
+ if (ctx->hostnqn == NULL) {
|
||||
+ free(ctx);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ ctx->subsystem = subsystem;
|
||||
ctx->cb_fn = cb_fn;
|
||||
ctx->cb_arg = cb_arg;
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,82 +0,0 @@
|
||||
From b367f485f83e65b76d3ae67b5ab4bc344e1a7c49 Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Sun, 13 Jun 2021 18:59:13 +0800
|
||||
Subject: [PATCH 24/28] nvmf:check return value of strdup in
|
||||
spdk_nvmf_subsystem_add_ns_ext()
|
||||
|
||||
In spdk_nvmf_subsystem_add_ns_ext(), ns->ptpl_file is set to strdup(),
|
||||
which may return NULL. We should deal with it.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: If95102fe9d6d789b8ba9e846c4d7f4e22e48a93c
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8305
|
||||
Community-CI: Mellanox Build Bot
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
---
|
||||
lib/nvmf/subsystem.c | 30 ++++++++++++++++++------------
|
||||
1 file changed, 18 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/lib/nvmf/subsystem.c b/lib/nvmf/subsystem.c
|
||||
index 5fc1813..5729524 100644
|
||||
--- a/lib/nvmf/subsystem.c
|
||||
+++ b/lib/nvmf/subsystem.c
|
||||
@@ -1451,14 +1451,14 @@ spdk_nvmf_subsystem_add_ns_ext(struct spdk_nvmf_subsystem *subsystem, const char
|
||||
rc = nvmf_ns_reservation_restore(ns, &info);
|
||||
if (rc) {
|
||||
SPDK_ERRLOG("Subsystem restore reservation failed\n");
|
||||
- subsystem->ns[opts.nsid - 1] = NULL;
|
||||
- spdk_bdev_module_release_bdev(ns->bdev);
|
||||
- spdk_bdev_close(ns->desc);
|
||||
- free(ns);
|
||||
- return 0;
|
||||
+ goto err_ns_reservation_restore;
|
||||
}
|
||||
}
|
||||
ns->ptpl_file = strdup(ptpl_file);
|
||||
+ if (!ns->ptpl_file) {
|
||||
+ SPDK_ERRLOG("Namespace ns->ptpl_file allocation failed\n");
|
||||
+ goto err_strdup;
|
||||
+ }
|
||||
}
|
||||
|
||||
for (transport = spdk_nvmf_transport_get_first(subsystem->tgt); transport;
|
||||
@@ -1467,13 +1467,7 @@ spdk_nvmf_subsystem_add_ns_ext(struct spdk_nvmf_subsystem *subsystem, const char
|
||||
rc = transport->ops->subsystem_add_ns(transport, subsystem, ns);
|
||||
if (rc) {
|
||||
SPDK_ERRLOG("Namespace attachment is not allowed by %s transport\n", transport->ops->name);
|
||||
- free(ns->ptpl_file);
|
||||
- nvmf_ns_reservation_clear_all_registrants(ns);
|
||||
- subsystem->ns[opts.nsid - 1] = NULL;
|
||||
- spdk_bdev_module_release_bdev(ns->bdev);
|
||||
- spdk_bdev_close(ns->desc);
|
||||
- free(ns);
|
||||
- return 0;
|
||||
+ goto err_subsystem_add_ns;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1486,6 +1480,18 @@ spdk_nvmf_subsystem_add_ns_ext(struct spdk_nvmf_subsystem *subsystem, const char
|
||||
nvmf_subsystem_ns_changed(subsystem, opts.nsid);
|
||||
|
||||
return opts.nsid;
|
||||
+
|
||||
+err_subsystem_add_ns:
|
||||
+ free(ns->ptpl_file);
|
||||
+err_strdup:
|
||||
+ nvmf_ns_reservation_clear_all_registrants(ns);
|
||||
+err_ns_reservation_restore:
|
||||
+ subsystem->ns[opts.nsid - 1] = NULL;
|
||||
+ spdk_bdev_module_release_bdev(ns->bdev);
|
||||
+ spdk_bdev_close(ns->desc);
|
||||
+ free(ns);
|
||||
+ return 0;
|
||||
+
|
||||
}
|
||||
|
||||
uint32_t
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,45 +0,0 @@
|
||||
From 09b368248b3337e5d7fd0ff9c4b1ce4fb0827ea1 Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Sun, 13 Jun 2021 20:12:17 +0800
|
||||
Subject: [PATCH 25/28] nvmf: fix fd leakage problem in nvmf_vfio_user_listen()
|
||||
|
||||
In nvmf_vfio_user_listen(), fd should be closed before
|
||||
set it to endpoint->fd, otherwise, the fd leakage probem
|
||||
occurs.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: I3fabc65d2764926e5873475962e4362e46eb37e4
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8309
|
||||
Community-CI: Mellanox Build Bot
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Reviewed-by: sunshihao <sunshihao@huawei.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
---
|
||||
lib/nvmf/vfio_user.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/nvmf/vfio_user.c b/lib/nvmf/vfio_user.c
|
||||
index f5daa8d..7ec980a 100644
|
||||
--- a/lib/nvmf/vfio_user.c
|
||||
+++ b/lib/nvmf/vfio_user.c
|
||||
@@ -1662,6 +1662,7 @@ nvmf_vfio_user_listen(struct spdk_nvmf_transport *transport,
|
||||
}
|
||||
free(path);
|
||||
|
||||
+ endpoint->fd = fd;
|
||||
err = ftruncate(fd, NVMF_VFIO_USER_DOORBELLS_OFFSET + NVMF_VFIO_USER_DOORBELLS_SIZE);
|
||||
if (err != 0) {
|
||||
goto out;
|
||||
@@ -1675,8 +1676,6 @@ nvmf_vfio_user_listen(struct spdk_nvmf_transport *transport,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- endpoint->fd = fd;
|
||||
-
|
||||
snprintf(uuid, PATH_MAX, "%s/cntrl", endpoint_id(endpoint));
|
||||
SPDK_DEBUGLOG(nvmf_vfio, "%s: doorbells %p\n", uuid, endpoint->doorbells);
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,62 +0,0 @@
|
||||
From ab69fc61073df903970dbf00582617970f97a9ea Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Sun, 13 Jun 2021 21:10:19 +0800
|
||||
Subject: [PATCH 26/28] posix: set fd to -1 after close(fd) in
|
||||
posix_sock_create()
|
||||
|
||||
In posix_sock_create(), we loops through all the addresses available.
|
||||
If something is wrong, we should close(fd) and set fd to -1, and
|
||||
try the next address. Only, when one fd satisfies all conditions,
|
||||
we will break the loop with the useful fd.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: Icbfc10246c92b95cacd6eb058e6e46cf8924fc4c
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8310
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
|
||||
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Community-CI: Mellanox Build Bot
|
||||
---
|
||||
module/sock/posix/posix.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/module/sock/posix/posix.c b/module/sock/posix/posix.c
|
||||
index c180a16..ebafc1e 100644
|
||||
--- a/module/sock/posix/posix.c
|
||||
+++ b/module/sock/posix/posix.c
|
||||
@@ -468,12 +468,14 @@ retry:
|
||||
rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof val);
|
||||
if (rc != 0) {
|
||||
close(fd);
|
||||
+ fd = -1;
|
||||
/* error */
|
||||
continue;
|
||||
}
|
||||
rc = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof val);
|
||||
if (rc != 0) {
|
||||
close(fd);
|
||||
+ fd = -1;
|
||||
/* error */
|
||||
continue;
|
||||
}
|
||||
@@ -483,6 +485,7 @@ retry:
|
||||
rc = setsockopt(fd, SOL_SOCKET, SO_PRIORITY, &opts->priority, sizeof val);
|
||||
if (rc != 0) {
|
||||
close(fd);
|
||||
+ fd = -1;
|
||||
/* error */
|
||||
continue;
|
||||
}
|
||||
@@ -493,6 +496,7 @@ retry:
|
||||
rc = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &val, sizeof val);
|
||||
if (rc != 0) {
|
||||
close(fd);
|
||||
+ fd = -1;
|
||||
/* error */
|
||||
continue;
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
From 9dace0d9cae727747f333f032537e873c73d9d8c Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Sun, 13 Jun 2021 19:04:05 +0800
|
||||
Subject: [PATCH 27/28] spdk_top:check return value of strdup in
|
||||
store_last_run_counter()
|
||||
|
||||
In store_last_run_counter(), history->poller_name is set to
|
||||
strdup(), which may return NULL. We should deal with it.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: Ice5f27c4a7d2f9abd528b97a48ff5f92b48c8d7c
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8306
|
||||
Community-CI: Mellanox Build Bot
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
---
|
||||
app/spdk_top/spdk_top.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/app/spdk_top/spdk_top.c b/app/spdk_top/spdk_top.c
|
||||
index 402c2a5..3c0a889 100644
|
||||
--- a/app/spdk_top/spdk_top.c
|
||||
+++ b/app/spdk_top/spdk_top.c
|
||||
@@ -1017,6 +1017,11 @@ store_last_run_counter(const char *poller_name, uint64_t thread_id, uint64_t las
|
||||
return;
|
||||
}
|
||||
history->poller_name = strdup(poller_name);
|
||||
+ if (!history->poller_name) {
|
||||
+ fprintf(stderr, "Unable to allocate poller_name of a history object in store_last_run_counter.\n");
|
||||
+ free(history);
|
||||
+ return;
|
||||
+ }
|
||||
history->thread_id = thread_id;
|
||||
history->last_run_counter = last_run_counter;
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,62 +0,0 @@
|
||||
From b97c91b7d2480ee1cc038e70f6e2de2e2bb5d19d Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Sun, 13 Jun 2021 21:29:33 +0800
|
||||
Subject: [PATCH 28/28] uring: set fd to -1 after close(fd) in
|
||||
uring_sock_create()
|
||||
|
||||
In uring_sock_create(), we loops through all the addresses available.
|
||||
If something is wrong, we should close(fd) and set fd to -1, and
|
||||
try the next address. Only, when one fd satisfies all conditions,
|
||||
we will break the loop with the useful fd.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Change-Id: I22eada5437776fe90a6b57ab42cbad6dc4b0585c
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8311
|
||||
Community-CI: Mellanox Build Bot
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
|
||||
---
|
||||
module/sock/uring/uring.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/module/sock/uring/uring.c b/module/sock/uring/uring.c
|
||||
index be76973..8f22758 100644
|
||||
--- a/module/sock/uring/uring.c
|
||||
+++ b/module/sock/uring/uring.c
|
||||
@@ -424,12 +424,14 @@ retry:
|
||||
rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof val);
|
||||
if (rc != 0) {
|
||||
close(fd);
|
||||
+ fd = -1;
|
||||
/* error */
|
||||
continue;
|
||||
}
|
||||
rc = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof val);
|
||||
if (rc != 0) {
|
||||
close(fd);
|
||||
+ fd = -1;
|
||||
/* error */
|
||||
continue;
|
||||
}
|
||||
@@ -439,6 +441,7 @@ retry:
|
||||
rc = setsockopt(fd, SOL_SOCKET, SO_PRIORITY, &opts->priority, sizeof val);
|
||||
if (rc != 0) {
|
||||
close(fd);
|
||||
+ fd = -1;
|
||||
/* error */
|
||||
continue;
|
||||
}
|
||||
@@ -448,6 +451,7 @@ retry:
|
||||
rc = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &val, sizeof val);
|
||||
if (rc != 0) {
|
||||
close(fd);
|
||||
+ fd = -1;
|
||||
/* error */
|
||||
continue;
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
From b1959244d8178975119606e9fc1323dbee06c18f Mon Sep 17 00:00:00 2001
|
||||
From: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
Date: Mon, 13 Sep 2021 21:36:51 +0800
|
||||
Subject: [PATCH] spdk: use -fstack-protector-strong instead of
|
||||
-fstack-protector
|
||||
|
||||
use -fstack-protector-strong instead of -fstack-protector for
|
||||
stronger security.
|
||||
|
||||
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
|
||||
---
|
||||
mk/spdk.common.mk | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk
|
||||
index f3fe5c2..dc8ed69 100644
|
||||
--- a/mk/spdk.common.mk
|
||||
+++ b/mk/spdk.common.mk
|
||||
@@ -120,7 +120,7 @@ COMMON_CFLAGS += -D_GNU_SOURCE
|
||||
COMMON_CFLAGS += -fPIC
|
||||
|
||||
# Enable stack buffer overflow checking
|
||||
-COMMON_CFLAGS += -fstack-protector
|
||||
+COMMON_CFLAGS += -fstack-protector-strong
|
||||
|
||||
# Prevent accidental multiple definitions of global variables
|
||||
COMMON_CFLAGS += -fno-common
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,80 +0,0 @@
|
||||
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);
|
||||
@ -1,47 +0,0 @@
|
||||
From de8f3a50ee33c8218ba59bc16297e953121206d7 Mon Sep 17 00:00:00 2001
|
||||
From: root <root@wls-x86-hp04.shanghai.arm.com>
|
||||
Date: Fri, 19 Mar 2021 15:38:55 +0800
|
||||
Subject: [PATCH] mk: Fix debug build error on ARM ThunderX2 and neoverse N1
|
||||
platform
|
||||
|
||||
When building spdk on ARM platform like thunderx2 with --enable-debug,
|
||||
there are following error:
|
||||
|
||||
/tmp/ccOBb4AF.s: Assembler messages:
|
||||
/tmp/ccOBb4AF.s:45: Error: selected processor does not support `casp x0,x1,x2,x3,[x4]'
|
||||
/tmp/ccOBb4AF.s:77: Error: selected processor does not support `caspa x0,x1,x2,x3,[x4]'
|
||||
/tmp/ccOBb4AF.s:109: Error: selected processor does not support `caspl x0,x1,x2,x3,[x4]'
|
||||
/tmp/ccOBb4AF.s:141: Error: selected processor does not support `caspal x0,x1,x2,x3,[x4]'
|
||||
|
||||
The reason is that DPDK is built with -march=armv8.1-a or -march=armv8.2-a+lse which
|
||||
have these instructions while SPDK is built with -march=armv8-a+crc which does not support
|
||||
them. Change spdk build machine to native can fix this.
|
||||
|
||||
Signed-off-by: Rui Chang <rui.chang@arm.com>
|
||||
Change-Id: I759d4ce2c557ce5ff73a802d7a4b6579c4ba64f7
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7025
|
||||
Community-CI: Mellanox Build Bot
|
||||
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
---
|
||||
mk/spdk.common.mk | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk
|
||||
index 633a05bda79..897be4d2150 100644
|
||||
--- a/mk/spdk.common.mk
|
||||
+++ b/mk/spdk.common.mk
|
||||
@@ -77,11 +77,7 @@
|
||||
ifneq ($(filter powerpc%,$(TARGET_MACHINE)),)
|
||||
COMMON_CFLAGS += -mcpu=$(TARGET_ARCHITECTURE)
|
||||
else ifeq ($(TARGET_MACHINE),aarch64)
|
||||
-ifeq ($(TARGET_ARCHITECTURE),native)
|
||||
-COMMON_CFLAGS += -march=armv8-a+crc
|
||||
-else
|
||||
COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
|
||||
-endif
|
||||
COMMON_CFLAGS += -DPAGE_SIZE=$(shell getconf PAGESIZE)
|
||||
else
|
||||
COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
|
||||
@ -1,53 +0,0 @@
|
||||
From fcc389490a4abe26c1efe6cc624dc2925ed6b670 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Chang <rui.chang@arm.com>
|
||||
Date: Tue, 18 May 2021 15:32:56 +0800
|
||||
Subject: [PATCH] configure: add gcc version check for ARM Neoverse-N1 platform
|
||||
|
||||
When doing debug build on ARM Neoverse-N1 platform, if gcc version is
|
||||
lower than 8.4.0, we may met following errors:
|
||||
|
||||
/tmp/cc24qua1.s: Assembler messages:
|
||||
/tmp/cc24qua1.s:53: Error: selected processor does not support `casp x0,x1,x2,x3,[x4]'
|
||||
/tmp/cc24qua1.s:85: Error: selected processor does not support `caspa x0,x1,x2,x3,[x4]'
|
||||
/tmp/cc24qua1.s:117: Error: selected processor does not support `caspl x0,x1,x2,x3,[x4]'
|
||||
/tmp/cc24qua1.s:149: Error: selected processor does not support `caspal x0,x1,x2,x3,[x4]'
|
||||
|
||||
The change also fix the problem by pass armv8.2-a+crypto as target architecture.
|
||||
|
||||
Signed-off-by: Rui Chang <rui.chang@arm.com>
|
||||
Change-Id: I2053b9440e06873066480d63e471802df2e69d4e
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7949
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Community-CI: Mellanox Build Bot
|
||||
---
|
||||
configure | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 7d063f4ef3b..a2d0c5a62fb 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -786,6 +786,20 @@ exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
+# For ARM Neoverse-N1 platform, debug build needs gcc version newer than 8.4
|
||||
+if [[ "${CONFIG[DEBUG]}" = "y" && $arch = aarch64* && "$CC_TYPE" = "gcc" ]]; then
|
||||
+ GCC_VERSION=$($CC -dumpfullversion)
|
||||
+ PART_NUM=$(grep -i -m 1 "CPU part" /proc/cpuinfo | awk '{print $4}')
|
||||
+
|
||||
+ if [[ "$(printf '%s\n' "8.4.0" "$GCC_VERSION" | sort -V | head -n1)" != "8.4.0" ]]; then
|
||||
+ if [[ $PART_NUM = 0xd0c ]]; then
|
||||
+ echo "WARNING: For ARM Neoverse-N1 platform, debug build needs GCC version newer than 8.4."
|
||||
+ echo " Will work around this by using armv8.2-a+crypto as target architecture for now."
|
||||
+ CONFIG[ARCH]=armv8.2-a+crypto
|
||||
+ fi
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
# We are now ready to generate final configuration. But first do sanity
|
||||
# check to see if all keys in CONFIG array have its reflection in CONFIG file.
|
||||
if [ $(egrep -c "^\s*CONFIG_[[:alnum:]_]+=" $rootdir/CONFIG) -ne ${#CONFIG[@]} ]; then
|
||||
@ -1,28 +0,0 @@
|
||||
From 56b3831310673beeb0b7d5121cf36b1993ebe322 Mon Sep 17 00:00:00 2001
|
||||
From: Weifeng Su <suweifeng1@huawei.com>
|
||||
Date: Tue, 15 Mar 2022 11:25:02 +0000
|
||||
Subject: [PATCH] Enhance security for share library
|
||||
|
||||
Remove rpath link option, Due to it's easy for attacher to
|
||||
construct 'rpath' attacks.
|
||||
|
||||
Signed-off-by: Weifeng Su <suweifeng1@huawei.com>
|
||||
---
|
||||
mk/spdk.common.mk | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk
|
||||
index f9409c4..8569687 100644
|
||||
--- a/mk/spdk.common.mk
|
||||
+++ b/mk/spdk.common.mk
|
||||
@@ -293,7 +293,6 @@ LINK_CXX=\
|
||||
# Provide function to ease build of a shared lib
|
||||
define spdk_build_realname_shared_lib
|
||||
$(CC) -o $@ -shared $(CPPFLAGS) $(LDFLAGS) \
|
||||
- -Wl,-rpath=$(DESTDIR)/$(libdir) \
|
||||
-Wl,--soname,$(notdir $@) \
|
||||
-Wl,--whole-archive $(1) -Wl,--no-whole-archive \
|
||||
-Wl,--version-script=$(2) \
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,870 +0,0 @@
|
||||
From f0710b6c37214457ab46bd1859f00ec413b01a7f Mon Sep 17 00:00:00 2001
|
||||
From: sunshihao <sunshihao@huawei.com>
|
||||
Date: Thu, 18 Feb 2021 10:52:24 +0800
|
||||
Subject: [PATCH 17/27] add HSAK needed head file and API to spdk
|
||||
|
||||
Signed-off-by: sunshihao <sunshihao@huawei.com>
|
||||
---
|
||||
CONFIG | 3 +
|
||||
Makefile | 6 +
|
||||
configure | 8 ++
|
||||
etc/spdk/nvme.conf.in | 88 ++++++++++++
|
||||
include/spdk/bdev.h | 85 +++++++++++
|
||||
include/spdk/bdev_module.h | 89 ++++++++++++
|
||||
include/spdk/log.h | 2 +-
|
||||
include/spdk/nvme.h | 230 ++++++++++++++++++++++++++++++
|
||||
include/spdk/thread.h | 18 +++
|
||||
include/spdk_internal/bdev_stat.h | 63 ++++++++
|
||||
include/spdk_internal/debug.h | 43 ++++++
|
||||
include/spdk_internal/thread.h | 2 +
|
||||
mk/spdk.app_vars.mk | 4 +-
|
||||
13 files changed, 639 insertions(+), 2 deletions(-)
|
||||
create mode 100644 etc/spdk/nvme.conf.in
|
||||
create mode 100644 include/spdk_internal/bdev_stat.h
|
||||
create mode 100644 include/spdk_internal/debug.h
|
||||
|
||||
diff --git a/CONFIG b/CONFIG
|
||||
index b5fffae..214e59e 100644
|
||||
--- a/CONFIG
|
||||
+++ b/CONFIG
|
||||
@@ -43,6 +43,9 @@ CONFIG_CROSS_PREFIX=
|
||||
# Build with debug logging. Turn off for performance testing and normal usage
|
||||
CONFIG_DEBUG=n
|
||||
|
||||
+# Enable read and write NVMe for application
|
||||
+CONFIG_APP_RW=n
|
||||
+
|
||||
# Treat warnings as errors (fail the build on any warning).
|
||||
CONFIG_WERROR=n
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index a50fa94..1c98268 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -37,6 +37,12 @@ S :=
|
||||
SPDK_ROOT_DIR := $(CURDIR)
|
||||
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
||||
|
||||
+ifeq ($(CONFIG_APP_RW),y)
|
||||
+# secure compile option
|
||||
+CFLAGS += -fPIE -pie -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2 -Wall -Werror
|
||||
+CFLAGS += -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines
|
||||
+endif
|
||||
+
|
||||
DIRS-y += lib
|
||||
DIRS-y += module
|
||||
DIRS-$(CONFIG_SHARED) += shared_lib
|
||||
diff --git a/configure b/configure
|
||||
index 5b48696..964322e 100644
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -25,6 +25,8 @@ function usage()
|
||||
echo " example: aarch64-linux-gnu"
|
||||
echo ""
|
||||
echo " --enable-debug Configure for debug builds"
|
||||
+ echo " --enable-err-injc Enable error injection feature"
|
||||
+ echo " --enable-raw Enable read and write NVMe disk feature."
|
||||
echo " --enable-werror Treat compiler warnings as errors"
|
||||
echo " --enable-asan Enable address sanitizer"
|
||||
echo " --enable-ubsan Enable undefined behavior sanitizer"
|
||||
@@ -204,6 +206,12 @@ for i in "$@"; do
|
||||
--disable-debug)
|
||||
CONFIG[DEBUG]=n
|
||||
;;
|
||||
+ --enable-raw)
|
||||
+ CONFIG[APP_RW]=y
|
||||
+ ;;
|
||||
+ --enable-err-injc)
|
||||
+ CONFIG[ERR_INJC]=y
|
||||
+ ;;
|
||||
--enable-asan)
|
||||
CONFIG[ASAN]=y
|
||||
;;
|
||||
diff --git a/etc/spdk/nvme.conf.in b/etc/spdk/nvme.conf.in
|
||||
new file mode 100644
|
||||
index 0000000..a3df92b
|
||||
--- /dev/null
|
||||
+++ b/etc/spdk/nvme.conf.in
|
||||
@@ -0,0 +1,88 @@
|
||||
+#NVME configuration file
|
||||
+#
|
||||
+# Please write all parameters using ASCII.
|
||||
+# The parameter must be quoted if it includes whitespace.
|
||||
+#
|
||||
+# Configuration syntax:
|
||||
+# Leading whitespace is ignored.
|
||||
+# Lines starting with '#' are comments.
|
||||
+# Lines ending with '\' are concatenated with the next line.
|
||||
+# Bracketed ([]) names define sections
|
||||
+
|
||||
+[Global]
|
||||
+ # Users can restrict work items to only run on certain cores by specifying a ReactorMask.
|
||||
+ # Can not specify the NO. 0 core.
|
||||
+ ReactorMask 0x2
|
||||
+
|
||||
+ # The print level of log.
|
||||
+ # 0: Print ERROR log only; 1: Print WARNING and ERROR log; and so on, 4: Print all level log
|
||||
+ LogLevel 1
|
||||
+
|
||||
+ # The sizes of Memory for Libstorge(Unit: MB). The minimum value is 300MB.
|
||||
+ # If parameter "SocketMem" was set corrected, MemSize was useless
|
||||
+ MemSize 300
|
||||
+
|
||||
+ # The same block device supports multiple queues.
|
||||
+ MultiQ No
|
||||
+
|
||||
+ # End-to-end data protection. This item is only used if the namespace is formatted to use end-to-end protection information.
|
||||
+ # if the value is set to '1', then the protection information are generated by controller, and the logical block data and protection information are written to NVM.
|
||||
+ # if the value is set to '2', then the protection information are transferred from the host buffer to NVM.
|
||||
+ E2eDif 2
|
||||
+
|
||||
+ # Open IOstat or not
|
||||
+ IoStat No
|
||||
+
|
||||
+ # Poll time threshold in millisecond, It will count exceptional polling thread call which duration exceed the value and display in stat report.
|
||||
+ # This item is only used when UseReactor = No, Set to 0 means disable this measurement.
|
||||
+ PollTime 0
|
||||
+
|
||||
+ # Preallocate specified amounts of memory(Unit: MB) per socket.
|
||||
+ # The parameter is a comma-sprated list of values, For example:
|
||||
+ # SocketMem 1024,2048
|
||||
+ # This will allocate 1 gigabyte of memory on socket 0, and 2048 megabytes of memory on socket 1.
|
||||
+ # The sum of socket memory must be greater than 300MB.
|
||||
+ # if SocketMem was set corrected, The parameter "MemSize" was useless
|
||||
+ # SocketMem 300
|
||||
+
|
||||
+ # Place a per-socket upper limit on memory use (non-legacy memory mode only).
|
||||
+ # 0 will disable the limit for a particular socket.
|
||||
+ # SocketLimit 1024,1
|
||||
+ # This will set upper limit of 1 gigabyte on socket 0, and 1 megabytes of memory on socket 1.
|
||||
+ # if the value is set to empty, means disable the limit per socket.
|
||||
+ # if SocketMem was empty, the parameter was useless.
|
||||
+ # SocketLimit 300
|
||||
+
|
||||
+ #Decide whether to start rpc server or not
|
||||
+ RpcServer Yes
|
||||
+
|
||||
+# NVMe configuration options
|
||||
+[Nvme]
|
||||
+ # NVMe Device Whitelist
|
||||
+ # Users may specify which NVMe devices to claim by their transport id.
|
||||
+ # See spdk_nvme_transport_id_parse() in spdk/nvme.h for the correct format.
|
||||
+ # The second argument is the assigned name, which can be referenced from
|
||||
+ # other sections in the configuration file. For NVMe devices, a namespace
|
||||
+ # is automatically appended to each name in the format <YourName>nY, where
|
||||
+ # Y is the NSID (starts at 1).
|
||||
+ #TransportID "trtype:PCIe traddr:0000:81:00.0" nvme0
|
||||
+ #TransportID "trtype:PCIe traddr:0000:01:00.0" nvme1
|
||||
+
|
||||
+ # The number of attempts per I/O when an I/O fails. Do not include
|
||||
+ # this key to get the default behavior.
|
||||
+ RetryCount 4
|
||||
+ # Timeout for each command, in microseconds. If 0, don't track timeouts.
|
||||
+ TimeoutUsec 0
|
||||
+ # Action to take on command time out. Only valid when Timeout is greater
|
||||
+ # than 0. This may be 'Reset' to reset the controller, 'Abort' to abort
|
||||
+ # the command, or 'None' to just print a message but do nothing.
|
||||
+ # Admin command timeouts will always result in a reset.
|
||||
+ ActionOnTimeout None
|
||||
+ # Set how often the admin queue is polled for asynchronous events.
|
||||
+ # Units in microseconds.
|
||||
+ AdminPollRate 100000
|
||||
+
|
||||
+[Reactor]
|
||||
+ # Batch size of IO for one-time release by reactor.
|
||||
+ # The maximum value is 32.
|
||||
+ BatchSize 8
|
||||
diff --git a/include/spdk/bdev.h b/include/spdk/bdev.h
|
||||
index d894646..2951660 100644
|
||||
--- a/include/spdk/bdev.h
|
||||
+++ b/include/spdk/bdev.h
|
||||
@@ -53,6 +53,8 @@ extern "C" {
|
||||
|
||||
#define SPDK_BDEV_SMALL_BUF_MAX_SIZE 8192
|
||||
#define SPDK_BDEV_LARGE_BUF_MAX_SIZE (64 * 1024)
|
||||
+#define SPDK_BDEV_SMALL_BUF_WITH_MAX_MD 512
|
||||
+#define SPDK_BDEV_LARGE_BUF_WITH_MAX_MD 1024
|
||||
|
||||
/* Increase the buffer size to store interleaved metadata. Increment is the
|
||||
* amount necessary to store metadata per data block. 16 byte metadata per
|
||||
@@ -116,6 +118,42 @@ enum spdk_bdev_status {
|
||||
SPDK_BDEV_STATUS_REMOVING,
|
||||
};
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+/** ns status */
|
||||
+enum spdk_bdev_ns_status {
|
||||
+ SPDK_BDEV_NS_STATUS_INVALID,
|
||||
+ SPDK_BDEV_NS_STATUS_READY,
|
||||
+ SPDK_BDEV_NS_STATUS_REMOVING,
|
||||
+ SPDK_BDEV_NS_STATUS_UNREGISTER,
|
||||
+};
|
||||
+
|
||||
+typedef void (*LIBSTORAGE_CALLBACK_FUNC)(int32_t cb_status, int32_t sct_code, void *cb_arg);
|
||||
+
|
||||
+typedef struct libstorage_io {
|
||||
+ uint8_t *buf;
|
||||
+ struct iovec *iovs; /* array of iovecs to transfer */
|
||||
+ int iovcnt; /* Number of iovecs in iovs array */
|
||||
+ int32_t fd; /* File Descriptor */
|
||||
+ uint16_t opcode; /* r/w */
|
||||
+ uint16_t streamId; /* Stream ID for IO */
|
||||
+ uint8_t pi_action;
|
||||
+ uint8_t fua;
|
||||
+ uint8_t location;
|
||||
+ bool inSubmit; /* In the I/0 phase or not. Use in nopoll model */
|
||||
+ uint32_t count;
|
||||
+ uint32_t nbytes;
|
||||
+ uint64_t offset;
|
||||
+ uint8_t *md_buf;
|
||||
+ uint32_t md_len;
|
||||
+ uint32_t magic;
|
||||
+ /*Save the error code returned by the callback */
|
||||
+ int32_t err;
|
||||
+ int32_t reserved;
|
||||
+ LIBSTORAGE_CALLBACK_FUNC cb;
|
||||
+ void *cb_arg;
|
||||
+} LIBSTORAGE_IO_T;
|
||||
+#endif
|
||||
+
|
||||
/**
|
||||
* \brief Handle to an opened SPDK block device.
|
||||
*/
|
||||
@@ -140,6 +178,13 @@ enum spdk_bdev_io_type {
|
||||
SPDK_BDEV_IO_TYPE_COMPARE,
|
||||
SPDK_BDEV_IO_TYPE_COMPARE_AND_WRITE,
|
||||
SPDK_BDEV_IO_TYPE_ABORT,
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ SPDK_BDEV_IO_TYPE_READ_NVME,
|
||||
+ SPDK_BDEV_IO_TYPE_WRITE_NVME,
|
||||
+ SPDK_BDEV_IO_TYPE_READV_NVME,
|
||||
+ SPDK_BDEV_IO_TYPE_WRITEV_NVME,
|
||||
+ SPDK_BDEV_IO_TYPE_UNMAP_BLOCKS,
|
||||
+#endif
|
||||
SPDK_BDEV_NUM_IO_TYPES /* Keep last */
|
||||
};
|
||||
|
||||
@@ -181,6 +226,14 @@ struct spdk_bdev_io_stat {
|
||||
uint64_t write_latency_ticks;
|
||||
uint64_t unmap_latency_ticks;
|
||||
uint64_t ticks_rate;
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ int io_stat_id;
|
||||
+ uint64_t io_ticks;
|
||||
+ uint64_t pre_ticks;
|
||||
+ uint64_t cur_ticks;
|
||||
+ uint64_t start_tsc;
|
||||
+ uint64_t interval_tsc;
|
||||
+#endif
|
||||
};
|
||||
|
||||
struct spdk_bdev_opts {
|
||||
@@ -1342,6 +1395,38 @@ int spdk_bdev_unmap(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
uint64_t offset, uint64_t nbytes,
|
||||
spdk_bdev_io_completion_cb cb, void *cb_arg);
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+/**
|
||||
+ * Submit an unmap request to the block device. Unmap is sometimes also called trim or
|
||||
+ * deallocate. This notifies the device that the data in the blocks described is no
|
||||
+ * longer valid. Reading blocks that have been unmapped results in indeterminate data.
|
||||
+ *
|
||||
+ * \param bdev Block device description
|
||||
+ * \param ch I/O channel. Obtained by calling spdk_bdev_get_io_channel().
|
||||
+ * \param unmap_d An array of unmap descriptors.
|
||||
+ * \param bdesc_count The number of elements in unmap_d.
|
||||
+ * \param cb Called when the request is complete.
|
||||
+ * \param cb_arg Argument passed to cb.
|
||||
+ *
|
||||
+ * \return 0 on success. On success, the callback will always
|
||||
+ * be called (even if the request ultimately failed). Return
|
||||
+ * negated errno on failure, in which case the callback will not be called.
|
||||
+ */
|
||||
+int
|
||||
+spdk_bdev_unmap_multiblocks(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
+ void *unmap_d, uint16_t unmap_count,
|
||||
+ spdk_bdev_io_completion_cb cb, void *cb_arg);
|
||||
+
|
||||
+void*
|
||||
+spdk_bdev_get_channel_group(struct spdk_io_channel *io_ch);
|
||||
+
|
||||
+void*
|
||||
+spdk_bdev_io_get_pool(size_t nbytes);
|
||||
+
|
||||
+bool
|
||||
+spdk_bdev_have_io_in_channel(struct spdk_io_channel *bdevIoCh);
|
||||
+#endif
|
||||
+
|
||||
/**
|
||||
* Submit an unmap request to the block device. Unmap is sometimes also called trim or
|
||||
* deallocate. This notifies the device that the data in the blocks described is no
|
||||
diff --git a/include/spdk/bdev_module.h b/include/spdk/bdev_module.h
|
||||
index bbb9f94..c2fd81d 100644
|
||||
--- a/include/spdk/bdev_module.h
|
||||
+++ b/include/spdk/bdev_module.h
|
||||
@@ -222,8 +222,67 @@ struct spdk_bdev_fn_table {
|
||||
|
||||
/** Get bdev module context. */
|
||||
void *(*get_module_ctx)(void *ctx);
|
||||
+
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ uint16_t (*get_io_channel_id)(struct spdk_io_channel *ch);
|
||||
+
|
||||
+ int (*bdev_poll_rsp)(void *pollCh);
|
||||
+
|
||||
+ uint64_t (*get_timeout_count)(struct spdk_io_channel *ch);
|
||||
+#endif
|
||||
+};
|
||||
+
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+static inline void spdk_bdev_set_io_location(void *bdev_ctx, uint8_t location)
|
||||
+{
|
||||
+ struct spdk_bdev_io *bdev_io = spdk_bdev_io_from_ctx(bdev_ctx);
|
||||
+ uint8_t *ioLoc = (uint8_t *)bdev_io->internal.caller_ctx;
|
||||
+ *ioLoc = location;
|
||||
+}
|
||||
+
|
||||
+enum spdk_bdev_driver_ctx {
|
||||
+ SPDK_BDEV_IO_ACTION_PI,
|
||||
+ SPDK_BDEV_IO_ACTION_FUA,
|
||||
+ SPDK_BDEV_IO_STREAM_ID_0,
|
||||
+ SPDK_BDEV_IO_STREAM_ID_1,
|
||||
+};
|
||||
+
|
||||
+enum spdk_bdev_io_e2e_pi_action{
|
||||
+ IO_NO_PROTECTION = 0,
|
||||
+ IO_HALF_WAY_PROTECTION = 1,
|
||||
+ IO_E2E_PROTECTION = 2
|
||||
};
|
||||
|
||||
+#define FLAG_NO_REF 0x10//bit 4 : 1, disable ctrl ref tag check; 0, enable check
|
||||
+#define FLAG_CALCRC 0x08//bit 3 : 1, libstorage calculate crc; 0, app calculate crc
|
||||
+#define FLAG_PRCHK 0x04//bit 2 : 1, enable ctrl guard crc check; 0, disable check
|
||||
+
|
||||
+enum spdk_bdev_io_fua{
|
||||
+ IO_FUA_NO = 0,
|
||||
+ IO_FUA_YES = 1
|
||||
+};
|
||||
+
|
||||
+void spdk_bdev_nvme_remove_cb(void *cb_ctx, void *ctrlr);
|
||||
+
|
||||
+void spdk_bdev_fail_ctrlr(const char* traddr);
|
||||
+
|
||||
+void *nvme_channel_get_group(void *io_ch);
|
||||
+
|
||||
+enum reqLocation_E
|
||||
+{
|
||||
+ LOCAL_RECEIVE_APP = 1,
|
||||
+ LOCAL_LIBSTORAGE_SUBMIT = 2,
|
||||
+ LOCAL_LIBSTORAGE_ASYNC_REQ = 3,
|
||||
+ LOCAL_LIBSTORAGE_BDEV_NVME = 4,
|
||||
+ LOCAL_LIBSTORAGE_HUNG_REQ = 5,
|
||||
+ LOCAL_LIBSTORAGE_TO_DISK = 6,
|
||||
+ LOCAL_LIBSTORAGE_FROM_DISK = 7,
|
||||
+ LOCAL_LIBSTORAGE_CALLBACK = 8,
|
||||
+ LOCAL_LIBSTORAGE_SUBMIT_RETRY = 9,
|
||||
+ LOCAL_LIBSTORAGE_BDEV_NOMEM = 10,
|
||||
+};
|
||||
+#endif
|
||||
+
|
||||
/** bdev I/O completion status */
|
||||
enum spdk_bdev_io_status {
|
||||
SPDK_BDEV_IO_STATUS_AIO_ERROR = -8,
|
||||
@@ -407,6 +466,10 @@ struct spdk_bdev {
|
||||
/** The bdev status */
|
||||
enum spdk_bdev_status status;
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ enum spdk_bdev_ns_status ns_status;
|
||||
+#endif
|
||||
+
|
||||
/**
|
||||
* Pointer to the module that has claimed this bdev for purposes of creating virtual
|
||||
* bdevs on top of it. Set to NULL if the bdev has not been claimed.
|
||||
@@ -528,6 +591,11 @@ struct spdk_bdev_io {
|
||||
/** Starting offset (in blocks) of the bdev for this I/O. */
|
||||
uint64_t offset_blocks;
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ /* The number of bytes to transfer */
|
||||
+ size_t nbytes;
|
||||
+#endif
|
||||
+
|
||||
/** stored user callback in case we split the I/O and use a temporary callback */
|
||||
spdk_bdev_io_completion_cb stored_user_cb;
|
||||
|
||||
@@ -595,6 +663,27 @@ struct spdk_bdev_io {
|
||||
/* The data buffer */
|
||||
void *buf;
|
||||
} zone_mgmt;
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ struct {
|
||||
+ /* The data buffer to transfer */
|
||||
+ void *buf;
|
||||
+
|
||||
+ /* The meta data buffer to transfer */
|
||||
+ void *md_buf;
|
||||
+
|
||||
+ /** Total size of data(in blocks) to be transferred. */
|
||||
+ uint64_t num_blocks;
|
||||
+
|
||||
+ /* The number of bytes to transfer */
|
||||
+ size_t nbytes;
|
||||
+
|
||||
+ /** Starting offset (in blocks) of the bdev for this I/O. */
|
||||
+ size_t offset_blocks;
|
||||
+
|
||||
+ /* meta data buffer size to transfer */
|
||||
+ size_t md_len;
|
||||
+ } contig;
|
||||
+#endif
|
||||
} u;
|
||||
|
||||
/** It may be used by modules to put the bdev_io into its own list. */
|
||||
diff --git a/include/spdk/log.h b/include/spdk/log.h
|
||||
index ad850ab..e16035c 100644
|
||||
--- a/include/spdk/log.h
|
||||
+++ b/include/spdk/log.h
|
||||
@@ -173,7 +173,7 @@ enum spdk_log_level spdk_log_get_print_level(void);
|
||||
* \param format Format string to the message.
|
||||
*/
|
||||
void spdk_log(enum spdk_log_level level, const char *file, const int line, const char *func,
|
||||
- const char *format, ...) __attribute__((__format__(__printf__, 5, 6)));
|
||||
+ const char *format, ...) __attribute__((weak)) __attribute__((__format__(__printf__, 5, 6)));
|
||||
|
||||
/**
|
||||
* Same as spdk_log except that instead of being called with variable number of
|
||||
diff --git a/include/spdk/nvme.h b/include/spdk/nvme.h
|
||||
index 45b9f94..8e05139 100644
|
||||
--- a/include/spdk/nvme.h
|
||||
+++ b/include/spdk/nvme.h
|
||||
@@ -2465,6 +2465,7 @@ enum spdk_nvme_ns_flags {
|
||||
part of the logical block that it is associated with */
|
||||
SPDK_NVME_NS_WRITE_UNCORRECTABLE_SUPPORTED = 0x40, /**< The write uncorrectable command is supported */
|
||||
SPDK_NVME_NS_COMPARE_SUPPORTED = 0x80, /**< The compare command is supported */
|
||||
+ SPDK_NVME_NS_DPS_PI_MDSTART = 0x100 /**< protection info transferred at start of metadata */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -3434,6 +3435,235 @@ struct spdk_nvme_transport_ops {
|
||||
*/
|
||||
void spdk_nvme_transport_register(const struct spdk_nvme_transport_ops *ops);
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+struct nvme_ctrlr_info {
|
||||
+ char ctrlName[16];
|
||||
+ char pciAddr[24];
|
||||
+ uint64_t tnvmcap; /* Total NVM Capacity in bytes */
|
||||
+ uint64_t unvmcap; /* Unallocated NVM Capacity in bytes */
|
||||
+ int8_t sn[20]; /* Serial number */
|
||||
+ int8_t mn[40]; /* Model number */
|
||||
+ uint8_t fr[8]; /* Firmware revision */
|
||||
+ uint32_t max_num_ns; /* Number of namespaces */
|
||||
+ uint32_t version; /* Version of the NVM Express specification that the controller implementation supports */
|
||||
+ uint16_t num_io_queues; /* num of io queues */
|
||||
+ uint16_t io_queue_size; /* io queue size */
|
||||
+ uint16_t device_id; /* Device id */
|
||||
+ uint16_t subdevice_id; /* Subsystem device id */
|
||||
+ uint16_t vid; /* Vendor id */
|
||||
+ uint16_t ssvid; /* Subsystem vendor id */
|
||||
+ uint16_t ctrlid; /* Controller id */
|
||||
+ uint16_t trtype; /* Transport type */
|
||||
+ uint16_t support_ns :1; /* Supports the Namespace Management and Namespace Attachment commands */
|
||||
+ uint16_t directives :1; /* Supports Directives */
|
||||
+ uint16_t streams :1; /* Supports Streams Directives */
|
||||
+ uint16_t dsm :1; /* Supports the controller supports the Dataset Management command */
|
||||
+ uint16_t reserved :12;
|
||||
+ uint16_t reserved2[3];
|
||||
+};
|
||||
+
|
||||
+struct nvme_ctrlr;
|
||||
+struct nvme_bdev_ctrlr;
|
||||
+struct spdk_bdev;
|
||||
+struct nvme_bdev;
|
||||
+struct spdk_nvme_ns;
|
||||
+struct spdk_nvme_qpair;
|
||||
+int32_t nvme_ctrlr_get_info(const char* ctrlName, struct nvme_ctrlr_info** ppCtrlr);
|
||||
+struct spdk_nvme_ctrlr* spdk_nvme_ctrlr_get_by_name(const char* ctrlname);
|
||||
+struct spdk_nvme_ctrlr* spdk_nvme_ctrlr_get_by_ctrlr(const struct nvme_bdev_ctrlr *nvme_bdev_ctrlr);
|
||||
+struct nvme_bdev_ctrlr* nvme_ctrlr_get_by_name(const char* ctrlname);
|
||||
+void nvme_ctrlr_clear_iostat_by_name(const char* ctrlname);
|
||||
+void nvme_ctrlr_clear_iostat_all(void);
|
||||
+struct nvme_bdev_ctrlr* bdev_nvme_get_ctrlr_by_bdev_desc(void *bdev);
|
||||
+struct spdk_nvme_ns* bdev_nvme_get_ns(struct nvme_bdev *nbdev);
|
||||
+void bdev_nvme_update_block_by_nvme_ctrlr(struct spdk_nvme_ctrlr *ctrlr);
|
||||
+int bdev_nvme_update_ns(struct nvme_bdev_ctrlr *nvme_ctrlr, uint32_t nsid);
|
||||
+bool spdk_bdev_can_remove(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr, uint32_t nsid);
|
||||
+void spdk_bdev_set_ns_normal(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr, uint32_t nsid);
|
||||
+void spdk_nvme_ctrlr_set_shutdown(struct spdk_nvme_ctrlr *ctrlr, bool is_shutdown);
|
||||
+bool spdk_nvme_ctrlr_is_smart_per_namespace_supported(struct spdk_nvme_ctrlr *ctrlr);
|
||||
+int spdk_nvme_ctrlr_get_smart_info(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid, struct spdk_nvme_health_information_page *health_payload);
|
||||
+int spdk_nvme_ctrlr_get_error_info(struct spdk_nvme_ctrlr *ctrlr, uint32_t err_entries, struct spdk_nvme_error_information_entry *error_info);
|
||||
+struct spdk_nvme_ctrlr_opts* spdk_nvme_ctrlr_get_opts(struct spdk_nvme_ctrlr *ctrlr);
|
||||
+int nvme_ns_get_common_data(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_ns_data *nsdata);
|
||||
+bool spdk_nvme_ns_is_allocated(struct spdk_nvme_ctrlr *ctrlr, uint16_t nsid);
|
||||
+bool spdk_nvme_ctrlr_is_ns_manage_supported(struct spdk_nvme_ctrlr *ctrlr);
|
||||
+bool spdk_nvme_ctrlr_is_format_supported(struct spdk_nvme_ctrlr *ctrlr);
|
||||
+bool spdk_nvme_ctrlr_is_format_all_ns(struct spdk_nvme_ctrlr *ctrlr);
|
||||
+bool spdk_nvme_ctrlr_is_directive_supported(struct spdk_nvme_ctrlr *ctrlr);
|
||||
+bool spdk_nvme_ctrlr_is_streams_supported(struct spdk_nvme_ctrlr *ctrlr);
|
||||
+int32_t spdk_nvme_ctrlr_identify_directives(struct spdk_nvme_ctrlr *ctrlr, uint16_t nsid, void *payload);
|
||||
+int32_t spdk_nvme_ctrlr_enable_streams(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid);
|
||||
+int32_t spdk_nvme_ctrlr_ret_streams_param(struct spdk_nvme_ctrlr *ctrlr, void *payload);
|
||||
+int32_t spdk_nvme_ns_ret_streams_param(struct spdk_nvme_ns *ns, void *payload);
|
||||
+int32_t spdk_nvme_ns_get_streams_status(struct spdk_nvme_ns *ns, void *payload);
|
||||
+int32_t spdk_nvme_ns_alloc_streams_res(struct spdk_nvme_ns *ns, uint16_t nsr);
|
||||
+int32_t spdk_nvme_ns_release_streams_id(struct spdk_nvme_ns *ns, uint16_t streamsId);
|
||||
+int32_t spdk_nvme_ns_release_streams_res(struct spdk_nvme_ns *ns);
|
||||
+void spdk_nvme_use_streams(bool use);
|
||||
+
|
||||
+/**
|
||||
+ * \brief Get the ctrlr is_failed state, for an I/O sent to the given namespace.
|
||||
+ *
|
||||
+ * This function is thread safe and can be called at any point while the controller is attached to
|
||||
+ * the SPDK NVMe driver.
|
||||
+ */
|
||||
+bool spdk_nvme_ns_ctrl_is_failed(struct spdk_nvme_ns *ns);
|
||||
+#define NVME_MAX_CONTROLLERS 1024
|
||||
+
|
||||
+/* check nvme whether exist by access cc register */
|
||||
+bool nvme_ctrlr_is_exist(struct spdk_nvme_ctrlr *ctrlr);
|
||||
+
|
||||
+/* create ctrlr for new added device */
|
||||
+int spdk_bdev_nvme_create_self(struct spdk_nvme_transport_id *trid, const char *base_name,
|
||||
+ const char **names, size_t *count, const char *hostnqn);
|
||||
+
|
||||
+int spdk_nvme_detach_ublock(struct spdk_nvme_ctrlr *ctrlr);
|
||||
+void spdk_nvme_ctrlr_update_unvmcap(struct spdk_nvme_ctrlr *ctrlr);
|
||||
+
|
||||
+#define SPDK_NVME_UEVENT_SUBSYSTEM_UIO 1
|
||||
+#define SPDK_NVME_UEVENT_SUBSYSTEM_NVME 2
|
||||
+
|
||||
+enum spdk_nvme_uevent_action {
|
||||
+ SPDK_NVME_UEVENT_ADD = 0,
|
||||
+ SPDK_NVME_UEVENT_REMOVE = 1,
|
||||
+};
|
||||
+
|
||||
+struct spdk_uevent {
|
||||
+ /* remove or add */
|
||||
+ enum spdk_nvme_uevent_action action;
|
||||
+ int subsystem;
|
||||
+ /* pci address of device */
|
||||
+ char traddr[SPDK_NVMF_TRADDR_MAX_LEN + 1];
|
||||
+};
|
||||
+
|
||||
+/* make a socket to get uevent */
|
||||
+int nvme_uevent_connect(void);
|
||||
+
|
||||
+/* get uevent from socket fd */
|
||||
+int nvme_get_uevent(int fd, struct spdk_uevent *uevent);
|
||||
+
|
||||
+/* blocked to get uevent from socket fd */
|
||||
+int nvme_get_uevent_block(int fd, struct spdk_uevent *uevent);
|
||||
+
|
||||
+/**
|
||||
+ * @Description: bind device with pci_addr to driver
|
||||
+ * @param pci_addr: device's pci_addr,like "0000:08:00.0"
|
||||
+ * @param driver: driver name which device bind to
|
||||
+ */
|
||||
+int32_t spdk_rebind_driver(char *pci_addr, char *driver_name);
|
||||
+
|
||||
+/**
|
||||
+ * \brief True if the protection information transferred at the start of metadata
|
||||
+ * when end-to-end data protection enabled.
|
||||
+ *
|
||||
+ * This function is thread safe and can be called at any point while the controller is attached to
|
||||
+ * the SPDK NVMe driver.
|
||||
+ */
|
||||
+bool spdk_nvme_ns_pi_md_start(struct spdk_nvme_ns *ns);
|
||||
+
|
||||
+/**
|
||||
+ * \brief True if the namespace supports Dataset Management command.
|
||||
+ *
|
||||
+ * This function is thread safe and can be called at any point while the controller is attached to
|
||||
+ * the SPDK NVMe driver.
|
||||
+ */
|
||||
+bool spdk_nvme_ns_is_dataset_mng_supported(struct spdk_nvme_ns *ns);
|
||||
+
|
||||
+/**
|
||||
+ * Submit a data set management request to the specified NVMe namespace. Data set
|
||||
+ * management operations are designed to optimize interaction with the block
|
||||
+ * translation layer inside the device. The most common type of operation is
|
||||
+ * deallocate, which is often referred to as TRIM or UNMAP.
|
||||
+ *
|
||||
+ * The command is submitted to a qpair allocated by spdk_nvme_ctrlr_alloc_io_qpair().
|
||||
+ * The user must ensure that only one thread submits I/O on a given qpair at any
|
||||
+ * given time.
|
||||
+ *
|
||||
+ * This is a convenience wrapper that will automatically allocate and construct
|
||||
+ * the correct data buffers. Therefore, ranges does not need to be allocated from
|
||||
+ * pinned memory and can be placed on the stack. If a higher performance, zero-copy
|
||||
+ * version of DSM is required, simply build and submit a raw command using
|
||||
+ * spdk_nvme_ctrlr_cmd_io_raw().
|
||||
+ *
|
||||
+ * \param ns NVMe namespace to submit the DSM request
|
||||
+ * \param type A bit field constructed from \ref spdk_nvme_dsm_attribute.
|
||||
+ * \param qpair I/O queue pair to submit the request
|
||||
+ * \param ranges An array of \ref spdk_nvme_dsm_range elements describing the LBAs
|
||||
+ * to operate on.
|
||||
+ * \param num_ranges The number of elements in the ranges array.
|
||||
+ * \param cb_fn Callback function to invoke when the I/O is completed
|
||||
+ * \param cb_arg Argument to pass to the callback function
|
||||
+ *
|
||||
+ * \return 0 if successfully submitted, negated POSIX errno values otherwise.
|
||||
+ */
|
||||
+int spdk_nvme_ns_cmd_unmap_blocks(struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair,
|
||||
+ uint32_t type,
|
||||
+ const struct spdk_nvme_dsm_range *ranges,
|
||||
+ uint16_t num_ranges,
|
||||
+ spdk_nvme_cmd_cb cb_fn,
|
||||
+ void *cb_arg);
|
||||
+/**
|
||||
+ * \brief Submits a write I/O to the specified NVMe namespace.
|
||||
+ *
|
||||
+ * \param ns NVMe namespace to submit the write I/O
|
||||
+ * \param qpair I/O queue pair to submit the request
|
||||
+ * \param lba starting LBA to write the data
|
||||
+ * \param lba_count length (in sectors) for the write operation
|
||||
+ * \param streamId The stream id for write I/O
|
||||
+ * \param cb_fn callback function to invoke when the I/O is completed
|
||||
+ * \param cb_arg argument to pass to the callback function
|
||||
+ * \param io_flags set flags, defined in nvme_spec.h, for this I/O
|
||||
+ * \param reset_sgl_fn callback function to reset scattered payload
|
||||
+ * \param next_sge_fn callback function to iterate each scattered
|
||||
+ * payload memory segment
|
||||
+ *
|
||||
+ * \return 0 if successfully submitted, ENOMEM if an nvme_request
|
||||
+ * structure cannot be allocated for the I/O request
|
||||
+ *
|
||||
+ * The command is submitted to a qpair allocated by spdk_nvme_ctrlr_alloc_io_qpair().
|
||||
+ * The user must ensure that only one thread submits I/O on a given qpair at any given time.
|
||||
+ */
|
||||
+int spdk_nvme_ns_cmd_writev_stream(struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair,
|
||||
+ uint64_t lba, uint32_t lba_count, uint16_t streamId,
|
||||
+ spdk_nvme_cmd_cb cb_fn, void *cb_arg, uint32_t io_flags,
|
||||
+ spdk_nvme_req_reset_sgl_cb reset_sgl_fn,
|
||||
+ spdk_nvme_req_next_sge_cb next_sge_fn);
|
||||
+
|
||||
+/**
|
||||
+ * \brief Send comman to NVMe controller to start or abort a self-test operation.
|
||||
+ *
|
||||
+ * \param ctrlr NVMe controller to operate self-test command.
|
||||
+ * \param nsid Depending on the log page, this may be 0, a namespace identifier, or SPDK_NVME_GLOBAL_NS_TAG.
|
||||
+ * \param stc self-test code, which specifies the action taken by the Device Self-test command.
|
||||
+ * \param payload The pointer to the payload buffer. it doesn't work actually.
|
||||
+ * \param payload_size The size of payload buffer. it doesn't work actually.
|
||||
+ * \param cb_fn Callback function to invoke when the feature has been retrieved.
|
||||
+ * \param cb_arg Argument to pass to the callback function.
|
||||
+ *
|
||||
+ * \return 0 if successfully submitted, ENOMEM if resources could not be allocated for this request
|
||||
+ *
|
||||
+ * This function is thread safe and can be called at any point while the controller is attached to
|
||||
+ * the SPDK NVMe driver.
|
||||
+ *
|
||||
+ * Call \ref spdk_nvme_ctrlr_process_admin_completions() to poll for completion
|
||||
+ * of commands submitted through this function.
|
||||
+ *
|
||||
+ * \sa spdk_nvme_ctrlr_cmd_self_test_operation()
|
||||
+ */
|
||||
+int spdk_nvme_ctrlr_cmd_self_test_operation(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid, uint32_t stc,
|
||||
+ void *payload, uint32_t payload_size,
|
||||
+ spdk_nvme_cmd_cb cb_fn, void *cb_arg);
|
||||
+
|
||||
+/**
|
||||
+ *\get I/O queue pair id
|
||||
+ *\param qpair I/O queue pair to submit the request
|
||||
+ *\
|
||||
+ *\return I/O queue pair id
|
||||
+ */
|
||||
+uint16_t spdk_nvme_get_qpair_id(struct spdk_nvme_qpair *qpair);
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* Macro used to register new transports.
|
||||
*/
|
||||
diff --git a/include/spdk/thread.h b/include/spdk/thread.h
|
||||
index 4b7e650..7c52433 100644
|
||||
--- a/include/spdk/thread.h
|
||||
+++ b/include/spdk/thread.h
|
||||
@@ -42,6 +42,9 @@
|
||||
|
||||
#include "spdk/cpuset.h"
|
||||
#include "spdk/queue.h"
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+#include "rte_config.h"
|
||||
+#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -57,6 +60,21 @@ enum spdk_thread_poller_rc {
|
||||
*/
|
||||
struct spdk_thread;
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+struct spdk_iodev_thread_info {
|
||||
+ struct spdk_thread *thread;
|
||||
+ volatile int32_t state;
|
||||
+ uint32_t bdevnum;
|
||||
+};
|
||||
+extern struct spdk_iodev_thread_info lcore_thread_info[RTE_MAX_LCORE];
|
||||
+
|
||||
+void spdk_reactors_use(bool useOrNot);
|
||||
+
|
||||
+bool spdk_get_reactor_type(void);
|
||||
+
|
||||
+void spdk_set_thread_exited(struct spdk_thread *thread);
|
||||
+#endif
|
||||
+
|
||||
/**
|
||||
* A function repeatedly called on the same spdk_thread.
|
||||
*/
|
||||
diff --git a/include/spdk_internal/bdev_stat.h b/include/spdk_internal/bdev_stat.h
|
||||
new file mode 100644
|
||||
index 0000000..f1ba1df
|
||||
--- /dev/null
|
||||
+++ b/include/spdk_internal/bdev_stat.h
|
||||
@@ -0,0 +1,63 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 and
|
||||
+ * only version 2 as published by the Free Software Foundation.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+*/
|
||||
+
|
||||
+#ifndef LIBSTORAGE_STAT_H
|
||||
+#define LIBSTORAGE_STAT_H
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <stdbool.h>
|
||||
+#include <inttypes.h>
|
||||
+
|
||||
+//share memory file name
|
||||
+#define LIBSTORAGE_STAT_SHM_FILE_NAME "libstorage_stat.shm.\
|
||||
+49ce4ec241e017c65812b71b9832a50865f0b7d9b4d5f18d3d03283b"
|
||||
+
|
||||
+//max number of channel+bdev
|
||||
+#define STAT_MAX_NUM 8192
|
||||
+
|
||||
+extern int32_t g_libstorage_iostat;
|
||||
+extern int32_t g_polltime_threshold;
|
||||
+
|
||||
+extern pthread_mutex_t *g_io_stat_map_mutex;
|
||||
+
|
||||
+/* libstorage iostat status */
|
||||
+enum libstorage_iostat_status {
|
||||
+ LIBSTORAGE_IOSTAT_DISABLE = 0,
|
||||
+ LIBSTORAGE_IOSTAT_ENABLE = 1,
|
||||
+ LIBSTORAGE_IOSTAT_QUERY = 2,
|
||||
+};
|
||||
+
|
||||
+struct libstorage_bdev_io_stat
|
||||
+{
|
||||
+ bool used;
|
||||
+ uint16_t channel_id;
|
||||
+ char bdev_name[24];
|
||||
+ uint64_t num_read_ops;
|
||||
+ uint64_t num_write_ops;
|
||||
+ uint64_t bytes_read;
|
||||
+ uint64_t bytes_written;
|
||||
+ uint64_t io_outstanding;
|
||||
+ uint64_t read_latency_ticks;
|
||||
+ uint64_t write_latency_ticks;
|
||||
+ uint64_t io_ticks;
|
||||
+ bool poll_time_used;
|
||||
+ uint64_t num_poll_timeout;
|
||||
+};
|
||||
+
|
||||
+extern struct libstorage_bdev_io_stat *g_io_stat_map;
|
||||
+
|
||||
+int libstorage_stat_init(void);
|
||||
+
|
||||
+int libstorage_stat_exit(void);
|
||||
+#endif
|
||||
diff --git a/include/spdk_internal/debug.h b/include/spdk_internal/debug.h
|
||||
new file mode 100644
|
||||
index 0000000..5d6e623
|
||||
--- /dev/null
|
||||
+++ b/include/spdk_internal/debug.h
|
||||
@@ -0,0 +1,43 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 and
|
||||
+ * only version 2 as published by the Free Software Foundation.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+*/
|
||||
+
|
||||
+#ifndef LIBSTORAGE_INTERNAL_DEBUG_H
|
||||
+#define LIBSTORAGE_INTERNAL_DEBUG_H
|
||||
+#include "spdk/stdinc.h"
|
||||
+
|
||||
+struct spdk_debug_subsystem
|
||||
+{
|
||||
+ const char *name;
|
||||
+ void (*output)(FILE *file);
|
||||
+ TAILQ_ENTRY(spdk_debug_subsystem) tailq;
|
||||
+};
|
||||
+
|
||||
+void spdk_add_debug_subsystem(struct spdk_debug_subsystem *subsystem);
|
||||
+
|
||||
+/**
|
||||
+ * \brief Register a new subsystem
|
||||
+ */
|
||||
+#define SPDK_DEBUG_REGISTER(_name, _output) \
|
||||
+ struct spdk_debug_subsystem __spdk_debug_subsystem_ ## _name = \
|
||||
+ { \
|
||||
+ .name = #_name, \
|
||||
+ .output = _output, \
|
||||
+ }; \
|
||||
+ __attribute__((constructor)) static void _name ## _debug_register(void) \
|
||||
+ { \
|
||||
+ spdk_add_debug_subsystem(&__spdk_debug_subsystem_ ## _name); \
|
||||
+ }
|
||||
+
|
||||
+void spdk_output_debug_info(void);
|
||||
+
|
||||
+#endif
|
||||
diff --git a/include/spdk_internal/thread.h b/include/spdk_internal/thread.h
|
||||
index 5bab452..7d1811b 100644
|
||||
--- a/include/spdk_internal/thread.h
|
||||
+++ b/include/spdk_internal/thread.h
|
||||
@@ -80,6 +80,8 @@ struct spdk_poller {
|
||||
};
|
||||
|
||||
enum spdk_thread_state {
|
||||
+ SPDK_THREAD_STATE_INITIALIZED,
|
||||
+
|
||||
/* The thread is pocessing poller and message by spdk_thread_poll(). */
|
||||
SPDK_THREAD_STATE_RUNNING,
|
||||
|
||||
diff --git a/mk/spdk.app_vars.mk b/mk/spdk.app_vars.mk
|
||||
index 059a56e..ff8fad5 100644
|
||||
--- a/mk/spdk.app_vars.mk
|
||||
+++ b/mk/spdk.app_vars.mk
|
||||
@@ -57,8 +57,10 @@ SPDK_LIB_LINKER_ARGS = \
|
||||
-L$(SPDK_ROOT_DIR)/build/lib \
|
||||
-Wl,--whole-archive \
|
||||
-Wl,--no-as-needed \
|
||||
+ -Wl,-Bstatic \
|
||||
$(SPDK_DEPLIB_LIST:%=-lspdk_%) \
|
||||
- -Wl,--no-whole-archive
|
||||
+ -Wl,--no-whole-archive \
|
||||
+ -Wl,-Bdynamic
|
||||
|
||||
# This is primarily used for unit tests to ensure they link when shared library
|
||||
# build is enabled. Shared libraries can't get their mock implementation from
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,953 +0,0 @@
|
||||
From 214b56fd5a6fd40113c3bf912f0cf1ca7a07abae Mon Sep 17 00:00:00 2001
|
||||
From: sunshihao <sunshihao@huawei.com>
|
||||
Date: Thu, 18 Feb 2021 16:49:16 +0800
|
||||
Subject: [PATCH 18/27] lib/bdev: Add bdev support for HSAK
|
||||
|
||||
Signed-off-by: sunshihao <sunshihao@huawei.com>
|
||||
---
|
||||
include/spdk/bdev.h | 21 ++-
|
||||
include/spdk/bdev_module.h | 9 +-
|
||||
include/spdk/nvme.h | 42 +++---
|
||||
include/spdk_internal/bdev_stat.h | 14 +-
|
||||
include/spdk_internal/debug.h | 5 +-
|
||||
lib/accel/accel_engine.c | 4 +
|
||||
lib/bdev/Makefile | 1 +
|
||||
lib/bdev/bdev.c | 173 ++++++++++++++++++++++--
|
||||
lib/bdev/bdev_internal.h | 18 +++
|
||||
lib/bdev/bdev_self.c | 217 ++++++++++++++++++++++++++++++
|
||||
10 files changed, 449 insertions(+), 55 deletions(-)
|
||||
create mode 100644 lib/bdev/bdev_self.c
|
||||
|
||||
diff --git a/include/spdk/bdev.h b/include/spdk/bdev.h
|
||||
index 2951660..22b87ec 100644
|
||||
--- a/include/spdk/bdev.h
|
||||
+++ b/include/spdk/bdev.h
|
||||
@@ -131,23 +131,22 @@ typedef void (*LIBSTORAGE_CALLBACK_FUNC)(int32_t cb_status, int32_t sct_code, vo
|
||||
|
||||
typedef struct libstorage_io {
|
||||
uint8_t *buf;
|
||||
- struct iovec *iovs; /* array of iovecs to transfer */
|
||||
- int iovcnt; /* Number of iovecs in iovs array */
|
||||
- int32_t fd; /* File Descriptor */
|
||||
- uint16_t opcode; /* r/w */
|
||||
- uint16_t streamId; /* Stream ID for IO */
|
||||
+ struct iovec *iovs; /* array of iovecs to transfer */
|
||||
+ int iovcnt; /* Number of iovecs in iovs array */
|
||||
+ int32_t fd; /* File Descriptor */
|
||||
+ uint16_t opcode; /* r/w */
|
||||
+ uint16_t streamId; /* Stream ID for IO */
|
||||
uint8_t pi_action;
|
||||
uint8_t fua;
|
||||
uint8_t location;
|
||||
- bool inSubmit; /* In the I/0 phase or not. Use in nopoll model */
|
||||
+ bool inSubmit; /* In the I/0 phase or not. Use in nopoll model */
|
||||
uint32_t count;
|
||||
uint32_t nbytes;
|
||||
uint64_t offset;
|
||||
uint8_t *md_buf;
|
||||
uint32_t md_len;
|
||||
uint32_t magic;
|
||||
- /*Save the error code returned by the callback */
|
||||
- int32_t err;
|
||||
+ int32_t err; /* Save the error code returned by the callback */
|
||||
int32_t reserved;
|
||||
LIBSTORAGE_CALLBACK_FUNC cb;
|
||||
void *cb_arg;
|
||||
@@ -1395,7 +1394,7 @@ int spdk_bdev_unmap(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
uint64_t offset, uint64_t nbytes,
|
||||
spdk_bdev_io_completion_cb cb, void *cb_arg);
|
||||
|
||||
-#ifdef SPDK_CONFIG_APP_RW
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
/**
|
||||
* Submit an unmap request to the block device. Unmap is sometimes also called trim or
|
||||
* deallocate. This notifies the device that the data in the blocks described is no
|
||||
@@ -1417,10 +1416,10 @@ spdk_bdev_unmap_multiblocks(struct spdk_bdev_desc *desc, struct spdk_io_channel
|
||||
void *unmap_d, uint16_t unmap_count,
|
||||
spdk_bdev_io_completion_cb cb, void *cb_arg);
|
||||
|
||||
-void*
|
||||
+void *
|
||||
spdk_bdev_get_channel_group(struct spdk_io_channel *io_ch);
|
||||
|
||||
-void*
|
||||
+void *
|
||||
spdk_bdev_io_get_pool(size_t nbytes);
|
||||
|
||||
bool
|
||||
diff --git a/include/spdk/bdev_module.h b/include/spdk/bdev_module.h
|
||||
index c2fd81d..3ff7e28 100644
|
||||
--- a/include/spdk/bdev_module.h
|
||||
+++ b/include/spdk/bdev_module.h
|
||||
@@ -247,7 +247,7 @@ enum spdk_bdev_driver_ctx {
|
||||
SPDK_BDEV_IO_STREAM_ID_1,
|
||||
};
|
||||
|
||||
-enum spdk_bdev_io_e2e_pi_action{
|
||||
+enum spdk_bdev_io_e2e_pi_action {
|
||||
IO_NO_PROTECTION = 0,
|
||||
IO_HALF_WAY_PROTECTION = 1,
|
||||
IO_E2E_PROTECTION = 2
|
||||
@@ -257,19 +257,18 @@ enum spdk_bdev_io_e2e_pi_action{
|
||||
#define FLAG_CALCRC 0x08//bit 3 : 1, libstorage calculate crc; 0, app calculate crc
|
||||
#define FLAG_PRCHK 0x04//bit 2 : 1, enable ctrl guard crc check; 0, disable check
|
||||
|
||||
-enum spdk_bdev_io_fua{
|
||||
+enum spdk_bdev_io_fua {
|
||||
IO_FUA_NO = 0,
|
||||
IO_FUA_YES = 1
|
||||
};
|
||||
|
||||
void spdk_bdev_nvme_remove_cb(void *cb_ctx, void *ctrlr);
|
||||
|
||||
-void spdk_bdev_fail_ctrlr(const char* traddr);
|
||||
+void spdk_bdev_fail_ctrlr(const char *traddr);
|
||||
|
||||
void *nvme_channel_get_group(void *io_ch);
|
||||
|
||||
-enum reqLocation_E
|
||||
-{
|
||||
+enum reqLocation_E {
|
||||
LOCAL_RECEIVE_APP = 1,
|
||||
LOCAL_LIBSTORAGE_SUBMIT = 2,
|
||||
LOCAL_LIBSTORAGE_ASYNC_REQ = 3,
|
||||
diff --git a/include/spdk/nvme.h b/include/spdk/nvme.h
|
||||
index 8e05139..adda642 100644
|
||||
--- a/include/spdk/nvme.h
|
||||
+++ b/include/spdk/nvme.h
|
||||
@@ -3454,11 +3454,11 @@ struct nvme_ctrlr_info {
|
||||
uint16_t ssvid; /* Subsystem vendor id */
|
||||
uint16_t ctrlid; /* Controller id */
|
||||
uint16_t trtype; /* Transport type */
|
||||
- uint16_t support_ns :1; /* Supports the Namespace Management and Namespace Attachment commands */
|
||||
- uint16_t directives :1; /* Supports Directives */
|
||||
- uint16_t streams :1; /* Supports Streams Directives */
|
||||
- uint16_t dsm :1; /* Supports the controller supports the Dataset Management command */
|
||||
- uint16_t reserved :12;
|
||||
+ uint16_t support_ns : 1; /* Supports the Namespace Management and Namespace Attachment commands */
|
||||
+ uint16_t directives : 1; /* Supports Directives */
|
||||
+ uint16_t streams : 1; /* Supports Streams Directives */
|
||||
+ uint16_t dsm : 1; /* Supports the controller supports the Dataset Management command */
|
||||
+ uint16_t reserved : 12;
|
||||
uint16_t reserved2[3];
|
||||
};
|
||||
|
||||
@@ -3468,23 +3468,25 @@ struct spdk_bdev;
|
||||
struct nvme_bdev;
|
||||
struct spdk_nvme_ns;
|
||||
struct spdk_nvme_qpair;
|
||||
-int32_t nvme_ctrlr_get_info(const char* ctrlName, struct nvme_ctrlr_info** ppCtrlr);
|
||||
-struct spdk_nvme_ctrlr* spdk_nvme_ctrlr_get_by_name(const char* ctrlname);
|
||||
-struct spdk_nvme_ctrlr* spdk_nvme_ctrlr_get_by_ctrlr(const struct nvme_bdev_ctrlr *nvme_bdev_ctrlr);
|
||||
-struct nvme_bdev_ctrlr* nvme_ctrlr_get_by_name(const char* ctrlname);
|
||||
-void nvme_ctrlr_clear_iostat_by_name(const char* ctrlname);
|
||||
+int32_t nvme_ctrlr_get_info(const char *ctrlName, struct nvme_ctrlr_info **ppCtrlr);
|
||||
+struct spdk_nvme_ctrlr *spdk_nvme_ctrlr_get_by_name(const char *ctrlname);
|
||||
+struct spdk_nvme_ctrlr *spdk_nvme_ctrlr_get_by_ctrlr(const struct nvme_bdev_ctrlr *nvme_bdev_ctrlr);
|
||||
+struct nvme_bdev_ctrlr *nvme_ctrlr_get_by_name(const char *ctrlname);
|
||||
+void nvme_ctrlr_clear_iostat_by_name(const char *ctrlname);
|
||||
void nvme_ctrlr_clear_iostat_all(void);
|
||||
-struct nvme_bdev_ctrlr* bdev_nvme_get_ctrlr_by_bdev_desc(void *bdev);
|
||||
-struct spdk_nvme_ns* bdev_nvme_get_ns(struct nvme_bdev *nbdev);
|
||||
+struct nvme_bdev_ctrlr *bdev_nvme_get_ctrlr_by_bdev_desc(void *bdev);
|
||||
+struct spdk_nvme_ns *bdev_nvme_get_ns(struct nvme_bdev *nbdev);
|
||||
void bdev_nvme_update_block_by_nvme_ctrlr(struct spdk_nvme_ctrlr *ctrlr);
|
||||
int bdev_nvme_update_ns(struct nvme_bdev_ctrlr *nvme_ctrlr, uint32_t nsid);
|
||||
bool spdk_bdev_can_remove(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr, uint32_t nsid);
|
||||
void spdk_bdev_set_ns_normal(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr, uint32_t nsid);
|
||||
void spdk_nvme_ctrlr_set_shutdown(struct spdk_nvme_ctrlr *ctrlr, bool is_shutdown);
|
||||
bool spdk_nvme_ctrlr_is_smart_per_namespace_supported(struct spdk_nvme_ctrlr *ctrlr);
|
||||
-int spdk_nvme_ctrlr_get_smart_info(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid, struct spdk_nvme_health_information_page *health_payload);
|
||||
-int spdk_nvme_ctrlr_get_error_info(struct spdk_nvme_ctrlr *ctrlr, uint32_t err_entries, struct spdk_nvme_error_information_entry *error_info);
|
||||
-struct spdk_nvme_ctrlr_opts* spdk_nvme_ctrlr_get_opts(struct spdk_nvme_ctrlr *ctrlr);
|
||||
+int spdk_nvme_ctrlr_get_smart_info(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid,
|
||||
+ struct spdk_nvme_health_information_page *health_payload);
|
||||
+int spdk_nvme_ctrlr_get_error_info(struct spdk_nvme_ctrlr *ctrlr, uint32_t err_entries,
|
||||
+ struct spdk_nvme_error_information_entry *error_info);
|
||||
+struct spdk_nvme_ctrlr_opts *spdk_nvme_ctrlr_get_opts(struct spdk_nvme_ctrlr *ctrlr);
|
||||
int nvme_ns_get_common_data(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_ns_data *nsdata);
|
||||
bool spdk_nvme_ns_is_allocated(struct spdk_nvme_ctrlr *ctrlr, uint16_t nsid);
|
||||
bool spdk_nvme_ctrlr_is_ns_manage_supported(struct spdk_nvme_ctrlr *ctrlr);
|
||||
@@ -3492,7 +3494,8 @@ bool spdk_nvme_ctrlr_is_format_supported(struct spdk_nvme_ctrlr *ctrlr);
|
||||
bool spdk_nvme_ctrlr_is_format_all_ns(struct spdk_nvme_ctrlr *ctrlr);
|
||||
bool spdk_nvme_ctrlr_is_directive_supported(struct spdk_nvme_ctrlr *ctrlr);
|
||||
bool spdk_nvme_ctrlr_is_streams_supported(struct spdk_nvme_ctrlr *ctrlr);
|
||||
-int32_t spdk_nvme_ctrlr_identify_directives(struct spdk_nvme_ctrlr *ctrlr, uint16_t nsid, void *payload);
|
||||
+int32_t spdk_nvme_ctrlr_identify_directives(struct spdk_nvme_ctrlr *ctrlr, uint16_t nsid,
|
||||
+ void *payload);
|
||||
int32_t spdk_nvme_ctrlr_enable_streams(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid);
|
||||
int32_t spdk_nvme_ctrlr_ret_streams_param(struct spdk_nvme_ctrlr *ctrlr, void *payload);
|
||||
int32_t spdk_nvme_ns_ret_streams_param(struct spdk_nvme_ns *ns, void *payload);
|
||||
@@ -3651,9 +3654,10 @@ int spdk_nvme_ns_cmd_writev_stream(struct spdk_nvme_ns *ns, struct spdk_nvme_qpa
|
||||
*
|
||||
* \sa spdk_nvme_ctrlr_cmd_self_test_operation()
|
||||
*/
|
||||
-int spdk_nvme_ctrlr_cmd_self_test_operation(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid, uint32_t stc,
|
||||
- void *payload, uint32_t payload_size,
|
||||
- spdk_nvme_cmd_cb cb_fn, void *cb_arg);
|
||||
+int spdk_nvme_ctrlr_cmd_self_test_operation(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid,
|
||||
+ uint32_t stc,
|
||||
+ void *payload, uint32_t payload_size,
|
||||
+ spdk_nvme_cmd_cb cb_fn, void *cb_arg);
|
||||
|
||||
/**
|
||||
*\get I/O queue pair id
|
||||
diff --git a/include/spdk_internal/bdev_stat.h b/include/spdk_internal/bdev_stat.h
|
||||
index f1ba1df..58a5102 100644
|
||||
--- a/include/spdk_internal/bdev_stat.h
|
||||
+++ b/include/spdk_internal/bdev_stat.h
|
||||
@@ -9,21 +9,18 @@
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
-*/
|
||||
+ */
|
||||
|
||||
#ifndef LIBSTORAGE_STAT_H
|
||||
#define LIBSTORAGE_STAT_H
|
||||
|
||||
-#include <stdio.h>
|
||||
-#include <stdlib.h>
|
||||
-#include <stdbool.h>
|
||||
-#include <inttypes.h>
|
||||
+#include "spdk/stdinc.h"
|
||||
|
||||
-//share memory file name
|
||||
+/* share memory file name */
|
||||
#define LIBSTORAGE_STAT_SHM_FILE_NAME "libstorage_stat.shm.\
|
||||
49ce4ec241e017c65812b71b9832a50865f0b7d9b4d5f18d3d03283b"
|
||||
|
||||
-//max number of channel+bdev
|
||||
+/* max number of channel+bdev */
|
||||
#define STAT_MAX_NUM 8192
|
||||
|
||||
extern int32_t g_libstorage_iostat;
|
||||
@@ -38,8 +35,7 @@ enum libstorage_iostat_status {
|
||||
LIBSTORAGE_IOSTAT_QUERY = 2,
|
||||
};
|
||||
|
||||
-struct libstorage_bdev_io_stat
|
||||
-{
|
||||
+struct libstorage_bdev_io_stat {
|
||||
bool used;
|
||||
uint16_t channel_id;
|
||||
char bdev_name[24];
|
||||
diff --git a/include/spdk_internal/debug.h b/include/spdk_internal/debug.h
|
||||
index 5d6e623..cf9b9e7 100644
|
||||
--- a/include/spdk_internal/debug.h
|
||||
+++ b/include/spdk_internal/debug.h
|
||||
@@ -9,14 +9,13 @@
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
-*/
|
||||
+ */
|
||||
|
||||
#ifndef LIBSTORAGE_INTERNAL_DEBUG_H
|
||||
#define LIBSTORAGE_INTERNAL_DEBUG_H
|
||||
#include "spdk/stdinc.h"
|
||||
|
||||
-struct spdk_debug_subsystem
|
||||
-{
|
||||
+struct spdk_debug_subsystem {
|
||||
const char *name;
|
||||
void (*output)(FILE *file);
|
||||
TAILQ_ENTRY(spdk_debug_subsystem) tailq;
|
||||
diff --git a/lib/accel/accel_engine.c b/lib/accel/accel_engine.c
|
||||
index ca3e248..865128a 100644
|
||||
--- a/lib/accel/accel_engine.c
|
||||
+++ b/lib/accel/accel_engine.c
|
||||
@@ -745,7 +745,11 @@ spdk_accel_engine_module_finish(void)
|
||||
}
|
||||
|
||||
if (g_accel_engine_module->module_fini) {
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
spdk_thread_send_msg(spdk_get_thread(), g_accel_engine_module->module_fini, NULL);
|
||||
+#else
|
||||
+ g_accel_engine_module->module_fini(NULL);
|
||||
+#endif
|
||||
} else {
|
||||
spdk_accel_engine_module_finish();
|
||||
}
|
||||
diff --git a/lib/bdev/Makefile b/lib/bdev/Makefile
|
||||
index 795fa6e..c23caf1 100644
|
||||
--- a/lib/bdev/Makefile
|
||||
+++ b/lib/bdev/Makefile
|
||||
@@ -42,6 +42,7 @@ CFLAGS += -I$(CONFIG_VTUNE_DIR)/include -I$(CONFIG_VTUNE_DIR)/sdk/src/ittnotify
|
||||
endif
|
||||
|
||||
C_SRCS = bdev.c bdev_rpc.c bdev_zone.c part.c scsi_nvme.c
|
||||
+C_SRCS-$(CONFIG_APP_RW) += bdev_self.c
|
||||
C_SRCS-$(CONFIG_VTUNE) += vtune.c
|
||||
LIBNAME = bdev
|
||||
|
||||
diff --git a/lib/bdev/bdev.c b/lib/bdev/bdev.c
|
||||
index 2a642d6..bf102bb 100644
|
||||
--- a/lib/bdev/bdev.c
|
||||
+++ b/lib/bdev/bdev.c
|
||||
@@ -50,6 +50,13 @@
|
||||
#include "spdk/log.h"
|
||||
#include "spdk/string.h"
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+#include "spdk/stdinc.h"
|
||||
+#include "spdk/barrier.h"
|
||||
+#include <securec.h>
|
||||
+#include "spdk_internal/bdev_stat.h"
|
||||
+#endif
|
||||
+
|
||||
#include "bdev_internal.h"
|
||||
|
||||
#ifdef SPDK_CONFIG_VTUNE
|
||||
@@ -1377,8 +1384,12 @@ spdk_bdev_initialize(spdk_bdev_init_cb cb_fn, void *cb_arg)
|
||||
|
||||
g_bdev_mgr.buf_small_pool = spdk_mempool_create(mempool_name,
|
||||
g_bdev_opts.small_buf_pool_size,
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ SPDK_BDEV_SMALL_BUF_MAX_SIZE + SPDK_BDEV_SMALL_BUF_WITH_MAX_MD,
|
||||
+#else
|
||||
SPDK_BDEV_BUF_SIZE_WITH_MD(SPDK_BDEV_SMALL_BUF_MAX_SIZE) +
|
||||
SPDK_BDEV_POOL_ALIGNMENT,
|
||||
+#endif
|
||||
cache_size,
|
||||
SPDK_ENV_SOCKET_ID_ANY);
|
||||
if (!g_bdev_mgr.buf_small_pool) {
|
||||
@@ -1392,8 +1403,12 @@ spdk_bdev_initialize(spdk_bdev_init_cb cb_fn, void *cb_arg)
|
||||
|
||||
g_bdev_mgr.buf_large_pool = spdk_mempool_create(mempool_name,
|
||||
g_bdev_opts.large_buf_pool_size,
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ SPDK_BDEV_LARGE_BUF_MAX_SIZE + SPDK_BDEV_LARGE_BUF_WITH_MAX_MD,
|
||||
+#else
|
||||
SPDK_BDEV_BUF_SIZE_WITH_MD(SPDK_BDEV_LARGE_BUF_MAX_SIZE) +
|
||||
SPDK_BDEV_POOL_ALIGNMENT,
|
||||
+#endif
|
||||
cache_size,
|
||||
SPDK_ENV_SOCKET_ID_ANY);
|
||||
if (!g_bdev_mgr.buf_large_pool) {
|
||||
@@ -1561,7 +1576,11 @@ bdev_finish_unregister_bdevs_iter(void *cb_arg, int bdeverrno)
|
||||
* (like bdev part free) that will use this bdev (or private bdev driver ctx data)
|
||||
* after returning.
|
||||
*/
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ bdev_module_finish_iter(NULL);
|
||||
+#else
|
||||
spdk_thread_send_msg(spdk_get_thread(), bdev_module_finish_iter, NULL);
|
||||
+#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2296,6 +2315,17 @@ _bdev_io_submit(void *ctx)
|
||||
bdev_io->internal.submit_tsc = tsc;
|
||||
spdk_trace_record_tsc(tsc, TRACE_BDEV_IO_START, 0, 0, (uintptr_t)bdev_io, bdev_io->type);
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ struct spdk_bdev_io_stat *stat = &bdev_ch->stat;
|
||||
+ if (bdev_ch->io_outstanding > 0) {
|
||||
+ stat->pre_ticks = stat->cur_ticks;
|
||||
+ stat->cur_ticks = tsc;
|
||||
+ stat->io_ticks += stat->cur_ticks - stat->pre_ticks;
|
||||
+ } else {
|
||||
+ stat->cur_ticks = tsc;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
if (spdk_likely(bdev_ch->flags == 0)) {
|
||||
bdev_io_do_submit(bdev_ch, bdev_io);
|
||||
return;
|
||||
@@ -2307,6 +2337,9 @@ _bdev_io_submit(void *ctx)
|
||||
if (spdk_unlikely(bdev_io->type == SPDK_BDEV_IO_TYPE_ABORT) &&
|
||||
bdev_abort_queued_io(&bdev->internal.qos->queued, bdev_io->u.abort.bio_to_abort)) {
|
||||
_bdev_io_complete_in_submit(bdev_ch, bdev_io, SPDK_BDEV_IO_STATUS_SUCCESS);
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ spdk_bdev_set_io_location(bdev_io->driver_ctx, (uint8_t)LOCAL_LIBSTORAGE_BDEV_NOMEM);
|
||||
+#endif
|
||||
} else {
|
||||
TAILQ_INSERT_TAIL(&bdev->internal.qos->queued, bdev_io, internal.link);
|
||||
bdev_qos_io_submit(bdev_ch, bdev->internal.qos);
|
||||
@@ -2652,6 +2685,7 @@ bdev_desc_free(struct spdk_bdev_desc *desc)
|
||||
pthread_mutex_destroy(&desc->mutex);
|
||||
free(desc->media_events_buffer);
|
||||
free(desc);
|
||||
+ desc = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2837,6 +2871,9 @@ bdev_channel_create(void *io_device, void *ctx_buf)
|
||||
ch->flags = 0;
|
||||
ch->shared_resource = shared_resource;
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ spdk_bdev_init_iostat(ch, ch->bdev, ch->channel, &ch->stat);
|
||||
+#endif
|
||||
TAILQ_INIT(&ch->io_submitted);
|
||||
TAILQ_INIT(&ch->io_locked);
|
||||
|
||||
@@ -3075,6 +3112,10 @@ bdev_channel_destroy(void *io_device, void *ctx_buf)
|
||||
spdk_histogram_data_free(ch->histogram);
|
||||
}
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ spdk_bdev_destroy_iostat(ch, ch->bdev, ch->channel);
|
||||
+#endif
|
||||
+
|
||||
bdev_channel_destroy_resource(ch);
|
||||
}
|
||||
|
||||
@@ -3527,6 +3568,26 @@ _bdev_io_check_md_buf(const struct iovec *iovs, const void *md_buf)
|
||||
return _is_buf_allocated(iovs) == (md_buf != NULL);
|
||||
}
|
||||
|
||||
+static void
|
||||
+bdev_build_contig_io(uint8_t type, void *buf, void *md_buf, uint64_t offset_blocks,
|
||||
+ uint64_t num_blocks,
|
||||
+ struct libstorage_io *io, struct spdk_bdev_io *bdev_io)
|
||||
+{
|
||||
+ bdev_io->type = type;
|
||||
+ bdev_io->u.contig.buf = buf;
|
||||
+ bdev_io->u.contig.md_buf = md_buf;
|
||||
+ bdev_io->u.contig.offset_blocks = offset_blocks;
|
||||
+ bdev_io->u.contig.num_blocks = num_blocks;
|
||||
+ bdev_io->u.contig.nbytes = io->nbytes;
|
||||
+ bdev_io->u.contig.md_len = io->md_len;
|
||||
+ bdev_io->driver_ctx[SPDK_BDEV_IO_ACTION_PI] = io->pi_action;
|
||||
+ bdev_io->driver_ctx[SPDK_BDEV_IO_ACTION_FUA] = io->fua;
|
||||
+ if (type == SPDK_BDEV_IO_TYPE_WRITE_NVME) {
|
||||
+ bdev_io->driver_ctx[SPDK_BDEV_IO_STREAM_ID_0] = io->streamId & 0xFF;
|
||||
+ bdev_io->driver_ctx[SPDK_BDEV_IO_STREAM_ID_1] = (io->streamId >> 8) & 0xFF;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int
|
||||
bdev_read_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch, void *buf,
|
||||
void *md_buf, int64_t offset_blocks, uint64_t num_blocks,
|
||||
@@ -3547,6 +3608,7 @@ bdev_read_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch
|
||||
|
||||
bdev_io->internal.ch = channel;
|
||||
bdev_io->internal.desc = desc;
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
bdev_io->type = SPDK_BDEV_IO_TYPE_READ;
|
||||
bdev_io->u.bdev.iovs = &bdev_io->iov;
|
||||
bdev_io->u.bdev.iovs[0].iov_base = buf;
|
||||
@@ -3555,6 +3617,12 @@ bdev_read_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch
|
||||
bdev_io->u.bdev.md_buf = md_buf;
|
||||
bdev_io->u.bdev.num_blocks = num_blocks;
|
||||
bdev_io->u.bdev.offset_blocks = offset_blocks;
|
||||
+#else
|
||||
+ struct libstorage_io *io = (struct libstorage_io *)cb_arg;
|
||||
+ bdev_build_contig_io(SPDK_BDEV_IO_TYPE_READ_NVME, buf, md_buf, offset_blocks, num_blocks,
|
||||
+ io, bdev_io);
|
||||
+ cb_arg = &io->location;
|
||||
+#endif
|
||||
bdev_io_init(bdev_io, bdev, cb_arg, cb);
|
||||
|
||||
bdev_io_submit(bdev_io);
|
||||
@@ -3592,7 +3660,7 @@ spdk_bdev_read_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channe
|
||||
struct iovec iov = {
|
||||
.iov_base = buf,
|
||||
};
|
||||
-
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
if (!spdk_bdev_is_md_separate(spdk_bdev_desc_get_bdev(desc))) {
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -3600,7 +3668,7 @@ spdk_bdev_read_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channe
|
||||
if (!_bdev_io_check_md_buf(&iov, md_buf)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
return bdev_read_blocks_with_md(desc, ch, buf, md_buf, offset_blocks, num_blocks,
|
||||
cb, cb_arg);
|
||||
}
|
||||
@@ -3647,6 +3715,14 @@ bdev_readv_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channel *c
|
||||
bdev_io->u.bdev.md_buf = md_buf;
|
||||
bdev_io->u.bdev.num_blocks = num_blocks;
|
||||
bdev_io->u.bdev.offset_blocks = offset_blocks;
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ struct libstorage_io *io = (struct libstorage_io *)cb_arg;
|
||||
+ bdev_io->type = SPDK_BDEV_IO_TYPE_READV_NVME;
|
||||
+ bdev_io->u.bdev.nbytes = io->nbytes;
|
||||
+ bdev_io->driver_ctx[SPDK_BDEV_IO_ACTION_PI] = io->pi_action;
|
||||
+ bdev_io->driver_ctx[SPDK_BDEV_IO_ACTION_FUA] = io->fua;
|
||||
+ cb_arg = &io->location;
|
||||
+#endif
|
||||
bdev_io_init(bdev_io, bdev, cb_arg, cb);
|
||||
|
||||
bdev_io_submit(bdev_io);
|
||||
@@ -3668,6 +3744,7 @@ spdk_bdev_readv_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_chann
|
||||
uint64_t offset_blocks, uint64_t num_blocks,
|
||||
spdk_bdev_io_completion_cb cb, void *cb_arg)
|
||||
{
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
if (!spdk_bdev_is_md_separate(spdk_bdev_desc_get_bdev(desc))) {
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -3675,7 +3752,7 @@ spdk_bdev_readv_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_chann
|
||||
if (!_bdev_io_check_md_buf(iov, md_buf)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
return bdev_readv_blocks_with_md(desc, ch, iov, iovcnt, md_buf, offset_blocks,
|
||||
num_blocks, cb, cb_arg);
|
||||
}
|
||||
@@ -3689,9 +3766,11 @@ bdev_write_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channel *c
|
||||
struct spdk_bdev_io *bdev_io;
|
||||
struct spdk_bdev_channel *channel = spdk_io_channel_get_ctx(ch);
|
||||
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
if (!desc->write) {
|
||||
return -EBADF;
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (!bdev_io_valid_blocks(bdev, offset_blocks, num_blocks)) {
|
||||
return -EINVAL;
|
||||
@@ -3704,6 +3783,7 @@ bdev_write_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channel *c
|
||||
|
||||
bdev_io->internal.ch = channel;
|
||||
bdev_io->internal.desc = desc;
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
bdev_io->type = SPDK_BDEV_IO_TYPE_WRITE;
|
||||
bdev_io->u.bdev.iovs = &bdev_io->iov;
|
||||
bdev_io->u.bdev.iovs[0].iov_base = buf;
|
||||
@@ -3712,6 +3792,12 @@ bdev_write_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channel *c
|
||||
bdev_io->u.bdev.md_buf = md_buf;
|
||||
bdev_io->u.bdev.num_blocks = num_blocks;
|
||||
bdev_io->u.bdev.offset_blocks = offset_blocks;
|
||||
+#else
|
||||
+ LIBSTORAGE_IO_T *io = (struct libstorage_io *)cb_arg;
|
||||
+ bdev_build_contig_io(SPDK_BDEV_IO_TYPE_WRITE_NVME, buf, md_buf, offset_blocks, num_blocks,
|
||||
+ io, bdev_io);
|
||||
+ cb_arg = &io->location;
|
||||
+#endif
|
||||
bdev_io_init(bdev_io, bdev, cb_arg, cb);
|
||||
|
||||
bdev_io_submit(bdev_io);
|
||||
@@ -3751,6 +3837,7 @@ spdk_bdev_write_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_chann
|
||||
.iov_base = buf,
|
||||
};
|
||||
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
if (!spdk_bdev_is_md_separate(spdk_bdev_desc_get_bdev(desc))) {
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -3758,7 +3845,7 @@ spdk_bdev_write_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_chann
|
||||
if (!_bdev_io_check_md_buf(&iov, md_buf)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
return bdev_write_blocks_with_md(desc, ch, buf, md_buf, offset_blocks, num_blocks,
|
||||
cb, cb_arg);
|
||||
}
|
||||
@@ -3773,9 +3860,11 @@ bdev_writev_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channel *
|
||||
struct spdk_bdev_io *bdev_io;
|
||||
struct spdk_bdev_channel *channel = spdk_io_channel_get_ctx(ch);
|
||||
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
if (!desc->write) {
|
||||
return -EBADF;
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (!bdev_io_valid_blocks(bdev, offset_blocks, num_blocks)) {
|
||||
return -EINVAL;
|
||||
@@ -3794,6 +3883,16 @@ bdev_writev_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channel *
|
||||
bdev_io->u.bdev.md_buf = md_buf;
|
||||
bdev_io->u.bdev.num_blocks = num_blocks;
|
||||
bdev_io->u.bdev.offset_blocks = offset_blocks;
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ struct libstorage_io *io = (struct libstorage_io *)cb_arg;
|
||||
+ bdev_io->type = SPDK_BDEV_IO_TYPE_WRITEV_NVME;
|
||||
+ bdev_io->u.bdev.nbytes = io->nbytes;
|
||||
+ bdev_io->driver_ctx[SPDK_BDEV_IO_ACTION_PI] = io->pi_action;
|
||||
+ bdev_io->driver_ctx[SPDK_BDEV_IO_ACTION_FUA] = io->fua;
|
||||
+ bdev_io->driver_ctx[SPDK_BDEV_IO_STREAM_ID_0] = io->streamId & 0xFF;
|
||||
+ bdev_io->driver_ctx[SPDK_BDEV_IO_STREAM_ID_1] = (io->streamId >> 8) & 0xFF;
|
||||
+ cb_arg = &io->location;
|
||||
+#endif
|
||||
bdev_io_init(bdev_io, bdev, cb_arg, cb);
|
||||
|
||||
bdev_io_submit(bdev_io);
|
||||
@@ -3832,6 +3931,7 @@ spdk_bdev_writev_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_chan
|
||||
uint64_t offset_blocks, uint64_t num_blocks,
|
||||
spdk_bdev_io_completion_cb cb, void *cb_arg)
|
||||
{
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
if (!spdk_bdev_is_md_separate(spdk_bdev_desc_get_bdev(desc))) {
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -3839,7 +3939,7 @@ spdk_bdev_writev_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_chan
|
||||
if (!_bdev_io_check_md_buf(iov, md_buf)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
return bdev_writev_blocks_with_md(desc, ch, iov, iovcnt, md_buf, offset_blocks,
|
||||
num_blocks, cb, cb_arg);
|
||||
}
|
||||
@@ -5111,8 +5211,16 @@ bdev_io_complete(void *ctx)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ bdev_io_stat_update(bdev_io, tsc, &bdev_io->internal.ch->stat);
|
||||
+#endif
|
||||
}
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ bdev_update_iostat_map(bdev_io, tsc, &bdev_io->internal.ch->stat, bdev_io->internal.ch->channel,
|
||||
+ bdev_io->internal.ch->io_outstanding);
|
||||
+#endif
|
||||
+
|
||||
#ifdef SPDK_CONFIG_VTUNE
|
||||
uint64_t now_tsc = spdk_get_ticks();
|
||||
if (now_tsc > (bdev_io->internal.ch->start_tsc + bdev_io->internal.ch->interval_tsc)) {
|
||||
@@ -5134,7 +5242,9 @@ bdev_io_complete(void *ctx)
|
||||
#endif
|
||||
|
||||
assert(bdev_io->internal.cb != NULL);
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
assert(spdk_get_thread() == spdk_bdev_io_get_thread(bdev_io));
|
||||
+#endif
|
||||
|
||||
bdev_io->internal.cb(bdev_io, bdev_io->internal.status == SPDK_BDEV_IO_STATUS_SUCCESS,
|
||||
bdev_io->internal.caller_ctx);
|
||||
@@ -5208,6 +5318,9 @@ spdk_bdev_io_complete(struct spdk_bdev_io *bdev_io, enum spdk_bdev_io_status sta
|
||||
|
||||
if (spdk_unlikely(status == SPDK_BDEV_IO_STATUS_NOMEM)) {
|
||||
TAILQ_INSERT_HEAD(&shared_resource->nomem_io, bdev_io, internal.link);
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ spdk_bdev_set_io_location(bdev_io->driver_ctx, (uint8_t)LOCAL_LIBSTORAGE_BDEV_NOMEM);
|
||||
+#endif
|
||||
/*
|
||||
* Wait for some of the outstanding I/O to complete before we
|
||||
* retry any of the nomem_io. Normally we will wait for
|
||||
@@ -5613,8 +5726,8 @@ bdev_unregister_unsafe(struct spdk_bdev *bdev)
|
||||
* immediately closes its descriptor.
|
||||
*/
|
||||
desc->refs++;
|
||||
- spdk_thread_send_msg(desc->thread, _remove_notify, desc);
|
||||
pthread_mutex_unlock(&desc->mutex);
|
||||
+ spdk_thread_send_msg(desc->thread, _remove_notify, desc);
|
||||
}
|
||||
|
||||
/* If there are no descriptors, proceed removing the bdev */
|
||||
@@ -5858,9 +5971,9 @@ spdk_bdev_close(struct spdk_bdev_desc *desc)
|
||||
|
||||
SPDK_DEBUGLOG(bdev, "Closing descriptor %p for bdev %s on thread %p\n", desc, bdev->name,
|
||||
spdk_get_thread());
|
||||
-
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
assert(desc->thread == spdk_get_thread());
|
||||
-
|
||||
+#endif
|
||||
spdk_poller_unregister(&desc->io_timeout_poller);
|
||||
|
||||
pthread_mutex_lock(&bdev->internal.mutex);
|
||||
@@ -6909,6 +7022,50 @@ bdev_unlock_lba_range(struct spdk_bdev_desc *desc, struct spdk_io_channel *_ch,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+void *
|
||||
+spdk_bdev_io_get_pool(size_t nbytes)
|
||||
+{
|
||||
+ struct spdk_mempool *pool = NULL;
|
||||
+
|
||||
+ if (nbytes == 0 || nbytes > SPDK_BDEV_LARGE_BUF_MAX_SIZE + SPDK_BDEV_LARGE_BUF_WITH_MAX_MD) {
|
||||
+ SPDK_ERRLOG("The size of buffer[%zu] is incorrect!\n", nbytes);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (nbytes <= SPDK_BDEV_SMALL_BUF_MAX_SIZE + SPDK_BDEV_SMALL_BUF_WITH_MAX_MD) {
|
||||
+ pool = g_bdev_mgr.buf_small_pool;
|
||||
+ } else {
|
||||
+ pool = g_bdev_mgr.buf_large_pool;
|
||||
+ }
|
||||
+
|
||||
+ return pool;
|
||||
+}
|
||||
+
|
||||
+void *
|
||||
+spdk_bdev_get_channel_group(struct spdk_io_channel *io_ch)
|
||||
+{
|
||||
+ struct spdk_bdev_channel *ch = spdk_io_channel_get_ctx(io_ch);
|
||||
+ struct spdk_io_channel *under_io_ch = ch->channel;
|
||||
+ void *nvme_io_ch = spdk_io_channel_get_ctx(under_io_ch);
|
||||
+
|
||||
+ return nvme_channel_get_group(nvme_io_ch);
|
||||
+}
|
||||
+
|
||||
+bool
|
||||
+spdk_bdev_have_io_in_channel(struct spdk_io_channel *io_ch)
|
||||
+{
|
||||
+ struct spdk_bdev_channel *bdev_ch = NULL;
|
||||
+
|
||||
+ if (io_ch != NULL) {
|
||||
+ bdev_ch = spdk_io_channel_get_ctx(io_ch);
|
||||
+ return bdev_ch->io_outstanding != 0;
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
SPDK_LOG_REGISTER_COMPONENT(bdev)
|
||||
|
||||
SPDK_TRACE_REGISTER_FN(bdev_trace, "bdev", TRACE_GROUP_BDEV)
|
||||
diff --git a/lib/bdev/bdev_internal.h b/lib/bdev/bdev_internal.h
|
||||
index d1fa6e6..871387f 100644
|
||||
--- a/lib/bdev/bdev_internal.h
|
||||
+++ b/lib/bdev/bdev_internal.h
|
||||
@@ -47,4 +47,22 @@ void bdev_io_init(struct spdk_bdev_io *bdev_io, struct spdk_bdev *bdev, void *cb
|
||||
|
||||
void bdev_io_submit(struct spdk_bdev_io *bdev_io);
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+void
|
||||
+spdk_bdev_init_iostat(struct spdk_bdev_channel *ch, struct spdk_bdev *bdev,
|
||||
+ struct spdk_io_channel *io_ch,
|
||||
+ struct spdk_bdev_io_stat *stat);
|
||||
+
|
||||
+void
|
||||
+spdk_bdev_destroy_iostat(struct spdk_bdev_channel *ch, struct spdk_bdev *bdev,
|
||||
+ struct spdk_io_channel *io_ch);
|
||||
+
|
||||
+void
|
||||
+bdev_io_stat_update(struct spdk_bdev_io *bdev_io, uint64_t tsc, struct spdk_bdev_io_stat *stat);
|
||||
+
|
||||
+void
|
||||
+bdev_update_iostat_map(struct spdk_bdev_io *bdev_io, uint64_t tsc, struct spdk_bdev_io_stat *stat,
|
||||
+ struct spdk_io_channel *channel, uint64_t io_outstanding);
|
||||
+#endif
|
||||
+
|
||||
#endif /* SPDK_BDEV_INTERNAL_H */
|
||||
diff --git a/lib/bdev/bdev_self.c b/lib/bdev/bdev_self.c
|
||||
new file mode 100644
|
||||
index 0000000..7050c30
|
||||
--- /dev/null
|
||||
+++ b/lib/bdev/bdev_self.c
|
||||
@@ -0,0 +1,217 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License version 2 and
|
||||
+ * only version 2 as published by the Free Software Foundation.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ */
|
||||
+
|
||||
+#include "bdev_internal.h"
|
||||
+
|
||||
+#include "spdk/stdinc.h"
|
||||
+#include "spdk/bdev.h"
|
||||
+#include "spdk/bdev_module.h"
|
||||
+#include "spdk/env.h"
|
||||
+#include "spdk/nvme_spec.h"
|
||||
+#include "spdk/log.h"
|
||||
+
|
||||
+#include <securec.h>
|
||||
+#include "spdk_internal/bdev_stat.h"
|
||||
+
|
||||
+pthread_mutex_t *g_io_stat_map_mutex = NULL;
|
||||
+/* share memory for libstorage iostat */
|
||||
+struct libstorage_bdev_io_stat *g_io_stat_map;
|
||||
+/* libstorage iostat enable or disable switch */
|
||||
+int32_t g_libstorage_iostat = 0;
|
||||
+int32_t g_polltime_threshold = 0;
|
||||
+
|
||||
+void
|
||||
+spdk_bdev_init_iostat(struct spdk_bdev_channel *ch, struct spdk_bdev *bdev,
|
||||
+ struct spdk_io_channel *io_ch,
|
||||
+ struct spdk_bdev_io_stat *stat)
|
||||
+{
|
||||
+ int i = 0;
|
||||
+ bool find = false;
|
||||
+ uint16_t channel_id;
|
||||
+
|
||||
+ if (bdev->fn_table->get_io_channel_id) {
|
||||
+ channel_id = bdev->fn_table->get_io_channel_id(io_ch);
|
||||
+ for (i = 0; i < STAT_MAX_NUM; i++) {
|
||||
+ /* Reuse last record */
|
||||
+ if (g_io_stat_map[i].used && !strcmp(g_io_stat_map[i].bdev_name, bdev->name)
|
||||
+ && g_io_stat_map[i].channel_id == channel_id) {
|
||||
+ stat->io_stat_id = i;
|
||||
+ find = true;
|
||||
+ g_io_stat_map[i].num_read_ops = 0;
|
||||
+ g_io_stat_map[i].num_write_ops = 0;
|
||||
+ g_io_stat_map[i].bytes_read = 0;
|
||||
+ g_io_stat_map[i].bytes_written = 0;
|
||||
+ g_io_stat_map[i].io_outstanding = 0;
|
||||
+ g_io_stat_map[i].read_latency_ticks = 0;
|
||||
+ g_io_stat_map[i].write_latency_ticks = 0;
|
||||
+ g_io_stat_map[i].io_ticks = 0;
|
||||
+ g_io_stat_map[i].poll_time_used = false;
|
||||
+ g_io_stat_map[i].num_poll_timeout = 0;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!find) {
|
||||
+ /* Add lock when multi thread or process */
|
||||
+ if (pthread_mutex_lock(g_io_stat_map_mutex) == EOWNERDEAD) {
|
||||
+ if (pthread_mutex_consistent(g_io_stat_map_mutex)) {
|
||||
+ SPDK_WARNLOG("[libstorage] the iostat_map process mutex is not normal any more.\n");
|
||||
+ }
|
||||
+ }
|
||||
+ for (i = 0; i < STAT_MAX_NUM; i++) {
|
||||
+ /* Find unused record, allocate it to this channel */
|
||||
+ if (!g_io_stat_map[i].used) {
|
||||
+ g_io_stat_map[i].used = true;
|
||||
+ if (strncpy_s(g_io_stat_map[i].bdev_name, sizeof(g_io_stat_map[i].bdev_name), bdev->name,
|
||||
+ sizeof(g_io_stat_map[i].bdev_name) - 1) != 0) {
|
||||
+ SPDK_ERRLOG("[libstorage] string copy failed.\n");
|
||||
+ }
|
||||
+ g_io_stat_map[i].channel_id = channel_id;
|
||||
+ stat->io_stat_id = i;
|
||||
+ find = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ pthread_mutex_unlock(g_io_stat_map_mutex);
|
||||
+ }
|
||||
+ if (!find) {
|
||||
+ stat->io_stat_id = -1;
|
||||
+ SPDK_ERRLOG("channel %u bdev %s allocate io stat memory failed.\n", channel_id, bdev->name);
|
||||
+ }
|
||||
+ } else {
|
||||
+ /* It is not nvme disk, can use iostat. So do not do IO statistics in libstorage. */
|
||||
+ stat->io_stat_id = -1;
|
||||
+ }
|
||||
+ stat->start_tsc = spdk_get_ticks();
|
||||
+ stat->interval_tsc = spdk_get_ticks_hz() / 10;
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+spdk_bdev_destroy_iostat(struct spdk_bdev_channel *ch, struct spdk_bdev *bdev,
|
||||
+ struct spdk_io_channel *io_ch)
|
||||
+{
|
||||
+ int i = 0;
|
||||
+ uint16_t channel_id;
|
||||
+
|
||||
+ if (bdev->fn_table->get_io_channel_id) {
|
||||
+ channel_id = bdev->fn_table->get_io_channel_id(io_ch);
|
||||
+ for (i = 0; i < STAT_MAX_NUM; i++) {
|
||||
+ /* clear channel iostat info in share memory */
|
||||
+ if (g_io_stat_map[i].used && !strcmp(g_io_stat_map[i].bdev_name, bdev->name)
|
||||
+ && g_io_stat_map[i].channel_id == channel_id) {
|
||||
+ g_io_stat_map[i].channel_id = 0;
|
||||
+ memset(g_io_stat_map[i].bdev_name, 0, sizeof(g_io_stat_map[i].bdev_name));
|
||||
+ g_io_stat_map[i].num_read_ops = 0;
|
||||
+ g_io_stat_map[i].num_write_ops = 0;
|
||||
+ g_io_stat_map[i].bytes_read = 0;
|
||||
+ g_io_stat_map[i].bytes_written = 0;
|
||||
+ g_io_stat_map[i].io_outstanding = 0;
|
||||
+ g_io_stat_map[i].read_latency_ticks = 0;
|
||||
+ g_io_stat_map[i].write_latency_ticks = 0;
|
||||
+ g_io_stat_map[i].io_ticks = 0;
|
||||
+ /* used flag set false in last avoid race in channel create */
|
||||
+ g_io_stat_map[i].used = false;
|
||||
+ g_io_stat_map[i].poll_time_used = false;
|
||||
+ g_io_stat_map[i].num_poll_timeout = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+spdk_bdev_unmap_multiblocks(struct spdk_bdev_desc *desc, struct spdk_io_channel *ch,
|
||||
+ void *unmap_d, uint16_t unmap_count,
|
||||
+ spdk_bdev_io_completion_cb cb, void *cb_arg)
|
||||
+{
|
||||
+ struct spdk_bdev *bdev = spdk_bdev_desc_get_bdev(desc);
|
||||
+ struct spdk_bdev_io *bdev_io = NULL;
|
||||
+ struct spdk_bdev_channel *channel = spdk_io_channel_get_ctx(ch);
|
||||
+
|
||||
+ bdev_io = bdev_channel_get_io(channel);
|
||||
+ if (bdev_io == NULL) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ bdev_io->internal.ch = channel;
|
||||
+ bdev_io->internal.desc = desc;
|
||||
+ bdev_io->type = SPDK_BDEV_IO_TYPE_UNMAP_BLOCKS;
|
||||
+ bdev_io->u.contig.buf = unmap_d;
|
||||
+ bdev_io->u.contig.num_blocks = unmap_count;
|
||||
+ bdev_io_init(bdev_io, bdev, cb_arg, cb);
|
||||
+
|
||||
+ bdev_io_submit(bdev_io);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+bdev_io_stat_update(struct spdk_bdev_io *bdev_io, uint64_t tsc, struct spdk_bdev_io_stat *stat)
|
||||
+{
|
||||
+ switch (bdev_io->type) {
|
||||
+ case SPDK_BDEV_IO_TYPE_READ_NVME:
|
||||
+ stat->bytes_read += bdev_io->u.contig.nbytes + bdev_io->u.contig.md_len;
|
||||
+ stat->num_read_ops++;
|
||||
+ stat->read_latency_ticks += (tsc - bdev_io->internal.submit_tsc);
|
||||
+ break;
|
||||
+ case SPDK_BDEV_IO_TYPE_WRITE_NVME:
|
||||
+ stat->bytes_written += bdev_io->u.contig.nbytes + bdev_io->u.contig.md_len;
|
||||
+ stat->num_write_ops++;
|
||||
+ stat->write_latency_ticks += (tsc - bdev_io->internal.submit_tsc);
|
||||
+ break;
|
||||
+ case SPDK_BDEV_IO_TYPE_READV_NVME:
|
||||
+ stat->bytes_read += bdev_io->u.bdev.nbytes;
|
||||
+ stat->num_read_ops++;
|
||||
+ stat->read_latency_ticks += (tsc - bdev_io->internal.submit_tsc);
|
||||
+ break;
|
||||
+ case SPDK_BDEV_IO_TYPE_WRITEV_NVME:
|
||||
+ stat->bytes_written += bdev_io->u.bdev.nbytes;
|
||||
+ stat->num_write_ops++;
|
||||
+ stat->write_latency_ticks += (tsc - bdev_io->internal.submit_tsc);
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+bdev_update_iostat_map(struct spdk_bdev_io *bdev_io, uint64_t tsc, struct spdk_bdev_io_stat *stat,
|
||||
+ struct spdk_io_channel *channel, uint64_t io_outstanding)
|
||||
+{
|
||||
+ uint64_t num_poll_timeout;
|
||||
+
|
||||
+ stat->pre_ticks = stat->cur_ticks;
|
||||
+ stat->cur_ticks = tsc;
|
||||
+ stat->io_ticks += stat->cur_ticks - stat->pre_ticks;
|
||||
+
|
||||
+ if (g_libstorage_iostat) {
|
||||
+ if ((stat->io_stat_id >= 0) && (stat->io_stat_id < STAT_MAX_NUM)) {
|
||||
+ g_io_stat_map[stat->io_stat_id].io_outstanding = io_outstanding;
|
||||
+ if (tsc > (stat->start_tsc + stat->interval_tsc)) {
|
||||
+ g_io_stat_map[stat->io_stat_id].num_read_ops = stat->num_read_ops;
|
||||
+ g_io_stat_map[stat->io_stat_id].num_write_ops = stat->num_write_ops;
|
||||
+ g_io_stat_map[stat->io_stat_id].bytes_read = stat->bytes_read;
|
||||
+ g_io_stat_map[stat->io_stat_id].bytes_written = stat->bytes_written;
|
||||
+ g_io_stat_map[stat->io_stat_id].read_latency_ticks = stat->read_latency_ticks;
|
||||
+ g_io_stat_map[stat->io_stat_id].write_latency_ticks = stat->write_latency_ticks;
|
||||
+ g_io_stat_map[stat->io_stat_id].io_ticks = stat->io_ticks;
|
||||
+
|
||||
+ stat->start_tsc = tsc;
|
||||
+
|
||||
+ if (g_polltime_threshold) {
|
||||
+ num_poll_timeout = bdev_io->bdev->fn_table->get_timeout_count ? \
|
||||
+ bdev_io->bdev->fn_table->get_timeout_count(channel) : 0;
|
||||
+ g_io_stat_map[stat->io_stat_id].poll_time_used = true;
|
||||
+ g_io_stat_map[stat->io_stat_id].num_poll_timeout = num_poll_timeout;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,176 +0,0 @@
|
||||
From c359ae7d0ee0593b032f2e2543442fa9f6df3827 Mon Sep 17 00:00:00 2001
|
||||
From: sunshihao <sunshihao@huawei.com>
|
||||
Date: Mon, 22 Feb 2021 19:58:17 +0800
|
||||
Subject: [PATCH 19/27] lib/env_dpdk: Add config args for HSAK
|
||||
|
||||
Signed-off-by: sunshihao <sunshihao@huawei.com>
|
||||
---
|
||||
lib/env_dpdk/init.c | 7 +++++++
|
||||
lib/event/reactor.c | 36 +++++++++++++++++++++++++++++---
|
||||
lib/jsonrpc/jsonrpc_internal.h | 2 +-
|
||||
lib/jsonrpc/jsonrpc_server_tcp.c | 4 ++--
|
||||
4 files changed, 43 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/lib/env_dpdk/init.c b/lib/env_dpdk/init.c
|
||||
index e6464c9..3bb713d 100644
|
||||
--- a/lib/env_dpdk/init.c
|
||||
+++ b/lib/env_dpdk/init.c
|
||||
@@ -398,6 +398,13 @@ build_eal_cmdline(const struct spdk_env_opts *opts)
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ /* set IOVA use phys addr and keep same with DPDK16.11 */
|
||||
+ args = push_arg(args, &argcount, _sprintf_alloc("--iova-mode=pa"));
|
||||
+ if (args == NULL) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+#endif
|
||||
if (opts->iova_mode) {
|
||||
args = push_arg(args, &argcount, _sprintf_alloc("--iova-mode=%s", opts->iova_mode));
|
||||
if (args == NULL) {
|
||||
diff --git a/lib/event/reactor.c b/lib/event/reactor.c
|
||||
index 724371c..9fb9e0f 100644
|
||||
--- a/lib/event/reactor.c
|
||||
+++ b/lib/event/reactor.c
|
||||
@@ -42,6 +42,8 @@
|
||||
#include "spdk/util.h"
|
||||
#include "spdk/string.h"
|
||||
#include "spdk/fd_group.h"
|
||||
+#include "spdk_internal/thread.h"
|
||||
+#include "spdk/conf.h"
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/prctl.h>
|
||||
@@ -54,6 +56,10 @@
|
||||
|
||||
#define SPDK_EVENT_BATCH_SIZE 8
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+struct spdk_iodev_thread_info lcore_thread_info[RTE_MAX_LCORE];
|
||||
+#endif
|
||||
+
|
||||
static struct spdk_reactor *g_reactors;
|
||||
static uint32_t g_reactor_count;
|
||||
static struct spdk_cpuset g_reactor_core_mask;
|
||||
@@ -62,6 +68,7 @@ static enum spdk_reactor_state g_reactor_state = SPDK_REACTOR_STATE_UNINITIALIZE
|
||||
static bool g_framework_context_switch_monitor_enabled = true;
|
||||
|
||||
static struct spdk_mempool *g_spdk_event_mempool = NULL;
|
||||
+static int16_t g_reactor_batch_size = SPDK_EVENT_BATCH_SIZE;
|
||||
|
||||
TAILQ_HEAD(, spdk_scheduler) g_scheduler_list
|
||||
= TAILQ_HEAD_INITIALIZER(g_scheduler_list);
|
||||
@@ -250,6 +257,20 @@ spdk_reactors_init(void)
|
||||
uint32_t i, current_core;
|
||||
char mempool_name[32];
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ struct spdk_conf_section *sp;
|
||||
+ sp = spdk_conf_find_section(NULL, "Reactor");
|
||||
+ if (sp != 0) {
|
||||
+ g_reactor_batch_size = spdk_conf_section_get_intval(sp, "BatchSize");
|
||||
+ if (g_reactor_batch_size <= 0 || g_reactor_batch_size > SPDK_EVENT_BATCH_SIZE) {
|
||||
+ g_reactor_batch_size = SPDK_EVENT_BATCH_SIZE;
|
||||
+ }
|
||||
+ syslog(LOG_INFO,"BatchSize is set to %d\n", g_reactor_batch_size);
|
||||
+ } else {
|
||||
+ SPDK_ERRLOG("config file does not contain [Reactor] section, which need to be provided\n");
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
snprintf(mempool_name, sizeof(mempool_name), "evtpool_%d", getpid());
|
||||
g_spdk_event_mempool = spdk_mempool_create(mempool_name,
|
||||
262144 - 1, /* Power of 2 minus 1 is optimal for memory consumption */
|
||||
@@ -557,7 +578,7 @@ event_queue_run_batch(struct spdk_reactor *reactor)
|
||||
return -errno;
|
||||
}
|
||||
|
||||
- count = spdk_ring_dequeue(reactor->events, events, SPDK_EVENT_BATCH_SIZE);
|
||||
+ count = spdk_ring_dequeue(reactor->events, events, g_reactor_batch_size);
|
||||
|
||||
if (spdk_ring_count(reactor->events) != 0) {
|
||||
/* Trigger new notification if there are still events in event-queue waiting for processing. */
|
||||
@@ -568,7 +589,7 @@ event_queue_run_batch(struct spdk_reactor *reactor)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
- count = spdk_ring_dequeue(reactor->events, events, SPDK_EVENT_BATCH_SIZE);
|
||||
+ count = spdk_ring_dequeue(reactor->events, events, g_reactor_batch_size);
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
@@ -948,6 +969,9 @@ reactor_run(void *arg)
|
||||
}
|
||||
|
||||
if (g_reactor_state != SPDK_REACTOR_STATE_RUNNING) {
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ lcore_thread_info[reactor->lcore].state = SPDK_THREAD_STATE_EXITED;
|
||||
+#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1039,11 +1063,16 @@ spdk_reactors_start(void)
|
||||
spdk_cpuset_zero(&tmp_cpumask);
|
||||
spdk_cpuset_set_cpu(&tmp_cpumask, i, true);
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ lcore_thread_info[reactor->lcore].thread = spdk_thread_create(thread_name, &tmp_cpumask);
|
||||
+ lcore_thread_info[reactor->lcore].state = SPDK_THREAD_STATE_RUNNING;
|
||||
+#else
|
||||
spdk_thread_create(thread_name, &tmp_cpumask);
|
||||
+#endif
|
||||
}
|
||||
spdk_cpuset_set_cpu(&g_reactor_core_mask, i, true);
|
||||
}
|
||||
-
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
/* Start the main reactor */
|
||||
reactor = spdk_reactor_get(current_core);
|
||||
assert(reactor != NULL);
|
||||
@@ -1052,6 +1081,7 @@ spdk_reactors_start(void)
|
||||
spdk_env_thread_wait_all();
|
||||
|
||||
g_reactor_state = SPDK_REACTOR_STATE_SHUTDOWN;
|
||||
+#endif
|
||||
}
|
||||
|
||||
void
|
||||
diff --git a/lib/jsonrpc/jsonrpc_internal.h b/lib/jsonrpc/jsonrpc_internal.h
|
||||
index 4e5852e..331ee00 100644
|
||||
--- a/lib/jsonrpc/jsonrpc_internal.h
|
||||
+++ b/lib/jsonrpc/jsonrpc_internal.h
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
#include "spdk/log.h"
|
||||
|
||||
-#define SPDK_JSONRPC_RECV_BUF_SIZE (32 * 1024)
|
||||
+#define SPDK_JSONRPC_RECV_BUF_SIZE (4 * 1024 * 1024)
|
||||
#define SPDK_JSONRPC_SEND_BUF_SIZE_INIT (32 * 1024)
|
||||
#define SPDK_JSONRPC_SEND_BUF_SIZE_MAX (32 * 1024 * 1024)
|
||||
#define SPDK_JSONRPC_ID_MAX_LEN 128
|
||||
diff --git a/lib/jsonrpc/jsonrpc_server_tcp.c b/lib/jsonrpc/jsonrpc_server_tcp.c
|
||||
index 71f3b5c..5173aea 100644
|
||||
--- a/lib/jsonrpc/jsonrpc_server_tcp.c
|
||||
+++ b/lib/jsonrpc/jsonrpc_server_tcp.c
|
||||
@@ -319,7 +319,7 @@ jsonrpc_server_conn_recv(struct spdk_jsonrpc_server_conn *conn)
|
||||
}
|
||||
|
||||
offset += rc;
|
||||
- } while (rc > 0);
|
||||
+ } while (rc > 1000);
|
||||
|
||||
if (offset > 0) {
|
||||
/*
|
||||
@@ -375,7 +375,7 @@ more:
|
||||
return 0;
|
||||
}
|
||||
|
||||
- SPDK_DEBUGLOG(rpc, "send() failed: %s\n", spdk_strerror(errno));
|
||||
+ SPDK_ERRLOG("send() failed: %s\n", spdk_strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,122 +0,0 @@
|
||||
From 1447fa25369f107192be8fa9e5f21ec78f19dcf1 Mon Sep 17 00:00:00 2001
|
||||
From: sunshihao <sunshihao@huawei.com>
|
||||
Date: Mon, 1 Mar 2021 09:20:10 +0800
|
||||
Subject: [PATCH 22/27] use spdk_nvme_ns_cmd_dataset_management and delete
|
||||
spdk_nvme_ns_cmd_unmap_blocks
|
||||
|
||||
Signed-off-by: sunshihao520 <sunshihao@huawei.com>
|
||||
---
|
||||
include/spdk/nvme.h | 33 -----------------------------
|
||||
lib/nvme/nvme_ns_cmd.c | 35 -------------------------------
|
||||
module/bdev/nvme/bdev_nvme_self.c | 8 +++----
|
||||
3 files changed, 4 insertions(+), 72 deletions(-)
|
||||
|
||||
diff --git a/include/spdk/nvme.h b/include/spdk/nvme.h
|
||||
index 6393db3..9acfb89 100644
|
||||
--- a/include/spdk/nvme.h
|
||||
+++ b/include/spdk/nvme.h
|
||||
@@ -3549,39 +3549,6 @@ bool spdk_nvme_ns_pi_md_start(struct spdk_nvme_ns *ns);
|
||||
bool spdk_nvme_ns_is_dataset_mng_supported(struct spdk_nvme_ns *ns);
|
||||
uint16_t spdk_nvme_get_qpair_id(struct spdk_nvme_qpair *qpair);
|
||||
|
||||
-/**
|
||||
- * Submit a data set management request to the specified NVMe namespace. Data set
|
||||
- * management operations are designed to optimize interaction with the block
|
||||
- * translation layer inside the device. The most common type of operation is
|
||||
- * deallocate, which is often referred to as TRIM or UNMAP.
|
||||
- *
|
||||
- * The command is submitted to a qpair allocated by spdk_nvme_ctrlr_alloc_io_qpair().
|
||||
- * The user must ensure that only one thread submits I/O on a given qpair at any
|
||||
- * given time.
|
||||
- *
|
||||
- * This is a convenience wrapper that will automatically allocate and construct
|
||||
- * the correct data buffers. Therefore, ranges does not need to be allocated from
|
||||
- * pinned memory and can be placed on the stack. If a higher performance, zero-copy
|
||||
- * version of DSM is required, simply build and submit a raw command using
|
||||
- * spdk_nvme_ctrlr_cmd_io_raw().
|
||||
- *
|
||||
- * \param ns NVMe namespace to submit the DSM request
|
||||
- * \param type A bit field constructed from \ref spdk_nvme_dsm_attribute.
|
||||
- * \param qpair I/O queue pair to submit the request
|
||||
- * \param ranges An array of \ref spdk_nvme_dsm_range elements describing the LBAs
|
||||
- * to operate on.
|
||||
- * \param num_ranges The number of elements in the ranges array.
|
||||
- * \param cb_fn Callback function to invoke when the I/O is completed
|
||||
- * \param cb_arg Argument to pass to the callback function
|
||||
- *
|
||||
- * \return 0 if successfully submitted, negated POSIX errno values otherwise.
|
||||
- */
|
||||
-int spdk_nvme_ns_cmd_unmap_blocks(struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair,
|
||||
- uint32_t type,
|
||||
- const struct spdk_nvme_dsm_range *ranges,
|
||||
- uint16_t num_ranges,
|
||||
- spdk_nvme_cmd_cb cb_fn,
|
||||
- void *cb_arg);
|
||||
/**
|
||||
* \brief Submits a write I/O to the specified NVMe namespace.
|
||||
*
|
||||
diff --git a/lib/nvme/nvme_ns_cmd.c b/lib/nvme/nvme_ns_cmd.c
|
||||
index 37dcdc2..9b67b8e 100644
|
||||
--- a/lib/nvme/nvme_ns_cmd.c
|
||||
+++ b/lib/nvme/nvme_ns_cmd.c
|
||||
@@ -1221,38 +1221,3 @@ spdk_nvme_ns_cmd_reservation_report(struct spdk_nvme_ns *ns,
|
||||
|
||||
return nvme_qpair_submit_request(qpair, req);
|
||||
}
|
||||
-
|
||||
-#ifdef SPDK_CONFIG_APP_RW
|
||||
-int
|
||||
-spdk_nvme_ns_cmd_unmap_blocks(struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair,
|
||||
- uint32_t type,
|
||||
- const struct spdk_nvme_dsm_range *ranges, uint16_t num_ranges,
|
||||
- spdk_nvme_cmd_cb cb_fn, void *cb_arg)
|
||||
-{
|
||||
- struct nvme_request *req = NULL;
|
||||
- struct spdk_nvme_cmd *cmd = NULL;
|
||||
- struct nvme_payload payload;
|
||||
-
|
||||
- if (ranges == NULL) {
|
||||
- return -EINVAL;
|
||||
- }
|
||||
-
|
||||
- payload = NVME_PAYLOAD_CONTIG((void *)ranges, NULL);
|
||||
-
|
||||
- req = nvme_allocate_request(qpair, &payload, num_ranges * sizeof(struct spdk_nvme_dsm_range),
|
||||
- 0, cb_fn, cb_arg);
|
||||
- if (req == NULL) {
|
||||
- return -ENOMEM;
|
||||
- }
|
||||
-
|
||||
- req->user_cb_arg = cb_arg;
|
||||
-
|
||||
- cmd = &req->cmd;
|
||||
- cmd->opc = SPDK_NVME_OPC_DATASET_MANAGEMENT;
|
||||
- cmd->nsid = ns->id;
|
||||
-
|
||||
- cmd->cdw10 = num_ranges - 1;
|
||||
- cmd->cdw11 = type;
|
||||
-
|
||||
- return nvme_qpair_submit_request(qpair, req);
|
||||
-}
|
||||
diff --git a/module/bdev/nvme/bdev_nvme_self.c b/module/bdev/nvme/bdev_nvme_self.c
|
||||
index 7371ecb..1419b1f 100644
|
||||
--- a/module/bdev/nvme/bdev_nvme_self.c
|
||||
+++ b/module/bdev/nvme/bdev_nvme_self.c
|
||||
@@ -565,10 +565,10 @@ bdev_nvme_unmap_blocks(struct nvme_bdev *nbdev, struct spdk_io_channel *ch, void
|
||||
}
|
||||
|
||||
spdk_bdev_set_io_location(driver_ctx, (uint8_t)LOCAL_LIBSTORAGE_BDEV_NVME);
|
||||
- return spdk_nvme_ns_cmd_unmap_blocks(nbdev->nvme_ns->ns, nvme_ch->qpair,
|
||||
- SPDK_NVME_DSM_ATTR_DEALLOCATE,
|
||||
- unmap_d, unmap_count,
|
||||
- bdev_nvme_queued_done, driver_ctx);
|
||||
+ return spdk_nvme_ns_cmd_dataset_management(nbdev->nvme_ns->ns, nvme_ch->qpair,
|
||||
+ SPDK_NVME_DSM_ATTR_DEALLOCATE,
|
||||
+ unmap_d, unmap_count,
|
||||
+ bdev_nvme_queued_done, driver_ctx);
|
||||
}
|
||||
|
||||
void
|
||||
--
|
||||
2.33.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,55 +0,0 @@
|
||||
From 86162fca6435c4b5d98356f63ae32519fe485f02 Mon Sep 17 00:00:00 2001
|
||||
From: suweifeng <suweifeng1@huawei.com>
|
||||
Date: Mon, 17 May 2021 16:05:40 +0800
|
||||
Subject: [PATCH 24/27] Add CUSE switch for nvme ctrlr
|
||||
|
||||
Signed-off-by: suweifeng <suweifeng1@huawei.com>
|
||||
---
|
||||
module/bdev/nvme/bdev_nvme.c | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
diff --git a/module/bdev/nvme/bdev_nvme.c b/module/bdev/nvme/bdev_nvme.c
|
||||
index d291646..4f88e4e 100644
|
||||
--- a/module/bdev/nvme/bdev_nvme.c
|
||||
+++ b/module/bdev/nvme/bdev_nvme.c
|
||||
@@ -137,6 +137,9 @@ static struct spdk_thread *g_bdev_nvme_init_thread;
|
||||
static struct spdk_poller *g_hotplug_poller;
|
||||
static struct spdk_poller *g_hotplug_probe_poller;
|
||||
static struct spdk_nvme_probe_ctx *g_hotplug_probe_ctx;
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+bool g_useCUSE = false;
|
||||
+#endif
|
||||
|
||||
static void nvme_ctrlr_populate_namespaces(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr,
|
||||
struct nvme_async_probe_ctx *ctx);
|
||||
@@ -1694,6 +1697,12 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
|
||||
}
|
||||
|
||||
nvme_ctrlr_populate_namespaces(nvme_bdev_ctrlr, NULL);
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ /* register CUSE */
|
||||
+ if (g_useCUSE) {
|
||||
+ spdk_nvme_cuse_register(ctrlr);
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
free(name);
|
||||
}
|
||||
@@ -1720,6 +1729,14 @@ remove_cb(void *cb_ctx, struct spdk_nvme_ctrlr *ctrlr)
|
||||
return;
|
||||
}
|
||||
nvme_bdev_ctrlr->destruct = true;
|
||||
+
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ /* remove CUSE */
|
||||
+ if (g_useCUSE) {
|
||||
+ spdk_nvme_cuse_unregister(ctrlr);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
pthread_mutex_unlock(&g_bdev_nvme_mutex);
|
||||
_nvme_bdev_ctrlr_destruct(nvme_bdev_ctrlr);
|
||||
}
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,45 +0,0 @@
|
||||
From c6239a3dc45a7cb3fa245cdcb5f0641959159714 Mon Sep 17 00:00:00 2001
|
||||
From: suweifeng <suweifeng1@huawei.com>
|
||||
Date: Thu, 20 May 2021 16:41:01 +0800
|
||||
Subject: [PATCH 25/27] Adapt for ES3000 serial vendor special opcode in CUSE
|
||||
|
||||
With Huawei ES3000 serial NVMe PCIe SSD, Will send special opcode 0xC0
|
||||
to get self-define vendor logs, the data transfer field of opcode didn't
|
||||
follow NVMe 1.3/1.4 spec, So treat the opcode as bidirectional.
|
||||
All self-define opcode start with 0xC0.
|
||||
|
||||
Signed-off-by: suweifeng <suweifeng1@huawei.com>
|
||||
---
|
||||
include/spdk/nvme_spec.h | 1 +
|
||||
lib/nvme/nvme_cuse.c | 3 +++
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/include/spdk/nvme_spec.h b/include/spdk/nvme_spec.h
|
||||
index ca91c8b..8058ea0 100644
|
||||
--- a/include/spdk/nvme_spec.h
|
||||
+++ b/include/spdk/nvme_spec.h
|
||||
@@ -1345,6 +1345,7 @@ enum spdk_nvme_admin_opcode {
|
||||
SPDK_NVME_OPC_SANITIZE = 0x84,
|
||||
|
||||
SPDK_NVME_OPC_GET_LBA_STATUS = 0x86,
|
||||
+ SPDK_NVME_OPC_VENDOR = 0xC0,
|
||||
};
|
||||
|
||||
/**
|
||||
diff --git a/lib/nvme/nvme_cuse.c b/lib/nvme/nvme_cuse.c
|
||||
index 62d1422..3eccfd0 100644
|
||||
--- a/lib/nvme/nvme_cuse.c
|
||||
+++ b/lib/nvme/nvme_cuse.c
|
||||
@@ -154,6 +154,9 @@ cuse_nvme_admin_cmd_send(fuse_req_t req, struct nvme_admin_cmd *admin_cmd,
|
||||
|
||||
ctx->req = req;
|
||||
ctx->data_transfer = spdk_nvme_opc_get_data_transfer(admin_cmd->opcode);
|
||||
+ if (admin_cmd->opcode >= SPDK_NVME_OPC_VENDOR) {
|
||||
+ ctx->data_transfer = SPDK_NVME_DATA_BIDIRECTIONAL;
|
||||
+ }
|
||||
|
||||
memset(&ctx->nvme_cmd, 0, sizeof(ctx->nvme_cmd));
|
||||
ctx->nvme_cmd.opc = admin_cmd->opcode;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,182 +0,0 @@
|
||||
From d651f8a2385cc40232a9837fc3cf75014700da3e Mon Sep 17 00:00:00 2001
|
||||
From: Weifeng Su <suweifeng1@huawei.com>
|
||||
Date: Thu, 10 Jun 2021 10:29:51 +0800
|
||||
Subject: [PATCH] nvme/nvme_cuse: Fix race condition in cuse session
|
||||
|
||||
Conflict:NA
|
||||
Reference:https://github.com/spdk/spdk/commit/d651f8a2385cc40232a9837fc3cf75014700da3e
|
||||
|
||||
If we continuous setup and teardown cuse session, It will teardown
|
||||
uninitialized cuse session and cause segment fault, New function
|
||||
cuse_session_create will do the session create operation and under
|
||||
g_cuse_mtx to avoid this issue.
|
||||
|
||||
Signed-off-by: Weifeng Su <suweifeng1@huawei.com>
|
||||
Change-Id: I2b32e81c0990ede00eea6d4ed3a7e44d534d4df3
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8231
|
||||
Community-CI: Mellanox Build Bot
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
---
|
||||
lib/nvme/nvme_cuse.c | 61 ++++++++++++++++++++++++++++----------------
|
||||
1 file changed, 39 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/lib/nvme/nvme_cuse.c b/lib/nvme/nvme_cuse.c
|
||||
index 2a38ba4d2..9c3198ee5 100644
|
||||
--- a/lib/nvme/nvme_cuse.c
|
||||
+++ b/lib/nvme/nvme_cuse.c
|
||||
@@ -734,22 +734,14 @@ static const struct cuse_lowlevel_ops cuse_ns_clop = {
|
||||
.ioctl = cuse_ns_ioctl,
|
||||
};
|
||||
|
||||
-static void *
|
||||
-cuse_thread(void *arg)
|
||||
+static int cuse_session_create(struct cuse_device *cuse_device)
|
||||
{
|
||||
- struct cuse_device *cuse_device = arg;
|
||||
char *cuse_argv[] = { "cuse", "-f" };
|
||||
+ int multithreaded;
|
||||
int cuse_argc = SPDK_COUNTOF(cuse_argv);
|
||||
+ struct cuse_info ci;
|
||||
char devname_arg[128 + 8];
|
||||
const char *dev_info_argv[] = { devname_arg };
|
||||
- struct cuse_info ci;
|
||||
- int multithreaded;
|
||||
- int rc;
|
||||
- struct fuse_buf buf = { .mem = NULL };
|
||||
- struct pollfd fds;
|
||||
- int timeout_msecs = 500;
|
||||
-
|
||||
- spdk_unaffinitize_thread();
|
||||
|
||||
snprintf(devname_arg, sizeof(devname_arg), "DEVNAME=%s", cuse_device->dev_name);
|
||||
|
||||
@@ -765,12 +757,25 @@ cuse_thread(void *arg)
|
||||
cuse_device->session = cuse_lowlevel_setup(cuse_argc, cuse_argv, &ci, &cuse_ctrlr_clop,
|
||||
&multithreaded, cuse_device);
|
||||
}
|
||||
+
|
||||
if (!cuse_device->session) {
|
||||
SPDK_ERRLOG("Cannot create cuse session\n");
|
||||
- goto err;
|
||||
+ return -1;
|
||||
}
|
||||
-
|
||||
SPDK_NOTICELOG("fuse session for device %s created\n", cuse_device->dev_name);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void *
|
||||
+cuse_thread(void *arg)
|
||||
+{
|
||||
+ struct cuse_device *cuse_device = arg;
|
||||
+ int rc;
|
||||
+ struct fuse_buf buf = { .mem = NULL };
|
||||
+ struct pollfd fds;
|
||||
+ int timeout_msecs = 500;
|
||||
+
|
||||
+ spdk_unaffinitize_thread();
|
||||
|
||||
/* Receive and process fuse requests */
|
||||
fds.fd = fuse_session_fd(cuse_device->session);
|
||||
@@ -788,7 +793,6 @@ cuse_thread(void *arg)
|
||||
free(buf.mem);
|
||||
fuse_session_reset(cuse_device->session);
|
||||
cuse_lowlevel_teardown(cuse_device->session);
|
||||
-err:
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
@@ -817,13 +821,15 @@ cuse_nvme_ns_start(struct cuse_device *ctrlr_device, uint32_t nsid)
|
||||
free(ns_device);
|
||||
return -ENAMETOOLONG;
|
||||
}
|
||||
-
|
||||
+ rv = cuse_session_create(ns_device);
|
||||
+ if (rv != 0) {
|
||||
+ return rv;
|
||||
+ }
|
||||
rv = pthread_create(&ns_device->tid, NULL, cuse_thread, ns_device);
|
||||
if (rv != 0) {
|
||||
SPDK_ERRLOG("pthread_create failed\n");
|
||||
return -rv;
|
||||
}
|
||||
-
|
||||
ns_device->is_started = true;
|
||||
|
||||
return 0;
|
||||
@@ -916,8 +922,12 @@ cuse_nvme_ctrlr_stop(struct cuse_device *ctrlr_device)
|
||||
cuse_nvme_ns_stop(ctrlr_device, i);
|
||||
}
|
||||
|
||||
+ if (!ctrlr_device->is_started) {
|
||||
+ return;
|
||||
+ }
|
||||
fuse_session_exit(ctrlr_device->session);
|
||||
pthread_join(ctrlr_device->tid, NULL);
|
||||
+ ctrlr_device->is_started = false;
|
||||
TAILQ_REMOVE(&g_ctrlr_ctx_head, ctrlr_device, tailq);
|
||||
spdk_bit_array_clear(g_ctrlr_started, ctrlr_device->index);
|
||||
if (spdk_bit_array_count_set(g_ctrlr_started) == 0) {
|
||||
@@ -970,7 +980,7 @@ nvme_cuse_start(struct spdk_nvme_ctrlr *ctrlr)
|
||||
if (!ctrlr_device) {
|
||||
SPDK_ERRLOG("Cannot allocate memory for ctrlr_device.");
|
||||
rv = -ENOMEM;
|
||||
- goto err2;
|
||||
+ goto free_device;
|
||||
}
|
||||
|
||||
ctrlr_device->ctrlr = ctrlr;
|
||||
@@ -981,7 +991,7 @@ nvme_cuse_start(struct spdk_nvme_ctrlr *ctrlr)
|
||||
ctrlr_device->index = spdk_bit_array_find_first_clear(g_ctrlr_started, ctrlr_device->index);
|
||||
if (ctrlr_device->index == UINT32_MAX) {
|
||||
SPDK_ERRLOG("Too many registered controllers\n");
|
||||
- goto err2;
|
||||
+ goto free_device;
|
||||
}
|
||||
|
||||
if (nvme_cuse_claim(ctrlr_device, ctrlr_device->index) == 0) {
|
||||
@@ -993,12 +1003,19 @@ nvme_cuse_start(struct spdk_nvme_ctrlr *ctrlr)
|
||||
snprintf(ctrlr_device->dev_name, sizeof(ctrlr_device->dev_name), "spdk/nvme%d",
|
||||
ctrlr_device->index);
|
||||
|
||||
+ rv = cuse_session_create(ctrlr_device);
|
||||
+ if (rv != 0) {
|
||||
+ goto clear_and_free;
|
||||
+ }
|
||||
+
|
||||
rv = pthread_create(&ctrlr_device->tid, NULL, cuse_thread, ctrlr_device);
|
||||
if (rv != 0) {
|
||||
SPDK_ERRLOG("pthread_create failed\n");
|
||||
rv = -rv;
|
||||
- goto err3;
|
||||
+ goto clear_and_free;
|
||||
}
|
||||
+ ctrlr_device->is_started = true;
|
||||
+
|
||||
TAILQ_INSERT_TAIL(&g_ctrlr_ctx_head, ctrlr_device, tailq);
|
||||
|
||||
ctrlr_device->ns_devices = (struct cuse_device *)calloc(num_ns, sizeof(struct cuse_device));
|
||||
@@ -1007,14 +1024,14 @@ nvme_cuse_start(struct spdk_nvme_ctrlr *ctrlr)
|
||||
SPDK_ERRLOG("Cannot start CUSE namespace devices.");
|
||||
cuse_nvme_ctrlr_stop(ctrlr_device);
|
||||
rv = -1;
|
||||
- goto err3;
|
||||
+ goto clear_and_free;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
-err3:
|
||||
+clear_and_free:
|
||||
spdk_bit_array_clear(g_ctrlr_started, ctrlr_device->index);
|
||||
-err2:
|
||||
+free_device:
|
||||
free(ctrlr_device);
|
||||
if (spdk_bit_array_count_set(g_ctrlr_started) == 0) {
|
||||
spdk_bit_array_free(&g_ctrlr_started);
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
From 5f8b5846741c965b1b5ad7a8ca2960b20565d192 Mon Sep 17 00:00:00 2001
|
||||
From: suweifeng <suweifeng1@huawei.com>
|
||||
Date: Thu, 10 Jun 2021 11:25:17 +0800
|
||||
Subject: [PATCH 27/27] Change log level in poll timeout
|
||||
|
||||
Change to 'NOTICE' log level in poll timeout
|
||||
|
||||
Signed-off-by: suweifeng <suweifeng1@huawei.com>
|
||||
---
|
||||
module/bdev/nvme/bdev_nvme_self.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/module/bdev/nvme/bdev_nvme_self.c b/module/bdev/nvme/bdev_nvme_self.c
|
||||
index dc480ff..cba129e 100644
|
||||
--- a/module/bdev/nvme/bdev_nvme_self.c
|
||||
+++ b/module/bdev/nvme/bdev_nvme_self.c
|
||||
@@ -36,7 +36,7 @@ void bdev_update_ch_timeout(struct nvme_bdev_poll_group *group)
|
||||
poll_time = (poll_ticks * 1000ULL) / spdk_get_ticks_hz();
|
||||
if (poll_time >= g_polltime_threshold) {
|
||||
group->num_poll_timeout++;
|
||||
- SPDK_WARNLOG("group[%p] poll timeout in %ldms", group, poll_time);
|
||||
+ SPDK_NOTICELOG("group[%p] poll timeout in %ldms", group, poll_time);
|
||||
}
|
||||
}
|
||||
group->save_start_ticks = current_ticks;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,111 +0,0 @@
|
||||
From 1fc649fe351919c60c7e1e5044bd6fb00ce59edd Mon Sep 17 00:00:00 2001
|
||||
From: Jim Harris <james.r.harris@intel.com>
|
||||
Date: Fri, 12 Aug 2022 05:00:25 +0000
|
||||
Subject: [PATCH] configure: add CONFIG_HAVE_ARC4RANDOM
|
||||
|
||||
glibc 2.36 added arc4random(), which breaks
|
||||
the SPDK iSCSI build since it always implements its
|
||||
own arc4random() implementation on non-FreeBSD OS
|
||||
(meaning always on Linux).
|
||||
|
||||
So instead add a CONFIG_HAVE_ARC4RANDOM and remove
|
||||
the explicit FreeBSD dependency - this will work on
|
||||
FreeBSD as well as Linux with >= glibc 2.36.
|
||||
|
||||
Also fix check_format.sh, so that it does not
|
||||
enforce spdk/stdinc.h checks on code snippets in
|
||||
the configure file.
|
||||
|
||||
Fixes issue #2637.
|
||||
|
||||
Reported-by: Karl Bonde Torp <k.torp@samsung.com>
|
||||
Signed-off-by: Jim Harris <james.r.harris@intel.com>
|
||||
Change-Id: Iab9da8ae30d62a56869530846372ffddf7138eed
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14028
|
||||
Community-CI: Mellanox Build Bot
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Reviewed-by: Dong Yi <dongx.yi@intel.com>
|
||||
|
||||
Confilict: file CONFIG context is inconsistent
|
||||
---
|
||||
CONFIG | 3 +++
|
||||
configure | 5 +++++
|
||||
lib/iscsi/iscsi.c | 5 ++---
|
||||
scripts/check_format.sh | 2 +-
|
||||
4 files changed, 11 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/CONFIG b/CONFIG
|
||||
index 214e59e..b8dde2e 100644
|
||||
--- a/CONFIG
|
||||
+++ b/CONFIG
|
||||
@@ -171,3 +171,6 @@ CONFIG_RAID5=n
|
||||
|
||||
# Build with IDXD support
|
||||
CONFIG_IDXD=n
|
||||
+
|
||||
+# arc4random is available in stdlib.h
|
||||
+CONFIG_HAVE_ARC4RANDOM=n
|
||||
diff --git a/configure b/configure
|
||||
index 01db27a..376019c 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -750,6 +750,11 @@ if [[ "${CONFIG[TSAN]}" = "y" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
+if echo -e '#include <stdlib.h>\nint main(void) { arc4random(); return 0; }\n' \
|
||||
+ | "${BUILD_CMD[@]}" - 2> /dev/null; then
|
||||
+ CONFIG[HAVE_ARC4RANDOM]="y"
|
||||
+fi
|
||||
+
|
||||
if [[ "${CONFIG[OCF]}" = "y" ]]; then
|
||||
# If OCF_PATH is a file, assume it is a library and use it to compile with
|
||||
if [ -f ${CONFIG[OCF_PATH]} ]; then
|
||||
diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c
|
||||
index 4bca616..48e548a 100644
|
||||
--- a/lib/iscsi/iscsi.c
|
||||
+++ b/lib/iscsi/iscsi.c
|
||||
@@ -64,7 +64,6 @@
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define HAVE_SRANDOMDEV 1
|
||||
-#define HAVE_ARC4RANDOM 1
|
||||
#endif
|
||||
|
||||
struct spdk_iscsi_globals g_iscsi = {
|
||||
@@ -99,7 +98,7 @@ srandomdev(void)
|
||||
}
|
||||
#endif /* HAVE_SRANDOMDEV */
|
||||
|
||||
-#ifndef HAVE_ARC4RANDOM
|
||||
+#ifndef SPDK_CONFIG_HAVE_ARC4RANDOM
|
||||
static int g_arc4random_initialized = 0;
|
||||
|
||||
static uint32_t
|
||||
@@ -117,7 +116,7 @@ arc4random(void)
|
||||
r = (r1 << 16) | r2;
|
||||
return r;
|
||||
}
|
||||
-#endif /* HAVE_ARC4RANDOM */
|
||||
+#endif /* SPDK_CONFIG_HAVE_ARC4RANDOM */
|
||||
|
||||
static void
|
||||
gen_random(uint8_t *buf, size_t len)
|
||||
diff --git a/scripts/check_format.sh b/scripts/check_format.sh
|
||||
index b522115..8c242a7 100755
|
||||
--- a/scripts/check_format.sh
|
||||
+++ b/scripts/check_format.sh
|
||||
@@ -240,7 +240,7 @@ function check_posix_includes() {
|
||||
local rc=0
|
||||
|
||||
echo -n "Checking for POSIX includes..."
|
||||
- git grep -I -i -f scripts/posix.txt -- './*' ':!include/spdk/stdinc.h' ':!include/linux/**' ':!lib/rte_vhost*/**' ':!scripts/posix.txt' ':!*.patch' > scripts/posix.log || true
|
||||
+ git grep -I -i -f scripts/posix.txt -- './*' ':!include/spdk/stdinc.h' ':!include/linux/**' ':!lib/rte_vhost*/**' ':!scripts/posix.txt' ':!*.patch' ':!configure' > scripts/posix.log || true
|
||||
if [ -s scripts/posix.log ]; then
|
||||
echo "POSIX includes detected. Please include spdk/stdinc.h instead."
|
||||
cat scripts/posix.log
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,340 +0,0 @@
|
||||
From 344a408a5ff466f530e6788341e308f9193011cd Mon Sep 17 00:00:00 2001
|
||||
From: Weifeng Su <suweifeng1@huawei.com>
|
||||
Date: Tue, 1 Nov 2022 20:41:17 +0800
|
||||
Subject: [PATCH] Enable unittest in make check
|
||||
|
||||
To adapt to unittest, the following modifications are made:
|
||||
1.Enable unittest compilation and remove --disable-unit-tests configuration item.
|
||||
2.To eliminate the weak reference of spdk_log,add a reference to log.c in spdk.unittest.mk.
|
||||
3.Use CONFIG_APP_RW to add some adaptation codes to the bdev and nvme cases.
|
||||
4.Use CONFIG_APP_RW in the unittest.sh file to shield the execution of cases that are incompatible with --enable-raw.
|
||||
|
||||
Signed-off-by: Weifeng Su <suweifeng1@huawei.com>
|
||||
---
|
||||
mk/spdk.unittest.mk | 3 +++
|
||||
test/common/autotest_common.sh | 10 +++++++++-
|
||||
test/unit/lib/Makefile | 4 ++++
|
||||
test/unit/lib/bdev/bdev.c/bdev_ut.c | 3 +++
|
||||
test/unit/lib/bdev/mt/bdev.c/bdev_ut.c | 3 +++
|
||||
test/unit/lib/bdev/part.c/part_ut.c | 3 +++
|
||||
test/unit/lib/nvme/Makefile | 8 ++++++--
|
||||
test/unit/lib/nvme/nvme.c/nvme_ut.c | 5 +++++
|
||||
.../lib/nvme/nvme_ctrlr.c/nvme_ctrlr_ut.c | 3 +++
|
||||
test/unit/lib/nvme/nvme_pcie.c/nvme_pcie_ut.c | 7 +++++++
|
||||
test/unit/lib/scsi/Makefile | 4 ++++
|
||||
test/unit/lib/util/Makefile | 5 +++++
|
||||
test/unit/unittest.sh | 19 ++++++++++++++++++-
|
||||
13 files changed, 73 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/mk/spdk.unittest.mk b/mk/spdk.unittest.mk
|
||||
index 01d2bc3..d362ba9 100644
|
||||
--- a/mk/spdk.unittest.mk
|
||||
+++ b/mk/spdk.unittest.mk
|
||||
@@ -50,6 +50,9 @@ CFLAGS += -I$(SPDK_ROOT_DIR)/lib
|
||||
CFLAGS += -I$(SPDK_ROOT_DIR)/module
|
||||
CFLAGS += -I$(SPDK_ROOT_DIR)/test
|
||||
CFLAGS += -ffunction-sections
|
||||
+ifeq ($(CONFIG_APP_RW), y)
|
||||
+CFLAGS += -include$(SPDK_ROOT_DIR)/lib/log/log.c
|
||||
+endif
|
||||
LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
SPDK_LIB_LIST += thread util log
|
||||
diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh
|
||||
index 8fc383f..6865698 100755
|
||||
--- a/test/common/autotest_common.sh
|
||||
+++ b/test/common/autotest_common.sh
|
||||
@@ -160,7 +160,11 @@ export UBSAN_OPTIONS='halt_on_error=1:print_stacktrace=1:abort_on_error=1'
|
||||
# Export LeakSanitizer option to use suppression file in order to prevent false positives
|
||||
# and known leaks in external executables or libraries from showing up.
|
||||
asan_suppression_file="/var/tmp/asan_suppression_file"
|
||||
-sudo rm -rf "$asan_suppression_file"
|
||||
+if [ $CONFIG_APP_RW == 'y' ]; then
|
||||
+ rm -rf "$asan_suppression_file"
|
||||
+else
|
||||
+ sudo rm -rf "$asan_suppression_file"
|
||||
+fi
|
||||
cat << EOL >> "$asan_suppression_file"
|
||||
# ASAN has some bugs around thread_local variables. We have a destructor in place
|
||||
# to free the thread contexts, but ASAN complains about the leak before those
|
||||
@@ -309,6 +313,10 @@ function set_test_storage() {
|
||||
mount=$(df "$target_dir" | awk '$1 !~ /Filesystem/{print $6}')
|
||||
|
||||
target_space=${avails["$mount"]}
|
||||
+ if [ $CONFIG_APP_RW == 'y' ]; then
|
||||
+ export SPDK_TEST_STORAGE=$target_dir
|
||||
+ return 0
|
||||
+ fi
|
||||
if ((target_space == 0 || target_space < requested_size)); then
|
||||
continue
|
||||
fi
|
||||
diff --git a/test/unit/lib/Makefile b/test/unit/lib/Makefile
|
||||
index aa2d707..ac8f66c 100644
|
||||
--- a/test/unit/lib/Makefile
|
||||
+++ b/test/unit/lib/Makefile
|
||||
@@ -34,7 +34,11 @@
|
||||
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
|
||||
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
||||
|
||||
+ifeq ($(CONFIG_APP_RW), y)
|
||||
+DIRS-y = bdev blob blobfs event ioat iscsi json jsonrpc lvol
|
||||
+else
|
||||
DIRS-y = bdev blob blobfs event ioat iscsi json jsonrpc log lvol
|
||||
+endif
|
||||
DIRS-y += notify nvme nvmf scsi sock thread util
|
||||
DIRS-$(CONFIG_IDXD) += idxd
|
||||
DIRS-$(CONFIG_REDUCE) += reduce
|
||||
diff --git a/test/unit/lib/bdev/bdev.c/bdev_ut.c b/test/unit/lib/bdev/bdev.c/bdev_ut.c
|
||||
index f210692..159a01a 100644
|
||||
--- a/test/unit/lib/bdev/bdev.c/bdev_ut.c
|
||||
+++ b/test/unit/lib/bdev/bdev.c/bdev_ut.c
|
||||
@@ -41,6 +41,9 @@
|
||||
#undef SPDK_CONFIG_VTUNE
|
||||
|
||||
#include "bdev/bdev.c"
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+#include "bdev/bdev_self.c"
|
||||
+#endif
|
||||
|
||||
struct spdk_trace_histories *g_trace_histories;
|
||||
DEFINE_STUB_V(spdk_trace_add_register_fn, (struct spdk_trace_register_fn *reg_fn));
|
||||
diff --git a/test/unit/lib/bdev/mt/bdev.c/bdev_ut.c b/test/unit/lib/bdev/mt/bdev.c/bdev_ut.c
|
||||
index 238823e..80d86cb 100644
|
||||
--- a/test/unit/lib/bdev/mt/bdev.c/bdev_ut.c
|
||||
+++ b/test/unit/lib/bdev/mt/bdev.c/bdev_ut.c
|
||||
@@ -41,6 +41,9 @@
|
||||
#undef SPDK_CONFIG_VTUNE
|
||||
|
||||
#include "bdev/bdev.c"
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+#include "bdev/bdev_self.c"
|
||||
+#endif
|
||||
|
||||
#define BDEV_UT_NUM_THREADS 3
|
||||
|
||||
diff --git a/test/unit/lib/bdev/part.c/part_ut.c b/test/unit/lib/bdev/part.c/part_ut.c
|
||||
index 2258c71..15bc5d7 100644
|
||||
--- a/test/unit/lib/bdev/part.c/part_ut.c
|
||||
+++ b/test/unit/lib/bdev/part.c/part_ut.c
|
||||
@@ -41,6 +41,9 @@
|
||||
#undef SPDK_CONFIG_VTUNE
|
||||
|
||||
#include "bdev/bdev.c"
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+#include "bdev/bdev_self.c"
|
||||
+#endif
|
||||
#include "bdev/part.c"
|
||||
|
||||
struct spdk_trace_histories *g_trace_histories;
|
||||
diff --git a/test/unit/lib/nvme/Makefile b/test/unit/lib/nvme/Makefile
|
||||
index 5f74579..7ca1632 100644
|
||||
--- a/test/unit/lib/nvme/Makefile
|
||||
+++ b/test/unit/lib/nvme/Makefile
|
||||
@@ -33,9 +33,13 @@
|
||||
|
||||
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..)
|
||||
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
||||
-
|
||||
+ifeq ($(CONFIG_APP_RW), y)
|
||||
+DIRS-y = nvme.c nvme_ctrlr.c nvme_ctrlr_cmd.c nvme_ctrlr_ocssd_cmd.c nvme_ns.c nvme_ns_cmd.c nvme_ns_ocssd_cmd.c nvme_pcie.c nvme_poll_group.c nvme_qpair.c \
|
||||
+ nvme_quirks.c nvme_tcp.c
|
||||
+else
|
||||
DIRS-y = nvme.c nvme_ctrlr.c nvme_ctrlr_cmd.c nvme_ctrlr_ocssd_cmd.c nvme_ns.c nvme_ns_cmd.c nvme_ns_ocssd_cmd.c nvme_pcie.c nvme_poll_group.c nvme_qpair.c \
|
||||
- nvme_quirks.c nvme_tcp.c nvme_uevent.c \
|
||||
+ nvme_quirks.c nvme_tcp.c nvme_uevent.c
|
||||
+endif
|
||||
|
||||
DIRS-$(CONFIG_RDMA) += nvme_rdma.c
|
||||
|
||||
diff --git a/test/unit/lib/nvme/nvme.c/nvme_ut.c b/test/unit/lib/nvme/nvme.c/nvme_ut.c
|
||||
index bef45c6..cd2b82d 100644
|
||||
--- a/test/unit/lib/nvme/nvme.c/nvme_ut.c
|
||||
+++ b/test/unit/lib/nvme/nvme.c/nvme_ut.c
|
||||
@@ -67,6 +67,11 @@ DEFINE_STUB(nvme_uevent_connect, int, (void), 1);
|
||||
DEFINE_STUB(spdk_nvme_poll_group_process_completions, int64_t, (struct spdk_nvme_poll_group *group,
|
||||
uint32_t completions_per_qpair, spdk_nvme_disconnected_qpair_cb disconnected_qpair_cb), 0);
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+DEFINE_STUB(spdk_nvme_ctrlr_process_admin_completions, int32_t, (struct spdk_nvme_ctrlr *ctrlr), 0);
|
||||
+DEFINE_STUB_V(spdk_output_debug_info, (void));
|
||||
+#endif
|
||||
+
|
||||
static bool ut_destruct_called = false;
|
||||
void
|
||||
nvme_ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr)
|
||||
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 16a4c1b..9a1fb5a 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
|
||||
@@ -40,6 +40,9 @@
|
||||
#include "common/lib/test_env.c"
|
||||
|
||||
#include "nvme/nvme_ctrlr.c"
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+#include "nvme/nvme_ctrlr_self.c"
|
||||
+#endif
|
||||
#include "nvme/nvme_quirks.c"
|
||||
|
||||
SPDK_LOG_REGISTER_COMPONENT(nvme)
|
||||
diff --git a/test/unit/lib/nvme/nvme_pcie.c/nvme_pcie_ut.c b/test/unit/lib/nvme/nvme_pcie.c/nvme_pcie_ut.c
|
||||
index 5956bce..55d2048 100644
|
||||
--- a/test/unit/lib/nvme/nvme_pcie.c/nvme_pcie_ut.c
|
||||
+++ b/test/unit/lib/nvme/nvme_pcie.c/nvme_pcie_ut.c
|
||||
@@ -75,6 +75,11 @@ DEFINE_STUB(spdk_pci_device_get_id, struct spdk_pci_id, (struct spdk_pci_device
|
||||
|
||||
DEFINE_STUB(nvme_uevent_connect, int, (void), 0);
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+DEFINE_STUB(nvme_qpair_check_enabled, bool, (struct spdk_nvme_qpair *qpair), true);
|
||||
+DEFINE_STUB_V(nvme_qpair_abort_reqs, (struct spdk_nvme_qpair *qpair,uint32_t dnr));
|
||||
+#endif
|
||||
+
|
||||
SPDK_LOG_REGISTER_COMPONENT(nvme)
|
||||
|
||||
struct nvme_driver *g_spdk_nvme_driver = NULL;
|
||||
@@ -309,6 +314,7 @@ test_nvme_pcie_hotplug_monitor(void)
|
||||
TAILQ_INIT(&driver.shared_attached_ctrlrs);
|
||||
g_spdk_nvme_driver = &driver;
|
||||
|
||||
+#ifndef SPDK_CONFIG_APP_RW
|
||||
/* Case 1: SPDK_NVME_UEVENT_ADD/ NVME_VFIO */
|
||||
entry.uevent.subsystem = SPDK_NVME_UEVENT_SUBSYSTEM_VFIO;
|
||||
entry.uevent.action = SPDK_NVME_UEVENT_ADD;
|
||||
@@ -385,6 +391,7 @@ test_nvme_pcie_hotplug_monitor(void)
|
||||
_nvme_pcie_hotplug_monitor(&test_nvme_probe_ctx);
|
||||
|
||||
CU_ASSERT(pctrlr.ctrlr.is_failed == true);
|
||||
+#endif
|
||||
|
||||
pthread_mutex_destroy(&driver.lock);
|
||||
pthread_mutexattr_destroy(&attr);
|
||||
diff --git a/test/unit/lib/scsi/Makefile b/test/unit/lib/scsi/Makefile
|
||||
index 8044d3f..54ddcb7 100644
|
||||
--- a/test/unit/lib/scsi/Makefile
|
||||
+++ b/test/unit/lib/scsi/Makefile
|
||||
@@ -34,7 +34,11 @@
|
||||
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..)
|
||||
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
||||
|
||||
+ifeq ($(CONFIG_APP_RW), y)
|
||||
+DIRS-y = dev.c lun.c scsi.c scsi_bdev.c
|
||||
+else
|
||||
DIRS-y = dev.c lun.c scsi.c scsi_bdev.c scsi_pr.c
|
||||
+endif
|
||||
|
||||
.PHONY: all clean $(DIRS-y)
|
||||
|
||||
diff --git a/test/unit/lib/util/Makefile b/test/unit/lib/util/Makefile
|
||||
index 2217157..eb0a4c5 100644
|
||||
--- a/test/unit/lib/util/Makefile
|
||||
+++ b/test/unit/lib/util/Makefile
|
||||
@@ -34,8 +34,13 @@
|
||||
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..)
|
||||
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
|
||||
|
||||
+ifeq ($(CONFIG_APP_RW), y)
|
||||
+DIRS-y = base64.c bit_array.c cpuset.c crc16.c crc32_ieee.c crc32c.c dif.c \
|
||||
+ iov.c pipe.c string.c
|
||||
+else
|
||||
DIRS-y = base64.c bit_array.c cpuset.c crc16.c crc32_ieee.c crc32c.c dif.c \
|
||||
iov.c math.c pipe.c string.c
|
||||
+endif
|
||||
|
||||
.PHONY: all clean $(DIRS-y)
|
||||
|
||||
diff --git a/test/unit/unittest.sh b/test/unit/unittest.sh
|
||||
index 91b249c..444bb24 100755
|
||||
--- a/test/unit/unittest.sh
|
||||
+++ b/test/unit/unittest.sh
|
||||
@@ -11,9 +11,12 @@ rootdir=$(readlink -f $(dirname $0)/../..)
|
||||
source "$rootdir/test/common/autotest_common.sh"
|
||||
|
||||
cd "$rootdir"
|
||||
+enable_raw=`grep '#define SPDK_CONFIG_APP_RW 1' $rootdir/include/spdk/config.h`
|
||||
|
||||
function unittest_bdev() {
|
||||
+ if [ -z ${enable_raw} ]; then
|
||||
$valgrind $testdir/lib/bdev/bdev.c/bdev_ut
|
||||
+ fi
|
||||
$valgrind $testdir/lib/bdev/bdev_ocssd.c/bdev_ocssd_ut
|
||||
$valgrind $testdir/lib/bdev/raid/bdev_raid.c/bdev_raid_ut
|
||||
$valgrind $testdir/lib/bdev/bdev_zone.c/bdev_zone_ut
|
||||
@@ -22,13 +25,15 @@ function unittest_bdev() {
|
||||
$valgrind $testdir/lib/bdev/scsi_nvme.c/scsi_nvme_ut
|
||||
$valgrind $testdir/lib/bdev/vbdev_lvol.c/vbdev_lvol_ut
|
||||
$valgrind $testdir/lib/bdev/vbdev_zone_block.c/vbdev_zone_block_ut
|
||||
+ if [ -z ${enable_raw} ]; then
|
||||
$valgrind $testdir/lib/bdev/mt/bdev.c/bdev_ut
|
||||
+ fi
|
||||
}
|
||||
|
||||
function unittest_blob() {
|
||||
# We do not compile blob_ut on systems with too old Cunit, so do
|
||||
# not try to execute it if it doesn't exist
|
||||
- if [[ -e $testdir/lib/blob/blob.c/blob_ut ]]; then
|
||||
+ if [[ -z ${enable_raw} && -e $testdir/lib/blob/blob.c/blob_ut ]]; then
|
||||
$valgrind $testdir/lib/blob/blob.c/blob_ut
|
||||
fi
|
||||
$valgrind $testdir/lib/blobfs/tree.c/tree_ut
|
||||
@@ -82,14 +87,18 @@ function unittest_nvme() {
|
||||
$valgrind $testdir/lib/nvme/nvme_poll_group.c/nvme_poll_group_ut
|
||||
$valgrind $testdir/lib/nvme/nvme_quirks.c/nvme_quirks_ut
|
||||
$valgrind $testdir/lib/nvme/nvme_tcp.c/nvme_tcp_ut
|
||||
+ if [ -z ${enable_raw} ]; then
|
||||
$valgrind $testdir/lib/nvme/nvme_uevent.c/nvme_uevent_ut
|
||||
+ fi
|
||||
}
|
||||
|
||||
function unittest_nvmf() {
|
||||
$valgrind $testdir/lib/nvmf/ctrlr.c/ctrlr_ut
|
||||
$valgrind $testdir/lib/nvmf/ctrlr_bdev.c/ctrlr_bdev_ut
|
||||
$valgrind $testdir/lib/nvmf/ctrlr_discovery.c/ctrlr_discovery_ut
|
||||
+ if [ -z ${enable_raw} ]; then
|
||||
$valgrind $testdir/lib/nvmf/subsystem.c/subsystem_ut
|
||||
+ fi
|
||||
$valgrind $testdir/lib/nvmf/tcp.c/tcp_ut
|
||||
}
|
||||
|
||||
@@ -98,7 +107,9 @@ function unittest_scsi() {
|
||||
$valgrind $testdir/lib/scsi/lun.c/lun_ut
|
||||
$valgrind $testdir/lib/scsi/scsi.c/scsi_ut
|
||||
$valgrind $testdir/lib/scsi/scsi_bdev.c/scsi_bdev_ut
|
||||
+ if [ -z ${enable_raw} ]; then
|
||||
$valgrind $testdir/lib/scsi/scsi_pr.c/scsi_pr_ut
|
||||
+ fi
|
||||
}
|
||||
|
||||
function unittest_sock() {
|
||||
@@ -120,7 +131,9 @@ function unittest_util() {
|
||||
$valgrind $testdir/lib/util/string.c/string_ut
|
||||
$valgrind $testdir/lib/util/dif.c/dif_ut
|
||||
$valgrind $testdir/lib/util/iov.c/iov_ut
|
||||
+ if [ -z ${enable_raw} ]; then
|
||||
$valgrind $testdir/lib/util/math.c/math_ut
|
||||
+ fi
|
||||
$valgrind $testdir/lib/util/pipe.c/pipe_ut
|
||||
}
|
||||
|
||||
@@ -200,7 +213,9 @@ run_test "unittest_iscsi" unittest_iscsi
|
||||
run_test "unittest_json" unittest_json
|
||||
run_test "unittest_notify" $valgrind $testdir/lib/notify/notify.c/notify_ut
|
||||
run_test "unittest_nvme" unittest_nvme
|
||||
+if [ -z ${enable_raw} ]; then
|
||||
run_test "unittest_log" $valgrind $testdir/lib/log/log.c/log_ut
|
||||
+fi
|
||||
run_test "unittest_lvol" $valgrind $testdir/lib/lvol/lvol.c/lvol_ut
|
||||
if grep -q '#define SPDK_CONFIG_RDMA 1' $rootdir/include/spdk/config.h; then
|
||||
run_test "unittest_nvme_rdma" $valgrind $testdir/lib/nvme/nvme_rdma.c/nvme_rdma_ut
|
||||
@@ -218,7 +233,9 @@ fi
|
||||
|
||||
run_test "unittest_scsi" unittest_scsi
|
||||
run_test "unittest_sock" unittest_sock
|
||||
+if [ -z ${enable_raw} ]; then
|
||||
run_test "unittest_thread" $valgrind $testdir/lib/thread/thread.c/thread_ut
|
||||
+fi
|
||||
run_test "unittest_util" unittest_util
|
||||
if grep -q '#define SPDK_CONFIG_VHOST 1' $rootdir/include/spdk/config.h; then
|
||||
run_test "unittest_vhost" $valgrind $testdir/lib/vhost/vhost.c/vhost_ut
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
From ade8e6254cb8720446dd38e2a29408ac57d7d5e6 Mon Sep 17 00:00:00 2001
|
||||
From: zhanghongtao <zhanghongtao22@huawei.com>
|
||||
Date: Wed, 7 Sep 2022 17:08:29 +0800
|
||||
Subject: [PATCH] nvme_ctrlr_abort_queued_aborts Segmentation fault occurs due
|
||||
to recursion
|
||||
|
||||
When ctrlr destruct,we need to abort queued aborts.
|
||||
Function nvme_ctrlr_abort_queued_aborts has a recursive call,
|
||||
ctrlr->queued_aborts has been processed in recursion.
|
||||
|
||||
Signed-off-by: zhanghongtao <zhanghongtao22@huawei.com>
|
||||
---
|
||||
lib/nvme/nvme_ctrlr.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/lib/nvme/nvme_ctrlr.c b/lib/nvme/nvme_ctrlr.c
|
||||
index 6c25f0d..a84affb 100644
|
||||
--- a/lib/nvme/nvme_ctrlr.c
|
||||
+++ b/lib/nvme/nvme_ctrlr.c
|
||||
@@ -1344,7 +1344,15 @@ nvme_ctrlr_abort_queued_aborts(struct spdk_nvme_ctrlr *ctrlr)
|
||||
struct nvme_request *req, *tmp;
|
||||
struct spdk_nvme_cpl cpl = {};
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ if (ctrlr->is_destructed == true) {
|
||||
+ cpl.status.sc = SPDK_NVME_SC_SUCCESS;
|
||||
+ } else {
|
||||
+ cpl.status.sc = SPDK_NVME_SC_ABORTED_SQ_DELETION;
|
||||
+ }
|
||||
+#else
|
||||
cpl.status.sc = SPDK_NVME_SC_ABORTED_SQ_DELETION;
|
||||
+#endif
|
||||
cpl.status.sct = SPDK_NVME_SCT_GENERIC;
|
||||
|
||||
STAILQ_FOREACH_SAFE(req, &ctrlr->queued_aborts, stailq, tmp) {
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
From 9c74cca9c8572dabe472d0f2b033bdc84dfb8882 Mon Sep 17 00:00:00 2001
|
||||
From: zhanghongtao <zhanghongtao22@huawei.com>
|
||||
Date: Tue, 25 Oct 2022 16:24:44 +0800
|
||||
Subject: [PATCH] Fix UAF in STAILQ_FOREACH
|
||||
|
||||
function spdk_nvme_ctrlr_free_io_qpair will free and memset qpair,
|
||||
The loop variable is destroyed in the loop.
|
||||
---
|
||||
lib/nvme/nvme_transport.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/lib/nvme/nvme_transport.c b/lib/nvme/nvme_transport.c
|
||||
index 3050163..c35f29f 100644
|
||||
--- a/lib/nvme/nvme_transport.c
|
||||
+++ b/lib/nvme/nvme_transport.c
|
||||
@@ -494,6 +494,9 @@ nvme_transport_poll_group_process_completions(struct spdk_nvme_transport_poll_gr
|
||||
{
|
||||
struct spdk_nvme_qpair *qpair;
|
||||
int64_t rc;
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ struct spdk_nvme_qpair *tmp_qpair;
|
||||
+#endif
|
||||
|
||||
tgroup->in_completion_context = true;
|
||||
rc = tgroup->transport->ops.poll_group_process_completions(tgroup, completions_per_qpair,
|
||||
@@ -502,7 +505,11 @@ nvme_transport_poll_group_process_completions(struct spdk_nvme_transport_poll_gr
|
||||
|
||||
if (spdk_unlikely(tgroup->num_qpairs_to_delete > 0)) {
|
||||
/* deleted qpairs are more likely to be in the disconnected qpairs list. */
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ STAILQ_FOREACH_SAFE(qpair, &tgroup->disconnected_qpairs, poll_group_stailq, tmp_qpair) {
|
||||
+#else
|
||||
STAILQ_FOREACH(qpair, &tgroup->disconnected_qpairs, poll_group_stailq) {
|
||||
+#endif
|
||||
if (spdk_unlikely(qpair->delete_after_completion_context)) {
|
||||
spdk_nvme_ctrlr_free_io_qpair(qpair);
|
||||
if (--tgroup->num_qpairs_to_delete == 0) {
|
||||
@@ -511,7 +518,11 @@ nvme_transport_poll_group_process_completions(struct spdk_nvme_transport_poll_gr
|
||||
}
|
||||
}
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ STAILQ_FOREACH_SAFE(qpair, &tgroup->connected_qpairs, poll_group_stailq, tmp_qpair) {
|
||||
+#else
|
||||
STAILQ_FOREACH(qpair, &tgroup->connected_qpairs, poll_group_stailq) {
|
||||
+#endif
|
||||
if (spdk_unlikely(qpair->delete_after_completion_context)) {
|
||||
spdk_nvme_ctrlr_free_io_qpair(qpair);
|
||||
if (--tgroup->num_qpairs_to_delete == 0) {
|
||||
--
|
||||
2.27.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,473 +0,0 @@
|
||||
From 3e50e7afd7463c963b1305a32ef45ebaa01c6f84 Mon Sep 17 00:00:00 2001
|
||||
From: Kemeng Shi <shikemeng@huaweicloud.com>
|
||||
Date: Sun, 13 Jun 2021 19:53:08 +0800
|
||||
Subject: [PATCH] SPDK: enable xcache
|
||||
|
||||
1. export get_starting_vec and initialize_cpy_vector in ocf
|
||||
2. extend struct vbdev_ocf_cache_ctx with new member "struct vbdev_ocf
|
||||
*vbdev"
|
||||
3. replace OCF IO interface with Xcache IO interface
|
||||
|
||||
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
|
||||
---
|
||||
module/bdev/ocf/ctx.c | 4 +
|
||||
module/bdev/ocf/ctx.h | 3 +
|
||||
module/bdev/ocf/vbdev_ocf.c | 17 +-
|
||||
module/bdev/ocf/vbdev_xcache.c | 291 +++++++++++++++++++++++++++++++++
|
||||
module/bdev/ocf/vbdev_xcache.h | 7 +
|
||||
module/bdev/ocf/volume.c | 16 +-
|
||||
module/bdev/ocf/volume.h | 4 +
|
||||
7 files changed, 334 insertions(+), 8 deletions(-)
|
||||
create mode 100644 module/bdev/ocf/vbdev_xcache.c
|
||||
create mode 100644 module/bdev/ocf/vbdev_xcache.h
|
||||
|
||||
diff --git a/module/bdev/ocf/ctx.c b/module/bdev/ocf/ctx.c
|
||||
index 8666617..9a8ea04 100644
|
||||
--- a/module/bdev/ocf/ctx.c
|
||||
+++ b/module/bdev/ocf/ctx.c
|
||||
@@ -340,7 +340,11 @@ cleaner_poll(void *arg)
|
||||
}
|
||||
|
||||
if (spdk_get_ticks() >= priv->next_run) {
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ xcache_cleaner_run(cleaner, priv->queue);
|
||||
+#else
|
||||
ocf_cleaner_run(cleaner, priv->queue);
|
||||
+#endif
|
||||
return SPDK_POLLER_BUSY;
|
||||
}
|
||||
|
||||
diff --git a/module/bdev/ocf/ctx.h b/module/bdev/ocf/ctx.h
|
||||
index 4419ef5..a96c10a 100644
|
||||
--- a/module/bdev/ocf/ctx.h
|
||||
+++ b/module/bdev/ocf/ctx.h
|
||||
@@ -50,6 +50,9 @@ struct vbdev_ocf_cache_ctx {
|
||||
ocf_queue_t cleaner_queue;
|
||||
pthread_mutex_t lock;
|
||||
env_atomic refcnt;
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ struct vbdev_ocf *vbdev;
|
||||
+#endif
|
||||
};
|
||||
|
||||
void vbdev_ocf_cache_ctx_put(struct vbdev_ocf_cache_ctx *ctx);
|
||||
diff --git a/module/bdev/ocf/vbdev_ocf.c b/module/bdev/ocf/vbdev_ocf.c
|
||||
index 41f1f73..b4f45cb 100644
|
||||
--- a/module/bdev/ocf/vbdev_ocf.c
|
||||
+++ b/module/bdev/ocf/vbdev_ocf.c
|
||||
@@ -47,6 +47,10 @@
|
||||
#include "spdk/log.h"
|
||||
#include "spdk/cpuset.h"
|
||||
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+#include "vbdev_xcache.h"
|
||||
+#endif
|
||||
+
|
||||
static struct spdk_bdev_module ocf_if;
|
||||
|
||||
static TAILQ_HEAD(, vbdev_ocf) g_ocf_vbdev_head
|
||||
@@ -780,7 +784,11 @@ vbdev_ocf_write_json_config(struct spdk_bdev *bdev, struct spdk_json_write_ctx *
|
||||
static struct spdk_bdev_fn_table cache_dev_fn_table = {
|
||||
.destruct = vbdev_ocf_destruct,
|
||||
.io_type_supported = vbdev_ocf_io_type_supported,
|
||||
- .submit_request = vbdev_ocf_submit_request,
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ .submit_request = xcache_submit_request,
|
||||
+#else
|
||||
+ .submit_request = vbdev_ocf_submit_request,
|
||||
+#endif
|
||||
.get_io_channel = vbdev_ocf_get_io_channel,
|
||||
.write_config_json = vbdev_ocf_write_json_config,
|
||||
.dump_info_json = vbdev_ocf_dump_info_json,
|
||||
@@ -1121,6 +1129,9 @@ start_cache(struct vbdev_ocf *vbdev)
|
||||
vbdev_ocf_mngt_exit(vbdev, unregister_path_dirty, rc);
|
||||
return;
|
||||
}
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ vbdev->cache_ctx->vbdev = vbdev;
|
||||
+#endif
|
||||
|
||||
if (vbdev->cfg.loadq) {
|
||||
ocf_mngt_cache_load(vbdev->ocf_cache, &vbdev->cfg.device, start_cache_cmpl, vbdev);
|
||||
@@ -1847,7 +1858,11 @@ static struct spdk_bdev_module ocf_if = {
|
||||
.module_init = vbdev_ocf_init,
|
||||
.fini_start = fini_start,
|
||||
.module_fini = vbdev_ocf_module_fini,
|
||||
+#ifdef SPDK_CONFIG_APP_RW
|
||||
+ .get_ctx_size = xcache_get_ctx_size,
|
||||
+#else
|
||||
.get_ctx_size = vbdev_ocf_get_ctx_size,
|
||||
+#endif
|
||||
.examine_config = vbdev_ocf_examine,
|
||||
.examine_disk = vbdev_ocf_examine_disk,
|
||||
};
|
||||
diff --git a/module/bdev/ocf/vbdev_xcache.c b/module/bdev/ocf/vbdev_xcache.c
|
||||
new file mode 100644
|
||||
index 0000000..819ef4b
|
||||
--- /dev/null
|
||||
+++ b/module/bdev/ocf/vbdev_xcache.c
|
||||
@@ -0,0 +1,291 @@
|
||||
+#include <ocf/ocf.h>
|
||||
+
|
||||
+#include "spdk/bdev_module.h"
|
||||
+#include "spdk/thread.h"
|
||||
+#include "spdk/log.h"
|
||||
+
|
||||
+#include "vbdev_ocf.h"
|
||||
+#include "data.h"
|
||||
+#include "ctx.h"
|
||||
+#include "volume.h"
|
||||
+
|
||||
+#include "vbdev_xcache.h"
|
||||
+
|
||||
+static inline struct spdk_bdev_io *spdk_io_to_bdev_io(struct xcache_io *io)
|
||||
+{
|
||||
+ struct spdk_bdev_io *bdev_io = container_of((void *)io - sizeof(struct bdev_ocf_data), struct spdk_bdev_io, driver_ctx);
|
||||
+ return bdev_io;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+xcache_submit_io_cb(struct xcache_io *io, int error)
|
||||
+{
|
||||
+
|
||||
+ struct spdk_bdev_io *bdev_io = spdk_io_to_bdev_io(io);
|
||||
+
|
||||
+ if (error == 0) {
|
||||
+ spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_SUCCESS);
|
||||
+ } else if (error == -ENOMEM) {
|
||||
+ spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_NOMEM);
|
||||
+ } else {
|
||||
+ spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+submit_io_to_xcache(struct spdk_bdev_io *bdev_io, struct xcache_io *io)
|
||||
+{
|
||||
+ switch (bdev_io->type) {
|
||||
+ case SPDK_BDEV_IO_TYPE_WRITE:
|
||||
+ case SPDK_BDEV_IO_TYPE_READ:
|
||||
+ case SPDK_BDEV_IO_TYPE_FLUSH:
|
||||
+ xcache_submit_io(io);
|
||||
+ return 0;
|
||||
+ default:
|
||||
+ SPDK_ERRLOG("Unsupported IO type: %d\n", bdev_io->type);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+xcache_io_handle(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io, int dir)
|
||||
+{
|
||||
+ struct vbdev_ocf_qctx *qctx = spdk_io_channel_get_ctx(ch);
|
||||
+ struct vbdev_ocf *vbdev = bdev_io->bdev->ctxt;
|
||||
+
|
||||
+ struct bdev_ocf_data *data;
|
||||
+ struct xcache_io *io;
|
||||
+ int err;
|
||||
+
|
||||
+ data = vbdev_ocf_data_from_spdk_io(bdev_io);
|
||||
+ io = (struct xcache_io *)(data + 1);
|
||||
+ io->data = data;
|
||||
+ io->io_queue = qctx->queue;
|
||||
+ io->end = xcache_submit_io_cb;
|
||||
+ io->error = 0;
|
||||
+ io->rw = dir;
|
||||
+ io->size = bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen;
|
||||
+ io->start_addr = bdev_io->u.bdev.offset_blocks * bdev_io->bdev->blocklen;
|
||||
+ io->core = vbdev->ocf_core;
|
||||
+ io->cache = vbdev->ocf_cache;
|
||||
+ io->flags = 0;
|
||||
+
|
||||
+ err = submit_io_to_xcache(bdev_io, io);
|
||||
+ if (err) {
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ return;
|
||||
+
|
||||
+fail:
|
||||
+ if (err == -ENOMEM) {
|
||||
+ spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_NOMEM);
|
||||
+ } else {
|
||||
+ spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+xcache_get_buf_cb(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io,
|
||||
+ bool success)
|
||||
+{
|
||||
+ if (!success) {
|
||||
+ spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ xcache_io_handle(ch, bdev_io, OCF_READ);
|
||||
+}
|
||||
+
|
||||
+/* Called from bdev layer when an io to Cache vbdev is submitted */
|
||||
+void
|
||||
+xcache_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
|
||||
+{
|
||||
+ switch (bdev_io->type) {
|
||||
+ case SPDK_BDEV_IO_TYPE_READ:
|
||||
+ /* User does not have to allocate io vectors for the request,
|
||||
+ * so in case they are not allocated, we allocate them here */
|
||||
+ spdk_bdev_io_get_buf(bdev_io, xcache_get_buf_cb,
|
||||
+ bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen);
|
||||
+ break;
|
||||
+ case SPDK_BDEV_IO_TYPE_WRITE:
|
||||
+ xcache_io_handle(ch, bdev_io, OCF_WRITE);
|
||||
+ break;
|
||||
+ case SPDK_BDEV_IO_TYPE_FLUSH:
|
||||
+ xcache_io_handle(ch, bdev_io, OCF_FLUSH);
|
||||
+ break;
|
||||
+ default:
|
||||
+ SPDK_ERRLOG("Unknown I/O type %d\n", bdev_io->type);
|
||||
+ spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+xcache_get_ctx_size(void)
|
||||
+{
|
||||
+ return sizeof(struct xcache_io) + sizeof(struct bdev_ocf_data);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+backdev_io_end(bool success, struct xcache_backdev_io *io_base,
|
||||
+ uint64_t addr, uint64_t size)
|
||||
+{
|
||||
+ struct backdev_io_end_arg cb_arg;
|
||||
+
|
||||
+ if (io_base->priv != NULL) {
|
||||
+ env_free(io_base->priv);
|
||||
+ io_base->priv = NULL;
|
||||
+ }
|
||||
+
|
||||
+ cb_arg.error = !success;
|
||||
+ cb_arg.addr = addr;
|
||||
+ cb_arg.size = size;
|
||||
+ xcache_backdev_io_end(io_base, &cb_arg);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+backdev_io_cb(struct spdk_bdev_io *bdev_io, bool success, void *opaque)
|
||||
+{
|
||||
+ uint64_t addr = bdev_io->u.bdev.offset_blocks * bdev_io->bdev->blocklen;
|
||||
+ uint64_t size = bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen;
|
||||
+
|
||||
+ backdev_io_end(success, (struct xcache_backdev_io *)opaque, addr, size);
|
||||
+
|
||||
+ spdk_bdev_free_io(bdev_io);
|
||||
+}
|
||||
+
|
||||
+static int xcache_prepare_submit(struct xcache_backdev_io *io_base, bool to_cache,
|
||||
+ struct vbdev_ocf_base **base, struct spdk_io_channel **ch)
|
||||
+{
|
||||
+ struct xcache_io *io = io_base->xcache_io;
|
||||
+ ocf_queue_t q = io->io_queue;
|
||||
+ ocf_cache_t cache = ocf_queue_get_cache(q);
|
||||
+ struct vbdev_ocf_cache_ctx *cctx = ocf_cache_get_priv(cache);
|
||||
+ struct vbdev_ocf *vbdev;
|
||||
+ struct vbdev_ocf_qctx *qctx;
|
||||
+
|
||||
+ if (cctx == NULL) {
|
||||
+ return -EFAULT;
|
||||
+ }
|
||||
+
|
||||
+ vbdev = cctx->vbdev;
|
||||
+ // get vbdev_ocf_base
|
||||
+ if (to_cache) {
|
||||
+ *base = &vbdev->cache;
|
||||
+ } else {
|
||||
+ *base = &vbdev->core;
|
||||
+ }
|
||||
+
|
||||
+ if (q == cctx->cleaner_queue || q == cctx->mngt_queue) {
|
||||
+ *ch = (*base)->management_channel;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ qctx = ocf_queue_get_priv(q);
|
||||
+ if (qctx == NULL) {
|
||||
+ return -EFAULT;
|
||||
+ }
|
||||
+ if (to_cache) {
|
||||
+ *ch = qctx->cache_ch;
|
||||
+ } else {
|
||||
+ *ch = qctx->core_ch;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+struct copy_vector {
|
||||
+ int iovcnt;
|
||||
+ struct iovec iovs[];
|
||||
+};
|
||||
+
|
||||
+void spdk_backdev_submit_io(struct xcache_backdev_io *io_base, bool to_cache, uint64_t addr, uint64_t len, uint64_t offset, uint8_t dir)
|
||||
+{
|
||||
+ struct bdev_ocf_data *data = (struct bdev_ocf_data *)io_base->data;
|
||||
+
|
||||
+ uint64_t size, bytes;
|
||||
+ struct iovec *iovs;
|
||||
+ int iovcnt;
|
||||
+ int status = 0;
|
||||
+ struct vbdev_ocf_base *base;
|
||||
+ struct spdk_io_channel *ch;
|
||||
+ int i, j;
|
||||
+ struct copy_vector *vector;
|
||||
+
|
||||
+ io_base->priv = NULL;
|
||||
+
|
||||
+ if (xcache_prepare_submit(io_base, to_cache, &base, &ch) != 0) {
|
||||
+ backdev_io_end(false, io_base, addr, len);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (dir == OCF_FLUSH) {
|
||||
+ status = spdk_bdev_flush(base->desc, ch, addr, len, backdev_io_cb, io_base);
|
||||
+ goto end;
|
||||
+ }
|
||||
+
|
||||
+ size = data->size;
|
||||
+ iovs = data->iovs;
|
||||
+ iovcnt = data->iovcnt;
|
||||
+ if (len < size) {
|
||||
+ if (iovcnt == 1) {
|
||||
+ if (dir == OCF_READ) {
|
||||
+ status = spdk_bdev_read(base->desc, ch,
|
||||
+ iovs[0].iov_base + offset, addr, len,
|
||||
+ backdev_io_cb, io_base);
|
||||
+ } else if (dir == OCF_WRITE) {
|
||||
+ status = spdk_bdev_write(base->desc, ch,
|
||||
+ iovs[0].iov_base + offset, addr, len,
|
||||
+ backdev_io_cb, io_base);
|
||||
+ }
|
||||
+ goto end;
|
||||
+ } else {
|
||||
+ i = get_starting_vec(iovs, iovcnt, &offset);
|
||||
+
|
||||
+ if (i < 0) {
|
||||
+ SPDK_ERRLOG("offset bigger than data size\n");
|
||||
+ backdev_io_end(false, io_base, addr, len);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ bytes = len + offset;
|
||||
+ j = get_starting_vec(iovs + i, iovcnt - i, &bytes);
|
||||
+ if (offset == 0 && bytes == 0) {
|
||||
+ iovs = iovs + i;
|
||||
+ iovcnt = j;
|
||||
+ } else {
|
||||
+ if (bytes != 0) {
|
||||
+ j++;
|
||||
+ }
|
||||
+ vector = env_malloc(sizeof(int) + sizeof(*iovs) * j, ENV_MEM_NOIO);
|
||||
+ if (vector == NULL) {
|
||||
+ SPDK_ERRLOG("allocation failed\n");
|
||||
+ backdev_io_end(false, io_base, addr, len);
|
||||
+ return;
|
||||
+ }
|
||||
+ vector->iovcnt = j;
|
||||
+ io_base->priv = vector;
|
||||
+
|
||||
+ initialize_cpy_vector(vector->iovs, &iovs[i], offset, len);
|
||||
+
|
||||
+ iovs = vector->iovs;
|
||||
+ iovcnt = vector->iovcnt;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (dir == OCF_READ) {
|
||||
+ status = spdk_bdev_readv(base->desc, ch,
|
||||
+ iovs, iovcnt, addr, len, backdev_io_cb, io_base);
|
||||
+ } else if (dir == OCF_WRITE) {
|
||||
+ status = spdk_bdev_writev(base->desc, ch,
|
||||
+ iovs, iovcnt, addr, len, backdev_io_cb, io_base);
|
||||
+ }
|
||||
+
|
||||
+end:
|
||||
+ if (status) {
|
||||
+ SPDK_ERRLOG("submission failed with status=%d\n", status);
|
||||
+ backdev_io_end(false, io_base, addr, len);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/module/bdev/ocf/vbdev_xcache.h b/module/bdev/ocf/vbdev_xcache.h
|
||||
new file mode 100644
|
||||
index 0000000..8e386f3
|
||||
--- /dev/null
|
||||
+++ b/module/bdev/ocf/vbdev_xcache.h
|
||||
@@ -0,0 +1,7 @@
|
||||
+#ifndef VBDEV_XCACHE_H
|
||||
+#define VBDEV_XCACHE_H
|
||||
+
|
||||
+void xcache_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io);
|
||||
+int xcache_get_ctx_size(void);
|
||||
+
|
||||
+#endif
|
||||
diff --git a/module/bdev/ocf/volume.c b/module/bdev/ocf/volume.c
|
||||
index b65a5eb..96112ff 100644
|
||||
--- a/module/bdev/ocf/volume.c
|
||||
+++ b/module/bdev/ocf/volume.c
|
||||
@@ -120,7 +120,7 @@ vbdev_ocf_volume_io_put(struct ocf_io *io)
|
||||
}
|
||||
}
|
||||
|
||||
-static int
|
||||
+int
|
||||
get_starting_vec(struct iovec *iovs, int iovcnt, int *offset)
|
||||
{
|
||||
int i;
|
||||
@@ -136,13 +136,16 @@ get_starting_vec(struct iovec *iovs, int iovcnt, int *offset)
|
||||
off -= iovs[i].iov_len;
|
||||
}
|
||||
|
||||
+ if (off == 0) {
|
||||
+ *offset = 0;
|
||||
+ return i;
|
||||
+ }
|
||||
+
|
||||
return -1;
|
||||
}
|
||||
|
||||
-static void
|
||||
-initialize_cpy_vector(struct iovec *cpy_vec, int cpy_vec_len, struct iovec *orig_vec,
|
||||
- int orig_vec_len,
|
||||
- size_t offset, size_t bytes)
|
||||
+void
|
||||
+initialize_cpy_vector(struct iovec *cpy_vec, struct iovec *orig_vec, size_t offset, size_t bytes)
|
||||
{
|
||||
void *curr_base;
|
||||
int len, i;
|
||||
@@ -342,8 +345,7 @@ vbdev_ocf_volume_submit_io(struct ocf_io *io)
|
||||
return;
|
||||
}
|
||||
|
||||
- initialize_cpy_vector(iovs, io_ctx->data->iovcnt, &io_ctx->data->iovs[i],
|
||||
- iovcnt, offset, len);
|
||||
+ initialize_cpy_vector(iovs, &io_ctx->data->iovs[i], offset, len);
|
||||
}
|
||||
} else {
|
||||
iovs = io_ctx->data->iovs;
|
||||
diff --git a/module/bdev/ocf/volume.h b/module/bdev/ocf/volume.h
|
||||
index 20b4bff..b053e02 100644
|
||||
--- a/module/bdev/ocf/volume.h
|
||||
+++ b/module/bdev/ocf/volume.h
|
||||
@@ -59,4 +59,8 @@ static inline struct ocf_io_ctx *ocf_get_io_ctx(struct ocf_io *io)
|
||||
return ocf_io_get_priv(io);
|
||||
}
|
||||
|
||||
+int get_starting_vec(struct iovec *iovs, int iovcnt, int *offset);
|
||||
+void initialize_cpy_vector(struct iovec *cpy_vec, struct iovec *orig_vec,
|
||||
+ size_t offset, size_t bytes);
|
||||
+
|
||||
#endif
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
From b76cb37ce4bfd53eb48ae299cf0067b4647f8a21 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Berger <michal.berger@intel.com>
|
||||
Date: Mon, 31 Oct 2022 09:25:11 +0100
|
||||
Subject: [PATCH] test/nvmf: Fix trap
|
||||
|
||||
Also, add at_app_exit() to make sure that all vhost and qemu
|
||||
instances are terminated as well.
|
||||
|
||||
Signed-off-by: Michal Berger <michal.berger@intel.com>
|
||||
Change-Id: I917f1cb1b02d18b78a482d754a19f509e580fc98
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15185
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
|
||||
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
|
||||
---
|
||||
test/nvmf/target/nvmf_vhost.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/nvmf/target/nvmf_vhost.sh b/test/nvmf/target/nvmf_vhost.sh
|
||||
index 9c9dde35d..c00a66b18 100755
|
||||
--- a/test/nvmf/target/nvmf_vhost.sh
|
||||
+++ b/test/nvmf/target/nvmf_vhost.sh
|
||||
@@ -35,7 +35,7 @@ mkdir -p "$(get_vhost_dir 3)"
|
||||
vhostpid=$!
|
||||
waitforlisten $vhostpid $NVMF_SOCK
|
||||
|
||||
-trap 'process_shm --id $NVMF_APP_SHM_ID; killprocess $vhostpid nvmftestfini; exit 1' SIGINT SIGTERM EXIT
|
||||
+trap 'process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; at_app_exit; exit 1' SIGINT SIGTERM EXIT
|
||||
|
||||
# Configure NVMF tgt on host machine
|
||||
malloc_bdev="$($NVMF_RPC bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
|
||||
--
|
||||
2.37.2.windows.2
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
From 6882e04563c8b406c2751ad258b5dd87786937aa Mon Sep 17 00:00:00 2001
|
||||
From: Karol Latecki <karol.latecki@intel.com>
|
||||
Date: Thu, 28 Jan 2021 14:04:03 +0100
|
||||
Subject: [PATCH] scripts/nvmf_perf: fix pylint C0411 wrong import order
|
||||
|
||||
Standard lib modules first, then pip installed modules
|
||||
and local modules last.
|
||||
|
||||
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
|
||||
Change-Id: If0159fad29bab5bef0b69aa803e3cea429cc5f25
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6202
|
||||
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
|
||||
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Community-CI: Mellanox Build Bot
|
||||
---
|
||||
scripts/perf/nvmf/run_nvmf.py | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/scripts/perf/nvmf/run_nvmf.py b/scripts/perf/nvmf/run_nvmf.py
|
||||
index 2883d9a99..2c5331e86 100755
|
||||
--- a/scripts/perf/nvmf/run_nvmf.py
|
||||
+++ b/scripts/perf/nvmf/run_nvmf.py
|
||||
@@ -4,17 +4,19 @@ import os
|
||||
import re
|
||||
import sys
|
||||
import json
|
||||
-import paramiko
|
||||
import zipfile
|
||||
import threading
|
||||
import subprocess
|
||||
import itertools
|
||||
import time
|
||||
import uuid
|
||||
+from collections import OrderedDict
|
||||
+
|
||||
+import paramiko
|
||||
+import pandas as pd
|
||||
+
|
||||
import rpc
|
||||
import rpc.client
|
||||
-import pandas as pd
|
||||
-from collections import OrderedDict
|
||||
from common import *
|
||||
|
||||
|
||||
--
|
||||
2.37.2.windows.2
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
From 62c2c1c110f7d569110876108963d118fe20af34 Mon Sep 17 00:00:00 2001
|
||||
From: Karol Latecki <karol.latecki@intel.com>
|
||||
Date: Thu, 28 Jan 2021 14:08:31 +0100
|
||||
Subject: [PATCH] scripts/nvmf_perf: fix pylint E1111 error - assignment on no
|
||||
return
|
||||
|
||||
Fix assigning variables from functions which return nothing.
|
||||
|
||||
Change-Id: Ic54dc0d42e3339cda23970ed347ac6f7bf92e795
|
||||
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6203
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
|
||||
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Community-CI: Mellanox Build Bot
|
||||
---
|
||||
scripts/perf/nvmf/run_nvmf.py | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/scripts/perf/nvmf/run_nvmf.py b/scripts/perf/nvmf/run_nvmf.py
|
||||
index 2c5331e86..63179923a 100755
|
||||
--- a/scripts/perf/nvmf/run_nvmf.py
|
||||
+++ b/scripts/perf/nvmf/run_nvmf.py
|
||||
@@ -647,11 +647,11 @@ class SPDKTarget(Target):
|
||||
rpc.client.print_dict(rpc.nvmf.nvmf_get_transports(self.client))
|
||||
|
||||
if self.null_block:
|
||||
- nvme_section = self.spdk_tgt_add_nullblock(self.null_block)
|
||||
- subsystems_section = self.spdk_tgt_add_subsystem_conf(self.nic_ips, self.null_block)
|
||||
+ self.spdk_tgt_add_nullblock(self.null_block)
|
||||
+ self.spdk_tgt_add_subsystem_conf(self.nic_ips, self.null_block)
|
||||
else:
|
||||
- nvme_section = self.spdk_tgt_add_nvme_conf()
|
||||
- subsystems_section = self.spdk_tgt_add_subsystem_conf(self.nic_ips)
|
||||
+ self.spdk_tgt_add_nvme_conf()
|
||||
+ self.spdk_tgt_add_subsystem_conf(self.nic_ips)
|
||||
self.log_print("Done configuring SPDK NVMeOF Target")
|
||||
|
||||
def spdk_tgt_add_nullblock(self, null_block_count):
|
||||
--
|
||||
2.37.2.windows.2
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
From 4dd1548be3a04d4ae072c4edcfc0a349036f4df2 Mon Sep 17 00:00:00 2001
|
||||
From: Karol Latecki <karol.latecki@intel.com>
|
||||
Date: Thu, 28 Jan 2021 16:30:49 +0100
|
||||
Subject: [PATCH] scripts/nvmf_perf: check "extra_params" key berofe accessing
|
||||
it
|
||||
|
||||
If config without this field was used then
|
||||
script resulted in KeyError exception.
|
||||
|
||||
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
|
||||
Change-Id: Icf0b270d28dcc6bf44b66c4b9ed583a6b3ef08b6
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6204
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Community-CI: Mellanox Build Bot
|
||||
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
|
||||
---
|
||||
scripts/perf/nvmf/run_nvmf.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/scripts/perf/nvmf/run_nvmf.py b/scripts/perf/nvmf/run_nvmf.py
|
||||
index 63179923a..7885ff2f0 100755
|
||||
--- a/scripts/perf/nvmf/run_nvmf.py
|
||||
+++ b/scripts/perf/nvmf/run_nvmf.py
|
||||
@@ -772,7 +772,7 @@ class KernelInitiator(Initiator):
|
||||
cpu_frequency=cpu_frequency, fio_bin=fio_bin)
|
||||
|
||||
self.extra_params = ""
|
||||
- if kwargs["extra_params"]:
|
||||
+ if "extra_params" in kwargs.keys():
|
||||
self.extra_params = kwargs["extra_params"]
|
||||
|
||||
def __del__(self):
|
||||
--
|
||||
2.37.2.windows.2
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
From 74b2916c4a7d90a882b671c925f0e86dc0cb6338 Mon Sep 17 00:00:00 2001
|
||||
From: Ziye Yang <ziye.yang@intel.com>
|
||||
Date: Sat, 30 Jan 2021 01:25:32 +0800
|
||||
Subject: [PATCH] nvme/rdma: Only wait for the RDMA event if
|
||||
spdk_rdma_qp_disconnect return 0
|
||||
|
||||
If rdma_qp_disconnect is not correctly sent out, we will not wait
|
||||
for the event.
|
||||
|
||||
Change-Id: I99701e421dc93909d481ccf35e9bfd8004e60da8
|
||||
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6163
|
||||
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: <dongx.yi@intel.com>
|
||||
---
|
||||
lib/nvme/nvme_rdma.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/nvme/nvme_rdma.c b/lib/nvme/nvme_rdma.c
|
||||
index 1046f3d91..47023c083 100644
|
||||
--- a/lib/nvme/nvme_rdma.c
|
||||
+++ b/lib/nvme/nvme_rdma.c
|
||||
@@ -1646,6 +1646,7 @@ nvme_rdma_ctrlr_disconnect_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme
|
||||
struct nvme_rdma_qpair *rqpair = nvme_rdma_qpair(qpair);
|
||||
struct nvme_rdma_ctrlr *rctrlr = NULL;
|
||||
struct nvme_rdma_cm_event_entry *entry, *tmp;
|
||||
+ int rc;
|
||||
|
||||
spdk_rdma_free_mem_map(&rqpair->mr_map);
|
||||
nvme_rdma_unregister_reqs(rqpair);
|
||||
@@ -1673,8 +1674,8 @@ nvme_rdma_ctrlr_disconnect_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme
|
||||
|
||||
if (rqpair->cm_id) {
|
||||
if (rqpair->rdma_qp) {
|
||||
- spdk_rdma_qp_disconnect(rqpair->rdma_qp);
|
||||
- if (rctrlr != NULL) {
|
||||
+ rc = spdk_rdma_qp_disconnect(rqpair->rdma_qp);
|
||||
+ if ((rctrlr != NULL) && (rc == 0)) {
|
||||
if (nvme_rdma_process_event(rqpair, rctrlr->cm_channel, RDMA_CM_EVENT_DISCONNECTED)) {
|
||||
SPDK_DEBUGLOG(nvme, "Target did not respond to qpair disconnect.\n");
|
||||
}
|
||||
--
|
||||
2.37.2.windows.2
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
From b56f1ef5e47b740e2934ef25ea9d051bde8917d4 Mon Sep 17 00:00:00 2001
|
||||
From: Matthew King <matthew.king@xilinx.com>
|
||||
Date: Mon, 18 Jan 2021 16:42:09 +0000
|
||||
Subject: [PATCH] Cleanup: Fix boolean arg in fio plugin.
|
||||
|
||||
In fio, bools are represented as ints. They have to be read into int entries
|
||||
in the options struct, or memory corruption may occur.
|
||||
Also provided a default to bring it more in line with existing fio code.
|
||||
|
||||
Signed-off-by: Matthew King <matthew.king@xilinx.com>
|
||||
Change-Id: Ib718653d6597a287bf8ff96d2fb864e46295751d
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6147
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Community-CI: Mellanox Build Bot
|
||||
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
|
||||
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
|
||||
Reviewed-by: <dongx.yi@intel.com>
|
||||
---
|
||||
examples/bdev/fio_plugin/fio_plugin.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/examples/bdev/fio_plugin/fio_plugin.c b/examples/bdev/fio_plugin/fio_plugin.c
|
||||
index 90f1c4bb4..8d82e0363 100644
|
||||
--- a/examples/bdev/fio_plugin/fio_plugin.c
|
||||
+++ b/examples/bdev/fio_plugin/fio_plugin.c
|
||||
@@ -59,7 +59,7 @@ struct spdk_fio_options {
|
||||
char *conf;
|
||||
char *json_conf;
|
||||
unsigned mem_mb;
|
||||
- bool mem_single_seg;
|
||||
+ int mem_single_seg;
|
||||
};
|
||||
|
||||
struct spdk_fio_request {
|
||||
@@ -789,6 +789,7 @@ static struct fio_option options[] = {
|
||||
.type = FIO_OPT_BOOL,
|
||||
.off1 = offsetof(struct spdk_fio_options, mem_single_seg),
|
||||
.help = "If set to 1, SPDK will use just a single hugetlbfs file",
|
||||
+ .def = "0",
|
||||
.category = FIO_OPT_C_ENGINE,
|
||||
.group = FIO_OPT_G_INVALID,
|
||||
},
|
||||
--
|
||||
2.37.2.windows.2
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
From a8d21b9b550dde7d3e7ffc0cd1171528a136165f Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
|
||||
Date: Wed, 18 Jan 2023 19:44:45 +0100
|
||||
Subject: [PATCH] =?UTF-8?q?lib/ioat:=20initialized=20=E2=80=98status?=
|
||||
=?UTF-8?q?=E2=80=99=20variable=20before=20use?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This patch fix `gcc-12` warning: #2829
|
||||
|
||||
```
|
||||
warning: ‘status’ may be used uninitialized [-Wmaybe-uninitialized]
|
||||
ioat.c:360:18: note: ‘status’ was declared here
|
||||
360 | uint64_t status;
|
||||
| ^~~~~~
|
||||
```
|
||||
|
||||
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
|
||||
Change-Id: I8d010256e51cf6f1b9047d054773cb85d435ccf9
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16339
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
---
|
||||
lib/ioat/ioat.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/ioat/ioat.c b/lib/ioat/ioat.c
|
||||
index 479f73dd875..949afea850a 100644
|
||||
--- a/lib/ioat/ioat.c
|
||||
+++ b/lib/ioat/ioat.c
|
||||
@@ -357,7 +357,7 @@ static int
|
||||
ioat_channel_start(struct spdk_ioat_chan *ioat)
|
||||
{
|
||||
uint8_t xfercap, version;
|
||||
- uint64_t status;
|
||||
+ uint64_t status = 0;
|
||||
int i, num_descriptors;
|
||||
uint64_t comp_update_bus_addr = 0;
|
||||
uint64_t phys_addr;
|
||||
@ -1,41 +0,0 @@
|
||||
From 2d686707df37b8752f31684db16b689637ba141d Mon Sep 17 00:00:00 2001
|
||||
From: Xue Liu <liuxue@loongson.cn>
|
||||
Date: Thu, 1 Dec 2022 18:37:21 +0800
|
||||
Subject: [PATCH 1/3] barrier: LOONGARCH memory barriers
|
||||
|
||||
Implement memory barrier for LOONGARCH platforms.
|
||||
|
||||
Change-Id: I44f5e63e6eb3f8bf98e965a22fb86f94e727061d
|
||||
Signed-off-by: Xue Liu <liuxue@loongson.cn>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16082
|
||||
Community-CI: Mellanox Build Bot
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
---
|
||||
include/spdk/barrier.h | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/include/spdk/barrier.h b/include/spdk/barrier.h
|
||||
index acae360..1ee7240 100644
|
||||
--- a/include/spdk/barrier.h
|
||||
+++ b/include/spdk/barrier.h
|
||||
@@ -97,6 +97,15 @@ extern "C" {
|
||||
#define _spdk_smp_mb() __asm volatile("lock addl $0, -128(%%esp); " ::: "memory");
|
||||
#endif
|
||||
|
||||
+#elif defined(__loongarch__)
|
||||
+
|
||||
+#define _spdk_rmb() __asm volatile("dbar 0" ::: "memory")
|
||||
+#define _spdk_wmb() __asm volatile("dbar 0" ::: "memory")
|
||||
+#define _spdk_mb() __asm volatile("dbar 0" ::: "memory")
|
||||
+#define _spdk_smp_rmb() __asm volatile("dbar 0" ::: "memory")
|
||||
+#define _spdk_smp_wmb() __asm volatile("dbar 0" ::: "memory")
|
||||
+#define _spdk_smp_mb() __asm volatile("dbar 0" ::: "memory")
|
||||
+
|
||||
#else
|
||||
|
||||
#define _spdk_rmb()
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
From e9a94122b8704411b79157b25c4d07580246be6c Mon Sep 17 00:00:00 2001
|
||||
From: Xue Liu <liuxue@loongson.cn>
|
||||
Date: Thu, 1 Dec 2022 18:38:57 +0800
|
||||
Subject: [PATCH 2/3] nvme/pcie: add memory barrier for LOONGARCH
|
||||
|
||||
Add memory barrier for LOONGARCH in nvme_pcie_qpair_process_completions.
|
||||
|
||||
Signed-off-by: Xue Liu <liuxue@loongson.cn>
|
||||
Change-Id: Icc992ef612a00dd18ff33f70ab8f54e8c5d5c5b7
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16083
|
||||
Community-CI: Mellanox Build Bot
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
---
|
||||
lib/nvme/nvme_pcie_common.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/nvme/nvme_pcie_common.c b/lib/nvme/nvme_pcie_common.c
|
||||
index 0ef56cb..5fb6304 100644
|
||||
--- a/lib/nvme/nvme_pcie_common.c
|
||||
+++ b/lib/nvme/nvme_pcie_common.c
|
||||
@@ -801,7 +801,7 @@ nvme_pcie_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_
|
||||
__builtin_prefetch(&pqpair->tr[next_cpl->cid]);
|
||||
}
|
||||
|
||||
-#ifdef __PPC64__
|
||||
+#if defined(__PPC64__) || defined(__loongarch__)
|
||||
/*
|
||||
* This memory barrier prevents reordering of:
|
||||
* - load after store from/to tr
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
From d7484395ac0fd85c91365beb4af00c6e5ea39ee6 Mon Sep 17 00:00:00 2001
|
||||
From: Xue Liu <liuxue@loongson.cn>
|
||||
Date: Thu, 1 Dec 2022 18:39:44 +0800
|
||||
Subject: [PATCH 3/3] build: Specify the target build architecture for
|
||||
LOONGARCH.
|
||||
|
||||
More information about LoongArch:
|
||||
- https://loongson.github.io/LoongArch-Documentation/README-EN.html
|
||||
|
||||
Signed-off-by: Xue Liu <liuxue@loongson.cn>
|
||||
Change-Id: I24852e31b5fadef3578354da2d26252014330e83
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16084
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
---
|
||||
mk/spdk.common.mk | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk
|
||||
index da214c8..1e73776 100644
|
||||
--- a/mk/spdk.common.mk
|
||||
+++ b/mk/spdk.common.mk
|
||||
@@ -80,6 +80,9 @@ COMMON_CFLAGS += -mcpu=$(TARGET_ARCHITECTURE)
|
||||
else ifeq ($(TARGET_MACHINE),aarch64)
|
||||
COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
|
||||
COMMON_CFLAGS += -DPAGE_SIZE=$(shell getconf PAGESIZE)
|
||||
+else ifneq ($(filter loongarch%,$(TARGET_MACHINE)),)
|
||||
+COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
|
||||
+COMMON_CFLAGS += -DPAGE_SIZE=$(shell getconf PAGESIZE)
|
||||
else
|
||||
COMMON_CFLAGS += -march=core-avx-i
|
||||
endif
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@ -1,104 +0,0 @@
|
||||
From 8afb3d003798965618a8f018bac1644204f4b6e2 Mon Sep 17 00:00:00 2001
|
||||
From: GangCao <gang.cao@intel.com>
|
||||
Date: Thu, 29 Sep 2022 03:03:22 -0400
|
||||
Subject: [PATCH] lib/bdev: return error when failing to get resource
|
||||
|
||||
To fix issue: 2719
|
||||
|
||||
Change-Id: I983ef607fad154608fff9bb9355645968caf0c5a
|
||||
Signed-off-by: GangCao <gang.cao@intel.com>
|
||||
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14746
|
||||
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
|
||||
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
|
||||
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
|
||||
Reviewed-by: Jim Harris <james.r.harris@intel.com>
|
||||
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
|
||||
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
|
||||
Community-CI: Mellanox Build Bot
|
||||
---
|
||||
lib/bdev/bdev.c | 55 +++++++++++++++++++++++++++----------------------
|
||||
1 file changed, 30 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/lib/bdev/bdev.c b/lib/bdev/bdev.c
|
||||
index 122f3668a..1642289ff 100644
|
||||
--- a/lib/bdev/bdev.c
|
||||
+++ b/lib/bdev/bdev.c
|
||||
@@ -1382,6 +1382,30 @@ spdk_bdev_subsystem_config_json(struct spdk_json_write_ctx *w)
|
||||
spdk_json_write_array_end(w);
|
||||
}
|
||||
|
||||
+static void
|
||||
+bdev_mgmt_channel_destroy(void *io_device, void *ctx_buf)
|
||||
+{
|
||||
+ struct spdk_bdev_mgmt_channel *ch = ctx_buf;
|
||||
+ struct spdk_bdev_io *bdev_io;
|
||||
+
|
||||
+ if (!STAILQ_EMPTY(&ch->need_buf_small) || !STAILQ_EMPTY(&ch->need_buf_large)) {
|
||||
+ SPDK_ERRLOG("Pending I/O list wasn't empty on mgmt channel free\n");
|
||||
+ }
|
||||
+
|
||||
+ if (!TAILQ_EMPTY(&ch->shared_resources)) {
|
||||
+ SPDK_ERRLOG("Module channel list wasn't empty on mgmt channel free\n");
|
||||
+ }
|
||||
+
|
||||
+ while (!STAILQ_EMPTY(&ch->per_thread_cache)) {
|
||||
+ bdev_io = STAILQ_FIRST(&ch->per_thread_cache);
|
||||
+ STAILQ_REMOVE_HEAD(&ch->per_thread_cache, internal.buf_link);
|
||||
+ ch->per_thread_cache_count--;
|
||||
+ spdk_mempool_put(g_bdev_mgr.bdev_io_pool, (void *)bdev_io);
|
||||
+ }
|
||||
+
|
||||
+ assert(ch->per_thread_cache_count == 0);
|
||||
+}
|
||||
+
|
||||
static int
|
||||
bdev_mgmt_channel_create(void *io_device, void *ctx_buf)
|
||||
{
|
||||
@@ -1399,7 +1423,12 @@ bdev_mgmt_channel_create(void *io_device, void *ctx_buf)
|
||||
ch->per_thread_cache_count = 0;
|
||||
for (i = 0; i < ch->bdev_io_cache_size; i++) {
|
||||
bdev_io = spdk_mempool_get(g_bdev_mgr.bdev_io_pool);
|
||||
- assert(bdev_io != NULL);
|
||||
+ if (bdev_io == NULL) {
|
||||
+ SPDK_ERRLOG("You need to increase bdev_io_pool_size using bdev_set_options RPC.\n");
|
||||
+ assert(false);
|
||||
+ bdev_mgmt_channel_destroy(io_device, ctx_buf);
|
||||
+ return -1;
|
||||
+ }
|
||||
ch->per_thread_cache_count++;
|
||||
STAILQ_INSERT_HEAD(&ch->per_thread_cache, bdev_io, internal.buf_link);
|
||||
}
|
||||
@@ -1410,30 +1439,6 @@ bdev_mgmt_channel_create(void *io_device, void *ctx_buf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static void
|
||||
-bdev_mgmt_channel_destroy(void *io_device, void *ctx_buf)
|
||||
-{
|
||||
- struct spdk_bdev_mgmt_channel *ch = ctx_buf;
|
||||
- struct spdk_bdev_io *bdev_io;
|
||||
-
|
||||
- if (!STAILQ_EMPTY(&ch->need_buf_small) || !STAILQ_EMPTY(&ch->need_buf_large)) {
|
||||
- SPDK_ERRLOG("Pending I/O list wasn't empty on mgmt channel free\n");
|
||||
- }
|
||||
-
|
||||
- if (!TAILQ_EMPTY(&ch->shared_resources)) {
|
||||
- SPDK_ERRLOG("Module channel list wasn't empty on mgmt channel free\n");
|
||||
- }
|
||||
-
|
||||
- while (!STAILQ_EMPTY(&ch->per_thread_cache)) {
|
||||
- bdev_io = STAILQ_FIRST(&ch->per_thread_cache);
|
||||
- STAILQ_REMOVE_HEAD(&ch->per_thread_cache, internal.buf_link);
|
||||
- ch->per_thread_cache_count--;
|
||||
- spdk_mempool_put(g_bdev_mgr.bdev_io_pool, (void *)bdev_io);
|
||||
- }
|
||||
-
|
||||
- assert(ch->per_thread_cache_count == 0);
|
||||
-}
|
||||
-
|
||||
static void
|
||||
bdev_init_complete(int rc)
|
||||
{
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
From 0489d5319ea6a0918c1bc7bd9c3d1da61543467b Mon Sep 17 00:00:00 2001
|
||||
From: zhanghongtao <zhanghongtao22@huawei.com>
|
||||
Date: Mon, 18 Dec 2023 19:52:56 +0800
|
||||
Subject: [PATCH] Fix deadlock due to lock sequence in bdev_unregister_unsafe
|
||||
|
||||
Signed-off-by: Hongtao Zhang <zhanghongtao22@huawei.com>
|
||||
---
|
||||
lib/bdev/bdev.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/bdev/bdev.c b/lib/bdev/bdev.c
|
||||
index 4c63e8b..64027c6 100644
|
||||
--- a/lib/bdev/bdev.c
|
||||
+++ b/lib/bdev/bdev.c
|
||||
@@ -5758,8 +5758,8 @@ bdev_unregister_unsafe(struct spdk_bdev *bdev)
|
||||
pthread_mutex_unlock(&bdev->internal.mutex);
|
||||
pthread_mutex_unlock(&g_bdev_mgr.mutex);
|
||||
_remove_notify(desc);
|
||||
- pthread_mutex_lock(&bdev->internal.mutex);
|
||||
pthread_mutex_lock(&g_bdev_mgr.mutex);
|
||||
+ pthread_mutex_lock(&bdev->internal.mutex);
|
||||
}
|
||||
|
||||
/* If there are no descriptors, proceed removing the bdev */
|
||||
--
|
||||
2.27.0
|
||||
|
||||
82
spdk.spec
82
spdk.spec
@ -3,57 +3,13 @@
|
||||
%bcond_with doc
|
||||
|
||||
Name: spdk
|
||||
Version: 21.01.1
|
||||
Release: 19
|
||||
Version: 24.01
|
||||
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/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
|
||||
Patch12: 0012-spdk-use-fstack-protector-strong-instead-of-fstack-p.patch
|
||||
Patch13: 0013-lib-vhost-Fix-compilation-with-dpdk-21.11.patch
|
||||
Patch14: 0014-mk-Fix-debug-build-error-on-ARM-ThunderX2-and-neoverse_N1_platform.patch
|
||||
Patch15: 0015-configure-add-gcc-version-check-for-ARM-Neoverse-N1_platform.patch
|
||||
Patch16: 0016-Enhance-security-for-share-library.patch
|
||||
Patch17: 0017-add-HSAK-needed-head-file-and-API-to-spdk.patch
|
||||
Patch18: 0018-lib-bdev-Add-bdev-support-for-HSAK.patch
|
||||
Patch19: 0019-lib-env_dpdk-Add-config-args-for-HSAK.patch
|
||||
Patch20: 0020-lib-nvme-Add-nvme-support-for-HSAK.patch
|
||||
Patch21: 0021-module-bdev-Add-bdev-module-support-for-HSAK.patch
|
||||
Patch22: 0022-use-spdk_nvme_ns_cmd_dataset_management-and-delete-s.patch
|
||||
Patch23: 0023-spdk-add-nvme-support-for-HSAK.patch
|
||||
Patch24: 0024-Add-CUSE-switch-for-nvme-ctrlr.patch
|
||||
Patch25: 0025-Adapt-for-ES3000-serial-vendor-special-opcode-in-CUS.patch
|
||||
Patch26: 0026-nvme-nvme_cuse-Fix-race-condition-in-cuse-session.patch
|
||||
Patch27: 0027-Change-log-level-in-poll-timeout.patch
|
||||
Patch28: 0028-configure-add-CONFIG_HAVE_ARC4RANDOM.patch
|
||||
Patch29: 0029-Enable-unittest-in-make-check.patch
|
||||
Patch30: 0030-nvme_ctrlr_abort_queued_aborts-Segmentation-fault-oc.patch
|
||||
Patch31: 0031-Fix-UAF-in-STAILQ_FOREACH.patch
|
||||
Patch32: 0032-spdk-upgrade-ocf-lib-and-ocf-bdev-to-latest-SPDK-22.patch
|
||||
Patch33: 0033-SPDK-enable-xcache.patch
|
||||
Patch34: 0034-test-nvmf-Fix-trap.patch
|
||||
Patch35: 0035-scripts-nvmf_perf-fix-pylint-C0411-wrong-import-orde.patch
|
||||
Patch36: 0036-scripts-nvmf_perf-fix-pylint-E1111-error-assignment-.patch
|
||||
Patch37: 0037-scripts-nvmf_perf-check-extra_params-key-berofe-acce.patch
|
||||
Patch38: 0038-nvme-rdma-Only-wait-for-the-RDMA-event-if-spdk_rdma_.patch
|
||||
Patch39: 0039-Cleanup-Fix-boolean-arg-in-fio-plugin.patch
|
||||
Patch40: 0040-initialized-status-variable-before-use.patch
|
||||
Patch41: 0041-barrier-LOONGARCH-memory-barriers.patch
|
||||
Patch42: 0042-nvme-pcie-add-memory-barrier-for-LOONGARCH.patch
|
||||
Patch43: 0043-build-Specify-the-target-build-architecture-for-LOON.patch
|
||||
Patch44: 0044-lib-bdev-return-error-when-failing-to-get-resource.patch
|
||||
Patch45: 0045-Fix-deadlock-due-to-lock-sequence-in-bdev_unregister.patch
|
||||
Patch1: 0001-Add-without-ISA-L-option-and-disabled-by-default.patch
|
||||
|
||||
%define package_version %{version}-%{release}
|
||||
|
||||
@ -76,14 +32,13 @@ BuildRequires: libiscsi-devel, libaio-devel, openssl-devel, libuuid-devel
|
||||
BuildRequires: libibverbs-devel, librdmacm-devel
|
||||
BuildRequires: fuse3, fuse3-devel
|
||||
BuildRequires: libboundscheck
|
||||
BuildRequires: CUnit, CUnit-devel
|
||||
BuildRequires: CUnit, CUnit-devel, python3-pip, chrpath
|
||||
%if %{with doc}
|
||||
BuildRequires: doxygen mscgen graphviz
|
||||
%endif
|
||||
BuildRequires: ocf-devel
|
||||
|
||||
# Install dependencies
|
||||
Requires: dpdk >= 21.11, numactl-libs, openssl-libs
|
||||
Requires: dpdk >= 23.11, numactl-libs, openssl-libs
|
||||
Requires: libiscsi, libaio, libuuid
|
||||
Requires: fuse3, libboundscheck
|
||||
# NVMe over Fabrics
|
||||
@ -139,18 +94,15 @@ BuildArch: noarch
|
||||
--disable-tests \
|
||||
--without-crypto \
|
||||
--without-isal \
|
||||
--with-dpdk=/usr/lib64/dpdk/pmds-22.0 \
|
||||
--with-dpdk \
|
||||
--without-fio \
|
||||
--with-vhost \
|
||||
--without-pmdk \
|
||||
--without-rbd \
|
||||
--with-rdma \
|
||||
--with-shared \
|
||||
--with-iscsi-initiator \
|
||||
--without-vtune \
|
||||
--enable-raw \
|
||||
--with-nvme-cuse \
|
||||
--with-ocf=/usr/src/ocf-21.6.3.1
|
||||
|
||||
make -j`nproc` all
|
||||
|
||||
@ -163,13 +115,6 @@ test/unit/unittest.sh
|
||||
|
||||
%install
|
||||
%make_install -j`nproc` prefix=%{_usr} libdir=%{_libdir} datadir=%{_datadir}
|
||||
install -d $RPM_BUILD_ROOT%{_sysconfdir}/spdk
|
||||
install -d $RPM_BUILD_ROOT/opt/spdk
|
||||
install -d $RPM_BUILD_ROOT/usr/include/spdk_internal
|
||||
install -m 0744 ./scripts/setup_self.sh $RPM_BUILD_ROOT/opt/spdk/setup.sh
|
||||
install -m 0644 ./etc/spdk/nvme.conf.in $RPM_BUILD_ROOT%{_sysconfdir}/spdk
|
||||
install -m 0644 include/spdk_internal/*.h $RPM_BUILD_ROOT/usr/include/spdk_internal
|
||||
install -m 0644 lib/nvme/nvme_internal.h $RPM_BUILD_ROOT/usr/include/spdk_internal
|
||||
|
||||
# Install tools
|
||||
mkdir -p %{install_datadir}
|
||||
@ -196,26 +141,26 @@ mkdir -p %{install_docdir}
|
||||
mv doc/output/html/ %{install_docdir}
|
||||
%endif
|
||||
|
||||
%chrpath_delete
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
|
||||
%files
|
||||
%{_bindir}/iscsi_tgt
|
||||
%{_bindir}/nvmf_tgt
|
||||
%{_bindir}/vhost
|
||||
/usr/lib/python%{python3_version}/site-packages/spdk*/*
|
||||
%{_bindir}/spdk_*
|
||||
%{_libdir}/*.so.*
|
||||
%dir %{_sysconfdir}/spdk
|
||||
%{_sysconfdir}/spdk/nvme.conf.in
|
||||
%dir /opt/spdk
|
||||
/opt/spdk/setup.sh
|
||||
|
||||
|
||||
%files devel
|
||||
%{_libdir}/pkgconfig/*.pc
|
||||
%{_includedir}/%{name}
|
||||
%{_libdir}/*.a
|
||||
%{_libdir}/*.so
|
||||
%dir /usr/include/spdk_internal
|
||||
/usr/include/spdk_internal/*.h
|
||||
|
||||
|
||||
%files tools
|
||||
@ -230,6 +175,9 @@ mv doc/output/html/ %{install_docdir}
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Feb 20 2024 Hongtao Zhang <zhanghongtao22@huawei.com> - 24.01-1
|
||||
- Update to 24.01 LTS version
|
||||
|
||||
* Thu Jan 4 2024 Hongtao Zhang <zhanghongtao22@huawei.com> - 21.01.1-19
|
||||
- Fix deadlock due to lock sequence in bdev_unregister_unsafe
|
||||
|
||||
|
||||
BIN
v21.01.1.tar.gz
BIN
v21.01.1.tar.gz
Binary file not shown.
BIN
v24.01.tar.gz
Normal file
BIN
v24.01.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user