Commit Graph

16220 Commits

Author SHA1 Message Date
Andreas Economides
93db90f7f3 nvmf/vfio-user: fix SQ race condition
The host driver should do a wmb() before it updates the SQ tail doorbell
to ensure that any writes to the SQ are guaranteed to be visible if a
doorbell update is visible (a store-release) - and indeed, this is what
the Linux NVMe driver does.

Therefore, we require a rmb() after we read the tail doorbell in order
to synchronise properly with the host driver (we need a load-acquire),
and guarantee that the updates to the SQ are visisble to us.

Signed-off-by: Andreas Economides <andreas.economides@nutanix.com>
Change-Id: I57eb1e1f0dfb1091a8f10f40f8ee0e2604d9268c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9514
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-20 10:48:22 +00:00
wanghailiangx
49911c47fb rpc: fix a description of method bdev_pmem_create_pool/total_size
Change-Id: Ic17588a9e904e400ae898407af217bf5001a16a4
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9152
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-17 07:10:06 +00:00
Krishna Kanth Reddy
490c83c6ac lib/nvme: NVMe ZNS - Zone Descriptor Extension support
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I11a72f48bf4e39e0547c29cb0213679ab24388b2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9494
Reviewed-by: Klaus Jensen <its@irrelevant.dk>
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: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-09-16 07:21:40 +00:00
Krishna Kanth Reddy
2d6736d153 include/spdk: NVMe spec header changes for Zone Descriptor Extension support
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I4459d9bcd06823ecaabbff4628b7038582b58f95
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9493
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Klaus Jensen <its@irrelevant.dk>
2021-09-16 07:21:40 +00:00
Konrad Sztyber
8da3c16612 nvme: asynchronously check CSTS.RDY in disable path
The CSTS reads in DISABLE_WAIT_FOR_READY_(0|1) states are now done
asynchronously.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I4ca8ad286e259e8fcfbf484223288554280347fe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8618
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-16 07:16:52 +00:00
Konrad Sztyber
ccc084f3f3 nvme: check CC.EN bit asynchronously
Checking if the controller is enabled (CC.EN == 1) is now done without
blocking.

Additionally, a copy of the controller configuration register (CC) value
is now stored in spdk_nvme_ctrlr.process_init_cc.  It'll be updated in
subsequent patches whenever the register is written / read.  This will
make it possible to make several function non-blocking without having
send asynchronous register reads.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I8323cf0c31a5ea282840aab6cf8ca241ce8667be
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8617
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-16 07:16:52 +00:00
Konrad Sztyber
9d8251f60d nvme: read the capability (CAP) register asynchronously
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I685e0ca772ff7e485db42a2179a84c483ec49cdc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8616
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-16 07:16:52 +00:00
Konrad Sztyber
09acc16286 nvme: read the version (VS) register asynchronously
This is is the first patch in a series changing all register accesses in
the NVMe controller initialization path to be asynchronous.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic4df9890992eafb402cf3372fe2ff3ac3c503932
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8615
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-16 07:16:52 +00:00
Jim Harris
fc8d861892 nvme: add new SET_EN_0 state for ctrlr initialization
This removes some code that was duplicated in the
CHECK_EN and DISABLE_WAIT_FOR_READY_1 states.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ie5d175540f71c692f7784c7ff22a48f34b9b7082
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8614
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-16 07:16:52 +00:00
Konrad Sztyber
d953072d21 nvme: add option to keep existing timeout
It will allow the async callbacks to retain the existing timeout while
changing controller's state.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I4210f2cf7d4171444c338b8926334b985129a6c7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8613
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2021-09-16 07:16:52 +00:00
Konrad Sztyber
38091aade8 nvme: extract ready timeout calculation to a function
It will make it easier to set this timeout once the register accesses
are performed asynchronously.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I9d61555a17380ddd57567db8dd912ef6d739fc01
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8612
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.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>
2021-09-16 07:16:52 +00:00
Konrad Sztyber
214ed8e37f nvme/tcp: hook async fabrics register operations
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2972df7c01a9a3f5ee4f59d6d0501e112a86f161
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8611
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-09-16 07:16:52 +00:00
Konrad Sztyber
94cec6a78a ut/nvme_ctrlr: asynchronous register get/set mocks
Added mocks in preparation for making the NVMe controller initialization
use asynchronous versions of the register operations.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ifbcc3c73933fb965db710389fec8cd2d52886d4d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8610
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-16 07:16:52 +00:00
Konrad Sztyber
eff86c7042 nvme/fabric: implement async register get/set functions
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib63aea443177814f3703dcdc34495a83c1c7e319
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8609
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-16 07:16:52 +00:00
Konrad Sztyber
efb2ed8751 nvme/fabric: extract prop set/get to separate sync/async functions
It will make it easier to support asynchronous register set/get
functions.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I9915609ff940596ae4d67388238cc685dfa426fa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8608
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2021-09-16 07:16:52 +00:00
Konrad Sztyber
1bea880598 nvme: asynchronous register operations
This patch introduces asynchronous versions of the ctrlr_(get|set)_reg
functions.  Not all transports need to define them - for those that it
doesn't make sense (e.g. PCIe), the transport layer will call the
synchronous API and queue the callback to be executed during the next
process_completions call.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2e78e72b5eba58340885381cb279f3c28e7995ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8607
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-16 07:16:52 +00:00
Changpeng Liu
e72453b39f nvmf/vfio-user: don't unmap commands without data buffers
libvfio-user will assert if the command didn't have data
buffers.

Fix issue #2124.

Change-Id: I43e9562c614bc65e54dbf650447369317c10f7b5
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9264
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: John Levon <levon@movementarian.org>
2021-09-16 01:17:52 +00:00
Andreas Economides
a89d15e46a event: add disable_signal_handlers to the spdk_app_opts struct
Currently, there is no way to prevent spdk_app_start() from calling
app_setup_signal_handlers() and setting SPDK's signal handlers.
We'd like to use our own set of signal handlers, therefore this
patch adds a flag to the spdk_app_opts struct that disables this
behaviour.

Signed-off-by: Andreas Economides <andreas.economides@nutanix.com>
Change-Id: I61d7cd66527d819fd5f687d5cc8a03be4fe10a6a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9380
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-15 07:11:42 +00:00
Andreas Economides
5930558212 spdk_top: display pollers' busy counts
Would be nice if we could see the busy count of each poller.
This patch adds a new "Busy count" column to the pollers tab,
and a field in the show_poller() window.

Signed-off-by: Andreas Economides <andreas.economides@nutanix.com>
Change-Id: Ic93ba9811bc0a45f262e358a1d34930c6917ff54
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8960
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: Krzysztof Karas <krzysztof.karas@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-09-14 16:08:37 +00:00
Andreas Economides
78d7ce3c90 spdk_top: fix sorting when total data is displayed
Even when g_interval_data was false, all three sorting functions
would still use interval data.

Signed-off-by: Andreas Economides <andreas.economides@nutanix.com>
Change-Id: I4650fd0bd8581e13a79cdf1dc972fdcada86afc4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8959
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-09-14 16:08:37 +00:00
Konrad Sztyber
a746dd6e60 make: use CXX to build libraries with C++ code
If a library contains C++ code, use a C++ compiler when creating a
shared object.  This ensures that the standard C++ libraries are
listed as dependencies.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Icc5321a628682e6dbdab0c053784e0750ebd29c2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9448
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-14 07:30:23 +00:00
Shuhei Matsumoto
d3d6f74ca1 bdev/nvme: Inline find_admin_path()
bdev_nvme_find_admin_path() is used only in a place and it's role
is to find a non-failed ctrlr even after multipath is supported.
Inline it into bdev_nvme_admin_passthru() will be better.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If58507c49b43d047e1f3ef25bbdfb571c36a1956
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9194
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-09-14 07:30:10 +00:00
Shuhei Matsumoto
2ee6ab36f9 bdev/nvme: bdev_nvme_reset() follow spdk_nvme_ctrlr_reset() about return value
Previously bdev_nvme_reset() returned -EBUSY if ctrlr is being
destructed and returned -EAGAIN if ctrlr is being reset.

These did not match what spdk_nvme_ctrlr_reset() returned.

Reset operation will be more important than current when multipath
is supported and reset operation is made asynchronous.

Hence change bdev_nvme_reset() to follow spdk_nvme_ctrlr_reset().
bdev_nvme_reset() returns -ENXIO if ctrlr is being destructed and
returns -EBUSY if ctrlr is being reset.

Additionally change the return value of bdev_nvme_failover()
accordingly. After the change bdev_nvme_failover() returns -ENXIO
if being destructed and returns -EBUSY if ctrlr is being reset.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie2c6f8601050b1043d83de9cf01490751784e4e5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8859
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-14 07:30:10 +00:00
Shuhei Matsumoto
6d2caa652b bdev/nvme: Include hostid into ctrlr_opts when calling bdev_nvme_create()
Following the last patch, include hostid into ctrlr_opts rather than
passing it as a parameter for bdev_nvme_create().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0d04db1c5767ec76a9a7cd255c3a8d56b0b8f583
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9344
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-14 07:30:10 +00:00
Shuhei Matsumoto
b0a6496a7b bdev/nvme: Save probe_ctx in nvme_ns and populate_namespace_done() refer it
nvme_ctrlr_populate_namespace_done() needs nvme_ns, probe_ctx, and completion
status.

When multipath is supported, nvme_ctrlr_populate_namespace_done() will
be called from the spdk_for_each_channel() callback. The spdk_for_each_channel()
callback can have one context and one completion status.

Hence nvme_ns or probe_ctx need to have another.

If an nvme_ctrlr has multiple namespaces, a probe_ctx is shared by
multiple nvme_ns.

So let nvme_ns has probe_ctx.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iedaaab80616d34d01935f4ebc31e1f3b84e09e32
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9047
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-14 07:30:10 +00:00
Shuhei Matsumoto
fbbc8c4f81 bdev/nvme: Restore the removed async callbacks for populating namespaces
For multipath, when an new nvme_ns is added to an existing nvme_bdev,
we need to add the corresponding qpair to all existing nvme_bdev_channels
dynamically. The RPC bdev_nvme_attach_controller has to return after that.
Hence populating namespace needs to be asynchronous.

On the other hand, when an nvme_ns is removed from an existing nvme_bdev,
we need to remove the corresponding qpair from all existing nvme_bdev_channels
dynamically. Hence depopulating namespace needs to be asynchronous.

By the recent refactoring, two callbacks, nvme_ctrlr_populate_namespace_done()
and nvme_ctrlr_depopulate_namespace_done() were removed accidentally.
We need to restore these.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I37ea2420588cef3a18648dec053f8bd2b884e86b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9392
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-14 07:30:10 +00:00
Shuhei Matsumoto
edc95ba117 bdev/nvme: Delete unnecessary function declarations from bdev_nvme.h
A few functions can be made private in bdev_nvme.c. Hence delete
these function declarations from bdev_nvme.h.

Besides, bdev_nvme_remove_trid() is only a function declaration.
Hence delete it together in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7bf9ae6da332c6426f6eb40926e7c4130d9acd8a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9444
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-14 07:30:10 +00:00
Jim Harris
e91d7428f9 nvme: print name of ctrlr state in timeout message
Previously the nvme_ctrlr_state_string() function
was only defined for DEBUG builds since it was only
used in DEBUGLOGs.  So now that we're also using
it for an ERRLOG we need to define this function
in release builds as well.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9468
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-13 07:44:59 +00:00
John Levon
7c4a245425 doc: fix a typo in accel_fw.md
Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I1404de46415f485f0f16311442f27135207f157a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9462
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-13 07:44:51 +00:00
Alexey Marchuk
abc45c4642 nvme/rdma: Don't log error for WC Flush Error
This type of errors is not fatal and can be observed when
qpairs are diconnected. The same approach is used in target
side.

Change-Id: Ic3c7b1731c0cbd2e98d776f0f0c5d82464b3d556
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9416
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-10 16:00:33 +00:00
Karol Latecki
8106e20726 autotest.sh: remove udev.log if tests successful
Remove udev.log just before exiting from autotest.sh.
This file probably won't be useful in case all functional
tests passed and leaving it unnecesarily bloats the output
directory.

Change-Id: I1c019a09ed573a0423e085ce96919162efec80a6
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9413
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-09-10 15:59:27 +00:00
Krishna Kanth Reddy
2f0f20d79b nvme_spec: Update as per the ZNS command set specification
The descriptions and structure member are updated as per the
ZNS command set specification.

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I687824bf9a08e98f0b8b9a49f513607c92de8275
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9445
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-09-10 15:59:19 +00:00
Karol Latecki
1f8e021e07 doc: add NVMe-oF RDMA 21.07 performance report link
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I68e3b6a6ace4812e152086c979a5070748592205
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9421
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-10 15:59:12 +00:00
Krishna Kanth Reddy
654c1fc8f3 scripts: ARM64 Cross-Compilation Support
This script contains the necessary steps for the cross-compilation
of SPDK and the libraries needed by SPDK for aarch64 on x64 machines.

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I6319f461242b267ca4b63f276d98ee8820085bfe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8784
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-09 20:26:59 +00:00
uubs
064cc9edac bdevperf: update the calculation of buffer content
This is to fix issue #2130.

Change-Id: I017f130f6247d49128839e664929db6cad521002
Signed-off-by: Xin Huang <xin.huang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9372
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-09-09 17:25:08 +00:00
Maciej Wawryk
cb85bf0b49 markdownlint: enable rule MD003
MD003 - Header style
Fixed all errors

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ic00d38a3fa0af16581598fd49dc2ee7e1632c9d8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9287
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-08 21:53:48 +00:00
Maciej Wawryk
111d42765d markdownlint: enable rule MD046
MD046 - Code block style
Fixed all errors

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I0a5f711a54e1859a6c8d0f26dcabf210496fb819
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9273
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-08 21:53:48 +00:00
Maciej Wawryk
63ee471b64 markdownlint: enable rule MD040
MD040 - Fenced code blocks should have a language specified
Fixed all errors

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Iddd307068c1047ca9a0bb12c1b0d9c88f496765f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9272
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-08 21:53:48 +00:00
Konrad Sztyber
1c81d1afa2 nvmf: clear ctrlr->listener in remove_listener
When removing a listener, there's a small window when the listener is
already freed, while the controllers that were created on that listener
are still active.  It happens, because the listener is removed before
disconnecting its qpairs and in turn destroying the controllers.

The ctrlr->listener pointer is now cleared when a listener is freed and
its value is checked for NULL before each use.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Iace65a46eebc5972cc4ef0f1c1822ffc5d3e559e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9237
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.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: Ziye Yang <ziye.yang@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-08 08:08:59 +00:00
Alexey Marchuk
fb4398ef4b nvmf: Correct the error path of transport creation.
An error might occur after succesful transport creation
when the new transport is added to nvmf poll groups, e.g.
in nvmf_transport_poll_group_create. In that case
transport is not detroyed and poll groups are not fully
functional. To correct this behaviour, destroy transport if
spdk_nvmf_tgt_add_transport fails. Also update nvmf_tgt
initialization step to check that all poll groups were
created.

Change-Id: I116e6944729d846c1755c2844c77825f65db8c12
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9255
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-08 08:08:41 +00:00
Ben Walker
d409971b79 bdev/nvme: Remove common.h/common.c
This only existed to share code between OCSSD and regular NVM
namespaces. Now OCSSD is gone, so just merge the files into bdev_nvme.

Change-Id: Idb73cc05d67144de5dd20af8db24c8f6974d10a7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9337
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-08 08:06:39 +00:00
Ben Walker
a8b0293094 bdev/nvme: Don't rely on knowing ctrlr->num_ns in
nvme_ctrlr_populate_namespaces

Avoid relying on this number. Different targets have interpreted its
meaning in different ways and it cannot be used anymore in practice. It
may also be very, very large.

Change-Id: I94e8eae49d6ccdbd8be302b30a120d89242b6d39
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9316
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Jim Harris <james.r.harris@intel.com>
2021-09-08 08:06:39 +00:00
Ben Walker
050346e05e bdev/nvme: Add accessors for getting namespaces
Try to use these accessors instead of directly using the namespaces
array. This will make changing the data structure easier later on.

Change-Id: I3367d0e0065894f3aa199ed1698d27976b4cbbb5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9315
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-08 08:06:39 +00:00
Ben Walker
282b8b70a7 bdev/nvme: Don't allocate inactive namespaces
If the number of namespaces is very large, this can cause excessive
memory allocation. This is especially true because when the number of
namespaces is large, it is almost always very sparsely populated.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I27d94956c222ae3c49c6a7422164ae3a8ec8d963
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9302
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-08 08:06:39 +00:00
Ben Walker
bb555ef1b0 bdev/nvme: Reverse order of checks in bdev_nvme_attach_controllers
Do simple validity checks first, then check for duplicate controllers.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ic21d64574b37a3d9148e5cd6d5a7599449ea8fe1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9341
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
2021-09-08 08:06:23 +00:00
Ben Walker
ae2ea64740 bdev/nvme: Report host parameters when listing controllers via RPC
Change-Id: Ia3a73d63fd0e8b2eee29be4dc7ea8736f2ffb6ab
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9339
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-08 08:06:23 +00:00
Ben Walker
3875f287dd nvme: Add spdk_nvme_ctrlr_get_opts
This is needed for reporting additional information in JSON RPCs

Change-Id: I45da2ea78cd5415f7536130b6793ca29e929b86e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9338
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-08 08:06:23 +00:00
Alexey Marchuk
343e2c8565 test/nvmf: Add test to cover subsystem destruction
Change-Id: Ide26bd4d1f6a83f28d47f63f09766e54895410f6
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6662
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-08 08:04:04 +00:00
Alexey Marchuk
ca5ce67f6e nvme/rdma: Ignore completion when we can't find qpair
When poll_group is used, several qpairs share the same CQ
and it is possible to receive a completion with error (e.g.
IBV_WC_WR_FLUSH_ERR) for already disconnected qpair
That happens due to qpair is destroyed while there are
submitted but not completed send/receive Work Requests

To avoid such situation, we should not detroy ibv
qpair until we reap completions for all submitted
send/receive work requests. That requires some
rework in rdma transport and will be implemented
later

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Idb6213d45c2a7954b9ab280f5eb5e021be00505f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9056
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-08 08:04:04 +00:00
Alexey Marchuk
00277bc5d5 nvme/rdma: Fix searching for qpair by qp_num
Poll group holds lists of qpairs in different states and
when we got rdma completion with error, we iterate these
lists to find a qpair which qp_num matches. qp_num
is stored inside of ibv_qp which belongs to spdk_rdma_qp
structure. When nvme_rdma_qpair is disconnected, pointer
to spdk_rdma_qp is cleaned but qpair may still exist in
poll group list and when we start searhing for qpair by
qp_num we may dereference NULL pointer.

This patch adds a check that pointer to spdk_rdma_qp
is valid before dereferencing it. To minimize boilerplate code,
wrap all check in macro. Add unit test to verify this fix.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I1925f93efb633fd5c176323d3bbd3641a1a632a9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9050
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-08 08:04:04 +00:00