Commit Graph

13299 Commits

Author SHA1 Message Date
Niklas Cassel
c31fc45324 ut/nvme: use nvme_ns_construct()/nvme_ns_destruct() in nvme_ns_ut.c
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>
2020-09-18 07:25:06 +00:00
Niklas Cassel
07525a91b5 nvme: clear the ns id desc list in nvme_ns_destruct()
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>
2020-09-18 07:25:06 +00:00
Jim Harris
792807a444 nvme: fix infinite loop when aborting queued reqs
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>
2020-09-17 21:34:58 +00:00
Changpeng Liu
5198fbeda8 test/blobfs: add 1 second delay before checking the mount point
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>
2020-09-17 15:25:16 +00:00
Jim Harris
7d5318cfb1 nvmf/fc: simplify nvmf_fc_master_enqueue_event
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>
2020-09-17 15:25:09 +00:00
Li Feng
ae8c48d4bb vhost-scsi: support live recovery
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>
2020-09-17 15:25:03 +00:00
Tomasz Zawadzki
9b294aeaa6 ut/blob: fix CU_VERSION check for clear linux
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>
2020-09-17 15:24:50 +00:00
Tomasz Zawadzki
a06628195e blobfs/fuse: add 'event' as dependency for blobfs_bdev
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>
2020-09-16 07:59:08 +00:00
Alexey Marchuk
e7c92b2426 nvme/tcp: Rename r2t_recv, set this flag when send_ack is 0
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>
2020-09-16 07:58:59 +00:00
Alexey Marchuk
dc88d13129 nvme/tcp: Move tcp_req ordering bits to union
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>
2020-09-16 07:58:59 +00:00
Alexey Marchuk
8db652e17e mk: Build crypto/qat when --with-reduce is specified
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>
2020-09-16 07:58:32 +00:00
Maciej Wawryk
2e2a0b947d scripts/vagrant: Change host ip in local.conf
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>
2020-09-16 07:58:21 +00:00
Alexey Marchuk
eb78b90ca8 nvme/rdma: Check that SGL descriptors fit into ICD
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>
2020-09-16 07:58:13 +00:00
Maciej Wawryk
0b510f0e83 scripts/vagrant: Add network interface for openstack tests
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I094f8e3c98fb9be4f952efa9ff751e0b1144e391
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4125
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
2020-09-16 07:57:56 +00:00
Sochin Jiang
5363eb3c4c lib/blob: fix an uint32_t overflow in blobstore init
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>
2020-09-16 07:57:42 +00:00
Shuhei Matsumoto
8701f636c6 test/nvmf_example: Not echo but substitute directly to NVMF_EXAMPLE variable
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>
2020-09-16 07:55:28 +00:00
Shuhei Matsumoto
0ecb36c727 test/nvmf: Use $USER instead of logname to follow other cases
$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>
2020-09-16 07:55:28 +00:00
Shuhei Matsumoto
5cf0c3707f lib/nvmf: Use macro constant for ANA descriptor to avoid variable length array
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>
2020-09-16 07:55:28 +00:00
Shuhei Matsumoto
c8cb51d4bc lib/nvmf: Add nvmf_subsystem_listener_set_ana_state RPC
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>
2020-09-16 07:55:28 +00:00
Shuhei Matsumoto
071d80f37b lib/nvmf: Add an internal API nvmf_subsystem_set_ana_state()
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>
2020-09-16 07:55:28 +00:00
Shuhei Matsumoto
523f2a85d3 lib/nvmf: Set up ANA Change Notice
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>
2020-09-16 07:55:28 +00:00
Jeffry Molanus
c66275c075 lib/sock: do not fail spdk_sock_flush() on ENOBUFS
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>
2020-09-16 07:55:22 +00:00
Karol Latecki
e4ff3a5bf1 test/nvme_perf: add iodepth_batch options for fio tests
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: Ia029df5c8c75eff6ba8db9f21756b91a8a0d9720
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4104
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>
2020-09-15 07:14:26 +00:00
Karol Latecki
67d4ef8dab test/nvme_perf: remove "case" blocks from results parsing
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>
2020-09-15 07:14:26 +00:00
Karol Latecki
c2f804d753 test/nvme_perf: fix kernel fio results maths
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>
2020-09-15 07:14:26 +00:00
Karol Latecki
20df041193 test/nvme_perf: use float arithmetics
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>
2020-09-15 07:14:26 +00:00
Xiaodong Liu
195fb4e40e bdev/aio: assign new io-ctx to each io-ch
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
2020-09-15 07:14:18 +00:00
Jacek Kalwas
4e06de69b8 nvme: expose functions to manage queue identifiers
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>
2020-09-15 07:13:46 +00:00
Seth Howell
848e9e2dd9 lib/nvmf: modify subsystem_state_change.
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>
2020-09-15 07:12:54 +00:00
Seth Howell
8ff8bf0713 lib/nvmf: add synchronization to subsystem state change.
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>
2020-09-15 07:12:54 +00:00
Jim Harris
bd16f57472 blob: switch to bit_pool for tracking used_clusters
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>
2020-09-15 07:12:44 +00:00
Jim Harris
0d2a5bbe17 util: add spdk_bit_pool
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
2020-09-15 07:12:44 +00:00
Jim Harris
04eb8e05d6 blob: allocate ctx in bs_alloc
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>
2020-09-15 07:12:44 +00:00
Jim Harris
39caf843a1 blob: consolidate init, load and dump ctx objects
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>
2020-09-15 07:12:44 +00:00
Jim Harris
0a19f43e05 blob: move spdk_bs_load_ctx earlier in the file
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>
2020-09-15 07:12:44 +00:00
Jim Harris
835fbef712 blob: simplify bs_allocate_cluster
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>
2020-09-15 07:12:44 +00:00
Jim Harris
ded02d0929 blob: batch used_cluster_mutex operations
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>
2020-09-15 07:12:44 +00:00
paul luse
7ad510b930 doc: add jsonrpc docs for compress bdev RPCs
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I38585f1cd609bb53f90ec8c169b14fb09808b6e1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4155
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>
2020-09-14 09:19:19 +00:00
paul luse
2b29a2b16c bdev/compress: rename RPC to match standard naming
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>
2020-09-14 09:19:19 +00:00
Changpeng Liu
fd5e781afc nvme: don't loop MMIO reads if the controller is already in failed state
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>
2020-09-14 09:19:07 +00:00
Jacek Kalwas
8387e97f90 nvmf: simplify listen_associate interface
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>
2020-09-14 09:18:57 +00:00
Jacek Kalwas
ae207216fb nvmf: remove request exec backdoor
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>
2020-09-14 09:18:49 +00:00
Shuhei Matsumoto
ce7eee9861 lib/nvme: Enable Async ANA Change Notice if supported
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ida297aaf5b8212dde5abfe8e2d3df8d333f6c109
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4157
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
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>
2020-09-14 09:18:35 +00:00
Shuhei Matsumoto
6c6efee89d lib/nvme: Set Add ANA log page to be supported by controller
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>
2020-09-14 09:18:35 +00:00
Ziye Yang
a6db2f3590 sock: enable placement_id configuration in sock layer
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>
2020-09-11 10:04:22 +00:00
Ziye Yang
ebb903d46e sock/uring: Add the support for enable_quickack
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: If908173600b7803dcf0e130f185dfdaec70c71c5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4148
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.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>
2020-09-11 10:04:22 +00:00
Ziye Yang
2c80fce02d sock/uring: enable "enable_recv_pipe" in uring sock
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: If62030a011ded73181b88f90fe87586a907af9ae
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4145
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.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>
2020-09-11 10:04:22 +00:00
Niklas Cassel
174a5fe140 nvme: add initial namespace types support
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>
2020-09-11 07:29:51 +00:00
Niklas Cassel
5c861295dd nvme: warn if found UUID descriptor length is incorrect
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>
2020-09-11 07:29:51 +00:00
Ziye Yang
e699355434 bdev/rbd: Still use rbd_aio_read/write if iovcnt=1
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>
2020-09-11 07:29:20 +00:00