Use nvme_ns_construct()/nvme_ns_destruct() for each subtest.
This is what lib/nvme uses when creating/deleting namespaces,
so it makes sense to use the same functions in the unit test.
If we explicitly call memset(), we might hide real problems,
since e.g. nvme_ns_destruct() does not clear all struct members
in struct spdk_nvme_ns.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Ia0ffce3d0a29088282e9fc8fc5413b98d1fe7c63
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4264
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Clear the ns id desc list in nvme_ns_destruct().
Without this, someone can get stale data by calling e.g.
spdk_nvme_ns_get_uuid() on a destructed namespace.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I965dd4cd6101d3a77eddbd582b9618b3436d39c8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4263
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
When we disconnect a qpair, part of the code path is
calling _nvme_qpair_abort_queued_reqs. This takes
care of aborting any requests that were queued waiting
for slots to open on the submission queue.
It walks the STAILQ one by one and manually completes
them with ABORT status back to the caller.
But if the callback path submits another request, this
request may also get queued to the end of the queued_req
TAILQ. This can result in an infinite loop.
The solution is to use an STAILQ_SWAP to a local, empty
STAILQ. Then we ensure we only abort the requests that
were queued when _nvme_qpair_abort_queued_reqs() started
executing.
Fixes issue #1588.
I used the multipath.sh test to reproduce this on my local
system. If it ever dropped into the STAILQ loop in this
function, we would hit the infinite loop. With this patch,
I confirmed locally that now we safely avoid the infinite
loop and the test passes.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I657db23efe5983bd8613c870ad62695a7fc7f689
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4284
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
The thread loop function fuse_loop_new_thread() may not be executed
before checking the mount point.
For #1572 case, only one notice log as follow:
"Mounting filesystem on bdev BlobfsBdev to path /tmp/spdk_tmp_mount..."
For normal cases, there are two notice messages:
"Mounting filesystem on bdev BlobfsBdev to path /tmp/spdk_tmp_mount..."
"blobfs_fuse.c: 267:fuse_loop_new_thread: NOTICE: Start to loop blobfs..."
So add 1 second delay here.
Change-Id: I8f36fa538cb8864c94fe8110ced38703b7e2e413
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4260
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Remove some of the boilerplate code from each case and
replace with just an spdk_msg_fn assignment.
This also reduces the size of an upcoming change needed
in this function.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia209073cfb66032f2cca6bb44a09e1984ef2110c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4257
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
When the vhost-scsi target needs live recovery, check the inflight share memory,
and resubmit the inflight io.
Signed-off-by: Li Feng <fengli@smartx.com>
Change-Id: I785476c8835053a4e8d4f1d692437feaf3a9ace1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4092
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
On clear linux the # was interpreted as bash comment.
The result was that no file was included and CU_VERSION
was undetected.
Removing the backslash before hash resolves it on clearlinux,
but breaks on fedora 31. Workaround in this patch portable
for both, as strange as it looks.
For future reference:
Fedora 32, Make 4.2.1, gcc 10.2.1, bash 5.0.17
Clearlinux, Make 4.3, gcc 10.1.1, bash 5.0.16
While here, added more specific string detection for
CU_VERSION. Before patch e7a86c42 only CUnit header was scanned,
now other output from CC is. This will prevent accidental
matches in the future.
Fixes#1562
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ia4aa9fcbc3ad810755cfecd745c5c1ecd2a70717
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4240
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This was missed in CI, due to disabled SPDK_TEST_BLOBFS
test flag in UT job that performs check_so_deps.sh.
Error seen when it is enabled:
there was a dependency mismatch in the library blobfs_bdev
The makefile lists: 'bdev blob_bdev blobfs json jsonrpc log rpc thread util'
readelf outputs : 'bdev blob_bdev blobfs event json jsonrpc log rpc thread util'
Temporary workarounds have been added, ignoring blobfs_dev
in the abi check test. This will allow for better transition
on CI side. After this patch is merged, UT job flags on CI will be
updated to include SPDK_TEST_BLOBFS and abi reference repository
will be recompiled with this flag.
Next patch in series removes this workaround. It will be merged
after work on CI side is done.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I4753a918d5760f154d4a59349747a0b1356e9c91
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3961
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Rename ordering bit r2t_recv to h2c_send_waiting_ack, that is more
descriptive name.
Change-Id: I6d6143ff4c1cccc74e11226b7974706808092f9a
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4202
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This makes it easier to zerofy ordering bits.
Change-Id: If5696bfedfff1bf75e41c1449eac7fccb469e98b
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4201
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
DPDK compilation fails when we configure SPDK using --with-reduce:
../drivers/common/qat/qat_qp.c:18:10: fatal error: qat_sym.h: No such file or directory
#include "qat_sym.h"
^~~~~~~~~~~
But when SPDK is also configured using --with-crypto, DPDK is built successfully
--with-crypto enables build of crypto/qat driver and meson config for
this driver adds dpdk/driver/crypto/qat directory to QAT includes. This
directory contains the missing qat_sym.h and qat_sym_pmd.h files.
Group common drivers required by crypto/reduce
Fixes issue #1529
Change-Id: I7a53411798091e9a3c16442f3951ff73138d7337
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4179
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I68766e986268352159114dc2ddc9104a17a31718
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4137
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
The issue happens when SPDK RDMA initiator is connected to a remote
target and this target reports rather small (or zero) ICD and we try
to send several SGL descriptors.
Since SGL descriptors are located in ICD, we should check that their
total length fits into ICD. In other case sending such a command
will cause RDMA errors (local length error)
Change-Id: I8c0e8375dae799bc442ed2fab249cad2c4ccce51
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reported-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4131
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
uint32_t supports at most 2TB at most, we need to handle
the larger blobstores, fix this overflow problem.
Signed-off-by: Sochin Jiang <jiangxiaoqing.sochin@bytedance.com>
Change-Id: I27950eb759e9cb9ad48fa4aa8dd1976b4e852832
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4075
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Following the last patch, simply set NVMF_EXAMPLE directly without
using echo.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibc3b9268263f44c0b865a15a1ed1a15a404ed23e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4091
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
$USER gives the login name who logged in the terminal and
logname prints the login name who logged in the session.
test/nvmf/common.sh has used $USER to start the SPDK application,
as non-root but test/nvmf/host/perf.sh and
test/nvmf/target/nvmf_example.sh have used logname to start the
example application as non-root.
It looks OK to use $USER to start application as non-root like other
cases.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia0a17e3bd37a76e4d808e5816ba6716920f8f340
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4090
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
In C language, we cannot use constant at compile time. Hence the
local array _ana_desc[] is not a fixed size array but a variable
length array.
We can avoid using variable length array by changing const variable
to macro constant.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7333a8078d3102c4bd5088f56f6530846854c85f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4093
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Add an new RPC, nvmf_subsystem_listener_set_ana_state.
Find the specified subsystem listener, and then set the ANA state
of the listener by calling nvmf_subsystem_listener_set_ana_state().
By adding a string and an enum to the existing context structure,
nvmf_rpc_listener_ctx, and adding an operation type to the existng
enum, nvmf_rpc_listen_op, reuse the existing code and data as much
as possible.
Besides, insert line break into a few long lines and fix wrong
error log.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6fb2dfbb1f9c5f56848eba21d2a733fbed802614
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4080
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Add an internal API nvmf_subsystem_set_ana_state() to change the
ANA state of the subsystem listener whose trid matches.
ANA optimized state, ANA non-optimized state, and ANA inaccessible
state are supported. ANA change state is not used and ANA persistent
loss state is not supported.
After changing the ANA state of the subsystem listener, on each poll
group, controllers, whose the subsystem listener match, send ANA
change notice.
Initiators query ANA log page anyway if they receive ANA change
notification. False positive notification should be avoided but is
acceptable.
To avoid any concurrency conflict, simply compare ctrlr->listener and
the passed listener.
It may be better to execute nvmf_subsystem_set_ana_state() on the
subsystem thread but currently the RPC thread adds and removes a
listener to and from the subsystem, respectively, and the subsystem
has been suspended while executing nvmf_subsystem_set_ana_state().
Hence we keep this as a future enhancement.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If1910b79dd33d904114e258ae2c5e868947cdc52
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4079
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
If the ANA reporting feature is enabled for the subsystem,
- set ANA Change Notice of Asynchronous Event Configuration to 1
- set ANA Change Notice of Optional Asynchronus Event Supported to 1
- set ANA Non-Optimized state and ANA Inaccessible state of ANA
Capability to 1.
ANA Change state is not used and ANA Persistent Loss state is not
supported for now.
The next patch will actually support ANA Change Notice using an new
RPC.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4db2e33dd2879cdf995adcab41ef53728b27a201
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4087
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
When net.core.optmem_max is not set high enough, a call to sendmsg()
might fail with ENOBUFS. Currently this is treated as an error.
When we have no more buffer space left, we should continue to process
any completions and by doing so, free up the auxiliary buffers we ran out
of.
With this change I was able to run perf against the spdk target with a
purposely set to a low, value of optmem_max, where previously it would
fail.
This fixes github issue #1592
Signed-off-by: Jeffry Molanus <jeffry.molanus@gmail.com>
Change-Id: Ieeeed4fbecd827d0da815456b57fbe81495fe54d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4129
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
These were not really needed and parsing functions had to
be unnecessarily called multiple times.
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I277125bbb3d598a348164e8834843d0d04f1434c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4098
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Calculating kernel fio results did not take
number of workload retries into account for latency
stats.
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I418845d2f6be328827e4217c2eca761b0c211504
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4096
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Using only Bash for calculation in this script
results in operating only on integers, which lead
to wrong results being saved after test run.
For example - submission latency of 0.175usec was
saved as 0usec.
Change-Id: I6f9924d12189631ab6d0bdc5385e642b6c2aa34f
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4013
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
It aims to avoid bdev starvation by setting separate
io_context to each bdev_aio io channel and link them
into group channel.
Previous, each ch of aio_bdev on a same spdk_thread shares
same io_context. If one of them submits too many IO to the
io_context, then other channels will be starved.
Moreover, if the first bdev_io gets NOMEM error, then the
following IO of this bdev have no chance to get processed.
The bdev_aio starvation can be reproduced by bdevperf in
v20.04, by:
./bdevperf -q 100 -w randwrite -t 5 -c hdd.conf -o 1048576
(hdd.conf defines 2 aio_bdevs of HDD)
Change-Id: Ic709323f5baeb2f8f7250b75ad872ec4156b5e78
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3808
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Community-CI: Broadcom CI
In cases where the SPDK nvme driver is being used as a validation/test
vehicle, users may need to allocate a currently unused qid that can be
used for creating queues using the raw interfaces. One example would be
testing N:1 SQ:CQ mappings which are supported by PCIe controllers but
not through the standard SPDK nvme driver APIs.
These new functions fulfill this purpose, and ensure that the allocated
qid will not be used by the SPDK driver for any future queues allocated
through the spdk_nvme_ctrlr_alloc_io_qpair API.
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I21c33596ec415c2816728a600972b242da9d971b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3896
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
If we are already in the desired state,
just call the callback directly from the
subsystem_state_change function. That way
we save a lot of message passing.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I6cf8563524610d9125d53266e3c0e179e064bf63
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3760
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This is important to avoid doubling up on state changes
and hitting asserts.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: If8797ea13a5c224cee85e53e9b2542012423b37f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3759
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
We still need to be able to explicitly set specific
bits in the cluster array during initialization and
loading (especially recovery), so we use a bit_array
during load, and then convert it to a bit_pool just
before calling the user's cmopletion callback.
This gives a roughly 300% improvement over baseline
on a benchmark which does continuous resize operations.
The benefit is primarily from saving the lowest free
bit rather than having to always start at bit 0. We
may be able to further improve this by saving extents
in the bit pool as well, although after this patch,
the benchmark shows other hot spots different from the
bit search.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Idb1d75d8348bc50560b1f42d49dbe4d79d024619
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3975
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
spdk_bit_pool is a wrapper around spdk_bit_array with the
intentions of providing much better performance for allocating
from a fragmented bit array. The cost of searching a large bit
array for a cleared bit can become expensive so the spdk_bit_pool
will provide an ability to track extents of recently cleared
bits.
This initial commit does not adding the tracking yet - it is strictly
a wrapper around spdk_bit_array with enough functionality to replace
the use of spdk_bit_pool in SPDK blobstore with equivalent performance.
This will allow us to switch blobstore to use this minimal
wrapper first, and then iteratively improve spdk_bit_pool to provide
the better performance.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I95d0d12db47eac73e0641eb7f94fa5df43d42e45
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3974
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
The ctx allocation was duplicated after both bs_alloc
calling sites, so this reduces the code a bit. This change
also enables some future changes involving the used_clusters
bit array.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4ea98f079dbe385654e9cb9c0c58a1926a990c9e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3973
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This will allow for some additional simplifications
in future patches.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie421ad35f8c0efbb775fbe6bf85799af515264ef
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3972
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This prepares for some future patches.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If63c83f76e839b796c58200ddb0ca2137fbc4288
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3971
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Have it both find and set the lowest available cluster
bit index.
This will temporarily hurt the performance for cluster
allocation, since it will always search starting at
bit index 0. But upcoming changes in this patch set
will fix that again by using a new spdk_bit_pool object
that will do allocations much more efficiently than the
current implementation here.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iad199c9166b82cb9a31597a080f5a28823849e60
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3970
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Currently if we create a blob of 128 clusters, we
lock/unlock the used_cluster_mutex 128 times - once
for each cluster. Same when those clusters are released
when the blob is deleted. Batching these lock/unlock
operations is very easy and gives a noticeable
efficiency improvement.
My local benchmark (1GiB ramdisk, 4KB cluster size,
128 clusters/blob) creates enough blobs to fill the
blobstore and then continuously deletes and recreates
them. Performance increases 20% on that benchmark
with this patch.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic503accf1ca1ab1af7254b4067771d956f52014d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4069
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Not sure how this one was missed back during the big rename party.
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ia00819a2c2e8c81ad0499f4081667dde04fa726e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4140
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This may happen when resetting a controller, if the ADMIN queue failed
to reconnect, the controller is set to failed state, so for this case
we don't need to loop until timeout, just exit.
Change-Id: I2b37af5453086cd64f3609c41eb8f6475da55fd4
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4143
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: JinYu <jin.yu@intel.com>
There is no need for this interface to be async.
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I1f21b53e90b7d165b6b5fb2e1226ce7591966b58
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4181
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
It was introduced for the purpose of executing fabric cmds when
subsystem and qpairs are not active. It was rather workaround than
solution for transport type like vfio-user. spdk_nvmf_request_exec
is a preferred way of passing request obj into nvmf layer.
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I4f989de27bfd494c744017599909c2e200f0f233
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4180
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
If ctrlr->cdata.cmic.ana_reporting is 1, set the corresponding
field to true.
Then use its API in the identify application.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4e74bc4c114883e4aecdbee7a6f1a02027db23a5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4156
Community-CI: Broadcom CI
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This patch is used to enable placement_id getting
in sock layer and also add the rpc support.
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I70de57b0ed392a0aefce9d3ff1f61ef924015a87
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4146
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Add support for getting the Command Set Identifier for a given namespace.
The SPDK_NVME_CAP_CSS_IOCS feature can be implemented on top of an old NVMe
specification. If the feature is set, retrieve the NS ID Descriptor List
regardless of the NVMe specification version. The quirk is still respected.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I7b257115ecb0d813ba75201c0f48960c7070dcc9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4085
Community-CI: Broadcom CI
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Warn if found UUID descriptor length differs from NIDL for NIDT_UUID.
This will help identify non-compliant NVMe controllers.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Idf0daff9996147f38413318d1cd7fc3f929c5ce4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4138
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
In most cases, there is single element for iov array,
so using rbd_aio_read/write is enough.
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Id3ccbb4a4ff10be9d4546c8e89e6dc596d0f3a72
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4122
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>