Commit Graph

7495 Commits

Author SHA1 Message Date
Seth Howell
0d8f86f842 lib/nvme: don't submit request if qpair is disconnected.
This becomes a problem when the qpair is reconnected.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I6677b396cf766684a4891ffbee93aa3e4e83374d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3391
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-07-31 08:23:44 +00:00
Jacek Kalwas
92f29271d5 nvmf: add aqa property rsvd bits validation
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I824544f8b8faa040a5e0a6802c8ff611d3cb3b86
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3249
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-07-31 08:23:30 +00:00
Jacek Kalwas
e5bf2a1966 nvmf: fix aqa property validation
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I4de16c80fda5a39cfcdb15badb0d37acd1a5a21c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3102
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-31 08:23:30 +00:00
GangCao
51e8c2362b RPC: update the error message for current RPC state
This is to fix below issue:
https://github.com/spdk/spdk/issues/1516

Change-Id: Ibd7b4692b3d94fb7131aa0763d7fb7f6298d4101
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3565
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>
2020-07-31 08:21:37 +00:00
Changpeng Liu
da60639f86 rocksdb: call spdk_app_stop before exit the process
For some other reason when the host didn't have a block
device e.g: "Nvme0n1", we will call exit(1) directly in
the process, the ASAN will report memory leak issue, so
before exiting the process, we call spdk_app_stop to
do the cleanup.

Fix issue #1422.

Change-Id: I7b7a05807625586bd5b97dc31f41e2b86e1b323f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3586
Community-CI: Mellanox Build Bot
Reviewed-by: JinYu <jin.yu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-31 08:21:10 +00:00
Alexey Marchuk
6967fec6df nvmf/rdma: Submit recv to SRQ when AER is released
Currently we don't resubmit receive request associated with AER
request to SRQ. This leads to reducing of SRQ elements and may
lead to non responsive NVMF target.

Fixes #1507

Change-Id: Ie96f8c4be0202ae973e561ebe5ea28688a6a3b72
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3558
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-07-30 18:20:30 +00:00
Jin Yu
79c7744efb virtio: fix virtio hw double free issue
During virtio_pci_dev_probe, if enum_cb fails, hw needs
to be released. But in bdev_virtio, if vdev fails after
initialization, it will enter the bdev destruction process
which call the modern_destruct_dev function and hw will
be released during the process. So we will encounter the
problem of hw being released twice.

Change-Id: Ifba35284c072355ba0e10428b597a1894d32d59e
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3564
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-07-30 08:43:23 +00:00
Ben Walker
a9be2ce64a env: Rename pci_device_rte_hotremove to pci_device_rte_dev_event
Give this a more generic name. We're going to be using these
events for more than just hotremove coming up.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ia5356e9ab809807ba4d85ecc212a496e96012bce
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3559
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-07-30 08:43:06 +00:00
yidong0635
0d73f143b8 lib/iscsi: Put bits NAND or OR together.
We can OR some of the bits ,and setting them one time.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: Ie919ef66f3b8deea125df47d2194130b364c302a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3489
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-07-30 08:43:00 +00:00
Ben Walker
e12a4f6ec8 Revert "thread: add spdk_env_get_primary_core"
This reverts commit 6194cb2e15.

It's unclear whether we need to add a new API for the env layer
for upcoming work. Nothing currently uses it. When we have a clear
need, we can add this back in.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I174276799d650a1365b37a737271a54a796cd455
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3561
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-29 14:58:44 +00:00
Jin Yu
b45f293d57 vhost-blk: add resize bdev support
This will allow us to resize the backend bdev of vhost-blk
and notify the guest OS that the capactiy of virtio-blk
disk has been resized.

The spdk api entry is `spdk_bdev_notify_blockcnt_change`.
Any bdev if used as vhost-blk backend may need to implement
a rpc that calls this function.

Related DPDK patch has been merged and release in 20.02.
https://www.mail-archive.com/dev@dpdk.org/msg153365.html

Change-Id: I961c61de0fc03e210d776035a40f3a4adfa9b4f3
Signed-off-by: Li Feng <fengli@smartx.com>
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1468
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-29 08:05:31 +00:00
Seth Howell
0b1799cd98 nvme/transport: addd assert for transport.
Silences a KW error.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ifd8d6088a22de7c230d48751be2b3991d0649778
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3553
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>
2020-07-29 07:37:26 +00:00
paul luse
8d059e7a18 accel: add API to cancel a batch sequence
Added to the framework as well as all 3 engines.  Needed by apps
in the event that they have to fail following the creation of a
batch, allows them to tell the framework to forget about the batch
as they have no intent to send it.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Id94754ab1350e5a969a5fd2306bd59c38f0a0120
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3389
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: Ben Walker <benjamin.walker@intel.com>
2020-07-27 22:43:40 +00:00
Jim Harris
751e2812bc nvme: do not abort reqs in multi-process cleanup path
When a process cleans up IO qpairs from another crashed
process in a multi-process environment, we must not try to
abort reqs for that IO qpair.  Any reqs will contain callbacks
for the crashed process which we must not try to execute in
a different process.

Fixes issue #1509.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5e58cce7bdb86e3feb4084733815c086901f867e

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3536
Community-CI: Mellanox Build Bot
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-07-27 22:42:07 +00:00
Alexey Marchuk
3d1d4fcf54 nvmf/rdma: Send ibv async event to the correct thread
Since rqpair->qpair.group is set to NULL when we remove the
qpair from poll group, we fail to send event to qpair's thread.
This patch adds a pointer to io_chaneel to spdk_nvmf_rdma_qpair
structure and a function to handle poll_group_remove transport
operation. In this function we get io_channel from nvmf_tgt,
this channel will be used to get a thread for sending
async event notification. This also guarantees that the thread
will be alive while we are destroying qpair.

Change-Id: I1222be9f9004304ba0a90edf6d56d316d014efda
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3475
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-27 17:19:44 +00:00
Darek Stojaczyk
6b41a08654 dpdkbuild: build dpdk with meson+ninja
Makefile support in DPDK was deprecated and will be removed soon,
so switch to the officially supported way of building DPDK -
with meson and ninja. Two new tools. Basically, our Makefiles
will invoke meson+ninja for DPDK, no other SPDK components are
affected.

Apparently DPDK wanted to move away from an octopus-like config
system and the ideology behind meson configuration is simple now:
build everything by default. Some PMDs can be explicitly disabled
with meson command line, but all libraries (both static and shared
versions) and test apps are built unconditionally.

How long does it take to build minimal DPDK with meson? Too much.
On my machine half of the total build time is spent on libraries
we don't need at all. (I have some hacks up my sleeve to disable
building those libraries - see the subsequent patch.) As for the
official way of building a minimal DPDK, there was a patch [1]
on dpdk mailing list to introduce more specific configuration,
but it was rejected:

> We talked about this a few times in the past, and it was actually one
> of the design goals to _avoid_ replicating the octopus-like config
> system of the makefiles. That's because it makes the test matrix
> insanely complicated, not to mention the harm to user friendliness,
> among other things.
>
> If someone doesn't want to use a PMD, they can just avoid installing it
> - it's simple enough.
>
> Sorry, but from me it's a very strong NACK.

Let's not follow that direction, hack the DPDK build system instead.

As for advantages of meson+ninja over Makefiles? I can't find any.
It's another build system that does a lot for you with some functions,
magic options, and a built-in dependency system. It seems nice if you know
the syntax, but it's another component that you need to learn, debug,
and possibly find bugs in (there's a lot of github issues open for meson).
I would compare it to CMake.

As for changes in this patch: rather that explicitly disabling
PMDs we don't need, specify a list of PMDs we do need and disable
everything else found in ./dpdk/drivers/*. This way we won't have
to disable the new PMDs as they're added to DPDK.

Meson configuration also sets RTE_EAL_PMD_PATH #define to a valid directory
with built PMD shared libs. When it's set, DPDK dynamically loads all shared
libraries inside. The drivers there depend on DPDK shared libs and fail to
load in static SPDK builds, so we disable them altogether by unsetting
RTE_EAL_PMD_PATH in the meson-generated config file - just like
DPDK Makefiles did. EAL checks for RTE_EAL_PMD_PATH being empty and skips
loading any external PMDs then. We do it for both static and shared libs.
We specify all PMDs at build time for now, so there's just no need to load
them dynamically.

We have three more hacks in our submodule:
 * disable building dpdk apps by commenting-out a line in dpdk/meson.build
 * disable building unnecessary libs (build everything that spdk *may*
   need)
 * build isa-l compress pmd with `-L[...] -lisal`. DPDK expects to find
   libisal with pkg-config. We don't want to prepare a pkg-config file,
   so comment-out a failing check in another meson.build file and provide
   isa-l through CFLAGS and LDFLAGS.

We also need to make some changes to our test/external_code. First of
all, -ldpdk is no more. Meson build generates a pkg-config file with all
libs, but we'll switch to it in a separate patch - for now just specify
all -lrte_ libs one by one. -Wl,--no-as-needed has to be added to some
test cases, otherwise rte_mempool_ring isn't loaded. We don't use any
APIs from this library, it only has a static constructor that provides
a few callbacks used by rte_mempool_create(). Also, since DPDK now builds
both static and shared libraries, we need to add -Wl,-Bstatic to force
using static libswhere required. It's only needed for DPDK libs, but we
use it for SPDK libs as well since there's no harm.

As for performance:
$ ./configure --enable-debug --with-crypto --with-reduce
$ time make -j40 -C dpdkbuild all
with meson:
real    0m8.287s
user    1m7.983s
sys     0m10.548s

before, with the old DPDK makefiles:
real    0m20.232s
user    0m55.921s
sys     0m16.491s

The subsequent builds are much faster too:
$ time make -j40 -C dpdkbuild all
meson:
real    0m0.876s
user    0m0.663s
sys     0m0.217s

makefiles:
real    0m10.150s
user    0m11.740s
sys     0m6.772s

[1] http://inbox.dpdk.org/dev/1a07d1cd59d84dce84e56c10fdabf5e5504560a6.camel@debian.org/

Change-Id: Ic65db563014100bafb12e61ee0530cc2ae64401d
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1440
Community-CI: Mellanox Build Bot
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-07-24 22:06:11 +00:00
Darek Stojaczyk
cdffd22581 env_dpdk: move NVMe PCI driver definition to the nvme lib
Now that drivers can be registered from upper layers there's
no need to keep them centralized inside env.

(check_format.sh complains that spdk_pci_nvme_get_driver() shouldn't
start with the spdk_ prefix - to workaround that we move the function
declaration from one place in env.h to another - that's enough to
convince check_format it really is a public function)

Change-Id: If86aebd6c997349569c71430ec815b413eb44ef8
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3187
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>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-24 21:42:26 +00:00
Darek Stojaczyk
f425f16385 env: add spdk_pci_driver_register() to the public API
This allows SPDK apps to register new PCI drivers outside of
the env layer, enabling SPDK as a whole with new use cases.

Change-Id: I0c998a9ec249c3ca610b7b3b8b6caf616b16f64c
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3185
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-24 21:42:26 +00:00
Darek Stojaczyk
3498c0a886 env: add spdk_pci_get_driver()
An alternative to spdk_pci_*_get_driver();

Change-Id: I20a80b3c655a37fb1c76da21c2b70d5678041fab
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3186
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>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-24 21:42:26 +00:00
Darek Stojaczyk
e6decf684a env_dpdk: add DPDK-independent driver information to spdk_pci_driver
We want to make struct spdk_pci_driver public, so add env-agnostic
fields that define a driver directly to that struct.
PCI driver registration (potentially in upper layers) will only use
spdk_pci_id-s and spdk pci drv_flags, then those will be translated
to DPDK equivalents inside env_dpdk.

Change-Id: Ia24ecfc99ebf0f54f096eaf27bca5ed9c0dfe01d
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3183
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-24 21:42:26 +00:00
paul luse
f7d25cf7c7 lib/accel: remove dead code
Not needed with new scheme around accel_task in prior patches.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ic6f16654db62fe1dc51b0822f0ff92261da4494c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3212
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-24 19:38:46 +00:00
paul luse
ee7e31f9ae lib/accel: remove the need for the app to allocate an accel_task
This was sort of a clunky interface requiring a couple of inline
functions in every app that wants to use the accel_fw moving
forward. By having the accel_fw public API accept a callback arg
instead of an accel_task combined with adding a pool of accel_tasks
in the accel_fw engine we can eliminate this.

After changing the parm to a cb_arg, changes were made to all accel_fw
interfaces to put cb_fn and cb_arg as the last parms in public and
private function calls.

Related bdev_malloc changes need to be in this patch in order to pass CI.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I2b75764e534562d91484a094c3352266156d8425
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3209
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: Ben Walker <benjamin.walker@intel.com>
2020-07-24 19:38:46 +00:00
Seth Howell
c9bc86c061 lib/nvme: add checks for new states in reconnect_io_qpair.
This function hasn't kept up properly with the states that
we use for tracking the qpair lifecycle.

Add checks for NVME_QPAIR_DISCONNECTING and NVME_QPAIR_DESTROYING.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I51607d4f00e94937b08fca28e766163580d46461
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3359
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-24 15:43:07 +00:00
Xiaodong Liu
6194cb2e15 thread: add spdk_env_get_primary_core
Change-Id: I5b337477e41da7d424cccc48366ca6018b776ee2
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2448
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
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>
2020-07-24 15:25:57 +00:00
Xiaodong Liu
ef7c128a8a lib/event: enable repeated spdk_app_start/stop
With this patch, spdk_app_start/stop can be repeatedly
called by users based on their upper level application's
requirement.
Changes are:
* Add reinit ability inside spdk_env_init and related functions
* Clear g_shutdown_sig_received in spdk_app_setup_signal_handlers
* Clear malloc_disk_count in bdev_malloc_initialize

Change-Id: I2d7be52b0e4aac2cb6734cc1237ce72d33b6de0c
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2260
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-24 15:25:57 +00:00
Xiaodong Liu
30ff304290 env_dpdk: set g_external_init in end of func
Set g_external_init to false when the function calling
is succeed in the end of function spdk_env_init.

Change-Id: I3fc4b4c87b11ca34354efafdd9644c077309c638
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3455
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: GangCao <gang.cao@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>
2020-07-24 15:25:57 +00:00
Changpeng Liu
5d49baeb8e iscsi: use default MaxRecvDataSegmentLength for login response data length
Change-Id: I57205143fc29db96761791f2f6a20b4741875d58
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3458
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
2020-07-24 09:41:20 +00:00
Darek Stojaczyk
d3e1aa05db dpdkbuild: add support for DPDK 20.05
EAL got a new dependency in 20.05: rte_telemetry.

Change-Id: I43df7afe9a84e88f034a7f87fc6a299f0bbd8bac
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2590
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>
2020-07-24 09:40:37 +00:00
Michael Haeuptle
62649a7d7b lib/nvmf: Support custom admin cmd handler for abort
The new abort functionality doesn't take custom admin cmd
handlers into account.
This commit allows setting a custom admin cmd handler
for abort that provides the ability to influence the
bdev lookup to which the abort is sent to.

Signed-off-by: Michael Haeuptle <michael.haeuptle@hpe.com>
Change-Id: I3a66c6f863f5ee4d89cb2194dffdc6855945fa8a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3485
Community-CI: Mellanox Build Bot
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: Jim Harris <james.r.harris@intel.com>
2020-07-24 07:25:47 +00:00
Shuhei Matsumoto
e2b236ed50 lib/ioat: Update the major SO version for libspdk_ioat.so
ABI dependency check tool complained the following:

00:06:10.012  ************************************
00:06:10.012  START TEST confirm_abi_deps
00:06:10.012  ************************************
00:06:11.559  No corresponding object for libspdk_bdev_uring.so in canonical directory. Skipping.
00:06:12.237  No corresponding object for libspdk_event_sock.so in canonical directory. Skipping.
00:06:12.485  Please update the major SO version for libspdk_ioat.so. A header accesible type has been modified since last release.
00:06:15.388  No corresponding object for libspdk_rdma.so in canonical directory. Skipping.
00:06:15.663  No corresponding object for libspdk_sock_uring.so in canonical directory. Skipping.
00:06:15.954  Processed 55 objects.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2a6cc91ac56ed693ae0676cf64e01ed3ff620ffc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3511
Community-CI: Mellanox Build Bot
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-07-24 07:25:47 +00:00
Evgeniy Kochetov
29f31a90e1 sock: Add sock_impl option to disable zero copy on send
Zero copy send can cause performance degradation with small
payloads. This patch adds an option to disable it if required. By
default zero copy is enabled.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: I14f2b21ad375e770cb08f850360898bac675b351
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3344
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-24 00:30:45 +00:00
Evgeniy Kochetov
63c5e51ebc sock: Add sock_impl option to disable receive pipe
Receive pipe reduces number of system calls and gives significant
performance improvement with kernel TCP stack and relatively small IO
sizes. With user space TCP/IP implementations there are no system
calls and double buffering introduced by pipe has negative impact on
performance. Receive pipe remains enabled by default.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: Ic5ddee42293df2c233ba7ffbe6662de7917ac586
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3343
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-24 00:30:45 +00:00
Shuhei Matsumoto
81437ff6ce lib/nvmf: Remove req_to_abort parameter from nvmf_ctrlr_abort_request()
struct spdk_nvmf_request holds req_to_abort and so passing req_to_abort
separately is not really necessary now. The internal API
nvmf_ctrlr_abort_request() was added at the stage of prototyping.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9ef2467d6f92422f044650c62a0777b95c0fc1ab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3488
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2020-07-24 00:22:24 +00:00
paul luse
6a9e923da2 lib/ioat: add mew API to get the max # of descriptors supported
Needed by follow-on patches to aupport accel_fw batching in IOAT
module.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ie39718f42756c10af131ff7893874d19ea390ecc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3154
Community-CI: Mellanox Build Bot
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-07-23 22:26:39 +00:00
Darek Stojaczyk
3759b87082 env_dpdk/pci: remove driver->is_registered
Now that we support only DPDK 18.11+ and always have
to register pci drivers to DPDK on initialization we
don't need that flag - it's always true.

Change-Id: Ibf1d79155595609fe9093f58e056bea25db6fdb2
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3446
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-23 20:48:47 +00:00
Darek Stojaczyk
45528bfef6 env: add spdk_pci_id->class_id
This follows struct rte_pci_id which had class_id as well.
We'll need it to make some additional DPDK APIs public through
the env abstraction.

Change-Id: I794a6cd6b17e48daf53b48fa5abe3d3dcfeaa403
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3182
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-23 20:48:47 +00:00
Darek Stojaczyk
e8e46cb615 env_dpdk/pci: remove device detach callback
You don't get notified when someone starts using your hooked
device, so there's not much gain from knowing when someone
stops.

Remove that callback and also move DPDK device detach under
the same lock which sets the pending_removal flag. This eliminates
a data race window when hotremove notification could arrive
after device was detached, but before it was scheduled to be
removed.

vmd and ioat nest the spdk_pci_device struct and abigail complains
even though the parent structs only have forward declarations in
public headers. Adding those two structs to the suppression list
doesn't help though. Abidiff still complains about the pci device
struct being changed, probably because ioat.h and vmd.h both include
env.h. Abidiff suppresion list should eventually be split per-lib,
but for now ignore struct spdk_pci_device changes globally.

$ abidiff [...]/libspdk_ioat.so [...]

'struct spdk_pci_device at env.h:652:1' changed:
  type size changed from 1024 to 960 (in bits)
  1 data member deletion:
    <SNIP>

Change-Id: I9b113572c661f0e0786b6d625e16dc07fe77e778
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2939
Community-CI: Mellanox Build Bot
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-07-23 20:48:47 +00:00
Darek Stojaczyk
814072fa4e env_dpdk/pci: delay device initialization on hotplug
A workaround for kernel deadlocks surfaced in #1275.

DPDK basically offers two APIs for hotplugging all PCI devices:
rte_bus_scan() and rte_bus_probe(). Scan iterates through
/sys/bus/pci/devices/* and creates corresponding rte_pci_device-s,
then rte_bus_probe() tries to initialize each device with the
supporting driver.

Previously we did scan and probe together, one after another, now
we'll have an intermediate step. After scanning the bus, we'll
iterate through all rte_pci_device-s and temporarily blacklist any
newly detected devices. We'll use devargs->data field to a store
a timeout value (integer) after which the device can be un-blacklisted
and initialized. devargs->data is documented in DPDK as "Device
string storage" and it's a char*, but it's not referenced anywhere
in DPDK. rte_bus_probe() respects the blacklist and doesn't do
absolutely anything with blacklisted ones.

The timeout value is 2 seconds, which should be plenty enough
for an NVMe device to reset, leave the critical lock sections in
kernel, and let us initialize it safely.

Note that direct attach by BDF doesn't respect the blacklist,
so an NVMe attach RPC won't be delayed in any way, it will continue
to work as it always did. Only the automatic discovery & enumeration
is deferred.

Change-Id: I62b719271bd0755bc2882331ea33f69897b1e5e5
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1733
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-23 20:48:47 +00:00
Darek Stojaczyk
701d17f6d6 env_dpdk/pci: ignore rte_bus_scan() errors
Extensive testing showed it can fail:
> EAL: eal_parse_sysfs_value(): cannot open sysfs value
> /sys/bus/pci/devices/0000:02:00.0/vendor
> EAL: Scan for (pci) bus failed.

spdk_pci_enumerate() would previously return with error because
of this and e.g. the test nvme hotplug app could immediately exit
with failure. A mis-timed scan shouldn't cause this kind of failure,
so ignore it's return code. This shouldn't cause any issues.

Change-Id: I9253219c218981a747774a8632335963cfb0db53
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2941
Community-CI: Mellanox Build Bot
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: <dongx.yi@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-07-23 20:48:47 +00:00
Darek Stojaczyk
3554970375 env_dpdk: drop DPDK 18.08 support
DPDK versions 17.11 to 18.08 reached EOL.

Change-Id: Icfec27b0099f53d6ab00ec3aed63e5d30d94ee4d
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2940
Community-CI: Mellanox Build Bot
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: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-07-23 20:48:47 +00:00
Darek Stojaczyk
64c4fafd32 nvme/pcie: dont initiate hotremoval on SIGBUS for VFIO devices
This is an attempt to workaround a kernel data race spotted in #1275.
We have to delay our VFIO interraction until after the kernel handles
the PCIe hotremoval. Otherwise we risk having a deadlock inside the
kernel. We could put a dummy delay in SPDK hotremove routine, but we
don't know exactly how long we have to wait, so wait for the VFIO
hotremove notification to arrive instead. From what I understand it
is always sent after the kerner already releases the critical locks.

This patch breaks hotremove for VFIO devices when running with
DPDK version < 18.05, but those reached EOL already and their support
is removed from SPDK later within this series.

It would be nice to wait for this VFIO notification inside lib/env_dpdk
e.g. inside the detach function, but we don't know there why the
detach is happening. It could be triggered by a user RPC, not physical
device hotremoval.

Change-Id: I2727de923bb2e3e05a83202465330a32a77d7cfc
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1732
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: Ben Walker <benjamin.walker@intel.com>
2020-07-23 20:48:47 +00:00
Darek Stojaczyk
f280ce59b7 vmd: dont remove the hooked pci device on its detach
The hooked spdk_pci_device was being removed when someone
stopped using it (detached from it). The following didn't
work:

$ rpc.py bdev_nvme_attach_controller 10000:00:01.0
$ rpc.py bdev_nvme_detach_controller 10000:00:01.0
$ rpc.py bdev_nvme_attach_controller 10000:00:01.0

The second attach can't find PCI device 10000:00:01.0.
To fix it, simply don't do anything in VMD on device detach.
The entire callback will be removed soon. You don't get
notified when someone starts using your hooked device, so
there's not much gain from knowing when someone stops.

Change-Id: I147c24609077be24182ecfd2e273988a2e9e26b2
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2938
Community-CI: Mellanox Build Bot
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: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-07-23 20:48:47 +00:00
Darek Stojaczyk
7c6f0ef001 env_dpdk/pci: fix segfault on simultaneous VFIO hotremove and user detach
There was a chance we scheduled a device removal to the DPDK thread
while that thread was already removing the device from a VFIO hotremove
notification (on the DPDK interrupt thread). The second hotremove
attempt touches some freed memory and segfaults.

The VFIO hotremove notification already checks pending_removal flag
under a mutex and sets it to true, so do the same in spdk_detach_rte()
(called from the SPDK init thread).

Change-Id: Ib3f0eb7c0c5c6e1ab8cf253b7711fd149925a143
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1730
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2020-07-23 20:48:47 +00:00
Darek Stojaczyk
d3bcd1ca5b env_dpdk/pci: split dpdk device detach and removal
Simplify the code path a bit. VFIO notification is the only
place where detach callback is called from the dpdk intr thread.
Detach checks the current thread and behaves differently in this
case, but it could be the VFIO notification that simply calls
a different function.

So instead of carrying the VFIO notification through the generic
detach routine, carry it just through the DPDK-thread specific
subset. This lets us remove some ifs in the generic routine.

Change-Id: I5e8866e4643ef08fb3cd12621e2d262b5e827c74
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1731
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-23 20:48:47 +00:00
Darek Stojaczyk
b71ee92e3b Revert "pci: fix the hotplug issue"
This reverts commit 301c5aeec9.

The patch doesn't fix anything as the hotremoval could be still
called twice and the second call would do use-after-free.

Change-Id: I78a1120707dbdf36c871ec378a312c4a058fc76b
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1729
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-23 20:48:47 +00:00
Seth Howell
7192849ed2 lib: add checks for return code of pthread_spin_init
This function can fail with -EAGAIN or -ENOMEM so we
should really check the return value.

Change-Id: I4a443351f3c85032f47e8af9e70b6b71ba3413f5
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3240
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2020-07-23 07:25:21 +00:00
paul luse
8cee297c3f lib/idxd: add batching support for compare command
Also one small bug fix w/compare in accel_perf as a result
of changes made in accel_perf sicne base compare was added.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Id8e67bd9de9cbd006ac148f4a77807cc3e8e662b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2958
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2020-07-22 23:01:45 +00:00
paul luse
8d0334726f lib/idxd: factor out common code used in prep'ing batch commands
Create helper function.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I264f0ed067e4657f21ee38d875235b3410d9d04b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2957
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-22 23:01:45 +00:00
paul luse
80da74964a lib/idxd: add support for batching crc32c requests
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I38e8b26272e86e84e579262496b367375976638d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2955
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>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-22 23:01:45 +00:00
paul luse
e54f14a52b lib/accel: add batch prep for crc32c to accel fw and sw engine
Also update accel_perf to support it.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ida7b863de02c64239ec4cfbdc3b0235d4e0521f9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2954
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-22 23:01:45 +00:00
paul luse
396b05a3e4 lib/idxd: add support for batching the fill command
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I0996db55e78b7b74bf0a603ac0e9825a4d80d2e9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2953
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>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-22 23:01:45 +00:00
paul luse
d207237fc4 lib/accel: add batch functionality for fill command
Also as a minor drive-by, added verify capability for fill that
wasn't there before, useful in making sure the prep function
was working and really should have been there anyway.

idxd support for prep fill will follow.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ib54311c1fb98abd2fb61df6603cf3c5300b71161
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2952
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>
Community-CI: Mellanox Build Bot
2020-07-22 23:01:45 +00:00
paul luse
a7dfca5b45 lib/accel: have the accel fw default to use sw at times
When an engine has not filled out an entry point for an accel_fw
function, call the sw implmentation that's built into the accel_fw
transparently.

Also update the accel_perf app to no longer block attempts to use
capabilities not reported as supported by the selected engine but
instead to print an informational message.

The exception is batch related commands as their implementation
is specific to the engine.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I0b3971d075ced20182f97e95147e8887103e68cd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2930
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>
Community-CI: Mellanox Build Bot
2020-07-22 23:01:45 +00:00
paul luse
11c2e05fd8 lib/accel: add support for batching compare commands
Adds support for both the accel fw and the sw implementation.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ib8748f272a688a074ca475a86dea14179acc020d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2928
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-07-22 15:02:06 +00:00
paul luse
68a648ca90 lib/idxd: use more appropriate casting of ptr to int values
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I8e5b65c43d073bc479be145c3355d1974ee04d04
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2916
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-07-22 15:02:06 +00:00
Vitaliy Mysak
800b18d028 lib/conf: allow multiple sections with same name
Add disable_sections_merge() procedure that will allow
to have multiple sections with a same name.
This behaviour is how FIO treats such sections
and so will be used in bdevperf config file.

Change-Id: If221daeb7753d91b5d2608d25ccbb16f2d43ccce
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3433
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@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>
Community-CI: Mellanox Build Bot
2020-07-22 12:24:08 +00:00
Changpeng Liu
2d1fc3ca06 iscsi: report that long text responses isn't supported
When there are many Target information which exceeds the data
buffer, the initiator and target can use long text responses,
but SPDK doesn't support this feature now, so here we just
report an error here, we may add this feature in following
patches.

Fix issue #1442.

Change-Id: I5962c00943819cd11ce21e610e4b37265451f0cb
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3454
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-22 12:21:48 +00:00
Ziye Yang
1da44e0604 nvme_tcp: Move the default buffer factor size in nvme_tcp.h
1 Change the default factor from 4 to 8, which can be used
to improve the performance.

2 Change the base buffer size in nvme_tcp.c,
we should not use sizeof(struct spdk_nvme_tcp_cmd),
it is 72 bytes. Normally, the initiator will receive
C2h pdus and R2T Pdus by most, so set the size of using
sizeof(struct spdk_nvme_tcp_c2h_data_hdr) is enough.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I384f4cb026cb8d83e75b639f7256ee8cb8ed1df1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3283
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-07-22 12:21:07 +00:00
Seth Howell
f0be991330 lib/nvmf: complete requests in req_process for inactive qpairs.
There is no reason to continue processing these requests if the
qpair is not still active. We should complete them and free
any resources they are still holding.

Also, not doing so can cause issues with trying to access pointers
in the qpair after they are invalid. See issue #1460.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I6e570a576983dfedf726dc4a9a83316209403e00
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3451
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-07-22 12:20:55 +00:00
paul luse
22058d70fc lib/idxd: add support for batching dualcast commands
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ia5b5a346ae5c8470d9792766dba2bcf68c6fe2fd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2915
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: Ben Walker <benjamin.walker@intel.com>
2020-07-22 12:20:27 +00:00
paul luse
ec086e6f3f lib/accel: add support for batch dualcast to fw and sw engine
Includes a few related changes:

* slight refactor to have common prep function for batch prep
commands in the sw engine
* added support for dualcast batching in accel_perf example app

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: If9f078a0f8eb509d296e60a94331c92a72f8cb10
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2913
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: Ben Walker <benjamin.walker@intel.com>
2020-07-22 12:20:27 +00:00
paul luse
90c4ae4582 lib/accel: add batch capability and prep_copy() to sw engine
Doesn't provide any performance benefit but lets apps consistently
use the batch interface regardless of engine. Additional functions
and test code to follow.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ia737045560ddd5117a689f7715fa206268bbc13d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2911
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-07-22 12:20:27 +00:00
GangCao
ce1501218b RocksDB/BlobFS: add the related RPC module
Change-Id: Iff2730e3f410a7141004fdcf6ecfd31cb18d321a
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3265
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: JinYu <jin.yu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
2020-07-21 09:20:06 +00:00
Jacek Kalwas
81717da169 nvmf: use nvme print completion
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: If814edb3c99a7ed9f1800a634f293d3645884457
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3241
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-17 07:20:21 +00:00
Jacek Kalwas
afefd815ca nvmf: use nvme print command
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I22747fb342d2e50f40a3bae4f930957f755a97fd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3202
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-17 07:20:21 +00:00
Jacek Kalwas
b0a28e9509 nvmf: set group to null after qpair removed from the poll group
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I874fdb0771790e4a93bebbf812c30974dadc48e9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3091
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-07-16 07:40:32 +00:00
Shuhei Matsumoto
26e0ef9a36 lib/nvmf: Make abort execution timeout value optional
Make the abort execution timeout value as optional.

Zero is acceptable and means immediate timeout.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia4b03c65b8bd15899f48be9476ee657446147581
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3104
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-16 07:29:46 +00:00
Shuhei Matsumoto
3e1ab5ea18 nvmf/rdma: Wait until request is abortable if it is transferring
If the state of the request is TRANSFERRING_HOST_TO_CONTROLLER,
we cannot abort it now but may be able to abort it when its state
is EXECUTING. Hence wait until its state is EXECUTING, and then
retry aborting.

The following patch will make the timeout value configurable as
an new transport option.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia4b43e79c3b0d9c53ed04b01a9eaa9b117b32d81
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3013
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-07-16 07:29:46 +00:00
Shuhei Matsumoto
c1305e71b6 nvmf/rdma: Abort request whose CID matches if it is pending
If the request is queued and is not in completing, we can abort
it safely.

If the state of the request is NEED_BUFFERING, the request is
queued to tqpair->group->group.pending_buf_queue.

If the state of the request is DATA_TRANSFER_TO_CONTROLLER_PENDING,
the request is queued to rqpair->pending_rdma_read_queue.

If the state of the request is DATA_TRANSFER_TO_HOST_PENDING,
the request is queued to rqpair->pending_rdma_write_queue.

According to the current state, dequeue from the corresponding
queue, and then call an new helper function
nvmf_rdma_request_set_abort_status().

Using helper function will be easier to read.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id0327f4d2c4728a11b3b6bbc7c2252f0b35263cf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3012
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-16 07:29:46 +00:00
Shuhei Matsumoto
deec1fc790 nvmf/rdma: Abort request whose CID matches if it is outstanding
Call nvmf_ctrlr_abort_request() if the request whose CID matches
is found and its state is executing.

nvmf_rdma_qpair_abort_request() returns immediately if rc is
SPDK_NVMF_REQUEST_EXEC_STATUS_ASYNCHRONOUS, or calls
spdk_nvmf_request_complete() otherwise.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1462a21db7270f3d63f8f293ad4be61d52e74da1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3011
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-07-16 07:29:46 +00:00
Shuhei Matsumoto
040ee27c16 nvmf/tcp: Wait until request is abortable if it is transferring
If the state of the request is TRANSFERRING_HOST_TO_CONTROLLER,
we cannot abort it now but may be able to abort it when its state
is EXECUTING. Hence wait until its state is EXECUTING, and then
retry aborting.

The following patch will make the timeout value configurable as
an new transport option.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I98347b68e8b6b4a804c47894964cb81eae215aaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3010
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-07-16 07:29:46 +00:00
Ziye Yang
9a6a561149 lib/iscsi: Change the order of executing iscsi_clear_all_transfer_task
In my mind, we should firstly remove the sock from the group, then
all the call_cb of pdus will be handled, then we clear the task,
we can avoid the duplicated resource recycling.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Ic5fad130e58c9dcb42a237973979b042eabdf43a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3309
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-07-15 07:09:24 +00:00
Seth Howell
8e65bfc7e4 lib/log: add a check for localtime() failure
localtime() can technically fail and return a NULL
pointer. We should handle this case.

Change-Id: I5f9d11c5f992453ec3e3804bd17f5d05a863d526
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3245
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-07-15 07:09:19 +00:00
Shuhei Matsumoto
72eedc578d nvmf/tcp: Abort request whose CID matches if it is pending
If the request is queued and is not in completing, we can abort
it safely.

If the state of the request is NEED_BUFFERING, the request is
queued to both tqpair->group->group.pending_buf_queue and
the queue per state.

If the state is AWAITING_R2T_ACK, the request is queued to the
queue per state.

Dequeueing from the queue per state is done in
nvmf_tcp_req_set_state(). Hence explicit dequeuing only when the
state of the request is NEED_BUFFERING.

Most abort operation is common between two cases. We can use fallthrough
in switch-case but factor out the common operation into a helper
function nvmf_tcp_req_set_abort_status() instead because we may use
the helper function in future and using helper function is easier to
read than fallthrough.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1695b084d5d1f2537fbdd512bc3cd136e0f6a65b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3009
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-07-14 07:54:42 +00:00
Shuhei Matsumoto
b8a87e6af5 nvmf/tcp: Abort request whose CID matches if it is outstanding
Call nvmf_ctrlr_abort_request() if the request whose CID matches
is found and its state is executing.

nvmf_tcp_qpair_abort_request() returns immediately if rc is
SPDK_NVMF_REQUEST_EXEC_STATUS_ASYNCHRONOUS or calls
spdk_nvmf_request_complete() otherwise.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1abceecc211ee79d8ac18a82dc63b13d313a6f27
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3008
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-07-14 07:54:42 +00:00
Shuhei Matsumoto
604b4503c4 lib/nvmf: Add nvmf_transport_qpair_abort_request()
State machine is different among NVMe-oF transports and is
encapsulated to the transport neutral NVMe-oF controller and
NVMe-oF qpair.

To implement abort operation for each NVMe-oF transport,
add a function pointer qpair_abort_request to struct spdk_nvmf_transport_ops
and a stub nvmf_transport_qpair_abort_request() to encapsulate
which transport is used.

The following patches will implement qpair_abort_request for each
transport. Each qpair_abort_request() is responsible to call
spdk_nvmf_request_complete() for the abort request.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2beac959ed428c5108cf33691226b7fae5cd24d6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3007
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-07-14 07:54:42 +00:00
Shuhei Matsumoto
a8beb79ea3 lib/nvmf: Add nvmf_ctrlr_abort_request() to call nvmf_bdev_ctrlr_abort_cmd() from transport
If nvmf_ctrlr_abort_request() returns SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE,
the caller is responsible to call spdk_nvmf_request_complete().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6ed5f8611bcacd20385dd925b9b2e29ed2200269
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3006
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-07-14 07:54:42 +00:00
Shuhei Matsumoto
91b80fe287 lib/nvmf: Add nvmf_bdev_ctrlr_abort_cmd() to call spdk_bdev_abort()
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idc9957aabe0c3c24d2d36f1ac84b847b7455e7d8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2959
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-07-14 07:54:42 +00:00
Shuhei Matsumoto
f045d924fc lib/nvmf: Factor out abort operation on the specific qpair into a function
Factor out abort operation on the specific qpair into a helper
function nvmf_qpair_abort_request().

After this refactoring, nvmf_ctrlr_abort_done() calls
_nvmf_request_complete() only if the passed status is zero.
If the passed status is not zero, nvmf_qpair_abort() is responsible
for calling _nvmf_request_complete() instead.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4828c0e21cc7650210675661d6e1c0fd54c7a2cb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2991
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-14 07:54:42 +00:00
Shuhei Matsumoto
9975d4a1d2 lib/nvmf: Always return success and only toggle bit 0 of CDW0 for abort command
Description is not clear but according to the NVMe specification,
always set the completion status to success and differentiate only
the bit 0 of CDW0 between success and failure for abort command.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0195e72fe1d7fcc2592f47e9dcf92ac56912282c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1965
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-07-14 07:54:42 +00:00
Shuhei Matsumoto
71da42e953 lib/nvme: Add spdk_nvme_ctrlr_cmd_abort_ext() to abort commands whose cb_arg matches
A new API spdk_nvme_ctrlr_cmd_abort_ext() gets cmd_cb_arg as a
parameter, and use it to abort requests whose cb_arg matches cmd_cb_arg.

The caller can set the parameter qpair to NULL if it wants to abort
requests on admin qpair.

Hold ctrlr->ctrlr_lock throughout because abort request is submitted
to admin qpair.

The API is not critical for performance, and so initialize parent
data first.

The API is for a specific qpair, and so hold SQID in the parent,
and it is copied to the children. On the other hand, CID is set
to child when request to abort is found.

Use an new helper function nvme_transport_qpair_iterate_requests()
to add abort request for each outstanding request which has
cmd_cb_arg as its callback context.

The case is possible such that the request to abort is not outstanding
yet but queued. Hence abort queued requests which has cmd_cb_arg
as its callback context too, but it is done only if there is no error
so far.

If only queued requests are aborted and there is no outstanding
request to abort, complete with success synchronously.

If there is no outstanding or queued request to abort, return -ENOENT.

When any abort request is submitted, the difference between success
and failure is only bit 0 of CDW0 according to the NVMe specification.

We cannot the existing helper functions nvme_request_add_child() and
nvme_cb_complete_child() but can use nvme_request_remove_child().
nvme_qpair_submit_request() may use only nvme_request_remove_child()
from these three helper functions. Hence we use req->parent as other
types of request do.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3a271c6542f8e2e6b425b3bf6151f41e924bc200
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2039
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-14 07:54:42 +00:00
Shuhei Matsumoto
576a373d58 lib/nvme: Abort queued requests whose cb_arg matches
Use another list dedicated to hold queued requests being aborted
to avoid potential infinite recursive calls.

Add a helper function nvme_qpair_abort_queued_req() to move requests
whose cb_arg matches from qpair->queued_req to qpair->aborted_queued_req.
Then nvme_qpair_resubmit_requests() aborts all requests in
qpair->aborted_queued_req.

The first idea was that nvme_qpair_abort_queued_req() aborts queued
requests directly. However, this caused infinite recursive calls.
Hence separate requesting abort to queued requests and actually
aborting queued requests.

The detail of the infinite recursive calls is as follows:

Some SPDK tool submits the next request from the callback to the completion
of a request in the completion polling loop. For such tool, if the callback
submits a request and then aborts the request immediately, and the request
could not be submitted but queued, it will create infinite recursive calls
by request submit and abort, and it will not be able to get out of
completion polling loop.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8196182b981bc52dee2074d7642498a5d6ef97d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2891
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-13 08:40:42 +00:00
Alexey Marchuk
e137881e4e nvme/tcp: Insert free req at the head of the list
lifo model is more cache friendly

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Id937ab0c1b8b4ce121136144c7d6013bbe5eb963
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3282
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-07-13 08:40:31 +00:00
Evgeniy Kochetov
35429c9b5d sock: Save socket subsystem configuration in JSON format
Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: I32c25e6410c418ffa00a76559aa7b6999e2269ba
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/617
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-07-13 08:40:15 +00:00
Vitaliy Mysak
367c980b45 lib/conf: accept entries of form key=value
In INI config, split key based on whitespace AND symbol '='
This allows to have same format as FIO configs

FIO style config will be used for bdevperf config file

Change-Id: I92c501c839842919afb5c23ed935be010ae2b168
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3151
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-13 08:39:57 +00:00
Shuhei Matsumoto
ee7f961655 lib/iscsi: Unify outstanding_r2t_tasks array and active_r2t_tasks list into the latter
We have no particular requirement to keep both conn->outstanding_r2t_tasks
array and conn->active_r2t_tasks list now.

To improve readability and maintaineability, unify two into the latter,
conn->outstanding_r2t_tasks list. Update unit test accordingly.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I25cf7cffbe39ac66e102eb3052340de6ef65c8f1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3115
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-13 08:39:50 +00:00
Shuhei Matsumoto
d5f3f48b60 lib/iscsi: Fix iscsi_del_transfer_task deletes from both array and tailq
Previously iscsi_del_transfer_task() dequeued the task only from
the array conn->outstanding_r2t_tasks[].

process_non_read_task_completion() had dequeued the task from
the tailq conn->active_r2t_tasks then.

However abort_transfer_task_in_task_mgmt_resp had not dequeued the
task from the tailq conn->active_r2t_tasks then.

This was an apparent bug, and is fixed here. Update unit tests
accordingly.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I93f02b2fb670dcee4c32d61c264e3ad5b4f9f43e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3108
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-13 08:39:50 +00:00
Shuhei Matsumoto
41f59559e1 lib/iscsi: Return if conn->state is already exited when adding conn to poll group
Previously, we fixed a similar bug that iSCSI target got seg. fault
if connection is being exited between spdk_iscsi_conn_write_pdu()
and its callback iscsi_conn_login_pdu_success_complete() are executed.

This fix was not sufficient and we still saw similar error.

Not only socket write but also SPDK message is asynchronous and
connection may start exiting between iscsi_conn_schedule() and
iscsi_conn_full_feature_migrate().

This patch fix this new issue.

The previous fix was
https://review.spdk.io/gerrit/c/spdk/spdk/+/1275

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5cc422529a335e5f1982693bdf910ac7debe6f17
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3074
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-13 08:39:50 +00:00
Shuhei Matsumoto
66aec44a4b lib/iscsi: Manage active connections by TAILQ
Following the last patch, add g_active_conns to manage active connections
by TAILQ. We cannot remove the is_valid bit and g_conns_array
to support iSCSI top application, but this change simplifies the
code a little.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8b449f3056ffaed19f23f42d83c912dfba9a7b75
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3090
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>
2020-07-13 08:39:50 +00:00
Shuhei Matsumoto
89ae0e3c62 lib/iscsi: Manage free connections not by array but by TAILQ
Previously free connections had been managed by g_conns_array,
and allocate_conn() gets the lowest free connection. This had worked
almost as LIFO, and the just freed connection had been reused
immediately to the new connection.

Using TAILQ makes management of free connections FIFO, and this will
be more intuitive and simpler, and avoid potential issues due to the
fact that we do not know the state INVALID is the current connection
or the current connection is exited and the new connection is allocated.

This patch includes following updates.

Remove the test condition that the connection ID should be zero.
Connection ID is used as Target Transfer Tag (TTT) and TTT is opaque
number. Hence requiring connection ID to be zero is not meaningful.

iscsi_conn_free() calls free_conn() while holding g_conns_mutex, but
iscsi_conn_construct() does not call free_conn() without holding
g_conns_mutex. Hence add g_conns_mutex to the latter.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I204f66469f0bf54845c773da5b4ac86f3c8dca60
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3089
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-07-13 08:39:50 +00:00
Shuhei Matsumoto
e685db2caf lib/iscsi: Rename link pointer to pg->connections from link to pg_link
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I50902ebf0ac1ee103d2bf999578e68637efcc123
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3088
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-07-13 08:39:50 +00:00
paul luse
fc250841ca idxd: add batch capability to accel framework and IDXD back-end
This patch only includes the basic framework for batching and the
ability to batch one type of command, copy. Follow-on patches will
add the ability to batch other commands and include an example of
how to do so via the accel perf tool.  SW engine support for batching
will also come in a future patch. Documentation will also be coming.

Batching allows the application to submit a list of independent
descriptors to DSA with one single "batch" descriptor. This is beneficial
when the application is in a position to have several operations ready
at once; batching saves the overhead of submitting each one separately.

The way batching works in SPDK is as follows:

1) The app gets a handle to a new batch with spdk_accel_batch_create()
2) The app uses that handle to prepare a command to be included in the
batch. For copy the command is spdk_accel_batch_prep_copy(). The
app many continue to prep commands for the batch up to the max via
calling spdk_accel_batch_get_max()
3) The app then submits the batch with spdk_accel_batch_submit()
4) The callback provided for each command in the batch will be called as
they complete, the callback provided to the batch submit itself will be
called then the entire batch is done.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I4102e9291fe59a245cedde6888f42a923b6dbafd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2248
Community-CI: Mellanox Build Bot
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-07-10 07:31:09 +00:00
Jacek Kalwas
ed4b7d12ec nvmf: suppress scan-build warning
Logic error     Dereference of null pointer     ctrlr.c
nvmf_ctrlr_async_event_request  1522

Dereference of null pointer is not possible if sgroup obtained using
ctrlr obj. Adding corresponding asserts suppresses the warning.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I78b32fadd5449ee9b533f65193c70e55cf9a8f1c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3251
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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: Ben Walker <benjamin.walker@intel.com>
2020-07-10 07:30:59 +00:00
Jacek Kalwas
4d9ab1e9a1 nvme: pretty print dptr
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I576878fbbafc3d17617ceeec99e40565be7d5d3d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3213
Community-CI: Mellanox Build Bot
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-07-10 07:30:59 +00:00
Jacek Kalwas
64f05eb5c5 nvme: pretty print fabric cmd
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Ib4bc28026cab208d45c8b876714fa525e5bb38f3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3200
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-10 07:30:59 +00:00
Jacek Kalwas
9cd4723913 nvme: pretty print set/get features
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Ib6f1811da9a6294983bce04cff01ba1fb5e45607
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3179
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-10 07:30:59 +00:00
Jacek Kalwas
41b360d54e nvme: add missing cmds to admin opc string
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I6cdcf675ebc8ad31d88b5469f87e1eae066b2e3c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3178
Community-CI: Mellanox Build Bot
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-10 07:30:59 +00:00
Jacek Kalwas
61668cc43e nvme: introduce new set of cmd/cpl printers
Having functions without qpair on the interface allows for wider usage
e.g. by nvmf layer.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I3a51ad53f00eb29e2ba2681ef4ff0cc2a197b65d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3176
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>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
2020-07-10 07:30:59 +00:00
Jacek Kalwas
0555074965 event: expose base virtaddr as an option
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I062ac2b1de5a89d521bde926433139457f9168f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2777
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-09 07:23:40 +00:00
GangCao
249f95daeb BlobFS: fix the case where configuration field is not set
In the case that the configuration field is not set, it will
return "-1" and then implicitly convert to the unsigned
case where the variable is wrongly set.

Change-Id: I7b2c64d653badd731d8e6df46629231343a0ae6d
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3236
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-09 07:23:34 +00:00
Ziye Yang
4c9aad0299 nvme/tcp: Report the free entries if sending_ack is set
Previous we fix the same issue in this commit:
cb98b2ab3e

But we forget to fix it here. And we also need to update here,
otherwise we will still face the same issue described in
commit: cb98b2ab3e

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I3660dbb6e97c92ea4cb347cfce4bf23c6dfe97ab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3242
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-09 07:23:19 +00:00
Seth Howell
3b830202ca lib/nvmf: add an acceptor_backlog transport opt.
This allows users to configure the number of
connection requests outstanding to an rdma port
at once.

RPC included.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I8a2bb86b2fb7565cb10288088d39af763b778703
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3097
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-07-08 07:57:04 +00:00
Evgeniy Kochetov
c5c9a150a3 make: Create variable for event_bdev dependencies
Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: I7468dd242b83af8b41d72e503c212c1ffac1abd1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/614
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-08 07:56:46 +00:00
Jacek Kalwas
3dff6a3b48 nvmf: add util to get id from ctrlr
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: If9246be80d9d43863c1f9cc6ee33c1126dc67fd8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2983
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-07-08 07:55:03 +00:00
Maciej Szwed
5550beb879 nbd: Make nbd_poll return real busy/idle status
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ibced4f525b1fb8f57d493358f5b60a2d4009b5ac
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3150
Reviewed-by: Jeffry Molanus <Jeffry.molanus@gmail.com>
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>
Community-CI: Mellanox Build Bot
2020-07-08 07:54:38 +00:00
Jacek Kalwas
42f2f01a0e nvme: fix timeout log during ctrlr state change
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Icf6741f059ed92fdf0ee9fd0952acdd07711c69c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3226
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-08 07:54:29 +00:00
Shuhei Matsumoto
d80c9f6257 lib/nvme: Add underscore prefix to nvme_qpair_abort_queued_reqs()
This is a preparation to the next patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I15356c69e676dc41d3af69caa6d12c1fcb282152
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3071
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-07-08 07:54:01 +00:00
Shuhei Matsumoto
f2bd635ecf lib/nvme: Add qpair_iterate_requests() to iterate the common operation among transports
To abort requests whose cb_arg matches, add child abort request greedily.
Iterating all outstanding requests is unique for each transport but
adding child abort is common among transports, and adding child abort
is replaceable by other operations.

Hence add qpair_iterate_requests() function to the function pointer table
of transport, and pass the operation done in the iteration by a
parameter of it.

In each transport, the implementation of qpair_iterate_requests() uses
TAILQ_FOREACH_SAFE() for potential future use cases.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic70d1bf2613fce2566eade26335ceed731f66a89
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2038
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-07-08 07:54:01 +00:00
Shuhei Matsumoto
aa2ea2bed5 nvme/rdma: Follow the fix in TCP transport and restore nvme_rdma_req_put()
Recently two patches were merged but we should have get more reviews.
The fix done in TCP transport will be better because we can keep
the existing functions and make the code change minimum.

Restore nvme_rdma_req_put() and move removing rdma_req from
rqpair->outstanding_reqs to nvme_rdma_req_complete(). One exception
is the case that only nvme_rdma_req_put() is called. For the case
remove rdma_req from rqpair->outstanding_reqs before calling
nvme_rdma_req_put().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3f68dbc88c60af6b8f4ecc3209fde9b763ac3189
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3073
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-07-08 07:54:01 +00:00
Shuhei Matsumoto
ad69e739e1 nvme/tcp: Dequeue request from outstanding list before calling completion
Each request has a callback context as cb_arg, and the callback to
nvme_complete_request() for the completed request may reuse the context
to the new request.

On the other hand, TCP transport dequeues tcp_req from
tqpair->outstanding_reqs after calling nvme_complete_request() for
the request pointe by tcp_req.

Hence while nvme_complete_request() is executed, tqpair->outstanding_reqs
may have two requests which has the same callback context, the
completed request and the new submitted request.

The upcoming patch will search all requests whose cb_arg matches to
abort them. In the above case, the search may find two requests by
mistake.

To avoid such error, move dequeueing tcp_req from tqpair->outstanding_reqs
before calling nvme_request_complete(). One exception is the case that
only nvme_tcp_req_put() is called. For the case remove tcp_req from
tqpair->outstanding_reqs before calling nvme_tcp_req_put().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5f2ac292c60431ac1e27b8657db92b220860a0a8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2865
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-08 07:54:01 +00:00
Shuhei Matsumoto
e060285ea6 nvme/tcp: Change nvme_tcp_req_complete() to take tcp_req instead of req
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ida0ee76015821d7db54b273d14383a245a18047b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3058
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-07-08 07:54:01 +00:00
Evgeniy Kochetov
b1074c4905 sock/rpc: Add sock_impl_get/set_options RPC methods
Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: If1193ef647c85b045d7f14a03a9942783583f553
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/612
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
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>
2020-07-07 07:32:32 +00:00
Ziye Yang
449dee3563 nvme/tcp: Fix the sending conflict between cmd and h2c pdu.
As is well known, we may also handle the r2t data pdu receving earlier
before calling the cb function of send_cmd due to the outof order execution
of the lower layer uring socket interface.So we need to fix
this issue, otherwise the data of the sending_pdu will be placed with the
wrong data.

And it will cause the issue shown in
https://github.com/spdk/spdk/issues/1473

Fixes #1473

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Idac1ad65761695f3a655b85003861c1d1f4f3875
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3215
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-07-07 07:31:53 +00:00
yupeng
cb619b5229 bdev: add allowlist to bdev layer
When set bdev_auto_examine to false, the bdev layer will only
examine a device if it is in the allowlist. Currently the allowlist
is always empty. Will add api to add bdev to the allowlist in the
future.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: Iee7597623e7dd4172acc88736d23e0e5a4a2b03e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3101
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-07 07:31:22 +00:00
Ben Walker
30ee8137cf blob: Add a bitmask for quickly checking which blobs are open
This can speed up the check for whether a blob is already open
significantly.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: If32b0b1f168fcdb58e61df6281d7b7520725a195
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2781
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
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-07-07 07:30:58 +00:00
yidong0635
eb15a29f27 iscsi/tgt_node: Fix truncation warning on clear-linux-os-33460
Compiling warning :
spdk/lib/iscsi/tgt_node.c:550:42: warning: ‘%s’ directive output may be truncated
writing up to 2927 bytes into a region of size 1024 [-Wformat-truncation=]
  550 |  snprintf(port_name, sizeof(port_name), "%s,t,0x%4.4x",
      |                                          ^~
In file included from /usr/include/stdio.h:867,

gcc -v:
gcc-10.1.0-290-gc32074f6de

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I56fd5adfc461254751b54fd8610949e72ecbd8f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3216
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-07 07:30:31 +00:00
Maciej Szwed
eb05cbd677 pollers: Fix pollers to return correct busy status
Poller should return status > 0 when it did some work
(CPU was used for some time) marking its call as busy
CPU time.

Active pollers should return BUSY status only if they
did any meangful work besides checking some conditions
(e.g. processing requests, do some complicated operations).

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Id4636a0997489b129cecfe785592cc97b50992ba
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2164
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-07 07:29:31 +00:00
Jin Yu
d76951c7ba nvme_rdma: fix the recvs_to_post.first to NULL
nvme_rdma_qpair_submit_recvs is not judged in
nvme_rdma_poll_group_process_completions path.
If we do not clean the recvs_to_post.first we
may get the wrong current_num_recvs when the rc
is non-zero and call it again.

Change-Id: If0046e711525dcfcb419132a01fed7a09db13ba0
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3163
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@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>
2020-07-06 07:20:33 +00:00
Jin Yu
05805e54a0 nvme:disconnected state then destroying state
Put the destroying state after the disconnected state.
Because nvme_transport_ctrlr_disconnect_qpair will modify the state
of qpair to disconnected, and in the path of rdma, it will postpone
the deletion of qpair until the release of pg by judging the
destroying state. So qpair is not deleted.

Change-Id: Ica606905cddf67d0ffda14bd48cc5f4e424f01ee
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3136
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: <dongx.yi@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>
2020-07-06 07:20:26 +00:00
Jin Yu
19228a0602 nvme_rdma:fix current_num_sends to current_num_recvs
Change-Id: I1a3067165c06db3fe7d7fd1c1ec149e845100b27
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3162
Community-CI: Mellanox Build Bot
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: <dongx.yi@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>
2020-07-06 07:20:26 +00:00
Simon A. F. Lund
ae6c40a4a5 lib/nvme: fallback to NVM when then given command_set is not supported
When the user requests a non-default command set configuration, via the
probe_cb() supplied to spdk_nvme_probe(), which is not supported, then
the controller initialization will not proceed.

This patch changes that behavior into falling back to the NVM command
set and continue with the controller initialization. It is done by
assigning the NVM command set to opts.command_set such that the user
knows in attach_cb() with which command_set the controller is
configured/enabled.

The fallback is needed since the user does not have access to the
controller capabilities register. The strategy left for the user is thus
to try. However, this is an issue, as the user only has one attempt, as
subsequent calls to spdk_nvme_probe() will not trigger probe_cb() for
the controllers whose initialization did not proceed.

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: Ia414628fcd7d56956649647775462e62d98c0a90
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2931
Community-CI: Mellanox Build Bot
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-07-03 07:31:31 +00:00
Jim Harris
7ff9609f3d nvme: add security send/receive quirk for Intel 900P SSDs
These SSDs set the oacs.security bit but do not actually
support OPAL.  So do not set the controller flag indicating
SECURITY_SEND_RECV support in this case.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7fcfeafcc8d9439a1c53c60a1aea1801923a2ce5

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3156
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-03 07:31:20 +00:00
Sochin Jiang
7137bde120 lib/blob: fix a potential wrong release of md page
blob_insert_cluster_msg() will release the already claimed
md page(intended for extent page) if the corresponding extent page
is found to be allocated. But later blob_insert_extent() may fails,
and this cause blob_insert_cluster_cpl() to release the same md page again,
this could be wrong if this specific md page is clamied by others, thus
cause data corruption. So, put it to zero after released in
blob_insert_cluster_msg().

Signed-off-by: Sochin Jiang <jiangxiaoqing.sochin@bytedance.com>
Change-Id: I46eba79b24b1950318002dcb27cb51b01ca566ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3152
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-03 07:30:30 +00:00
Jim Harris
16364fdc14 nvme: copy 8 bytes at a time into virtualized CMB
QEMU won't emulate wide (>8 byte) instructions on an MMIO
region.  We tried to fix this previously but it wasn't sufficient.
So this version adds an explicit copy function that will only
copy 8 bytes at a time from the source cmd pointer into the
SQ cmd point in the virtualized CMB.

Fixes issue #1458.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I804005a2e8cf3f7365c1608674f82a3f843e59ba

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3135
Community-CI: Mellanox Build Bot
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-07-02 07:21:38 +00:00
Alexey Marchuk
e762508854 nvme_rdma: Add check for keyed SGL length
The length of a keyed SGL data block is limited by 3 bytes.
Add a check to fail requests which length exceeds 3 bytes.
In other case we can send an incorrectly formed SGL request with
an invalid or zero length.

Fixes issue #1450

Change-Id: I77cdaff5fbf4be5754a3ac6008b8ccd532ac5905
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3056
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-07-02 07:21:31 +00:00
Ziye Yang
cb98b2ab3e nvme/tcp: Report that we have free entries if send_ack is set.
Without this patch, we will face the following warning code
when compiled with (--with-uring --enable-debug) while testing
big I/O size: 256KB, e.g.,

"nvme_qpair.c: 474:nvme_qpair_resubmit_requests: *ERROR*:
Unable to resubmit as many requests as we completed"

The reason is because the nvme_tcp_request structure is not freed yet
if send_ack is not set, so there will be no entries when there
are other requests submit again.

And this patch can mitigate such issue.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I4c7616fbd3c82a883b4e9facd257a1a4f66e876d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3123
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-07-01 07:51:17 +00:00
Ziye Yang
a213592c89 nvmf/tcp: Fix the error return code
It should return "NVME_TCP_PDU_FATAL". I think that
this issue is introduced after we move the data
copy from tcp transport layer to the socket
layer. And it should return "NVME_TCP_PDU_FATAL now",
and it will be consistent with the logic in the same
function.

With this patch, it will fix the big I/O size write
from the initiator.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Ide018adb603eb13d002fc98886258dd1e2424f7c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3122
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
2020-07-01 07:51:17 +00:00
Tomasz Zawadzki
4c156e6379 lib/scsi: downgrade SCSI SO version
Internal headers (such as one in SCSI) should not trigger the
SO versoning fialures. This was addressed by patch:

(f53bf76)test/check_so_deps: limit scope of header checks.

Additionally quite recently another patch increased the SO version
for SCSI:
(6b6a3ff)scsi: add SPC2 RESERVE/RELEASE support

They were not in the same relation chain when being submitted,
so they didn't test against each other.

This resulted in:
SO name for libspdk_scsi.so changed without a change to abi. please revert that change.

For this reason this patch revs down the SO version for SCSI lib.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I69caae6c139e546afe2eeeae3395dc80ff898339
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3114
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-06-29 15:01:57 +00:00
Yan Wang
abeae98424 lib/blob: check return value after malloc() and strdup()
Signed-off-by: Yan Wang <wangyan122@huawei.com>
Change-Id: Ieaaecfd12ddf7826c2e4ce6dc5f47411e7e077da
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2907
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2020-06-29 09:20:12 +00:00
Darek Stojaczyk
1befc43b2d json_config: fix error message for loading failures
resp->error is usually a JSON object, but it was printed as
a string. For objects, resp->len was the number of fields in
this object, definitely not a length of the string to print.
There was usually just 3 characters printed with no newline.

To print this object we should stringify it using our json_write
library, so that's this patch does.

Before:
json_config.c: 192:rpc_client_poller: *ERROR*: error response: {"co
(missing newline at the end)

After:
[2020-06-19 13:33:57.060869] json_config.c: 220:rpc_client_poller:
*ERROR*: error response:
{
  "code": -32601,
  "message": "Method not found"
}
[2020-06-19 13:33:57.061067] app.c: 714:spdk_app_stop: *WARNING*:
spdk_app_stop'd on non-zero

Change-Id: I5d7aeba2b972782f18b8da0141ed4bfd79833f80
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2971
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-06-29 09:20:01 +00:00
Seth Howell
27f435bc1d lib/nvmf: raise RDMA acceptor backlog to 100.
10 is kind of unreasonable. You could easily start
seeing failures if you had just 3 intiators trying to
connect with 4 io qpairs at once.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I9985ffa3b03ebb33880eb5934b60eaafab57c82d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3096
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-06-29 09:19:09 +00:00
Seth Howell
203ed4f673 lib/nvme: report rdma_connect errors up the stack.
This will allow applications to discern specific connect
behavior and make choices relative to it.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I46182c285367ceb8a72511defe4508b3592b4572
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3095
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>
2020-06-29 09:19:09 +00:00
Alexey Marchuk
8421f83973 rdma: Fix qpair desctruction in error flow
rdma_qp may not be initialized when qpair is not fully
created. When such a qpair is being destroyed we may pass
a NULL pointer to spdk_rdma_qp_disconnect or spdk_rdma_qp_destroy
and hit an assert. This patch fixes this problem for NVMEoF
target and initiator.

Change-Id: I84787dc1b1211293c2a19f59d47727eaecd9d5a1
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3050
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
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>
2020-06-29 09:18:52 +00:00
Michael Haeuptle
89013903fe NVME: Fixes stuck IOs during hot remove (#1451)
When a NVMe device is hot removed, subsequent calls to
nvme_qpair_submit_request can fail with ENXIO.
The failure path handling for ENXIO did not free the request which
exhausts the qpair's free_req list eventually and all IOs are stuck
going forward.

This fix adds the same cleanup handling to nvme_qpair_submit_request
for this error case as it is done in _nvme_qpair_submit_request.

Signed-off-by: Michael Haeuptle <michael.haeuptle@hpe.com>
Change-Id: I5677d53965bdbd6d339c013483cdf42ce782099a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3018
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: Changpeng Liu <changpeng.liu@intel.com>
2020-06-29 09:18:29 +00:00
Ziye Yang
ceb07eb8f4 nvme/tcp: Fix send_cb and recv pdu function contention when there is R2T.
When using uring socket, we see following assert

nvme_tcp.c:1018: nvme_tcp_capsule_resp_hdr_handle:
Assertion `tcp_req->state == NVME_TCP_REQ_ACTIVE' failed.
Detailed info is in

https://ci.spdk.io/results/autotest-per-patch/builds/19205/archive/nvmf-tcp-vg-autotest/build.log

We face this issue, because there is also code execution ordering
between "sending callback function" and "pdu receving function".
We did not find it in physical machine testing, but finding it
in vagrant machine in CI.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I5eb241d564c0fc42ce0601b7c85999a2550f0de3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3046
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-06-29 09:18:13 +00:00
Changpeng Liu
6b6a3ff91f scsi: add SPC2 RESERVE/RELEASE support
Some OS(Windows and VMWARE esxi) will send SPC2 RESERVE/RELEASE
commands when formatting the filesystems, but in our previous
implementation of reservation feature, we didn't add such support,
in specification SPC3/4, they all include one section "Exceptions to
SPC-2 RESERVE and RELEASE behavior" feature for compatible support of
SCP2 RESERVE/RELEASE, so we add this support now.

Fix issue #1414.

Change-Id: I65d85ffb3b8f824b0ae4e130f53f01d95735d700
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2802
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-06-25 07:16:08 +00:00
Jin Yu
eb76afe78b event: add iova-mode parameter
Export iova-mode parameters in spdk which is useful in
VM environment.

Change-Id: I3f4756b2c3b6cf5d1964a50bbf63f9c596997696
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2910
Community-CI: Mellanox Build Bot
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-06-24 08:22:24 +00:00
Ziye Yang
2ac8d3ff5e nvme/tcp: Allocate send_pdu with DMA allocated memory.
Purpose: It will be used to leverage the uring acceleration
later when we use io_uring_prep_write_fixed.

Because for using the Registered buffers feature in I/O uring,
we currently can register all the huge memories. And if we
allocate send_pdus in DMA memory, we can leverage such feature.

Change-Id: Id0ba5f7fe43202027c0378e9cbe74d861aad21e5
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3002
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-06-24 08:22:17 +00:00
Shuhei Matsumoto
465b2f8a6b nvme/rdma: Inline nvme_rdma_req_put()
nvme_rdma_req_complete() and nvme_rdma_req_put() are called in a
row except a single case. Move clearing completion_flags and req
of rdma_req from nvme_rdma_req_put() to nvme_rdma_req_complete(),
and then inline nvme_rdma_req_put() because nvme_rdma_req_put()
does only insert now. To do this, change the type of the second
parameter of nvme_rdma_req_complete() from struct nvme_request
to struct spdk_nvme_rdma_req.

For the exceptional case that only nvme_rdma_req_put() is called,
change nvme_rdma_req_init() to clear rdma_req->req if returned with
error.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibf7e6d245f3a48fb895cd9e6d92596ef833f26d1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2876
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-06-24 08:19:43 +00:00
Shuhei Matsumoto
a57aeac1fe nvme/rdma: Dequeue request from outstanding list before calling completion
Each request has a callback context as cb_arg, and the callback to
nvme_complete_request() for the completed request may reuse the context
to the new request.

On the other hand, RDMA transport dequeues rdma_req from
rqpair->outstanding_reqs after calling nvme_complete_request() for
the request pointed by rdma_req.

Hence while nvme_complete_request() is executed, rqpair->outstanding_reqs
may have two requests which has the same callback context, the
completed request and the new submitted request.

The upcoming patch will search all requests whose cb_arg matches to
abort them. In the above case, the search may find two requests by
mistake.

To avoid such error, move dequeueing rdma_req from rqpair->outstanding_reqs
before calling nvme_request_complete().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia183733f4a4cd4f85de17514ef3a884693910a05
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2863
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-06-24 08:19:43 +00:00
Shuhei Matsumoto
299fce881a nvme/pcie: Dequeue request from outstanding list before calling completion
Each request has a callback context as cb_arg, and the callback to
nvme_complete_request() for the completed request may reuse the context
to the new request.

On the other hand, nvme_pcie_qpair_complete_tracker() dequeues tr from
pqpair->outstanding_tr after calling nvme_complete_request() for the
request pointed by tr.

Hence while nvme_complete_request() is executed, pqpair->outstanding_tr
may have two requests which has the same callback context, the
completed request and the new submitted request.

The upcoming patch will search all requests whose cb_arg matches to
abort them. In the above case, the search may find two requests by
mistake.

To avoid such error, change nvme_pcie_qpair_complete_tracker() to
dequeue tr from pqpair->outstanding_tr before calling nvme_complete_request().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie9efc200d06d02d8ee2be3cb8e9fd64591bc210d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2861
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-06-24 08:19:43 +00:00
Shuhei Matsumoto
aacac0b433 lib/nvme: Get ctrlr simply from req->qpair->ctrlr at spdk_nvme_ctrlr_cmd_abort()
req->qpair and qpair->ctrlr are set at their initialization, and
hence we don't have to store ctrlr to req->user_buffer but we can
get ctrlr simply from req->qpair->ctrlr.

Besides, save a local variable by overwriting qpair when it is NULL.
This is also a small clean up.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1cca763fbaae55079b38f7f16fcf779360232797
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2890
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-06-24 08:19:43 +00:00
Shuhei Matsumoto
43f3a8d99f lib/nvme: Factor out submit abort request into a helper function
To reuse the code for the upcoming new function
spdk_nvme_ctrlr_cmd_abort_ext(), factor out the operation to submit
an abort request into an new helper function
_nvme_ctrlr_submit_abort_request().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id00bed8fb8dc15b77e3c7f19105c1623588faa53
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2494
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-06-24 08:19:43 +00:00
Shuhei Matsumoto
5322f30787 lib/nvme: Fix aborting queued abort requests at controller reset or destruct
ctrlr->outstanding_aborts is counted only for submitted abort requests.
However ctrlr->outstanding_aborts had been decremented for queued
abort requests by mistake.

Subsequent patches will use parent-children for abort requests but
nvme_free_request() is not aware of such relationship.

Queued abort requests had not been canceled or aborted when controller
was destructed. Retry submitting queued abort requests had been
repeated recursively and had caused stack overflow.

This patch fixes all.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8ce0ae51ddd5ed3e1e8ac86329c8bdb7a9236b2f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2555
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-06-24 08:19:43 +00:00
Shuhei Matsumoto
5cbc1d5cae lib/nvme: Factor out retry queued abort into a helper function
To reuse the code for the upcoming new function
spdk_nvme_ctrlr_cmd_abort_ext(), factor out the operation to retry
queued abort into an new helper function nvme_ctrlr_retry_queued_abort().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I56bdfefe2c54990c9fd0463303b3d65ccf6e8942
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2493
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-06-24 08:19:43 +00:00
Shuhei Matsumoto
9d4751a550 lib/nvme: Fix Abort Command Limit to process as 0's based value
SPDK NVMe driver had processed ACL as 1's based value by mistake,
and SPDK NVMe-oF target sets ACL to 0. Hence If NVMe driver connects
to SPDK NVMe-oF transport, spdk_nvme_ctrlr_cmd_abort() always queued
abort request.

Fix this bug to process ACL as 0's based value in
spdk_nvme_ctrlr_cmd_abort(). Besides, initialize ACL explicitly to
0 in spdk_nvmf_ctrlr_identify_ctrlr() for clarification.

Signed-off-by: Michael Haeuptle <michael.haeuptle@hpe.com>
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id4f3a469776cdab88bcc6f41e7893885a7b78d8c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2513
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-06-24 08:19:43 +00:00
Shuhei Matsumoto
10c4193363 lib/nvme: Set the parent to failure when submission of any children failed
When one of the children is failed to submit, if any children is
already submitted, the function can return success to wait for those children
to complete, but the parent should be set to failure.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2ea53856ee58da991bceca0058d1e1f55d42af37
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2492
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-06-24 08:19:43 +00:00
Shuhei Matsumoto
b3d0c369a8 lib/nvme: Fix wrong completion status when retrying queued abort command
next->cpl should have been set if nvme_ctrlr_submit_admin_request()
failed in spdk_nvme_ctrlr_cmd_abort_cpl().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4114294e398b18148d8a9ad798a656a7686c5a85
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2491
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-06-24 08:19:43 +00:00
Wojciech Malikowski
c10c9bf767 lib/ftl: Evict valid cache entries when destroying io channel
When io channel is being destroyed some of its write
buffer entries could still be a valid cache entry.
This patch evicts all entries during io channel destroy
to keep consistent l2p table.

fixes issue #1434

Change-Id: I4e1cd206102c1f565b0f3e2dc90b5c2b3ed3d28c
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2964
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2020-06-22 15:48:47 +00:00
Ziye Yang
3a1f5364d2 nvme/tcp: Fix nvme_tcp_req free conflict between cmd sending and incoming pdu receiving
This patch tries to solve the out of order
call back handling for cmd sending and the incoming pdu handling.

Normally, the cmd call back will be called before
receving the next PDU from the target if the application
uses the sync manner.

With the uring implementation, after sending the
cmd to the target, we may have the following scenerio:
(1) Firstly receive the incoming pdu(e.g., CapsuleResp pdu, C2hdata pdu)
due to the group polling read event.
(2) Secondly execute the callback function related with NVMe command sending.

This means that the data from the initiator is really sent out to the target,
and the target receives, then sending back the data to the initiator. But the
uring io_uring_cqe event is not handled, thus if we execute
(1) first, it will clean the data structures related with nvme_tcp_req, and the
nvme_tcp_req will be used for other purpose. Then causes wrong behaviour like
the following:

"Rand Write test failed at QD=128 because fio hangs with the following error:
nvme_tcp.c: 971:nvme_tcp_capsule_resp_hdr_handle: *ERROR*:
no tcp_req is found with cid=66 for tqpair=0x7f23d8001710".

And this patch can address this issue.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I5043aaa8adf5033d93dedac15f633f0850e0b9f2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2818
Community-CI: Mellanox Build Bot
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-06-22 07:47:31 +00:00