Compare commits

...

1335 Commits

Author SHA1 Message Date
Karol Latecki
9d1b1fb332 config_converter.py: fix malloc num_blocks arithmetics
Use floor division so that operation results in "int"
returned.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I17126e81102b9f4612efc954213bab9ad55a9395
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10824
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-12-22 17:32:44 +00:00
Alexey Marchuk
7f10a88c11 lib/vhost: Fix compilation with dpdk 21.11
Structure vhost_device_ops was renamed to
rte_vhost_device_ops

Cherry-picked-from: f72cab94dd
Signed-off-by: Michal Berger <michalx.berger@intel.com>

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ie9601099d47465536500aa37fc113aeae03a8254
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10223
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10713
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-12-20 08:42:02 +00:00
Michal Berger
f343f73d57 autobuild: Move DPDK patches into the repo
Fetching these patches from external forks of DPDK repo is a bit
cumbersome and hard to maintain so instead have them in one place
for easy apply.

All of the patches were fetched "as-is" from the used forks, with
a commit section trimmed to provide just the relevant info.

Cherry-picked-from: 5673325a6f
Signed-off-by: Michal Berger <michalx.berger@intel.com>

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I6bf538ea15ef87fe04d5a77944de36c797cdf284
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10360
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10712
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-12-20 08:42:02 +00:00
Michal Berger
43df2c44a9 autobuild: Stop patching DPDK versions not tested under CI
Currently CI tests 21.08, 20.11 and the main branch. Maintaining
patches for other versions feels extraneous and adds only extra
work under autobuild.

Cherry-picked-from: d2d55a0359
Signed-off-by: Michal Berger <michalx.berger@intel.com>

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I2dfac60fe3745b09fbe7159b170739680c94a8c5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10359
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10711
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-12-20 08:42:02 +00:00
Michal Berger
024748c5c1 autobuild: Use patch instead of git am
It's more forgiving in case of small changes that force some fuzzing
like formatting changes. For instance, this change is currently breaking
our vs-dpdk builds:

f88b0b8922

Cherry-picked-from: d2d55a0359
Signed-off-by: Michal Berger <michalx.berger@intel.com>

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I8816ad59f930fa61ec081ac13e35129060f6cb86
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10135
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10710
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-12-20 08:42:02 +00:00
Tomasz Zawadzki
d3796d7d3e version: 21.10.1 pre
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6ca98438a33844aeabe2242fe4c9aa388bcf64c3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10050
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-29 07:15:27 +00:00
Tomasz Zawadzki
4e4f11ff78 SPDK 21.10
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id0f813fcf7613b4d22b921473f5059e7c4eced46
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10049
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-29 07:07:57 +00:00
Tomasz Zawadzki
fda5d3d8be dpdk: update submodule to allow using meson >= 0.60.0
This patch moves submodule forward to include patch below:
22e79be44f

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>

(cherry picked from commit 56d468010898b7f96c6caa214350e30977f949c4)
Change-Id: I4f2139325cfa7a186fdea24fb2a119f3871c7398
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10054
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>
2021-10-29 07:07:57 +00:00
Michal Berger
8ee2a317cf autobuild: Adjusting crypto build for latest DPDK (21.11)
Details of the changes here:
918fd2f146.

They mainly target the aesni_mb driver which was moved to ipsec_mb and
bump the minimal supported version of the ipsec to v1.0.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10003 (master)

(cherry picked from commit 089cbda8bf)
Change-Id: Ica3b4fd66684751939159511845eb6ac6f7d5205
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10039
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>
2021-10-29 07:07:57 +00:00
Changpeng Liu
9a91cbf3ef vbdev_delay: fix wrong usage of spdk_for_each_channel()
We can't call spdk_io_channel_iter_get_channel() in the
completion callback of spdk_for_each_channel(), the value
is always NULL.

Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9983 (master)

(cherry picked from commit 9024562463)
Change-Id: I65bc972da8a7ab309f3cab438432196a59f26bd4
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10015
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-28 07:04:47 +00:00
Changpeng Liu
377c115183 nvmf: only change CSTS RDY and SHN after no connected IO queues
When doing controller reset and shutdown, we may change the
CSTS.RDY and CSTS.SHN even there are pending IOs in the IO
queues, so here we add a timer in the reset and shutdown
callback, it will change the status when there are no
connected IO queues.

Fix #2199.

Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9908 (master)

(cherry picked from commit 534e2e7c04)
Change-Id: I3a54d30b257973661b269ad5e37637490f9390f4
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10014
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-28 07:04:47 +00:00
Alexey Marchuk
2ba691b76f nvmf: Add discovery filtering rules
SPDK nvmf target reports all listeners on all subsystems
in discovery pages, kernel target reports only subsystems
listening on a port where discovery command is received.

NVMEoF specification allows to specify any addresses/
transport types. Ch 5: The set of Discovery Log entries should
include all applicable addresses on the same fabric as the
Discovery Service and may include addresses on other fabrics.

To align SPDK and kernel targets behaviour, add filtering
rules to allow flexible configuration of what should be
listed in discovery log page entries.

Fixes #2082

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9185 (master)

(cherry picked from commit 3d8904c66b)
Change-Id: Ie981edebb29206793d3310940034dcbb22c52441
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10001
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-26 08:50:04 +00:00
Jim Harris
53dab80caa nvme/pcie: only set qpair state from qpair's thread
The qpair's state member is only 3 bits of a uint8_t,
and the in_completion_context bit is another bit in that
same uint8_t.

We know that the qpair's state is only ever updated by
one thread, but it is possible that the state could
be modified by one thread, while another thread
is modifying in_completion_context.

in_completion_context is only modified by the thread
that is polling the qpair (or the qpair's poll group).
But with async mode, another thread that has a qpair
on the same PCIe controller could poll its adminq and
reap the SQ completion for the qpair that's owned by
the other thread.

So do *not* set the generic qpair state to CONNECTED
from the SQ completion callback.  Instead just set
the pcie_state to READY, and let the thread that owns
the qpair detect the qpair is READY and set the state
to CONNECTED itself.

Fixes issue #2157.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9975 (master)

(cherry picked from commit e40bd53175)
Change-Id: I9efc0c954504f1841e1c3890ae78211ad0d1990e
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10000
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-26 08:50:04 +00:00
Krzysztof Karas
98b1301fe4 trace: shorten tpoint names
Some of our tpoints have a name exceeding 24 characters.
Althought this is not problem for SPDK, it might cause
confusion, because error messages are printed.

Tpoints regstered inside fc.c had their _REQ_ part removed,
since it was used in all of them.

Fixes #2208

Change-Id: I598eb9c1d252d8ca6c83f82e564a6b53037936f4
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9963
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-22 18:08:05 +00:00
Tomasz Zawadzki
890f1ae38d CHANGELOG: add missing entries for SPDK 21.10
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I28afb06d7cee0ebbd6bbe6fb87ef7cf700e7de1d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9956
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-22 16:01:23 +00:00
Tomasz Zawadzki
93e2ff5ac4 CHANGELOG: fix ordering and formatting
Ordered sections alphabetically and fixed minor errors.

Moved a section from SPDK 21.07 to SPDK 21.10 introduced
in patch (38a30da5bd). That patch was not part of SPDK 21.07.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ic4514d790686fca510d39dfbe2bc2bf08aae21ad
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9955
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: Changpeng Liu <changpeng.liu@intel.com>
2021-10-22 07:06:04 +00:00
Tomasz Zawadzki
15b0fb3a71 docker: Add virtio traffic generator
Expand the traffic generator container into two:
- traffic-generator-nvme, which uses NVMe-oF to connect
to proxy-container
- traffic-generator-virtio, which uses Virtio to connect
to proxy-container

Added second device Malloc device in storage-target,
and second subsystem shared between storage-target and
proxy-container.
The proxy-container and traffic-generator-virtio share
named volume in order to pass the vhost socket file.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I889dc19f523255f10b22e15f5e5f437b33ae796d

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9667
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-10-22 07:02:52 +00:00
Michal Berger
e8ea27f859 docker: Add docker-compose for building basic SPDK containers
This suite can be used to deploy containers with the following
functionality (more details in README.md):

- storage-target
- proxy-container
- traffic-generator

This will run simple fio test as per fio.conf against nvmf controller
provided by initiator-container. Similar task can be performed directly
from initiator-container as well.

Each container includes SPDK installation with most common tools, e.g.
rpc.py, available under $PATH. This allows for something like:

docker-compose exec storage-target rpc.py nvmf_get_subsystems

Note that SPDK environment heavily depends on a running kernel hence all
the containers need to be privileged. That said, to make sure containers
are not affecting the host too much, some tasks must be done prior running
them. This includes:

- loading proper kernel modules (like nvme-fabrics, etc.)
- allocating hugepages and having at least one hugetlbfs mount
available under /dev/hugepages

base_build is created as docker multi-stage build.

This is done in order to decrease the size of the final image. The
SPDK RPMs are built inside a base image and then copied over to the
main image (+ fio binary) - this leaves all the dependencies inside
the intermediate image instead of the final one.

The resulted difference in size may look similar to the following
(it may differ depending on the docker version etc.):

no multi-stage build: spdk_base == 1.04GB
multi-stage build: spdk_base == 261MB

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I825bd0d0bb4071bd9d44b6a0749c033894899ae0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9055
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-10-22 07:02:52 +00:00
Ben Walker
b098640f05 bdev/nvme: bdev_nvme_detach_controller now understands host parameters
You can now detach specific paths based on the host parameters. This is
useful for two paths to the same target that use different local NICs.

Change-Id: I4858bfda7d940052ca77ffb0bbe764a688fb315d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9827
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-10-22 04:28:22 +00:00
tanlong
8a154b2c0d bdev/rbd:Add uuid to bdev_rbd_create to support multipath when rbd used as ns of nvmf target
This patch is to solve the issue that two nvmf target connect the same rbd image and used for multipath.
The scenario is host wants to access the same rbd image via two gateways, host and gateways are working as nvmf ini and tgt, and two gateways connect with the rbd image, io can switch to another gateway once one is broken. The targets of multipath must have the same uuid, so this patch add a new argument for bdev_rbd_create, like malloc dev.

Signed-off-by: tanlong <948985618@qq.com>
Change-Id: I593fedb6c5d94f625f1b331fdc40e2db488f7fb7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9935
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-22 00:38:18 +00:00
Changpeng Liu
76e1ac04c7 env/dpdk: fix the PCI detach error in secondary process
DPDK will report error when detaching the PCI device in secondary
process, because SPDK will return -1 in `pci_device_fini`, so
here we will reset the `attached` flag before that.

Also return the errno instead of -1.

Change-Id: I3efa4d97ceab504215faeb9d3d80a694bdd6014c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7944
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Dong Yi <dongx.yi@intel.com>
2021-10-22 00:36:41 +00:00
Maciej Wawryk
1aa72efad3 scripts: exit from tests when no qat card
Also moved qat_setup.sh to functional tests
fixes: GH#2203

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Iab69b192a29013a69f4cc4a251a34dcc6fbf6b7d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9952
Reviewed-by: Michal Berger <michalx.berger@intel.com>
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: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-10-21 21:26:44 +00:00
Tomasz Zawadzki
88f5864005 dpdk: update submodule to allow hugetlbfs sub-directories
This patch moves submodule forward to include patch below:
1fcbb74487

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I24a9108d31aa048c0e0768678dd3d58321f4da4a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9900
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: Ben Walker <benjamin.walker@intel.com>
2021-10-21 21:26:16 +00:00
Liu Xiaodong
b1906912e9 thread: reap unreg pollers in intr
When intr mode is enabled, it will be common that
poller is unregistered during interrupt processing.
Since poller unregister is a delayed operation,
mark it in spdk_thread object, and reap unregistered
pollers out of poller execution.

Fixes #2143

Change-Id: Ieb61fc7685f85af5c15e833dd1dd56f8c97a3b12
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5770
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-21 21:25:53 +00:00
Krzysztof Karas
3c271d5e4c scripts/bpf/trace.py: enable printing relations for NativeProvider
Currently the only way to see the relations, while using trace.py script,
is to feed it a JSON formatted file. This patch allows trace.py
to do the same for the for the binary trace files.

Change-Id: I7237896ede608080d3bec896a43586e34c297b04
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9906
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-21 17:57:33 +00:00
Krzysztof Karas
5594c7c847 scripts/bpf/trace.py: print relation information
Make use of the changes introduced in previous patches while
printing trace information.

Change-Id: I69edadfb4a7d34fa9c8c1c520b083372317cabbb
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9638
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.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>
2021-10-21 17:57:33 +00:00
Krzysztof Karas
ed54725a79 app/trace: include relation information while printing json
Add relation information to printed json traces to later read them
in trace.py.

Change-Id: I090b7ffa2b85da00b6ad57825c7208dd5cfc396a
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9637
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.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>
2021-10-21 17:57:33 +00:00
Krzysztof Karas
5d95e31510 lib/nvmf/tpc.c: add relations between tcp io object and bdev traces
This patch makes use of the changes from  previous patch and to
show connections between bdev events and tcp events.

Change-Id: If28c256d74a9a5d581ee4d8292a08fc061fee968
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9622
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.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>
2021-10-21 17:57:33 +00:00
Krzysztof Karas
70c171602a trace: enable adding relations between traces
Currently we do not have any way to connect traces from different
modules in SPDK. This change modifies our trace library
and app/trace to handle adding relations between trace points
and a trace object.

Additionally this patch adds classes and fields to structs
inside trace.py to prepare it for future patches implementing
printing relation information.

Change-Id: Ia09d01244d923957d589fd37e6d4c98f9f7bbd07
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9620
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.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>
2021-10-21 17:57:33 +00:00
Jim Harris
84ab68c1a3 test/scheduler: add a for_each_reactor shutdown test
The scheduler test app is ideal for testing that the
reactors properly flush any existing for_each_reactor
operations during the shutdown process.  This is
because it has no SPDK subsystems, so the reactors
stop immediately after the application is signaled to
terminate.

So start a for_each_reactor operation when the
application starts, and then keep starting another
one once the previous one completes.

This serves as a regression test for issue #2206.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9929
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-21 14:47:15 +00:00
Shuhei Matsumoto
5466d5d4dc test/nvmf: Extend ANA state change timeout to 20 seconds
If a connection is lost, Linux NVMe host tries reconnecting after
10 seconds delay by default. To cover this case, extend the timeout
to 20 seconds. Usually Linux NVMe host recognizes the new ANA state
within 2 seconds.

This patch is for the github issue #2081

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I61fba2febcea81951c8b29f940d93863bc31b332
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9393
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-21 09:17:46 +00:00
Jim Harris
c4f086b6ed event: use for_each_reactor to shut down reactors
There could be an outstanding for_each_reactor operation
in progress when the application shuts down.  If we don't
wait for that operation to complete, we'll get a memory
leak for its context.

So when stopping the reactors, before setting the
state to EXITING, do one final for_each_reactor to
ensure any outstanding for_each_reactor operations are
flushed.  Once this final for_each_reactor operation
is complete, we can set the state to EXITING safely.

Also use a global mutex and flag to ensure no more
for_each_reactor operations can start while the final
for_each_reactor is in progress.  If a new operation
is requested, we'll just ignore since the reactors are
shutting down anyways.

Fixes issue #2206.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9928
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-21 09:17:42 +00:00
Changpeng Liu
19aa304023 nvmf: consolidate CC reset and shutdown
nvmf_ctrlr_cc_shn_done() and nvmf_ctrlr_cc_reset_done() are
almost same, so consolidate them together by adding a flag.

Change-Id: Ib7714d31a40f9d8d344ec2630c083c5d76dac8a1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9907
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-21 08:51:30 +00:00
Ziye Yang
749ec90903 doc/accel_fw: Update the description to use kernel idxd driver
This patch is used to update the accel_fw in order to
add more details about using the kernel idxd driver to
drive DSA devices.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I7358e601492bd8f88c84505c14062ee6dce42d6f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9206
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-10-21 08:49:28 +00:00
Konrad Sztyber
a78d8ea4f2 scripts/bpftrace: force basic regex syntax in grep
Forced grep to use use basic regular expression syntax (-G option) and
removed escape characters from "{", as they're not needed in this mode.
It fixes the following errors:

fatal: command line, 'enum spdk_nvmf_subsystem_state \{': Unmatched \{
fatal: command line, 'enum nvmf_tgt_state \{': Unmatched \{

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7dd15207d6ff22d229d8f66668d33e0f5596379e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9932
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-20 23:39:59 +00:00
Konrad Sztyber
143aa5cb1f scripts/bpftrace: use SO names in bpftrace scripts
If an USDT probe is defined within a shared object, bpftrace expects the
path to that shared object instead of an executable.  This means that we
need to replace __EXE__ in the bpftrace scripts differently, depending
on whether the application was linked statically or dynamically.

This is now done by the `scripts/bpf/gen.py` script.  It lists all
available probes, along with their locations, of a process.  Then, it
matches them to those described in a bpftrace script replacing the
__EXE__ markers with the listed location (either a path to the
executable or a shared library).  If a bpftrace script uses a probe that
isn't listed, its __EXE__ will be replaced by a path to the executable.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7c323d5f7d948ea57cf8d4d3132e4d59a2de594f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9807
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-20 23:39:59 +00:00
GangCao
9072c4ad0d accel: create SW Engine Channel if HW Engine not supports
Currently either HW Engine Channel or SW Engine Channel will be used.

In the case that HW Engine Channel is used while does not support related
operations like IOAT for CRC, it will shift back to the SW Engine's handle.

So that this is an issue that it still refers to the HW Engine Channel
while needs SW Eninge Channel to handle.

This patch introduces the SW Eninge Channel and always initializes there
in case that HW Engine does not support some operations.

Related UT also added to simulate the case the IOAT does not support CRC
and then SW Eninge needs to properly handle it.

Change-Id: I4ecdcd09ab669a616b37c567b45b1e6499800ec9
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9874
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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-10-20 23:04:38 +00:00
Rafal Stefanowski
502a2d7512 bdev/ocf: Set defaults for OCF devices
Use dedicated OCF API functions to set default parameters during
startup configuration instead of manual and incomplete
initialization.

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Change-Id: Ied1afa9c249a032451a266fd97ce09e6088a0f97
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9786
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-20 23:02:03 +00:00
Alexey Marchuk
2696886c75 dma: Update translation result to hold iovec pointer
In some cases a single virtually contriguos memory
buffer can be translated to several chunks of memory.
To make such translation possible, update structure
spdk_memory_domain_translation_result to use a pointer
to iovec.
Add a single iov structure or cases where translation
is always 1:1, it will make easier translation callback
implementation. For RDMA transport translation of address
is always 1:1, so treat iovcnt other than 1 as an
error.

Change-Id: I65605575d43a490490eba72c1eb19f3a09d55ec6
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9779
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-20 22:55:52 +00:00
Alexey Marchuk
549bcdc0a4 dma: Update memory domain context structure
Instead of a union with domain type specific
parameters, store an opaque pointer to user
context. Depending on the memory domain type,
this context can be cast to a specific struct,
e.g. to spdk_memory_domain_rdma_ctx for RDMA
memory domains.
This change provides more flexibility to
applications to create and manage custom
memory domains

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Change-Id: Ib0a8297de80773d86edc9849beb4cbc693ef5414
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9778
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-20 22:55:52 +00:00
Alexey Marchuk
6c64d64e48 dma: Add a range of device types reserved for apps
That will allow applications to create their own
dma devices types IDs which won't conflict with
SPDK internal device types

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Change-Id: I89bf25a5ed760967d823f3fc32a466657f45e799
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9777
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-20 22:55:52 +00:00
Alexey Marchuk
0ecbe09bc1 dma: Add infrstructure for push operation
Push operation complements existing pull
operation and allows to implement read data
flow using memory domains.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Change-Id: I0a3ddcb88c433dff7a9c761a99838658c72c43fd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9701
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-20 22:55:52 +00:00
Michal Berger
b794726807 scripts/common: Extract SPDK_GPT_PART_TYPE_GUID from source
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Id22c28c46a5fbdf5bd76b31d16f07f2672dfe14e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9306
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-20 21:18:52 +00:00
Michal Berger
76f840c049 autotest: Check if nvme devices are in use before the wipe
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I4f838df0bfb91398eb5d179a982165adb8af3476
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9291
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-20 21:18:52 +00:00
Michal Berger
8419c294b4 test/bdev: Make sure cleanup() is always called upon exiting
This is mostly relevant for making sure the nvme drive used for gpt
test is cleaned up. To that effect, replace dd with wipefs to make
sure all signatures are wiped and kernel updated with the changes.

Also, since gpt test is not supported on FreeBSD don't try to run
it from autotest.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ic970026363a6269f85b63e713f4187268fd6f923
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9290
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>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-20 21:18:52 +00:00
Michal Berger
84a9119bb0 scripts: Add python script to read SPDK's GPT GUID from device
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ib24714363405f926ac8483244b24296fe35d5a86
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9591
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-20 21:18:52 +00:00
Changpeng Liu
f6c2ad904e nvme_compliance: add test cases for SET FEATURES with Number of Queues
Change-Id: I590712f11b54db0f7d5bf383d32034d02b158e0e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9855
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-20 07:38:44 +00:00
Changpeng Liu
5509f57e2e nvmf/vfio-user: fix empty free request issue
It's too strict to fail the controller when there are no free requests.

Change-Id: I0a66ff2d294a2fd9326506ea50af4213aaaf8e92
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9848
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: GangCao <gang.cao@intel.com>
2021-10-20 07:38:44 +00:00
Changpeng Liu
3494f69c90 nvme_compliance: add tests for get features
Change-Id: I9988f75e8fb4c626a91c040846ad9b57dde0d895
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9819
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-20 07:38:44 +00:00
Changpeng Liu
8a1862c0f0 nvmf: add Get Features with Host Behavior Support
We already support Set Features with Host Behavior, so here also
add the support in Get Features.

Change-Id: I27d973e81fd6be89cc67ad559439334fc1087c9e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9818
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
2021-10-20 07:38:44 +00:00
Changpeng Liu
9f7cb6aa2d examples/nvme/cmb_copy: exit the test tool if no controller found
fix issue #2200.

Change-Id: I9d0374e56f199d562c48581ec6630547175d8627
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9927
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-20 07:24:47 +00:00
zhaoshushu.zss
6000920e8c nvmf/rpc: Put channel refcount after nvmf_subsystem_get_qpairs use
nvmf_subsystem_get_qpairs RPC handler may cause the program
could not exit normally (e.g. ctrl c). Reason is that,
spdk_get_io_channel() will be called during the getting
qpairs stream, which will add refcount value for each
existing channel. When end target, channel cannot be
destroyed since refcount be added additionally and
its value could not be subtracted to 0. As a result,
the program will hang in the process of exiting.

So here we don't need to allocate a new channel, just use
the exist one.

Signed-off-by: zhaoshushu.zss <zhaoshushu.zss@alibaba-inc.com>
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Change-Id: I08b4678edaa9404b8e8af125ebae572b31edf77e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9881
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-20 07:24:23 +00:00
Maciej Wawryk
ce7a40b6ee scripts/nvmf: disable channel packet inspection optimization after fio ramp time
A temporary workaround for issues seen when using "adq_enable"
is to set channel-pkt-inspect-optimize on before fio ramp_up and
turn it off when ramp_up is ending.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I74f71d11e3b9d1a064b36de8acc7a2a23f51a34b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9879
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-20 07:23:52 +00:00
Maciej Wawryk
6f2f94e634 scripts/nvmf: fixes for ADQ
* Added sleep as sugested in config guide
 * Moved adq_configure_tc() before nvmf_create_transport()
 * Added extra logs to output

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Icc253b98a0fadbe917e912342f91e2bc5ca5064b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9703
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-20 07:23:52 +00:00
Shuhei Matsumoto
a59b3f9236 bdev/nvme: Retry I/O immediately if it got I/O path error
The previous patch supported I/O retry when no available io_path
was found at submission.

This patch supports I/O retry when we get I/O path error at completion.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I93a1664944b15ab0a826a321e2ea7a2574263afe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9850
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-20 07:23:40 +00:00
Shuhei Matsumoto
a77188cdea nvme: Add three macros for multipath
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7632d1572c261256d6c759a22f3f40dcd311b7c9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9417
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>
2021-10-20 07:23:40 +00:00
Shuhei Matsumoto
ef409194a1 bdev/nvme: Retry I/O a second later if any I/O path may become available
If ANA state is inaccessible or qpair is disconnected, I/O cannot
be submitted.

But if qpair is connected, ANA state may become accessible, or if
qpair is disconnected, it may become connected via resetting.

Hence even if find_io_path() returned NULL, queue I/O and retry it
one second later if qpair is connected or ctrlr is resetting.

Sort retried I/Os by expiration values in ticks, and activate a timed
poller per nvme_bdev_channel only if there is any retried I/O. So
the poller function bdev_nvme_retry_ios() always returns BUSY because
if the poller runs earlier than the closest retried I/O or runs when
there is no retried I/O, it is more like a bug of the framework.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id28110a0d63ebc1c5772814e2ff8a47934df1644
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9830
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-20 07:23:40 +00:00
Michal Mielewczyk
3f4474d5cb Update ocf to 21.6
- remove metadata updater
- handle 'zero' flag in mempool allocator
- adapt ocf_mngt_cache_start() to new OCF API

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Change-Id: I34afd856cc1306ffe305f71a445e7474c9b0a2d9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9129
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-20 07:22:22 +00:00
Michal Mielewczyk
9544fe07aa bdev/ocf: add mempools to ocf env
OCF requires separate mempool for each request size from rage 4k-128k. Mempools
are meant for both IO and OCF's internal requests.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Change-Id: I3b37d287bbd6f963a24007c8485002f414fb8a7e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7774
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-20 07:22:22 +00:00
Krzysztof Karas
3590222911 lib/bdev: add context to trace records in bdev.c
Adds context to currently existing traces inside bdev.c file.
These are going to be used later to match with traces from
nvmf layer to enable io tracing.

Change-Id: I599a60412f39144cdd306315a184b2000a61286e
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9497
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Konrad Sztyber <konrad.sztyber@gmail.com>
2021-10-20 07:22:00 +00:00
Krzysztof Karas
c37e776efe trace: move all trace definitions to a separate file
This is to help with binding trace objects together and
for the convenience (all trace definitions are in one place
instad of being scattered accross multiple files).

Change-Id: Ib15bc9c2eeee9c4d0816bcee509ab69f3f558e19
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9574
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
2021-10-20 07:22:00 +00:00
Krzysztof Karas
6d4ad9a2af scripts/bpf/trace.py: add tcp events
Add tcp events changed in previous patch to the trace.py for
enhanced event information.

Change-Id: I8f176905a8283ba1b588d95bdbc075c38677acbe
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9307
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
2021-10-20 07:22:00 +00:00
Krzysztof Karas
8107587bb4 nvmf/tcp: add tracepoints for nvmf tcp qpairs
Enable tracing of tcp qpairs in lib/nvmf/tcp.c.

Change-Id: I692e74a972dcddd0bff193f1703470926e28b4db
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9288
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
2021-10-20 07:22:00 +00:00
Krzysztof Karas
219ddb5712 nvmf/tcp: add a helper function for qpair status change
This change aims to help with tracepoint handling in the future.
Instead of printing each trace directly with given values, we
will use this function to pass status change value.

Change-Id: Icc7f2863703899f818f0a2d5f49b69aa4e26a62c
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9690
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
2021-10-20 07:22:00 +00:00
Konrad Sztyber
e89224d1b7 scripts/trace: improve line formatting when printing
Changed the way a line is formatted to avoid unnecessary operations.
This slightly (~5-10%) decreases the runtime when the script is executed
on large trace files.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I5549462d56f866bea99609f746aa53890b98d622
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9442
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2021-10-20 07:22:00 +00:00
Konrad Sztyber
364dbc8f48 scripts/trace: suppress KeyboardInterrupt and BrokenPipe exceptions
The stack trace is no longer printed if a user presses <C-c> while the
script is running or pipes its output to tools such as head or less.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I0951c38d914986b5c9bf2ee98bcd046f0e957ff0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9441
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Krzysztof Karas <krzysztof.karas@intel.com>
2021-10-20 07:22:00 +00:00
Konrad Sztyber
bc71c2e6d7 scripts/trace: add build/lib to LD_LIBRARY_PATH before starting
It makes it more convinient for a user to start the script, as it's no
longer necessary to update the library path manually.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I0dbeb54cad2585a50162c91f48c5ef199fa133b9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9440
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2021-10-20 07:22:00 +00:00
Konrad Sztyber
5d5d9cbb3e scripts/trace: use trace library for parsing traces
Added trace provider based on the trace library.  It uses ctypes to
define the trace objects and execute library calls.  It significantly
(~2x) speeds up the execution time on large trace files.

The script automatically detects the type of the trace file and will use
the appropriate engine (either JSON or the trace library) using
python-magic for file detection.  When piping a file through stdin, JSON
format will be assumed.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Icfa216edee4662714266968eeb72f0097b3779b4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9439
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-20 07:22:00 +00:00
paul Luse
df3fe33ff4 thread.h: document expected poller return values.
Code isn't alway consistent (for legacy reasons) so lets at
least document what we expect moving forward.

Signed-off-by: paul Luse <paul.e.luse@intel.com>
Change-Id: Iba9e383ae89ec9f850dcacca45c3bf8410c3b28b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8582
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-10-19 08:05:23 +00:00
Alexey Marchuk
d47893607b test/scsi: Fix uninitialized variable
dev_ut.c:667:30: error: ‘prev_lun’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  667 |  struct spdk_scsi_lun *lun, *prev_lun;
      |                              ^~~~~~~~

gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
aarch64

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Id6608620ef6f18002ff7b7cc6de3e1361be762d0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9860
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-10-18 21:49:20 +00:00
Alexey Marchuk
9efad7468f dma: Rename fetch operation to pull
The new name suits better to the following "data push"
operation

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ic3249f65de203f375477f8e87b0749b9502d165c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9878
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-18 07:56:57 +00:00
Alexey Marchuk
219be8dff1 dma: Change signature of fetch callback
iovs are not needed in the callback

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I29718f1f2e65881628b72dea938e40c60348b85d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9877
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-18 07:56:57 +00:00
Changpeng Liu
0fce7b0958 nvmf/vfio-user: set ADMIN GET/SET FEATURES command with buffer length
For GET/SET FEATURES command, some feature IDs will have data buffer
while some don't have, so here we will return the buffer length base
on the feature ID.  The length is defined by the specification.

Change-Id: Ie9798585fc74544b77998aeebc2a20614c1c25f0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9689
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: Jim Harris <james.r.harris@intel.com>
2021-10-18 07:56:31 +00:00
Changpeng Liu
0171f8c184 test/vfio-user: add delete_io_cq test case
Change-Id: Icf7f978d7083afdc729959328d985a660111e371
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9681
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-18 07:56:31 +00:00
Changpeng Liu
e91846d342 test/vfio-user: add delete_create_io_sq test case
Change-Id: I0d801b2760574b19002058a45e1b26060b6898f7
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9679
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: Ben Walker <benjamin.walker@intel.com>
2021-10-18 07:56:31 +00:00
Mao Jiang
89ee2417ba test/nvme_fuzz: fix nvme_fuzz not support sequential FUSE commands
Change-Id: I3801a339fa712b9ba41a9e9251e36a57c35239b7
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9873
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-18 07:55:20 +00:00
Jim Harris
67ac0638eb nvmf: make fused status construction easier to understand
It is a bit confusing for the variable names to not match
the parameter names for spdk_bdev_io_get_nvme_fused_status().
These changes should make it a bit simpler to understand.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I833bf2a75cfec7b86da2d8a234f800de3510c2b7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9867
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-10-18 07:54:57 +00:00
GangCao
d58d7e3c47 bdev/nvme: destroy the mutex when failing to create disk
Change-Id: I41868021e6f482c9f0c345d197fedb766e6533d6
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9885
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
2021-10-18 07:50:10 +00:00
Ben Walker
c93b5564c8 bdev/nvme: Use an RB_TREE to hold namespaces in the controller
If NN is very large this saves a lot of memory. This lookup is
not generally used in the I/O path anyway.

Change-Id: I98e190006843ad5d0bac8483bf9feb800d4a665a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9884
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-18 07:49:52 +00:00
Shuhei Matsumoto
2b70bf9291 ut/bdev_nvme: Fix bug in spdk_nvme_ctrlr_reset_async/poll_async() stubs
In the SPDK NVMe driver, spdk_nvme_ctrlr_reset_async() sets
ctrlr->is_failed to false and spdk_nvme_ctrlr_reset_poll_async() sets
ctrlr->is_failed to true if it fails.

On the other hand, in the unit test for the NVMe bdev module,
the stub for spdk_nvme_ctrlr_reset_async() does nothing and
the stub for spdk_nvme_ctrlr_reset_poll_async() sets ctrlr->is_failed
to false if it succeeds.

This bug made us very difficult to write unit test for I/O retry.

Hence fix this bug.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic0dcf1109ce543a53fca74708fc86c8c74a17692
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9829
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-18 07:49:14 +00:00
Shuhei Matsumoto
ccee9a9151 bdev/nvme: find_io_path() excludes io_path whose ANA state is not accessible
bdev_nvme_find_io_path() selects an io_path whose qpair is connected
and ANA state is optimized or non-optimized.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I79c978795562b606ee27aa43020684d8bcbf50c5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9405
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-18 07:49:14 +00:00
Shuhei Matsumoto
56e2d632ce bdev/nvme: Reset all ctrlrs of a bdev ctrlr sequentially
Reset all controllers of a bdev controller sequentially. When resetting
a controller is completed, check if there is next controller, and
start resetting the controller.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I169a84b931c6b03b36bb971d73d5a05caabf8e65
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7274
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-18 07:49:14 +00:00
Shuhei Matsumoto
5d62af41a3 bdev/nvme: Complete outstanding reset after canceling pending resets
Previously the NVMe bdev module had completed the outstanding reset and
then canceled pending resets. This was complex.

On the other hand, the generic bdev layer cancels pending resets
and then completes the outstanding reset.

Following the generic bdev layer simplifies the code and makes us easier
to control retry reset, delay retry reset by a few seconds, or stop retry
after repeated failures and then delete ctrlr.

Update unit tests accordingly.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9a68422918ebcb052b3a281316ffba9b3450ecd4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9816
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-18 07:49:14 +00:00
Jim Harris
df9f1e99c2 bpftrace: add escape char to gen_enums.sh
At least on my system, I need an extra escape for
the opening brace in the generated enums.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9671
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-18 07:47:38 +00:00
Jim Harris
88f9411281 bpftrace.sh: append enums at end of script
bpftrace scripts do not allow struct definitions after
the first probe definition (including BEGIN/END).
This is problematic for an upcoming patch which will
include some struct defintions.

So instead just add the generated BEGIN/END probes
with enum definitions to the end of the user-specified
script, instead of the beginning.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9670
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-18 07:47:38 +00:00
Jim Harris
e8c467965e test/scheduler: change how test threads consume cpu cycles
Now a test thread will have one idle_poller and an optional
busy poller (when active_percent > 0).

The idle poller will just consume a very small amount of
tsc via spdk_delay_us(10).

If active_percent > 0, we will start a timed poller for
TIMESLICE_US (currently 100 * 1000).  When that timer
expires, it will consume TIMESLICE_US * active_percent
microseconds.

I think this is a slightly simpler way to enforce the
thread consumption percentages specified by the tests.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9654
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-18 07:47:38 +00:00
Jim Harris
15535803d4 test/unit/scsi: initialize prev_lun
Otherwise compiler complains that this variable
is used uninitialized (scsi_dev_find_free_lun does
reference it).

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9868
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-10-18 07:47:38 +00:00
GangCao
b0a52577a2 bdevperf: properly handle the next run of perform_tests
Change-Id: I65060a3a3f254ef541ab2f65995f168f649fbf69
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9821
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-10-14 23:23:21 +00:00
GangCao
d4827a681b bdevperf: properly rename functions and update the usage of job count
There are two resources to construct.

One is the job configuration and the other is the job.

This patch is to properly rename the related functions.

Change-Id: Ie005ed75a558b3176b183f30ef5bfdb9bef30dc2
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9854
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-10-14 23:23:21 +00:00
Maciej Wawryk
328a75c0cb scripts/nvmf: fixed type error in sar measurements
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ibcc7a77d1ebcc013b5050564fcc31b23b1202912
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9840
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2021-10-14 23:20:36 +00:00
Krzysztof Karas
a72f77e9b1 Commit updating intel-ipsec-mb submodule.
Additionally:
In release 1.0 intel-ipsec-mb module moved main header
(intel-ipsec-mb.h) from main directory of the project
to the /lib directory. This change aims to address that
and allow for a successful build.

Change-Id: Idd6ec90396166c94ca492ef1d2038331adbbc36c
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7976
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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-10-14 09:52:39 +00:00
Jacek Kalwas
8f8f3f8703 json: add the spdk_json_write_uint8|16 function
Add the paired spdk_json_write_named_uint8|16 function

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Ib7ee9ae4dbe9a4e9cfa28750f0b9a0af597d260c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9788
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-14 09:52:25 +00:00
Michal Berger
58410e6c79 test/openstack: Use stable branch for the requirements repo
As of recently, devstack requirements are broken - the suds-jurko
requirement doesn't work with a particular version of setuptools
needed by the latest devstack. Since this breaks installation on
ALL distros take a step back and use specific, stable branch
for the requirements: xena is the upcoming release hence it should
be as close as possible to master.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I1133cd64413ec4fb794fac932bd3ffe6ac81dd9c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9794
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-14 09:51:52 +00:00
Michal Berger
3bcff0b2e4 pgkdep/git: Patch ice driver under ubuntu1804
This is needed for the older kernel builds which include the following
change:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7240b60c98d6

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I8ac86885028d663b776ae8de6d9fb500ed997523
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9808
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
2021-10-14 09:51:42 +00:00
Richael Zhuang
711a4a70e5 test: fix build error about type-limits on arm64
There is an build error on arm64:
nvme_compliance.c:203:42: error: comparison is always true due to
limited range of data type [-Werror=type-limits]
while ((op = getopt(argc, argv, "gr:")) != -1) {

For "op" is defined as "char" here. "char" is "unsigned char" on arm
and "signed char" on x86 by default. So change its type to "int"
to avoid this error.

Change-Id: I1f9fa8e0112538e005e8b88c1bfda9257b3f517e
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9853
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
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: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-10-14 09:51:14 +00:00
Jim Harris
4963728855 nvme_fio: add log_flags
Allow user to add something like:

log_flags=nvme,nvme_vfio

to their fio config file to enable log flags.  On
DEBUG builds, setting at least one flag will also
set the print_level to DEBUG.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7a409445d23c96845bc7afa9641966a964b7f44f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9871
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-14 08:17:28 +00:00
Jim Harris
1b61d481cc bdev_fio: add log_flags
Allow user to add something like:

log_flags=app_config,nvme,bdev

to their fio config file to enable log flags.  On
DEBUG builds, setting at least one log flag will
also set the print_level to DEBUG.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I383512e47ad6ea86b8b2c71a212bdc88fadf2f65
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9870
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-14 08:17:28 +00:00
Jim Harris
f01146ae48 blob: use uint64_t for unmap and write_zeroes lba count
Previous patches (5363eb3c) tried to work around the
32-bit unmap and write_zeroes LBA counts by breaking
up larger operations into smaller chunks of max size
UINT32_MAX lba chunks.

But some SSDs may just ignore unmap operations that
are not aligned to full physical block boundaries -
and a UINT32_MAX lba unmap on a 512B logical /
4KiB physical SSD would not be aligned.  If the SSD
decided to ignore the unmap/deallocate (which it is
allowed to do according to NVMe spec), we could end
up with not unmapping *any* blocks.  Probably SSDs
should always be trying hard to unmap as many
blocks as possible, but let's not try to depend on
that in blobstore.

So one option would be to break them into chunks
close to UINT32_MAX which are still aligned to
4KiB boundaries.  But the better fix is to just
change the unmap and write_zeroes APIs to take
64-bit arguments, and then we can avoid the
chunking altogether.

Fixes issue #2190.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I23998e493a764d466927c3520c7a8c7f943000a6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9737
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-14 08:17:16 +00:00
Shuhei Matsumoto
6dba57eb26 bdev/nvme: Use cb_arg of for_each_channel() to pass result of reset
Restore the previous nice idea and unify canceling pending resets
into bdev_nvme_complete_pending_resets().

cb_arg of spdk_for_each_channel() was reserved for a different
purpose but it was gone.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1c01051ae9d8eccc7fc3ec485dd344ff9f55087b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9815
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-14 08:16:32 +00:00
Shuhei Matsumoto
8786f215e3 bdev/nvme: Use boolean for the result of the reset operation throughout
The all setters of the reset_cb_fn use boolean as the result eventually.
Using boolean as the result earlier makes the code simpler and the
following patches easier.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9ec4f670ed7a000a824ab7e261bab07a3dc21f43
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9814
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-14 08:16:32 +00:00
Shuhei Matsumoto
d456cd93d6 bdev/nvme: admin_passthru() submits to the first found unfailed ctrlr
bdev_nvme_admin_passthru() chooses the first ctrlr which is not failed.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If41a1d1e1bde4bddfa92e5a385509daa3f0ce4de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9525
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-14 08:16:32 +00:00
Shuhei Matsumoto
eea12e0df1 bdev/nvme: Admin commands fall through even if optimal io_path is not found
bdev_nvme_admin_passthrough(), bdev_nvme_reset_io(), and
bdev_nvme_abort() do not use io_path. So simply fall through even
if the optimal io_path is not found for these, and clear the
cached io_path for these.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib26fcbf99c95bbfb6e825c1b7c6455241c198d92
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9675
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-14 08:16:32 +00:00
Shuhei Matsumoto
d2e2405f13 bdev/nvme: reset() and abort() call io_complete() themselves for error cases
Even if the NVMe bdev module supports I/O retry, it will not retry reset or abort.

For clarification, bdev_nvme_reset_io() and bdev_nvme_abort() call
bdev_nvme_io_complete() themselves for error cases.

For bdev_nvme_abort(), we do not need to differentiate error processing
among return values. Simply complete the request with failure.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id5d51cbba47c6360a6177efd7d5f2e978c48ee9b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9674
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-14 08:16:32 +00:00
Shuhei Matsumoto
d7c7fbcda7 bdev/nvme: Inline bdev_nvme_io_complete() into bdev_nvme_reset_io_complete()
Even when I/O retry is supported, reset will not be retried. However,
bdev_nvme_io_complete() will process I/O retry. Hence inline
bdev_nvme_io_complete() into bdev_nvme_reset_io_complete() to exclude
reset from I/O retry. The result of reset is success or failure, so omit
the -ENOMEM case.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I667e74cbbac4a13cefb6896f898476ba48bcd0fa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9687
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-14 08:16:32 +00:00
Shuhei Matsumoto
d278711cff bdev/nvme: Save io_path into nvme_bdev_io to reuse it while processing I/O
Save the io_path to which the current I/O is submitted into struct
nvme_bdev_io to know which io_path caused I/O error, or to reuse it
to avoid repeated traversal.

Besides, add a simple helper function nvme_io_path_is_available() to
check if the io_path can be reused.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idadd3a3188d9b333b335ea79e20a244aa0ce0bdd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9296
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-14 08:16:32 +00:00
Shuhei Matsumoto
e49f77ece3 bdev/nvme: find_io_path() returns io_path instead of ns and qpair
We have io_path structure now and returning io_path rather than
ns and qpair match the function name. The following patches will
cache the returned io_path into nvme_bdev_io.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5d773da18591fc324667f6b5c489a38f497bf3d8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9295
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-14 08:16:32 +00:00
Shuhei Matsumoto
c19ec84378 bdev/nvme: Add multiple namespaces to a single nvme_bdev
This patch removes the critical limitation that ctrlrs which are
aggregated need to have no namespace. After this patch, we can
add multiple namespaces into a single nvme_bdev.

The conditions that such namespaces satisfy are,
- they are in the same NVM subsystem,
- they are in different ctrlrs,
- they are identical.

Additionally, if we add one or more namespaces to an existing
nvme_bdev and there are active nvme_bdev_channels, the corresponding
I/O paths are added to these nvme_bdev_channels.

Even after this patch, ANA state is not utilized in I/O paths yet.
It will be done in the following patches.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I15db35451e640d4beb99b138a4762243bee0d0f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8131
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: Jim Harris <james.r.harris@intel.com>
2021-10-14 08:16:32 +00:00
Jacek Kalwas
630db8c209 nvmf: rm parse trtype in create transport rpc
seems it is not required, string is used instead enum

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Ic67af6cfa6f8e22a6593f904cd5b5c1b51cae6ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9623
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-10-13 07:40:33 +00:00
Liu Xiaodong
a3d93c468c bdev_nvme_rpc: NULL check for multipath
Pointer 'ctx->req.multipath' returned from call to
function 'strdup' may be NULL. Reported by Klocwork.

Change-Id: Id4a188ec5340f02c9bd0643db0acb03409dd5829
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9843
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: GangCao <gang.cao@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-13 07:40:23 +00:00
Michal Berger
0403d3736a test/nvmf: Nuke all SPDK net namespaces before starting tests
This is to make sure we won't lose any net interfaces needed for the
phy tests in case they got stuck behind lingering namespace.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ic83bc5cca8b536bb3e72fbceb31d2560d840d05e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9795
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: wanghailiang <hailiangx.e.wang@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-13 07:40:18 +00:00
Monica Kenguva
9221a0d81c test/accel: add UT for test_spdk_accel_submit_copy_crc32c()
Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Change-Id: I1d70d0fccc7e251777a5568ce869bb47fbaefaca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9504
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-13 07:37:36 +00:00
Monica Kenguva
55ee29ec09 test/accel: add UT for test_spdk_accel_submit_crc32cv()
Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Change-Id: Iefe925a61accea896e820cae5c401f1ceb8856e6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9503
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-13 07:37:36 +00:00
Monica Kenguva
24128a9703 test/accel: add UT for test_spdk_accel_submit_crc32c()
Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Change-Id: I38d0e301399e0ba1e2196a1a109f36c3c4cd1cd9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9487
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-13 07:37:36 +00:00
Monica Kenguva
fb639b53b0 test/accel: add UT for test_spdk_accel_submit_fill()
Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Change-Id: I6ecccb015ddc72b3d676d9607bf2ca79aa7435ef
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9486
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-13 07:37:36 +00:00
Monica Kenguva
b22cd665c9 test/accel: add UT for test_spdk_accel_submit_compare()
Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Change-Id: I3287353d76de226f950620f1a4702887d33b1686
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9297
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-13 07:37:36 +00:00
Monica Kenguva
2e736160e1 test/accel: add UT for test_spdk_accel_submit_dualcast()
Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Change-Id: If20750c3671e794b5079972c612743c5ab189862
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9285
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Paul Luse <paul.e.luse@intel.com>
2021-10-13 07:37:36 +00:00
Jim Harris
355604bfb0 nvme_fuzz: simplify register_ns()
We can just always do the TAILQ_INITs for admin
related TAILQs.  Also no need to set anything to
NULL since the buffer was allocated using calloc.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ifbbda0436e7f33e225cf14dbd103779080b106da
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9729
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-10-13 07:27:14 +00:00
Jim Harris
3ca8b72c9e nvme_compliance: test admin commands with fuse bits set
These commands should always fail.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0abfbe4a4a107957a3271692468fe69eeb823137
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9728
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.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-10-13 07:27:14 +00:00
Jim Harris
eb3f756ce4 nvme_compliance: add test for IDENTIFY CNS=1
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I030e64fa8d679d2beebacf657f0c417c422533e4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9727
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-13 07:27:14 +00:00
Jacek Kalwas
a827fd7eec json: Added support for 8 bit unsigned value converter in json
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Id670be974f5d07f5292d338448cb0ada9510b105
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9787
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-10-12 23:46:49 +00:00
Michal Berger
bec627fcb0 test/common: Supress mem leak triggered during nvme_fio test
This is needed since fio, by default, links to libtcmalloc if found
during the build. See:

01fe773df4

Fixes #2192

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I1de8fe9d489f92acb79ef0f169229a6c09ce1179
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9822
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-12 16:22:07 +00:00
Tomasz Zawadzki
f8a961f5ea scheduler_dynamic: prioritize g_main_lcore during _find_optimal_core
_find_optimal_core was always consolidating idle threads to g_main_lcore.
Meanwhile for active threads lower lcore id were prioritized over the
higher ones.

So long as g_main_lcore can fit the active thread, it should be prioritized
over any other. Regardless of the lcore id.

Fix #2080

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I30b3a7353bcf243d4362b4db9dde5446c435d675
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9243
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-12 09:10:32 +00:00
Shuhei Matsumoto
45dddbc891 scsi: Decide LUN format for each LUN ID
Previously we decided which LUN format is used by the macro constant
SPDK_SCSI_DEV_MAX_LUN. However, as long as we read SAM, the LUN format
can be decided per LUN ID.

Linux host SCSI driver supports 256 LUNs per SCSI device at the
maximum. So we cannot test this fix on any actual system but we
apply this fix for the potential future cases.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifa6a3b66431f5e1eade326348dd99b8b9653408b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9664
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-10-12 09:10:18 +00:00
Shuhei Matsumoto
5e87727596 scsi: SCSI device supports 256 LUNs at the maximum by default
Most SCSI hosts, Linux, Windows, VMware, supports 256 LUNs per
device now, and it is not easy to test even if any other non-free
OS or driver supports more than 256 LUNs.

Hence increase the macro constant SPDK_SCSI_DEV_MAX_LUN from 64 to
256. Then we do not need to expose it publicly now. So move it to
lib/scsi/scsi_internal.h.

Update the CHANGELOG together.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iacde46c3854f326eebfb8befb47d41fce383b027
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9631
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-10-12 09:10:18 +00:00
Shuhei Matsumoto
4265fc50d9 scsi: Manage LUNs per device by not fixed size array but linked list
Change a fixed size array to a linked list to manage LUNs per SCSI
device.

Keep the linked list sorted by LUN ID because this is necessary to
efficiently find the lowest free LUN ID or check the specified LUN is free.

To avoid traversing the linked list twice, change scsi_dev_find_free_lun()
to return the LUN which comes just before where we want to insert an new LUN.

Additionally, previously spdk_scsi_dev_add_lun_ext() had not checked if
the specified LUN ID was duplicated. Fix the bug in this patch.

Add unit test cases for the function scsi_dev_find_free_lun().

These changes will enable the following patches to increase
SPDK_SCSI_DEV_MAX_LUN from 64 to 256 without consuming additional memory.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7f6f070ddc680127cf86ae255055da2d1d29e4ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9630
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: Ben Walker <benjamin.walker@intel.com>
2021-10-12 09:10:18 +00:00
GangCao
e9030f36bc trace: add an assert for the valid history
Change-Id: I4dd97351354af8ccdd0684afda06e6f2e8889839
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9828
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-10-12 08:52:10 +00:00
Ben Walker
fa36884a78 bdev/nvme: Inline bdev_nvme_delete_secondary_trid
It can be much simpler when inlined.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ifad89d7b9557a45eee601fc2004066a0fd9289c0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9826
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-12 08:52:01 +00:00
Ben Walker
be6a2feff2 bdev/nvme: bdev_nvme_delete now takes a path_id
Specifying only a transport id is not enough. We need to be able to
describe the host parameters too.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Iadbea553aee4b38e7cacab0b486e7e5746d0d1ab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9825
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-12 08:52:01 +00:00
Ben Walker
128a921e95 bdev/nvme: Build an nvme_path_id in rpc_bdev_nvme_detach_controller
Change-Id: I463ee15480fbde3b113afc75fbe38032f59d3aad
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9577
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-12 08:52:01 +00:00
Ben Walker
7d28aae7fb bdev/nvme: Rename connected_trid to active_path_id
This is the currently active path identifier in a failover scenario. The
path is defined by more than just the transport identifier, so fix the
name.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I682c6f4c54f75307e2615bf80e70358180d99fe2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9576
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-12 08:52:01 +00:00
Ben Walker
0262859f3c bdev/nvme: Rename nvme_ctrlr_trid to nvme_path_id
This defines a unique path between a host and a target.

Change-Id: Ia3d24c1b34199a8b596aaf17900ca9694a9da77d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9505
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-10-12 08:52:01 +00:00
Ben Walker
e3c398aa1c bdev/nvme: Don't allow a second identical path for failover
The new path must differ in some way.

Change-Id: I98fd2b2cb3220b482efe0a19bfce94ec4e72bec2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9418
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-10-12 08:52:01 +00:00
Ben Walker
a24d549038 bdev/nvme: bdev_nvme_attach_controller now has a multipath parameter
This parameter may have the values "disable" or "failover". The default
is failover to match existing behavior. In the future we expect to
change the default behavior to disable.

Further, we expect to add an "enable" option soon to do full multipath.

Change-Id: Iebbdc9b95f23101f18d64e085933463498e627be
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9343
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-12 08:52:01 +00:00
Michal Berger
ed763cee62 pkgdep/git: Add missing disable option to refspdk's configure
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I832cc8e2972b081a69a9704886e3c6b37d75847f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9796
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-11 10:10:50 +00:00
Ziye Yang
62210eff55 bdev/rbd: Remove epoll based group polling mechanism.
We know that the librbd's read/write operations will be handled by a
non spdk thread, so we can get rid of the epoll based group based
polling and directly use the async completion. This makes the code
is simple and easy to maintain.

And we still need to keep the io_device registration for this module,
because the I/Os are async. We need the channel reference on "rbd_if"
in order to know which rbd disks are still active.

Change-Id: I1c140a4b286dbfe113ed2a67bd2875de605e8f24
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9335
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-10-11 10:10:37 +00:00
Shuhei Matsumoto
845db70ccc scsi: Report LUNs use spdk_scsi_dev_get_first/next_lun() to iterate LUNs
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib812c1f4c180f4173c3b3d668a98e3b23ed32899
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9629
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-11 10:08:22 +00:00
Shuhei Matsumoto
27646a08d7 vhost/scsi: Use spdk_scsi_dev_get_first/next_lun() to iterate LUNs.
This is the same effort as lib/iscsi.

By using spdk_scsi_dev_get_first_lun() and spdk_scsi_dev_get_next_lun(),
remove the dependency on SPDK_SCSI_DEV_MAX_LUN from lib/vhost.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib79d2c3f8e7a5027d3d2c03f8f886c588b86009b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9611
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-11 10:08:22 +00:00
Shuhei Matsumoto
356df80468 iscsi: iSCSI connection use spdk_scsi_dev_get_first/next_lun() to iterate LUNs
Use two new public APIs spdk_scsi_dev_get_first_lun() and
spdk_scsi_dev_get_next_lun() to manage iSCSI LUNs by linked list and
to traverse all LUNs of the SCSI device.

By these changes, we can remove the dependency on the macro constant
SPDK_SCSI_DEV_MAX_LUN from lib/iscsi.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3237e7f887dd761d6812ed4313f87b6e7884ea29
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9610
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-11 10:08:22 +00:00
Shuhei Matsumoto
153373a5e7 iscsi: Pass iscsi_lun directly to the callback argument of spdk_scsi_lun_open()
By this change, we will not need to traverse LUN list or tree in the
callback to hot remove.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibe72fba824553d0189b9120884aa2113599a568d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9627
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: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-11 10:08:22 +00:00
Shuhei Matsumoto
594f46d7a9 iscsi: iSCSI target uses spdk_scsi_dev_get_first/next_lun() to iterate LUNs
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I99cc770c3637d79689d61f996ae40bb4be25cb00
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9626
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-11 10:08:22 +00:00
Shuhei Matsumoto
8215c0acef scsi: spdk_scsi_dev_add_lun() checks if lun_id is less than max by itself
This is an effort to remove the dependency on the macro constant
SPDK_SCSI_DEV_MAX_LUN from lib/iscsi.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ieeff4136b16cc6bfa92614248f150bc9dfe3dc74
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9609
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
2021-10-11 10:08:22 +00:00
Shuhei Matsumoto
f61d81e47c scsi: Add spdk_scsi_dev_get_first/next_lun() to traverse all LUNs
Add two public APIs spdk_scsi_dev_get_first_lun() and
spdk_scsi_dev_get_next_lun() to remove the dependency on the macro
constant SPDK_SCSI_DEV_MAX_LUN from lib/iscsi and lib/vhost.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6546697f823fe9f4fa34e1161f5c7fa912dd2d59
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9608
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: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-10-11 10:08:22 +00:00
Changpeng Liu
266ef92284 test/vfio-user: enable delete_io_sq_twice test case
Change-Id: I9ba43f2c961b5590b472671b400163cd20199f28
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9678
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-11 01:42:33 +00:00
Changpeng Liu
2dc55b19e8 test/vfio-user: enable NVMe compliance tests with vfio-user
Also add "-g" parameter to use single segment file.

Change-Id: If12c75ccdf1e6074951819fb94cc85a982f9d843
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9677
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-11 01:42:33 +00:00
Changpeng Liu
232ed2a3d3 nvmf/vfio-user: check invalid minimal qsize when creating IO SQ/CQ
Fix issue #2175.

Change-Id: I89365f2c482026c0a0313c4e27a802c0a66bebef
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9606
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-11 01:42:33 +00:00
Changpeng Liu
091aa2b681 nvmf/vfio-user: fix potential overflow for qsize/MQES/NLB
The spec treats the sizes (MQES or qsize from create/delete
IO queue command) as a 0-based value of uint16_t, but vfio-user
treats them as 1-based value, so we need to use uint32_t to
make sure the value can't overflow.  The same for NLB(number of
logical blocks).

Change-Id: I7654b7e12234525c0fce78a713dd50097e9b3d58
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9632
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: Jim Harris <james.r.harris@intel.com>
2021-10-11 01:42:33 +00:00
Changpeng Liu
318a3f0a43 nvmf/vfio-user: optimize lookup_io_q() function
The function is used to check the IO SQ or CQ exists or not,
so return bool type is better and also rename it.

Change-Id: I1af2a25255b012dcf1e1952b828617ededf9b897
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9680
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Andreas Economides <andreas.economides@nutanix.com>
2021-10-11 01:42:33 +00:00
Changpeng Liu
aa9e0ac633 nvmf/vfio-user: support delete/create SQ
Previously vfio-user will hit an error when creating a deleted IO SQ.
For lookup_io_q() function, actually we should not use the queue's
address to check the queue is exist or not, as when there is a memory
removal, we will also set the queue's address to NULL and reset it again,
so here we use the queue state to indicate the queue is exist or not.

Fix issue #2174.

Change-Id: I56bdd63947c2b30a598c427e64ff2dafe1cc1d2e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9605
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-11 01:42:33 +00:00
Changpeng Liu
e4913b3c7f examples/nvme/identify: print Command Retry Delay Time if exist
Change-Id: I7a9ea6054b853bd1abe7cbf7c918a220b1234485
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9263
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-08 07:26:45 +00:00
Michal Berger
19ad1783e4 pkgdep/git: cherry-pick instead of curl'ing the SPDK patches
We clone entire repo and then checkout into a proper tag so there's no
need to extra fetch the patches since they are already part of the
repo.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I38155a33506e373c129a02442b77bc48def23121
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9755
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-08 07:26:39 +00:00
Michal Berger
86f428c922 pkgdep/git: Disable fio in the refspdk builds
This allows us to remove the fio patch needed for the current LTS.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: If6a73669842179ced94f857557e6bf594aaddfb7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9784
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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-10-08 07:26:39 +00:00
Michal Berger
4f9ef50850 test/nvme: Simplify hotplug test
Instead of relaying on vhost VM image, which may be incompatible with
the host system, perform the hotplug test locally against detecte
nvme device.

Also, limit this test to Linux since it never was intended to run
on other platforms in the CI due to qemu dependency.

Fixes #2150

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ie048343ceb52c1a45193a6c857bc3a09fa1ec3fd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9461
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-07 09:36:00 +00:00
peluse
504bf59148 lib/idxd: only select idxd device that are on the same socket
Prior a regular round robin could result in strange performance
if an idxd device from another socket was used.

Signed-off-by: peluse <peluse@localhost.localdomain>
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Id863c79067beabe73ef89d92b3fb3c436821b97a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9367
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-07 09:26:50 +00:00
John Levon
17199cdc8f add name to fd groups
For debugging purposes, take a name for identifying fds added to a group.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: If1654e56e19f7fa964446ef1b9e71debf74979d1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9731
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-10-07 09:25:48 +00:00
John Levon
2d48b7dc10 lib/event: avoid cast of event_queue_run_batch
Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I1f23b9ab3aa5ace791a9460267606fcb03287245
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9776
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-07 09:25:48 +00:00
paul luse
78ef7cfc23 test/accel: add UT for test_spdk_accel_submit_copy()
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I2fb94a20bda23e9da07db5405977603dfaa319f9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6473
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-10-07 09:25:20 +00:00
Michal Berger
71a8e5658c autobuild: Consider use of clang while building DPDK
Our CI has a separate job dedicated for clang builds. Consider that
while specifying arguments to make sure they are compatible with the
actual compiler that is being used during the test.

Also, be strict as to what compilers can be used for the test -
gcc and clang only.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ia1a4e9fea9a46e37c07fffe5077c4dacbe13102a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9614
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-07 09:24:16 +00:00
paul luse
bcd3ed39e7 modules/crypto: remove dependency on rte_cryptodev_pmd.h
Call rte_cryptodev_close() to free qpair memory instead of using
an internal function.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I1bd7f0dd86de83f278f6be3263cdf3fbd8e1c77f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9720
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-07 09:23:55 +00:00
Maciej Wawryk
e50d1e0f59 scripts/nvmf: fixed sar mesure error
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I1a4d32de6a83800cdcd65dde3895a36731c52838
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9710
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-07 09:23:22 +00:00
John Levon
890b657e6b examples: detect fio backend fd redirection
It's useful to be able to run fio daemonized, and very recent versions of fio
redirect stdout/stderr to /dev/null in order to avoid the problem that
previously caused the plugin to abort. Detect if this redirection has happened
and allow fio to run in this case.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I8ec13a4c26a0acc67b15fa5e8502dc28d341e441
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9691
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Andreas Economides <andreas.economides@nutanix.com>
2021-10-07 09:22:57 +00:00
John Levon
6751909838 bdev/iscsi: unregister conn poller when idle
There's no need to keep polling with iscsi_bdev_conn_poll() when the request
list is empty, as new requests already restart the poller when needed.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Iec5553f8c14d32e894989c9f7a448b6817a821b1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9375
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-07 09:22:37 +00:00
Jim Harris
99fb67803c test: allow user to override autotest_common.sh HUGEMEM
By default on Linux, we hardcode HUGEMEM=4096.  But some
environments (like VMs) may not have enough memory to
allocate that much hugepage memory, and the user may
want to run some test scripts that don't require that
much memory.

So allow user to specify HUGEMEM in their environment
before calling a script that uses autotest_common.sh.
If it's set, it will use the specified value,
otherwise default to the values used prior to this
patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6e441ed2d703a04430305ad712903a7fa41190c1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9726
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-06 11:17:21 +00:00
Jim Harris
93351b0e01 test: use single core when testing nvme fuzz with nvmf target
There's really no need to specify 4 cores for both the fuzz app
and the nvmf target, since only one is ever used.  Reducing the
mask to a single core each makes the fuzz.sh tests easier to run
in VMs with a limited number of cores.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id956ac8d0d7f75cb0e76b78c9175b4aa520218bf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9725
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-06 11:17:21 +00:00
Jim Harris
a29c5a164f nvme_fuzz: add -U option to skip IOMMU check
There are many cases where we can safely run the nvme_fuzz
app without having to worry about DMA corruptions - for
example, any test using the TCP/RDMA/vfio-user transports
against a target using an emulated backend like null or
malloc.  So add a -U option to skip the IOMMU check if
the user so desires.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia123b7fb49056f49e2d805c9c3d5b3169c0d589e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9724
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-06 11:17:21 +00:00
Jim Harris
c42d8a16df nvme_fuzz: use spdk_nvme_connect() API
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7e2bd33ba4a70000493a2f8f1c67ede784dd29cd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9723
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-06 11:17:21 +00:00
Konrad Sztyber
b14196fa7f scripts/trace: add owner/object type to tracepoint definition
These fields aren't needed by the JSON provider, as the trace entries in
this format already has the owner and object fields filled, but it'll be
needed for the provider using the trace library.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I9db974793193fe59bfffc8dd3b975d5343036be9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9438
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: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-06 07:30:17 +00:00
Konrad Sztyber
d1732fcedc scripts/trace: create trace provider abstraction
This abstraction will make it possible to support different sources for
the traces.  The current JSON implementation is moved to a provdider and
a new one using the trace_parse library will be added in the following
patches.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I322e7984ffe19ce8b8e1bb551e8339655383623f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9437
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: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-06 07:30:17 +00:00
Konrad Sztyber
69390766a4 app/trace: use trace_parse library to process traces
Removed code that was copied to the trace_parse library and replaced
with calls to that library.  This significantly reduces the size of the
application (LOC), as it's only responsible for formatting the traces
and pretty-printing them.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib9f4e65f9f0072fb00bfa60cece1ce0627f109a0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9436
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-06 07:30:17 +00:00
Konrad Sztyber
f243f62450 lib/trace_parser: update object statistics
Object's statistics (its index and start timestamp) are now tracked and
updated in the trace entry object.

This is the final piece of code that had to be copied from the trace
app.  The following patch will remove that code from the application and
replace it with functions from the trace_parse library.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I1acaefb5a516bbc59c0549b2f66a5c52368bcd2c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9435
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.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-10-06 07:30:17 +00:00
Konrad Sztyber
189b0f0920 lib/trace_parser: method for retrieving entry count
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: If5f1b1bea0d30419be46e704ddd7c2f9556b4627
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9498
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.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-10-06 07:30:17 +00:00
Konrad Sztyber
ffaec5f91c lib/trace_parser: reconstruct tracepoint arguments
Tracepoint arguments are now reconstructed when retrieving next trace
entry (possible from multiple buffers).  Similarly to previous patches,
the code is directly copied from the spdk_trace app.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ie7594d381660ef31c286b5e124d2a6df3835111e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9434
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.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-10-06 07:30:17 +00:00
Michal Berger
65f01122b2 pkgdep/git: Bump fio to 3.28
Older versions of fio depend on raw driver which recently got removed
from the linux kernel:

git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=603e4922f1c

Due to that, these fio versions won't build anymore under latest
kernels available, e.g., for fedora (due to missing raw.h from the
kernel-headers package). Details here:

https://github.com/axboe/fio/commit/382975557

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ie63769395c482f1965c6664e8f5143c71ef80253
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9718
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-06 07:21:43 +00:00
Maciej Wawryk
c76f45ee87 scripts/nvmf: set correct port in adq_configure_tc
fixes #2178

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I89981459e2d5917bf46cde496550e28b1a3175f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9717
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-05 08:24:01 +00:00
Denis Nagorny
d42045b2af bdevperf: test time wrong time fix
spdk_bdevperf_shutdown_cb computed total time after the
bdevperf_test_done call. It's wrong. Let's get
g_shutdown_tsc delta when it is really needed.

Signed-off-by: Denis Nagorny <denisn@nvidia.com>
Change-Id: Ic4421305b16277af874008e293da8cb121c0244a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9598
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-04 15:02:46 +00:00
Konrad Sztyber
00d587140f bdev/nvme: remove CSTS from driver-specific JSON info
It's not providing a lot of value, while being pretty problematic, as
the read is blocking and cannot be easily changed to be non-blocking, as
dump_info_json is a synchronous interface.

Now that dump_info_json isn't using any synchronous interfaces from the
NVMe driver, we can send a bdev_get_bdevs call in the async_init.sh
test to verify that.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ida31c8d1000a52b0782f698afe46b071ed4e41df
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9488
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-04 15:00:35 +00:00
Konrad Sztyber
c5ebb7ff99 bdev/nvme: use asynchronous ctrlr detach functions
This patch replaces the synchronous `spdk_nvme_detach()` calls with its
asynchronous counterparts in the controller unregister path.

An additional poller is introduced to periodically poll the NVMe driver
for detach completion.  Once the detach is completed, the poller is
unregistered and the nvme_ctrlr is destroyed.  The poller uses the same
period (1ms) as the async probe poller.

Since reset and detach cannot happen at the same time, reset_poller was
renamed to reset_detach_poller and it can now store the pointer either
to the reset or detach poller, depending on the circumstances.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I5eb2dd6383d98d25d1f9748af08c1a13d18acb0e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8729
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-04 15:00:35 +00:00
Konrad Sztyber
f983acfc3a bdev/nvme: move module finish callback to nvme_ctrlr_delete
This is done in preparation for using the non-blocking versions of the
spdk_nvme_detach API, which will delay controller's delation until the
detach is completed asynchronously.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ia785408c9a94427e60bf239e6036a5e89d589f61
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8727
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-04 15:00:35 +00:00
Konrad Sztyber
c1f6054114 nvme: asynchronous detach without shutdown notification
Detaching a controller with `no_shn_notification` flag set will follow
the regular detach path making it asynchronous too.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I0b9c6c23626b4cc1cfaedb3268024776a07b9195
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9003
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-10-04 15:00:35 +00:00
Konrad Sztyber
b6ecc37298 nvme: make ctrlr detach fully asynchronous
The controller detach had asynchronous API (with async/poll), but the
register operations were synchronous, so they would block on fabrics
controllers.  In this patch, they're changed to their non-blocking
counterparts, making the detach fully asynchronous.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I74df12ab40a54f1d675639672e03755c89768bef
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8726
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-04 15:00:35 +00:00
Konrad Sztyber
51b018da0f test/nvmf: add asynchronous NVMe initialization test
The test verifies that the NVMe driver initialization is asynchronous.
There are some error logs during shutdown, as the detach path isn't
asynchronous yet, but as long as the detach is performed implicitly,
the test completes successfully.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I97483d8a8ba2487e279f7674514ad2cc2c54d504
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8625
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-10-04 15:00:35 +00:00
Changpeng Liu
b3ddd46e0d nvmf/vfio-user: return error when deleting SQ more than once
Previously we only use an assertion to address this sceanrio.

Fix issue #2173.

Change-Id: I7a6e715977218d2a3a08c48a9935880f3fe4ec63
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9604
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Andreas Economides <andreas.economides@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-30 08:08:05 +00:00
Changpeng Liu
742ae4ec72 nvmf/vfio-user: check SQ doorbell is valid or not before use
According to the specification, we should also post an AER
error event for this error case.

Fix #2171.

Change-Id: Ifb2343453ea5e36ce244938a939537ee6ed1c4e1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9584
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-30 08:08:05 +00:00
Michal Berger
8a0fedf4e6 scripts/vagrant: Remove OCSSD support from vagrant configuration
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ifdd1d02b466b6496469c9ea1f09633b6e368ab57
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9617
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-30 08:07:57 +00:00
Jim Harris
b8d2b705dd README.md: add some additional pointers on setup.sh help
This calls attention to some of the more advanced features
in setup.sh for users who may require them.

Fixes issue #2179.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9676
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-30 08:06:02 +00:00
Nick Connolly
2a51824a54 lib/thread: Use PRIu64 for portability
POSIX defines PRId64/PRIu64/PRIx64 for printing 64-bit values in a
portable way. Replace a reference to %lu to remove the assumption
about the size of a long.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I622fd43e7acf2cb93d3ba4ba9e9367e6dd064a74
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9663
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-29 08:58:28 +00:00
Denis Nagorny
7098e2ed31 bdevperf: prevent multiple performance statistics poller registering
Current implementation allows to run bdevperf with --wait-for-rpc and
without -z option. As the result several statistics pollers will be
registered. Let's add guardian to prevent this.
In the case of multiple test running guardian also will be helpful.

Signed-off-by: Denis Nagorny <denisn@nvidia.com>
Change-Id: I885f9dba6fa324fe4fbaba104d3058bf9f686c19
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9613
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-29 08:58:12 +00:00
Konrad Sztyber
279b7babe4 lib/trace_parser: method for iterating over entries
Added a definition of a parsed trace entry and a function allowing for
iterating over these objects.  The difference between a parsed and a
regular trace entry is that it includes more information gathered while
processing the trace file (e.g. lcore, object statistics) and provides a
contigous buffer for trace arguments.

For now, only lcore and the pointer to the actual trace entry are
filled.  Tracepoint arguments and object statistics will be added in
subsequent patches.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I4d5e30a7abb4860a5ba9db46f64ceae8bd14646f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9433
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-29 08:57:58 +00:00
Konrad Sztyber
6727cc382b lib/trace_parser: method for retrieving tsc offset
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I11fc341b4353c01cd933d6692cf97de3a3744a84
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9432
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-29 08:57:58 +00:00
Konrad Sztyber
4ba770720a lib/trace_parser: populate entries map
The trace file is now parsed and the entries are put in a map, sorted by
their timestamps.  The code is directly copied from the spdk_trace app,
with very little modifications.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7929497ffd3079b6974f5423c82a6128db2cee98
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9431
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-29 08:57:58 +00:00
Konrad Sztyber
41ba2b30e7 lib/trace_parser: method for retrieving trace flags
It gives user access to things like the tsc rate and tracepoint
definitions.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib50126b331faa4508174c7cb707643a3d8db6a01
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9430
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: Ben Walker <benjamin.walker@intel.com>
2021-09-29 08:57:58 +00:00
Konrad Sztyber
55f64c36c6 lib/trace_parser: map/unmap the trace file
Copied code responsible for mapping/unmapping the trace file.  The
only modifications were related with tying it to the spdk_trace_parser
object.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ia575101532c612b185bd971c69157623b52b9e81
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9429
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: Ben Walker <benjamin.walker@intel.com>
2021-09-29 08:57:58 +00:00
Konrad Sztyber
9f671238b2 make: specify C++ standard version in CXXFLAGS
The standard is now specified explicitly.  The chosen standard, c++11,
is the latest supported by gcc-4.8.5, which is the oldest compiler still
in use on some systems (centos 7).

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7ba84278b28e6d96f43b52014c358a74902188b9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9597
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-29 08:57:58 +00:00
Konrad Sztyber
d919a197d6 lib/trace_parser: add trace_parser library stubs
This library will provide functions that parse traces recorded by an
SPDK application.  This includes merging traces from multiple cores,
sorting them by their timestamp and constructing trace entries spanning
across multiple buffers.  All of these tasks are currently implemented
in the spdk_trace app, so most of its code will be moved here (this is
the reason for using C++).

The motivation for extracting this code to a library is to be able to
use it from places other than the spdk_trace app, specifically the
`scripts/bpf/trace.py` script.

The main reason for creating a separate library instead of extending
libtrace is to avoid pulling in all of its dependencies.  ISA-L is the
most problematic, as we only build it as a static library, which makes
it impossible to use with dlopen (making it unusable in scripts).

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: If101ca3425d7404abd51b0da2031358d0be44766
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9428
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-29 08:57:58 +00:00
Changpeng Liu
f7866a563f nvmf: consolidate AER notification into one function
Change-Id: If43e92fad60eff3e3f12cac1a8b413f5c16232fb
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9633
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-28 12:51:06 +00:00
Changpeng Liu
86ad145bc1 nvmf: add AER error event API support
We still don't support get log page with error
information LID.

Change-Id: I92db361dc956ea3ed4f6e7bdfdca763d0fea6886
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9583
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-28 12:51:06 +00:00
Jacek Kalwas
fb335cb29c nvmf: allow to query only specified transport
Similar is already done for json-rpc bdev_get_bdevs, it might be
useful for the upper layer which has no interest in all but only
in one specified.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Ie1af1cb4778edd265914bbfdc2777f66c6c76572
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9362
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@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-28 07:36:45 +00:00
Jim Harris
1227342cd4 test/nvme: add nvme_compliance test app
This is a rough first cut at an nvme_compliance test
application.  Initial focus will be on testing
the SPDK vfio-user target, but over time many of the
tests here will apply to TCP and RDMA as well (or
even running the test against a virtual nvme device
backed by vfio-user in a VM).

Usage:

test/nvme/compliance/nvme_compliance -r <trid>

There is also a test/nvme/compliance/compliance.sh
script that starts the vfio-user target with a single
malloc namespace, and runs the nvme_compliance
app against that target.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9599
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: John Levon <levon@movementarian.org>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-28 07:30:28 +00:00
Ben Walker
4fb3fea387 bdev/nvme: In bdev_nvme_attach_controllers, if adding a path the subnqn
must match.

Change-Id: I4e19ab8668268b273580d2b23ec30eafe21001ef
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9342
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-28 07:29:50 +00:00
Ben Walker
8dfefec509 bdev/nvme: Improve error reporting when adding additional paths to a
controller

Change-Id: I53ac0c6f8879bf80bc1345ef620a215d434f536f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9340
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-28 07:29:50 +00:00
Ben Walker
bf9e3156a9 test/nvmf: Add detach_controller calls to multicontroller.sh
This test will expand with more ways to add second paths, so we need to
remove the ones we add right after they're added.

Change-Id: Ie95ba01176cdedd858a98306f876d2d253a1c8cc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9454
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Dong Yi <dongx.yi@intel.com>
2021-09-28 07:29:50 +00:00
Ben Walker
14739d6e13 bdev/nvme: bdev_nvme_detach_controller is now much more flexible
It can match by any provided parameter to remove paths.

Change-Id: I5e7a87342bbb90943dc97fb52f142814fcf0acfa
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9453
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-28 07:29:50 +00:00
Ben Walker
301b3635fd bdev/nvme: bdev_nvme_delete treats empty trid fields as wildcards
The RPC that calls this function needs wildcard behavior.

Change-Id: Ie373d8fdd6f0308476e23de8a7a5be1d2595e574
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9575
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-28 07:29:50 +00:00
Ben Walker
a91079fd2d bdev/nvme: connected_trid is now an nvme_ctrlr_trid
Instead of storing an spdk_nvme_transport_id, store the object that
contains it. This will make a few later patches easier.

Change-Id: I36b74889fe39af3b7ab2b900fb3ea4b3f39e1f83
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9484
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>
2021-09-28 07:29:50 +00:00
Jim Harris
3184f6e227 scheduler/dynamic: rename _is_core_over_limit()
Rename it to _is_core_at_limit().  This function
currently returns true if the core is at the limit
(instead of over the limit) which is really the semantics
that we want - so just change the name of the function
to make it more precise.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9582
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: Ben Walker <benjamin.walker@intel.com>
2021-09-28 07:29:03 +00:00
Jim Harris
cf494305bf scheduler/dynamic: don't put dst core over limit when moving thread
We have _is_core_over_limit() which determines if a core is
currently over its busy:total tsc ratio.  We use this to determine
if we need to move threads off of a core that is too busy.

But when we pick a core to move a thread *to* we were allowing the
dst core to fill to 100%, rather than the SCHEDULER_CORE_LIMIT.

This patch fixes that, which has the nice effect of keeping
thread-to-core assignments much more stable when running
I/O workloads.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9578
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-28 07:29:03 +00:00
Jim Harris
6c3728e958 scheduler/dynamic: reduce SCHEDULER_CORE_LIMIT to 80%
This will lead the scheduler to be quicker to move
threads to an unused core - favoring performance over
power savings.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9551
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-28 07:29:03 +00:00
Jim Harris
bcff088852 scheduler/dynamic: don't adjust tsc too much for very busy cores
If a core has a very high busy percentage, we should
not assume that moving a thread will gain that
thread's busy tsc as newly idle cycles for the
current core.

So if the current core's percentage is above
SCHEDULER_CORE_BUSY (95%), do not adjust the
current core's busy/idle tsc when moving a thread
off of it.  If moving the thread does actually
result in some newly idle tsc, it will get adjusted
next scheduling period.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9581
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: Ben Walker <benjamin.walker@intel.com>
2021-09-28 07:29:03 +00:00
Jim Harris
f1acee8f83 scheduler_dynamic: fix busy tsc accounting
For the src thread, add the busy_tsc of the thread
we are moving to the idle_tsc of the current core.
This is consistent with how are accounting for the
cycles in the target core too.

We will disable the load_balancing.sh script for now.
We will reenable it later in this patch set once
a few other changes are made, along with some updates
to the load_balancing.sh script based on the changes
made in this patch set.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9550
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: Ben Walker <benjamin.walker@intel.com>
2021-09-28 07:29:03 +00:00
Jim Harris
62b273d7cf test/reactor_ut: use more variables in dynamic scheduler ut
The values 100 and 200 are used a lot in this part of the
unit tests, many times for different reasons.  So add
some more variables and use some of the existing ones more
often to make some of this more clear to the reader.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9625
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-28 07:29:03 +00:00
Jim Harris
ae51da29da test/reactor_ut: don't assert number of events
Refactor this part of the unit tests to make it a bit
easier to maintain as the dynamic scheduler itself is
modified.

For example, depending on the simulated thread loads,
we may need to pass extra events to cores for
purposes of setting interrupt mode.  The important
thing to test here isn't how many events it takes to
do that, but what is the end result.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9624
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-28 07:29:03 +00:00
Jim Harris
de04fa748f scheduler/dynamic: add helper function to calculate busy pct
This will be useful in some upcoming patches where we will
be calculating these percentages in more places.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9580
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-28 07:29:03 +00:00
Nick Connolly
1cfdbd429f include/mock.h: prevent expension of syscall name
If a platform defines a syscall using a macro (e.g. #define open _open)
then wrapping it fails because DEFINE_RETURN_MOCK and MOCK_GET
will use the definition to name the ut_ variables, but DEFINE_WRAPPER
will use the original name. This result in an undefined reference when
linking.

Prevent macro expansion of the syscall name by avoiding nested macro
calls in DEFINE_WRAPPER. Include the contents of DEFINE_RETURN_MOCK
and MOCK_GET directly in DEFINE_WRAPPER.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I452857ec7df43f7a1a5f093439c7d5cf4683f8ee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9618
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-27 20:59:40 +00:00
Nick Connolly
7a5bc4905b ut/rpc: wrap syscalls using spdk.mock.unittest.mk
spdk.mock.unittest.mk contains platform specific definitions to wrap
syscalls. Allow SPDK_MOCK_SYSCALLS to be predefined before it is
included to extend the list of syscalls to be wrapped. Update rpc
Makefile to use this mechanism so that the platform specific definitions
are used.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: If51c0e7a31cf0eda45a844cb8cfa579efe173c42
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9621
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-27 20:59:37 +00:00
John Levon
180d2c1d9d nvmf/vfio-user: add transport opts to RPC
Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Ifa8e80e0a25af7757181f480ab0405ec902a61ff
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9596
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-27 10:56:47 +00:00
John Levon
75775a4720 doc: add control_msg_num to jsonrpc.md
Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I5c0fc5966d1ed9c78e83bd6772191d46bde1331c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9595
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@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>
2021-09-27 10:56:47 +00:00
Jim Harris
213eaed3bd nvme_fuzz: pass trid on command line only
Previously the Transport IDs would need to be an ini-style
config file that the nvme_fuzz app would then parse.  Instead
just add a -F option that tells the nvme_fuzz app which
subsystem(s) to fuzz.  This simplifies the fuzz_app code
a bit and makes it a bit easier to use.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9603
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-27 10:55:34 +00:00
Jim Harris
9c968f8e05 test/nvmf: always use loopback when running tests in --iso mode
Using the physical NIC interfaces is really designed more for
CI.  Don't try to use the physical NIC interfaces when running
tests locally in --iso mode.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9602
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-27 10:55:34 +00:00
Jim Harris
974271125d nvmf/vfio_user: free request when handling invalid IO opcs
IO commands with invalid OPCs are not freeing the
associated request object after handling the response.
This would eventually result in requests on the qpair
becoming exhausted which ends up failing the controller.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9601
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-27 10:55:34 +00:00
Nick Connolly
d960df9989 ut/nvme_qpair: add missing mutex init
Add missing mutex init for ctrlr ctrlr_lock.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I9f018898a828a2ca4caf246117b3b895c5069150
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9615
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-27 10:54:46 +00:00
Mao Jiang
25e1099b93 test/nvmf/ctrlr_bdev: cases for ctrlr reading and writing cmd
Change-Id: I3626b3abe07274c4b3cb3e446899999372e14c47
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9226
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-27 10:54:08 +00:00
Mao Jiang
a43f891e9b test/nvmf/vfio_user: cases for creating vfio user
Change-Id: Id477e1f1f278d34b6d025dafa34ddd9ed1cae1d1
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8770
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-27 10:53:32 +00:00
Ziye Yang
34c901e308 nvme/tcp: Fix tcp_req->datao calculation issue.
When data digest is enabled for a nvme tcp qpair, we can use accel_fw
to calculate the data crc32c. Then if there are multiple
c2h pdus are coming, we can use both CPU resource directly
and accel_fw framework to caculate the checksum. Then the datao value compare
will not match since we will not update "datao" in the pdu coming order.

For example, if we receive 4 pdus, named as A, B, C, D.
   offset   data_len (in bytes)
A:  0       8192
B:  8192    4096
C:  12288   8192
D:  20480   4096

For receving the pdu, we hope that we can continue exeution even if
we use the offloading engine in accel_fw. Then in this situation,
if Pdu(C) is offloaded by accel_fw. Then our logic will continue receving
PDU(D). And according to the logic in our code, this time we leverage CPU
to calculate crc32c (Because we only have one active pdu to receive data).
Then we find the expected data offset is still 12288. Because "datao" in tcp_req will
only be updated after calling nvme_tcp_c2h_data_payload_handle function. So
while we enter nvme_tcp_c2h_data_hdr_handle function, we will find the
expected datao value is not as expected compared with the data offset value
contained in Pdu(D).

So the solution is that we create a new variable "expected_datao"
in tcp_req to do the comparation because we want to comply with the tp8000 spec
and do the offset check.

We still need use "datao" to count whether we receive the whole data or not.
So we cannot reuse "datao" variable in an early way. Otherwise, we will
release tcp_req structure early and cause another bug.

PS: This bug was not found early because previously the sw path in accel_fw
directly calculated the crc32c and called the user callback. Now we use a list and the
poller to handle,  then it triggers this issue. Definitely, it will be much easier to
trigger this issue if we use real hardware engine.

Fixes #2098

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I10f5938a6342028d08d90820b2c14e4260134d77
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9612
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: GangCao <gang.cao@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-27 10:53:04 +00:00
Changpeng Liu
553a6e7ad9 nvmf/vfio-user: fix race condition when free_ctrlr()
This commit fixes a race condition when calling free_ctrlr(),
nvmf_vfio_user_close_qpair->free_qp will set controller `ctrlr->qp[qid] = NULL`
finally, when calling free_ctrlr() we also need to check `ctrlr->qp[qid]`
is NULL or not, when there are multiple IO queues, we need a lock to protect
`ctrlr->qp[qid]`.  However, the call to free_qp() in free_ctrlr() is valid
only when killing SPDK target, for all other cases, e.g: VM disconnected,
the queue pairs are already freed, so here we can process these different
cases separately, and avoid extra lock.

Change-Id: I7ab71f08bf4d737843b2af42e27b1571be0b45e9
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9351
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Thanos Makatos <thanos.makatos@nutanix.com>
2021-09-24 07:43:12 +00:00
Changpeng Liu
5fd77e32a9 nvmf/vfio-user: unmap queue pairs before spdk_mem_unregister()
Ideally, SPDK should make sure no pending I/Os in this queue
pair are using the removed memory region. Currently we just
stop the submission path and leave a TODO comment here until
we have an asynchronous way to do this.

Also use the `<=` for the boundary check.

Change-Id: I63a2189022978811dc21f92f2599f28a5191ecd7
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9352
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-24 07:43:12 +00:00
Mao Jiang
159fa94ad8 test/nvmf/subsystem: cases for restoring ns reservation
Add rkey checking to enhance nvmf_ns_reservation_restore().

Change-Id: I6d557adcba9bf81f954c118aa09452642318bc98
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9427
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-24 07:42:51 +00:00
Michal Berger
bf988beba5 autobuild: Enable mlx5 drivers for supported DPDK versions
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I224fa7d01286a68afecaca6e4afddcf7e966fed5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9559
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-24 07:42:05 +00:00
Michal Berger
c2de56b0a1 configure: Fix DPDK version lookup in case submodule is in use
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I6184557bfd8ca24168324f874a032badd4f51477
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9558
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-24 07:42:05 +00:00
Ziye Yang
0d90cda0be bdev/rbd: Save comp varaible in bdev_io structure
Purpose: Better to put this varable into the bdev_rbd_io structure
instead of on the stack. And we will use this variable in next patch,
when the callback function is completed, so we should not put it on the stack.

Change-Id: I11ff46ef07908084012bc1ce040eceb667334a40
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9334
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-24 07:41:09 +00:00
Ziye Yang
70e2e5d94b bdev/rbd: Always save the submit_td while submitting the request
The purpose is that we will remove the group reaping of
rbd_io later, so we need to know the original thread info of the
rbd_io.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I69f60261447fdac0b0885fdb213e92c246439047
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9585
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-24 07:41:09 +00:00
Changpeng Liu
7fed70f1bd env/dpdk: revert 8f7d9ec "env/dpdk: Use the DPDK device count for IOMMU mapping"
This patch revert commit 8f7d9ec.  In function vtophys_iommu_init(), we
can use `dev->drvier` in RTE_DEV_FOREACH() loop to count number of devices
probed by device driver using vfio APIs, or we will count all the PCI devices
that bind to vfio-pci driver, only the probed device's IOMMU group is added
to vfio container.

The original implementation is correct to count `g_vfio.device_ref` in
vtophys_pci_device_added(), we don't need to count it in
vtophys_iommu_device_event() callback.

Fix issue #2086.

Change-Id: Ib1502a67960a49e9a2f93823cc8ceab2e8303134
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9236
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: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-24 07:40:21 +00:00
Karol Latecki
65113c191b examples/bdev: update fio bdev plugin readme file
Update readme file with more detailed examples on how to run
fio workloads versus local and remote storage.

Includes some minor markdown styling fixes as well, to
keep the file style consistent.

Change-Id: I93e8079abbda689a2d3414d1dca959e34c7e5b94
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8821
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-24 07:39:41 +00:00
Karol Latecki
faaa9dd596 scripts/gen_nvme.sh: add option for remote bdev JSON configuration
Add "create_remote_json_config" which will create
a bdev JSON configuration for SPDK initiator to
connect to NVMe-oF Target.

Change-Id: I2370c6911df35ffa1f27e93bdfa4ddb7f174ea49
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8776
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
2021-09-24 07:39:41 +00:00
Krzysztof Karas
38ea8d54f3 spdk_top: fix memory leaks upon exiting application
Fixes momory leak in spdk_top upon exiting due to not freeing
json response.

Fixes #2129

Change-Id: Ia0fee94e2c12dceda921cc540f6e3466ef4f6905
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9313
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-24 07:39:09 +00:00
Konrad Sztyber
a4b7f87b61 nvme: abort queued admin requests during init
Abort any queued admin requests once admin queue gets enabled. A request
can get queued if a controller is being reset and it gets submitted
while admin qpair is being reconnected.  If these requests aren't
aborted, the init process will stall, as requests don't get resubmitted
while controller is resetting and subsequent admin commands required for
the initialization would be queued too.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: If456a297d2d434b3cc741816cbfb13b01d37e963
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9324
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-24 07:38:57 +00:00
Alexey Marchuk
38829de4d9 bdev_nvme: Fix writev_ext completion callback
Copy-paste error, wrong completion callback
was used.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I0b66a70f541dbea72339c27aaf7fbd4ac99322d6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9573
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-24 07:37:45 +00:00
Alexey Marchuk
9381d8d399 nvme: Update spdk_nvme_ctrlr_get_memory_domain
Allow to return more than one memory domain.
This change aligns bdev and nvme API and provides
more flexibility for custom transports.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ica9b12ad8463c361be6cb62ee2c0513eec0b486d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9546
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-24 07:37:45 +00:00
Alexey Marchuk
ecfc50872f test/dma: Add functional test to verify DMA
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: If7eb7da6c3356aae9e8654372ce1c9a89bf25de6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8855
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-24 07:37:45 +00:00
Alexey Marchuk
fad59a283f perf: Align output of transport statistics
It'll make output more readable and align all
transports output

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I9ac420ffd947ed433ebefec50e7c287ddf2eb344
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9162
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: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
2021-09-24 07:30:06 +00:00
Alexey Marchuk
ea86c035bb nvme/tcp: NVME TCP poll group statistics
Enable dump of transport stats in functional test.
Update unit tests to support the new statistics

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I815aeea7d07bd33a915f19537d60611ba7101361
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8885
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-24 07:30:06 +00:00
Alexey Marchuk
7d589976f2 nvme_tcp: Check return value of spdk_sock_group_poll
This function may return an error and we should handle it

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I996ceb6e300bd9527385aded9068b2841e94a20d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9278
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-24 07:30:06 +00:00
Shuhei Matsumoto
75f1d6484a bdev/nvme: Aggregate multiple ctrlrs into a single bdev ctrlr
This patch enables us to aggrete multiple ctrlrs in the same NVM
subsystem into a single bdev ctrlr to create multipath.

This patch has a critical limitation that ctrlrs which are aggregated
need to have no namespace. Hence any nvme bdev is not created.
However it will be removed in the next patch.

The design is as follows.

A nvme_bdev_ctrlr is created to aggregate multiple nvme_ctrlrs in
the same NVM subsystem. The name of the nvme_ctrlr is changed to be
the name of the nvme_bdev_ctrlr.

NVMe bdev module has both the failover feature and the multipath
feature now. To choose which of failover or multipath to use, add an new
parameter multipath to the RPC bdev_nvme_attach_controller.

When we attach a new trid to the existing nvme_bdev_ctrlr, we use the failover
feature if multipath is false, we use the multipath feature if multipath is
false.

nvme_bdev_ctrlr has a list for nvme_ctrlr and it is guarded by the
global mutex. Callers can query nvme_ctrlrs from a nvme_bdev_ctrlr via
trid as a key. nvme_bdev_ctrlr is not registered as io_device.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I20571bf89a65d53a00fb77236ad1b193e88b8153
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8119
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-24 07:29:05 +00:00
Shuhei Matsumoto
14535253f1 bdev/nvme: Reset the nvme_ctrlr if an I/O qpair is disconnected
Previously, if an I/O qpair is disconnected, we tried reconnecting
the qpair. However, this reconnect operation was very likely to fail
and will not match the upcoming asynchronous connect/reconnect
operation. We need an extra callback to make this reconnect operation
asynchronous, but we do not want to have it.

Hence if an I/O qpair is disconnected, we free the I/O qpair and then
reset the corresponding nvme_ctrlr immediately. If the admin qpair is
also disconnected, the nvme_ctrlr is reset immediately. However this
event may never happen. So we do not wait for the error of the admin
qpair.

The NVMf host may disconnect connections by itself intentionally.
In this case, resetting the nvme_ctrlr will surely fail. But resetting
the nvme_ctrlr frees all I/O qpairs of the nvme_ctrlr and these I/O
qpairs are not created again until resetting the nvme_ctrlr succeeds.
Resetting the nvme_ctrlr once at most is more efficient than repeating
reconnecting the I/O qpair. So this change is valuable even for such
intentional disconnection. However, it is helpful to know the event that
I/O qpair is disconnected. Hence change DEBUGLOG to NOTICELOG in the
disconnected callback. The disconnected callback is not repeated, and
we do not need to worry about NOTICELOG flooding.

Refine the unit test case to verify this change.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I376b749c2f55d010692bf916370e8bb4249b795f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9515
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-24 07:29:05 +00:00
Shuhei Matsumoto
c9ab7ae4b3 nvme_tcp: Use qpair->poll_group only if it is not NULL
nvme_transport_poll_group_remove() clears qpair->poll_group. Hence
we should not use it after that.

Fixes #2170

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I57ceee8c66684e2d02b51b8a0f3d66aacbcb9915
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9560
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-24 07:29:05 +00:00
John Levon
d42557401c lib/thread: improve error message for wrong thread context
Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Id591f8566df1d6522742461501f750aa9a52a190
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9480
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-24 04:45:11 +00:00
Andreas Economides
5cd558f383 nvmf/vfio-user: fix lookup_io_q & some off-by-ones
lookup_io_q() should return NULL when qid == 0 (admin queue). This
ensures that handle_del_io_q() won't delete the admin queue (which is
prohibited by the spec) and fixes #2172.

Also fixes a few related off-by-one errors.

Signed-off-by: Andreas Economides <andreas.economides@nutanix.com>
Change-Id: I7ab063f25bba45b755d84c9ddde82072cf01f5e8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9593
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@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-24 02:37:34 +00:00
Karol Latecki
deb14d9cd2 doc: add SPDK NVMe Bdev 21.07 performance report entry
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I67728508bc6797dd38b5c8c9d836538be1989d8b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9586
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-23 16:48:50 +00:00
Karol Latecki
50be976452 doc: add SPDK NVMe-oF TCP 21.07 performance report entry
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: Ia1163ca9bc8477d2ef893593386a2f6bdbaeb2a0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9569
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-23 07:47:42 +00:00
Michal Berger
d5af2f0d73 pkgpdep: Fix typos, update comments
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I000087b4ecf6f887fb5d5c300215b72eee373115
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9553
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-23 07:45:17 +00:00
Tomasz Bielecki
85eb3ed86b nvme: Don't mention polling requirement on blocking functions.
The current documentation is misleading. All those functions are
blocking and handle admin queue polling internally.

Signed-off-by: Tomasz Bielecki <tomasz.bielecki@wdc.com>
Change-Id: I1062ef255e4cf10b1532771efe90837eaf1171d6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9222
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-23 07:41:25 +00:00
Maciej Wawryk
5293d380ce scripts/nvmf: added SAR results parsing
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ia858a47e51a6ef4a0fba1dc1e68d314b27e20342
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9276
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-23 07:40:35 +00:00
Michal Berger
1cd28b484f test/openstack: Adjust environment for stack.sh
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: If6c972893471fbb504bf2ccac540899ea66a699d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9368
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Karol Latecki <karol.latecki@intel.com>
2021-09-23 07:40:25 +00:00
Changpeng Liu
beca9a86fb nvmf/vfio-user: use a list for connected queue pairs
We can avoid extra iteration to null queue pairs by using a list.

Change-Id: Idebd5a396959372004c33f8b21c555032af67aae
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9350
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-23 00:01:07 +00:00
Changpeng Liu
94adbefa4f nvmf/vfio-user: disable shared IO CQ case
Existing vfio-user assumes that the IO SQ/CQ are paired, so we
return an error when creating SQ with shared CQID.

Leave a TODO comment, we may support this in future.

Change-Id: I297ce53eb9a119469145e2453177d03252b629c8
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9173
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-09-23 00:01:07 +00:00
Jim Harris
2bd631dc38 scheduler_dynamic: change directory name to just "dynamic"
This is similar to how we name other module library
directories.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9549
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-22 13:52:21 +00:00
Jim Harris
104f7bffa6 scheduler: remove unused SCHEDULER_THREAD_BUSY
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie23530aa2268c5a524e8fe78d35c8603da07f8ec

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9548
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-22 13:52:21 +00:00
Jim Harris
7653ceda5a nvmf: fix error message for per-poll group caches
Some spaces needed to separate some words from each
other.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9547
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-22 13:52:21 +00:00
Jim Harris
4aff2dfda7 check_format.sh: fix JSON-RPC doc checks
The check needs to fail if documentation is missing
for any RPC. But the way the check was written, the
rc would get set to 0 everytime it found docs for
an RPC. This means it would only return failure if
the last RPC that was checked did not have
documentation.

While here, add a message telling the user that
JSON-RPC docs are being checked, to be consistent
with other checks in this script.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib2ff0f0432ce3e2853526223c0ad00176d84a78c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9391
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Dong Yi <dongx.yi@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>
2021-09-22 08:30:54 +00:00
Jim Harris
7a372bbe12 rpc.py: only use dashes in argument names
SPDK has been inconsistent in the argument names,
most use dashes (--max-subsystems, --io-unit-size),
but in some cases we had underscores (--tgt_name,
--include_aliases).

So let's do 3 things here:

1) convert all argument names to use dashes only
2) if user passes and argument with an underscore,
   convert it to a dash implicitly - this ensures
   backward compatability and is a bit less pedantic
3) enforce use of dashes in check_format.sh

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I99289d3d3b03ce40cf192ad4fddec7b5c6bc8388
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9390
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-22 08:30:54 +00:00
Liu Qing
0fb77ea8c3 sock/posix: move fd creation to a separated function
Options modified on sock after connected is also moved to a
function.

Signed-off-by: Liu Qing <winglq@gmail.com>
Change-Id: I4c2a9ae9858c102764959d055bed208b4b0621d9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9516
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>
2021-09-22 07:00:28 +00:00
paul luse
549429e12d idxd: move header file to include dir
Used to be in the lib directory but an upcoming patch needs
access to it so move it to a more appropriate location.

The changes in the .h file were needed to address compile
error when in the /include dir (didn't get errors elsewhere)

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I44d11fc620f213b13683d62dca899e2792ca6ed5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9450
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.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-22 07:00:10 +00:00
Krzysztof Karas
2510b74e9d spdk_top: change border line display in tab window
Currently we use box() function to draw borders of tab windows.
This may be causing jumbled display in some terminals, when displaying
vertical lines inside tab window (as seen in #2053), so this
patch aims to change this.

Additionally changed length value of vertical line separating
tab menu from data rows, to avoid going "outside" the screen.

Change-Id: Ie842bb8c958a6c3aebef81e3a0e9f7b3d74dff53
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9415
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: Chengqiang Meng <chengqiangx.meng@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-22 06:59:06 +00:00
Mao Jiang
c17c7b9564 test/nvmf/transport: cases for creating polling group
Also make stub for spdk_mempool_get_bulk consistent with DPDK APIs.

Change-Id: I021378ea92651d75a73cc9f447df57c2f71680fa
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9356
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-22 06:58:51 +00:00
Michal Berger
88b2d4e6b4 pkgdep/git: Bump fio to 3.27
Newer version is needed to work properly with zoned devices.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I5e16116a00f0cb2af5c8028d1b4396c0d3cd42f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9183
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-22 06:57:40 +00:00
Michal Berger
7e703a59ad pkgdep/git: Add install support for lcov
This is targeted mainly for centos7 where newer devtoolset is meant
to be used and with which the shipped version of lcov is not
compatible.

Considering the above, don't add lcov to the default installation
list, keep it on-demand.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I8022770d301dc778317f6ada215c31877d058fbd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9513
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-22 06:57:40 +00:00
Michal Berger
e08096ac78 test/common: Don't log removal of tmp directories
The list may end up being quite big due to the number of executed
tests so drop it from the log.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Id9f2823be053a7ab8c03d95830d3f63f6f5aa4d0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9459
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-22 06:57:18 +00:00
paul luse
a19781ba61 lib/accel: rework UT for code reuse
Moved frequenty used stack vars to globals and added setup and
teardown functions.  Should be useful in upcoming patches as well
wrt code savings.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I468bec8856c354fcc954628e4e733594a6580104
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7013
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: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-09-22 06:56:46 +00:00
Maciej Wawryk
e588603d3e Revert "sock/posix: fix the socket pipe_has_data or socket_has_data."
This reverts commit 2cd948c4a6.
This commit caused drop in performance tests.
More info in issue https://github.com/spdk/spdk/issues/2158

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Id5d353535323c79e773e33377af388dae47238cb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9510
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-22 06:56:31 +00:00
Konrad Sztyber
1fbeeb23b3 nvme: rename nvme_qpair_abort_reqs to *_with_cbarg
Renamed nvme_qpair_abort_reqs() to nvme_qpair_abort_reqs_with_cbarg() to
highlight the fact that it only aborts requests with specified cb_arg
and to distinguish it from _nvme_qpair_abort_reqs() which aborts all
requests immediately.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I32fec5ab0501b1beb8605689d73ec42a6424fba5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9323
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-22 06:55:28 +00:00
Konrad Sztyber
75aa60e123 nvme: disable keep-alive during controller reset
When a controller is reset, it goes through the whole init process,
including establishing keep-alive, so there's no point in sending it
during that time.  Additionally, it can stall the initialization if it
gets queued when adminq is connecting.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib9fee42f6097972e8ba336958f81e1b6b1a5f006
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9310
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-22 06:55:28 +00:00
Konrad Sztyber
0825befa59 nvme: use saved CC register value when creating IO qpairs
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I6c518df9d8ecd74247ed8f8ffe133305cbd627f3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8622
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>
2021-09-22 06:55:28 +00:00
Konrad Sztyber
9e2166807a nvme: asynchronously wait for the controller to be enabled
Additionally, this patch removes reading the CC and CSTS registers from
`nvme_ctrlr_process_init()`, as it's no longer needed.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: If4f9e57dbf249fbce87e90018cff389f59906e38
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8621
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-22 06:55:28 +00:00
Konrad Sztyber
e4e94c383b nvme: print ERRLOGs when init fails due to CSTS read failure
When the controller initialization is failed due to not being able to
read the CSTS register, an ERRLOG is now printed instead of DEBUGLOG.
It should make it easier to debug initialization failures.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I42602bd08e263faf2e87fe4a68abcc82ddec11ba
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9556
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-22 06:55:28 +00:00
Konrad Sztyber
73050d511a nvme: enable the controller asynchronously
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2a8116bbb95f6835cd37118f81ec1144501c5b3a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8620
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-22 06:55:28 +00:00
Konrad Sztyber
5f3764852c nvme: asynchronously disable the controller during init
The CC register is now re-read again when disabling the controller as
preparation for subsequent patches, in which the synchronous CC register
read will be removed from nvme_ctrlr_process_init().

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ibfc8ed85bab188c3938451fbdfb771b969157807
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8619
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-22 06:55:28 +00:00
root
69f89ecf4b examples/idxd: Add the perf tool for idxd
The purpose of this patch is to add an independent
idxd perf tool. Because users may not always
use SPDK application framework, io channel related
API.

With this tool, users can know to integrate spdk's
idxd api in their own software stack.

In this patch, batched submission is not supported yet.

Change-Id: I6e3e62cdb7c43da591ab0ae90fc17771222f7285
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9398
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: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-22 06:54:48 +00:00
Michal Berger
1670d1ddf1 scripts/pkgdep: Add Software Collections repo to centos7
This one provides devtoolset packages which can be used for adding
alternatives for some older packages like gcc for instance. Useful
for the CI to bring newer stuff into VMs.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ia82d712e670177f37256a999f5dc2a07784d2218
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9500
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: Karol Latecki <karol.latecki@intel.com>
2021-09-21 07:52:48 +00:00
Michal Berger
a90e749f44 test/ftl: Use emulated zoned devices instead of ocssd
Support for Open-Channel SSDs is dying out (already marked as
deprecated in linux kernel, scheduled for complete removal in 5.15)
hence we should slowly adjust our test suites and move towards more
standardized zoned nvmes.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I038b6361a78b27c2b350ccf594d201ffe92794e3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8295
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2021-09-21 07:52:48 +00:00
Krishna Kanth Reddy
13905aa3e7 examples: Zone Descriptor Extension support
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I22038e65cc3c2d65c4857569185f14bce2ab1aaf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9495
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@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-21 07:45:43 +00:00
Shuhei Matsumoto
87e9ae4035 bdev/nvme: Poll group manages ctrlr channels for qpair disconnect
Poll group has a list of the associated ctrlr channels to update
them when the corresponding I/O qpair is disconnected to do path
failover.

Another idea is that poll group has a list of the associated bdev
channels. However, two or more bdev channels may share a single
ctrlr channel and I/O qpair is per ctrlr channel. What we want to do
by this addition is to stop I/O submission to any failed I/O qpair
and choose alternative I/O qpair. Hence we take the first idea.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia287bd1b803313e66b8505a19694a40133b675f1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8124
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-20 10:51:04 +00:00
Shuhei Matsumoto
cf0dbbb924 ut/bdev_nvme: Copy probe_ctx->opts to ctrlr->opts
In unit tests, spdk_nvme_ctrlr had opts but did not use it.

Hostnqn will be checked to determine if multipath can be created.

Hence we implement the stub spdk_nvme_ctrlr_get_default_ctrlr_opts()
and copy probe_ctx->opts to ctrlr->opts as we do in lib/nvme.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I13980424d5f463877eae7f7cd1e5ffcae888aebe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9333
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: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-20 10:51:04 +00:00
Shuhei Matsumoto
17d28590fd bdev/nvme: Get ctrlr from ctrlr_channel by spdk_io_channel_get_io_device()
Previously nvme_ctrlr_channel had a pointer to a nvme_ctrlr and used it
throughout. However the use cases are not performance critical and
are better to convert from nvme_ctrlr_channel to nvme_ctrlr by
spdk_io_channel_get_ctx() and spdk_io_channel_get_io_device().

Provide a convenient macro nvme_ctrlr_channel_get_ctrlr() to do it.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie22e8c318af88e09b95824c67b3e874d85425f1a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9195
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-20 10:51:04 +00:00
Michal Berger
e2faef472b pkgdep: Install liburing regardless if it's in the ld cache
Some distros may already provide liburing (e.g. fedora34) as a
package. In case given system has it installed, without the devel
portion, we would skip building our own version leaving system
without proper include files needed for the tests.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I7b07ba8d1c3c6b97d6b114935dfe472cc7902bf6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9543
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-20 10:49:19 +00:00
Michal Berger
f105046fe3 doc: Fix issues reported by newer Doxygen versions
Issues in question:

include/spdk/bdev.h:919: warning: argument 'md' of command @param is
not found in the argument list of spdk_bdev_readv_blocks_ext(...)

include/spdk/bdev.h:1122: warning: argument 'md' of command @param is
not found in the argument list of spdk_bdev_writev_blocks_ext(...)

include/spdk/bdev.h:211: warning: Found unknown command '\erf'

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I9322bde021460f4bef8e41050b9cfc6492a14a2c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9541
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2021-09-20 10:49:19 +00:00
Michal Berger
91a4e9160a doc: Add page describing OS distros used by the CI
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I9efbb1928e1935ec55edbdb23a6ad99772b1e6ae
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9522
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Karol Latecki <karol.latecki@intel.com>
2021-09-20 10:48:56 +00:00
Konrad Sztyber
42b6254197 ut/rpc: mock out system calls
Mock out open, close, unlink, and flock system calls.  Flock isn't
supported under nfs, so if the repo is mounted through nfs, the test
will fail.  And a unit test shouldn't be doing these calls aynway.

Additionally, changed listen_addr from an IP address to a file path, as
the RPC listens on a UNIX socket, so an IP address doesn't make much
sense.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Icc759a74e6db4d1b9e766313a1e4672820e1c272
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9446
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-20 10:48:34 +00:00
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
Alexey Marchuk
97385af196 nvmf: Fix double controller destruction when subsys is deleted
When a subsystem is being deleted, we disconnect all qpairs
and when the last qpair for some controller is disconnected,
we start controller desctruction process. This process requires
to send a message to subsystem's thread to remove the controller
from the list in the subsystem and after that send a message to
controller's thread to release resources.
The problem is that the subsystem also destroys all attached
controllers. This order is unpredictable and we may get
heap-use-after-free or double free.

To fix this problem we can rely on the fact that the subsystem
can only be destroyed in incative state, that means that all
qpairs linked to the subsystem are already disconnected and
all controllers are already destroyed or in the process of
destruction.

spdk_nvmf_subsystem_destroy API is now can be asyncrhonous,
it accepts a callback with cb argument.

Change-Id: Ic72d69200bc8302dae2f8cd8ca44bc640c6a8116
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6660
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
Jim Harris
971f07b9fb nvme: add tracing to pcie request path
John Kariuki tested this patch on a system with
several Intel P5800X Optane SSDs, to determine the
performance impact of adding these two
spdk_trace_records() in the main NVMe I/O path.

The pathological case (512B random reads on a single
Xeon core) decreased from 13.10M to 12.88M, or 1.7%.
Normal workloads (4KB+) would incur a smaller penalty
since the I/O rate would be much lower - maybe even
unnoticeable..

This is a really valuable tracepoint to have enabled
by default, so I think this small amount of degradation
is acceptable.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9303
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-08 08:03:20 +00:00
Krzysztof Karas
6b79ee126b spdk_top: refresh tab space
Currently THREADS tab displays records of objects that
have already been deleted inside SPDK target.
This patch adds redrawing of empty spaces to erase those
leftovers.

Deleted threads_info pointer array, since we can use
the global array directly.

Change-Id: Ia4ccb8f1b9a530cb86be50b9ed629f6b9b0543cb
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9199
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Chengqiang Meng <chengqiangx.meng@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: GangCao <gang.cao@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-08 08:01:52 +00:00
Krzysztof Karas
6c7e079d04 doc/nvmf_tracing.md: add link to nvmf target configuration page
NVMe over Fabrics target page mentions nvmf traces, but nvmf traces
page does not link the nvmf target guide - the need to configure
target using our guide is obvious, if user follows the guide and
then enters the traces page. However, if user lands on traces page
first, the need to configure target first is not clearly communicated.

Change-Id: If4aef1a8d061acb436ca77c3308e8dda0ab340cf
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9345
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 07:59:31 +00:00
Ziye Yang
caa1f84e1c lib/idxd: Fix the idxd_ops resource exhaustion in chan->ops_pool
The issue is that:

We call cb_fn firstly, then add the related idxd_ops into the
chan->ops_list. Then if in user's callback, we call spdk_idxd_submit_*
function gain, then we will allocate new idxd_opts first.  So if there is
recursive spdk_idxd_submit_* in the call back function, then
we will exhaust all the ops_pool resources. And the function will
report -EBUSY issue in _idxd_prep_command function.

And this patch fixes this issue by adding back idxd_ops before calling
user's call_cb function.

Change-Id: I32239fb29be875bc452803a48dc24ff5fa533016
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9401
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-08 07:59:21 +00:00
Ziye Yang
43299f394d lib/idxd: make errmsg of "cannot set implementation" more clear.
Add more information to users which implementation cannot
be set for idxd.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Ib26f117dc19fa1f28cc1d548549caba0b696a915
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9399
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-08 07:59:21 +00:00
Jacek Kalwas
dfafab22af nvmf: allow to query only specified subsystem
Similar is already done for json-rpc bdev_get_bdevs, it might be
useful for the upper layer which has no interest in all but only
in one specified.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I25f7d20ff953e612d7982207d57607f1c3bbaa90
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9361
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-07 07:35:11 +00:00
Jacek Kalwas
bf22ddc60f module/bdev/nvme: return nvme ns as a module ctx instead nvme ctrlr
It is more flexible now as it is possible to get nvme ns handle to do
additional management or queries, however if nvme ctrlr handle is needed
there is already public nvme API for that with nvme ns as an input.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I5493168ad31cc95687962288d57fb5457f2d7dd6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9357
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-07 07:34:56 +00:00
Mao Jiang
5f0ed1cc97 test/nvmf/subsystem: cases for valid nqn
Change-Id: I4dbbc4ec555c08395d257568aa2fcc49e7bd3cbf
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9321
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-07 07:34:31 +00:00
Krishna Kanth Reddy
e93e308d3e test/nvme: Add test application to verify Boot Partition Read / Write support
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: Id26304baef0dd320ecdd4e86cb069bfe8475f6c3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8632
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-07 07:34:09 +00:00
Krishna Kanth Reddy
fec55c842c lib/nvme: NVMe Boot Partition Read / Write support
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I44a7f41553db2f622b14bd4a20cad7f014801a65
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8631
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-07 07:34:09 +00:00
Jim Harris
6e5d6032a0 bdev/nvme: use spdk_nvme_ctrlr_prepare_for_reset()
When preparing for a reset, use this new call to tell
the driver to avoid sending DELETE_CQ/SQ commands to a
PCIe controller when they aren't needed.

Fixes issue #2073.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9ebb7d5c3f7cbb1c3192f162f32edbbea41acde1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9250
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Matt Dumm <matt.dumm@hpe.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2021-09-07 07:33:41 +00:00
Jim Harris
3cb9bc2593 nvme: add spdk_nvme_ctrlr_prepare_for_reset()
This new API signals that the ctrlr will soon be
reset. This allows the transport to skip unnecessary
steps in following calls to the driver prior to the
reset - for example, skipping PCIe DELETE_SQ/CQ
commands when freeing an IO qpair.

Note that if we are deleting a qpair after
prepare_for_reset was called, and the qpair is
still waiting for a CREATE_IO_CQ or CREATE_IO_SQ,
we cannot poll for those commands to complete,
but we also cannot free the qpair immediately.
So set a flag for this case to defer the
destruction until the outstanding CREATE_IO_CQ or
CREATE_IO_SQ callback is invoked (typically as an
aborted command when the reset happens).

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9249
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-07 07:33:41 +00:00
John Levon
89c4d059b7 nvmf/vfio-user: clarify endpoint fd meaning
Rename endpoint->fd to ->devmem_fd to better reflect its purpose.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Ic73cb6684228d4ecb3d58c1865c80a3d7d07c223
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9402
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-07 07:33:29 +00:00
Krzysztof Karas
b05d4a7d19 scheduler: add scheduler subsystem JSON configuration
Added writing out JSON configuration for the scheduler
subsystem.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I51b1f94b3f56d0bfb8a87127163c8e248d6846b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7119
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-07 07:33:03 +00:00
Tomasz Zawadzki
a86e40f320 scheduler: create public API and subsystem for scheduler/governor
This patch moves schedueler and governor related API from
the internal event.h to public scheduler.h.

With this it is possible to create subsystem responsible
for handling the schedulers.
Three schedulers and a governor were moved to scheduler modules
from event framework.

This will allow next patch to add JSON RPC configuration
to the whole subsystem.
Along with easier addition of other schedulers.

Removed debug logs from gscheduler, as they serve little purpose.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I98ca1ea4fb281beb71941656444267842a8875b7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6995
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>
2021-09-07 07:33:03 +00:00
Tomasz Zawadzki
b518cbe2d4 lib/event: handle error before balance()
Make sure to cancel the scheduling during:
1) gather_metrics error (already present)
2) setting the scheduler to NULL (new)
3) shutdown of the application (new)

In all of the above scheduler cannot proceed to
the balance() function.

Prior to this patch lack of setting
g_scheduling_in_progress to false would block
_start_subsystem_fini() from proceeding.
Resuling in application never shutting down.

thread_infos are allocated during gather_metrics,
and freed on threads_reschedule.
The added cleanup is used during 1) and 2).

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5ab77c85aaa9f94bd4e1a1660b55ab2f2c47bbdc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9326
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: Jim Harris <james.r.harris@intel.com>
2021-09-07 07:33:03 +00:00
Ziye Yang
a03bc55669 uring: Fix socket rotation and ordering issue in the pending_recv list.
When we rotate the socket in the list, we did not check whether the uc pointer
is NULL, then we cause the coredump when using uc pointer.

When we add a new socket (with pollin event) into the pending_recv list,
we add it into the end of the pending_recv list, then it delays the execution
of the newly socket, and it can cause the timeout especially when a socket
is in a connection phase.

So the purpose of this patch is:
1 Revise the rotation logic to handle the two cases, i.e., (1)sock is in the
beginning of the list; (2)sock is in the end of list. The purpose is
to avoid NULL pointer access, and efficently handle the exceptional case.

2 When there is new pollin event of the socket, we should add socket in the beginning
of the list. And this can avoid the new socket handling starvation.
Since max poll event num is 32 from upper layer and if we always put the new socket
in the end of the list, then starvation will occur if there are many socket connection events.
Because if we add the new socket into the end of the pending list, we will always handle the
existing socks first, then the later coming socket(with relatively pollin event) will always be
handled late. Then in the sock connection initialization phase, it will consume a relatively
long time, then the upper layer connection based on this socket will cause timeout,.e.g.,

ctrlr.c: 185:nvmf_ctrlr_keep_alive_poll: *NOTICE*: Disconnecting host nqn.2014-08.org.nvmexpress:
uuid:af56cce7-2008-408c-a8a0-9c710857febf from subsystem nqn.2019-02.io.spdk:cnode0 due to
keep alive timeout.
[2021-08-25 20:13:42.201139] ctrlr.c: 579:_nvmf_ctrlr_add_io_qpair:
*ERROR*: Unknown controller ID 0x1

Fixes #2097

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I171b83ffd800539e86660c7607538e120fbe1a91
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9223
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.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-07 07:32:50 +00:00
Changpeng Liu
a8c953cd9b nvmf/vfio-user: print return value for failed memory register/unregister
Change-Id: I5348ba084fea8053602e12639146df97805cc6eb
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9174
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: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
2021-09-07 01:47:30 +00:00
Changpeng Liu
07f0632956 nvmf/vfio-user: optimize NVMe command log
Previously vfio-user doesn't print IO commands.

Change-Id: Id3b10b9b22487b448765cee5a3dbf5fcf680973c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8867
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: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-09-07 01:47:30 +00:00
Karol Latecki
ead0cc342c scripts/nvmf_perf: do not print fio ETA
Do not print ETA output. This pollutes logs when long
benchmark tests are run.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I0dfe30fdd727decb4d81be6b530e675bc1f4518c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9379
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-09-06 09:56:29 +00:00
John Levon
f0b05dd384 scripts/pkgdep: respect $ID_LIKE
As per os-release(5), if $ID is not recognised, $ID_LIKE can be used
to identify similar systems in preference order. Modify the script to try both
variables.

Also do the same for the RPM build scripts.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I4ed924df01ec678aab232e114d8c9980463c38e0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9260
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
2021-09-06 09:56:14 +00:00
ChengqiangMeng
1ab3531e20 unittest/rpc: add rpc unittest
-add test for rpc functions.

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: I33ad89e993ba0b5a5aaebf47e7c2215fc634da87
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8576
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-06 09:55:33 +00:00
Krzysztof Karas
aeea7c2a6f spdk_top: reduce threads pop-up height
The threads pop-up has additional whitespace printed after the last
poller record. Since this empty space is not used anywhere in
in spdk_top, it can be removed.

Fixes #2137

Change-Id: I2e8fee79eea8ffd2a98e803cf41baa2fc4f95d24
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9360
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-06 09:54:38 +00:00
John Levon
e128476793 lib/thread: report error when adding to fd group
We report other errors in spdk_interrupt_register(), so add one if there is an
issue with adding the given efd to the fd group.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Idcd810d2b3f644bab1514063b399b9767797130f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9388
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: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-06 09:54:21 +00:00
Jacek Kalwas
86d7e4dc18 nvmf: add interface to dump transport specific listen opts
transport specific options are already introduced however dump was missed

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I2fe533898d82534cc6cb8a3e5de4e2b2c72ae00a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9355
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-06 09:53:57 +00:00
Jacek Kalwas
1f094a9405 nvmf: deduplicate transport listen dump opts
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I1a4818a33cd82fce7dfb57030f2530522a01c45f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9354
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-06 09:53:57 +00:00
Jacek Kalwas
220bcf7d74 nvmf: deduplicate transport dump opts
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I2ce20f18597314df80e5f49ece72272f9bb6e414
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9353
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-06 09:53:57 +00:00
Tomasz Bielecki
296ae15fd7 nvme: add spdk_nvme_ctrlr_get_regs_cc
Expose the already existing nvme_ctrlr_get_cc as
spdk_nvme_ctrlr_get_regs_cc, similar to spdk_nvme_ctrlr_get_regs_csts and
spdk_nvme_strlr_get_regs_cap etc.

Signed-off-by: Tomasz Bielecki <tomasz.bielecki@wdc.com>
Change-Id: Ibfcf6fbe64dee3719f381184fb728ab6e4d52526
Signed-off-by: Tomasz Bielecki <tomasz.bielecki@wdc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9220
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: Krishna Kanth Reddy <krish.reddy@samsung.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-06 09:47:37 +00:00
Shuhei Matsumoto
6d716c4705 nvmf: Update only ANA state of specified ANA group by RPC
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iccf3f393d1f027d04a57324762e6aabaf9d5a0df
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9117
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
2021-09-06 09:47:01 +00:00
Shuhei Matsumoto
694fa34d65 nvmf: Make anagrpid configurable when adding ns to subsystem by RPC
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I77e2e79889edb87374d81638380887ccc711818a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9114
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-06 09:47:01 +00:00
Shuhei Matsumoto
785d10b5c7 nvmf: Make ANA state not only per subsystem listener but also per ANA group
Refine ANA state from per subsystem listener to per subsystem listener
per ANA group.

Add an array of ANA state per ANA group to subsystem listener. The array is
indexed by ANA group ID - 1.

Then in I/O paths, we get ANA state by
    ctrlr->listener->ana_state[ns->anagrpid - 1].

The NVMe specification indicates the existence of NVM subsystem specific
ANA state when FFFFFFFFh is specified as NSID for the Get Features
and the Set Features commands. For these, we return the optimized state.

Update the nvmf_subsystem_get_listeners RPC to return all ANA states
of the underlying ANA groups. The nvmf_subsystem_get_listeners RPC is
not matured and not used in the test code yet. Hence compatibility is
not high priority.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia2d4d5361ac01236f595c22765fd35e4c5fdee0e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9064
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-06 09:47:01 +00:00
Shuhei Matsumoto
07bfc3cbe9 nvmf: Add anagrpid to ns and count number of ns per ANA group in subsystem
This is the first patch in the patch series to control ANA states not only
as a unit of subsystem listener but also as a unit of ANA group and create
user preferred mapping between namespaces and ANA groups within a single
subsystem.

This patch adds anagrpid to both spdk_nvmf_ns and spdk_nvmf_ns_opts, and adds
ana_group array to spdk_nvmf_subsystem to count number of namespaces per ANA
group within a single subsystem. The size of the ana_group array is equal
with the size of the namespaces.

For each subsystem, allocate ana_group array regardless of the value of
ana_reporting of the subsystem.

For each namespace, at its creation, initialize anagrpid explicitly to be equal
with nsid by default and increments the corresponding entry of the ana_group
array of the subsystem regardless of teh value of the ana_reporting of thee
subsystem.

Hence the contents of the created ANA log page is not changed even if the
algorithm to crete ANA log page is changed.

Additionally this patch adds a unit test case that one ANA group
has multiple namespaces.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I78539db4e7248c2953c6927ff8128cb5a7e34b96
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9102
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-06 09:47:01 +00:00
Shuhei Matsumoto
d2b9b2afb7 nvmf: Add ABI compatibility check to spdk_nvmf_ns_opts
The next patch will add anagrpid to spdk_nvmf_ns_opts. This patch
is for the upcoming change and futhre potential changesto ensure the
ABI compatibility.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibe1024a27ea4ab823d40d775470cde78b9eb8d2c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9112
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-06 09:47:01 +00:00
Michal Berger
85bf4c81a4 autotest_common: Simplify check for libiscsi's API version
This is done to get rid of this:
autotest_common.sh: line 384: [: -ge: unary operator expected

This happens for older libiscsi which doesn't define
LIBISCSI_API_VERSION in the iscsi.h.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I658ab2936e161d648fc301fadcc510b84a61d916
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8710
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>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2021-09-03 08:08:52 +00:00
Michal Berger
9378515eee autotest: Include only parent dir of the source in PS4
Previous expansion was assuming there's only one instance of "test/"
string in source's path but this is not really the case on phy
systems running in the CI. Instead of relaying on the string pattern
of the path, simply disect it into basename_dir/source. So e.g.:

/home/vagrant/spdk_repo/spdk/autobuild.sh -> spdk/autobuild.sh
/home/vagrant/spdk_repo/spdk/test/nvmf/common.sh -> nvmf/common.sh

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I6f458566547dcaf5508263b2b19f4e1bc0de4f32
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8836
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>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2021-09-03 08:08:45 +00:00
Michal Berger
d9bf6320b1 bash-completion: Use -h output in case app is not available under the sock
In case SPDK app crashed the leftover sock file would force completion
to use rpc_get_methods() instead of the -h output to get the list of
rpc functions. The end result would look something like:

$ rpc.py <TAB> IsSPDKapplicationrunning?

By the very accident this is quite informative about the state of the
app but from bash-completion standpoint not very useful. Instead,
if rpc_get_methods() fail fallback to -h output.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I9ca0b919445e5a08c49ab8fa5d0a3acc2e5c4e4e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8448
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>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
2021-09-03 08:08:28 +00:00
Michal Berger
7c06be855a bash-completion: Use default completion if there are no matches
This helps in completing, for instance, file paths as arguments to
some of the rpc functions (like bdev_aio_create, etc.).

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Id0880773fade3fc6128ac9de6abfe19f6b40077f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8447
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>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
2021-09-03 08:08:28 +00:00
Michal Berger
095df6b25a pkgdep: Copy the bash-completion file instead of creating a symlink
Symlink requires repo to be around, having a hard copy allows it to
be used standalone.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: If5aa354b10762805394418e9c9c0d171623ba093
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8446
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
2021-09-03 08:08:28 +00:00
Liu Xiaodong
de1df7a17d rocksdb: fix thread name typo
Change-Id: Ica0eff7268c227dac5fc3491b6894cd34ecea034
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9384
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-03 08:08:20 +00:00
Changpeng Liu
7ebcd64889 nvmf/vfio-user: check ADMIN command PSDT field
Previously we used assert for this check.

Fix #2141.

Change-Id: Ieaf8e34721a5b65e6d7790d56587239e2e6d75f4
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9383
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-03 08:08:13 +00:00
matthewb
f7b9f80b32 lib/nvmf : Fixed bad response if response is sent prior to _nvmf_request_complete being called
If a response is returned prior to _nvmf_request_complete being called then the cid in the response is
not set correctly and the PDU state is not reset which causes a hang and the PDU state machine is
expecting more data but none will be sent.  There are two cases where this can occur:
1) If the request is bi-directional
2) If nvmf_tcp_req_parse_sgl returns an error (e.g max_io_size exceeded)

Signed-off-by: matthewb <matthew.burbridge@hpe.com>
Change-Id: Icc3ed02a4499a12d8920e6433a746b72022a72fe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9327
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-03 08:07:55 +00:00
Ben Walker
940765a903 nvme: No longer allocate arrays of size NN in cuse handling
If NN is very, very large, this allocates too much memory. For now, just
use a list.

Change-Id: I904977673d8fb6c86f03c94ba798c6cc07f4a4d8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9301
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-03 08:07:25 +00:00
Ben Walker
72eab36037 nvme: Eliminate CONSTRUCT_NS state
This can be done immediately after receiving the controller identify
data for now.

Change-Id: I527a44c4d1f4d3ad2eeb8fc77e07086c2358cac3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9300
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-03 08:07:25 +00:00
Ben Walker
4ecbc5bb0e test/nvme: Simplify making an identify command fail
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I917b747a7c0f96a3439b539478666e777f4c85ff
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9299
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-03 08:07:25 +00:00
Ben Walker
789055cad4 bdev/nvme: Remove namespace types
There's only one type now.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I8fbf330797e772b1c45a04970c95bf4894c26639
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9348
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-09-03 08:07:25 +00:00
Ben Walker
dcc2a96af9 bdev/nvme: Remove async callbacks for populating namespaces
Only OCSSD needed this.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I41ee6a08fb4b87a710ca8399545abb9a9622c5be
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9330
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-03 08:07:25 +00:00
Ben Walker
9a29520be1 bdev/nvme: Eliminate populate_namespace callbacks
There's only one kind of namespace now that OCSSD is gone, so simplify
those whole path.

Change-Id: I721de11c3e7be8b3a13ada25b6d6163a67c6659f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9329
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-03 08:07:25 +00:00
Ben Walker
d39c4443d4 bdev/nvme: Remove OCSSD support
As far as we're aware, this is not in use by anyone. OCSSD has largely
been replaced by ZNS and no OCSSD drives made it to the market.

Change-Id: I020ee277da5292f8c4777f224acafd87586f8238
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9328
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
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>
2021-09-03 08:07:25 +00:00
Karol Latecki
5deb77ad89 doc: add Vhost 21.07 performance report link
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I4f9c904ca04dfde9d6d44774dff106790bf53167
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9358
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-02 13:54:51 +00:00
John Levon
fa20c0bb83 vhost-blk: fix interrupt names
Interrupts were all being registered with the name "fn". Directly pass in the
name instead to fix this.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I38e59d784298a61ca2130090ede500101389685c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9346
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Rui Chang <rui.chang@arm.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-02 07:43:37 +00:00
Krzysztof Karas
90a7a92456 spdk_top: check thread ID before invoking pop-up from core pop-up
This is to prevent app crashing when selecting a core with no
threads and invoking threads pop-up. The thread ID is being checked
before threads pop-up is displayed.
(by default this value is set to 0, because valid thread IDs start
from the value of 1).

Fixes #2132

Change-Id: I2285370a41fa087c21f968d13882ad06e6577423
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9363
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: Chengqiang Meng <chengqiangx.meng@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-02 07:43:07 +00:00
Jim Harris
e90a98ed98 bdev/aio: return void from bdev_aio_readv/writev
The values returned weren't actually used, and instead
make the code unclear especially in the error cases.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iee2661545a6831f6151a183d4ac723c835e84d13
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9349
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-02 07:42:31 +00:00
Jim Harris
30964540fa test/nvmf: only build and run transport_ut.c when RDMA is enabled
transport_ut.c has hard dependencies on RDMA header files,
so we cannot try to build it if CONFIG_RDMA was not specified
at configure time.

Found by OSS-Fuzz.

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37892
https://oss-fuzz-build-logs.storage.googleapis.com/log-b5922a9c-3219-479f-a0a8-50b69ca19473.txt

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iece49a6defcf713e00daaebcf054167a55bce8d0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9347
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-01 07:34:37 +00:00
paul luse
95e4b24d5e module/accel/idxd: don't increment flow control on submission error
Shouldn't really ever happen but is somehow things get out of whack
and we get a busy back from the low level lib we don't want to
increment our flow control counter.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I49176e8ad2bf6f658ac970efea5db89eebc747f1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9232
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-01 07:34:02 +00:00
paul luse
ab48766fd1 test/accel_engine: add more test cases
There's been a few silly escapes lately that we can catch with
some quick tests.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I6f6e9591573b2ab54da239981423341aeb0bdbb9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9190
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-09-01 07:34:02 +00:00
Ziye Yang
0c9a003b37 accel: Fix the data copy issue for copy+crc32c in vector mode.
The root cause is that we do not the copy the contents
to the dst address correctly.

So provide a _sw_accel_copyv function to address this
issue.

Fixes #2096

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I25d0e60f51abd41ed77b2b23f08d609f4f052de0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9193
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: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-09-01 07:34:02 +00:00
paul luse
5bdad0c1af examples/accel_perf: fix small bugs with copy + crc
Wrong opcode was used when deciding whether a dst buffer is needed
or not. Also on freeing we were freeing src instead of the vector
parts of the task.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I33eb9408ee20eca6c44911b4567d0367528347de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9189
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: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-09-01 07:34:02 +00:00
paul luse
df42f3582b lib/accel: eliminate need for caller to schedule completions
Previously the accel_perf tool would look at whether it had HW
or SW commands to know whether to execute the callback right away
or schdule to avoid blowing the stack (SW calls are sync).

Moved this to the SW module (part of the accel engine) so the
caller doesn't have to worry about.  Allowed for a few simplifcations
in the tool as well.

Also, instead of using send_msg to call the completion we add it to
a list in the sw module that a new poller uses to perform the
completions as this is more efficient the sending a message to the
same thread.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ifc6c5b8635f51e3fa1a825c8573378b3752d7d91
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9171
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-01 07:34:02 +00:00
paul luse
31079d2d94 lib/idxd: batch perf improvement
Small but noticable on perf top. We were using a list to track
valid batches and checking it on every submission.  Instead just
put a valid channel ptr in the batch struct and clear it when the
batch is freed. There was no other reason for the list.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ia26ceee578be4a82f4fd8abb2358ff18c56271a4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9149
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-01 07:34:02 +00:00
Michal Berger
75eed7b52e pkgdep/git: Lookup REFSPDK_TAG to build refspdk against a custom tag
This may be used by CI to determine which version of the SPDK the
refspdk should be built against. The default of using the latest tag
is not changed.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ia114bea163fb291d1a59069d34e62005865b04bc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8942
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-08-31 08:40:18 +00:00
Tomasz Zawadzki
a09bf113a8 event/scheduler_dynamic: remove g_core_mngmnt_available
There is no need to track if governor was enabled during
initialization of the scheduler dynamic.
Instead _spdk_governor_get() can be used to determine that.

While here set the default g_governor to NULL.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ibdfde3d2714dd0b6d629f19f0d246b4fc3c9d214
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9325
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-08-31 08:39:55 +00:00
Tomasz Zawadzki
ece9471659 lib/event: cleanup and document governor API
This patch cleans up the header file, structures and
parameters of governor API. While documenting the
functionality.

- made governor name const
- renamed _spdk_governor_list_add() to _spdk_governor_register()

This is preparation to making this API public.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ie394109c839dead0e7ade946f95be8105b00e674
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8843
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-08-31 08:39:55 +00:00
Tomasz Zawadzki
a86c94b3d1 lib/event: cleanup and document scheduler API
This patch cleans up the header file, structures and
parameters of scheduler API. While documenting the
functionality.

- made scheduler name const
- removed typedefs for schedueler callbacks
- balance() now accepts uint32_t for array size instead of an int
- removed unused _spdk_lw_thread_set_core()
- renamed _spdk_scheduler_period_set() to _spdk_scheduler_set_period()
- renamed _spdk_scheduler_period_get() to _spdk_scheduler_get_period()
- renamed _spdk_scheduler_list_add() to _spdk_scheduler_register()

This is preparation to making this API public.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ia7b6b6a5eafb052ac275db6c04113a8ad442383f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8842
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-08-31 08:39:55 +00:00
Tomasz Zawadzki
4c5246c97f lib/event: add governor structure name in SPDK_GOVERNOR_REGISTER macro
Registering multiple governors would fail due to them having
the same name. Only saved by the fact that right now,
there is only one governor registered in this fashion.

Fix it by adding name of the governor structure passed
to the function name.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ic7a206da2c8f5dc1e72e41629bccf989c030f182
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8792
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
2021-08-31 08:39:55 +00:00
Tomasz Zawadzki
d6c4f8cf6b lib/event: refactor _spdk_scheduler_set()
By default g_scheduler is now NULL. It can be set
either by event framework or RPC.
To keep RPC consistent, the 'static' scheduler was kept.

All access to the g_scheduler is done via _spdk_scheduler_get().
Access to its members is done to balance, get name for RPC and
through _spdk_scheduler_set(). All of them happen on scheduling
reactor and don't pose race condition when changing scheduler.
There is no need to delay init/deinit of scheduler via g_new_scheduler.
This variable was removed and all that happens in _spdk_scheduler_set().

To unset and deinitialize current scheduler,
_spdk_scheduler_set(NULL) has to be called.
This results in moving scheduler deinitalization to that
call too.

Every spdk_scheduler callback is now mandatory.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1fed766989de9bcaeb7e82b490c1275f3572d77d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8811
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-31 08:39:55 +00:00
Tomasz Zawadzki
2e394521a6 lib/event: refactor _spdk_governor_set()
By default g_governor is now NULL. It can be set
either by event framework or schedulers directly.

Dynamic_scheduler and gscheduler specifically want
to use the dpdk_governor, so their initialization
now sets it explicitly.

To unset and deinitialize current governor,
_spdk_governor_set(NULL) has to be called.
This results in moving governor deinitalization to that
call too.

The "default" governor has been removed.

Every spdk_governor callback is now mandatory.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ibf76bd28bfbb159416026996fa217bb3325a3d31
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8810
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
2021-08-31 08:39:55 +00:00
Tomasz Zawadzki
5bf2973e9f lib/event: remove per core init/deinit API from governor
There is no explicit need for the spdk governors initialization
to occur on per core basis.

This implementation detail for dpdk_governor is now hidden
in the init/deinit calls. There is no recourse when failing
deinit for a certain core, so ignore the return code.
Changed return type for deinit in governor and scheduler to void.

While here modified the callbacks for scheduler to no
longer require passing currently selected governor as an argument.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I7f0b7a09aa7f5d12ae47fca25186faeedac31a95
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8791
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
2021-08-31 08:39:55 +00:00
Sydney Vanda
65425be69a vmd: update for changes in IceLake platform
Add the new device ID for VMD devices so VMD devices
can be unbound and used with the SPDK setup script.

Bus numbering for VMD devices is different on IceLake platforms,
and only half of the bus numbers are available. Add a function to
set the starting bus number and the max bus number by reading the
new BUS_RESTRICT_CAP and BUS_RESTRICTIONS VMD registers.

Signed-off-by: Sydney Vanda <sydney.m.vanda@intel.com>
Change-Id: I8905d4bcba84c74e3dadfb27262e668c4281b0c8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8331
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-31 08:39:37 +00:00
Konrad Sztyber
662c0200be nvme/pcie: make sure qpair connection is finished in delete
When deleting an IO qpair, make sure that it's connection process is
finished (i.e. create CQ/SQ commands are completed) before freeing it.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I487dcef390d73ff4a7264ff97d965c9030916840
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9279
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: Ben Walker <benjamin.walker@intel.com>
2021-08-31 08:39:09 +00:00
Shuhei Matsumoto
9a3939bfb7 bdev/nvme: Include hostnqn into ctrlr_opts when calling bdev_nvme_create()
bdev_nvme_create() is called only by a single caller and hostnqn is
just copied to ctrlr_opts even if it is passed separately.

Hence include hostnqn 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: I75b640bcecefa94950b0c19936fab0571c428125
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9332
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-31 08:38:49 +00:00
Shuhei Matsumoto
efbab14933 bdev/nvme: Separate attach_cb between creating ctrlr and setting failover
The NVMe bdev module will have two similar features, multipath and
failover when it supports multipath.

Take a case that we add two different trids with the same name by the
bdev_nvme_attach_controller RPC as an example.

The failover adds secondary trid to an existing nvme_ctrlr. The multipath
feature creates another nvme_ctrlr and adds it to the same nvme_bdev_ctrlr
which has an existing nvme_ctrlr.

We want to use bdev_nvme_attach_controller for both failover and multipath.
To do it cleanly, separate callback to spdk_nvme_connect_async() between
creating ctrlr and setting failover.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id9bc175af6201cdd74e12d4903fc81afe4f91189
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9225
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: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-31 08:38:49 +00:00
Shuhei Matsumoto
f5b8ac0eff bdev/nvme: Pass ext_opts via a parameter to bdev_nvme_readv/writev
We get ext_opts by getting spdk_bdev_io from nvme_bdev_io in
bdev_nvme_readv() or bdev_nvme_writev() now. But this is not aligned
with the current design pattern and not so efficient.

We pass contents of bdev_io via parameters to bdev_nvme_readv() or
bdev_nvme_writev().

Let's follow it about ext_opts.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8a43f31934a36fa2d43800ec8bf17916edfca477
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9292
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
2021-08-31 08:38:49 +00:00
Jim Harris
20490aedf4 nvme: remove unneeded DEBUGLOG in nvme_ctrlr_process_init
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id28080c5eb1e5c9d18aaa7f4da3e41074f45f486
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8606
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-31 08:38:16 +00:00
Konrad Sztyber
681f5e6e8f nvme/tcp: pass async_mode when creating qpairs
This allows for creating admin qpair in an asynchronous mode and I/O
qpairs based on what the user specified in spdk_nvme_io_qpair_opts.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I1801ea76d5a08b1bdc558eb0f18648f59454b654
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9077
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>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
2021-08-31 08:38:16 +00:00
Konrad Sztyber
37c36ec154 nvme: asynchronous admin queue connection
Split the connection process across two states, which allows the
transport to connect the admin queue asynchronously.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ie84477331df0abf5ffdfc2a0ff5d5ada760c9e73
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9076
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>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-31 08:38:16 +00:00
Konrad Sztyber
7d32600e5c nvme/tcp: connect qpairs asynchronously
Polling for qpair connection was moved to `process_completions()` making
`nvme_tcp_ctrlr_connect_qpair()` asynchronous.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I4dec6bc24ed6c3865e58aaf3e0778b2af7bdb4ed
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9075
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
2021-08-31 08:38:16 +00:00
Konrad Sztyber
8280d5f2fc nvme: don't queue fabrics CONNECT command
This allows for submitting IO requests before the CONNECT command is
sent and not stopping the connect process due to the CONNECT being
queued.  It could happen once IO qpair connection is asynchronous.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I04e45b1c2f49f9da3412c843ea899341c56a0420
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8624
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-08-31 08:38:16 +00:00
Konrad Sztyber
17f99bbb46 nvme/tcp: prevent recursive calls to connect_qpair_poll()
This will allow us to call `connect_qpair_poll()` from
`process_completions()`.  Otherwise, `nvme_fabric_qpair_connect_poll()`
which calls `process_completions()` might create a loop, which can cause
issues with `nvme_completion_poll_status` used for tracking the CONNECT
command by the fabrics code.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ibd67bc3e011b238db264394e005b3268624cceef
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8623
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-31 08:38:16 +00:00
Jim Harris
b49fa72b22 nvme/tcp: use new async+poll APIs for fabrics connect
The fabric connect command is now sent without.  It will make it
possible to make `nvme_tcp_ctrlr_connect_qpair()` non-blocking too by
moving the polling to process_completions (this will be done in
subsequent patches).  Additionally, two extra states,
`NVME_TCP_QPAIR_STATE_FABRIC_CONNECT_SEND` and
`NVME_TCP_QPAIR_STATE_FABRIC_CONNECT_POLL`, were added to keep track of
the state of the connect command.  These states are only used by the
initiator code, as the target doesn't need them.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I25c16501e28bb3fbfde416b7c9214f42eb126358
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8605
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-08-31 08:38:16 +00:00
Jim Harris
7e21385f8a nvme: add async+poll APIs for nvme_fabric_qpair_connect
These functions will allow for sending the connect fabric command
asynchronously.

Additionally, this patch changes the return code for
`nvme_fabric_qpair_connect()` when a timeout occurs from -EIO to
-ECANCELED. It gives better description of the error as well as make it
more consistent with `nvme_wait_for_completion*` APIs.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I95806626d3573ebe4b1568157fd57013c4b909a7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8604
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-08-31 08:38:16 +00:00
Jim Harris
b10fbdf58f nvme: store fabrics connect data ptr in status structure
Since the connect will be completed asynchronously, we
need to keep the pointer around so we can access (and
free it!) later when the command completes.

Also change the code to poll on the status using the
new nvme_wait_for_completion_poll(), as prep for upcoming
patches.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I28add8f967fd000afed1e50e491a16ea9da16c22
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8603
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-31 08:38:16 +00:00
Jim Harris
b2bc01cd72 nvme: add nvme_completion_poll_status to spdk_nvme_qpair
This gives us a context that we can poll on when using the
nvme_wait_for_completion framework for async operations.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I5b23f9096eed5ce95848d1995c1ed0b4c74edc92
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8602
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-08-31 08:38:16 +00:00
Mao Jiang
03713cc291 test/nvmf/transport: build nvmf transport ut file
Change-Id: I4a7b6a2b16f6bd5baacee259408b202dd2984cfc
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8783
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-08-30 07:18:10 +00:00
Maciej Wawryk
9d9db2e0e9 markdownlint: enable rule MD038
MD038 - Spaces inside code span elements
Fixed all errors

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I8a776869f7b9580078b4aa8a149ec7017f63878d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9270
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-08-27 18:09:20 +00:00
Maciej Wawryk
f1c6b45774 markdownlint: enable rule MD037
MD037 - Spaces inside emphasis markers
Fixed all errors

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Id5b880f9fc758f1bdd19f0fd8bd3f1dfd0678ecc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9269
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-27 18:09:20 +00:00
Maciej Wawryk
ba58dd940c markdownlint: enable rules MD035, MD036, MD039, MD047
MD035 - Horizontal rule style
MD036 - Emphasis used instead of a header
MD039 - Spaces inside link text
MD047 - File should end with a single newline character

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I92ad6be4bfc5496e29504f052893ccdcb5ade11b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9267
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-08-27 18:09:20 +00:00
Monica Kenguva
e8dd82e5cf nvme: check the pcie qpair state after process completions to return correct value
Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Change-Id: I5a219849523ed8bed795bf9111fa0974261e3ef6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9252
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-27 07:25:28 +00:00
Jim Harris
64eb2cc1de bdev/nvme: account for abort completion with cdw0=1
When an abort command completes successfully,
cdw0 bit 0 may be set to indicate that the controller
was unable to abort the specified cid.  In that case
the bdev nvme abort completion callback needs
to reset the controller.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9320
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-08-27 07:25:20 +00:00
Krzysztof Karas
cda7ddebd7 spdk_top: add clear to the tab area after switch
Adds a window clear for the tab area after switching to another tab.
This is to avoid possible artifacts from previous tab after switching.
Added a column description redraw after the clear.

Fixes #2053

Change-Id: I204410096e5f2401938a36a8f29a09904eca83a8
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9312
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Chengqiang Meng <chengqiangx.meng@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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-08-27 07:25:11 +00:00
Maciej Wawryk
7c2524b8eb markdownlint: enable rule MD032
MD032 - Lists should be surrounded by blank lines
Fixed all errors

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Idd18d38386c0150f5d68068a59717a34d4e1d991
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9142
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-26 19:27:22 +00:00
Maciej Wawryk
b37fd53aef markdownlint: enable rule MD030
MD030 - Spaces after list markers

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I6dd7f88da713f3f010ba84827524420de34dffd7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9141
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-26 19:27:22 +00:00
Maciej Wawryk
7be3e185a9 markdownlint: enable rule MD029
MD029 - Ordered list item prefix
Set style to 'ordered'

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: If2068d88f90fb8324714ea3a2bd8bfa447d9df58
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9140
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-26 19:27:22 +00:00
Maciej Wawryk
de758882f7 markdownlint: enable rule MD028
MD028 - Blank line inside blockquote

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I08211a8fbe82adc72ed6c265e2c8997ff9425860
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9139
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-26 19:27:22 +00:00
Maciej Wawryk
928905199c markdownlint: enable rule MD027
MD027 - Multiple spaces after blockquote symbol

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I14b74e83bd7558384ac50387a708ed639b78ad51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9138
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-26 19:27:22 +00:00
Maciej Wawryk
7239e113a8 markdownlint: enable rule MD026
MD026 - Trailing punctuation in header
Fixed all errors

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I5e73356c7a573f1194f56386ca477d57e56a26f2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9137
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-26 19:27:22 +00:00
wawryk
1e1fd9ac21 markdownlint: enable rule MD025
MD025 - Multiple top level headers in the same document
Fixed all errors
Update check_format.sh to fit new header style in jsonrpc.md

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ib5f832c549880771c99c15b89affe1e82acd3fa4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9045
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@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-08-26 19:27:22 +00:00
Konrad Sztyber
a9704f6c21 ut/nvme: add process to a ctrlr in ANA resize test
This fixes unit test failure caused by 4ac203b2d, which changed the way
asynchronous events are reported to be on a per-process basis.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I150de552bb4be5e184d6eb518abf89f83de106eb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9308
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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-08-26 13:00:31 +00:00
Curt Bruns
4ac203b2de nvme: enable multi-process Async Event Reporting
Modified the async_list to be per-process instead of
on the controller object.  This allows an NVMe multi-
process setup to have Asynchronous Events Reported
to each process that may interested in them.  In the
previous case, where the async event list was on the
controller object, AER (Async Event Requests) would
not be reported to all the processes.

Fixes: #1874

Signed-off-by: Curt Bruns <curt.e.bruns@gmail.com>
Change-Id: I3e885c0cf5a0fd471d243bc7d96a8b7ffe65d14b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8744
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>
2021-08-26 07:37:44 +00:00
Richael Zhuang
3c701ad959 spdk_top: display the info of in_interrupt
Add information of in_interrupt of reactor in spdk_top.

Change-Id: Ie461c2ddfb0e6b13fa37485980d16fb2a2fdf941
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7911
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
2021-08-25 23:25:05 +00:00
Changpeng Liu
9b1372803b nvmf/vfio-user: add one more CQID check when creating SQ
Change-Id: I0099dee4de0f6948b5257e38c440029de3a6dc4e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9172
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: Ben Walker <benjamin.walker@intel.com>
2021-08-25 07:27:10 +00:00
Changpeng Liu
94292a7513 nvmf/vfio-user: define supported IO commands
Reservation commands aren't supported for vfio-user transport,
we should return error in case VM send such commands intentionally.

Also don't use one err variable for multiple functions return values.

Change-Id: Ie0d51ce3c85a1b8ef80c678a3ec9fb6523bab462
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9125
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-25 07:27:10 +00:00
Changpeng Liu
08f25fb993 nvmf/vfio-user: don't set RESERVATION support for vfio-user transport
Only one active socket connection is supported in libvfio-user,
RESERVATION should not be supported in this case.

Change-Id: I36a746f479da767d857425e84dfed5f2bef30b17
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9124
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>
2021-08-25 07:27:10 +00:00
Michael Haeuptle
af72d105ce bdev_nvme: Suppress too frequently called log message
Converted log message to debug that is called too many times
during a hot remove, filling up the log file.

Signed-off-by: Michael Haeuptle <michael.haeuptle@hpe.com>
Change-Id: I08f7ff7c36c6388270878291df8a1e83646e8aee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9258
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-08-25 07:27:01 +00:00
Jim Harris
abb4baef2d bdev/rbd: make destruct path asynchronous
When a bdev is being unregistered, after all
channels have been closed, the bdev layer calls
the module's destruct callback for the bdev before
calling the bdev unregister callback.

For the rbd module, the destruct callback is
bdev_rbd_destruct.  This callback unregisters the
rbd io_device which is an asynchronous operation.
We need to return >0 from bdev_rbd_destruct to
inform the bdev layer that this is an asynchronous
operation, so that it does not immediately call
the bdev unregister callback.  Once the rbd io_device
is unregistered, we can call spdk_bdev_destruct_done()
which will trigger the bdev layer to finally call
the bdev unregister callback.

Without this fix, deleting an rbd bdev would
complete before the backing cluster reference
had been released.  This meant that even
if you had deleted all rbd bdevs, there might still
be cluster references in place for a short period of
time.  It's better to wait to complete the delete
operation until the cluster reference has been
released to avoid this issue (which this patch
now does).

Fixes issue #2069.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8ac156c89d3e235a95ef196308cc349e6078bfd7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9115
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-25 07:26:46 +00:00
Jim Harris
a70aae4610 bdev_rbd: do final clean up on main_td
The bdev layer doesn't call the destruct callback until
all channels have been released, but because the channel
delete callback passes message to the main thread, we can
end up with a complicated race condition.  Currently we
have a deferred_free code path to handle this race, but
we can handle this a bit more cleanly by doing the
construct operation on the main_td as well.

This also simplifies the next patch which will
asynchronously destruct the bdev to fix an RPC bug.

Here's the race:

1) first channel was created on thread A, so disk->main_td = thread A
2) second channel was created on thread B
3) first channel is freed (but disk->main_td is still thread A)
4) spdk_bdev_unregister is called on thread C
5) bdev layer gives callback on thread B to upper layer
6) upper layer on thread B frees channel
7) bdev_rbd_destroy_cb runs on thread B and has to send msg to thread A
   for processing
8) bdev layer calls bdev_rbd_destruct on thread C (since step #4 was on
   thread C)

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I25ede2dc56e24dac0919aed05b9def2560823ee7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9158
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>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-25 07:26:46 +00:00
Alexey Marchuk
e71ae46797 configure: Check if DPDK support mlx5_pci PMD
Since SPDK supports DPDK version older than 21.02
which introduces mlx5_pci PMD, we should check
DPDK version in use before enabling build of DPDK
libraries.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ie86a055bfd079f0b0595649a5d6f60d23e1b1185
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9257
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: Ben Walker <benjamin.walker@intel.com>
2021-08-25 07:26:25 +00:00
Krzysztof Karas
3c5cff613b dpdk: update DPDK to 21.08 version
Update submodule DPDK to version 21.08 and modify
CHANGELOG.

Added bus auxiliary dependencies to dpdkbuild/Makefile
and lib/env_dpdk/env.mk. This dependency was introduced
in DPDK 21.08.

Change-Id: I72d9fde456583dc129f4c7fced4f10875bbc38e2
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9211
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-08-25 07:26:17 +00:00
Mao Jiang
8c51fe8134 test/nvmf/subsystem: case for namespace reservation
Change-Id: I30b5aa57ef8b9df2c162311c628bbd032a925400
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9242
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-08-24 07:19:12 +00:00
Liu Xiaodong
7dcc2507f6 bdev/lvol: asserting lvol ptr before dereference
Klocwork filtered it out that there is a dereference
of pointer 'lvol' before its NULL check.

Change-Id: I83a026e8762d1e004cf1a351585f48fb1e24ae41
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9208
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: GangCao <gang.cao@intel.com>
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-08-24 07:18:54 +00:00
Michal Berger
3220a05311 pkgdep: Make sure gem is installed on FreeBSD prior installing mdl
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I2ce2ce7294eff1c0cd66a5bf101f37d64ee4645d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9165
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-08-24 07:18:44 +00:00
wawryk
11d907c100 markdownlint: enable rule MD023
MD023 - Headers must start at the beginning of the line
Fixed all errors

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ie33dd5885386062253fa02ba4cc92f3cd1dcf7f3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9041
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-23 08:56:13 +00:00
wawryk
78d8ba2888 markdownlint: enable rule MD022
MD022 - Headers should be surrounded by blank lines
Fixed all errors

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I035778a9a1bb32107fb2018aec32a8d01e924dfb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9040
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-23 08:56:13 +00:00
wawryk
29511b3d4f markdownlint: enable rule MD021
MD021 - Multiple spaces inside hashes on closed atx style header

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I27a16ab517ac098b4462187f89cda44fb259da44
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9039
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-23 08:56:13 +00:00
wawryk
68269166e0 markdownlint: enable rule MD020
MD020 - No space inside hashes on closed atx style header

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ic81a24e3e23d77cf2436ebda17c4ac09c4f4e0ea
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9038
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-23 08:56:13 +00:00
wawryk
de3599f079 markdownlint: enable rule MD019
MD019 - Multiple spaces after hash on atx style header

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I3007f757997a3e9c5e22a926cffad2c68d2ca5ce
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9037
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-23 08:56:13 +00:00
wawryk
5e69ab1a8e markdownlint: enable rule MD018
MD018 - No space after hash on atx style header

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ifece1ef5e33093ed34b0d7f75b4cbe3ac37ca37b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9036
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-23 08:56:13 +00:00
wawryk
e0d04147a0 markdownlint: enable rule MD014
MD014 - Dollar signs used before commands without showing output
Fixed all errors

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I75f48c8e2edaf584a553c028e8feb262417b854d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9007
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-23 08:56:13 +00:00
wawryk
7ba660074f markdownlint: enable rule MD012
MD012 - Multiple consecutive blank lines
Fixed all errors

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ie7597b27094345febc0bb01464bacfcb5784a089
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9006
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Ben Walker <benjamin.walker@intel.com>
2021-08-23 08:56:13 +00:00
wawryk
98acc6be1e markdownlint: enable rule MD011
MD011 - Reversed link syntax

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I6d56d690559bc04e3d9c89d0f5bdc759803c38a0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9005
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-08-23 08:56:13 +00:00
Tomasz Bielecki
a248f8c898 nvme: remove spdk_nvme_ctrlr_get_registers declaration and map entry
Cleaning up the API, implementations were removed in 7dbe0e7c.

Signed-off-by: Tomasz Bielecki <tomasz.bielecki@wdc.com>
Change-Id: Iae25bbb301da123f9e784678d4c4f0b8d39f262e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9221
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-23 08:52:34 +00:00
Ziye Yang
0b51da144f nvme/tcp: Fix the C2hdata pdu receving logic.
There may be multiple C2H data pdus recevied.
So we should use the following steps:

1 Use the SPDK_NVME_TCP_C2H_DATA_FLAGS_LAST_PDU
to check whether it is a last pdu or not.
Then we will not cleanup tcp_req, i.e., tcp_req->datao
will not be cleaned.

Then use the SPDK_NVME_TCP_C2H_DATA_FLAGS_SUCCESS
to check whether the controller will use resp pdu
or not.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I9dccf2579aadd18f31361444e25bd4b3b76f06c5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9192
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-08-23 08:51:14 +00:00
Jim Harris
f76f52c057 nvme: remove unnecessary SPDK_NOTICELOG
This was accidentally merged as part of c3a5848.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9251
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-08-23 08:50:38 +00:00
Tomasz Rochumski
c522804126 test_make.sh: make configure respect SPDK_RUN_EXTERNAL_DPDK
Fixes issue #2042.

Signed-off-by: Tomasz Rochumski <tomasz.rochumski@intel.com>
Change-Id: Ied1fcda8cf449ba53b16fb56f3451b566c1fc9d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9202
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-08-23 08:50:18 +00:00
Tomasz Zawadzki
dbdf54f1c9 bdev/lvol: unload empty lvs during fini_start
This patch makes use of async_fini_start flag to
make fini_start asynchronous.

During this time all lvol stores which have no open
lvols are unloaded. This is required, since lvs
holds claim on the underlying bdev.

Fixes #1630

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If443cb087324d08a4a70df71c7afd930ab654f90
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9095
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: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-23 08:49:56 +00:00
Tomasz Zawadzki
511fe15531 lib/bdev: added spdk_bdev_module_fini_done()
Callback for bdev modules is called 'module_fini',
meanwhile after its execution bdev modules were to call
'spdk_bdev_module_finish_done()'.

This function carries incorrect name, so it was deprecated
and replaced with 'spdk_bdev_module_fini_done()'.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9a12dff746ea8b4b1570a3794470f7b24e29003e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9148
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: Changpeng Liu <changpeng.liu@intel.com>
2021-08-23 08:49:56 +00:00
Tomasz Zawadzki
413d25b036 bdev_module: add async fini_start()
fini_start() is called for each bdev module before
iterating over all unclaimed bdevs to unregister them.
This allows bdev modules to behave differently during
each such unregister. Ex. unloading lvol store when
all lvol bdevs on it are unregistered.

Another use of this callback is to unclaim all bdevs
that can be at that point. Especially ones that will
not receive callback due to no bdev registered.
Ex. offline raid bdev, when some underlying bdevs are missing.

fini_start() being synchronous does not help in cases
where to release claim on the bdev, an asynchronous operation
is required. Ex. lvol store with no bdevs present, requires
async lvs unload to be called.

This patch adds async_fini_start flag for the bdev modules,
to be used when async fini_start is required. When done,
bdev module has to call spdk_bdev_module_finish_start_done().

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I63438b325d4cc53fd236bf9ff143abf6bdd81c49
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9094
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-23 08:49:56 +00:00
Tomasz Zawadzki
a215c3ae5f lib/bdev: clarify spdk_bdev_module API
Clarified API in spdk_bdev_module related to init/fini/examine.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ia41f9b13d30736e9175717fb516f228440b0a8a8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9179
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-08-23 08:49:56 +00:00
Konrad Sztyber
c7d1c506ef sock/uring: reorder task cancellations in remove_sock
When removing a socket from a sock_group, the recv_task should be
cancelled last, because it can be sent out while cancelling other tasks
(if POLLERR is received).  Otherwise, we could end up with outstanding
recv requests from a socket removed from a group.

Fixes #2112.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic8e24c210541390dd8bdffe8d3bc4e7dd746d4b7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9239
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@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>
2021-08-23 08:49:01 +00:00
Konrad Sztyber
57d60b9f17 sock/uring: fix build on systems w/o zerocopy support
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I9c856a6390f227393bb0df8a473895e2368d2fbb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9238
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-23 08:49:01 +00:00
Karol Latecki
16e90dbded test/nvme: enable BPF traces for bdevperf performance tests
Enable BPF traces only for bdevperf for now, as it's
easiest to do thanks to "-z" option (wait for RPC before
starting the workload).

Other performance tools will come later - workloads start
immediately and enabling traces will need more thought.

Change-Id: I4a1cab358f4f3fcf1c838ed2dcd06b595c79f3dc
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8687
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-23 08:48:05 +00:00
Karol Latecki
ed5f83391b test/vhost: enable BPF traces in performance tests
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: Id63a0ef523be75def672ef3b4abe270624c28af0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8681
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-08-23 08:48:05 +00:00
Karol Latecki
a182f55b0e test/vhost: don't change directory during vhost_run
There's a directory change along the way which can
interfere with other test scripts. This is most
probably done to create vhost sockets in desired
location. Use "-S" option instead.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I95383def6cd1d1fc6a7760f0f7f468b87cbd8923
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8777
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-08-23 08:48:05 +00:00
Karol Latecki
22f36c0e68 test/vhost: don't save verify state files in shared test
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I7988ccbb3b2426d73a513d559f9ce4040a70d2fc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8830
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
2021-08-23 08:48:05 +00:00
Karol Latecki
5354fc45b0 test/vhost: remove hardcoded JSON config for shared test
Using JSON config with hardcoded path makes this test
susceptible to fail if some directory changes are made
during test. Remove the file and generate fresh config
on each test run.

Change-Id: Id8be920daad71207c06a867a8b6cb4403f1962a8
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8826
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
2021-08-23 08:48:05 +00:00
Karol Latecki
4ce1735929 scripts/nvmf_perf: enable BPF traces
Add option to enable gathering BPF traces while
running the test.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I9ea317a37c3638def40a525eca06f2d8325a74c2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8644
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-23 08:48:05 +00:00
Karol Latecki
348ff890ad scripts/bpftrace.sh: redirect output to file
Allow redirecting output to file. Using simple
"if" for an environment variable, as script arguments
number is variable and using getops seems like an
overkill.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I7e219bb1fd6377bc20c44b76cec3685b32e9316c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8643
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-08-23 08:48:05 +00:00
Jim Harris
ecd46370d9 nvme: add nvme_wait_for_completion_robust_lock_timeout_poll
This is exension to the existing nvme_wait_for_completion* interface
that allows the user to poll for request's completion without blocking.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I6c5b7203883f8e2fa28ceb039ce63aa50631f571
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8601
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-23 08:46:22 +00:00
Jim Harris
20e6c821dc nvme: save timeout_tsc in nvme_completion_poll_status
This is needed to enable using the nvme_completion_poll
machinery in an asynchronous mode.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I8009ab81bcc02cba685f560be3d6540aab7ef3f3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8600
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-08-23 08:46:22 +00:00
Jim Harris
45d63e9882 nvme: enable tcp async qpair connect
This will be done in stages.  This patch adds the
nvme_tcp_ctrlr_connect_qpair_poll function and and makes the icreq step
asynchronous.  Later patches will expand it and make the
nvme_fabric_qpair_connect part asynchronous as well.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ief06f783049723131cc2469b15ad8300d51b6f32
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8599
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-23 08:46:22 +00:00
Jim Harris
1763a126cc test: optimize unit test .gitignore files
Just add a single .gitignore file in test/unit
that covers *_ut.  That allows us to eliminate
100 .gitignore files in the test/unit directory
hierarchy.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9235
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-20 07:29:57 +00:00
Shuhei Matsumoto
801bce0d33 test/thread: Add poller_perf to evaluate cost to run poller
Add a simple tool, poller_perf, to evaluate cost to run non-timed
poller or timed poller by any period, number of pollers.

struct spdk_thread and struct spdk_thread_stats can have the count
of poller runs but we do not have any particular use case for it.
So the poller_perf tool use its global counter for now.

By following similar tools, event_perf and reactor_perf, run
poller_perf once for non-timed poller and once for timed poller.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic5b297bb23d0cd0dc1313e1638ac540ffd5fb8f8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8925
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-08-20 07:29:42 +00:00
Karol Latecki
226a705d83 test/nvmf: reduce number of loops in rpc.sh test
Running create/delete loop 50 times causes the test to
take over 10 minutes and time out in nightly version.

We have various code analyzer tests in place so running
the same script block over 50 times in hope of detecting
memory leak or some similar defect seems a bit redundant.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: Icb2acb0ffbbe63d3004532d0b4a261152891216a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9166
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-20 07:29:25 +00:00
Shuhei Matsumoto
2a67deefc0 nvmf: Add ana_reporting parameter into JSON config dump
We could not restore the setting of ana_reporting because it was not
included in the JSON config dump.

Add the parameter ana_reporting into JSON config dump by adding and
using a new helper function nvmf_subsystem_get_ana_reporting().

Besides, previously the JSON RPC nvmf_subsystem_get_listeners had
ana_state regardless of the value of ana_reporting. We make it
conditional in this patch. The JSON RPC nvmf_subsystem_get_listeners
had not been used in the test code in the repository. Hence this
change will be acceptable.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia4e04600c969c254e0a816d3eb34983ee951091e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9111
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-20 07:29:16 +00:00
Tomasz Zawadzki
d2dd47433b bdev/lvol: remove lvs with lvols during application shutdown
Once bdev finish starts, bdev unregister is called on all
unclaimed bdevs. This means that for lvs with at least one
lvol present, there will be a corresponding bdev unregister.

Yet the vbdev_lvol module does not attempt to unload the lvs,
once last lvol from that lvs is unregistered. Leaving
the base bdev for lvs claimed.

This patch fixes that by using fini_start callback from
bdev_module to mark when shutdown begins. After that
last lvol unregistered on lvs will unload it.

Expanded struct lvol_bdev to contain lvol_store_bdev.
Closing the lvol will free spdk_lvol, so lvol->lvol_store cannot
be accessed.

Changed ut_lvol_destroy UT to ut_bdev_finish. Previous UT didn't
really test vbdev_lvol_destroy, but 'hotremove' of the lvol bdev.
In effect there is no hotremove of the lvol bdevs (only lvs bdev).
spdk_bdev_unregister() can only be called from within vbdev_lvol,
or during bdev module finish.
This UT will now check the bdev module finish.

Note that at this point lvs with no lvols will not trigger
lvs unload. Next patches in series will introduce async fini_start,
to allow for the unload.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8f51e8c1fcfdc55a5d090a3bc84ccefda813aef8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9093
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: Konrad Sztyber <konrad.sztyber@intel.com>
2021-08-20 07:27:58 +00:00
Tomasz Zawadzki
2aeee54686 ut/vbdev_lvol: fix spdk_bdev_unregsiter() path
Instead of calling vbdev_lvol_unregister() hooked up
to the destruct callback, use spdk_bdev_unregister()
directly.

The spdk_bdev_unregister() is always asynchronous
and callbacks are delayed until spdk_bdev_destruct_done().
This is now corrected in the stubs.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I50683c71be80b1baa8bf3b39a05ca631ac527c2e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9155
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>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-08-20 07:27:58 +00:00
Rafal Stefanowski
074a63d507 bdev/ocf: Fix devices block size mismatch
OCF creates vbdev with block size equal in size with a core device.
We need to ensure that cache's bdev block size is not bigger than
core's bdev block size, so there are no IO errors due to IO length
smaller than cache device's block size.
The reason why this is implemented late in the cache start and not
as soon as we want to construct OCF vbdev is that cache or core
device can be added later after OCF vbdev creation and only then
we are certain to have both devices to compare.

Fixes #2088

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Change-Id: I536c783ca71b52f212217c597b7997f2d2e89491
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9229
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-20 07:27:43 +00:00
Jim Harris
15b7d3bacc nvme/pcie: defer bad vtophys to completion context
The pcie layer can't always detect bad addresses
in the request at submission time - for example,
the transport may not have any trackers available
and the request gets queued at the generic
nvme level.

So this means that we might detect vtophys failures
during submission time, or in a process_completions
context - the latter happening when we complete
one request which triggers submitting a new request.

Currently if the vtophys failure happens during
submission context, we return -EFAULT to the
caller *and* call the completion callback.  Nowhere
else in the driver do we do both - the intention
has always been that you get one or the other.

So make all of this consistent by tagging the
tracker and the qpair with a flag if we hit a vtophys
error in the submission path.  Return 0 to the caller,
who will then later get a completion callback for the
bad request when the qpair is next processed for
completions.

I considered a separate TAILQ to hold these 'bad'
trackers, but that would have required duplicating
quite a bit of the tracker completion code for this
one case.  The flag on the pqpair is already in the
hot cacheline, so it's cheap to check it.  We will
only interate the outstanding_tr list when that flag
is set, so this should have zero impact to performance.

Fixes issue #2085.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I60b135fb32d899188e51545b69feb1b27758fd7f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9234
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-20 07:27:09 +00:00
Jim Harris
8be5bd273f nvme: do some packing in spdk_nvme_qpair
This reduces the size of spdk_nvme_qpair by 8 bytes.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If5466d3fc2addecefe4b8227aa534707e1efb7b4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9233
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-20 07:27:09 +00:00
Jim Harris
c9268075ab bdevperf: use uint64_t to save per-job length
When specifying -C for multithread mode, we calculate
a 'blocks_per_job' to tell each core what subset of
the bdev it should target with I/O.  But this
blocks_per_job, and the config->length member that it
gets copied to, were ints.  For devices with num
blocks > INT32_MAX, this can cause overflow if the
num blocks is also < UINT32_MAX (because then we end
up storing a negative value in the bdevperf's length
field).

For sequential workloads, it may take a long time until
it happens, but for random workloads it fails almost
immediately.

Fixes issue #2108.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9231
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Dong Yi <dongx.yi@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-08-20 07:27:09 +00:00
Alexey Marchuk
8b21208129 bdev_nvme: Use new extended API
The new API is used if bdev ext_opts is not NULL.

Change-Id: I414b5d19bff54114d6708efed89ba19b5955f56a
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6271
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: Ziye Yang <ziye.yang@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-08-20 07:26:10 +00:00
Alexey Marchuk
ac6f2bdd8d bdev: Add extended versions of readv/writev
New functions accept extendable structure of IO options

Change-Id: If6864df151a3c0ad722785cb26d1f5d4309cd733
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6269
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: Ziye Yang <ziye.yang@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-08-20 07:26:10 +00:00
Alexey Marchuk
c3a5848966 bdev: Add API to get SPDK memory domains used by bdev
Change-Id: Ic9f42eff59bdc4c8c6e73deb76b3eecfc04f80a8
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6268
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: Ziye Yang <ziye.yang@intel.com>
2021-08-20 07:26:10 +00:00
Alexey Marchuk
110335f192 nvme: Add functions spdk_nvme_ns_cmd_readv/writev_ext
These functions accept extendable structure with IO request options.
The options structure contains a memory domain that can be used to
translate or fetch data, metadata pointer and end-to-end data
protection parameters

Change-Id: I65bfba279904e77539348520c3dfac7aadbe80d9
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6270
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: Ziye Yang <ziye.yang@intel.com>
2021-08-20 07:26:10 +00:00
Alexey Marchuk
a422d8b06f nvme: Add API to get SPDK memory domain per nvme controller
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I6db64c7075b1337b1489b2716fc686a6bed595e3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7239
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-20 07:26:10 +00:00
Alexey Marchuk
d06b6097e3 nvme/rdma: Create memory domain per Protection Domain
Add a global list of memory domains with reference counter.
Memory domains are used by NVME RDMA qpairs.

Also refactor ibv_resize_cq in nvme_rdma_ut.c to stub

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ie58b7e99fcb2c57c967f5dee0417e74845d9e2d1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8127
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-20 07:26:10 +00:00
Alexey Marchuk
4e52791092 dma: Introduce memory domain
Memory domain is used to describe memory which belongs to
another address space (e.g. GPU memory or host memory)
Memory domain can be configured with callbacks to translate
data to another memory domain and to fetch data to
local buffers.

Memory domains will be used in extended
bdev/nvme API added in the following patches.

Change-Id: I0dcc7108a4fbf416a11575aa5cf5d7ec501b3d8b
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8126
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-20 07:26:10 +00:00
Maciej Wawryk
6792ae70f1 scripts/pkgdep: add ruby-devel to INSTALL_DEV_TOOLS
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I367b42a84f3af4ca456ea8c2e1263a05a92bbae7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9145
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: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-08-19 11:24:07 +00:00
Changpeng Liu
e337be4990 libvfio-user: update submodule
This fix issue #2092.

Change-Id: I3192055e2ff9d37b06397e5d7b47a7b7daa0a891
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9207
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-19 07:17:57 +00:00
Konrad Sztyber
5b2e9b229c nvme: move aborted requests to a separate queue before completion
This avoids an infite loop when user sends and then immediately aborts
all requests while the transport cannot submit them (returning -EAGAIN).
It might happen in two cases: 1) if the transport doesn't have any free
requests or 2) if the qpair is still in the NVME_QPAIR_CONNECTING state.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ia1d0b7c93f387524be0ad39597ec49851e1d3af7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8711
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-18 08:13:39 +00:00
Jim Harris
f02e2328ae nvme: save icreq_timeout in tcp qpair
Needed to make this code path asynchronous.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6b18d4e9fc1a29b30c78f7f087b80913d00f9726
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8598
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2021-08-18 08:13:39 +00:00
Konrad Sztyber
3ada37faa3 nvme: use poll_group_process_completions in connect_qpair
If a qpair is part of a poll group and it's not configured in the async
mode, it should be using poll group's process_completions variant.

Additionally, connecting qpairs to the poll group was moved up, so that
qpairs are already on the connected qpairs queue when waiting for the
connection to complete.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I08f75bd61a566d1ab60029b6202d9337df75733f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9074
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
2021-08-18 08:13:39 +00:00
Konrad Sztyber
98b483a35e nvme/rdma: use timeout when destroying qpairs
Replaced poll cycle count with a timeout when destroying a qpair that is
part of a poll group.  Tracking the time instead of a poll count is more
stable, as the number of poll cycles can vary based on the application's
behavior when destroying a qpair.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7445bc1b411f2905aab7bf3dc7b2d3344712e1eb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9200
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-18 08:11:51 +00:00
Tomasz Zawadzki
b556e43e92 bdev/lvol: add lvol_bdev structure on top of spdk_bdev
Added struct lvol_bdev wrapping around spdk_bdev.
This will help with passing around any context.
For this patch only spdk_lvol is still used.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I23f5be5edda526ad607ea8b45274c945a42d90db
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9147
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-08-17 08:54:40 +00:00
Tomasz Zawadzki
08137e52e9 bdev/lvol: consolidate checking for open lvols on lvs
Same iterator was used in two places already, and new one
will be added in next patch.

Replaced _SAFE variant since entries cannot be removed
while iterating in this loop.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5ee911a5b653cfbdf0b4a39d283bd5eee66c49d8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9092
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-17 08:54:40 +00:00
Jim Harris
92e75dfc28 build: remove lib/.gitignore
This isn't required - we already have the whole build/
directory in the top level .gitignore.

When we remove build/lib/.gitignore, it means
build/lib directory must be created somewhere
before we try to place a library there. Top-level
builds get this directory created automatically,
but building directly from a sub-directory's
Makefile means we need to explicitly create
build/lib.  So add a mkdir -p to the LIB_C
macro to do exactly that to cover these cases.

Also simplify 'make clean' at the top level Makefile.
A lot of work went in there to work around this
.gitignore file that's not needed now that we've
fixed the underlying problem by getting rid of
it.

Suggested-by: John Levon <john.levon@nutanix.com>
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ibb92ff84d8c2a9bbe3e193c84f15ef3866f07b1f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9169
Reviewed-by: Nick Connolly <nick.connolly@mayadata.io>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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-08-17 08:54:30 +00:00
Jim Harris
9ef1a55d0a build: don't put out-of-tree ocf build in build/ dir
When we are testing out-of-tree ocf builds, don't
put the resulting binary in the build directory.
An upcoming patch will enable 'make clean' to just
remove the entire build/ directory, which would
then include this ocf.a binary.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I74040fc414a5009faffaeada7fd76842b8cad38e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9170
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-08-17 08:54:30 +00:00
Evgeniy Kochetov
076d14ce4b nvme/ctrlr: Allocate ANA log page only for active namespaces
Number of active namespaces may change. So, on ANA log page update we
should check if buffer has to be resized.

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I1720317ea7f59e5afef73d5c4bd1cd69a7dd6520
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8583
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-08-16 08:48:58 +00:00
Evgeniy Kochetov
a8ee010e13 nvme/ctrlr: Add ANA log page allocation helper function
This will simplify subsequent patches.

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I2fc78c8bfec7270d6036f2c9ea9e0cf715fc9c7d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9178
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-08-16 08:48:58 +00:00
Evgeniy Kochetov
49e433f8ed nvme/ctrlr: Allocate non-DMA memory for ANA log page
Log page reading function 'spdk_nvme_ctrlr_cmd_get_log_page' does read
into intermediate buffer and then copy to user provided buffer. So,
there is no need for user buffer to allow DMA.

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I7337afa99c3ae666cc43ea2a48317de875334cfc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9177
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-08-16 08:48:58 +00:00
Ziye Yang
c260537919 accel_perf: check accel engine usage in accel_perf_start function.
In accel_done function, we use g_using_sw_engine to
determine to directly call _accel_done or use thread message
passing way.

However when we get the capability and determine the
value of g_using_sw_engine in mulitple cases. We do not
protect the value of g_num_workers. Then if we use CPU mode
to do test, g_using_sw_engine will not set to be false
in racing condition. Since the value of g_num_workers can be
> 1 when we do the check, i.e., it is a TOC2TOU issue.

The solution is that we check the g_using_sw_engine in
accel_perf_start function.

Fixes issue #2084

Change-Id: I55c18e0443120adb698d5bd27d4522df09f6dcab
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9151
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: Ben Walker <benjamin.walker@intel.com>
2021-08-16 08:48:43 +00:00
Alexey Marchuk
6479ddb358 compress: Add RPC option to enable mlx5_pci PMD
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I31efa2f9dd1aafdb87904083e56d693a699af526
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8781
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-16 08:48:31 +00:00
Alexey Marchuk
e269bf4e84 mk: Enable build of mlx5_pci compress PMD
This PMD is availabe for BlueField2 DPU.
It requires libmlx5, so configure file is
updated to check if this library exists

Change-Id: Ic0cfbfdf24af393381667435009fb6afc49d9181
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8780
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-16 08:48:31 +00:00
Konrad Sztyber
5263f0a12f nvme: extract qpair connect fail to a seprate function
In the next patch, the qpair is polled from a poll group and needs a
disconnect callback, which should also fail the qpair, so it makes sense
to have a separate function doing that.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ied76431520962b25220027be829a4609afb6bbda
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9157
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-13 07:27:07 +00:00
Monica Kenguva
771f65bb1f nvme: asynchronous create io qpair
async_mode option is currently supported in PCIe transport layer
to create io qpair asynchronously. User polls the io_qpair for
completions, after create cq and sq completes in order, pqpair
is set to READY state. I/O submitted before the qpair is ready
is queued internally. Currently other transports only support
synchronous io qpair creation.

Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ib2f9043872bd5602274e2508cf1fe9ff4211cabb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8911
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-13 07:27:07 +00:00
Tomasz Zawadzki
a7b15178c2 lib/event: do not set interrupt mode when eventfd is not supported
spdk_reactor_set_interrupt_mode() writes/reads from fds created during
reactor_interrupt_init(). Since spdk_fd_group_create() depends
on eventfd, this will not work for systems that do not have it.

reactor_interrupt_init() handled lack of support for eventfd correctly,
while spdk_reactor_set_interrupt_mode() did not check for it.

Reported-by: Nick Connolly <nick.connolly@mayadata.io>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5181d436636c55cca3a06b1947e944502a9204ce
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9131
Reviewed-by: Nick Connolly <nick.connolly@mayadata.io>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@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-08-13 07:21:33 +00:00
Michal Berger
4f99de088e test/nvmf: Wait for net devices after they are moved from extra netns
Fixes #2072

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Iab6f1109cb4f3b31b3df62bb9ba678336c8b2502
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9168
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-13 07:20:50 +00:00
ChengqiangMeng
a2838de9dc unittest/nvmf_tcp: Test for nvmf_tcp_icreq_handle
Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: I068c7917a567e588d0f35e525eb58ed3aaf17fcb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8936
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-08-13 07:15:45 +00:00
Ziye Yang
fc9a264595 uring: Not enable zero copy if fd is opened on a loopback device.
In order to not affect the loopback test.

Also create a sock_common.c file which can be used by posix/uring
implementation. We do not put such code in sock.c. Because sock.c
is the general layer. Other users may include their own user space
sock impelmentations. So put those common code in sock_common.c instead.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I983ec2313119539e6eed2d9f11ba1488c0ed6560
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8769
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>
2021-08-13 07:14:38 +00:00
Ziye Yang
34ab803d30 sock/uring: Add the MSG zero copy feature
This patch tries to add MSG zero copy feature.
Though io_uring supports buffer registration, it only
support io_uring_prep_write_fixed. It means only one
registered buffer can be used. It does not satisfy our
current usage mode.

According to this situation, we still use the MSG_ZEROCOPY
flags in io_uring_prep_sendmsg.

Furthermore, this new feature is dependent on the kernel
version, The currently verified version is
kernel 5.12 rc3. So it is not enabled in the default manner.

For example, if you want to use it on the target side, you can
use the following rpc to configure:

./scripts/rpc.py sock_impl_set_options -i uring --enable-zerocopy-send-server

Change-Id: Ie7bb828f466362add94891989ddf0950dccd9e80
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/957
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>
2021-08-13 07:14:38 +00:00
Changpeng Liu
beb6ffd2f7 nvme: add ONCS definition
It's already defined in spdk_nvme_ctrlr_data, just move it out
so that other library can use this definition.

Change-Id: Ic40ba6f6e7870395ad3cec9511ce841f5dc4dff1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9123
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-13 01:25:07 +00:00
Changpeng Liu
1afe4de585 nvmf/vfio-user: refactor map_admin_cmd_req()
PRP1 value 0 is a valid Guest physical address and it may use two vectors
for one page, so we need to set `iovcnt` as the IO commands.  Also
fix the calculation for Get Log Page command.

Change-Id: Ib036bcf1ca9f6644dfd8a7406fea37269cea5c73
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9122
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
0ac315f047 nvmf/vfio-user: inline ctrlr_interrupt_enabled()
This function is called in the IO processing context, also
rename vfio-user controller data structure with "vu_" prefix.

Change-Id: Icb8fd18772f64c1e633f4a8b8eac26d0bafeed16
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9121
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>
2021-08-13 01:25:07 +00:00
Changpeng Liu
2746d51aa7 nvmf/vfio-user: inline io_q_id()
This function is called in the IO processing context, also rename
internal queue pair variable with "vu_" prefix.

Change-Id: Iac6be1fddf9ee28e0485ff0c3a707de4e98be96a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9120
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>
2021-08-13 01:25:07 +00:00
Changpeng Liu
40c447f843 nvmf/vfio-user: remove duplicated one line
The submission queue doorbell will be cleared to 0 at the end
of this function.

Change-Id: I0146f3dc208b8ca1d7fec4b2dae1d7395f304444
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8992
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
42abbac90e nvmf/vfio-user: eliminate cq_next function
There is only one place to call it now, so just remove it.

Change-Id: Ib16d640c80dbe79df46c965c5ee8bcd092e57b0d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9013
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
2f85499e43 nvmf/vfio-user: don't use Guest's phase bit for completion response
We should maintain phase bit in vfio-user target, it's not safe
to use Guest completion queue's phase bit.

Change-Id: I94856853784802f7695a0484b783d8de4042f8a6
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8988
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
a93387f69f nvmf/vfio-user: remap admin queue during the memory hotplug if necessary
It's wrong to call enable_admin_queue() in the memory hotplug context,
as the function will change doorbells and clear queue pair memory.

We can remap the ADMIN queue pair's memory just same as IO queue pairs.

Change-Id: I090ea40ce0f0613c15319bfb18771a154ca788c7
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8987
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
e9fd737a8e nvmf/vfio-user: add map_q function
The map_q function is used to map Guest's physical memory address
to Host virtual address for SQ/CQ.  This function can be used both
for initializing SQ/CQ and remap SQ/CQ, when used for remap SQ/CQ,
we don't need to unmap the related memory region.

Change-Id: Ia42e01a68482e5678dbaf8d0d4e8c04c1a94789d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9012
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: Ben Walker <benjamin.walker@intel.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-08-13 01:25:07 +00:00
Changpeng Liu
7d136a2088 nvmf: use INFOLOG for unsupported commands
Fix #2004.

Change-Id: I60899de4d369f50f159e6bbe1ba9eb546f367d87
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9035
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: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-12 12:57:50 +00:00
Changpeng Liu
a784122709 nvmf/vfio-user: use correct syslog level
vsnprintf() is called in the IO processing path if we set LOG_DEBUG
by default, which will impact the performance numbers. See below
perf record:

13.44%  reactor_0  [kernel.kallsyms]   [k] do_syscall_64
 7.59%  reactor_0  [kernel.kallsyms]   [k] syscall_return_via_sysret
 7.18%  reactor_0  libc-2.29.so        [.] __vfprintf_internal
 5.60%  reactor_0  [kernel.kallsyms]   [k] entry_SYSCALL_64
 4.74%  reactor_0  [kernel.kallsyms]   [k] vmx_deliver_posted_interrupt
 4.36%  reactor_0  nvmf_tgt            [.] post_completion

Change-Id: Icc12345c341d870375a1db729412acb7b3cd0211
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9079
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: John Levon <levon@movementarian.org>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-12 12:57:39 +00:00
Changpeng Liu
01936d2ed8 log: add an API to return syslog level based on SPDK's log level
Change-Id: I970119385989e7d97bda065f5aa2bbd82519c655
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9103
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-12 12:57:39 +00:00
Konrad Sztyber
aa51757648 bdev/zone_block: check for unmap support in zone reset
Sending the unmap in zone reset is optional (it's only a hint), so if
the base bdev doesn't support it, the reset is completed immediately.

Fixes #2064.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: If2c57eadc20d352a71853d7023599503330e1252
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9154
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-08-12 12:57:24 +00:00
paul luse
7abf75c2b5 lib/idxd: pre translate the completion address for batch entries
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I9df51acc2bbd3deffcb172c0fd3e7012ec3d4b3b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9100
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: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-12 12:57:07 +00:00
paul luse
d09b5674a4 lib/idxd: reduce size of per channel batch pool
Was set at a pretty high number during early development.
Instead of a #define, lets use the same math we use to
determine the size of the operation and descriptor pools as
that's the max number of batches that will be needed.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ide5311b4b6c931010413d0f82baed0e05d5fcde7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9099
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: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-12 12:57:07 +00:00
paul luse
31e3ed5ccb lib/idxd: fix leak of DSA operation for non batched commands
When address translation failed we were not putting the op back
into the pool.  In one place also changed the return error from
translation from hardcoded value to the rc returned by the call
to be consistent with the rest of the code.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I6d0c9c0f469a213721c6a5ce37c4e9dbdcef8183
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9097
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-12 12:57:07 +00:00
paul luse
d30e459e8d lib/idxd: pre translate completion record addresses
These are fixed, no reason to tranlate them with every IO.  This
patch is just for non-batched IO.  Batched IO will come later.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ifb7bdf147658a23714d94bb7f88d7fedd1749153
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9073
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: Ben Walker <benjamin.walker@intel.com>
2021-08-12 12:57:07 +00:00
Michal Berger
0e2b281be7 test/setup: Ignore atari partition table
It seems some versions of blkid report improper atari as an installed
partition table on devices filled with random data. Ignore that case
for now so the tests are able to find usuable nvme device.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: If6604ddf7099d3a98cfa36caab1e806d5f931886
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9143
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-08-12 12:56:59 +00:00
Jim Harris
a595959da0 test/nvme/abort: ensure admin queue is sized appropriately
This abort test app will send a lot of abort commands on
the admin queue.  The default admin queue size is
relatively small (32) so increase it if necessary to
account for the expected number of outstanding abort
commands as well as any extra admin commands that may
be sent during test execution such as Keep Alive.

Fixes issue #2048.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5f64b7fc72a028299b860f09e30d430a64c95d2a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8812
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-08-11 06:51:13 +00:00
Jim Harris
690783a3ae env_dpdk: tokenize env_context
DPDK requires each command line parameter to be
passed as a separate string in the args array.  So
we need to tokenize opts.env_context to handle the
case where a user passes multiple arguments in the
env_context string.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ifc72a7c25b31f1296d3aba3a3f7664ad8edf128f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9132
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-10 08:19:52 +00:00
Rui Chang
33acbe9caf spdk_top: fix vhost poller name issue
When run spdk_top against vhost, the poller name is displayed as
"bvdev->bdev ? vdev_worker : no_bdev_vdev_worker" which should be "vdev_worker".

Signed-off-by: Rui Chang <rui.chang@arm.com>
Change-Id: Ie97c69bd8cdd3fdafc5fe4dd80e1fde85a8e3238
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9130
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-10 08:19:33 +00:00
Tomasz Zawadzki
d10802cef9 build: remove types suppressed from abidiff during 21.07
Types suppressed during 21.07 release cycle can now be
removed.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I80f95b57fd9ae07367248a91071802b48aff4866
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9128
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-10 08:19:10 +00:00
Tomasz Zawadzki
47e952a0c8 vm_setup: add vfio-user to refspdk
refspdk is reference SPDK repository used for base in ABI tests.
When component is not present in the refspdk, but was added
in latest SPDK it is skipped in ABI tests.

Yet if the previous SPDK release contains such component already,
the ABI for it should be verified.

vfio-user flag was missing so this patch adds it.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1e2c11c506deed06416aef7c0aab41d99834f92b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9127
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-10 08:19:10 +00:00
Felipe Franciosi
3afba66ca5 perf: Fix help message on --io-pattern usage
The --io-pattern option can be specified by the -w short opt. However,
the help message suggested that -o should be used. This fixes it.

Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
Change-Id: I023d571fc3b165653257688fdbd7b1eeafd420e4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9116
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-10 08:18:47 +00:00
Michal Berger
29907b7240 test/common: Be verbose in waitforserial()
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I9c01e786c4d9df1b5a0f61b0ab354a3fd2546672
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9085
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-08-10 08:18:13 +00:00
Karol Latecki
f60b99b168 scripts/gen_nvme.sh: remove unnecessary wrapper function
create_json_config_with_subsystems contents does not
need to be in a function. Moving it to main simplifies
--with-subsystems condition.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I1414a209cc666ebb4639fc25133168482bd96c97
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8775
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-10 08:14:30 +00:00
Karol Latecki
65b3c34b14 scripts/gen_nvme.sh: make bdfs var local to a function
No need to keep "bdfs" variable as global variable.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I655ed9f1514f13a6460292c1298ef08f904157fa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8774
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Pawel Piatek <pawelx.piatek@intel.com>
2021-08-10 08:14:30 +00:00
Karol Latecki
61f3c72cd2 scripts/gen_nvme.sh: introduce getopts for handling options
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I21b7798e1004b227bcd7f62ee8867667c67dab7c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8773
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-10 08:14:30 +00:00
Maciej Wawryk
83440f1ded scripts/pkgdep: move markdownlint install to pkgdep scripts
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: If2cc3cf797602f90b26407d35f64840bb2d2697c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9108
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
2021-08-10 08:13:00 +00:00
wawryk
2f5c602574 markdownlint: add -g option to check_format and fix mdl errors
-g option using only files known to git, that allow us
to avoid errors from submodules

Also add check if mdl is installed, and gracefull info if not.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ib6e1920774ffca81e62d9abebc8d8b4548feb519
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9086
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-10 08:13:00 +00:00
wawryk
24bfe0dd27 test/config: move ruby-dev installation to distro package manager
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I3b740d9f28285824e9d42cb83857794b0a9f9374
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9088
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
2021-08-10 08:13:00 +00:00
wawryk
bb2d698755 test/config: fix wrong if statement in markdownlint install function
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I77e3cb58590c2148fa577ebf5765f61ca4d87e05
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9087
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
2021-08-10 08:13:00 +00:00
Richael Zhuang
e258fe53a1 lib/event: add in_interrupt in rpc
add in_interrupt in framework_get_reactors.

Change-Id: I7137aa604129cfd26acd2dec4ae9ca545c7e4348
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8552
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-08-09 08:40:25 +00:00
yupeng
304153e5c7 blobstore: calculate correct num_md_clusters in bs_recover
The current num_md_clusters doesn't include the the part before
md_start. So the bs_recover will get more num_free_clusters than it
should be. This patch can fix it.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: I911926beb69aca677da508ba71f292496c917e7f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9034
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-08-09 08:39:42 +00:00
Monica Kenguva
455a5d7821 nvme/pcie: Create queue pairs asynchronously
The generic transport layer still does a busy wait, but at least
the logic in the PCIe transport now creates the queue pair
asynchronously.

Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Change-Id: I9669ccb81a90ee0a36d3f5512bc49c503923b293
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8910
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-09 08:39:28 +00:00
paul luse
f93f3ee3f9 lib/idxd: move _vtophys() up
In prep for upcoming patch

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Iebc5bf5f6715c85cc09b404128338cd6f08c421e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9072
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-08-06 07:33:06 +00:00
paul luse
f3b423dc84 lib/idxd: remove batch_op element from op struct
We can instead use a combination of the op code and the batch
element in the op structure to determine if the op that is
completing is part of a batch or not so we know whether to
return it to the free list or not.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I8e27c7b991f5a20e82394a25a52ece560cab5543
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9071
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-08-06 07:33:06 +00:00
paul luse
bc393d841c lib/idxd: translate the completion address for batched commands
Was simply missing.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I111ad42977f75b8df89a7d63bba6936c5861f657
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9070
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-06 07:33:06 +00:00
paul luse
5bfcd5b329 lib/idxd: wait to add operation to outstanding list until hw submit
No real material impact but easier to read and cleans up error
handling when submitting a batch. Before we put the operation on
the list of operations to poll when it was prepared, a few LOC
before it was submitted to HW.  Now we do it in the hw submission
function. For batch elements, they are added just before the
batch operation itself (as was before).

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Icfeaeeb650d5b63f81e13a8ffd27e349c7118089
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9069
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-06 07:33:06 +00:00
paul luse
e5a19b3ea2 lib/idxd: replace bit arrays with lists
The bit arrays were used for dynamic flow control in a previous
implementation.  They are no longer needed as flow control is
now static and managed solely in the idxd plug in module. Use
simple lists of descriptors and completion records instead.

This is a simpler implementation and will allow for some future
clean up of structures as well.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I8c4cce12e88ac5416e3fe29a416487759214ec9f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8922
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-06 07:33:06 +00:00
Changpeng Liu
a8ca2e74f9 nvmf/vfio-user: rename map/unmap_admin_queue function
Actually we should not re-enable the ADMIN queue during
the memory region callback, similar with the IO queues,
we should just do the remap, but to avoid changing other
values such as doorbells.

This is a preparation patch just to rename it, and will fix
the issue in coming patchs.

Change-Id: Ic19654e944e4c58ce0fac9582c6bb187110fe571
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8986
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-08-06 07:31:57 +00:00
Changpeng Liu
28a95bdaa7 nvmf/vfio-user: inline SQ/CQ operation function
Change-Id: I97d085d7ffcb01e4dae0bc6b686bffc129132aca
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8985
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-08-06 07:31:57 +00:00
Changpeng Liu
77522c0a67 nvmf/vfio-user: fill SQID field when posting completion response
This field is required for Multiple SQs share one Completion queue.
Windows requires SQID field even not for the shared Completion
queue case, so we need to fill it.

Fix issue #2009

Change-Id: Ifb2f20196baeaf9b982154f0480f360bc97a8c2d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8971
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-06 07:31:57 +00:00
Rui Chang
d483d8a4f1 lib/util: optimize base64 encode and decode using ARM SVE intrinsics
Optimize base64 encode and decode using ARM SVE intrinsics.

Signed-off-by: Rui Chang <rui.chang@arm.com>
Change-Id: I63ae5b9105aef690e1fad8ec1ef98c8339758e9f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8858
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-06 07:31:06 +00:00
John Levon
849f05c9df nvmf/vfio-user: create queues directly
Currently, queue creation is delegated to nvmf_vfio_user_accept() for both I/O
and admin queues, by adding it to a ->new_qps list. But there's no good reason
for this indirection to exist, and it would make interrupt support for the
accept poller harder to implement. Instead, directly call
spdk_nvmf_tgt_new_qpair().

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I182bfac9c621eda2f746201db7022ab6fce1bf30
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9053
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-08-05 07:43:11 +00:00
Evgeniy Kochetov
785246f91d ut/nvmf: Fix uninitialized request structure
Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I5365c4d5aba1f91e97eb114a6647eb75eef2e55e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9066
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-05 07:43:04 +00:00
Michal Berger
6f5b95089a test/vhost: Don't decompress vhost image each time vhosttestinit() is called
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I699227517cc44fdb99380ff76b581e9840133023
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8674
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-08-05 07:42:53 +00:00
Michal Berger
117e555d9d autotest: Use $HOME as a base for the $DEPENDENCY_DIR
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I8f21f6f9a1cf837931646a7458f0ad8147cf6810
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8646
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-08-05 07:42:53 +00:00
wawryk
c95914ba1c markdownlint: enable rule MD009
MD009 - Trailing spaces

Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: I85860c0a754c87ad9693b111c991b4f9d6408f1a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8999
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-05 07:42:35 +00:00
wawryk
fb9b29e732 markdownlint: enable rule MD007
MD007 - Unordered list indentation
Fixed all errors

Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: I051556bbd6bdaa94cec21bb072316bc693aea2ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8998
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 <spdk-ci.pdl@broadcom.com>
2021-08-05 07:42:35 +00:00
wawryk
e96beb9374 markdownlint: enable rule MD006
MD006 - Consider starting bulleted lists at the beginning of the line
Fixed all errors

Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: Id9a50447160ca14c3fd3117957ba2263cdb00471
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8997
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-05 07:42:35 +00:00
wawryk
1df1583be5 markdownlint: enable rule MD005
MD005 - Inconsistent indentation for list items at the same level
Fixed all MD005 errors

Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: If6a12d6dab938094394a72c804f2a028f1c40f45
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8995
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-05 07:42:35 +00:00
wawryk
e5b5eabe82 markdownlint: enable rule MD002
MD002 - First header should be a top level header
Fixed all MD002 errors

Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: Id0cb693c18f3e26556949ba2220db7b25e9edbe1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8940
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-05 07:42:35 +00:00
wawryk
3f944e495a markdownlint: enable rule MD001
MD001 - Header levels should only increment by one level at a time
Fixed all MD001 errors

Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: I6c0d711b30246e8a9d00bc991edbf34c3cf68805
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8939
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-05 07:42:35 +00:00
wawryk
12fcbc9b94 markdownlint: enable rule MD013 - line_length
Fixed all MD013 errors

Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: I24846414ae6283e27a17caced16ac798a7e93018
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8938
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-05 07:42:35 +00:00
wawryk
e4d23dc757 scripts: add markdownlint to check_format
Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: I0f5a351fcdbf417a18e388432088c8bea6f12143
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8883
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-05 07:42:35 +00:00
wawryk
970e369fcf add Markdown lint tool rules file
Initially exclude all rules from list: https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md
Rules will be enebled step by step with md files fixes

Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: Ibb31bb3b6b9062dd450c613a18e93974aa87b560
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8820
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-05 07:42:35 +00:00
wawryk
554542d9b1 test/config: add markdownlint install option
Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: Ia5b3fadad31333bdaaaa996812b852742885603a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8819
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-08-05 07:42:28 +00:00
Michal Berger
637d9e6069 scripts/setup: Try to cleanup any lingering spdk_pci_lock files
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I853e278756e53e40d7faf5eb8392057653ca649f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9065
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-08-04 14:11:28 +00:00
Michal Berger
8bb27faff6 test/common: Always wait min 2s in waitforserial()
It seems like there's some race in the kernel when we try to
delete_controller (nvme disconnect) right after the new nvme subsystem
is connected. This results in a block subsystem left with lingering
nvme devices which are not usable and which start to affect the nvmf
suite. They also can't be removed either unless the kernel is rebooted.

To workaround it make sure that we wait long enough for all of the
subsystems to be in a sane state before we attempt to stress
the connect<->disconnect path.

Mitigates #2060.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I9299ecfc760e334504730aab6f19d338fad88081
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9059
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-04 14:11:28 +00:00
Michal Berger
e1946cd799 test/common: Add SERIAL to the last check in waitforserial_disconnect()
The argument is meant to be SERIAL so the last check may erroneously
force waitforserial_disconnect() to report success if lsblk is not told
to include serial of the device in the output.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Iee591597140658b1e611a84e65b280c565eecdfc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9057
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-04 14:11:28 +00:00
Ziye Yang
6434aaa274 scripts/pkgdep: Add the libpmem object library dependency.
Since we will create new bdev relied on libpmem object
library, so need add it.

Change-Id: I7ddcc694fd2ec5a0536abc9813b13fa429fcf068
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9049
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-04 11:05:30 +00:00
Jim Harris
d1e67b8b1b bdev/nvme: add fabrics timeout to attach_controller RPC
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I42f6729475fd767087fb0a0c6e30d409672c3b99
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8597
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>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2021-08-02 09:05:41 +00:00
John Levon
efd928e959 nvmf/vfio-user: fix comment for map_io_cmd_req()
The comment no longer reflected the code.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I5903e9483f01dd9b7a61c8f725eba4c38e1b8459
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9008
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-02 09:05:34 +00:00
Jim Harris
24a8c04af0 nvmf: zero data buffer before building identify ns list
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I772823ae4a57d988ed186c3fba91871580e95d5a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8984
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-02 09:05:18 +00:00
Jacek Kalwas
4cbe49baf9 build: fix missing dependency for env_dpdk
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I414a7bdb63990df6ae411b8b03f055b9ffecd41f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9009
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-02 09:04:58 +00:00
Ziye Yang
bc33302ac0 bdev/aio: Remove the unused link entry in bdev_aio_task
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I13e745b23c7fe0a5376234ead8c068c72de64a53
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9011
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-02 09:04:46 +00:00
Tomasz Zawadzki
7aed75fbc2 test/nvme_cuse: start nvme_cuse ctrlr in test_nvme_cuse_stop()
Patch below broke the UT due to not accouting for changes
in nvme_cuse since original submission:
(19f0bfd) test/nvme_cuse: cases for stop cuse

The change was introduced with:
(d651f8a) nvme/nvme_cuse: Fix race condition in cuse session
Now when initalizing nvme_cuse controller it uses is_started,
to avoid race condition.

The UT was missing this part of nvme_cuse controller initalization.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I46344977204c3383d8f400c80bc7df50e6d7581d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9001
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-30 11:22:20 +00:00
Changpeng Liu
80b3b68841 nvmf/vfio-user: don't pass the original NVMe command pointer to post_completion()
Only the CID is required when posting a completion response to the
completion queue.

Change-Id: I6a009386994d19a2fa05a0f5ed8c3237263644f3
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8970
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: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-30 08:23:45 +00:00
Changpeng Liu
4216f7fff5 nvmf/vfio-user: fix shared CQ usage case
Multiple IO Submission Queue can share one Completion Queue, and
we use field 'cqid' to save it in Submission Queue, so when posting
completion response, we need to get the Submission Queue's CQID first,
then post the completion queue based on CQID.

Also rename vfio-user internal variables with 'vu_' prefix in this
function.

Change-Id: Ib73b91a86740d105b5fb5c73127484ebfb6b55ef
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8969
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: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-30 08:23:45 +00:00
Changpeng Liu
5c1f77f590 nvmf/vfio-user: optimize create_io_q function with a stack qid variable
No actual logic change for this patch.

Change-Id: I486e889499ee2e4bdf05d1f633ded1712333fa88
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8968
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: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-30 08:23:45 +00:00
Ziye Yang
208b7016b3 accel_engine: Fix the crc destnation address
This issue is introduced by the refactoring, i.e.,
changed from dst to crc_dst. And this code
part is missed.

This patch can fix this issue.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Iad03d08707167c957193f6101eb9166a30e5cdd3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8935
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-30 08:22:48 +00:00
Jim Harris
d9cea939a9 rpc/nvmf: fix typo
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8bb9afd1f3e364105ea1c50d665183b949202d2a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8982
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-30 08:22:34 +00:00
Mao Jiang
476a77f95d test/nvmf/tcp: cases for sending capsule response pdu
Change-Id: I6bf446e78c09b0c3a1b3191cf19d19c44ab9ffbb
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8833
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-07-30 08:21:56 +00:00
Liu Xiaodong
a03ded655e test/intr: correct without-thread situation
Change-Id: I31eef70855f9968371e1f9f5ef278de66a83d552
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8887
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.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-07-30 08:21:43 +00:00
Liu Xiaodong
7ff8688ceb thread: print notice on changing intr mode
Change-Id: I79fcef41adf672d2e9dc34a579a1882f8e964bd7
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8890
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: <dongx.yi@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-07-30 08:21:43 +00:00
Michal Berger
093d01421d test/ftl: Remove dead code
In particular, non-volatile cache setup and EXTENDED fio tests:
these haven't been supported nor tested by the CI, thus there's
no value in keeping these routines anymore.

fio tests are limited to what was previously called as a "basic"
suite and hooked to standard SPDK_TEST_FTL flow.

Code which is not used by the remaining tests is removed as well.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I865da1ea4d8743322d4c303908c598efe6ecd40b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8294
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-07-30 08:21:32 +00:00
John Levon
1d4a88104d vfio-user: correct return code for library context poller
Currently, the poller that calls vfu_run_ctx() always returns SPDK_POLLER_BUSY.
Update libvfio-user and adjust the API usage so that it can accurately
report SPDK_POLLER_IDLE when needed.

Additionally, renaming the poller to better reflect its meaning: it's not just
for mmio handlers, but libvfio-user handling in general.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I5e598241ac0a692f03ee36242ff977c4e6f14987
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8568
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-30 08:20:49 +00:00
John Levon
923bab5f12 vfio-user: correct accept poller return code
Return the number of events handled as expected by the poller.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I70c4d32bf091b2c1a293eaa41f00869a3a7303f2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8563
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-30 08:20:49 +00:00
John Levon
f1c8170632 vfio-user: correct poller return value
The transport poller is supposed to return the number of events handled to the
generic nvmf code; correct the vfio-user implementation so it does that.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I804e1e8c75701c0b22ea6afd350b455c39908511
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8562
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-07-30 08:20:49 +00:00
John Levon
6ec5e75ae4 nvmf: fix keep alive poller
Return SPDK_POLLER_IDLE if we didn't disable any controllers.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Ie16301c6e5f3f7e3f4b46906a95ef214674f4af8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8560
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-30 08:20:49 +00:00
Mao Jiang
d6e0bbee39 test/nvmf/ctrlr_bdev: cases for ctrlr cmd
Change-Id: Idcadca62542c24c205e295e48a763a6d50e2abc7
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8564
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-30 08:20:09 +00:00
Mao Jiang
2ddc2b3c99 test/nvmf: build nvmf unittest file
Change-Id: I45d4efe1c6a9ea7e79deb3f937a9ff4817a97ce8
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8696
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: Jim Harris <james.r.harris@intel.com>
2021-07-30 08:19:35 +00:00
Mao Jiang
b942f8f56f test/nvmf/subsystem: cases for adding host subsystem
Change-Id: I5a31c5abb9257ce9315a9b15d3434a7687be0070
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8725
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: Changpeng Liu <changpeng.liu@intel.com>
2021-07-30 08:19:13 +00:00
Mao Jiang
19f0bfd6b6 test/nvme_cuse: cases for stop cuse
Change-Id: I871a868080078a516c4465629b040772daf1683c
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8168
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-07-30 08:18:18 +00:00
Mao Jiang
4d2048bb75 test/nvme_pcie_common: cases for constructing qpairs
Change-Id: Icb467146daf516d1470ee8537bf7f7d5f28897ef
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8215
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
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-07-30 08:18:05 +00:00
Mao Jiang
8b7d297f61 test/nvme_opal: cases for adding token bytestring
Change-Id: I38db2779bbf1495bc8fcfb55d5f1afb666d541b6
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8287
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-30 08:17:52 +00:00
Krzysztof Karas
f30f862a60 json/json.h: add note on JSON objects and arrays
Adds a note for JSON objects and arrays inside struct spdk_json_val.

Additionally deletes double space in section about len field.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I5d52b37a7e8023df09e16cbf9805bd6775abc5c8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8529
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-30 08:17:43 +00:00
Changpeng Liu
09c0c9764a nvmf: return feature not changeable for Interrupt Coalescing feature
Windows will always sends a Set Feature Interrupt Coalescing even
SPDK reports we can't support it in Get Feature command.  Here
we return Feature Not Changeable instead of Invalid Field which
is more meaningful.

Change-Id: Ie08086c3eba1e2d790a7ae4976653b6f9085028c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8923
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-07-29 07:04:27 +00:00
Michal Berger
a6e95347b2 iscsi_tgt/rpc_config: Give some extra time for the process to die
Fixes #2039

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I1775c62a780559e504cfd24e7ec988cefd836d87
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8957
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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-07-29 07:03:01 +00:00
Karol Latecki
84867c8eaf scripts: remove gdb from Python requirements file
This package is no longer available in PyPI.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I3e68b03eabeb4aff14453c90846fd03452c93ae2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8956
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2021-07-28 16:19:35 +00:00
Yuri
38a30da5bd nvmf: accepts new parameter to set poll groups mask
Parses and verifies hexadecimal cpu bit mask specified by the user.
Added verification to check for cpu cores range, making sure poll groups cores
assigned within the range of cpu cores allocated for the application.

RPC nvmf_set_config now takes an argument to configure ‘poll groups’,
a new parameter for NVMf subsystem. This parameter sets a CPU mask
to spawn threads which run an event loop for a ‘poll group’.

Change-Id: Ied9081c2213715ec94de00a8b37153730b8ac2ed
Signed-off-by: Yuri <yuriy.kirichok@hpe.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5611
Community-CI: Mellanox Build Bot
Reviewed-by: Matt Dumm <matt.dumm@hpe.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-28 08:06:00 +00:00
Ben Walker
ea0aaf5e85 nvme: Transports now set qpair state to NVME_QPAIR_CONNECTED inside
.ctrlr_connect_qpair

Previously this was assumed to be a synchronous process so the generic
layer transport code updated the state after .ctrlr_connect_qpair
returned. In preparation for making this support asynchronous mode,
shift that responsibility down into the individual transports.

While none of the transports actually do this asynchronously, insert a
busy wait in nvme_transport_ctrlr_connect_qpair to wait for the qpair to
exit from the CONNECTING state. None of the upper layer code can
actually correct handle a transport doing this asynchronously, so the
busy wait will cover that.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I3c1a5c115264ffcb87e549765d891d796e0c81fe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8909
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: Monica Kenguva <monica.kenguva@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>
2021-07-28 07:04:00 +00:00
Ziye Yang
50472c44cf idxd: Do not assign the results if there is error on completion.
If there is hardware issues, we do not need to assign
the result. Because we will report the error status to the uplayer.

Change-Id: I647ddd609a1d5d0d52cc4fee59699b9992da4fa4
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8864
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>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-28 07:02:22 +00:00
Ziye Yang
39827dd445 lib/idxd: Add assert check in each public API.
Those functions are exported publicly, so better to
add some assert functions to detect some null pointer
errors.

We do not use if/else check, because it is too heavy.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I16814efb84a5a41876657f0caf5f0a6d0c2db8f3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8863
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>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-07-28 07:02:22 +00:00
Ziye Yang
4a670845f8 idxd: Add a check for the batches list.
This assert is used to make sure that there is no
active batch (spdk_accel_batch) task is used.

If there are active batches found, it means that
we did not handle this case in a good manner.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I7ea6247d2d5a40cf4f3f31cd8b1240fed4648d62
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8857
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: <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-28 07:02:22 +00:00
Michal Mielewczyk
975852a079 lib/ocf_env: Force struct list 64 bytes alignment
After compiling SPDK with `--enable-ubsan` option, ocf tests fail with the
following error:

src/ocf/mngt/ocf_mngt_common.c:170:2: runtime error: member access within
misaligned address 0x200003800188 for type 'struct ocf_cache', which requires
64 byte alignment

The mentioned line of code is `list_for_each_entry()` macro used for iterating
lists. Forcing `struct list` alignment removes the issue.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Change-Id: I803dd962ff873679f42568e6f42fec7fed278f67
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8516
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-28 07:02:14 +00:00
Konrad Sztyber
d60fa400e4 lib/blob: add missing dereference in blob_get_snapshot_and_clone_entries
The assertion should verify that a clone has been found.  Without the
dereference, it makes no sense, as that pointer is dereferenced earlier.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I67fa17b33df6d507822a17ffc221a6d360985646
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8919
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-28 07:02:06 +00:00
Konrad Sztyber
56d702ab23 lib/blob: use bs_allocate_and_copy_cluster() in inflate
Using `bs_allocate_and_copy_cluster()` instead of a zero-length write
makes it possible to inflate/decouple snapshots, as the writes would
fail with -EPERM, because the snapshots are marked as read-only.

Additionally, zero-length non-vector requests are now completed
immediately.  It makes it consistent with the vector path (which already
does that) and allows us to use the zero-length reads as a context for
cluster copy.

Fixes #2028.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib7fdee352972ecf808833aa179820d85cfab7eed
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8918
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-28 07:02:06 +00:00
Karol Latecki
95a59652f9 autobuild.sh: Update DPDK 21.05 patches
93c4adda4d did not take
DPDK 21.05 release into consideration.

Change-Id: I9cc6a0fb7cb600d6ad08fc9eca1cbcd5e3c25d14
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8835
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-27 15:47:20 +00:00
Michal Berger
d19ead1f76 pkgdep/git: Patch refspdk repos
36b5a69bb0 "trace: fix the snprintf warning issue"
2ac1521581 "test/compress: fix Wstringop-overflow warnings"

These patches are needed to make sure SPDK's refs can be compiled
under GCC 11 (e.g. fedora34).

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I7e3800351b02506c99ba8ac7f4d40312867e1ab9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8790
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-27 14:55:34 +00:00
Ben Walker
fb1ace6700 nvmf: In zcopy, delay setting req->data until end of start operation
The data buffer isn't available at the beginning.

Change-Id: Ieeb1a297ff52dfdc6cd999d04862a0cd96483650
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8932
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.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-07-27 14:53:39 +00:00
Ben Walker
1d6adfb09c nvmf: Add commit parameter to zcopy end operation
Change-Id: I2803c806d623f345ce462b7fe1b7c02223008d9d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8931
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.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-07-27 14:53:39 +00:00
Alexey Marchuk
8c22b0ab1c event: Add parsing of env_context option
For some reason we didn't parse this cli parameter

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ic046cac637c5b7c4f52030b0b025c3192ca3fe0b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8779
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
2021-07-27 13:43:25 +00:00
John Levon
4ec7d1eff9 nvmf: small tidy in nvmf_ctrlr_association_remove()
Use explicit SPDK_POLLER_BUSY define.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Ie6f15d05f6f32bce8bba52689e192339f9289823
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8561
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-07-27 13:43:11 +00:00
John Levon
f243c7cd48 vfio-user: remove some stale comments
There were a few references to "SPDK thread context", which are no longer
relevant in the current codebase. Additionally clean up another XXX to be
clearer as to the context, and fix two minor typos.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I2aeda8aaa0edc973fdb67feccc32d792c5f7292e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8548
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-07-27 13:42:52 +00:00
Konrad Sztyber
84b304ce57 test/iscsi: wait for tgt termination before creating new node
If the process doesn't terminate before we try to create a new iscsi
node, the socket might still be in use by that process causing the
`bind()` call to fail.

Fixes #2052.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic6c32774b3c3d7008b1089f151fc933177f28aac
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8902
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-07-27 08:12:46 +00:00
ChengqiangMeng
be4e9db783 unittest/nvmf_tcp: Test for nvmf_tcp_send_c2h_term_req
Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: I549d30be62a0e3864ab47fbe0bc67cdc52aca939
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8888
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-07-26 08:58:19 +00:00
Mao Jiang
d428fbcc41 test/nvmf/ctrlr: cases for setting property
Change-Id: I410052feb7fb576f98d2756eb58205a54aec16ca
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8915
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>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-07-26 08:58:04 +00:00
Jonathan Teh
3387fbbc41 nvme: Split nvme_ctrlr_reset() into discrete parts
Split the NVMe controller reset into pre-init and reinit stages so
that the latter begins with a call to nvme_ctrlr_process_init(),
returning -EAGAIN if the controller is not yet ready so that a poller
can call it again later.

Signed-off-by: Jonathan Teh <jonathan.teh@mayadata.io>
Change-Id: Ia182b04e438241b139109be93f3ed858fac7f3d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8486
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-07-26 08:57:46 +00:00
Ziye Yang
e1e73440d3 bdev/rbd: open image on only one spdk_thread
Purpose: Only Open image on one spdk_thread
due to the limitation of librbd module in order to
eliminate the lock overhead among different
spdk_threads on operating on the same image.

Change-Id: I64c62e8ae1c3324b92cfd953b44ec08af6688530
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6812
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.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-07-26 08:57:09 +00:00
Wu, Mengjin
cc0d05b427 lib/nbd: hot remove will be correctly handled
BUG FIX: call nbd_bdev_hot_remove will stuck if
it is called when nbd has in-flight IOs.

nbd_bdev_hot_remove is asynchronous. It will
guarantee the stop of this nbd.

nbd hot remove test will be added later

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: I0a0dfab31fafd3d61212ade53c74ad05dbbff268
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8039
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-26 08:56:23 +00:00
Michal Berger
ea03551716 pkgdep/git: Update ice driver to the latest release 1.6.4
This is done since previous version is not compiling anymore under
latest fedora33.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I8f65d5e47af81f01221eb8699c3323c3f8099f38
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8916
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-07-26 08:56:00 +00:00
paul Luse
74dd24851d Revert "idxd: Remove the batch_op field because it is not necessary."
This reverts commit 585e808e06.

Signed-off-by: paul Luse <paul.e.luse@intel.com>
Change-Id: I578d248d490c27a5806c5a77fb241a15ba85a530
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8908
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-07-26 08:55:46 +00:00
Tomasz Zawadzki
789f8b85cd version: SPDK 21.10 pre
This is first commit that should go into latest SPDK
after the code freeze for SPDK 21.07.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib8c7a0e9d8594271119e4c9d0340528003798a92
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8901
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-23 10:34:01 +00:00
Alexey Marchuk
ec1b78dbd7 socket: Remove deprecated enable_zerocopy_send
This parameter is still part of API spdk_sock_impl_opts
structure but it is not used. Keep it to support ABI
compatibility since it is located in the middle of the
structure and removing it may break socket opts initialization
or parsing.

Change-Id: Ib641ad7d965d68bc9ebb65dba531408d88cf6fa1
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8914
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-23 10:30:25 +00:00
matthewb
5818b42fce lib/nvmf : Added support for ZCOPY
Implemented nvmf code to allow transports to use ZCOPY. Note ZCOPY
has to be enabled within the individual transport layer

Signed-off-by: matthewb <matthew.burbridge@hpe.com>
Change-Id: I273b3d4ab44d882c916ac39e821505e1f4211ded
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6817
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-23 08:34:43 +00:00
Ziye Yang
5a169179be uring: fix the assert issue.
Revise the if case to avoid the assert issue.

Change-Id: I095f3d111423e17abaa1f951fe22efb3d2e851b7
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8872
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-23 07:10:48 +00:00
Tomasz Zawadzki
250b2ba025 dpdk: update DPDK submodule with changes on spdk-21.05 branch
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8f8861be66afbe99f9d0de440b9bb76c2176ee3f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8906
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-23 07:10:03 +00:00
Tomasz Zawadzki
29b3da96ba socket: removed deprecated zerocopy RPC options
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I748c3f008a6ba1b969acecdd593940077800091b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8900
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: GangCao <gang.cao@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-07-23 07:10:03 +00:00
Tomasz Zawadzki
c97eb5ecd1 lib/nvmf: removed deprecated stats API
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6e89e7a6b723745517cee077facad134692044d3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8899
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-23 07:10:03 +00:00
Tomasz Zawadzki
0ac1bd07b8 rpm: remove deprecated pkg/spdk.spec
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I04972b5408abd1a8ac813e591e836e8db2876bcc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8898
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.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-07-23 07:10:03 +00:00
Tomasz Zawadzki
e0e716651e CHANGELOG: added new changes since SPDK 21.04
Added new entries missing from CHANGELOG.
Net library was removed so deprecation.md was modified.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I062149129aaf854b3038d1ab5291eb5e56ff35b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8897
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-23 07:10:03 +00:00
Tomasz Zawadzki
8595ff7bbc CHANGELOG: sort and format existing entries for 21.07
Sorted current entries and typo/formatting errors in
preparation for SPDK 21.07.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I108ef6ffb65a4f3bc713696c5f2d4ef8903d192a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8896
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-23 07:10:03 +00:00
Krzysztof Karas
821d8e26a6 spdk_top: add sorting to get_pollers_data()
Modified get_pollers_data() function to use already sorted
poller array across spdk_top.
Modified related display functions and sort_pollers() to
accomodate the change.

Deleted prepare_poller_data() and copy_pollers().

Modified show_poller() to use a single entry from pollers
array instead of all of them.

Modified refresh_pollers_tab() to handle changing
number of entries in a different manner.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I26936fbc96e7cb598a33b2fe4354b03277d88061
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8638
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-07-23 07:09:52 +00:00
Krzysztof Karas
c3e625ba2b spdk_top: create local poller structure to fill with RPC data
Create local structs to fill with RPC data, sort and then
copy into a global poller array inside get_pollers_data().

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I545392cbdc699e4d96f1d39611a6e694e209c25d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8234
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-07-23 07:09:52 +00:00
Krzysztof Karas
d55eb1af28 spdk_top: move prepare_poller_data(), copy_pollers(), sort_poller(),
get_last_run_counter() and get_last_busy_counter() upwards

Moves these functions above get_pollers_data() for use in next patch.

Moves enum sort_type to the section with struct definitions.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I795c02a660e987f5e9689dab07f14479d1026d99
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8057
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-07-23 07:09:52 +00:00
Krzysztof Karas
96e7dd3d65 spdk_top: refactor cores RPC functions and reduce number of cores structures
This patch aims to reduce number of core structures.

All related functions that use global core structures are reworked.
Part of code with poller and thread counter per core is moved to
data gathering function.

Additionally deletes double newline between functions.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I31034e5d889fe24b067a407ca348ba07c58ce6b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8565
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-23 07:09:52 +00:00
WindYu
49ffdc18af bdev/nvme: Add support to get the health log for NVMe device
Add a new RPC method to get the health log of a certain NVMe
device.

Below is the example:

./scripts/rpc.py bdev_nvme_get_controller_health_info -c Nvme0
{
  "model_number": "INTEL SSDPE2KX020T8",
  "serial_number": "BTLJ72430ARH2P0BGN",
  "firmware_revision": "VDV10110",
  "traddr": "0000:08:00.0",
  "temperature_celsius": 33,
  "available_spare_percentage": 99,
  "available_spare_threshold_percentage": 10,
  "percentage_used_percentage": 2,
  "data_units_read": 1013408619,
  "data_units_written": 346792685,
  "host_read_commands": 30457773264,
  "host_write_commands": 18949677715,
  "controller_busy_time": 4979,
  "power_cycles": 49,
  "power_on_hours": 31114,
  "unsafe_shutdowns": 18,
  "media_errors": 17,
  "num_err_log_entries": 19,
  "warning_temperature_time_minutes": 0,
  "critical_composite_temperature_time_minutes": 0
}

Change-Id: I53125d2ec16cb36011571473430aece99167b803
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8806
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-07-22 13:46:50 +00:00
WindYu
2d629511f5 json: add the spdk_json_write_uint128 function
Add the paired spdk_json_write_named_uint128 function

Change-Id: I222f0c5076efe150ab2861c0d915d18476815e37
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8797
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>
Community-CI: Mellanox Build Bot
2021-07-22 13:46:50 +00:00
Ziye Yang
585e808e06 idxd: Remove the batch_op field because it is not necessary.
This batch_op field is not necessary because we can
use the comp_ctx->desc->opcode to judge whether it is related
a batched task or not.

Change-Id: Id329221ccf272c4c3bb8c1b5ec08433029a9a1f8
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8865
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-07-22 13:28:39 +00:00
Michal Berger
e3410dd586 test/vhost: Make sure only Mellanox NICs are used for vhost tests
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ia616fa7411496628cd79e13474b6e0b96979480a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8895
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-22 13:21:01 +00:00
Michal Berger
c9e23c2b34 Revert "test/vhost: Don't use nvmftestinit() in vhost tests"
This reverts commit 5e03beae70.

As it happens, Soft-RoCE is not capable of handling all the test cases
in the vhost suite.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Iccbbe3a7314cc68bb4feca700fa6d943c961bd2b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8894
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-22 13:21:01 +00:00
wawryk
a42ccffa0a test/nvme: Always enable performance cpu governor in NVMe performance tests
Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: I2ef9bd23b545ea51e9e3f4b2b55189a2423707d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8547
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-21 19:45:02 +00:00
wawryk
cb19173375 scripts/nvmf: configure adq traffic classes before configuring target
Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: Ibb2c943b555ce4304ff0244af16cc93ab53482cb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8837
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-21 19:44:13 +00:00
Jonathan Teh
153f03cf42 bdev/nvme: Add bdev_nvme_reset_controller rpc
Implement bdev_nvme_reset_controller rpc, which allows the NVMe
controller to be reset over RPC. Implement bdev_nvme_reset_rpc()
which starts the reset of the controller and returns the result of
the controller reset via the callback function after it completes.

Signed-off-by: Jonathan Teh <jonathan.teh@mayadata.io>
Change-Id: Id98d5e56feb315b7e44e9bb5e5f495e9b1cd1de0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8456
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-21 07:45:38 +00:00
Jonathan Teh
3c6b670df4 bdev/nvme: Switch to spdk_nvme_ctrlr_reset_async
In bdev_nvme_reset_ctrlr(), get a controller reset context and start
a poller that calls spdk_nvme_ctrlr_reset_poll_async() to perform the
controller reset asynchronously.

Signed-off-by: Jonathan Teh <jonathan.teh@mayadata.io>
Change-Id: I1e3ae42291c3b43b69c99ca56997dc1965c3ac59
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8454
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-07-21 07:45:38 +00:00
Jonathan Teh
ac24039da3 nvme: Add spdk_nvme_ctrlr_reset_async
Implement an async variant of spdk_nvme_ctrlr_reset(). This initial
implementation only allocates a context and returns it to the caller,
relying on the caller to poll the context to execute the existing
spdk_nvme_ctrlr_reset() implementation.

Wire up spdk_nvme_ctrlr_reset() to use this async variant to verify
that NVMe controller reset still works.

Signed-off-by: Jonathan Teh <jonathan.teh@mayadata.io>
Change-Id: I75d4b75dbf5897db452ee65286aef5a4eb839fca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8330
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-07-21 07:45:38 +00:00
Krzysztof Karas
a40a081d20 spdk_top: reduce number of core structures and refactor core functions
Merge core_info into rpc_core_info to increase readability.

Delete g_cores_history to reduce number of cores structures in spdk_top.

Add temporary cores structure to get_cores_data() to fill with
data from RPC call. This is to allow fields last_busy and last_idle
in g_cores_stats.cores.core_info structure to retain their values
and assign new ones with each data_thread_routine() loop.

Change core display across spdk_top accordingly (change places
where g_cores_history was used to use g_cores_stats instead)

Delete get_core_last_stats(), because it is called only in one
place and can be replaced with direct assignment of two values.

Delete last_page variable from refresh_cores_tab.
That variable was used to decide which core entries to update,
and since we collect and update data for all entries elsewhere,
this is not needed anymore.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I4a5a4c90098401876b214068725a8fce29766a12
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6449
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-21 07:27:32 +00:00
Krzysztof Karas
254496fc95 spdk_top: reduce number of thread structures and refactor related RPC functions
This patch aims to reduce memory needed to run spdk_top by removing some
of thread data structures and also to rework thread RPC functions.

Related functions that use thread structures for data gathering and
display will be modfied to accomodate new changes.

free_rpc_threads_stats() will be removed, because we now allocate
memory on stack instead of heap and manually freeing is no longer
needed.

Deleted last_page variable in refresh_threads(), because it was
not used.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I73c30637b26434dad7ea55a9866887b1988166b1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8533
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-21 07:27:32 +00:00
Krzysztof Karas
fc41cd7b99 spdk_top: fix unchanging poller state
Poller state does not change back from Busy to Idle after it
has finished its work and this patch aims to resolve that issue.

Added a field in poller history to store last busy_count of each
poller for later comparisons with current values.

Added a function to get last busy count of a poller.

Modified related display functions.

Fixes #2037

Change-Id: I214e41133eaf90b0f1d7995a53e577a7c1c5d33e
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8755
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-21 07:27:32 +00:00
Krzysztof Karas
a599e69b58 spdk_top: change return type of get_last_run_counter()
New pollers did not have a corresponding run_counter_history entry
when displaying data for the first time after they were created.
If user enabled g_interval_data and observed the creation of the poller,
application crashed due to get_last_run_counter() returning NULL pointer.

Fixes #1995

For new pollers there is no historical data and current last_run_counter,
matches the expected last_run_counter for displayed spdk_top interval.
get_last_run_counter() now returns 0 when matching run_counter_history is
missing. Avoiding dereference of a NULL pointer.

While here modified copy_pollers() to no longer get and store the last run counter
twice. When doing reset_last_counter only storing the new last run counter is needed.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I5218c9ac0f2f79da32840cf64b4083642893f5cc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8683
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-07-21 07:27:32 +00:00
Krzysztof Karas
dddd28bedc spdk_top: refactor RPC decoders for pollers and reduce poller structs number
This patch aims to reduce memory usage by deleting chain of poller structs
that depend on each other.

Reworked RPC related functions to use only one poller structure.

Reworked prepare_poller_data() and copy_pollers() to accomodate new change.

Changed display functions, which use poller data.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I0252f93e47fec6a3298f07463aebd495697274bf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8519
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-21 07:27:32 +00:00
Krzysztof Karas
775173fdd9 spdk_top: delete core_num variable
Deletes core num variable inside refresh_cores_tab,
because it is used only in one place.

Change-Id: Ie10a7b53487da507cb8d0babab6d00eb2f9412ca
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8715
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-07-21 07:27:32 +00:00
Krzysztof Karas
e230f8e9e6 spdk_top: fix sorting in threads tab
Currently spdk_top retains selected thread sorting for one application
loop only, because it is performed before all assignment operations are
done.
This is a problem when 'sort by core' is selected, because threads are
sorted before core assignment happens.
This patch aims to resolve that issue.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: Ide6d025d5e4e31a8fda713703a822e976468f326
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8629
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-07-21 07:27:32 +00:00
Ben Walker
d673fcee3d test: Fix missing comma in app_ut.c
Caught by clang 12.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ibed23c3aab80508aebf06e4ba44e14e385a3256b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8854
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
2021-07-21 07:27:04 +00:00
Michal Berger
1963d3185c pkgdep/freebsd: Use globbing to match on package names
Some packages include versioning in their name which is not very
friendly in case given package is upgraded - the name of the package
will always change in such a case. To avoid that, use globbing to
match on package names in a more robust way.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I3e23fc8a06f93471f47835e945c24c4a95f80795
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8741
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-20 08:09:36 +00:00
Krishna Kanth Reddy
4e885f5aa2 include/spdk: NVMe spec header changes for Boot Partition Read / Write support
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I86209e24bdfb2388dae31fb68033a6208e518a7b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8630
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-07-20 08:09:27 +00:00
wawryk
a26d602844 test/pkgdep: install ice driver as root
Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: Ib61100342a4d29b4ce737f6fe01c60d8dba18e1d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8592
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-07-20 08:09:15 +00:00
Pawel Piatek
d7aa681b6b test/nvme_perf: add main core parameter
For Test Case 2: SPDK NVMe BDEV I/O Cores Scaling
we need to specify DPDK main (primary) core.

Signed-off-by: Pawel Piatek <pawelx.piatek@intel.com>
Change-Id: I53d706c4173e16035a3883c29547659a0c7a22fc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8553
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-20 08:09:05 +00:00
wawryk
a3d0f42889 test/vhost: Always enable performance cpu governor in Vhost performance tests
Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: Id0c1217b1c7138e7c618d816948ca34ba8a09be6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8543
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-20 08:08:05 +00:00
Michal Berger
d2b415bc86 autotest: Don't mark pmr tests as skipped
New job was added to the CI (nvme-cmb-pmr-vg-autotest) which brings
PMR|CMB functionality under qemu 6.0.0. Since these tests are now
being executed they should not be considered for skipping.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ib09336a85da2955d63e28834779042c672823cde
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8704
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-20 07:59:43 +00:00
Michal Berger
0b55bf715e test/nvme: Add basic test covering cmb_copy functionality
Change-Id: I083ce9560c37b0f0bd39c9dce3cf97e4038b5e31
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2006
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-20 07:59:43 +00:00
Michal Berger
5e03beae70 test/vhost: Don't use nvmftestinit() in vhost tests
For now this function is not working very well in case it finds E810
cards (we do have some installed across CI pool) as we don't have
proper irdma driver in place.

Instead, and since it shouldn't be relevant for vhost tests, enable
soft-RoCE devices and use them (or any other rdma-capable NIC that
ip is going to be allocated on) during the vhost migration tests.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I4e8cc7b8eea3ce91684d8a68d0a0e11b8d1e4b9b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8750
Reviewed-by: Changpeng Liu <changpeng.liu@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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-07-20 07:59:31 +00:00
Michal Berger
8b19bc2383 autotest: Add source and line number to PS4 prompt
Trace details are written out only when test fails, but sometimes
it's hard to determine from which script and what particular line
given command is being executed during the actual runtime of the
test. This should make it a bit easier. The log lines would look
like this:

-- common/autotest_common.sh@1217 -- # uname -s

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Iac6973f986e6c553f39e5a9c909ccabf607251f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8756
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-20 07:59:31 +00:00
Karol Latecki
8dace9e26c scripts/nvmf_perf: reuse get_connected_nvme_list()
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I1ccc18e9a025faea87ef4328bd79be7c3574ebf6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8743
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
2021-07-20 07:59:18 +00:00
Karol Latecki
0574f36dea scripts/nvmf_perf: improve error handling
Add exceptions to results parsing and fio run functions
to better inform what's the cause of the failure.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I94e51cb8f77515f7d26a75501011d6111820ae56
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8742
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-20 07:59:18 +00:00
wawryk
2c8baa4685 scripts/nvmf: add io_uring engine option for Kernel Initiator
Enable "kernel_engine" option for Kernel Initiator
class to enable ability to use io_uring engine on
initiator side.

For NVMe-oF this has limitations as apparently it's
not possible to enable polling on the initiator side,
which in turn makes fio "hipri" option also not
possible to use.

Adding #TODO sections with notes in case this is
later fixed in Kernel NVMe driver.

Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I31da52946692015237263abc77d8425b5eae5b98
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8134
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-20 07:59:18 +00:00
Ziye Yang
03323b09a4 nvme/ctrlr: Fix the invalid access of free_io_qids array.
To fix the segment fault.

Fixes issue #1749

Reported by user: https://github.com/rdxsasha
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I130d8dba04e4a3e83c22c5967507c1297a048f0b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8813
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@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-07-20 07:59:08 +00:00
Changpeng Liu
111851efbb nvmf/vfio-user: several code cleanup
Change-Id: Iba94148599c8b82827f38a7b9badc1b13713031e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8814
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: Ben Walker <benjamin.walker@intel.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>
2021-07-20 07:58:55 +00:00
Changpeng Liu
64b6b8e30f nvmf/vfio-user: optimize the special AER completion
When the QP is set to INACTIVE state, we always unmap the QP's
address to NULL, we can just check the address is valid or
not before posting completion response, so there is no need
to do the special process for the aborted AERs.

Change-Id: I1dc9893e04810e9a15e1eeb4d9405b775eab38d7
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8803
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Ziye Yang <ziye.yang@intel.com>
2021-07-20 07:58:55 +00:00
Changpeng Liu
cbafa31abc nvmf/vfio-user: enable/disable/shutdown controller same manner as the NVMf library
We should use the diff bits to decide the action to CC.

Change-Id: I08cf6f65711f86328825dcd9e204ed79766c59fe
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8802
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-20 07:58:55 +00:00
Changpeng Liu
7195aaa44c nvmf/vfio-user: handle Delete IO CQ command correctly
Similar with Create IO SQ command, we should also defer the completion
of Delete IO CQ command until the IO QP is disconnected finally.  However,
since the NVMf library will disconnect/free the queue pair finally, we
can't use the queue pair data structure to save the context, so define
a delete_cq context for Delete IO CQ command.

Change-Id: I005ad86c2af59540323205e9e928a2d573d5c448
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8796
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-20 07:58:55 +00:00
Changpeng Liu
0d0524b9e0 nvmf/vfio-user: handle Create IO SQ command correctly
The NVMf library doesn't process Create IO SQ command, so for
this command we will use a fabric connection command instead,
however, the fabric connect command is called asynchronously,
so we need to defer the completion for Create IO SQ command after
fabric connect command is completed.

Fix issue #2043.

Change-Id: Id8c71ca69fb750a3ffb0fb26b54fa8b6d87e8ff4
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8786
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-20 07:58:55 +00:00
Changpeng Liu
9bcafecb01 nvmf/vfio-user: set endpoint's controller pointer to NULL
We can set endpoint's controller pointer to NULL before free_ctrlr, as
controller is a session in vfio-user, while endpoint is related with
Unix Domain socket.

Change-Id: If6d26c7522804029f8c2425bc478df9e2d53d32a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7966
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-19 13:50:55 +00:00
Changpeng Liu
684410026b nvmf/vfio-user: free controller if no connected qpair
The VM may already delete all queue pairs and just leave the
socket when killing VM, so we can check number of connected
queue pairs here, if no connected queue pairs, free the
controller immediately.

It's an optimization so that we don't need to loop all
queue pairs below.

Change-Id: Ia1be868ce2c74ce6953b1f44a81b51d605e642f0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7625
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-19 13:50:55 +00:00
wawryk
7cb301c042 scripts/nvmf: replace deprecated enable_zerocopy_send by enable_zerocopy_send_server
Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: I98ee388059e522946f4111ab4c414208c8a68daf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8798
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-19 13:50:40 +00:00
Jim Harris
0c64044400 test: add connect_stress test
This new connect_stress application connects to a
specified subsystem, creates some IO qpairs and
reads the CSTS register.  It goes through this loop
over and over again until the specified time expires.

The connect_stress.sh test script runs this application,
and then while it is running does continuous add_ns and
remove_ns RPCs.

This stresses nvmf handling of connect (admin + I/O) as
well as get_property commands.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8ab5156045cf5614f74988e38a9d37db96d7d5b9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8572
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-19 13:50:29 +00:00
Evgeniy Kochetov
2716eb02f1 rpc: Fix disable_zerocopy_send_server in sock_impl_set_options
Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I27cfa20c59383e5689dd1795f1737b1676c1bb12
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8799
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2021-07-19 08:05:43 +00:00
Tomasz Zawadzki
8e649e83b2 lib/event: remove get/enable/disable turbo API from governor
In rte_power all that enabling/disabling turbo does is allows
for additional entry in frequency array for particular core.

Instead of exposing this API through spdk governor,
just make sure that dpdk_governor enables turbo by default.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I994b326a57c01889bccea26635753c56637259d2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8789
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-19 08:05:19 +00:00
Tomasz Zawadzki
12fcf7e1d5 lib/event: remove get/set_core_freqs API from governor
Those calls went unused, in favor or much more useful
up/down/min/max variants.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I432896196a1a6edfc6799c8658df49567f73d457
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8788
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-19 08:05:19 +00:00
Tomasz Zawadzki
7bf66ff5ac lib/event: remove fields from spdk_governor_capabilities
The spdk_governor_capabilities added lots of capabilities
which went unused, suposedly to mark which callbacks
a governor had implemented.

This made little sense, since capabilities are per core and
not implmenting this APIs made little sense.
With this patch spdk_governor_capabilities is brought in
line with rte_power_core_capabilities.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I85296fce2999cb41957162b63ee13d86a0be919f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8787
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.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-07-19 08:05:19 +00:00
Krzysztof Karas
ae74e70eff lib/event: remove _spdk_scheduler_disable()
Remove _spdk_scheduler_disable() to avoid confusion as there is
no spdk_scheduler_enable function. Since spdk_scheduler_disable
sets scheduler period to 0, use spdk_scheduler_period_set(0) instead.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I4f1390a635f80e8b92775aa4be2e37f5b95467f8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7448
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-19 08:05:19 +00:00
Tomasz Zawadzki
fba4a97dec lib/event: refactor managing core_info thread allocation
The size of the core_info->threads will always be equal
to reactor thread_count, there is no need to count it
separately.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Icfa84606bd29d7766738eb2053362a20d78c23af
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8733
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@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-07-19 08:05:19 +00:00
Tomasz Zawadzki
cf155f23b0 lib/event: refactor _reactors_scheduler_update_core_mode()
Replaced multiple functions calls to _reactors_scheduler_update_core_mode(),
with a for loop.

Since changing reactor to interrupt mode is rare operation, most of the
time we ended up with unnecessarily long callstack.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1c7858653be9e2256943c1da5a27001be41682b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8714
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-07-19 08:05:19 +00:00
Tomasz Zawadzki
cff96883fc lib/event: remove is_scheduling flag from reactor
There is only one g_scheduling_reactor (main core), the is_scheduling
flag for it is used to block starting new gather_metrics before
previous one is finished.

Meanwhile is_scheduling flag on other reactors was used to block
destroying lw_threads while scheduling happens. It was only needed
because scheduler interacted with the same lw_thread pointers as
each reactor. Previous patch removed this dependency, instead
spdk_thread ids is used. If an spdk_thread is destroyed,
while scheduling _threads_reschedule_thread() handles it.

It is no longer required to block destruction of lw_threads
based on this flag.

Instead of using the main core reactor flag, a g_scheduling_in_progress
is introduced.

Removed _spdk_get_scheduling_reactor() and instead shared the value
of g_scheduling_in_progress between reactor.c and app.c.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ica57326a552477add522174cc3e96b3bab918350
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8732
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.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-07-19 08:05:19 +00:00
Tomasz Zawadzki
b74b6133fa lib/event: remove scheduler dependency on lw_thread
Removing dependency on schedulers to directly modify
lw_thread field structures will help making schedulers
truly plugable.

Instead of using lw_thread, new structure is created
that holds copy of stats and refer to the thread by
spdk_thread id.

As an added benefit of not changing lw_thread directly,
we won't run into issue of balancing function changing it
while other reactor removes and frees it.

In the future an API will be added for scheduler to call
in order to move the thread directly. Rather than for
event framework to rely on modified core_info/thread_info
structure.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8f85bb8dc080fd13b78b07ee9ef8e8be7051659b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8411
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.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>
2021-07-19 08:05:19 +00:00
Tomasz Zawadzki
012b233426 ut/reactor: implement stub for _spdk_get_app_thread()
Functions that set reactor interrupt mode were not tested
since _spdk_get_app_thread() always returned NULL and
implementation did not verify the RC.

This patch will return a thread from scheduling reactor
as the app thread. Which is not exact, but otherwise
a new app thread would have to be added to each UT.

spdk_reactor_set_interrupt_mode() requires the completion to
be executed on app_thread. Added the poll of that thread
to make sure it gets drained.

Since now the UT actually executes the code path,
additional 4 events will be processed.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I0793e6dcc41c447dc11ed8ab28eb9041c5d82628
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8409
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@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-07-19 08:05:19 +00:00
Tomasz Zawadzki
a3aa222a39 ut/reactor: consolidate polling for all events
Scheduler and governor tests polled events till completion,
but depended on exact number of events and repeated those
calls multiple times.

This patch adds _run_events_till_completion() which will
run all events scheduled, until there are no more to process.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Iab3af2e031510b095ddfcc93d2320bbdc7d84aeb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8408
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@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-07-19 08:05:19 +00:00
Michal Berger
e52df268d3 test/scheduler: Check if load on all working CPUs is under 80%
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I89e31aceb7037c55801f4b7cbd4126bce38ae174
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7566
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-07-19 08:05:19 +00:00
Michal Berger
d841e24b21 test/scheduler: Add tests covering new load balancing functionality
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ia7b075711192189918d9fb1b186b907814a12430
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7450
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-07-19 08:05:19 +00:00
Tomasz Zawadzki
d47b0d2d7d test/scheduler: remove unnecessary assignments of thread names
The "threadX_name" variables are not used anywhere except
creating the thread. Instead use the names directly.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6bdb2eb1d1e96fe888a4d5d9765fc0b0dfa74272
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8794
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-07-19 08:05:19 +00:00
Tomasz Zawadzki
66a5b406cb scheduler_dynamic: lower the idle thread limit
Limit of 50% to mark thread as active or idle
didn't allow for multiple active threads to be placed
on single core.

Lowering the limit to 20% will allow that and force
more threads to be actively balanced.

Removing the limit was considered, but that would
cause too much thread moves when a thread with load
in single digits increased briefly. Either
due to actually doing any operation or placement
of other threads on the same core.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5f8c9ff15461feb71a2d82853cfe048e412ba921
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8289
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-07-19 08:05:19 +00:00
Tomasz Zawadzki
68063cd8b6 lib/blob: force md update during decouple parent
Fixes #1933

When decoupling parent the updated parent_id was
not persisted to the blob if it was a snapshot.
Due to having md_ro set to true, blob_set_xattr()
failed.

Later on the incorrect parent_id could cause troubles
like in the github issue, when deleting that snapshot.

This patch adds return code check for blob_set_xattr
and forces md_ro to false during blob md sync.

Since some of code paths are shared between decouple,
inflate and clone operations, the final callback for them
is doing revert of the original md_ro.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If017455f72e4d809fe533d9f986e5ae6bb8e2035
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8420
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: Ben Walker <benjamin.walker@intel.com>
2021-07-16 23:25:45 +00:00
Michal Berger
7478e053e1 test/scheduler: Don't use extra time while waiting for idle cpus
It's not needed anymore since we pick up now last idle sample in
comparision to remaining states given cpu spent time in. This way
we get the faster view if in given moment cpu is busy or not.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I3677c03ee3c2e42662df35dd0a6e7b5b6b1f98ed
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7565
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2021-07-16 07:14:47 +00:00
Michal Berger
330e9f779c test/scheduler: Commonize collect_cpu_idle()
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I72da312e0d7fe71ae40b582501b52be615de4b63
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7564
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>
2021-07-16 07:14:47 +00:00
Michal Berger
0ea8956025 test/scheduler: Add function for calculating cpu load
This is done in order to detect cpu times in a more deterministic
fashion.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I005d6fececdc15500bcf637e96f2fbecbd4273f1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7563
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-16 07:14:47 +00:00
Liu Xiaodong
413808e155 app/trace: assert history ptr
This is just assert to assure the Klocwork
static analizer that ptr is not NULL.

Change-Id: I458af194991fb1874fb7d32db55513a1f66408c0
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8745
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-16 07:13:44 +00:00
Wu, Mengjin
e5c3791c4e lib/nbd: Process NBD_CMD_DISC according to the NBD protocol
After this patch, nbd will no longer receive any requests if
NBD_CMD_DISC is received. But it will handle the  requests
already received.

Previously we called spdk_bdev_abort() for NBD_CMD_DISC and
it will reply to the rest requests in the channel of this bdev.

But there should be no reply to NBD_CMD_DISC. Hence we silently
discards requests after NBD_CMD_DISC.

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: I551dea1887cb2d108ed5e0d621309f62cfaabbb9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8038
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
2021-07-16 07:13:19 +00:00
Mao Jiang
0d1c7bf852 test/nvmf/tcp: cases for qpair memory resource initialization
Change-Id: I255a045e1684d5f36028ec53de63c68505af894f
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8751
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: Changpeng Liu <changpeng.liu@intel.com>
2021-07-16 07:13:02 +00:00
Changpeng Liu
d8843dccc5 nvmf/reservation: register new registrant when IEKEY is enabled
The specification says:
"A host may replace its reservation key without regard to its registration
status or current reservation key value by setting the Ignore Existing Key
(IEKEY) bit to '1' in the Reservation Register command."

So for this case we treat it as a new registrant, also add UT to cover
the added cases.

Change-Id: I5990f15da36706063a35565d110ed4c6eb30a3f3
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8024
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-16 07:12:48 +00:00
Changpeng Liu
814cd25882 nvmf: optimize log level for unsupported feature IDs and invalid property offset
Since we are using NVMf fabric library to emulate a PCIe based SSD via
vfio-user target, so there maybe some commands that are related with
PCIe SSD only, such as set/get features with interrupt coalescing
and Interrupt Mask Set/Interrupt Mask Clear registers.  Even the
NVMf library doesn't support that, it is not a fatal error to Host
NVMe driver, so here we use the info log instead of error log for
this case so that to avoid noise logs.

Fix #2036.

Change-Id: I8283bcde5779080835d6ab827dbd852b3816176f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8766
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-16 07:12:10 +00:00
Changpeng Liu
3eed8456d9 nvmf: support get_features with Interrupt Coalescing and Interrupt Vector Configuration
The NVMf library will not implement interrupt coalescing and ignore them, but we can
report this via get_features.

Some OS may check the result from get_features so that it will not send set_features
for interrupt coalescing.

Change-Id: I7466bcbc0ea5b3b067751cdf1979b2e0681c0043
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8765
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-16 07:12:10 +00:00
Jiewei Ke
df559ab6e0 thread: speed up io_channel lookup by using rbtree
Use the macros for red black tree provided by Free BSD to speed up
io_channel lookup.

Signed-off-by: Jiewei Ke <jiewei@smartx.com>
Change-Id: Icfd87a8a2f60c082a17b8c501a03faba83edb762
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7895
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: GangCao <gang.cao@intel.com>
2021-07-16 07:11:53 +00:00
Jiewei Ke
e45450d28f thread: spdk_get_io_channel() use i->dev as the search key
In current implementation, io_channel list will be accessed by
spdk_for_each_channel() and spdk_get_io_channel(). We will try to
accelerate spdk_get_io_channel() in the following change "thread: speed
up io_channel lookup by using rbtree" by changing io_channel from list
into RB tree.

To make it cleaner, we prefer to use ch->dev as the key for the
io_channel RB tree instead of ch->dev->io_device. This patch makes
spdk_for_each_channel() use the i->dev to find the expected io_channel.
And the io_device in structure spdk_io_channel_iter is not needed in
spdk_for_each_channel_continue() but we keep it for the compatibility of
spdk_io_channel_iter_get_io_device().

After this patch, spdk_for_each_channel() has to access both io_device
list and io_channel list, and spdk_for_each_channel_continue() still has
to access only io_channel list.

Both io_device list and io_channel list will become RB tree. Hence
performance degradation will be negligible. spdk_for_each_channel() is
not so performance critical than spdk_get_io_channel().

Signed-off-by: Jiewei Ke <jiewei@smartx.com>
Change-Id: Idd486b0aa1b63b57ede90527dcd1631cbb008a1a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8749
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: Jim Harris <james.r.harris@intel.com>
2021-07-16 07:11:53 +00:00
Jiewei Ke
281a7c2a15 test/unit/lib/nvmf: register target io device for test_spdk_nvmf_ns_event
In test_spdk_nvmf_ns_event, when doing ns resize it will call
spdk_for_each_channel() to pause the subsystem. But it doesn't call
spdk_io_device_register() in advance. This is wrong and may run into
assertion with the coming change since the io_device is not found.

Signed-off-by: Jiewei Ke <jiewei@smartx.com>
Change-Id: I077b41f812266248c39fdbdb8cdff352d3b4cb74
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8767
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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-16 07:11:53 +00:00
Jiewei Ke
49c6afbf12 thread: speed up io_device lookup by using rbtree
Use the macros for red black tree provided by Free BSD to speed up
io_device lookup.

This change was reverted once but is re-submitted because the critical
issue was fixed by the preceding patches.

In addition to the fix, add unit tests to verify the fix explicitly.

Signed-off-by: Jiewei Ke <jiewei@smartx.com>
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I97ed77f6e5ceacdf2593c9751b55a7d0b92c0b35
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8525
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-07-16 07:11:53 +00:00
Pawel Piatek
93c4adda4d autobuild: Update patches for mainline DPDK
Patch f95e331be3a1f856b816948990dd2afc67ea4020 is no longer needed,
since it was solved at upstream level.

Signed-off-by: Pawel Piatek <pawelx.piatek@intel.com>
Change-Id: Icf064b121351566988c26390f45286e7a456ca39
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8698
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-16 00:33:37 +00:00
paul luse
f95bd3b6c7 lib/idxd: change how we complete batch desc
Previously we used a counter of our own to make sure all batch
elements plus the batch itself were done before we freed the batch.
This was due to some observations early on that the batch desc
could complete before the individual elements and a lack of clarity
as to whether this was due to the simulator or the fact that
we poll on completions and could therefore "see" completions in
a different order at that time (we were using bit arrays to poll).

Now we use an ordered (in time) list to poll locations so if we
instead put the elements on the list first and then the batch desc
itself we are assured to always "see" them in order provided the
underlying device meets spec which there's no reason to assume it
does not.

This simplifies things a bit at the same time and still assures
that we call list calbacks in order and then the batch callback
without "special" handling.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I4d9e3997786f2116ce6515682b8117799c645f51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8397
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-15 21:04:08 +00:00
paul Luse
91cab3414c lib/idxd: remove casts that are no longer needed
Left over from when the field was a void *

Signed-off-by: paul Luse <paul.e.luse@intel.com>
Change-Id: If9dfe2878f6afd6137d6d8efec90e310baf417f1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8280
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-07-15 21:04:08 +00:00
paul luse
a738acd505 examples/accel_perf: use local task element for CRC destination
For all CRC related functions.  Does not need to be DMA'able memory
as DSA returns the CRC to it's completion record and the lib
copies it to this address.  Done for consistency as this element
was added as part of adding the copy+CRC API.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Iefedcbc0a1c4e211eeb8aaf5c52f2881e9173bad
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8230
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-07-15 21:04:08 +00:00
paul luse
96d4c7a36d lib/accel: have accel and idxd engine use task->crc_dst
For clarity, this element was added when crc+copy API was
added so might as well have all the CRC related functions use
it instead of `dst` to avoid confusion.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ic43adbd0df51c1a349847701ef318f452306d0b3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8229
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-07-15 21:04:08 +00:00
paul luse
2f3f5ec556 lib/accel: name crc function param for consistency
We've always used `dst` as the destination for CRC result, with
the recent addition of a copy_CRC API `dst` was needed for the
copy destination and `crc_dst` was used for the CRC.  This
patch just makes all the CRC functions use `crc_dst` to avoid
confusion.  The accel_task struct also has a `crc_dst1 field,
that will be used consistently in the next patch.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ia84c4a9e7940c6ebd31410c12272bd22b0c6dd29
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8228
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2021-07-15 21:04:08 +00:00
paul luse
221eb3f4dd examples/accel_perf: add support for copy_crc commands
For COPY+CRC operations, we allocate a destination buffer for each
task that's big enough to hold the copied input data for all stages
of the chain. For example, if the operation is 4 stages of 4K input
buffers, the destination will be 16K in size.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Id32a98c1dbada2881a8423c050e892d5c37bf6cc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8204
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: Jim Harris <james.r.harris@intel.com>
2021-07-15 21:04:08 +00:00
paul luse
71f0600c5b lib/accel: add support for crc32 with copy using source IOVs
Support in accel_perf is coming up in a later patch.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I63a1d3b9b1a3254fdca78e27c473b9b3468c93c8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8202
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-15 21:04:08 +00:00
paul luse
b4f302e525 lib/idxd: rotate portal offset with each submission
Allows for better performance by not hitting the same portal
address with every submission.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I1ec8eae6f3acec9e98161029cd5406ec08603aa6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8190
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 <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-15 21:04:08 +00:00
Shuhei Matsumoto
320ab72fb5 util: Add macro SPDK_SIZEOF_MEMBER to get size of a member of a struct
We find a few files to get the size of a member of a struct. How to
do it is a little complex. So add a macro to do it will be helpful
to read the current code and develop new features.

lib/dif had used member_size() internally but Linux use sizeof_member()
as the macro. Besides, SPDK have used upper case letters for similar
macros, SPDK_CONTAINEROF() and SPDK_COUNTOF(). Hence spdk_member_size()
may be good but propose SPDK_SIZEOF_MEMBER() as the macro.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2179c845a3b75fb71aa039075cc4dfd30617b898
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8738
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-07-15 07:16:22 +00:00
GangCao
e8cd34ae9f App: update the usage function for the core list usage
In this case, user could specify the core number like:

-m [0,1,10] besides the core mask like -m 0xF

Change-Id: I48621c5a84e5436deae07101591d0ef85b1e129e
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8746
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-15 07:16:16 +00:00
MengjinWu
da2fd6651a lib/nbd: fix conflict between nbd start and stop
Now nbd stop will not be processed if this nbd is not fully started.
However, it will remember the stop command and do it asychronously
until nbd is fully started.

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: Iea5ba143332c7d3fd85f816726788f05e7ae3c8d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8037
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-07-14 10:02:35 +00:00
Konrad Sztyber
970e2e2e18 nvme: free completed aers on shutdown
If there are completed asynchronous events that have not been notified
to the user, free them during controller shutdown to avoid memory leaks.
It can happen if an event completes before user has a chance to execute
`spdk_nvme_ctrlr_process_admin_completions()`.

Fixes #2032.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ie608bf9100342f8dfd709e070326f67335d27fed
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8740
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-14 09:44:43 +00:00
Shuhei Matsumoto
d2d1899b90 bdev/nvme: Create nvme_bdev_channel for nvme_bdev
Create a single nvme_bdev_channel for each nvme_bdev and each SPDK
thread. nvme_bdev_channel has a pair of nvme_ns and nvme_ctrlr_channel.

The pair of nvme_ns and nvme_ctrlr_channel will be aggregated by
nvme_ns_channel in the following patches.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I095a2d6afa4ea23a87e4452b2f9d4c7e0087abe0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6605
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-07-14 09:15:59 +00:00
Shuhei Matsumoto
f6b19841da example/nvme_identify: Fix the bug that assumed ANA descriptor is 8-bytes aligned
This is the same fix as done for lib/nvme.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9ca5e1ea9dbdba45b51b311e9a36f278b1b62770
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8437
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Monica Kenguva <monica.kenguva@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-07-14 09:15:59 +00:00
Shuhei Matsumoto
e0715c2a6b nvme: Add a new option disable_read_ana_log_page to struct spdk_nvme_ctrlr_opts
NVMe bdev module manages ANA log page itself now. So NVMe driver
should disable managing ANA log page.

Add a new option disable_read_ana_log_page to struct spdk_nvme_ctrlr_opts.
Then NVMe bdev module enables it when calling spdk_nvme_connect_async().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id5249efe90a4d50763c3a7eaa1eb9572f60fbc8c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8313
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-14 09:15:59 +00:00
Shuhei Matsumoto
a066f0c3fb nvme: Fix the bug that assumed ANA group descriptor is 8-bytes aligned
This fix is as same as for NVMe bdev module.

If a ANA log page has two or more ANA group descriptors, the second
or later of ANA group descriptors will not be 8-bytes aligned.
Then runtime error would occur as follows:

runtime error: member access within misaligned address 0x612000000074
for type 'const struct spdk_nvme_ana_group_descriptor', which requires
8 byte alignment

nvmf_get_ana_log_page() in lib/nvmf/ctrlr.c creates a ANA log page
data and processes 8 bytes alignment correctly because we got the
same runtime error before. However, lib/nvme had been missed at that
time.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idaa610544dc5cb659c387fcd38a2b4b97cbd06e5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8398
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-07-14 09:15:59 +00:00
Shuhei Matsumoto
793119f08c nvme: Initialize ns->ana_state when constructing ns before checking if ANA is supported
The next patch will add an new controller option, disable_read_ana_log_page.
Initializing ns->ana_state to optimized before reading ANA log page
will simplify the next patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I34e56a2b454e4c02e1899f972e0ad675f2ebe2a2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8312
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-14 09:15:59 +00:00
Shuhei Matsumoto
072f2d0011 bdev/nvme: Update ANA log page it self when ANA change event is notified
When ANA change event is notified, increment reference count, read
ANA log page, and parse it to update ANA states of namespaces.

Then remove the spdk_nvme_ns_get_ana_state() call and its stub in
unit tests.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I254ae6cb993694bf0d7f4fa4b1039b5f9243b5cb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8335
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-14 09:15:59 +00:00
Shuhei Matsumoto
7ec6d1d559 bdev/nvme: Read ANA log page itself when nvme_ctrlr is created
If ctrlr supports ANA log page, nvme_ctrlr allocates a buffer for ANA
log page and read ANA log page itself, and then each nvme_ns sets its
ANA state by parsing ANA log page.

Most code was brought from NVMe driver because NVMe driver already
supports ANA log page management. However it had a bug that assumed
each descriptor is 8-bytes aligned. Fix the bug together in this
patch. Besides, the implementation in NVMe driver was synchronous.
NVMe bdev module reads ANA log page asynchronously instead.

The next patch will support ANA log page update by AER handler.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib8eab887633b043b394a45702037859414b8e0a0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8318
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: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-14 09:15:59 +00:00
Matt Dumm
fa44df3627 test/nvme: A simple test confirming we can change nvme timeout settings via rpc
Signed-off-by: Matt Dumm <matt.dumm@hpe.com>
Change-Id: I1ceb90864eaef9ae131fe7ed13f3ed20384af1b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8352
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-14 09:15:20 +00:00
Matt Dumm
67fbfdd8af nvme: rpc interface updates to manage 'timeout_admin_us' value
Signed-off-by: Matt Dumm <matt.dumm@hpe.com>
Change-Id: Ib97371924e56275ba9b845725d1d42682fd0f94a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8163
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-14 09:15:20 +00:00
Matt Dumm
5288c4df83 nvme: separate admin timeout vs. io timeout
Signed-off-by: Matt Dumm <matt.dumm@hpe.com>
Change-Id: Ia1f105fdf154aae034ccfca2f0dc3b4c43c9fc84
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8072
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-07-14 09:15:20 +00:00
Karol Latecki
a6e45885a0 doc: add entry for 21.04 NVMe Bdev performance report
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I54093bef0fc34947dce161bacee7a75721ff937f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8712
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-14 09:12:15 +00:00
Ziye Yang
e5d5b3ebef idxd/rpc: Revise the rpc function to use kernel or user driver
This patch is used to add the support for users to configure
use kernel or userspace idxd library.

Change-Id: Ie159b897bc9595894ad8f333168efaea6c2a3d78
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7332
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 17:22:30 +00:00
Ziye Yang
2ed914f8ea idxd: Add the kernel idxd support
This patch is used to add the kernel idxd support.

Without this patch, we can use userspace idxd driver
under accel_engine library (module/accel/idxd/accel_engine).
With this patch, we can also kernel idxd driver under the
accel_engine library.

Our approach is implementing a wrapper library to use IDXD
device by leveraging the kernel DSA driver in SPDK idxd library
(lib/idxd).

Then users can leverage the RPC later to configure how to
use the DSA device by user space driver or kernel driver.

In this patch, our approach is to use the idxd-config library
to export the WQs (Working Queues) exported by the kernel.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I3a25a4fe0327bd626bf6883dfbe54437d3209e51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7331
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-07-13 17:22:30 +00:00
Changpeng Liu
870a606960 nvme: map PRP and SGL lists RO
There is no need to map the PRP/SGL list RW since this memory is never written
to. In fact, SeaBIOS might submit a request where the PRP list resides on
read-only memory, so attempting to map it RW can break things.

Change-Id: I7e4e90b1fa7e33e81b8d5cd8dcb9568c038938ec
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7288
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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-13 16:53:42 +00:00
Changpeng Liu
1b28efb510 UT/nvmf/vfio-user: restore nvme_cmd_map UT in nvmf/vfio-user
Change-Id: Ibce4d8921e2d33c8120ee3de8e7654f6676fe2fc
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8575
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-13 16:53:42 +00:00
Changpeng Liu
695425c776 nvme: move spdk_nvme_map_cmd to nvmf/vfio-user
Nvmf/vfio-user uses this API to map NVMe command sent from
VM from Guest Physical Address to Host Virtual Address, so
now we moved this API from the nvme library to nvmf/vfio-user
as an internal API.

UT code will be added back in coming patch.

Change-Id: I54817fc9811ccd9ddd97b3aa6762a2fce4bbdda6
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8574
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-13 16:53:42 +00:00
Ziye Yang
467f16bf7d uring: Use low level list ops to improve the performance when reorder the list.
This patch is used to improve the performance when
we need to reorder the list.

PS: Bring the similar operations from posix implementation.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I7031b35ddb597730ee160690e8ab9caf9b2b64b7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8675
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>
2021-07-13 09:08:15 +00:00
GangCao
bd4aec1cd5 nvmf: add an assert for the obtained sgroup
Change-Id: Ie00137083143722e9df50fa5a8e4d37000dfe29c
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8739
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.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-07-13 09:07:39 +00:00
Maciej Szwed
599303624e nvme: Fix remove event processing bug
This patch fixes bug introduced by this patch:
59237d22b8

lib/nvme/nvme_pcie.c:
ctrlr->remove_cb(ctrlr->cb_ctx, ctrlr) (line 147) -> ctrlr->remove_cb(cb_ctx, ctrlr) (line 123)

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I84c56aa7480fd597287f4935a583983eb96bc422
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8705
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>
2021-07-13 09:07:23 +00:00
Ziye Yang
13eb8f2fb3 idxd: Replace the read_8 function pointer with another one
Just remove this function pointer and add a new one,i.e.,
dump_sw_error.

Because this function pointer is only used to
read a sw err info. We can hide it in the detailed
idxd implemenation.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I42fe2220dae85df307b5af64e37acfd7f748915b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8707
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-07-13 09:06:15 +00:00
ChengqiangMeng
2f5abdb7fd unittest/nvmf: test for nvmf_rdma_update_ibv_state
test nvmf_rdma_update_ibv_state of nvmf/rdma.c

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: Ia9c172f799577eddd7a5949ee3d51d1a682d76f8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8724
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: <dongx.yi@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-07-13 09:01:14 +00:00
Pawel Piatek
2f0fdf0e48 scripts/nvmf_perf: support for arguments
Support for command line arguments.
This commit will add following ones:
* Configuration file
* Results directory
* CSV results filename
* Usage

Signed-off-by: Pawel Piatek <pawelx.piatek@intel.com>
Change-Id: I7166c792661b2fc7ed3b5547f2c3b8faad4e86b8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8594
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-13 09:00:24 +00:00
Pawel Piatek
99465fbd3a scripts/nvmf_perf: remove unused variables
Fix some of pylint W0612 and W0613 findings.

Signed-off-by: Pawel Piatek <pawelx.piatek@intel.com>
Change-Id: I34e72bf1e07787689025756c6ddf429711cd250b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8593
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2021-07-13 09:00:24 +00:00
Michal Berger
ca0339d8e5 nvme_cuse: Return ENOTTY in case unsupported ioctl is sent to a device
Latest nvme-cli (>= 1.13) fails to issue commands towards SPDK's cuse
ctrl device, e.g.:

$ nvme get-feature /dev/spdk/nvme0 -f 1 -s 1 -l 100
nvme_cuse.c: 654:cuse_ctrlr_ioctl: *ERROR*: Unsupported IOCTL 0x4E40.
get-namespace-id: Invalid argument

The reason is because nvme-cli now also sends NVME_IOCTL_ID to the
target device to determine if it's indeed a controller or a ns. In
case kernel returns ENOTTY then nvme-cli considers the device to be
a controller. Since cuse_ctrlr_ioctl() returns EINVAL in such a case
the nvme-cli fails.

To avoid this simply replace EINVAL with ENOTTY for the ioctls that
may be not supported by ctrl or ns device.

nvme-cli commit in question:
fa2b91da74

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I29003864bc2a5c1a8906d6d01beba3d6f4e31b0e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8531
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-13 09:00:05 +00:00
Michal Berger
aa303d87aa pkgdep/git: Disable array-bounds error while building qemu
gcc 11 started to complain about this condition. Ignore it.

Spotted under fedora34.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I472e5e88a30feaacc7ea96d5787544f49eaceb16
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8530
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-13 09:00:05 +00:00
Ziye Yang
9a0bd78b43 interrupt_tgt: Fix the interrupt mode usage issue.
When the application is not set with the interrupt mode,
we should fail the rpc.

Fixes issue #2023

Change-Id: I4157f220948b7c96f474682c41ac9d78977b1c40
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8676
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
2021-07-13 08:59:41 +00:00
Krishna Kanth Reddy
78ecd30d8e Fix Rocksdb db_bench build's Linker issue.
Linker throws undefined references to spdk_app_start, spdk_app_stop,
spdk_app_start_shutdown, spdk_app_fini, spdk_event_allocate,
spdk_app_opts_init and spdk_event_call.

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I05da1b9d94ac40127b4f0e80d8a8e406f279d3bb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8677
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: Changpeng Liu <changpeng.liu@intel.com>
2021-07-13 08:59:24 +00:00
Nick Connolly
e7da88dd66 app/trace: Use PRIu64 for portability
POSIX defines PRId64/PRIu64/PRIx64 for printing 64-bit values in a
portable way. Replace a reference to %lu to remove the assumption
about the size of a long.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I5696bcdb3add3d8b9d5ea91d9bc50b1dad1fbc95
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8685
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@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 08:59:08 +00:00
yidong0635
673afb3074 identify: Fix truncation warning of GCC11.
Fixes issue: #2031.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I67055ad5a42f16f3f927b15cfa8fd4ead2ca8813
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8697
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.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-07-13 08:59:00 +00:00
Krishna Kanth Reddy
3a2aa71ee2 ARM64: Cross-Compilation Support
Undefined references to the ncurses library APIs
_nc_panelhook_sp, getmouse, ungetmouse, copywin etc. while
cross-compiling with aarch64-none-linux-gnu/10.2.1 compiler.

Hence putting the libraries in the right link order.

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: If019744cf6b7bf79c072de57232bcf412d919a2b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8701
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-07-13 08:58:42 +00:00
wanghailiangx
7b9bd8ac2f rpc: update a method create_pmem_pool
The RPC method create_pmem_pool has been changed to bdev_pmem_create_pool.

Change-Id: I8ad1fb98d8e03240a4d982e04e9270cf90e198fc
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8708
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-07-13 08:58:21 +00:00
Ben Walker
e1d06d9954 net: Remove library
Now that we've deprecated the RPCs for a release, we can remove the whole
library.

Change-Id: I0f1a357fcfb3404efac39aa021928841c2f22ff1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4305
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-13 08:57:58 +00:00
Shuhei Matsumoto
1be049b7d4 bdev/nvme: Move up definition of struct nvme_async_probe_ctx in a file
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iac315c3484c23b7e8b9a812d728a15bf1c82dbb7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8591
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
07c2b34ab6 bdev/nvme: Register completion function as a generic callback for reset
bdev_nvme_reset() will be used by JSON RPC and we will have to call
the callback to JSON RPC at bdev_nvme_reset_complete(). To do it
easily, register the current completion function for nvme_bdev_io
in bdev_nvme_reset_complete() into nvme_ctrlr as a generic callback.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie59551dc343215a95bfa5b22f234fc153c9db1b5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8589
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
f1c141fcc8 bdev/nvme: Get ctrlr via io_channel_iter_get_io_device() at reset process
nvme_ctrlr will be registered as io_device even when multipath is
supported. Hence while spdk_for_each_channel() is executed in reset
processing, we can get nvme_ctrlr both spdk_io_channel_iter_get_ctx()
and spdk_io_channel_iter_get_io_device(). This duplication is not
necessary. Use spdk_io_channel_iter_get_io_device() and pass NULL
to the context parameter of spdk_for_each_channel() for clarification.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifdbd0af4274081c4be7ab0735eb8bf9ae10e3493
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8588
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
3a243b7f38 bdev/nvme: Inline bdev_nvme_reset_io_complete() into bdev_nvme_reset_complete()
The current nvme_ctrlr will be registered as io_device even when
multipath is supported. Then we do not have to differentiate completion
processing between reset from bdev_io and internal reset. Hence
inline bdev_nvme_reset_io_complete() into bdev_nvme_reset_complete().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ife2c4c93d423da3953174ac860485a6e095a28bd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8587
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
c213f1b452 bdev/nvme: Revert reset_io to bring nvme_bdev_io as context
When we support multipath, reset_io will hold the controller currently
being reset to reset all underlying controllers sequentially.

bdev_nvme_submit_request() basically passes nvme_bdev_io to each I/O
type, and we have a convenient helper function bdev_nvme_io_complete()
which has nvme_bdev_io as a parametetr.

So revert the previous change to bring nvme_bdev_io as context
for reset processing.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I19697e8252505bab519a42889d1a88d967932f22
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8586
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
07df4b0141 bdev/nvme: Rename bdev_nvme_reset() by bdev_nvme_reset_io()
Reset requests from the upper layer will reset the underlying
ctrlrs of a bdev ctrlr but internal reset requests will reset only
the specified ctrlr.

To clarify such difference, rename bdev_nvme_reset() by
bdev_nvme_reset_io() and remove the underscore prefix from
_bdev_nvme_reset() and related functions.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9a2d124f6e2039bfecfdd6599827354d6c373f2e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8492
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
82739d12e5 ut/bdev_nvme: Factor out allocating bdev_io into a helper function
This will reduce the size of the following patches and improve the
readability.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2ff5a10622141466d6a0352b2a6387b1412cfbf8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8641
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>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
39fdbc95f2 ut/bdev_nvme: Use bdev_nvme_submit_request() for test_pending_reset() case
Create an nvme_bdev by adding namespace to an attached controller,
and use bdev_nvme_submit_request() in the test case test_pending_reset().

This will reduce the size of the following patches and will increase
the test coverage.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifb05952a53949e12562e9be3f6526b0f8ad57696
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8640
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>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
03332379f0 bdev/nvme: Hold mutex while traversing global ctrlr list
nvme_bdev_first_ctrlr() and nvme_bdev_next_ctrlr() were not possible
to hold mutex correctly, and nvme_ctrlr_get() and nvme_ctrlr_get_by_name()
had not held mutex.

nvme_bdev_first_ctrlr() and nvme_bdev_next_ctrlr() were replaced by
nvme_ctrlr_for_each() in the last patch.

In this patch, add mutex to three helper functions, nvme_ctrlr_get(),
nvme_ctrlr_get_by_name(), and nvme_ctrlr_for_each().

Add mutex to nvme_ctrlr_create() but it will be removed in the
following patches because nvme_ctrlr will be added to not global
ctrlr list but ctrlr list per nvme_bdev_ctrlr.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ife27066d2dcac82db0616b0afeaf68e5705d7da1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8722
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
ca4dfff9e1 bdev/nvme: Replace nvme_bdev_first/next_ctrlr() by nvme_ctrlr_for_each()
Replace two helper functions, nvme_bdev_first_ctrlr() and
nvme_bdev_next_ctrlr() by an new helper function nvme_ctrlr_for_each().

This will make us easier to guard data structure correctly in the
following patches.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibd81286e454fd6127fd150a7d48d8381bd1b89d3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8721
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
4af68eade6 bdev/nvme: Rename nvme_bdev_poll_group by nvme_poll_group
This object aggregates multiple I/O qpairs for their completion
operations and may be a higher layer object. However, the
aggregation is only to poll completions efficiently. Hence if we
follow the new naming rule, nvme_poll_group is better than
nvme_ctrlr_poll_group and nvme_bdev_poll_group, and rename
nvme_bdev_poll_group by nvme_poll_group.

Besides, many functions in NVMe bdev module have a naming rule,
  bdev_nvme + verb + objective
Follow this rule for a few functions related with nvme_poll_group.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5e5cb6001d4a862c2121b7265cbbffe0c2109785
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8720
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
a3dcdc051f bdev/nvme: Rename nvme_bdev_ctrlr by nvme_ctrlr
This object is per I/O path and will be aggregated by an new upper
layer object.

Hence rename nvme_bdev_ctrlr by nvme_ctrlr. Then the following patches
will add nvme_bdev_ctrlr as a different upper layer object.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ieed634447785cc98140b3d49c52a2c753988ece7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8381
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-07-13 08:57:33 +00:00
Shuhei Matsumoto
9e65d3bb35 bdev/nvme: Rename nvme_bdev_ctrlr_trid by nvme_ctrlr_trid
This object is used for failover and per I/O path. A controller may
have multiple of this object. A controller is per path and may be
aggregated by an new object. Hence this object is a lower layer
object.

Based on the new naming rule, rename nvme_bdev_ctrlr_trid by
nvme_ctrlr_trid.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0d5e5812560a6947a0c25af05dea168e8745130e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8380
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
c4626aa486 bdev/nvme: Rename nvme_bdev_ns by nvme_ns
This object will be aggregated by the upper layer object nvme_bdev.
Hence based on the new naming rule, rename nvme_bdev_ns by nvme_ns.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I96a70213b29fb53437acd080a0787ec9f5a6759a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8379
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
c710c9acbe bdev/nvme: Rename nvme_io_path by nvme_ctrlr_channel
We will name the lower level objects starting with nvme_* and the
upper level objects starting with nvme_bdev_*.

This object is a channel per ctrlr and another new channel will be
added on top of this object.

Rename nvme_io_path by nvme_ctrlr_channel based on the new naming rule.

nvme_io_path will be used for a new object which is used to find an
optimal I/O path and to reset multiple ctrlrs sequentially when
multipath is supported.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1d4fa6d4625de3413d629a1ff412e00de12dfaf4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8378
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 08:57:33 +00:00
Shuhei Matsumoto
efbd101b8b nvme: Rename cmic.multi_host by cmic.multi_ctrlr of spdk_nvme_ctrlr_data
Bit 1 in the CMIC of the Identify Controller Data Structure specifies
if the NVM subsystem may have multiple controllers or not.

However, multi_host indicated a particular use case such that the NVM
subsystem is used by multiple hosts.

multi_ctrlr will be more appropriate.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0246096a5cc44721aeff3ff6f96473a2abe11964
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8719
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-07-13 08:57:33 +00:00
Tomasz Zawadzki
798ad0fb16 test/scheduler: reorder checks in interrupt test for debugging
Related to #1950
In the issue, CPU idle time measured from /proc/stats make it
seem like no reactor goes idle.

If true, then it would help for debugging to check stats from reactors.
Their busy/idle time and number of threads on them.

This patch reorders the checks in interrupt test,
to first show reactor stats, then confirm with idle time from
/proc/stats.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ia1770833828ef688110473e45ed5998d213059f3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8223
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-12 21:58:56 +00:00
Tomasz Zawadzki
57a2f03eb6 lib/app: only print cpumask for thread within app core mask
For cases where cpumask for a thread was not set,
all bits were turned on for whole length of cpuset structure.

This resulted in JSON RPC reponses with way too long cpumask
for what is useful.

Now the response is limited to the applications core mask,
as that makes sense so long as number of cores cannot change.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib5cf271d3b219ba679f1abe498516796693a87dd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8288
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-07-12 21:58:56 +00:00
Tomasz Zawadzki
fe2f80961c scheduler_dynamic: start core selection from first core
The round-robin logic is no longer necessary to spread
the threads around the cores. Starting from core other
than first is even counter-productive to bunching up
threads.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5fcee2bacc2d0b4af26336caf381ed954814d731
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8085
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-12 21:58:56 +00:00
Tomasz Zawadzki
a5999f637a scheduler_dynamic: prioritize lowest lcore id for active threads
Before this patch _find_optimal_core() returned
1) any core that could fit the thread
2) if current core was over the limit, the least busy core
3) current core if no better candidate was found

Combined with _get_next_target_core() round-robining
the first core to consider, resulted in threads being
unnecessarily spread over the cores.

This patch only places threads on lower lcore id,
or when current core is over limit then any core that can fit it.

Next patch will remove round-robin logic to always start with
lowest lcore id.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I54e373d3ca02a5633607d22978305baa1142f8bd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8112
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: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-07-12 21:58:56 +00:00
Tomasz Zawadzki
d2ed0f45e7 scheduler_dynamic: scale up core load when moving thread
Before this patch the idle time of a core was increased
by the amount of busy time of thread that was moved out.
No assumption was made as to how the remaining threads,
would behave during next scheduling period.

This approach is fine, as over multiple scheduling periods
we'd arrive at a point where threads could do no more work
or all cores would be busy.

Yet this requires multiple scheduling periods to sort out
the threads.
Later in the series core_load will be used to determine,
when to start moving threads out of the core. So changing
this assumption will allow for faster responses to thread load,
at cost of sometimes spreading threads too much briefly.

With this patch, we are assuming that threads remaining
on the core will do proportionally the same amount of work
during next scheduling period.

See an example illustrating the change:

Before moving Thread1
Thread1	Busy 80		Idle 20		Load 80%
Thread2	Busy 60		Idle 40		Load 60%
Core	Busy 140	Idle 60		Load 70%

After moving Thread1 out (original code)
Core	Busy 140-80=60	Idle 60+80=140	Load 30%

After moving Thread1 out (this patch)
Core	Busy 140-80=60	Idle 60-20=40	Load 60%

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1f347983449b2fde476dab360c4df689965ca3ea
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8279
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: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-07-12 21:58:56 +00:00
Maciej Szwed
97c5373fc7 test/scheduler: make activity of a thread % of time period
So far the test application was mostly used for cases with
single active thread on a core.
Setting activity as percentage of all poller operations worked
fine for those cases.

This patch changes the thread activity to mean percentage of
a set time period.
Which equals to the maximum load a thread will see when being
alone on the core.

Right now g_core_time_period is set to 100ms, and is the
maximum execution time for all threads on a core when
thread activity is set to 100%.
g_timeslice is set to 100us and is the execution time of
single thread poll.

Consider following scenario:

Before the patch
Thread1	Activity 70%	Busy 70		Idle 30	Load 70%
Thread2	Activity 60%	Busy 60		Idle 40	Load 60%
Core			Busy 130	Idle 70	Load 65%

After the patch
Thread1	Activity 70%	Busy 100	Idle 0	Load 100%
Thread2	Activity 60%	Busy 100	Idle 0	Load 100%
Core			Busy 200	Idle 0	Load 100%

Additionally increased period of sleeping from 1us to 100us,
to offset the time needed for additional operations
during thread poll.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I027432db1bea570dd58829eeccf7dd8bb06bf249
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7474
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-12 21:58:56 +00:00
Tomasz Zawadzki
11c9b3960b scheduler_dynamic: move thread to least busy core
In cases when all cores are already doing too much work
to fit a thread, active threads should still be balanced
over all cores.

When current core is overloaded, place the thread
on another that is less busy.

The core limit is set to 95% to catch only ones that are
fully busy.
Decreasing that value would make spreading out the threads
move aggressive.

Changed thread load in one of the unit tests to reflect the
95% limit.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3b3bc5f7fbd22725441fa811d61446950000cc46
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8113
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: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-12 21:58:56 +00:00
Shuhei Matsumoto
cf8405fc24 bdev: Hold mutex while removing name from name tree
We had not held mutex while removing bdev name or alias from bdev
name tree for most cases. Fix these in this patch.

spdk_bdev_unregister() already holds g_bdev_mgr.mutex when removing
name, and so we do not need to change it.

spdk_bdev_close() had not held g_bdev_mgr.mutex. What we want to lock
is only when removing name from name tree, that is, calling
bdev_name_del() in bdev_unregister_unsafe(). However, we need to
keep hierarchical lock ordering. Hence get and free g_bdev_mgr.mutex
outside of bdev->internal.mutex.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4e2c8604e27c8603725efa9bc0bee2013eccb2ac
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8527
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-07-12 15:30:39 +00:00
Shuhei Matsumoto
d06f1c498f bdev: Hold mutex when adding bdev name to global bdev name tree
We had not held mutex when adding bdev name to global bdev name tree
in bdev_name_add(). Fix these in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I33813638f11da85263ec0c8849e566d247a45d43
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8524
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-12 15:30:39 +00:00
Shuhei Matsumoto
20ba4a0dbe bdev: bdev_name_add() checks if the name exists in the global name tree
If the specified name already exists in the global bdev name tree,
RB_INSERT() returns a pointer to it. Hence we do not have to call
bdev_get_by_name() when using bdev_name_add().

Hence update bdev_name_add() to return -EEXIST if RB_INSERT() returns
a non-NULL pointer, and then remove the bdev_get_by_name() calls.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2d4554ef7e5286270417def64b638b803eecfca2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8573
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: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-12 15:30:39 +00:00
Ziye Yang
36b5a69bb0 trace: fix the snprintf warning issue.
The complier complains:

/usr/include/bits/stdio2.h:71:10: note: ‘__builtin___snprintf_chk’
output between 4 and 19 bytes into a destination of size 7
71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,

So we change the array size from 7 to 20, so it is enough to put 19 bytes
in.

Fixes #issue 2014

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I97dfbf9707d0e275382324fa7352b7a212b2aeb5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8694
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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-07-12 14:06:43 +00:00
Michal Berger
6317642ce6 rpmbuild: Handle bare --with-dpdk argument
This is done in order to detect if user wants to build spdk RPMs
against DPDK RPMs that might have been installed on the system.

This boils down to the following:

 - if --with-dpdk, with no argument, is detected don't build
   separate RPM holding DPDK libs since user in this case is
   most likely interested only in packaging the SPDK so it
   can coexist with separate DPDK packaging workflow
 - define install and build requirements for the SPDK RPMs
   to depend on dpdk-devel RPM

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I4dd587009da282a114524c74d833fd35ebc5b985
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8349
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-12 14:05:20 +00:00
Michal Berger
68b6d0ef54 test/openstack: Enable securitygroup driver in neutron
This seems to be needed for devstack pieced together out of the
current master branch (wallaby seems to work fine as is).

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I5abf22a606c84c120e42819a5450ba82d1bc52b5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8490
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-09 19:19:48 +00:00
Michal Berger
8770e80bda scripts/rpc_http_proxy: Print to stdout POSTed json rpc calls and responses
It's useful to determine what's being sent out to the server. This
may be relevant for e.g. openstack tests where currently it's hard
to see what tempest|cinder is actually doing, SPDK-wise, during the
tests.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ie32781621317dd65e3f6fbcfd5110e7dac337f04
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8489
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-09 19:19:48 +00:00
Ziye Yang
cd1261ae00 trace: fix compiler complain on two variables
In the nightly test, the compiler complains:

trace.c: In function ‘_spdk_trace_record’:
00:07:12.523  trace.c:144:53: error: ‘argval’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
00:07:12.523       memcpy(&buffer->data[offset], (uint8_t *)argval + argoff,
00:07:12.523                                                       ^
00:07:12.523  trace.c:145:36: error: ‘arglen’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
00:07:12.523              spdk_min(curlen, arglen - argoff));

And this patch is provided to fix such issue.

Fixes #issue 2034

Change-Id: I4c78d63bdc6a7d166990ae1d18a6abf183efdee1
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8709
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Chengqiang Meng <chengqiangx.meng@intel.com>
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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-09 19:19:24 +00:00
Konrad Sztyber
4ee3f1bccf usdt: don't emit probes in unit tests
There is no point in producing USDT probes in unit tests and it breaks
the build on some systems:

ctrlr_discovery_ut.o(.note.stapsdt+0x14): error: relocation refers to local symbol "" [102], which is defined in a discarded section
ctrlr_discovery_ut.o(.note.stapsdt+0x90): error: relocation refers to local symbol "" [108], which is defined in a discarded section
ctrlr_discovery_ut.o(.note.stapsdt+0xf8): error: relocation refers to local symbol "" [110], which is defined in a discarded section
ctrlr_discovery_ut.o(.note.stapsdt+0x15c): error: relocation refers to local symbol "" [112], which is defined in a discarded section

Fixes issue #2027.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic6dad60df1f7dccb7f99777ebc4435c618cb505a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8699
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: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-09 07:02:28 +00:00
Jacek Kalwas
03ac99d13f nvmf: set NGUID for given namespace based on bdev UUID
If NGUID is not specified with nvmf_subsystem_add_ns json-rpc request
then it is possible to expose the same NGUID as bdev nvme module
attached.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Ie0ed7189e55a5abd6bc0904fc356d26f62b50549
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8628
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-09 07:02:11 +00:00
Jacek Kalwas
1f433c4c32 bdev/nvme: prefer NGUID over UUID if supported
NVMe specification defines namespace identification descriptors i.e.
EUI64, NGUID, UUID.

BDEV abstracts NVMe specific details that is why only UUID is exposed,
however if NGUID is supported it is prefered to identify namespace
with NGUID over UUID.

If NGUID is not supported by NVMe Controller then fallback to UUID.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: If51889a3664c0daa7cbe983048231793e3c502e0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8627
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-09 07:02:11 +00:00
Jacek Kalwas
a410fb4438 nvme: introduce function to get nguid
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Ida07eca2e3cbc390d8ee481f63b20f5715a53631
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8626
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-07-09 07:02:11 +00:00
Konrad Sztyber
b8b1f19222 lib/trace: reduce trace entry size to 32B
Now that multiple trace entries can be chained together to form a larger
argument buffer, we can reduce the size of a single entry back to 32
bytes, while still allowing the user to pass multiple parameters.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic92a1413498df28a8561a13c0f06d895d0af2cc6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8407
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-07 09:43:37 +00:00
Konrad Sztyber
2731216dca app/trace: print arguments from chained entries
The trace app has been extended to parse chained entries when printing
arguments that exceed the size of a single trace entry.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib9705fd08da998bea39f14eaa83305a8e9d0d5a8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8406
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-07-07 09:43:37 +00:00
Konrad Sztyber
6cc3169677 lib/trace: chain entries to extend their buffer size
This patch adds the ability to chain multiple trace entries together to
extend the size of the argument buffer.  This means that a tracepoint is
no longer limited to the size of a single entry, so it can have any
number of arguments, and their size is also not constrained to a single
entry.

Some limitations are still there: a tracepoint can have up to 5
arguments and strings are limited to 255 bytes.  These constraints stem
from the definitions of tracepoint structures, which could be easily
modified to extend the limits if needed.

To record a tracepoint requiring larger buffer, aside from reserving
`spdk_trace_entry` structure, a series of `spdk_trace_entry_buffer`
structures are allocated too.  Each of them acts as a buffer for the
arguments.  To allow trace tools to treat the buffer structures
similarly to regular entries, they also have the `tpoint_id` and `tsc`
fields.  The id is always assigned to `SPDK_TRACE_MAX_TPOINT_ID` to make
sure that a buffer is never mistaken for an entry, while the value of
`tsc` is always shared with the initial entry.  This also provides a way
for the trace tools to verify if an entry is part of a chained buffer.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I51ceea6b6e57df95d4b8bd797f04edbc4936c180
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8405
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-07 09:43:37 +00:00
Konrad Sztyber
0cf270910a lib/trace: add argument variable in _spdk_trace_record
It makes the code more readable.  Additionally, to avoid partial updates
to an entry, the check for the number of arguments was moved before it's
filled in.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I9ba01b1bcdc29267571badaebd4a9b34ffd7f728
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8404
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-07-07 09:43:37 +00:00
Konrad Sztyber
c681d76fb4 lib/trace: extract getting next entry to a helper function
It allows us to get rid of the `next_circual_entry` variable and will
make it easier to retrieve multiple trace entries, which will be needed
in subsequent patches.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I4666c9da518c2ac0b376e10aa73d1c58cff91f13
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8403
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2021-07-07 09:43:37 +00:00
Konrad Sztyber
597688b2b1 scripts/trace: use ijson to parse the traces
Since the trace files can get very large (several GBs), parsing them
using python's json module might require an unfeasible amount of memory,
as it needs to load the whole file first.  The ijson [1] library
provides interfaces for parsing files iteratively, only loading a small
portion of a file at a time.

It requires the input JSON to have the tsc_rate and the definitions of
the tracepoints listed before the tracepoint entries.  It's not a big
deal, as this is the way `spdk_trace` generates it, but it's worth
noting, as passing that file through something like `jq -S` might make
it unreadable to the trace script.

[1] https://pypi.org/project/ijson

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I03c0c3fb47091da615a3978b8d63edf4d876b811
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8275
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
2021-07-07 09:43:37 +00:00
Konrad Sztyber
e61fbe91e7 scripts/trace: qpair annotations
This patch adds support for annotating qpairs.  The raw pointer values
are replaced with a list of various properties of a qpair collected by
the bpftrace script.

A line like this:

`0 2856282624.000 RDMA_REQ_NEW id: r3256 qpair: 0x26ba550`

becomes (the line was only broken here):

`0 2856282502.669 RDMA_REQ_NEW id: r3256 qpair(ptr=0x26ba550, thread=2, qid=0, \
subnqn=nqn.2016-06.io.spdk:cnode1, \
hostnqn=nqn.2014-08.org.nvmexpress:uuid:729783b4ab38485d8d767b7741108a8)`

To annotate a trace, one first needs to enable and record the DTrace
probes:

```
$ scripts/bpf/trace.py --record `pidof spdk_tgt` > bpftraces
^C
```

Of course, the probe events are only recorded when the script is
executing, so in order to generate the annotations properly, it must be
started before the annotated objects are created.  For instance, for
NVMeoF, it needs to be running before a connection is made.

After the BPF probes are recored, the traces can be annotated:

```
$ build/bin/spdk_trace -p `pidof spdk_tgt` -s spdk_tgt -j | \
	scripts/bpf/trace.py -b bpftraces
```

For now, the script only annotates traces from the rdma module, as it's
the only one with tracpoints recording qpair pointers now, but it could
be extended to support more tracepoints.

Similarly, more objects could be annotated in the future by extending
the `SPDKObject` class and defining additional DTrace probe points.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2225f4b1ab266b41af561b5e7d942411cd0c13c1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8107
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-07-07 09:43:37 +00:00
Konrad Sztyber
01ae68f71d scripts/trace: parse and generate usdt bpftrace scripts
This patch introduces definitions responsible for generating bpftrace
scripts and parsing its output.  That output will be used in subsequent
patches to provide annotations for SPDK traces.

The script has a hardcoded set of probe points that are used to generate
the bpftrace script.  They're also checked against the probes present in
code to sanitize them and make sure that they're in sync.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I1b8c95e1a035bd7affed2c44b056828a5da94abd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8106
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-07-07 09:43:37 +00:00
Jim Harris
109af0bcb3 bdev/nvme: don't check spdk_nvme_ctrlr_free_io_qpair return
spdk_nvme_ctrlr_free_io_qpair now always returns 0, so
update the code to account for that.

Fixes issue #2012.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I61c78459472573adbfeb28052ae3379d7880567c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8660
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-07 07:27:40 +00:00
Jim Harris
4246e79c04 nvme: change nvme_transport_ctrlr_delete_io_qpair to void
Returning an error from this function is not useful - there
is nothing the caller can do with that information. So
change the return value to void.  Also add ERRLOG and assert
if a transport actually returns a non-zero status, to
force the transport implementer (which must be an out-of-tree
transport) to make changes as necessary.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I402afec045265db178af821d25b99a6dbe066eab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8659
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-07 07:27:40 +00:00
Jim Harris
c081a84cd2 nvme: always return success from delete_io_qpair
It is not uncommon for delete_io_qpair to fail, for
example when a controller is hot removed.  So even
if SQ or CQ deletion fails, continue with freeing
resources and report success back up the stack.
There is really nothing the application can do to
account for this failing anyways.

Upcoming patches will add additional checks to
ensure failing delete_io_qpair status never gets
propagated to the caller.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iac007c1eba30f7a8c4936b3ffb6c837f28ee12ae
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8658
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-07 07:27:40 +00:00
Konrad Sztyber
2ac1521581 test/compress: fix Wstringop-overflow warnings
Fixed warnings produced by gcc-11:

compress_ut.c: In function ‘test_compress_operation’:
compress_ut.c:726:9: warning: ‘_get_mbuf_array’ accessing 32 bytes in a region of size 24 [-Wstringop-overflow=]
  726 |         _get_mbuf_array(exp_src_mbuf, &g_expected_src_mbufs[0], SPDK_COUNTOF(exp_src_mbuf), false);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compress_ut.c:726:9: note: referencing argument 1 of type ‘struct rte_mbuf **’
compress_ut.c:430:1: note: in a call to function ‘_get_mbuf_array’
  430 | _get_mbuf_array(struct rte_mbuf *mbuf_array[UT_MBUFS_PER_OP_BOUND_TEST],
      | ^~~~~~~~~~~~~~~

Fixes issue #2013.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I04d0182169e61e87401f93f56993168d7aa42e43
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8692
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: Ziye Yang <ziye.yang@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-07 07:27:01 +00:00
Shuhei Matsumoto
ce60606dbc iscsi: Fix data digest degradation by restoring the original code
Due to the recent changes for non block size multiples write I/O,
the data digest feature was degraded. If Linux iSCSI host enables
data digest and tries to detect LU from SPDK iSCSI target, data
mismatch error is detected and the connection is disconnected
unexpectedly.

The cause was that pdu->data_valid_bytes was not set for non-write
response PDUs which have a data segment.

iscsi_pdu_calc_data_digest() has been used only for non-write response
PDUs. Hence we did not need to change iscsi_pdu_calc_data_digest().

Restore the original implementation of iscsi_pdu_calc_data_digest().

Additionally, to avoid future degradation, rename the related
functions to iscsi_pdu_calc_partial_data_digest() and
iscsi_pdu_calc_partial_data_digest_done(), and add comments for
clarification.

This fix was verified by the reporter.

Fixes #2029.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6babcd1b56e79d3fa3cd26b2dfaad87a52788e63
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8635
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
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: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-07 07:26:23 +00:00
Michal Berger
c6db5f41e5 autotest: Don't run spdk_dd tests under crypto job
Currently, crypto job also executes tests from the SPDK_TEST_BLOCKDEV
suite, including spdk_dd tests. The dd tests under a bare-metal system
can take up to 4 minutes alone and that brings the crypto job to the
very edge of timing out.

Since these tests are extensively covered under separate vg jobs we
won't lose any coverage by excluding them from crypto's - the basic
set of SPDK_TEST_BLOCKDEV tests would still remain as part of this
job.

Fixes: #2017

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I877e63de1e43aeb06c134fdacd6f5efbbe2a6317
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8545
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2021-07-07 07:26:13 +00:00
Vasuki Manikarnike
a82e8478ea lib/nvme: Do not retry aborts if ctrlr is failed.
Fixes #2022

If queued aborts are present when trying to fail a ctrlr
using spdk_nvme_ctrlr_fail(), then the abort command completion
will attempt to retry one of the queued aborts.
This eventually leads to a segfault that can be avoided by not
retrying any queued aborts.

Change-Id: I897dcb8809e16af8bdd39d4381ab531e1cc29822
Signed-off-by: Vasuki Manikarnike <vasuki.manikarnike@hpe.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8585
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-06 19:44:59 +00:00
Changpeng Liu
e6464f32fa nvmf: abort AERs when doing controller reset and shutdown
The vfio-user target emulated NVMe device is treated as
PCIe NVMe SSD in the Guest VM, so when doing controller
reset or shutdown, we should abort the AERs which in the
NVMf library.

Users may switch kernel NVMe driver to SPDK NVMe driver
in the VM, without this fix, we will got "AERL exceeded"
response very frequently, because the AERs submitted by
previous driver will never be aborted in runtime.

Change-Id: I0222ed509629ccb0e98217414dd9043857105686
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8558
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>
2021-07-06 19:36:04 +00:00
Changpeng Liu
4fa3d99131 nvmf: don't start the association timer poller for vfio-user
When users remove kernel NVMe driver in the VM, after 120 seconds,
SPDK NVMf target will disconnect ADMIN queue pair due to association
timer timeout, and for vfio-user transport, the ADMIN queue pair
connection is associated with the socket connection, so when probing
the NVMe controller again, because there is no active ADMIN connection
for fabric register R/W commands, it will cause segment fault.

Here we set the association timeout value to 0 for vfio-user transport,
so that the ADMIN connection will not be disconnected when shutdown the
controller, the ADMIN queue pair will be disconnected when the socket
connection breaks.

Change-Id: I3613169229bae384405889653e50f581d30d7c07
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8557
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>
2021-07-06 19:36:04 +00:00
Changpeng Liu
d5102d37b3 nvmf/vfio-user: process NVMe response cdw0 correctly
The NVMf library will set cdw0 based on specific command,
so we use it directly in vfio-user, otherwise, some NVMe
commands such as AER can't work.

Fix issue #2016.

Change-Id: Ie1a80a92c0856b61822ee51ce5d8faaaf1d463de
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8556
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
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
2021-07-06 19:36:04 +00:00
Changpeng Liu
e34ad3e2c5 nvmf/vfio-user: add two debug logs
Also fix one incorrect print log.

Change-Id: I3254baf4bbff4acfc0ef43f628d025931e8589ea
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8555
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
2021-07-06 19:36:04 +00:00
Changpeng Liu
2ccb76c30a nvmf/vfio-user: remove unnecessary macros
These macros are only valid for Fabric transports.

Change-Id: Ia456eebdcdab28e81226c1b3a7211fcb41b5e481
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8554
Community-CI: Mellanox Build Bot
Reviewed-by: John Levon <levon@movementarian.org>
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>
2021-07-06 19:36:04 +00:00
Changpeng Liu
c138dfd3c0 nvmf/vfio-user: don't allocate internal data buffers for vfio-user target
Change-Id: I75f1f1a493a480aadbc233b4583616886559565c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8474
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>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
2021-07-06 19:36:04 +00:00
Shuhei Matsumoto
563f69ebe8 bdev: spdk_bdev_get_by_name() hold mutex itself while traversing bdev name tree
spdk_bdev_register() and spdk_bdev_add_alias() had not held mutex when
adding bdev name or alias to global bdev name tree. This bug caused unexpected
error when traversing global bdev name tree.

The next patch will fix the bug. This patch is a preparation for the fix.

spdk_bdev_get_by_name() had not held mutex while traversing bdev
name tree. The major callers to spdk_bdev_get_by_name() had held mutex
when calling it. However, this was not clear.

Factor out the internal of spdk_bdev_get_by_name() into a helper
function bdev_get_by_name() and then change spdk_bdev_get_by_name()
to lock and unlock when calling bdev_get_by_name().

Then replace spdk_bdev_get_by_name() call in spdk_bdev_alias_add() and
bdev_register() by bdev_get_by_name() call.

spdk_bdev_get_by_name() call in spdk_bdev_examine() is not changed.
This is called only from JSON RPC and not related with the bug. So
we want to fix only unlocked access to global bdev name tree.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I25f07694e569eec10dba6c3c8543f6ce77412fe8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8523
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-07-05 14:46:30 +00:00
Shuhei Matsumoto
680388d45d bdev: Move spdk_bdev_get_by_name() up in a file
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia081edc6d04f2293296d61ec2f229f9823149bbf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8522
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-07-05 14:46:30 +00:00
Jim Harris
ac3a42b15c nvmf: retry connect commands internally when subsys not ready
It is better to not fail connect commands when a subsystem
is not ready.  The host will not be expecting that and will
typically treat it as a catastrophic failure (i.e. it won't
retry the connect).

So instead when this situation occurs, start a poller for
the connect request.  We will continue to retry processing
it until the subsystem is ready to handle it.

Fixes issue #1985.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id8835df8f0edf1e889fdd7e754e261c2a880cbb6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8571
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-05 14:45:34 +00:00
Jim Harris
65ef1f32a6 nvmf: check for null admin_qpair when updating subsystem pg
It is possible for a controller to get added to the
subsystem before its admin_qpair has been assigned.
We need to account for that when traversing the subsystem's
ctrlr list when determining ns and ana_changes that need
to be reported for the ctrlr.

Found while doing stress testing with connects and
subsystem ns add/remove.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie54dc6ac202faeaeace054e6599f2dea2f30211e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8570
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-05 14:45:34 +00:00
Jim Harris
e8e2b469ec nvme: use spdk_strerror to report CQ transport errors
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I910c5a63e1f35fa76dfb7c296361fb1af7209e6b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8569
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-05 14:45:34 +00:00
Alexey Marchuk
01bbf5d183 perf: Correct usage
Some parameters were accidentally added under
`#ifndef DEBUG`

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Idd2fd67cf7b3bcc298a290bc45b9572dcf4c0076
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8466
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-05 14:45:11 +00:00
Alexey Marchuk
885331fe16 perf: Ignore trtypes that were not requested by user
If perf is connecting to a subsystem with listeners
of different transport types (e.g. TCP and RDMA) and
the user request a specific trtype via CLI (e.g. TCP),
discovery process will call probe_cb for every transport
type. As result, probe_cb in perf will return `true`
and undesired controllers will be created and used in
IO path.

This patch adds a check for trtype and trstring to ignore
controllers that are not of a requested type.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Id87afd03c7b38edfbbfecb5ad2239fe3e9ac9f83
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8465
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-07-05 14:45:11 +00:00
Alexey Marchuk
05c7a2cc0f nvme/fabrics: Fix trid trstring populate
After correct trstring initialization, it is
overwritten with trstring value of the current
probe ctx. That leads to a problem when initiator
connects to a sbusystem with listeners of different
transport types (e.g. TCP and RDMA). If probe_ctx has
TCP type, than discovery probe initialized probe trid
with trtype=RDMA and trstring=TCP. As results, SPDK
creates TCP controller with trtype=RDMA and we hit
assert in nvme_tcp_qpair function.

Change-Id: I9355450c40c58fa55b016220703f6f7ae36b2571
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8464
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-07-05 14:45:11 +00:00
John Levon
2c34af8bff nvmf: fix nvmf_tgt_accept() return code
Pollers are supposed to return SPDK_POLLER_{BUSY,IDLE}.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I92bd184aaba9e3efb730b68a6024ebc9757ffd8b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8559
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-05 14:37:07 +00:00
wanghailiangx
585543acd8 example/blob: fix a historical notes hello_blob.conf
Now, only hello_blob.json in examples/blob/hello_world.

Change-Id: Ib2606935b2466197d958fe6ced0db201c8c3e53a
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8590
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Chengqiang Meng <chengqiangx.meng@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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-07-05 14:36:53 +00:00
Mao Jiang
741c7985fb test/nvmf/subsystem: cases for subsystem ctrlr adding and removing
Change-Id: I831192e7938a21e2a959af6b5b6d3a41fc31e26f
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8513
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-05 14:36:45 +00:00
wawryk
2e6fb86176 test/pkgdep: update nvme-cli version
Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: I0d099427ac9bddf9981ccf22363e177d58a29bd8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8518
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>
2021-07-05 14:36:34 +00:00
wawryk
8439c53b94 scripts/vagrant: add fedora34
also remove out of support fedora31

Signed-off-by: wawryk <maciejx.wawryk@intel.com>
Change-Id: I2ec224a3fb3849eb62ba46a01aa74c62926174f8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8461
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-07-05 14:36:34 +00:00
Weifeng Su
d651f8a238 nvme/nvme_cuse: Fix race condition in cuse session
If we continuous setup and teardown cuse session, It will teardown
uninitialized cuse session and cause segment fault, New function
cuse_session_create will do the session create operation and under
g_cuse_mtx to avoid this issue.

Signed-off-by: Weifeng Su <suweifeng1@huawei.com>
Change-Id: I2b32e81c0990ede00eea6d4ed3a7e44d534d4df3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8231
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-05 14:36:24 +00:00
Darek Stojaczyk
9d17c1d0fc autotest: don't drop system cache
Without hugepage allocation at runtime this is
no longer required. Additionally CI VMs now
have a lifespan of just 1 test run, so there's
no need to clear the cache anymore.

Saves us a few seconds on every run.

Change-Id: I12cb4095c37bd5d22d3b3fcbce4b5072118d3000
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2375
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: <tomasz.rochumski@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-07-05 14:36:08 +00:00
Richael Zhuang
97f8a3b964 test/scheduler: check the idle thread on the main core
check if the thread is moved to the main core after it becomes idle.

Change-Id: I3ee38ee16d755cc9dea5fa10d9f8ba42507408ff
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7853
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-07-05 14:35:58 +00:00
Michal Berger
642b89f496 check_format: Fix git-grep pattern
Use extended regexp to resolve any potential ambiguity with matching
on '('. This should fix the following failure as seen on the CI:

fatal: command line, '^SPDK_RPC_REGISTER\(': Unmatched ( or \(

Also, since errexit doesn't see failures inside the process
substitution make sure we return from the function with a proper $rc
in case git fails early on.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ia03095e9cc8cf11602dafb5bef28265abb485704
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8577
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-07-05 14:35:50 +00:00
Ziye Yang
05dc895bea sock/posix: Fix the coredump when removing the sock from socks_has_data list
When entering the if case to order the list, there is bug should be
fixed. The original code does not address this.

The way this happens is when there is a connection left in the socks_with_data list
between polls and there are enough new events detected that it would exceed the
maximal number of events. A connection is left on this list between polls if it isn't
fully drained via reads by the upper layer on each poll loop.

Currently, the maximal socket event num is 32. Then we did not hit this issue
in our normal test cases. But when you use NVMe-oF tcp target to test which is
described in #2105, there are more than 32 active sockets, and it exceeeds
the maximal num of events of polling (32), so we will trigger this issue.

Fixes issue #2015

Change-Id: I9384476fdba8826f5fe55a5d2594e3f4ed3832ba
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8541
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>
2021-07-01 19:37:38 +00:00
Ziye Yang
358b84b40f accel_perf: Fix the complier complaining.
Faced the following warnings during the compilation:

accel_perf.c:222:17: warning: ‘argval’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  222 |   g_crc32c_seed = argval;

And this patch can be used to fix this issue.

Change-Id: I84ee542d629ff5d9e6a2873c0035bea81b376150
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8538
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Chengqiang Meng <chengqiangx.meng@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: wanghailiang <hailiangx.e.wang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-07-01 15:34:18 +00:00
Mao Jiang
8c3854fdc0 test/nvme_rdma: cases for qpair submitting request
Change-Id: I16e250091bc43aca7cf25c828971d8d71978750e
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8445
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-06-30 22:56:39 +00:00
Richael Zhuang
c737130356 spdk_top: fix lcore id display error in CORES tab
when running spdk_tgt -m 0x33,
the core id showed from refresh_cores_tab() is:
core
0
0
4
5
The correct should be:
0
1
4
5
This patch aims to fix this display error.

Change-Id: I2ac49d73de6dcf5bf10891b2299565c19cfaa686
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7856
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
2021-06-30 22:56:31 +00:00
Shuhei Matsumoto
00833e651c example/nvme_identify: Use spdk_nvme_detach_async()
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie026026fd64d36974e4a877aa9755bafdbe4fb29
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8473
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-30 22:54:19 +00:00
Shuhei Matsumoto
2184410027 test/env_dpdk_post_init: Use spdk_nvme_detach_async()
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7d78cc1a5ab1d696abcba9cd83aeac913ea101de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8472
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>
2021-06-30 22:54:19 +00:00
Shuhei Matsumoto
9a99ff90f9 example/nvme_hotplug: Use spdk_nvme_detach_async()
We can add one or more ctrlrs to the existing detach context even
after polling started as long as spdk_nvme_detach_poll_async()
returns -EBUSY.

By relying on this update, add a global variable g_detach_ctx and
use it to aggregate multiple detachments.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I28dcfa41daf1fe2bbe76fac80e1bc2abc24751f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8471
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-30 22:54:19 +00:00
Shuhei Matsumoto
3959e397d4 nvme: Add new detach to a detach context while it is being polled
This update will allow us to use spdk_nvme_detach_async() and
spdk_nvme_detach_poll_async() easier to aggregate multiple detachments.

Previously, we could do:
    spdk_nvme_detach_async()
    spdk_nvme_detach_async()
    spdk_nvme_detach_async()
and then started doing spdk_nvme_detach_poll_async().

Hence aggregating multiple detachments is already supported.

After this patch, the following sequence is possible:
    spdk_nvme_detach_async() = 0
    spdk_nvme_detach_async() = 0
    spdk_nvme_detach_async() = 0
    spdk_nvme_detach_poll_async() = -EAGAIN
    spdk_nvme_detach_async() = 0
    spdk_nvme_detach_async() = 0
    spdk_nvme_detach_poll_async() = -EAGAIN
    spdk_nvme_detach_poll_async() = -EAGAIN
    spdk_nvme_detach_poll_async() = -EAGAIN
    spdk_nvme_detach_poll_async() = 0

The actual changes is to remove the variable polling_started from
struct spdk_nvme_detach_ctx because it is not necessary anymore.

Clarify this change via updating the header file and CHANGELOG.
Verify this change by unit test.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iebdf6c27c5304a2097b7084c315ccc99634ffa1e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8468
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-30 22:54:19 +00:00
Shuhei Matsumoto
4fe4040a14 nvme: Add spdk_nvme_detach_poll() to simplify a common use case
Add a new function spdk_nvme_detach_poll() to simplify a common
use case to continue polling until all detachments complete.
Then use the function for the common use case throughout.

Besides, usage by simple_copy application was not correct, and
fix it in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic14711cd8478bf221c0fe375301e77b395b37f26
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8509
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-30 22:54:19 +00:00
Shuhei Matsumoto
5d617b4855 ut/nvme: Add test case for spdk_nvme_detach_async()
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iaeb7435b7efc126b95be1d7088a5d8b67dceec5d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8467
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-30 22:54:19 +00:00
John Levon
56e327e795 vfio-user: fix nvmf_vfio_user_poll_group_add() comment
The function comment was referring to a non-existent caller; instead, expand
with a little more detail on the path taken for new QPs.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I42478194f3cfc18a6ff6c434964630ac42866f1d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8534
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-06-30 22:53:38 +00:00
Krzysztof Karas
be1ff6def5 docs: update spdk_top page to contain help window info
Updates docs for spdk_top to refrect changes made to the bottom menu
and adds a section to explain help window.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: Iad3cf97ce0e06d9154b3b93e73c4c626f89a763e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6989
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-06-30 22:43:24 +00:00
Krzysztof Karas
aa64b29723 spdk_top: reduce bottom menu entries
Help window has proper explanations for each key used in spdk_top,
thus number of bottom menu entries can be reduced.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: Id8356cbf25a63931e2499fee245547a5dec3b7a0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6145
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: Paul Luse <paul.e.luse@intel.com>
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>
2021-06-30 22:43:24 +00:00
Krzysztof Karas
9d54193c70 spdk_top: add help pop-up window
Adds help pop-up window with descriptions for each menu entry.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: Ic622d30e24ba0b071254577c31829be235cdb0fc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6142
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-06-30 22:43:24 +00:00
Michal Berger
dd2b935dc4 check_format: Fixes for shellcheck's SC2268 directive
SC2268: Avoid x-prefix in comparisons as it no longer serves a purpose

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ica5ddfa8c39f34741c7344906abe802ff7451b1f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8505
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: <tomasz.rochumski@intel.com>
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>
2021-06-30 22:43:05 +00:00
Michal Berger
742f04b3f7 check_format: Fixes for shellcheck's SC2251 directive
SC2251: This ! is not on a condition and skips errexit.
        Use && exit 1 instead, or make sure $? is checked.

This is critical since our test suites heavily depend on errexit
to catch all abnormal conditions. Replace ! foo ... with a call to
NOT() wherever possible. For the test/ocf pieces, use [[ ]] instead
to define the condition for the existance of the ocf bdev.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ied3f99b9f1dc0594e4aef64fc21e51498f19ac23
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8504
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-30 22:43:05 +00:00
Michal Berger
9d48662103 check_format: Ignore shellcheck's SC2128 and SC2178 directives
These are currently prone to false-positives especially in terms of
scoping. Consider the following:

foo() {
	local bar=(42)
	echo "${bar[*]}"
}

bar=43
foo
echo "$bar"

Some versions of shellcheck, including the latest, 0.7.2, complain
about $bar being reused as a plain string here. This is incorrect
since foo() holds its own copy of bar[@] hence the assignment which
takes place outside of it doesn't affect its content.

SC2178 can be mitigated be reversing the order of declaration:

bar=43
foo() { ... }
...

but the SC2128 still remains.

Currently, in our code majority of these warnings are coming from
false-positives due to initial source'ing which most of our test
scripts do (e.g. they fetch a function where local bar=() is used
and in the test itself $bar happens to be assigned a plain string.
This is still valid code).

To mitigate, disable these directives untill shellcheck is capable
of properly interpreting scoping when checking them.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ifbde973eae6e261d79e1c340eb28644bce5f4e45
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8503
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: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-30 22:43:05 +00:00
Michal Berger
63fd943282 check_format: Fixes for shellcheck's SC2269 directive
SC2269: This variable is assigned to itself, so the assignment does
        nothing.

Since the --id check doesn't change the value of $id, remove it
completely. This simplifies the process_shm() so the --id type is
considered to a be default and $id changed only in case --pid was
explicitly requested.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: If8a4a43c6822fa1b32217a0b783cb96d0fee2644
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8502
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-30 22:43:05 +00:00
Michal Berger
8c176db2ca check_format: Fixes for shellcheck's SC2030 directive
SC2030: Modification of var is local (to subshell caused by pipeline)

This directive is raised since the for loop (or rather its contents)
is piped through to another process. In this context it's not harmful
since we are interested only in sending the stdout but since we operate
on variables that happen to be local to the process that handles the
loop shellcheck sees that as a potential issue. To make it happy
remove the pipe and sort pci addresses prior running the loop.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I835c5ac1da9012129c5d01d62880307f70caab1b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8501
Community-CI: Mellanox Build Bot
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
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>
2021-06-30 22:43:05 +00:00
Michal Berger
36f5f0df17 check_format: Fixes for shellcheck's SC2155 directive
This is a first commit in the series addressing potential Bash issues
as discovered by the latest shellcheck release (0.7.2, shipped with
the very latest fedora33 and fedora34). The goal is to either fix,
locally or globally disable given directive(s).

SC2155: Declare and assign separately to avoid masking return values

Simplify the setting of the variable pointing at the root of the repo.
Also, keep it consistent with the rest of the scripts and declare it as
$rootdir.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I63e0b1a85ce16f7983e9ba6dd985046e8a39a650
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8500
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-30 22:43:05 +00:00
Jim Harris
79b6771f61 scripts: add escape in check_json_rpc string
On my system, the git grep for ^SPDK_RPC_REGISTER(
fails because the ( is unmatched.  It seems we should
escape it, although clearly our CI systems don't seem
to require it.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8393
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-06-30 19:23:50 +00:00
Jim Harris
10c7d133be nvmf: print debug response value after prop size check
When the property is 8 bytes but the host only requested
4, we need to mask and only return the bytes requested
by the host.  Wait to do the DEBUGLOG until after
that has happened.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8f476a47e9fd07bf652fd64f3b1c17d650374167
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8506
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-06-30 19:23:40 +00:00
Michal Berger
7232c450f9 configure: Build against installed DPDK instance
Interpret bare --with-dpdk opt as user's request to find installed
(provided by the distro) DPDK's libs|include files and use them during
the build.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I9da99671b95af0121194b3a6d53636b0ded71f1b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8348
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tom Nabarro <tom.nabarro@intel.com>
Reviewed-by: <tomasz.rochumski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-06-29 18:17:43 +00:00
Michal Berger
52652c30cb rpmbuild: Fix Requires section
This particular section must be defined in one place hence the
%{requirements_list} cannot be passed down later on. This requires
reordering of the .spec a bit. Most notably, all global macros are
now defined at the very beginning so then Requires section can be
build properly.

Also, use %() to expand the macro which holds the requirements as
bare "Requires: %{foo}" is not valid.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I69430f73d10204325fc825ecc392506f261ebaf1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8347
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-29 18:17:43 +00:00
Karol Latecki
f5cb018a92 doc: add report link to 21.04 TCP report
Change-Id: I1cca29b0165b4ade6750c3655090e40bb84a5da7
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8469
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-29 18:17:10 +00:00
Changpeng Liu
15beaa20bf nvme: print NVMe command and response when enable nvme log flag
Fix issue #2010.

Change-Id: I9ffc77ddfececce1e6bdac49939d616d9e7bb3c0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8493
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-29 15:13:24 +00:00
paul luse
bb8102b1ff module/idxd: add lock around idxd device selection
Without it multiple threads can race and end up sharing a device
when the intention is sharing only after full round robin.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I29b854ff837d56078bc033802d3df244728a29aa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8187
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-29 00:46:25 +00:00
paul luse
3bbfbb5b0f lib/idxd: update some func params for consistency
Was using "dst" in some cases and "crc_dst" in others for crc32c
related calls.  Update them to always use crc_dst

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Icf200f1734c64c29881f23b02b8d12bad81b3ca0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8186
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-06-29 00:46:25 +00:00
paul luse
10808e45d4 idxd: refactor flow control for idxd engine
Recent work identified race conditions having to do with the
dynamic flow control mechanism for the idxd engine. In order
to both address the issue and simplify the code a new scheme
is now in place.  Essentially every DSA device will be allowed
to accomodate 8 channels and each channel will get a fixed 1/8
the number of work queue entries regardless of how many
channels there are.  Assignment of channels to devices is round
robin and if/when no more channels can be accommodated the get
channel request will fail.

The performance tests also revealed another issue that was
masked before, it's a one-line so is in this patch for convenience.
In the idxd poller we limit the number of completions allowed
during one run to avoid the poller thread from starving other
threads since as operations complete on this thread they are
immediately replaced up to the limit for the channel.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I913e809a934b562feb495815a9b9c605d622285c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8171
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>
2021-06-29 00:46:25 +00:00
Michal Berger
570c8bb483 autotest: Purge tmp test dirs during the final cleanup
Fixes #2006

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I3dbc0cb1177f3611b6d5684ddac7d26c64cc0479
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8476
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-06-28 16:54:55 +00:00
Mao Jiang
242a99babf test/nvme_pcie: cases for pmr configuration
Change-Id: I456e5c0472b1978be0f67a87d6a58816d769589e
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8232
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-06-28 16:30:50 +00:00
Zhiqiang Liu
e4746ad40f idxd: fix memleak problem in spdk_idxd_configure_chan()
In spdk_idxd_configure_chan(), if memory allocation fails in
TAILQ_FOREACH() {} code range, we will goto err_user_comp and
err_user_desc tag, in which we donot free chan->completions
and confused batch->user_completions with chan->completions.
Memleak problem and double free problem may occurs.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: I0e588a35184d97cab0ea6b6c013ca8b3342f940a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8432
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
2021-06-28 16:30:06 +00:00
Shuhei Matsumoto
3aeeb4b68f test/nvmf_multipath: Retry checking if ANA state is changed with timeout
The latest Linux NVMe host (e.g. Linux kernel 5.12) have improved
the quality of multipath but still has an issue such that ANA state
is observed to be invalid even after connection is successfully
created.

By code inspection and system test, initializing ANA state may be
delayed even after connection is successfully created.

We can insert a short sleep but it will be better to retry checking
with timeout. The created function check_ana_state() is applied to
the remaining cases.

This fixes the part of the issue #1819.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifc4eaef7c702d961caeee5bcdc9e6eab4704fc5d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8475
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-28 16:25:24 +00:00
Shuhei Matsumoto
b503ef4fa0 nvmf: Fix heap-use-after-free when poll_group_remove() is called after ctrlr is freed
When a qpair is destroyed and the qpair is the last,
_nvmf_ctrlr_free_from_qpair() (in lib/nvmf/nvmf.c) sends two messages,
one is for _nvmf_ctrlr_destruct() and another is for
_nvmf_transport_qpair_fini().

We do not know which of two completes earlier.

_nvmf_ctrlr_destruct() frees the qpair->ctrlr in the end.
On the other hand, _nvmf_ctrlr_free_from_qpair() calls
spdk_nvmf_poll_group_remove() in the end, and spdk_nvmf_poll_group_remove()
accesses the qpair->ctrlr to free queued requests to the qpair.

Before one recent change, spdk_nvmf_poll_group_remove() had been called
before _nvmf_ctrlr_free_from_qpair() was called.

Hence extrace the operation to free queued requests from
spdk_nvmf_poll_group_remove() and inline it into _nvmf_qpair_destroy().

Fixes one showstopper error to investigate the issue reported in #1819.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I29c43ff7b289fc77a5de9c33e0266301c412e208
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8438
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
2021-06-28 16:25:24 +00:00
Jim Harris
e1bf63afc9 accel_perf: add -a option for allocate depth
For benchmarking purposes, we may want to use a
relatively low queue depth but spread the operations
across a wider range of memory.  A new -a option is
added where the user can specify an "allocate depth"
to do exactly that.  In this case, more tasks (and
their associated buffers) can be allocated than we
have actual queue depth.  Then when we pick a new
task for the next operation, it will use a different
memory range and avoid always using the same buffers
over and over again.

If not specified, we just allocate the same number
of tasks as the queue depth, which is the current
behavior.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I78042d905fd49d130c4a318e2c19eb11b84ff726
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8451
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: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-06-28 16:18:54 +00:00
Jim Harris
c82d5789e6 accel_perf: check that numeric arguments are non-negative
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie512181e7e0537e8319abe0a5b53492c959964d2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8491
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: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
2021-06-28 16:18:54 +00:00
Jim Harris
451462f692 accel_perf: cycle tasks through task_pool
When a task completes, always put it back in the task
pool (using TAILQ_INSERT_TAIL) and then use _get_task
to get a task for the next submission.  Currently this
will just allocate the task that was just put into
the TAILQ.  But an upcoming patch will allocate
more tasks than we have queue depth, and this patch
will ensure all of those tasks get used evenly.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia6247a76ba60337fe6da3189e6c305f4dfb0a041
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8450
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-06-28 16:18:54 +00:00
Jim Harris
4cd7ca9bc0 accel_perf: assign task->worker when building tasks_pool
Previously we would only assign the worker in _get_task().
But future patches will use _get_task() for each I/O,
not just during startup.

Also increment the current_queue_depth during startup
only, rather than every time _get_task() is called.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2713591d36b8353eaab8119ee230261f40857019
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8449
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
2021-06-28 16:18:54 +00:00
Tomasz Zawadzki
127fc0d0c3 scheduler_dynamic: consider any core for the thread
Previously core load was only considered for main lcore.
Other cores were used based on cpumask only.

Once an active thread was placed on core it remained there
until idle. If _get_next_target_core() looped around,
the core might receive another active thread.

This patch makes the core load matter for placement of any thread.
As of this patch if no core can fit a thread it will remain there.
Later in the series least busy core will be used to balance
threads when every core is already busy.

Modified the functional test that depended on always selecting
consecutive core, even if 'current' one fit the bill.
Later in the series the round robin logic for core selection
is removed all together.

Fixed typo in test while here.

Note: _can_core_fit_thread() intentionally does not check
core->interrupt_mode and uses tsc. That flag is only updated
at the end of balancing right now. Meanwhile tsc is updated
one first thread moved to the core, so it is no longer
considered in interrupt mode.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I95f58c94e3f5ae8a468723d1dd6e53b0e417dcc3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8069
Reviewed-by: Maciej Szwed <maciej.szwed@intel.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
2021-06-28 16:18:19 +00:00
Tomasz Zawadzki
2d79bf58fb scheduler_dynamic: balance idle threads in separate pass
Idle threads are always moved to main core, there are no
other considations. Doing it as separate first pass,
allows to have the core stats be up to date for second
pass for active threads.

Core load stats will be used later in the series to determine
optimal target core for an active thread.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6a9bc11b86e954e461f7badebf3a6e4d1718f63c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8067
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-28 16:18:19 +00:00
Tomasz Zawadzki
e209981dd1 scheduler_dynamic: add _foreach_thread iterator
This will be needed when doing multiple passes over
all threads. See next patch.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I4e9c749d69314fc268cbcb9334862392100b651e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8066
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: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-28 16:18:19 +00:00
Tomasz Zawadzki
60b655aa91 scheduler_dynamic: simplify thread balancing logic
When picking a path to go down with a thread,
conditions unnecessarily piled up.

Instead do it either of two ways:
- move idle threads to main core
- find best core for active threads and move them there

There is no need to worry about cpumask of the thread,
since _find_optimal_core() will always return a core
within the cpumask.

If the found core is the same one as the current,
_move_thread() won't perform any action.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I0f4782766c15c86b5db0c970cfc9547058845b2a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8065
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>
2021-06-28 16:18:19 +00:00
Maciej Szwed
76b7210226 scheduler_dynamic: refactor out searching for target core
Refactors logic for finding the optimal core for a thread
to single function.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ifc2b09acb6f698640ce9602fec4f567eb32b79fa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6732
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-28 16:18:19 +00:00
Tomasz Zawadzki
537b01bf17 ut/event: fix cpumask resetting for scheduler tests
Intention was for the threads to contain a single
core in the cpu mask.
This patch fixes it.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8276cc906be53a7f8195d61c63bfa54bd2647b75
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8068
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-28 16:18:19 +00:00
Maciej Szwed
62491a6716 scheduler_dynamic: refactor out moving thread between cores
Refactor all thread moves and core stats updates to single function.

At this time in series only tsc of main core was modified and
only idle tsc of main core was used. Main core would be either
the destination core or the source core. In both cases, the idle
time for main core had to be updated.

This patch generalizes this logic to always move the execution
time from source core to destination core.
As a byproduct cores besides main core have the stats updated,
which will be useful later in the series. Once core load will
be the deciding factor for choosing a core.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I57564e8b2632f919869d74e8f10b01fb3dda3be9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6658
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2021-06-28 16:18:19 +00:00
Konrad Sztyber
b0d3f29a33 scripts/trace: added script to annotate traces
This script will use the output generated by the spdk_trace app (JSON) and
replace some of the raw pointers with the information gathered through
the DTrace probes.

For now, this only prints out the traces without doing any annotations,
so the output should be nearly identical to what's printed by
spdk_trace.  The annotations will be added in subsequent patches.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I406e8d4fde9cb88b31c38aa96f11b88e607e9436
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8105
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>
2021-06-28 16:17:35 +00:00
Konrad Sztyber
9953139612 app/trace: added an option to print traces as JSON
Added an option, `-j`, which will cause the spdk_trace to print traces
in JSON format.  The JSON output's structure is similar to the binary
SPDK trace format, i.e. tracepoint definitions are printed at the
beginning, followed by trace entries.  This allows us to reduce the size
of the output a bit, as we don't need to print all tracepoint properties
for each entry.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I22fd4bee72c0d214a3444ce62d0651fabd489f5a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8104
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-28 16:17:35 +00:00
Konrad Sztyber
63f14f9313 app/trace: remove the -q (quiet) option
The application doesn't do anything useful when started with this
option, so there's no point in keeping it.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2fca31fc7ccca11fc44a7f9a7a7b83d7634048d7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8103
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-28 16:17:35 +00:00
Konrad Sztyber
fb67f90b31 app/trace: move stats update out of print_event
It'll make it a bit easier to support printing traces in different
formats.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I33d454868fe7975ce81046823e3a3b9b6f587b0f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8102
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-28 16:17:35 +00:00
Konrad Sztyber
a4044e77d6 usdt: pass ticks as the first probe argument
This will allow to match and compare the DTrace probes with SPDK traces
as they'll be using the same source for the timestamps.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I686c3351428c75f9b618a1a909836504fccad828
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8101
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-06-28 16:17:35 +00:00
Konrad Sztyber
c556b6b892 lib/trace: don't pass zero as a non-argument
Now that the trace library can handle multiple arguments, there's no
point in passing 0 for tracepoints that don't have any arguments.  This
patch removes all such instances.  It allows us to to verify that
`spdk_trace_record()` was issued with the exact number of arguments as
specified in the definition of the tracepoint.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Idbdb6f5111bd6175e145a12c1f0c095b62d744a9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8125
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-28 16:17:35 +00:00
Konrad Sztyber
c514ba5053 lib/bdev: replace spdk_trace_record_tsc() with spdk_trace_record()
Replaced calls to `spdk_trace_record_tsc(spdk_get_ticks(), ...)` with
`spdk_trace_record(...)`, which does the same thing but is more consise.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib96e0bc0225490dadf857e1ddd2a3ecbf71e98c8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8444
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-28 16:17:35 +00:00
Konrad Sztyber
7ca411339c app/trace: print tpoint arguments at the end of a line
Now that each tracepoint can have more than one argument, we cannot pad
the missing ones, as it would take too much space.  Therefore, we put
them at the end of a line and simply skip the missing ones.

Additionally, since empty arguments are no longer padded, this patch
stops recording arguments with names consisting of an empty string
(containing just '\0').

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I5199a3219a31d6afd3178324a4f48563b84e6149
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7958
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-28 16:17:35 +00:00
Konrad Sztyber
3e158bd5c9 lib/trace: record string arguments as (const char *)
Now that `spdk_trace_record` receives variadic arguments, we no longer
have to pass strings as uint64_t, but can pass them directly as
pointers.  That also means that the recorded strings can be longer than
8B (up to 40B).

This patch changes the blobfs code to pass the filenames as strings and
gets rid of the code that converted them to uint64_t.

Additionally, the maximum length of string arguments printed by
`app/trace/trace` has been extended to 16 and they're also padded to 16
characters, to better align with other argument types.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ibe94452bf1b27eba2b15ca8608d0c3b55c2db360
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7957
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-28 16:17:35 +00:00
Konrad Sztyber
f301d156f1 lib/trace: variable number of tracepoint arguments
This patch allows tracepoint to record a variable number of arugments.
An additional function has been added,
`spdk_trace_register_description_ext()`, which allows the user to
register definitions for tracepoints specifying all the arugments that
they accept.  Users can also call `spdk_trace_register_description()` to
register tpoints with a single argument (or none).

Currently, all of the tracepoint arguments need to be passed as
uint64_t.

The trace record functions use variable arguments and rely on tracepoint
description to know the order and the format of the arguments passed.
That means that the user needs to take care that they're always in sync.

Moreover, this patch extends the tracepoint entry size from 32B to 64B,
meaning that there are 40B that can be utilized for passing arguments,
which in turn means that there can be up to 5 arguments per tracepoint.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I9993eabb2663078052439320e6d2f6ae607a47ff
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7956
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>
Community-CI: Mellanox Build Bot
2021-06-28 16:17:35 +00:00
Jim Harris
1be9c295b8 build: clarify Makefile for check_so_deps failures
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If6b9ee44568370667d5d597098b43aa892862232
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8499
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-25 16:45:17 +00:00
Jiewei Ke
5fc0475c14 thread: Make the definition of struct spdk_io_channel private
Move the definition of structure spdk_io_channel into
lib/thread/thread_internal.h, so we don't have to update SO_VER for
other libraries in future when we need to change the internal details on
the structure.

Signed-off-by: Jiewei Ke <jiewei@smartx.com>
Change-Id: I3d2ca7a8737972e0b33ce92e464da42c48f89dec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8189
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-25 05:01:45 +00:00
John Levon
2509e1248c vfio-user: correct logging levels
If we're not a DEBUG build, vfu_setup_log() was effectively forcing a
libvfio-user logging level of LOG_ERR. Instead, let the log handler decide what
to report, so we can respect the SPDK levels.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Ib3ad62589f495a377885f7deabaf02b428e83d30
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8452
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-24 22:19:00 +00:00
Michal Berger
227428c3a4 autotest: Don't override default amount of hugepages on Linux to 8GB
This is relevant mostly for the VMs. Allocating that much memory puts
a lot of pressure on remaining pieces of the system as currently we
allocate total of 12GB memory per VM instance in the CI pool. Default of
4GB hp should be enough to cover majority of the tests hence if there's
any suite that requires more memory, setup.sh should be called there
directly with an optimal value.

This is done to make sure we can accomodate proper resources in the CI
by knowing what are the actual requirements rather than just blindly
allocating "as much as possible".

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ie958c518c7ed702b068c7fc9042183fdf41aa816
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8436
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-24 17:33:10 +00:00
yidong0635
928db41626 rpc: Fix raid strip size method not consistent.
Fix json config file using strip_size error, and
The strip_size parameter was changed to strip_size_kb  in `bdev_raid_create`
     rpc function in order to make it more meaningful to users.

Unify the coding style in rpc help file.
      using --strip-size-kb --raid-level ... instead of --strip-size_kb.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I341af1034c7ea6716ff839bb524ee733c9e0cd34
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8401
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.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-06-24 17:30:19 +00:00
Jim Harris
164bfddf24 nvmf: don't set aerl=0 for non-discovery controllers
Commit b7cc4dd added support multiple AERs, but didn't
remove the code that hardcodes aerl=0 for non-discovery
controllers.  So even though the target now supports
multiple AERs, we never indicate that for non-discovery
controllers.

The spec also recommends that implementations support
a minimum of 4 AERs - so the current behavior is not
recommended.

It seems that at least on Windows (when testing with
vfio-user transport) we see the limit get exceeded
which results in ERRLOGs.  Let's keep the ERRLOG there
for now, assuming that once we report we support 4
AERs that Windows won't try to send more than that.

Fixes issue #2000.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6a07a6f37aaa6e531ae2cf1e1c46da036b00785b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8488
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-24 07:21:34 +00:00
Jim Harris
6aa6bfdda3 nvmf: use DEBUGLOG for unsupported features and log pages
We cannot control what the host may send to the target.
For example, we have empirical evidence that Windows
will send vendor-specific IDs for features and log pages
(when testing with the vfio-user target transport).

So let's change the ERRLOGs in these cases to DEBUGLOGs.

Fixes issues #2004, #2007, #2008.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8d5b92fc5e33d698af246f2f1c34f7cf51e6488a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8487
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-24 07:21:34 +00:00
Krzysztof Karas
bd4363d3e0 spdk_top: rename free_resources to free_poller_history
Rename this function to better expalin what it does.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I7ab84a7cfbe488df8c1681d943f8af74458f5b32
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7389
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-06-23 19:52:27 +00:00
Krzysztof Karas
b096b67010 spdk_top: make sure data from RPC is consistent
This patch changes how cores, threads and pollers data structures
are connected to each other. This is to ensure consistency and
avoid writes/reads from null pointers when application state
has been altered (e.g. by rescheduling thread to another core).
Fixes #1921.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: If517a7db41c512b27f86598a047df8ed27d3a274
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7769
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-23 19:52:27 +00:00
Krzysztof Karas
a9a2c09579 spdk_top: change type of core_num in rpc_thread_info
Change type of core_num to be int instead of uin32_t
to allow assignment of -1 value for the "hanging" threads
that are not assigned to any core.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I708f9547ee4fa2cf49f6c38750e12380d76b1160
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8154
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-23 19:52:27 +00:00
Liu Xiaodong
3a2a1d80e0 test: fix nbd test typo and add check
Change-Id: I5120baff8d2de3ef639d7b3c66d51002838c3f3c
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8439
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-23 18:07:46 +00:00
Tomasz Zawadzki
bbf52bd340 doc/rpms: add reference to rpms doc page
The RPM page was not referenced anywhere,
only accesible via list of files or direct link.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3a72add1cc2530a73f383ca0c144a551d94083e8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8015
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2021-06-22 23:47:52 +00:00
Changpeng Liu
9901ca18a2 libvfio-user: update submodule
1. Update with latest vfio-user specification changes.
2. The new libvfio-user will not expose dma_sg_t data structure
any more, SPDK should use pointer and allocate memory for it.

Change-Id: I619b0c0828cbe3b050c628bff4c4ce7ee840510f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8377
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Community-CI: Mellanox Build Bot
2021-06-22 23:42:02 +00:00
Changpeng Liu
c5432752b7 nvmf/vfio-user: eliminate insert_queue function
When creating queue pairs, the original code uses a stack
queue variable and copy it to queue pair in insert_queue
function, the coming changes in libvfio-user doesn't expose
dma_sg_t data structure any more, we need to change it to
a pointer and allocate memory for it, so here we eliminate
insert_queue function as a preparation.

Change-Id: Iee94029d24bc8882ec169665e229e6cbc11564c0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8376
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: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
2021-06-22 23:42:02 +00:00
Karol Latecki
b3bd02552c doc: add link to SPDK NVMe-oF RDMA 21.04 report
Change-Id: Ie19ce8913d745116af596b5b7d3680e26f382125
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8276
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-22 00:11:38 +00:00
Zhiqiang Liu
583689215f uring: set fd to -1 after close(fd) in uring_sock_create()
In uring_sock_create(), we loops through all the addresses available.
If something is wrong, we should close(fd) and set fd to -1, and
try the next address. Only, when one fd satisfies all conditions,
we will break the loop with the useful fd.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: I22eada5437776fe90a6b57ab42cbad6dc4b0585c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8311
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-06-22 00:11:32 +00:00
Jiewei Ke
7ba4ea0773 bdev: use thread api to access spdk_io_channel's thread
Thread is private data of spdk_io_channel, bdev should use
spdk_io_channel_get_thread() to access it. This prepares for the upcoming
change to make the definition of struct spdk_io_channel private.

Change-Id: I643c8d677e22f6d8dde2faf91bb2711d3f5d81b8
Signed-off-by: Jiewei Ke <jiewei@smartx.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8426
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
2021-06-22 00:08:48 +00:00
Krzysztof Karas
9d4fbc135d dpdk: update submodule to DPDK 21.05
Updates DPDK submodule to the 21.05 version.
Changes CHANGELOG to reflect this change.

Fixes #1998

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I9e65c680b9c0a6be23df22902ac1de938be60656
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8399
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-06-18 07:06:00 +00:00
Ben Walker
34392f231d nvmf/rdma: Add a warning about data corruption with MSDBD and
in-capsule data over 4KiB when using the Linux initiator.

This is fixed in the latest kernel. See

https://lists.infradead.org/pipermail/linux-nvme/2021-May/025641.html

Fixes #1823

Change-Id: Ie383ea774ee31ef8fe255119095b21603483c33f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8424
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-18 07:05:48 +00:00
Shuhei Matsumoto
e6a9c4042d bdev/nvme: Rename nvme_bdev_ctrlr_destruct() by nvme_bdev_ctrlr_release()
The reference count of nvme_bdev_ctrlr will be used to update ANA log
page safely, and nvme_bdev_ctrlr_destruct() can be used to decrement
reference count after completing ANA log page update.

However, nvme_bdev_ctrlr_destruct() is not a good name for this case.
Furthermore, nvme_bdev_ctrlr_destruct() does not set the destruct flag
to true, and the next patch will need nvme_bdev_ctrlr_acquire().

Hence rename nvme_bdev_ctrlr_destruct() by nvme_bdev_ctrlr_release().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I285b7ab0963d0f4ea4a7a9fd29bd026d37ba8460
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8334
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>
2021-06-17 09:21:27 +00:00
Shuhei Matsumoto
0f4cebebbf bdev/nvme: Factor out registering nvme_bdev_ctrlr and populating ns into a helper function
Factor out registering nvme_bdev_ctrlr as io_device and populating
namespaces after creating nvme_bdev_ctrlr into a helper function.

We extract spdk_io_device_register() from nvme_bdev_ctrlr_create()
because free(NULL) is correct but spdk_io_device_unregister(NULL) is
not allowed, and hence it is very simple if we call spdk_io_device_register()
only after nvme_bdev_ctrlr is successfully created.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia4d85ccf96f3ef62e51db9d08ec606d4100c7ebd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8317
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>
2021-06-17 09:21:27 +00:00
Shuhei Matsumoto
fcad162082 bdev/nvme: Simplify error paths of nvme_bdev_ctrlr_create()
Reorder a few operations and increment nvme_bdev_ctrlr->num_ns
after allocating nvme_bdev_ctrlr->namespaces[i] successfully.

Then unify the goto label for error cases to err and the err label
simply calls nvme_bdev_ctrlr_delete().

There is one noticeable change in this patch. Previously the
controller had not been detached when creating nvme_bdev_ctrlr failed.
However, after this patch, the controller will be detached when creating
nvme_bdev_ctrlr failed. This will be reasonable change.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifd8c4649036f1c5e5cd688f89727b2bd2e982735
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8316
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>
2021-06-17 09:21:27 +00:00
Shuhei Matsumoto
9ffa69dc75 bdev/nvme: Inline _nvme_bdev_ctrlr_create() into nvme_bdev_ctrlr_create()
Inline _nvme_bdev_ctrlr_create() into nvme_bdev_ctrlr_create().

This simplifies the nesting structure.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I903a9cee670dc0bf32d272e8c1d18c98a51ade8a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8315
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-17 09:21:27 +00:00
Shuhei Matsumoto
7ea4a778a3 bdev/nvme: Consolidate populate_namespace_cb() calls for error cases into connect_attach_cb()
Consolidate populate_namespaces_cb() calls for error cases into
connect_attach_cb().  Then remove ctx parameter from
bdev_nvme_add_secondary_trid() because it is not necessary now.

The next patch will inline _nvme_bdev_ctrlr_create() into
nvme_bdev_ctrlr_create().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia94f456df160c1cc874acac4c70aad27102cb0b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8314
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>
2021-06-17 09:21:27 +00:00
Karol Latecki
d8e185348f doc: add link to SPDK Vhost 21.04 performance report
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I96de738eb414233a7423d96e723e6623d5365693
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8277
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-17 09:21:15 +00:00
Zhiqiang Liu
b4226d6f99 posix: set fd to -1 after close(fd) in posix_sock_create()
In posix_sock_create(), we loops through all the addresses available.
If something is wrong, we should close(fd) and set fd to -1, and
try the next address. Only, when one fd satisfies all conditions,
we will break the loop with the useful fd.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: Icbfc10246c92b95cacd6eb058e6e46cf8924fc4c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8310
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-06-17 09:18:08 +00:00
Zhiqiang Liu
aafc440e9c blobstore:fix memleak problem in blob_load_cpl()
In blob_load_cpl(), spdk_realloc() is called to realloc
memory of ctx->pages. If spdk_realloc() return NULL,
the ctx->pages is set to NULL without being freed,
and then a memleak problem occurs.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: Idf21b690e89beab0245ba57a5de66a4f506d54fb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8308
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-06-17 09:02:37 +00:00
Jim Harris
59c8bb527b nvme: do not try to resubmit requests on error
If the transport returns error when polling for
completions, it gets to a uint32_t and we end up
trying to resubmit all of the requests that are
currently queued.  But that's not correct - if
the transport returns an error we shouldn't be
trying to resubmit requests at all.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8395
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>
2021-06-17 09:02:14 +00:00
Jim Harris
7d5ba10581 test: add bdev_wait_for_examine in waitforbdev
This helps ensure that not only is the bdev available,
but that it has been fully examined by any upper
layer bdev modules before returning from this
waitforbdev function.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8394
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>
2021-06-17 09:02:14 +00:00
Jiewei Ke
adc2942ada nvmf: nvmf_ctrlr_get_log_page use iovs to store the log page
nvmf_ctrlr_get_log_page used req->data to store the log page result.
While the req->data only contains the first iov, if req->iovcnt is
larger than 1, the req->data may not hold the complete log page; and
even worse, the log page result may be written to invalid address and
cause memory corruption.

Change-Id: Ie6415a6bd2327419fe4b32f21ac814fd827c9e95
Signed-off-by: Jiewei Ke <jiewei@smartx.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7970
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>
2021-06-17 09:02:02 +00:00
John Levon
342001e1ea env/dpdk: support additional core mask options
Currently, the SPDK "core_mask" environment option only supports setting either
"-l" or "-c". Allow applications to specify more complicated options by sniffing
for a leading "-", and passing that string through unchanged. This allows, for
example, --lcores to be used as described here:

https://doc.dpdk.org/guides/linux_gsg/linux_eal_parameters.html

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I38cc54bfcd356f3176cde7848e592525f9231e3d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7933
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-17 09:01:32 +00:00
Mao Jiang
f0f57a3fe1 test/nvmf/rdma: cases for rdma freeing request data
Change-Id: I3f95438482eb3b373592d2777cfdf28de34d6a30
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8375
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-06-17 09:00:45 +00:00
Changpeng Liu
ef7738b352 bdev/nvme: enable write zeroes split support in bdev layer
Change-Id: I4d54ac4b6aeaf1f1103c3ccb955da87334ce59f2
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7876
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>
2021-06-17 09:00:05 +00:00
Changpeng Liu
e7fbdf15fd bdev: add write zeroes split support
The common bdev layer will split large WRITE ZEROES ranges into
multiple children requests based on the backend device's setting,
it will try to split up to 8 children requests at a time to avoid
flood requests.

Also add UT to cover different cases.

Change-Id: Id9505fbe1c297412ef97b1f73587b22bc43f770e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7875
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>
2021-06-17 09:00:05 +00:00
Changpeng Liu
734de26066 bdev: use the same macro for both unmap and write zeroes
Change-Id: Id76d65dd84ac6377ca14b1671142c856c7d83b7e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7874
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>
2021-06-17 09:00:05 +00:00
Changpeng Liu
b71a8624cf bdev: add maximum write zeroes setting
Then we can enable the split for write zeroes request
in bdev layer.

Change-Id: I1341512994b061728cf8c94c0e4e7f86dbc53ce3
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7873
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: Ziye Yang <ziye.yang@intel.com>
2021-06-17 09:00:05 +00:00
Shuhei Matsumoto
074f503d27 scsi: Delete mutex from spdk_scsi_globals
This mutex is not used anywhere. After removing mutex from struct
spdk_scsi_globals, struct spdk_scsi_globals is empty. Hence then
remove struct spdk_scsi_globals. We can create struct spdk_scsi_globals
again if it becomes necessary.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I749ae43f7735a7c9383d090eae2093bb52607f17
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8192
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-06-17 08:59:18 +00:00
Shuhei Matsumoto
11d76e8c81 iscsi: Set resource pool size to the predetermined values to run with little memory
Add three parameters, pdu_pool_size, immediate_data_pool_size, and
data_out_pool_size to the RPC iscsi_set_options to run iSCSI target
with little memory.

For some use cases, we want to keep the max number of connections,
but simultaneously we want to reduce the pool size and let I/Os wait
until resource is provided.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I74dc785310b1d985f3e338c1e13fba3a3840d113
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8191
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-17 08:59:18 +00:00
Monica Kenguva
db8b121db0 test/pcie_common: changed the sequence of queued requests for CQ and SQ
Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Change-Id: If8937c01ca1d2ddfefa3c7472883a88879279165
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8284
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>
2021-06-16 17:59:41 +00:00
Zhiqiang Liu
8d7e75be24 nvmf: fix fd leakage problem in nvmf_vfio_user_listen()
In nvmf_vfio_user_listen(), fd should be closed before
set it to endpoint->fd, otherwise, the fd leakage probem
occurs.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: I3fabc65d2764926e5873475962e4362e46eb37e4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8309
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: sunshihao <sunshihao@huawei.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-16 09:01:00 +00:00
Zhiqiang Liu
14ad24c7b8 idxd: fix one memleak problem in spdk_idxd_get_channel()
In spdk_idxd_get_channel(), if chan->batch_base is allocated
faild, we should free chan before returning NULL.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: Ia652c334aead592429c1171da73d67160879686d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8301
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-16 09:00:48 +00:00
Zhiqiang Liu
3630473789 ioat: fix potential double free problem in ioat_channel_start()
In ioat_channel_start(), if spdk_vtophys(ioat->comp_update) returns
SPDK_VTOPHYS_ERROR, spdk_free is called to free ioat->comp_update,
and ioat->comp_update is not set to NULL. However, the caller
ioat_attach() will also call ioat_channel_destruct() to free
ioat->comp_update, then double-free problem occurs.

Here, we will not free ioat->comp_update in ioat_channel_start(),
ioat_channel_destruct() will do that.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: I3be19a3feec5c2188051ee67820bfd1e61de9b48
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8300
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-16 09:00:37 +00:00
Nick Connolly
f973413886 lib/nvmf: Use %z for portability
POSIX defines %z for printing size_t values in a portable way.
Replace a reference to %ld to remove the assumption about
the type of size_t.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I2186aa5e7072f565ea75de935e22c2c23acf1a1a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8341
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-06-16 09:00:25 +00:00
Nick Connolly
27f2d113c1 ut/bdev.c: Use PRIu64 for portability
POSIX defines PRId64/PRIu64/PRIx64 for printing 64-bit values in a
portable way. Replace a reference to %lu to remove the assumption
about the size of a long.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: Id5690eb2ad501eaacb4b266981b4dba128a7b174
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8340
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-16 09:00:09 +00:00
Zhiqiang Liu
c269de97eb blobstore: fix potential memleak problem in blob_serialize_add_page()
In blob_serialize_add_page(), *pages is set to spdk_realloc(*pages).
If spdk_realloc() returns NULL, the *pages pointer will be
overridden, whose memory will leak.

Here, we introduce a new var (tmp_pages) for checking the return
value of spdk_realloc(*pages).

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: Ib2ead3f3b5d5e44688d1f0568816f483aa9e101f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8307
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-06-16 08:54:20 +00:00
Zhiqiang Liu
c9d8421590 spdk_top:check return value of strdup in store_last_run_counter()
In store_last_run_counter(), history->poller_name is set to
strdup(), which may return NULL. We should deal with it.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: Ice5f27c4a7d2f9abd528b97a48ff5f92b48c8d7c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8306
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-16 08:54:20 +00:00
Zhiqiang Liu
2ef4855e83 blobfs: check return value of strdup in spdk_fs_create_file_async()
In spdk_fs_create_file_async(), file->name is set to strdup(name).
We should check whether file->name is equal to NULL.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: I2219cc353eb4711290aee2599505f57af9088bb2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8302
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-16 08:53:36 +00:00
Zhiqiang Liu
d491e7ea33 blobfs: check return value of strdup in blobfs_fuse_start()
In blobfs_fuse_start(), bfuse->bdev_name and bfuse->mountpoint
are allocated by calling strdup(), which may return NULL.
Here, we will go to err if strdup() returns NULL.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: I0599254b3436a310ddd26732312281f07a4972ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8303
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: Changpeng Liu <changpeng.liu@intel.com>
2021-06-16 08:53:21 +00:00
Jim Harris
d5af6a0417 iscsi: track whether io_device needs to be unregistered
If iscsi initialization fails (due to a memory allocation
failure for example), we may not even get to the point
where the g_iscsi global is registered as an io_device.
So then when we tear down the iscsi library using
spdk_iscsi_fini(), we need to make sure we don't
try to unregister g_iscsi if it wasn't registered.

For now, just use the g_init_thread global to make this
determination - it's set just after we register the
io_device.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8351
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-16 08:53:14 +00:00
Ziye Yang
b4af31de92 nvmf/tcp: fix the unexpected pointer access from mgmt_pdu
Because we use spdk_dma_malloc, then it does not init
the the contents in the memory.

Fixes #1996

Change-Id: Ieef411f6ae5114de9f732df6096e0bb123efb7e0
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8374
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-06-16 08:53:03 +00:00
Zhiqiang Liu
242eb6b4c2 nvmf:check return value of strdup in spdk_nvmf_subsystem_add_ns_ext()
In spdk_nvmf_subsystem_add_ns_ext(), ns->ptpl_file is set to strdup(),
which may return NULL. We should deal with it.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: If95102fe9d6d789b8ba9e846c4d7f4e22e48a93c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8305
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-15 23:39:17 +00:00
Zhiqiang Liu
e01a3f1c05 nvmf: check return value of strdup in spdk_nvmf_subsystem_disconnect_host()
In spdk_nvmf_subsystem_disconnect_host(), we should check
whether strdup() return NULL.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Change-Id: I29cb6b2499ecd2a2367001c0d21ac95da4e10e20
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8304
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-15 23:39:17 +00:00
Ziye Yang
1e660daa8d accel_engine: fix the vector crc32c computing for hw path.
We face the checksum error when using idxd hardware in vector mode because
we put fields of internal function in wrong union.
When use vector crc32c operation, seed and chained functions and cb's will
be used in the same time, so we should not put them in the same union.

With this patch, we can fix the crc32c computing while using
the vector mode with iov_count > 1.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I7097b47294ffd5dcac7d7a83d583321a73dc50d2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8213
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-15 13:55:08 +00:00
MengjinWu
e54df32e6b lib/nbd: refine nbd stop process
nbd will be closed in nbd poller function asychronously.
Unify the stop process of HARDDISC and SOFTDISC in same place.
Prepare for following patch.

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: Ida33ff6d081e68290cfa393c0c47fe7af545958b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8036
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: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-06-15 08:49:10 +00:00
Ziye Yang
9ab0ffcce2 nvme_tcp: Add data pdu crc32c offloading in receving side by Accel framework.
For receving the pdu, we add the crc32c offloading by Accel framework.
Because the size of to caculate the header digest size is too small, so
we do not offload the header digest.

Change-Id: If2c827a3a4e9d19f0b6d5aa8d89b0823925bd860
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7734
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-06-15 08:34:58 +00:00
Niklas Cassel
3edf255572 bdev/fio_plugin: spdk_fio_get_zoned_model() is too permissive
The .get_zoned_model() callback is supposed to reject unsupported
file types. Right now, we do not reject unsupported file types.

For our specific ioengine, this isn't strictly needed, since our
ioengine unconditionally sets f->filetype to FIO_TYPE_BLOCK, and if
it fails to find a SPDK bdev that matches the --filename, it will
return an error that it couldn't find the bdev matching filename.

However, all .get_zoned_model() callbacks in the fio in-tree ioengines
have a check that a given file has a file type that is supported by
the ioengine itself. This is needed since they do not set f->filetype
themselves, but instead let fio generic code initialize f->filetype.

Since we reuse --filename to mean something in the SPDK namespace, we
are force to initialize filetype manually. So that is the only reason
why we know that the file type will be FIO_TYPE_BLOCK. Anyway, let's
try to keep our code as similar to the in-tree ioengines as possible.

The SPDK nvme ioengine already has this check, so adding it in the
SPDK bdev ioengine makes our ioengines more consistent as well.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Ib5e19c738dea0f8d41641b63d0fabe055a930827
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8329
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-15 08:34:36 +00:00
Niklas Cassel
1a7a599ba0 bdev/fio_plugin: initialize filetype to FIO_TYPE_BLOCK
fio will do certain actions depending on the backing file
type of the target that it runs against.
(E.g. if the zbd code in fio detects that the backing file
is FIO_TYPE_FILE, it will emulate zones inside the regular
file.)

Both SPDK ioengines reuse the filename option to not point
to an actual path exposed by the OS, but to instead point to
a device in the SPDK namespace.

Because of this, the file type detection in fio will fail,
and will always initialize filetype to FIO_TYPE_FILE.
Therefore, the SPDK ioengines will need to initialize
f->filetype themselves.

The SPDK nvme ioengine already initializes f->filetype to
FIO_TYPE_BLOCK unconditionally. Do the same in the SPDK
bdev ioengine.
(Just like in the SPDK nvme ioengine, we also need to call
fio_file_set_size_known(), so that fio generic code does
not try to initialize f->real_file_size.)

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I37df185524ed262cb875105f989685b740b430a3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8328
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-15 08:34:36 +00:00
Niklas Cassel
5172337d95 nvme/fio_plugin: spdk_fio_get_zoned_model() is too permissive
The .get_zoned_model() callback is supposed to reject unsupported
file types. Right now, we only reject FIO_TYPE_PIPE.

However, in attach_cb() our ioengine unconditionally initializes
f->filetype to FIO_TYPE_BLOCK. This means that the only file type
that our ioengine supports is FIO_TYPE_BLOCK.

Therefore, fix spdk_get_zoned_model() to reject everything that
we do not support.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I115bb8ff9c8ea9f647baebc0196900681a36c410
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8327
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-15 08:34:36 +00:00
Niklas Cassel
bd53d09c31 nvme/fio_plugin: remove ZBD_IGNORE usage
The define ZBD_IGNORE has been removed from upstream fio.

fio will now return an error if --zonemode=zbd is used with a
--filename that points to something that is unsupported by either
the zbd code in fio or by the ioengine itself.

ioengines are now supposed to return -EINVAL for unsupported files
(instead of returning 0 with ZBD_IGNORE for unsupported files).

This change does not need any special ifdef FIO_IOOPS_VERSION check.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I7bec0b1f5dc8f166ebf683f6f3937b2ef295a21e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8326
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
2021-06-15 08:34:36 +00:00
Jim Harris
c4fafdb215 env: only pass failing address to spdk_pci_error_handler
siginfo_t is a GNU extension.  SPDK (and DPDK) have
direct dependencies on GNU extensions, but it's a bit
nicer if external modules don't also need to define
_GNU_SOURCE.  Currently siginfo_t parameter in the
spdk_pci_error_handler is the only thing that violates
this.

Note that DPDK also supports registering sigbus handlers,
but they take the failing address as a parameter instead
of the full siginfo_t structure.  Let's adopt the same
for SPDK.

While here, remove an extra semicolon that was just after
the virtio sigbus handler function signature that was
updated in this patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I07faf11a3ac3589c637cb2196581c102286b1e68
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8333
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>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-06-15 08:34:28 +00:00
Jim Harris
f29acca244 util: use __typeof__ instead of typeof
'typeof' is a GNU extension - let's use __typeof__
instead which is ISO C compliant.

Allows building SPDK header files with -std=c11 as
long as _GNU_SOURCE is also defined.

Next patch will enable omitting _GNU_SOURCE as well.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ibd6c984627b553d6f87f302800abc52157fe9b1e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8332
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-06-15 08:34:28 +00:00
Jim Harris
74c88aa62b CHANGELOG: fix typo in nvme section
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iab746ba777b04152ffb92fea2a2bb923a0a0bf20
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8299
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>
2021-06-14 08:45:45 +00:00
Richael Zhuang
a272380e2c spdk_top: fix mismatch when displaying core info
The lcore id, idle time, busy time, thread count and poller count
mismatch in refresh_cores_tab() and show_core(). The index of
g_cores_history[] should be lcore id.

Change-Id: I0e95a49b2660f64c3601d5e520c6daab3aa9925b
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7855
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>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2021-06-14 08:45:25 +00:00
Tomasz Zawadzki
286a43f512 scheduler_dynamic: move busy_threads_present
At this time only main lcore frequency is changed,
depending on its load either up or down.
Exception is when at least a single busy thread is present
on non-g_main_lcore. Then the main lcore frequency is set
to the maximum possible.

This patch moves when that is determined, from 'moving'
logic to one that sets reactors to interrupt mode.
If at least one thread is present on non-g_main_lcore,
it has to be busy. Otherwise it would be placed on main lcore.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I2900598afe53fb609e1f06a60d5245f74511e1c3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8050
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-06-14 08:44:39 +00:00
Tomasz Zawadzki
5e4fbe7364 lib/event: remove pending_threads_count from core_info
This field was only used to keep track of number of threads
that will be present on a core after scheduler moves.

It was used only internally within scheduler_dynamic.
Event framework has no need to keep such field in core_info.

Instead added field in cores_stats internal to scheduler_dynamic.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3ce74d4a25eac81e58da8705a1c4553730fc1e57
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8049
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-14 08:44:39 +00:00
Maciej Szwed
4324834113 scheduler_dynamic: add core_stats
Added core_stats structure that will hold stats modified
during balancing.

Further patches will modify the values in this structure,
to for example judge how much execution time a core
has left.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib8e611e36642c4543b5cb43bc2695c613d38f0fc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6657
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-14 08:44:39 +00:00
Tomasz Zawadzki
abbfa1a5d1 lib/event: calculate reactor tsc from last scheduling period
This patch expands spdk_scheduler_core_info with two new
fields that will contain core stats only from last scheduling
period.

This will make sure that schedulers do not have to keep track
and calculate this value on their own.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3aa7dfa6a60c1d14d95a0e684e84c2e83f0a4496
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8048
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-14 08:44:39 +00:00
Tomasz Zawadzki
da11c9d2a2 lib/event: fix refreshing tsc_last when returning to poll mode
(a5ad0f80) lib/event: update reactor tsc_last going poll mode
Patch above updated the tsc_last at the very end of changing
interrupt mode of the reactor.
The flow for turning from interrupt mode to poll mode is
first to send an event to the target lcore, then to iterate
over all reactors updating notify_cpuset on each.

Previous patch updated the tsc_last after notify_cpuset was
updated, meanwhile the threads could already been put on it.

This patch moves it immidietly to the point of changing
the in_interrupt state.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6aea252016f4706369b8b597b765593bc6edca3b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8111
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@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
2021-06-14 08:44:39 +00:00
Tomasz Zawadzki
e837ba3bde lib/event: rename core_busy/idle_tsc to total_busy/idle_tsc
Renamed core_busy_tsc and core_idle_tsc to better
describe that they contain particular core stats for
its whole lifetime.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6f16b2b0a162aad8fbaf18f549fc50a2372b920b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8047
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-06-14 08:44:39 +00:00
Tomasz Zawadzki
902c9e4de7 lib/event: remove new_lcore from lw_thread
There is no need to keep new_lcore field.

lcore value is enough to determine the target core.
Meanwhile _threads_reschedule() can see if the target
core matches the one from core_info.

Removed _spdk_lw_thread_set_core() since it did not
serve much purpose.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I82c7cfebf1107b4a55b2af9b891052084a788907
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8046
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-14 08:44:39 +00:00
Tomasz Zawadzki
18667806ca lib/event: update lw_thread->lcore after thread move
lw_thread->lcore was set during gather_metrics,
rather than just after the thread reschedule.
This patch just moves it to the right place.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I0477830902f68102e4e4f0ffc9359bd004a8ad42
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7961
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-06-14 08:44:39 +00:00
Tomasz Zawadzki
d9f5da13e4 lib/event: change last_stats to only describe last scheduling period
So far the schedulers had to calculate the diff of
current_stats - last_stats on their own to get tsc
from last scheduling period.

Renamed the current_stats to total_stats, but kept the meaning
as stats describing tsc for lifetime of a thread.

Instead change the meaning of the last_stats to describe
the tsc of only last scheduling period and change its name
to current_stats.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1a165ff7c1afe659b432c3127a351a96878d1f3d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7843
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-14 08:44:39 +00:00
Ziye Yang
2cd948c4a6 sock/posix: fix the socket pipe_has_data or socket_has_data.
After reading the code in detail, I think that we should
not set pipe_has_data= true and socket_has_data at the same time.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I8f9f96b16f4f0e0c585877a0dd687a240252a7cf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8283
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>
2021-06-14 08:44:28 +00:00
Michal Berger
1347830beb scripts/vagrant: Allow to mix CMB and PMR setup
As of latest qemu (>= 6.0.0) these can now be used together as
different BARs are used to accommodate for both.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Icf32f491fd33ef733f0d946f9b5caaeb87137d28
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8217
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-06-14 08:43:01 +00:00
Michal Berger
a5c3f72a89 scripts/vagrant: Initialize pmr_cmdline as an empty string
Having pmr_cmdline set to nil was for some reason breaking cmb setup
as weirdly enough pmr_cmdline was ending up being set to "true".
Avoid this by having pmr_cmdline set to some value, empty string in
this case.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ib41da699dcc2f213f0b18d21be3fd32f398bae41
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8216
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-06-14 08:43:01 +00:00
Michal Berger
22d7d62efb pkgdep/git: Update repo, branch of the vfio-user qemu fork
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Icd30d917f47f3585325ed689a5513b26f7d63d3b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8222
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-14 08:42:37 +00:00
Michal Berger
6b6c9db642 pkgdep/git: Make qemu's BRANCH vars global
This would make easier for the 3rd party tooling to adjust env for
the install_* routines.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ib5ea447bc67080f106cc43e005143bd52e91c768
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8122
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-06-14 08:42:37 +00:00
Jim Harris
815ce363a9 nvme: default use_cmb_sqs to false
Using the CMB for SQs is not a standard use case.
Performance can vary widely when using CMB for SQs
and is typically not the configuration used for
benchmarking.

So let's change the default value here to 'false',
users can still opt-in by setting this option to
true in the spdk_nvme_ctrlr_opts structure prior
to attach.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iab746ba777b04152ffb92fea2a2bb923a0a0bf21
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8227
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-11 22:12:08 +00:00
Krzysztof Karas
a01ad578a8 spdk_top: refactor data gathering to work per object type
Refactor data gathering functions to work per object type
and use more descriptive names.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: Ie49f58b12e705615e9b92141e83306da102511c2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7388
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>
2021-06-11 09:40:46 +00:00
Krzysztof Karas
6726f45969 spdk_top: delete free_data() function
Delete free_data() function, because it is called only once
and contains only three lines of code. This is to make
spdk_top code cleaner.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I78e0edd941e8fb81ac58ea13bdc91148db0a2417
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7972
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-11 09:40:46 +00:00
Krzysztof Karas
3154d4c9b1 spdk_top: change initial refresh rate
This patch increases initial refresh rate for data gathering.
Initial refresh rate value was originally set to 1 microsecond,
which was too little for some values in tabs to refresh.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: Ideeab28d3c2bbdd1133fa8706c8f2182948d7d5c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6445
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
2021-06-11 09:40:46 +00:00
Krzysztof Karas
0f5cd128ec spdk_top: fix threads_count assignment
threads_count inside show_core() function takes its value
from first core instead of the one selected by the user and
breaks core pop-up window.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I11710eaf061e7ead0fec46a0f9c47dd84d8d0209
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7588
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-06-11 09:40:46 +00:00
Krzysztof Karas
d7d4a712cf spdk_top: change threads array inside refresh_threads_tab()
Changes number of allocated elements to RPC_MAX_THREADS in *thread_info[]
array inside refresh_threads_tab() to match other refresh functions.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: If62faed463f42f232693f5bdaea70a5bb248891f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7993
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>
2021-06-11 09:40:46 +00:00
Krzysztof Karas
e9af400888 spdk_top: change where g_last_pollers_count is set
The goal of this patch is to set g_last_pollers_count
earlier than it was originally done to allocate less
memory for pollers array in refresh_pollers_tab(),
which is done in the next patch.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: Id403af9b1c510abd7b6a1ac1742076590b1b37d7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7992
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>
2021-06-11 09:40:46 +00:00
Krzysztof Karas
fbcfcb9807 spdk_top: separate data gathering logic from data display
Separates data gathering logic in tabs. Data is now being collected
on a separate thread.
Modified wait_init() and show_stats() to allow for thread creation
when starting spdk_top and thread join when closing.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I54a58522f31f938e2d1275c3a6f60fe8c17b0031
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6368
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-06-11 09:40:46 +00:00
Krzysztof Karas
57837813e3 spdk_top: fix threads assignment to cores in THREADS tab
FIxes incorrect cores showing for each thread in THREADS tab.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I661eac0cd70cf6ecf308dafaa940fcae8fd513f9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8153
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>
2021-06-11 09:40:46 +00:00
Jim Harris
130c94c489 nvme: add quirks for new RedHat QEMU NVMe dev/vendor ID
QEMU 6.0 by default uses a RedHat dev/vendor ID rather
than the Intel one that has always been used to date.
We need the NVME_QUIRK_MAXIMUM_PCI_ACCESS_WIDTH quirk
so that we do not use wide instructions to copy SQEs
to a virtualized CMB, since QEMU does not support
that.

The NVME_INTEL_QUIRK_NO_LOG_PAGES quirk is only needed
for devices with SPDK_PCI_VID_INTEL, so we do not need
to carry this one over to the new REDHAT entry.

Fixes issue #1986.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3d339b3525e7c6ceb792eb9d143e7a922c19344d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8226
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-11 07:22:10 +00:00
Swapnil Ingle
2dd2d19768 bdev/nvme: Set bdev phys_blocklen
Set nvme bdev physical block size based value of NPWG and NAWUPF namespace
field.
The logic to set bdev phys_blocklen is based on how Linux nvme block driver
sets it. If the underlying nvme namespace supports NPWG/NAWUPF then bdev
phys_blocklen is set to min(npwg, nawupf)

Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Change-Id: I6d254a9e730dccc230b9db4d1217bf7ab2f39b6c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8224
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-11 07:21:17 +00:00
Changpeng Liu
a119799b26 test/nvme/aer: remove duplicated changed NS list log
The NVMe driver layer will clear this log, so we don't
need to send another one in the aer callback.

Here we change the logic to compare with previous NS
state, if the NS state is same it will fail the test.

Change-Id: I6d80cb6a5f6d5eab92b8ccac601a23c19cea4003
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8175
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-06-11 07:18:06 +00:00
Konrad Sztyber
441431d228 lib/trace: don't format arg's name while registering a tpoint
The arguments of a tracepoint are formatted when they're printed now, so
there's no need to append ":" or pad it with spaces.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I74f5568f1982dacc079e3b80bd19a9cd740b48ce
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7955
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-10 10:58:05 +00:00
Konrad Sztyber
462eb754a2 lib/thread: trace (get|put) IO channel calls
The traces record calls to spdk_(get|put)_io_channel() and saves the
reference count of the IO channel and its context.  The context, instead
of an IO channel pointer, was selected because the same pointer is often
used in other traces (e.g. nvmf's poll group), so it makes it possible
to match these traces together.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I15fe982a89685d8f6e23d406d6d48f5c2d9d604b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7232
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-10 10:58:05 +00:00
Konrad Sztyber
db35950a13 mk/unit: link with trace library
Linking each unit test with spdk_trace allows for getting rid of lots of
stub definitions for the trace functions.  The behavior stays the same,
as the trace calls result in no-op anyway because none of the unit test
apps enable tracing.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I904dac92205aadd644100af2c38989bb7979e47c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7231
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-06-10 10:58:05 +00:00
Konrad Sztyber
62aa8bd8d2 nvmf/rdma: trace qpairs instead of rdma_cm_id
Both values should provide similar information, while the qpair can also
be matched to the traces from lib/nvmf allowing the user to track the
qpairs across these modules.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Iba9abdd3f41b93100c0403b1c90fc4549d39189e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7159
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: Paul Luse <paul.e.luse@intel.com>
2021-06-10 10:58:05 +00:00
Konrad Sztyber
a266b6e4be nvmf: add traces around poll group lifecycle
The traces are tracking the lifecycle of a poll group: creating it,
adding and disconnecting qpairs, and finally destroying the group.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I075b7f24d14b8fbb42bb18ddd70a668a8bace118
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7158
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-10 10:58:05 +00:00
paul luse
db71eb6a4b lib/accel: add suport for batching copy + CRC32C command
Future patches will add vectored versions and accel_perf support.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I9cea07283bba871c6d026f8c61c2c9552eaaa23d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8147
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>
Community-CI: Mellanox Build Bot
2021-06-09 07:26:00 +00:00
paul luse
cfd37e28f1 lib/idxd: add support for batching copy + crc32c
Upcoming patches will add accel_fw support for batching this cmd
and then vectored versions later along with accel_perf to exercise
them.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I59f577f4365fbf063d7419cc6052e10c998b58bc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8143
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>
2021-06-09 07:26:00 +00:00
paul luse
a6c5480f1d lib/idxd: fix batch submission of crc32c
Was using reserved field. Similar fix to what was done earlier
for direct submission of crc32c operation.

fixes #1972

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ie9867e72f60c7f38aa1af0273a036f34580ed4c6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8145
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: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
2021-06-09 07:26:00 +00:00
paul luse
fa99984283 lib/idxd: refactor batch prep command function
To match regular sumission prep function and allow caller to
modify both descriptor and completion structures.  Also allows
for more accurate error reporting.  Needed for upcoming patch to
fix batch CRC submissions.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I4b7b5b24e2f54149b513d4b23ba32f3802aff3e5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8144
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-09 07:26:00 +00:00
paul luse
f6ad617077 module/idxd: add support for copy + crc to idxd engine module
Upcoming patches will add support for accel_perf tool.  Also
following will come vectored support and batch versions.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I43bd11b8efe40e6df0e2c8bd2995b9a9341f6457
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8142
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-09 07:26:00 +00:00
paul luse
be8f5a3963 lib/accel: Add suport for copy + CRC32C to accel framework
Upcoming patches will add support for the idxd engine and
the accel_perf tool.  Also following will come vectored support and
batch versions.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I7223517a844525ad52ed49d65627b04c3cd9fe7c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8141
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-06-09 07:26:00 +00:00
paul luse
1076008e63 lib/idxd: add support for new opcode to low level library (copy + CRC)
Upcoming patches will add support to the accel fw, the idxd engine and
the accel_perf tool.  Also following will come vectored support and
batch versions.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ie0fbd4b8da9f727426000898c0b511587adac65b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8139
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-09 07:26:00 +00:00
MengjinWu
ab5cc9dd6e lib/nbd: refine _nbd_fini process
_nbd_fini will make all NBDs into closing state.
remove _nbd_async, beasue it will call asynchronous error.

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: Ifb873b7f079b735983bdf20c2df652be0a21919f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8035
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-09 07:25:44 +00:00
MengjinWu
628c230de4 lib/nbd: check if nbd is registered when start
Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: Ie6918e442724020e2be8f98cab971e1126ebb20a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8033
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.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>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Community-CI: Mellanox Build Bot
2021-06-09 07:25:44 +00:00
Changpeng Liu
67cf3e1c0a test/vfio-user: use variables to make each line more shorter
Also rename `muser` to `vfio-user` finally.

Change-Id: Iaf76a4bfc8f7a35621fcb60fd78cd145ea219269
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8167
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: <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-09 07:21:31 +00:00
Changpeng Liu
5c680e29ea nvme/vfio-user: use the common request submission function
Change-Id: Ic2f6dedd0734373d23e80f7875640fb17db7b321
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8032
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>
2021-06-09 07:21:31 +00:00
Changpeng Liu
d4844d5b4e nvme/pcie: use nvme_pcie_vtophys in the submit request function
And for some internal functions we need to pass controller
parameter so that we can do vtophys based on transport type.

Change-Id: I3ca4fa162ec9305f62b295ba21f7474c21edfe52
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8031
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>
2021-06-09 07:21:31 +00:00
ChengqiangMeng
621d9d3f63 unittest/nvme_tcp: increase code coverage for nvme_tcp.c
some functions code comprehensive coverage.

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: Iec707b2706cc873311eb2701f4f8c936de6e6b5a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8166
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>
2021-06-09 07:21:05 +00:00
Jim Harris
6564bd94ba nvme: fix DEFAULT_IO_QUEUE_SIZE_FOR_QUIRK handling
We need to wait to process this quirk until after we
have a valid CAP register value.  Before this fix,
controllers with this quirk would get their io_queue_size
always capped at 2 (min io queue size) because CAP hadn't
actually been read yet.

Fixes: f5ba8a5e (nvme: add NVME_CTRLR_STATE_READ_CAP)

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8211
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-06-09 07:07:50 +00:00
Changpeng Liu
5e4fe0adc8 nvme: inline nvme_pcie_vtophys
The inline function can also be used in the coming submit request
function.

Change-Id: If4a5511001e6586dbce0978298beddc537f54d8b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8173
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-06-08 08:28:44 +00:00
Changpeng Liu
b69827a394 nvme/pcie: move nvme_pcie_qpair_submit_request() to pcie common layer
The PCIE and VFIOUSER both can use this function, the only difference
is VFIOUSER should use IOVA=VA to do the vtophys translation, so
here we will move the function to the common PCIe layer as the first
step.

Change-Id: I699edb67a00a2fa534072fc02ac2dd4a27aba8f4
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8030
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>
2021-06-08 08:28:44 +00:00
Shuhei Matsumoto
0e3d4ada7b CHANGELOG: Red-black tree was added by using FreeBSD under the same BSD license
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7bb15bae30dcea4c3e241506ae40d878f3479a6b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8071
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-08 08:28:26 +00:00
tyler_sun
4f4f505c77 nvme: get changed ns log once AER notice of ns changed received.
Each time the following file
"/sys/kernel/config/nvmet/subsystems/nqn_name/namespaces/ns_id/enable"
on the target side was changed, the SPDK initiator should receive an
async event (type: SPDK_NVME_ASYNC_EVENT_TYPE_NOTICE, info:
SPDK_NVME_ASYNC_EVENT_NS_ATTR_CHANGED).
But actually not.
Since for SPDK, when target sent the non-first event, the condition
"nvmet_aen_bit_disabled(ctrl, NVME_AEN_BIT_NS_ATTR)" that prevents
target from sending event was matched.
This commit fix this issue by issuing a get_log_page cmd for each async
event received, just as the kernel initiator does.

Fixes #1825.

Signed-off-by: tyler.sun <tyler.sun@dell.com>
Change-Id: I2973470a81893456ca12e86ac390ea1de0eed62c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7107
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>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-06-08 08:28:06 +00:00
Yuri
d63fbc8a8e nvmf: allow poll groups to run on a subset of cores
In order to avoid latency imbalances, the user can specify a cpu mask
on which the poll groups should run. This code update added data structures
to control set of CPU cores.

Change-Id: Iaf69d75da2fc6fed350d97d11027ce09e9432210
Signed-off-by: Yuri <yuriy.kirichok@hpe.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5610
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-08 08:27:37 +00:00
Jim Harris
e0c9c640c6 doc: add a page for USDT
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5aa5ec3c3fc695a2555a34ac4e119e256da464a5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7195
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-06-08 08:27:15 +00:00
Jim Harris
3a0f624499 nvmf: add USDT probes for subsystem state changes
Also add scripts/bpf/nvmf.bt to enable and log these
probes.

This patch also adds a script that can generate
a bpftrace script snippet with string maps for
needed enumerations (currently nvmf_tgt_state and
spdk_nvmf_subsystem_state).  This allows us to
dynamically generate this from the source code, and
can be extended for other enums we may want to
add in the future.

Thanks to Michal Berger for converting my original
gen_enums.py script into gen_enums.sh!

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Iff34a6218aef40055ac14932eea5fc00e1c8bcf5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7194
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: Konrad Sztyber <konrad.sztyber@intel.com>
2021-06-08 08:27:15 +00:00
Mao Jiang
109106d888 test/nvme_ctrlr: cases for setting supported log pages
Change-Id: Id92a2de7899696abd428fe5e7ac56abc683117cb
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8155
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>
2021-06-08 08:26:46 +00:00
Mao Jiang
e8c8d4ebc7 test/pcie_common: cases for connecting qpair
Change-Id: If03ff8d382c663d1f1e291a2e9c84e7c0b1cd7a9
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7994
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
2021-06-08 08:26:37 +00:00
GangCao
9cedc7202c Util: check the error case of NULL pointer
Change-Id: I0be36b584c99de822920b935c34708576617ffc3
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8176
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-06-08 08:26:12 +00:00
Nick Connolly
5a21edf4e3 scripts: add autotest support for Windows
Source Windows specific definitions from common.sh. These adjust
uname to report the operating system as WSL, Msys or Cygwin and the
kernel name as Windows.  They also define kill() to invoke the SIGTERM
handler before causing a hard stop with TerminateProcess.

Adjust the ordering of the 'source' commands in autotest_common.sh so
that the config definitions are available when common.sh is loaded.
Define MAKE, MAKEFLAGS and HUGEMEM for Windows.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I130b892ee55c925a0b033bda271a29133993afb7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7101
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-06-08 08:19:32 +00:00
Michal Berger
93e6e40442 rpmbuild: Allow to define custom builddir
Alternative for the default of $HOME/rpmbuild.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Id1feb7207926b518deb87045fc17bb3d1d4c374e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8159
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-06-08 08:18:36 +00:00
Michal Berger
ab7bd10ad9 test/common: Remove BASH_XTRACEFD echo
This was added only for testing purposes. Right now it just
unnecessarily makes the build logs bigger and spams the stdout.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Id8ff3e1dfde955dc118e0a202897d6c6634c3995
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8194
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-08 07:13:17 +00:00
Jim Harris
3a7a66e505 nvme: add wmb before writing shadow register
Fixes issue #1828.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I02ba897b6c10f4ec870f46825f09e00f0c7c0235
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7905
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: Changpeng Liu <changpeng.liu@intel.com>
2021-06-07 23:34:30 +00:00
Jim Harris
c754043946 Revert "thread: speed up io_device lookup by using rbtree"
This reverts commit 2246a93718.

We are seeing a lot of failure on io_device lookup in the test
pool.  These only showed up after this patch was merged and sees
the most likely culprit.  Reverting this patch for now while we
continue debug.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2ab098319dfae3a5356eb4fe0dbf9f4af2d2eea5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8199
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-07 16:17:33 +00:00
Michal Berger
9d8e1ec03c test/common: Reset IFS within print_backtrace()
In case IFS was modified in the environment where print_backtrace()
was called, it could impact the cmd substitution used for seq'ing
the main FUNCNAME loop. Example:

========== Backtrace start: ==========

/home/vagrant/spdk_repo/spdk/test/common/autotest_common.sh: line 980: 1
2
3
4: syntax error in expression (error token is "2
3
4")

Avoid that by resetting the IFS to its default value, but also,
replace said $() with arithmetic evaluation to avoid it altogether.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I4ab098319dfae3a5356eb4fe0dbf9f4af2d2eea6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8013
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2021-06-07 07:26:27 +00:00
Mao Jiang
8742570d72 test/nvme_tcp: cases for handling pdu payload
Change-Id: I1bba56ec5f3061362deac1470cb7b53461f7006e
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8092
Tested-by: SPDK CI Jenkins <sys_sgci@intel.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-06-07 07:25:01 +00:00
Mao Jiang
e9d964bd3c test/nvme_opal: build nvme_opal unittest file
Change-Id: I74bd112800f0d8369bc4d4b7a02080fe3e6cbd1c
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6695
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>
Community-CI: Mellanox Build Bot
2021-06-07 07:24:47 +00:00
Karol Latecki
6d93f9ef67 test/common: update vfio-user capable Qemu branch
This should be vfio-user-master now. vfio-user-v0.6
branch is obsolete.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: Iaa0b429c4de13c59e1f58fe59149367f941d42f2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8062
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-07 07:24:32 +00:00
Mao Jiang
984fdca853 test/nvme_fabric: cases for fabric qpair connecting
Change-Id: I8b7babc5c3feb87c2b38c79dbf3cd158e2178162
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7580
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>
2021-06-04 22:56:36 +00:00
Mao Jiang
da71236778 test/nvme_pcie: cases for pmr mapping
Change-Id: Ie5af8012c15d63625abc4fe92e905aa6a9dc619c
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7943
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-06-04 22:56:28 +00:00
Michal Berger
9c3ba11a29 test/vhost: Commonize some of the environment
Also, remove the unecessary FIXME.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I3feda936cff62d79e921247dd40613c389ac3a3c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6586
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-06-04 22:52:21 +00:00
jiaqizho
81a8bc670c iostat : add -x to display extended statistics
Signed-off-by: jiaqizho <jiaqi.zhou@intel.com>
Change-Id: Ia25257093a13987c40a682c9b5ace4daa15ac607
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4847
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>
2021-06-04 22:47:44 +00:00
Jiewei Ke
84588b3ba8 util: rename RB_ROOT into _RB_ROOT
In examples/bdev/fio_plugin/fio_plugin, it will include fio.h which
defines the RB_ROOT macro. To workaround the RB_ROOT redefined error,
rename RB_ROOT to _RB_ROOT.

Signed-off-by: Jiewei Ke <jiewei@smartx.com>
Change-Id: Ied4f835e4d1657ca5a0a80c13c72845c774618d8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8044
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>
2021-06-04 22:46:40 +00:00
Jiewei Ke
2246a93718 thread: speed up io_device lookup by using rbtree
Use the macros for red black tree provided by Free BSD to speed up
io_device lookup.

Signed-off-by: Jiewei Ke <jiewei@smartx.com>
Change-Id: Ib3bd382bbeb610503194e7d7bfd569f60a0d0121
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7894
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>
2021-06-04 22:46:40 +00:00
Mao Jiang
661825cfc9 test/nvme_ns_cmd: cases for namespace command reading and setup
Change-Id: I774c386480bc5fb20ce40a58ce9b72798f280e6d
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7029
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>
2021-06-04 22:14:58 +00:00
Karol Latecki
7cccf5c5f4 test/common: update irdma driver version to 1.5.2
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I696870dbdc9fa654e270d9fe76f12b7044455527
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7946
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-04 22:14:42 +00:00
Changpeng Liu
45b5676738 nvmf/vfio-user: rename vfio_user_stop_ctrlr() to vfio_user_destroy_ctrlr()
The original function will disconnect queue pairs first and then free
controller memory finally, so rename it to vfio_user_destroy_ctrlr().

Change-Id: Idc235e4186bd4164be712fc9d4cda4991efc6248
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7624
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: <dongx.yi@intel.com>
2021-06-04 22:14:23 +00:00
Changpeng Liu
0cc8bcf508 nvmf/vfio-user: rename destroy_ctrlr() to free_ctrlr()
The coming destroy_ctrlr() function will disconnect
queue pairs and free controller at last, so here
rename the original destroy_ctrlr() to free_ctrlr().

Change-Id: I527b2742142d60b0383be5a12391c77dd50d47a7
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7623
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
2021-06-04 22:14:23 +00:00
Changpeng Liu
3d4b9ba0d4 nvmf/vfio-user: rename destroy_qp to free_qp
The original destroy_qp() only release the queue pair
related memory, and free_qp() will be called inside
destroy_ctrlr() function, so also remove one duplicated
line here.

Change-Id: I2a06a6704b514361685068acda4e65ed5d502f0d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7622
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
2021-06-04 22:14:23 +00:00
Changpeng Liu
12de3673f0 nvmf/vfio-user: remove controller ready field
The controller concept in NVMf is like a session, for any
new connection in nvmf_vfio_user_accept() with the endpoint,
we treat it as a new controller, we don't need the `ready`
field in controller to indicate the connection state, we
need the connection state in endpoint, so here just use
endpoint->ctrlr point to indicate the socket connection
is valid or not.

Change-Id: I588dbba7973cb61a1d79d81324a43e052f7dafb0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7621
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-06-04 22:14:23 +00:00
Michal Berger
e9a4350381 pkgdep/git: Patch QAT driver for changes in crypto API
Details here:

git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0eb76ba29d16df2951d37c54ca279c4e5630b071

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ica523bc4ec6b68fab2549a02476872b4d250a8f0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8041
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
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>
2021-06-04 20:11:58 +00:00
Shuhei Matsumoto
b7cc001a04 bdev/ocssd: find_io_path() returns bdev_ocssd_ns and spdk_nvme_ns pointers directly
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifd5a3f5ab2e87d383da1c3b94949fa2ffd916ecc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8150
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>
2021-06-04 20:11:42 +00:00
Shuhei Matsumoto
55e4be3432 bdev/nvme: find_io_path() returns spdk_nvme_ns pointer directly
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3f2b047c162c7d9cab69c273ca8ac5c2236314fa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8149
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>
2021-06-04 20:11:42 +00:00
Shuhei Matsumoto
980b501c98 bdev/nvme: Separate helper function find_io_path() between nvme and ocssd
This enables us to optimize nvme_bdev for multipath.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I09dcc6b34b4529fe1f90dbe0fddcbee807cf217e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8148
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-04 20:11:42 +00:00
matthewb
6127461c93 lib/bdev: Added iov to spdk_bdev_zcopy_start
Adding iov to the spdk_bdev_zcopy_start function enable spdk_bdev_zcopy_start to
be used by transport layers as the iov is owned by the transport command

Signed-off-by: matthewb <matthew.burbridge@hpe.com>
Change-Id: I6d2be7f49566048bf25b7711ada8d2fb49fea6ee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6816
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: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-06-04 20:10:07 +00:00
matthewb
51d7f9b13f lib/bdev: Removed ZCOPY emulation
ZCOPY emulation is not required. Modules can check if the bdev module
supports ZCOPY.  If not supported the module uses the existing
READ and WRITE operations.

Signed-off-by: matthewb <matthew.burbridge@hpe.com>
Change-Id: Idac0a4d27a79a6c7e567c420e15637e826c347c8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6815
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.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>
Community-CI: Mellanox Build Bot
2021-06-04 20:10:07 +00:00
Jim Harris
b333f00627 nvme: save last transport_failure_reason in transport
If a reconnect fails, we restore the original
transport_failure_reason after we're done with
the failed reconnect.  Save the original reason
in the qpair itself rather than a local variable,
to facilitate upcoming changes where connect will
be asynchronous.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I20ff43fc687a379aa5c930e17cf3ff8d730320be
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8116
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@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>
2021-06-04 20:03:25 +00:00
Jim Harris
43b4883217 nvme: don't reinit qpairs for vfio-user during reset
Previously we were only checking trtype==PCIE to
determine whether a controller was fabrics.  This
skipped the vfio-user case.  So use the new
spdk_nvme_transport_id_is_fabrics() API instead.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I81f26853f44b1c47522ce6354e5aa4a905796bd0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8089
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@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>
2021-06-04 20:03:25 +00:00
yupeng
b832f99f88 nvmf: Add nvmf_set_crdt RPC
Set the three CRDT values at SPDK_RPC_STARTUP time.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: I2fb4c4a3e367a4888cfec4658e6bf6899c7ae1f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8007
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-06-04 20:02:42 +00:00
Ziye Yang
26004a40fb accel_engine: Use the vector based crc32c function.
Purpose: Use the new function in order to reduce duplicated code.

Change-Id: Ie848c7586575b3f0bb617d7e767cf459b43d4783
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8174
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-06-04 20:01:20 +00:00
Michal Berger
c2feee4fef test/common: Free stderr fd from tracing
Consider this:

foo() { echo bar >&2 ; }
set -x
foobar=$(foo 2>&1)
[[ $foobar == "bar" ]]

The above test will fail since $foobar will also include tracing
strings as stderr is where set -x redirects the output. Since in
some cases this may troublesome, replace stderr with a dedicated
fd allocated dynamically.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ia6609e4463b371c07fab42d2bd291c9e43742df5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8158
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-04 19:58:56 +00:00
Michal Berger
70f7ea3e30 test/nvmf: Simplify get_nvme_devs()
This function was unintentionally including trace lines in its output
by playing with stderr (where -x is redirecting its output by default).
Avoid that by simply listing the devices and doing proper checks from
within the actual test.

Spotted in https://github.com/spdk/spdk/issues/1973

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: If15375aca152aaa49267c9cc51e70fd859685ea1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8156
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>
2021-06-04 19:58:56 +00:00
Curt Bruns
522faef3e2 nvme: add cuse support for RESCAN IOCTL
Nvme-cli submits a RESCAN IOCTL after a format command to
update any information that may have changed during the
format, such as LBA Format.  This patch adds support
for RESCAN by executing nvme_ctrlr_update_namespaces to
update the controller information.

Fixes: #1964

Change-Id: I9f03e00a7f39339947ff02390f69ce806e1cfa0e
Signed-off-by: Curt Bruns <curt.e.bruns@gmail.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8146
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>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-06-04 19:58:41 +00:00
Tomasz Zawadzki
47a6578ee5 lib/event: calculate last_stats in event framework
Rather than to rely on schedulers to access and modify
last_stats values over multiple scheduling periods, move that
operation to event framework.

Providing this to the schedulers in generic manner is better
than enforcing that each scheduler has to keep track of this
data on their own.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Icaf3b4af80d86fafaddf328fd230db9743d21ab5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7971
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-06-04 19:58:24 +00:00
Tomasz Zawadzki
005b22d299 ut/event: fix test_scheduler UT
This UT was not working as intended, and was covered by
scheduler implementation and direct modification
of the lw_thread stats in UT.

A single _reactor_run() iterates over all active pollers.
If at least one returns busy, so does the thread.
Thread load at the begining of UT is not 'low', but 100% busy.

To emulate loads outside of the 100% busy/idle, multiple
spdk_thread_polls need to be exectued.

As such to keep this case simple, the busy poller is removed.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I21b4c607977ed5926e0bb2743c33636cfc49f328
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8021
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-06-04 19:58:24 +00:00
Tomasz Zawadzki
dd743a3285 ut/event: verify tsc stats in test_scheduler
At no point in the UT thread and reactor stats
were verified. This patch makes sure that those are
checked and points out a glaring issue fixed in the
next patch.

Please note that spdk_get_ticks() and spdk_delay_us()
increase a single global value, which does not play
well with tests simulating multiple reactors.
As such each round through reactors resets the
global timer and verifies it at the end.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I27878fe35c1606ec20c548fe3bb5ede0102c8a63
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8020
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-06-04 19:58:24 +00:00
Changpeng Liu
a7f526ba1a nvme/opal: check Security Protocol 00h before sending TCG SP
A Security Receive command with the Security Protocol field cleared to
00h shall return information about the security protocols supported by
the controller, so we can check the TCG security protocol is supported
or not before sending it.

Fix issue #1961.

Change-Id: Id061defe45db981b276e2794fd0b59f8db70b7f4
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8083
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.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>
2021-06-04 19:57:36 +00:00
Changpeng Liu
1136107e21 nvme: optimize the error log when OPAL isn't supported
We will print a notice log if the drive can support SECURITY
SEND/RECEIVE commands but not OPAL, so remove the error logs.

Change-Id: Ib26aa727ad1e703d53c387af8507b920606ea9c6
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8055
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.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>
2021-06-04 19:57:36 +00:00
paul luse
475fadf365 examples/accel_perf: don't allocate channel just to get engine caps
Getting/putting the channel races with getting real IO channels
causing issues with an upcoming design. Avoid it entirely by using
the first worker channel to get the capabilties.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I750a8d59e294f4cda9f71f3327afc03e15342768
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8170
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>
2021-06-04 15:48:22 +00:00
paul luse
f31ad9b6f1 lib/idxd: add cache control flag to op codes that support it
Perf improvement, directs DSA to write to cache as opposed to
mem.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I0d6ba157af8f1b54f8aae3b8e54a6f7754e4a9de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8169
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>
2021-06-04 15:48:22 +00:00
paul luse
3e2e2a5765 examples/accel_perf: don't schedule final callback when using HW
This results in a significant performance improvement when using
HW offload engines.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I54d3e39f186c9f878fcf8bed8e9242e29d1e1bf1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8162
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>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-06-04 15:48:22 +00:00
paul luse
2e8ae7294a lib/idxd: stop polling on the first uncompleted location
We already keep a list of outstanding completion locations to
poll and were previously polling all of them.  New ones are
added at the tail and we poll the oldest first from the head
so if we break when we find a slot that hasn't completed we
can get more work done while the HW finishes. This is a proven
performance improvement in limited testing.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Icc15041605586f9a31435d447d253c381c00b1f8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8161
Reviewed-by: Ben Walker <benjamin.walker@intel.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>
Community-CI: Mellanox Build Bot
2021-06-04 15:48:22 +00:00
Changpeng Liu
c52e700774 libvfio-user: update submodule
1. struct pxdcap.per is changed to struct pxdcap.rer
Which matches the name in the nvme spec.
2. use new API return value.
3. update specification changes.

Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Change-Id: Ida421c4cffd1c65d550e83011ab123b321ea9dff
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8088
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-03 04:03:04 +00:00
Changpeng Liu
5b532e80c8 test/vfio-user: add subnqn for all vfio-user tests
After commit a31e319f "nvme: init discovery ctrlr using nvme_ctrlr_process_init"
SPDK will not initialize vfio-user subsystem if we didn't specify it
in the command line, so add this parameter as other transports already use it.

Change-Id: I5331459e9a88d8d94fa8b6ce693e086516b9f0bc
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8120
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-03 04:03:04 +00:00
Changpeng Liu
b70b16acba nvmf: don't use request internal variable after req_complete callback
vfio-user transport `req_complete` callback will zero the internal
NVMe command and response fields, the common NVMf library should
not use them after the callback, so here we use stack variables
to save them before the `req_complete` callback.

Fix issue #1965.

Change-Id: Iff2342b6095d9496cdf112d657a0a99ce1fb5d12
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8129
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-06-03 04:03:04 +00:00
Shuhei Matsumoto
fdc4c13e9e bdev/nvme: Rename nvme_io_channel by nvme_io_path
By the next patch, nvme_io_channel will be used as an I/O channel
to a single nvme_bdev. This channel is created to a single
nvme_bdev_ctrlr and has a corresponding I/O qpair. nvme_io_path
will be a better name especially when we support multipath.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic34162f3c383676c5249396a09173329fc6febce
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8095
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-02 11:37:58 +00:00
Shuhei Matsumoto
5863f95ae4 bdev/nvme: Submit abort command for admin command on the current thread
Previously only a single thread could submit abort commands for admin
commands and it was the thread of the corresponding controller.

When we support multipath, we need to traverse the list of controllers
to which the target admin command is submitted. Threads of controllers
may be different.

On the other hand, the previous implementation made the I/O flow very
clean, but the I/O flow will not be clean if there are many controllers
and the subsystem does not have its thread.

This patch changes the policy so that any SPDK thread can submit abort
commands for admin commands.

Then when multipath is supported, we will be able to traverse the
list of controllers simply on the current thread to abort either I/O
command or admin command.

We already are able to submit any admin command on any thread anytime
including abort command. Hence this will not cause any issue.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib69de33f2e84b03861c7d95ce060035bdb589e4b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8121
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-06-02 11:37:58 +00:00
Shuhei Matsumoto
a4f96d93a8 nvme: Initialize ANA state to optimized if ANA reporting is not supported
Initialize ANA state of each namespace to optimized regardless of
whether ANA is supported or not. This will simplify the code to get
the optimal I/O path because we do not have to care if the namespace
supports ANA.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I24dfe08674af398671de6528b884e9d82409eeae
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7890
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-02 11:37:58 +00:00
Shuhei Matsumoto
a3f581e83b bdev/nvme: Inline nvme_bdev_to_bdev_ns() and remove it
It is unlikely that managing namespaces by nvme_bdev is complicated.
Hence we do not need the helper function nvme_bdev_to_bdev_ns().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I77b4dcd12b2f2a219f58e5bc7b7e51dd10635da4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8118
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-06-02 11:37:58 +00:00
Shuhei Matsumoto
d4558c6132 bdev/nvme: Reduce conversion between spdk_bdev_io and nvme_bdev_io
We can hold bdev_io directly in nvme_bdev_ctrlr as an outstanding reset.

We can put spdk_bdev_io_from_ctx(bio) into a parameter for a few
functions because it is used only once in a function.

Passing not spdk_bdev_io but nvme_bdev_io to bdev_nvme_verify_pi_error()
remove unnecessary substitution.

This is a little more efficient and simplifies the implementation.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If49ad9fa42abf27decf3afcd8c994f55faa3bc70
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8094
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-06-02 11:37:58 +00:00
Mao Jiang
f70180d50d test/nvme_cuse: cases for cuse submitting io
Change-Id: I21f640c1d633884543961b382c400449caba241b
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6935
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-06-02 11:37:33 +00:00
Ziye Yang
b85127cc6f util/crc32c: Add spdk_crc32c_iov_update.
Purpose: To support caculating crc32c for iovs.

Change-Id: I7ea6d8b71ea2cf6e8b81903439787870923b9bef
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8093
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-06-02 11:37:17 +00:00
Ziye Yang
ee8f6dd1d5 sgl.h: Add a new internal header file.
The purpose is to reduce the duplicated code in nvmf and iscsi
layer.

Change-Id: I7e96f0d5bb1ba4b81378addca3cdd929056384e9
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8132
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
2021-06-02 11:34:27 +00:00
ChengqiangMeng
6a49507c47 unittest/nvme_rdma: increase code coverage for nvme_rdma.c
nvme_rdma_parse_addr and nvme_rdma_qpair_init code comprehensive coverage.

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: I7474281a2b80c092f0ed516e1da3649473eb0fa3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7337
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-06-02 10:23:51 +00:00
Jim Harris
9f5e3c99f2 nvme: add spdk_nvme_ctrlr_is_fabrics()
We map the SPDK_NVME_TRANSPORT_* values directly to
the NVMe-oF trtype values.  Since PCIe isn't
Fabrics, we choose 256 which is outside of the
8-bit trtype range of values.

So we can just check if trtype >= 256 to determine
if the trid is for fabrics or not.  This is
preferable to checking PCIE || VFIOUSER in case
additional non-fabrics transport types are added
in the future.

I considered taking a trid as the parameter instead,
but went this route since it is consistent with
the existing spdk_nvme_ctrlr_is_discovery().

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib62ff4d30549b2324486c81f2dce67f0f1741e9b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8077
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-06-01 07:43:12 +00:00
Jim Harris
d6f6ffd274 nvme: add NVME_CTRLR_STATE_CONNECT_ADMINQ
Connect the adminq as part of controller initialization
instead of controller construction.

We never actually 'connected' the adminq for
PCIe or vfio-user transports, since its a nop.
But their connect_qpair transport ops function
is also a nop for the adminq, so it's fine to
generically connect the adminq across all transports.

Note that we cannot read registers (cc or csts)
during controller initialization now until after
the adminq has been connected since reading fabrics
registers depends on a connected adminq.  This gets
special cased for now, but eventually reading
cc and csts will need to be part of the state machine
itself to make it asynchronous.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia5566d7c549d78d24b94ea253df51e697da6237f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8079
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-06-01 07:43:12 +00:00
Mao Jiang
0651ffe3f1 test/nvme_rdma: cases for rdma group connecting qpair
Change-Id: Ia2d76fb364671971d3c78555ab203c3c565ec2f3
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8029
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-06-01 07:42:55 +00:00
Ziye Yang
252430a053 nvme_tcp: Correctly handle the data digest err
According to NVMe-oF 1.1 spec, it is not a fatal error.
So according to Figure 126 in NVMe Base specification,
we should return "Transient Transport Error".

Change-Id: I601304ae2bb24508882fb1ec8c7e53ec587ab515
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7795
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-05-31 07:15:16 +00:00
Michal Berger
860a61f6eb autobuild: Export EXTERNAL_MAKE_HUGEMEM if set
EXTERNAL_MAKE_HUGEMEM can be currently used from the external_code
suite.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I4359edc62ebdee91b261133877523c52175cb248
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8059
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-05-31 07:14:28 +00:00
Michal Berger
3a53213fb3 autobuild: Run scan-build under a dedicated test flag
Also, move ocf build outside the autobuild suite to make sure
scanbuild also picks up all the pieces.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I5f0de407cc55b1dc153cc856f68e053a54fc0682
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6841
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-31 07:14:28 +00:00
Karol Latecki
4e4c2cd8e3 scripts/nvmf_perf: make rate_iops actually optional
Change-Id: Ie46df6e4f52b59941a90eeb786954fe7d5f1d089
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8040
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-28 14:25:54 +00:00
Jim Harris
a31e319fbb nvme: init discovery ctrlr using nvme_ctrlr_process_init
This ensures the discovery ctrlr initialization is
done the same as normal ctrlrs.  This will be
critical as we make the driver fully asynchronous.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I33c4fd7c82d241c30e7adb89abe79b8088c8776a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8090
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-28 08:14:06 +00:00
Jim Harris
f5ba8a5ef5 nvme: add NVME_CTRLR_STATE_READ_CAP
Read CAP (Capabilities) register as part of controller
initialization instead of controller construction.

For now, still read CAP in the pcie and vfio-user
controller construction, since they need the
drstd (doorbell stride) to construct the admin
queue.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I000fe880f2ec0d6de1d565c883d7ea0ae1ac2c81
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8078
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-28 08:14:06 +00:00
Jim Harris
df01076f70 nvme: add NVME_CTRLR_STATE_READ_VS
Read VS (Version) register as part of controller
initialization instead of controller construction.

This prepares for upcoming changes to make
controller attach fully asynchronous.  Since reading
fabrics registers is an asynchronous operation, it
will be easier to read the VS register as part of
controller initialization which operates as an
asynchronous state machine.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I771386dbdf5902633e0d9f91b3b20be98f26fdc3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8076
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-28 08:14:06 +00:00
Jim Harris
a12cf26cdd nvme: add NVME_CTRLR_STATE_CHECK_EN
We're going to be adding some new states (READ_CAP
and READ_VS) in future patches, that we want to
come before the current "INIT" state.

So we will simply make "INIT" have the same
value as this new NVME_CTRLR_STATE_CHECK_EN state
for now.  That means existing code won't have to
change later once we add new states that come
before CHECK_EN.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I07ca92e28ab1cd8d838cdef5c3ff36ba80a224bf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8075
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-28 08:14:06 +00:00
Tomasz Zawadzki
3db73426f2 lib/event: update current_stats at the time of thread reschedule
_reactor_schedule_thread() zeroes out the lw_thread on move.

To properly calculate thread stats since the move,
save them right after reschedule.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I44cc3b5907adda35b3117c2dd7268dc813d59853
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7919
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-28 08:13:48 +00:00
Tomasz Zawadzki
e0d448e7f6 lib/event: remove snapshot_stats
spdk_thread keeps track of tsc from its whole lifetime,
those can be requested with spdk_thread_get_stats() at any time.

spdk_lw_thread uses stats from above and keeps track of two points in time:
- current_stats reflecting stats at the time of gather_metrics stage
- last_stats reflecting stats from previous gather_metrics stage

1)
Before this patch current_stats were duplicated in snapshot_stats.
There is no need for that so now they are removed.

2)
Removed _spdk_lw_thread_get_current_stats() since it would be copying
current_stats to current_stats, thus not perform any action.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5e5d4039cd0f7cc10ba150a3d915b90ec96589d7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7842
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: Ben Walker <benjamin.walker@intel.com>
2021-05-28 08:13:48 +00:00
Tomasz Zawadzki
0598e484d7 lib/event: set thread for each event executed
Whenever an event executes, it might change the currently
set thread or reset it to NULL.
To prevent it from affecting other events, set the current
thread each time an event executes.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6f1e7f8b7acab25353b4782058e87a9e01aab2c8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8045
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>
2021-05-28 08:13:48 +00:00
Tomasz Zawadzki
a4bf3e1099 scheduler_dynamic: exit early from _get_thread_load()
_get_thread_load() is function used to determine
the load of a thread based on relation of busy/idle tsc
from previous scheduling period.

In order to avoid division by 0 calculating the percentage,
we can simply exit early determining that thread was not
doing any work.

Having this check here will make sure that no matter
the changes in event framework, scheduler dynamic will work.

Removed the place that updated last_stats if they weren't
yet updated at least once (first scheduling period iteration).
In this case after change to _get_thread_load() will be the same,
as only the latest iteration will be used to calculate thread load.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I75f0f12f024675f2473a26e30596d6eb28093d46
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7917
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-05-28 08:13:48 +00:00
Ziye Yang
d172854aa7 configure: Fix the nasm version detection.
I used the nasm with unstable version while compiling SPDK with ISA-L.
And when running nasm -v, it shows:

NASM version 2.16rc0 compiled on May 27 2021

So the version checking in the script is not correct,
it will get "2.16rc0", but not "2.16".  Then the version comparison
will fail.

This patch will fix such issue when users use an unstable nasm and it
also works for the stable version.

Change-Id: I950458f681642d7e1f5fc69acf2ced2e1342c9cf
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8082
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-28 07:20:35 +00:00
Changpeng Liu
cfff04aea2 nvme/cuse: add subsystem reset IOCTL support
Change-Id: Id85989d0ae1246cb60fff4a41e5847a2d84e271f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8084
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-28 07:20:23 +00:00
matthewb
8a7f6e71b6 test/bdev/bdevperf : Added check for ZCOPY Support
If the -Z option has been specified bdevperf checks that the bdev
module supports ZCOPY.

Signed-off-by: matthewb <matthew.burbridge@hpe.com>
Change-Id: I0bebad68090f48a1b1250afe4bc4c752c2061bfb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7352
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-27 07:35:59 +00:00
Rui Chang
080118cd83 lib/nvmf: Add current qpair count to poll group statistic
In struct spdk_nvmf_poll_group_stat, there are statistics of cumulative IO and
admin queue pair counts. But current qpair counts are not reflected. Use
this patch to add current admin and io qpair counts for a poll group.

Signed-off-by: Rui Chang <rui.chang@arm.com>
Change-Id: I7d40aed8b3fb09f9d34e5b5232380d162b97882b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7969
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Eugene Kochetov <evgeniik@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-27 07:35:49 +00:00
Changpeng Liu
75a507736b vhost-blk: use device name for VIRTIO_BLK_T_GET_ID
Block device product name is same among same type
of the block devices, while Guest VM may use this
value to generate UUID, so here we change it to
block device name instead.

Change-Id: I58c5fb271a6a436c15520616c2065eee9c37300a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7996
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-27 07:35:37 +00:00
Michal Berger
43aca60458 scripts/fio-wrapper: Move devices sync to configure_devices()
This is to make sure we sync devices for both nvmf and iscsi
protocols.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ifec6cc2d240a5b22b73e9f4087ae328568e4fe4a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8042
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-05-27 07:35:29 +00:00
sunshihao520
c1a41845cf lib/bdev: Change spdk_bdev_read_blocks_with_md arg offset definiton from int64_t to uint64_t.
Signed-off-by: sunshihao520 <sunshihao@huawei.com>
Change-Id: I25c3ae4f12d0ab4e2f3811e36028a04a1f32d862
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7869
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-27 07:35:17 +00:00
John Levon
940f06490c vfio-user: update for libvfio-user region offset API change
Now, vfu_setup_region() must specify the region fd offset (which is always zero
in our case).

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I10795d848a4c73ee9e1e78ea63776074401c4b17
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8022
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-27 01:33:31 +00:00
Shuhei Matsumoto
924bfd067e bdev/nvme: Add ANA state per namespace into JSON info dump
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idc0e783a2a4373a4269276aab8b1d857ed73caae
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7509
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-26 09:22:55 +00:00
Shuhei Matsumoto
8c2738a8fe bdev/nvme: Add UUID and EUI64 comparison to check if two namespaces are identical
Following Linux NVMe host, add UUID and EUI64 comparison to
bdev_nvme_compare_ns().

Besides, previously the return value of memcmp() had been used as
the return value of bdev_nvme_compare_ns() and this was wrong.
Fix it in this patch together.

Add unit test cases for bdev_nvme_compare_ns().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I069ab53e77741d6348b847d51e84a9338e2f3787
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7755
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-26 09:22:55 +00:00
Jiewei Ke
eabe783cc4 bdev: speed up bdev name lookup by using rbtree
Use the macros for red black tree provided by Free BSD to speed up bdev
name lookup in spdk_bdev_get_by_name().

In the bdev_multi_allocation test, we can get 3x ~ 5x speed up when
creating multiple bdevs for various bdev nums.

Signed-off-by: Jiewei Ke <jiewei@smartx.com>
Change-Id: I49a2fbcccf06d4c36cbd445ce59e0b0dd4ada31d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7837
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-26 09:22:06 +00:00
Jiewei Ke
1a22f9b6ac bdev: clean up spdk_bdev_register()
Clean up spdk_bdev_register() to facilitate the upcoming patch which
uses RB tree to speed up bdev name lookup.

* move TAILQ_INSERT from bdev_start() into bdev_init();
* rename bdev_init() to bdev_register() and rename bdev_start_finished()
  to bdev_register_finished();
* inline bdev_start() into spdk_bdev_register().

Signed-off-by: Jiewei Ke <jiewei@smartx.com>
Change-Id: Idbfc800472bc8c6f9b615046e082772e9f6026e3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8043
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
2021-05-26 09:22:06 +00:00
Ziye Yang
c3cf9ec295 rbd/rpc: Add a rpc call to get the info of the clusters.
Purpose: Let the users know the current available registered Rados
cluster and the related info.

Change-Id: I115c129ae6e4b0372579aad168fd88f8be136357
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7990
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-26 09:21:48 +00:00
ChengqiangMeng
f90eaf1672 unittest/nvme_ctrlr: increase code coverage for nvme_ctrlr_identify_namespaces_iocs_specific_next
nvme_ctrlr_identify_namespaces_iocs_specific_next code comprehensive coverage.

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: Icf039e15a983b04fcd1b558559ba651e495a6cd1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8006
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
2021-05-26 09:21:10 +00:00
Rui Chang
fcc389490a configure: add gcc version check for ARM Neoverse-N1 platform
When doing debug build on ARM Neoverse-N1 platform, if gcc version is
lower than 8.4.0, we may met following errors:

/tmp/cc24qua1.s: Assembler messages:
/tmp/cc24qua1.s:53: Error: selected processor does not support `casp x0,x1,x2,x3,[x4]'
/tmp/cc24qua1.s:85: Error: selected processor does not support `caspa x0,x1,x2,x3,[x4]'
/tmp/cc24qua1.s:117: Error: selected processor does not support `caspl x0,x1,x2,x3,[x4]'
/tmp/cc24qua1.s:149: Error: selected processor does not support `caspal x0,x1,x2,x3,[x4]'

The change also fix the problem by pass armv8.2-a+crypto as target architecture.

Signed-off-by: Rui Chang <rui.chang@arm.com>
Change-Id: I2053b9440e06873066480d63e471802df2e69d4e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7949
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-26 09:20:58 +00:00
Michal Berger
3f674e1e29 test/setup: Perform custom alloc based on hugepages' size not quantity
512 and 1024 number of hugpages is not a sensible value in case 1G
hugepages are in use. Instead of setting fixed number of hugepages,
determine it safely based on the default size and allocate 1GB for
node0, 2GB for node1 (if present).

Fixes: #1954

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I850ba877332527a68ec4ddf7408fcc183835cda6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8012
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-05-26 09:20:44 +00:00
Jiewei Ke
d07c581b7d nvmf: nvmf_get_ana_log_page should use iov to store the log page
nvmf_get_ana_log_page used req->data to store the log page result.
While the req->data only contains the first iov, if req->iovcnt is
larger than 1, the req->data may not hold the complete log page; and
even worse, the log page result may be written to invalid address and
cause memory corruption.

The following patch will fix the same issue for other commands in
nvmf_ctrlr_get_log_page.

Fix #1946

Signed-off-by: Jiewei Ke <jiewei@smartx.com>
Change-Id: I495f3be05c82be5cd53609772c655c8924b9179f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7923
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Mellanox Build Bot
2021-05-26 09:20:30 +00:00
Ziye Yang
2250abaeca nvme/tcp: Raname send_pdu to pdu in tcp_req.
Since we will reuse send_pdu for other purpose in the next
patch.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Iee5166131b70a25bc13aaa847bfc9066231f31a9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8028
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
2021-05-26 09:20:15 +00:00
Ziye Yang
9776b89444 nvme/tcp: Fix the bug when doing offloading.
For nvme/tcp connection, we use the synced manner
if the qpair is not fully connected. Thus without
the check, we will stuck here. And this patch
fixes this issue.

Change-Id: I72815bf5b4c0b31c4866bc1b9034b0e42b81d3f1
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8025
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>
Community-CI: Mellanox Build Bot
2021-05-26 09:20:15 +00:00
Ben Walker
dde419084b event: Move json config loading to init
Loading subsystems and restoring state from a JSON config file is useful
outside of the SPDK application framework, so move it to lib/init.

Change-Id: I7dd3ceace2e7b1b28eef83c91ce6a4eedc85740e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6645
Reviewed-by: Tom Nabarro <tom.nabarro@outlook.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-26 09:13:34 +00:00
Ben Walker
9f62796127 event: Move RPC server initialization to init
I'm not sure whether this should go into lib/init or to lib/rpc
directly, but I've chosen lib/init for now.

This is to support applications that want to run the SPDK JSON
RPC server, but aren't using the SPDK application framework.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I79ca39aa0ca6e1a3a6905b0bf73e6cc99b086e55
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6644
Reviewed-by: Tom Nabarro <tom.nabarro@outlook.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@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
2021-05-26 09:13:34 +00:00
Ben Walker
dc9374dd2f init: Declare a formal public API
The functions to initialize the SPDK subsystems or tear them down
was previously an internal-only API. Make it public for use by
applications that aren't leverage SPDK's application framework.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I2ebfd020e6fa4c1947fa1c1a2ac509ce9b0242f8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6643
Reviewed-by: Tom Nabarro <tom.nabarro@outlook.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-26 09:13:34 +00:00
Ben Walker
1a8467b02c init: Make some functions entirely private
There were some functions in the internal header that can be entirely
private to the init library. Move them over.

Also, remove the support for including the header from a C++ file
because these headers are internal to SPDK which is pure C.

Change-Id: Ic4323b2b8664e70106a57b3ca8acbc7c2efe621d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6642
Reviewed-by: Tom Nabarro <tom.nabarro@outlook.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-26 09:13:34 +00:00
Ziye Yang
00b0dc6624 nvme/tcp: Do not offload header crc32c calculation if header digest is enabled.
The header size is very small, which does not have too much value to
offload such calculation by hardware.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Iaa82f39312df7eef3282325a33677ea41ab735ab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8011
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-25 07:12:43 +00:00
Changpeng Liu
51b6cbb9a7 examples/nvme/identify: pass nsid to Error Recovery feature
The P5800X drive will report the following error when getting Error Recovery
feature, according to the specification we should pass valid nsid.

nvme_qpair.c: 238:nvme_admin_qpair_print_command: *NOTICE*: GET FEATURES ERROR_RECOVERY cid:23 cdw10:00000005 PRP1 0x0 PRP2 0x0
nvme_qpair.c: 452:spdk_nvme_print_completion: *NOTICE*: INVALID NAMESPACE OR FORMAT (00/0b) qid:0 cid:23 cdw0:0 sqhd:000f p:1 m:0 dnr:1
get_feature(0x05) failed

Fix issue #1955

Change-Id: I30ce60cddcddbf78e57a8c172a2056a82ac72802
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8009
Reviewed-by: Chengqiang Meng <chengqiangx.meng@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: <dongx.yi@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-25 07:12:20 +00:00
Changpeng Liu
7ee25c2e4c examples/nvme/identify: rename get_features to get_ctrlr_features
This will help us to add get namespace features later.

Change-Id: I7e809cd9e3bcb3874ce141183b9c4ee82543616c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8008
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <dongx.yi@intel.com>
2021-05-25 07:12:20 +00:00
Tomasz Zawadzki
42ad9d0379 lib/blob: resize open_blobids on bs load
open_blobids holds bit array of currently open blobs,
this is a way for quicker determination than iterating
over all blobs. See patch introducing it:
(30ee8137)blob: Add a bitmask for quickly checking which blobs are open

That patch added resizes of this bit array to bs init
and bs recovery path (not shut down cleanly).

But that patch skipped over bs load from a clean shutdown.
This resulted in blob open having multiple blob pointers that
target the same blob id.

Fixes #1937

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3c42a63d168d1f5b013b449f010c5b207936045b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7998
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Community-CI: Mellanox Build Bot
2021-05-25 07:12:07 +00:00
Tomasz Zawadzki
e65310624b lib/event: accumulate idle_tsc when reactor has no threads
Before this patch idle_tsc was sum of all idle tsc of all
threads running on a reactor.

There are cases when no threads are present on the reactor,
and _reactor_run() spins doing nothing.

To give more accurate representation of the reactors state,
the idle_tsc now adds time spent doing idle spinning.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If797b2a03507d17b07367d56d5f6c40cefbbbd49
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7900
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-25 07:11:53 +00:00
Tomasz Zawadzki
a5ad0f8051 lib/event: update reactor tsc_last going poll mode
Disabling interrupt mode on reactor now updates the tsc_last
to current time. So any further tsc caulations will not account
for the time when reactor was in interrupt mode.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I56fb8a738eea60ee5de3b49d586f7cb228b54510
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7901
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-25 07:11:53 +00:00
Tomasz Zawadzki
7438c388a0 lib/event: fix tsc_last for first thread on reactor
tsc_last value is used to update thread stats
during _reactor_run(). See:
spdk_thread_poll(thread, 0, reactor->tsc_last);

If no threads were present on the reactor,
this value got outdated and resulted in
adding time reactor spent with no threads to
stats of the first thread placed on that reactor.

This patch fixes thread stats by making sure
that argument to spdk_thread_poll() is up to date.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I0c35fdba1b63b6ee19a5a2b34751090839cb2438
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7845
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: Konrad Sztyber <konrad.sztyber@intel.com>
2021-05-25 07:11:53 +00:00
Tomasz Zawadzki
320fdaa325 ut/event: add current reactor tsc accounting
This patch does not change the UT in functional way.

Added accounting of last_tsc and spdk_get_ticks() similar
to the real application.
First the reactor_run() [not _reactor_run()] starts
reactor->tsc_last to current time. UT now set it at the start
and never touch it again directly.

Second the spdk_get_ticks() is updated to the elapsed time
to simulate flow of time, and make sure that its further
usage is up to date to the current time.

Fixed typo in test case description for test_reactor_stats.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Iaa2eb00fa3bffc2f21f1692da0259f1d023086b8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7904
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Mellanox Build Bot
2021-05-25 07:11:53 +00:00
Ben Walker
af935f768e event: Shift subsystem initialization code to a separate library
This is useful for applications even if they elect not to use the SPDK
event framework.

This doesn't shift everything in one go - just the subsystem
initialization logic. Configuration file loading also needs to move
in a separate patch later.

Change-Id: Id419df1045442d416650ed90e5ee78adfdd623d7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6641
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-24 10:12:50 +00:00
ChengqiangMeng
36cb16219e unittest/nvme_tcp: increase code coverage for some handle
nvme_tcp_c2h_data_payload_handle and nvme_tcp_c2h_term_req_payload_handle and nvme_tcp_icresp_handle code comprehensive coverage

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: Ib7ccc7dbab11990f851807c0b07e7c0e67e61bde
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7872
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-05-24 10:12:14 +00:00
Mao Jiang
f596245ce6 test/nvmf/ctrlr: cases for ctrlr creating and destruct
Change-Id: Ib4b3c124e6906e63409afc7e225d5afb89a28e76
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7612
Community-CI: Broadcom CI
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>
2021-05-24 10:11:52 +00:00
Michal Berger
cf091238f5 test/make: Ignore abidiff's exit status
Upon running abidiff to get the list of impacted interfaces it seems
to exit with != 0 status. This triggers errexit causing the script
to exit in the middle of processing the lib files so we don't get
the full picture of all potentially impacted files. Ignore the
exit status in this case and allow the loop to go through all the
.sos.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I7edc5122161b0927fdd9a918571419f32fd46dac
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7815
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-24 10:11:05 +00:00
Michal Berger
24e0f403b8 test/make: Fix LTS tag lookup
Replicating 00afb74669.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I19049e35ad959a34342cd714d805db6bdd933ea4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7814
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-24 10:11:05 +00:00
Michal Berger
6c1a1a3dca scripts/rpc: Make sure address argument is properly interpreted
In case the addr argument was not an existing unix socket file the rpc
client would consider it to be an actual ip address. As a result
connect() would be called with improper set of arguments. This could
cause the rpc.py to block for undesired amount of time until connect()
finally decided to return (seen on some fedora33 builds).

This was affecting sh wrapper functions like waitforlisten() which
use rpc.py to determine if given app is ready to be talk to blocking
execution of the tests for way too long then intendent.

To avoid such a scenario determine the format of the address and use
routines proper for given address family.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Iaac701d72c772629fa7c6478ff4781b0c5d485d5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7777
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2021-05-24 10:11:05 +00:00
Michal Berger
ef68667a82 pkgdep/git: Remove 20.01 release workarounds
There's already a new LTS release in place, hence these workarounds
are not needed anymore.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Idf597a5cf8da18d75f2630d59a277d4545fadc0f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7987
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-24 10:10:41 +00:00
Michal Berger
f8d6541d04 freebsd: Replace use of \s with [[:space:]]
In latest 13.0 release of freebsd sed is not accepting \s anymore,
hence it needs to be replaced. Note that only parts of the repo
which are touched by freebsd during the tests are updated.

Details https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253893

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I217208511af8f98e7033f8f24a343b5ca9c48825
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7986
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-24 10:10:41 +00:00
Michal Berger
022ecaa7f1 vm_setup: Don't fail on freebsd if etc_os-release package is missing
This package is not available under latest 13.0 release, however,
the /etc/os-release we are looking for is already installed there.
For older versions, and in case this package is missing, we still
can determine that we are running under freebsd as part of the
fallback check to uname().

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I6a04eb66392d91899a4b55d4eb508bef140e924a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7985
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-05-24 10:10:41 +00:00
Ben Walker
15ae31fb0c nvmf: Rearrange spdk_nvmf_requset for cache line locality
Get all of the hot stuff to the first cache line.

* Shrink the xfer enum to one byte (it only has 3 values).
* Pull out the dif enabled flag form the dif structure so it
  can be access separately
* Rearrange the members

Change-Id: Id4a2fe90a49c055a4672642faac0028671ebfae9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7827
Community-CI: Broadcom CI
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-24 10:10:19 +00:00
Ziye Yang
d33f44866d rbd: Fix the name comparison bug.
Checked the definition of strncmp. If substring s1
is found in strnmp(s1, s2, len), then it will return 0.

For the len value, it is better to use strcmp. Otherwise,
if s1=cluster1, s2=cluster & len=strlen(s2),
strncmp will return 0. But they are two different strings. For
cluster names, they are different.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I15a06184d834cd1567b329d0322cd6bdea6fee4b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7991
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: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
2021-05-24 10:09:44 +00:00
Tomasz Zawadzki
1180c390c1 lib/thread: fix iterating over paused pollers
(cd83ea4a)thread: Add SPDK internal APIs spdk_thread_get_first/next_active/timed/paused_poller()
Patch above by mistake iterates over active_pollers list
for function that lists paused pollers.

Fixes #1947

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1b69d942675f34f5f046ec46feacc8d81d89f015
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7952
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: <dongx.yi@intel.com>
2021-05-24 10:08:34 +00:00
Tomasz Zawadzki
ceaa0c7fa9 lib/blob: complete multiple persists
When blob persist starts, there can already be multiple
of such requests pending. It is possible to complete
a set of persists at once, if blob state after their
execution would be the same. This is the case when
persists are already pending when a particular persist
request is started.

This patch implements such mechanism by introducing
persists_to_complete queue, containing entries that
were previously queued up before starting the current
persist request. If there are any entries in this queue,
further requests are put into pending_persists.

When first request from persists_to_complete is persisted,
completions are issued for all requests on that queue at once.
If at that point there are any new entries on pending_persists,
all of them are put into persists_to_complete. Persist process is started
again with the first request from that queue.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I10063e55d6f821b1863de016d3148da6a719a422
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7643
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>
2021-05-24 10:08:00 +00:00
Rajarshi Chowdhury
119158cda8 configure: Added --disable-apps option.
Together with options to disable examples, tests and unit-tests
this will enable us to build SPDK without linking any executables.

This is useful for packaging SPDK in applications - especially
those using own ENV.

Fixes #1877

Signed-off-by: Rajarshi Chowdhury <rajarshi.chowdhury@oracle.com>
Change-Id: I0467ec497d2abe2fad40cdb4ba723a240bee46d6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7462
Community-CI: Broadcom CI
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-24 10:05:34 +00:00
Michal Berger
7bea0a074f scripts/vagrant: Create user netdev for openstack network
The openstack tests require to have one interface available under
specific ip, 10.0.2.15. This ip is a first lease VM receives from
the user network which is preconfigured in libvirt environment.

Use this instead of defining completely separate network which
by the very default will serve its own DHCP service as well. This
may result in a cosmetic issues (e.g. two ips, static one and
dynamic one on the interface) of having inconsistent config on the
VM depending on how the net device is configured by the underlying
distribution.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ie3da26eebcfb0de668166c4a0120c65aec104540
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7441
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: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
2021-05-24 09:58:17 +00:00
Michal Berger
0c25e6fbbc test/openstack: Clean up the test
This is done as part of the work to fix currently existing CI job
using this particular test suite.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Id5e9e8a814fb3025f192871650b8aa317f2de910
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7440
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: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
2021-05-24 09:58:17 +00:00
Krzysztof Karas
994be25fe1 spdk_top: move mvhline() function call inside show_core
Moves "mvwhline(core_win, 6, 1, ACS_HLINE, CORE_WIN_WIDTH - 2);"
upwards to increase readability by placing this call in order
(to print the line in 6th row after data in 5th row is done printing)

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: Icec340231090aeb57c600f52b3c687dbc78cc4b9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7959
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-24 09:57:47 +00:00
Krzysztof Karas
6f9d124888 spdk_top: change where sore_last_run_counter() is called
Changes where store_last_run_function() is called. Before this patch
this function was used inside refresh_pollers_tab() and it overwrote
last run counters of each poller before show_poller() function had a
chance to use them. As a result poller details window was always
showing zeroes instead of actual difference in run count between each
application loop.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I96219698f7f0b51b94ffe8c0d6bf40f73cbf8a82
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7951
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-24 09:57:47 +00:00
Krzysztof Karas
49bc3005f5 spdk_top: move store_last_run_counter() function
Moves store_last_run_counter() function to allow next patch to
call it earlier in the code, inside get_data() function.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I1e37080ec86309bbf33442fa12cbe9dc575cc864
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7950
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-24 09:57:47 +00:00
Krzysztof Karas
39950bc8f9 spdk_top: reduce number of poller global structures
Deletes g_pollers_history and store_pollers_last_stats() function
to simplify spdk_top code.

Adds last_run_counter to show_poller() function to get last state
of poller's run counter for comparision with current value and
display in pop-up window.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I236fbcac31e67a617d37ba15888aeb30e3763e01
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7925
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-24 09:57:47 +00:00
Krzysztof Karas
081a4a0943 spdk_top: reduce number of global thread data structures
Deletes g_thread_history and g_thread_info to use g_threads_stats
across the whole application to simplify spdk_top code.
Now instead of separate struct, fields last_busy and last_idle are
being used.

get_data() function now uses local structure to get RPC data instead
of filling global one. This has been changed so that g_threads_stats
keeps its last_busy and last_idle fields unchanged.
free_rpc_threads_stats has been moved down so that in future patches,
when multithreading is implemented, there is no need to lock
g_threads_stats during RPC call.

Changes places of allocation/deallocation of g_threads_stats, since
we want to save last_idle and last_busy fields instead of zeroing them
out each application loop.

Changes show_thread() function to use local copy of threads array
instead of pointers to global struct. This is for the convenience
in the future patches implementing multithreading to avoid the need
to lock the global struct for details display.


Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I0dc87eac4c1b89fa16f14f5387d94ee176dfdf43
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7587
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-24 09:57:47 +00:00
Krzysztof Karas
22edbe9626 spdk_top: change where get_data() and free_data() are called
Move part of code with get_data(), refresh_tab() and free_data()
inside show_stats() upwards to make sure data structures are
up to date for pop-up details windows.

Delete get_data(), free_data() calls from show_thread(), show_poller()
and show_core functions.

Add data freeing right before rpc calls inside get_data() to let
pop-up details windows to use updated data before freeing it.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I0d78eb7a48b0cdff4284815afc1a214b0effd7fc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7953
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-24 09:57:47 +00:00
Krzysztof Karas
e2b6cf2f96 spdk_top: move sort_threads function
This function is going to be needed in get_data() in the next patch.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I9368b4567a92ca20d830c3475e3120ee691b84c1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7947
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-24 09:57:47 +00:00
paul luse
eb5a111398 lib/idxd: move the crc destination * from the desc to comp record
Was using reserved field in CRC to store the final address of where
to put the result, this not legal.  Move to the completion record
and slightly re-arrange the struct to keep it at 96 bytes.

Refacorted the IO prep function so the caller can udpate both the
descriptor and completion records instead of continuing to add
parameters to the prep function for opcodes that need something
unique in the completion record.  This also allowed for a minor
fix where the prep function was returning NULL when vtophys failed
which would have indicated busy as opposed to failire.  Now we can
proprely fail that path.

fixes #1929

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ic23bc7b68bdd5757c30b7963880677f423368e20
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7735
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>
2021-05-22 18:42:35 +00:00
Michal Berger
274f52b527 autobuild: Separate unit tests from autobuild
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: If6ce4d3f7bc58855ba61b352be71dff404c87720
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6819
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-21 12:56:48 +00:00
Karol Latecki
7908736c22 autobuild: update patches for mainline DPDK
Patches stopped applying cleanly because of dpdk/dpdk changes:
7d5cfaa7508de0fd248b05effbf421a98317006a
4ad4b20a79052d9c8062b64eaf0170c16a333ff8
Needed to rebase custom patches.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I1006f7f6ba21a3cee5b607cfc44adedb4c1d5830
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7903
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-21 08:04:49 +00:00
Mao Jiang
bb27314c03 test/nvme_pcie: cases for mapping io cmd
Change-Id: Icf174668e9b1361bb232db4a0cc53921423a17a4
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7671
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>
2021-05-21 08:04:39 +00:00
Karol Latecki
b686c82581 scripts/nvmf_perf: update add_listener rpc call
nvmf_subsystem_add_listener() in rpc/nvmf was modified
by 64debe0453 and the
change was not reflected in performance scripts.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I7bb8c39ab225421964e37883aa7b0f824e8df683
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7978
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-21 08:04:24 +00:00
Jacek Kalwas
dd9350c7e6 build: fix missing pthread dependency for syslibs pc
SYS_LIBS var is used to generate Lib.private section of
spdk_syslibs.pc

lack of pthread can result in linking issue when spdk's *.pc are used

please note that usage of -lpthread and -pthread is not consisent
within system wide pc files

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I2dd327371d5621ea12f1e2f7abdfe6b7aa6602eb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7253
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Szulik <maciej.szulik@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
2021-05-21 08:04:09 +00:00
Jim Harris
887109bf9e scripts: add bpf/syscalls.bt
This script counts how many times each syscall
is called by the SPDK application.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ife5efccee73e407e1d819293786f2acdfa317f78
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7713
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: Konrad Sztyber <konrad.sztyber@intel.com>
2021-05-21 08:03:27 +00:00
Jim Harris
dca7ef2759 scripts: add bpf/readv.bt
This script captures a histogram of the returned values
from the readv syscall.  It can be useful for analyzing
the efficiency of our sock/posix implementation.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I910eb2e81e3416855cda7a3854982cd02476850e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7712
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: Konrad Sztyber <konrad.sztyber@intel.com>
2021-05-21 08:03:27 +00:00
Jim Harris
cbb57e0d96 scripts: add bpf/send_msg.bt
This script tracks spdk_thread_send_msg and
spdk_for_each_channel calls.  It also uses usym
to get the name of the function pointer passed to
these calls.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia0cf5b50538bd26a3e15e35cbab765fe3c327c73
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7711
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: Konrad Sztyber <konrad.sztyber@intel.com>
2021-05-21 08:03:27 +00:00
Jim Harris
af0bf0f006 scripts: add bpftrace.sh
This script simplifies execution of bpftrace scripts
for SPDK application analysis. The script should be
invoked as:

scripts/bpftrace.sh `pidof spdk_tgt` script.bt

where 'script.bt' is the name of the bpftrace script
you wish to execute.

The script helps simplify the following:

1) replace __EXE__ markers in the bpftrace script with
   the full path of the spdk executable (required for
   usdt probes);  it uses /proc/<pid>/exe to get the
   full path
2) replace __PID__ markers in the bpftrace script with
   the PID of the spdk process under analysis - this
   allows for doing things like filtering system call
   counts for just the SPDK process
3) invoke bpftrace with the -p <pid> option

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib271f26efe4ba326d951a7b30f61b22be755dda7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7710
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-05-21 08:03:27 +00:00
Jim Harris
5a1c74bfa4 usdt: add User Space DTrace support to SPDK
For now, we will keep this disabled by default,
enable with --with-usdt option to the configure
script.  Long-term we will want to enable this by
default, and only disable via configure.

Modules can include spdk_internal/usdt.h and add
probes such as:

SPDK_DTRACE_PROBE2(probe_name, ptr, val);

When USDT is enabled, these will translate to
DTRACE_PROBE2(spdk, probe_name, ptr, val).  When
USDT is disabled, these will translate to nothing.

Later patches will add some probe points to the
nvmf target, some bpftrace scripts, and instructions
for how to successfully capture data with these
probe points and scripts.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id168e2c800fa5522815a175026386319014cfdaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7173
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-21 08:03:27 +00:00
Shuhei Matsumoto
9e1c13c5f1 bdev/nvme: Move bdev_nvme_compare_ns() up in a file
bdev_nvme_compare_ns() will be used to check if all namespaces of
one nvme_bdev are identical, and this is the convenient location.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3fa6072c1cceec53268e53bf398fa1e8f069035e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7169
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-21 08:02:50 +00:00
Shuhei Matsumoto
9391bc33a7 bdev/nvme: Factor out the internal of _bdev_nvme_check_pending_destruct()
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I27d7e81fe0ecc35b374277c8e40233db2a3ed914
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7273
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
2021-05-21 08:02:50 +00:00
Shuhei Matsumoto
a0ea252399 bdev/nvme: Factor out reset_io completion into a helper function
This will be helpful to simplify the following patches.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I66939f2953c66582bfcb79cfe187814280e89680
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7324
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>
2021-05-21 08:02:50 +00:00
Shuhei Matsumoto
73b4b9ad68 bdev/nvme: Put all nvme_bdev_ctrlr accesses into a place in bdev_nvme_create_cb()
When multipath is supported, a subsystem has multiple controllers and
bdev_nvme_create_cb() will create a channel per nvme_bdev_ctrlr by
iterating the list of nvme_bdev_ctrlrs, and will hold lock while
doing it.

If the code to access nvme_bdev_ctrlr is put in a place, the
following patches will be easier and smaller.

Hence reorder the code of bdev_nvme_create_cb() as a preparation.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2f2e66758c3374c678cc44bbb0116f4611c6753a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7754
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>
2021-05-21 08:02:50 +00:00
Shuhei Matsumoto
81b4379cd8 bdev/nvme: Factor out spdk_bdev_io_complete() calls into a helper function
Factor out spdk_bdev_io_complete() calls into a helper function
bdev_nvme_io_complete().

This simplifies the code a little and will be helpful for the following
patches to retry I/Os. These are not performance critical but we
specify inline explicitly by following bdev_nvme_io_complete_nvme_status().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9fafacfd8571c037c3bc34382c251317309da334
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7497
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
2021-05-21 08:02:50 +00:00
Shuhei Matsumoto
e4ec38c336 bdev/nvme: Factor out spdk_bdev_io_complete_nvme_status() calls into a helper function
Factor out spdk_bdev_io_complete_nvme_status() calls into a helper
function bdev_nvme_io_complete_nvme_status().

This simplifies the code a little and will be helpful for the following
patches to retry I/Os. Specify inline explicitly to avoid performance
regression.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1ac451486e1c6a4401842490411e986fac191d59
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7484
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>
2021-05-21 08:02:50 +00:00
Shuhei Matsumoto
30d17fff30 bdev/nvme: Delegate processing -EBUSY of bdev_nvme_reset() to its caller
bdev_nvme_submit_request() calls spdk_bdev_io_complete() with failed
if bdev_nvme_reset() returns negated rc other than -ENOMEM.

So let bdev_nvme_submit_request() process it.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2569634ff0f18fb433cb685de1366e43abf5a9fe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7524
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-21 08:02:50 +00:00
Shuhei Matsumoto
5a6cd5b31c bdev/nvme: Inline _bdev_nvme_submit_request()
This is called only in a place. Inlining this into bdev_nvme_submit_request()
will simplify the following patches by removing unnecessary cast.

Besides, use -ENXIO if I/O path is not found. This will be better than -1.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib6c38f89db1c1e651941aad18d31dd0891f380de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7871
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-21 08:02:50 +00:00
Shuhei Matsumoto
b2c0e3761b bdev/nvme: Consolidate exit paths of get_buf_cb()
I/Os will be retried if spdk_bdev_io_complete() is called with
SPDK_BDEV_IO_STATUS_FAILED. To do it easier, consolidate exit paths
of bdev_nvme_get_buf_cb().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0a67b88a107d616c5a5b0fc5ff963ad1402f5651
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7487
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-21 08:02:50 +00:00
John Levon
c41508b7e2 libvfio-user: update submodule
Update libvfio-user to the current version, updating the client for the relevant
changes.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Ic64ace08ac0c7e9676f04f8d1f47a9c0388a2652
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7983
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>
Community-CI: Mellanox Build Bot
2021-05-21 03:01:21 +00:00
Krishna Kanth Reddy
b73d3e6894 test/nvme: Simple Copy Command takes nlb as a 0's based value
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I10a33d6478ce10fd2786c8eca2f179a9809764dc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7973
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-05-20 20:15:51 +00:00
Maciej Szwed
3703ebc710 doc: Add information about shutdown_cb
Fixes GH 1539

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I5256a53c619b13951382fcc0439a157aa29b61aa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7859
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-05-20 15:22:19 +00:00
yupeng
5cc565999e nvmf: support NVME ACRE feature
Support ACRE (Advanced Command Retry Enable) feature. Currently set
all crdt to 0 and only select crdt[0] (crd=1) when the IO has any
error.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: If7bc30f91f5b2d0839002dead17188a4b3a52d5d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7885
Community-CI: Broadcom CI
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>
2021-05-20 15:18:52 +00:00
Alexey Marchuk
103f5c62f5 nvmf: Remove qpair from poll group when it is deleted
That prevents nvmf target from starting to destroy poll
groups prematurely

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I833f6198ef0e3083fdadf70dd3b62844c905aceb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7881
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: Jim Harris <james.r.harris@intel.com>
2021-05-20 15:18:29 +00:00
Evgeniy Kochetov
d8eb6957a0 ut/nvme: Add tests for NVMe controller namespace handling
Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: Id2d3d1a15df22512f8d0d4414b5b3d35e79149f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6505
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>
2021-05-20 15:17:41 +00:00
Evgeniy Kochetov
f0e248586e nvme/ctrlr: Always access namespaces via getter function
Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I16e327c0c0485057dc90a87cae316c4d6b62720d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6504
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-05-20 15:17:41 +00:00
Evgeniy Kochetov
65ff07719d nvme/ctrlr: Retrieve active NS list before NS construct
This patch changes the order of IDENTIFY_ACTIVE_NS and CONSTRUCT_NS
controller states. It is required to further improve memory management
for namespaces by allocating memory only for active ones.

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: Ie540442b1bd9e897afcbaa4319c139109dd0c515
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6503
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-05-20 15:17:41 +00:00
Evgeniy Kochetov
75ddfd6511 nvme/ctrlr: Handle namespaces construction failure
Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I3b14e2dce3bd4b2ce42e3946592cfde9d4300f28
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7361
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-05-20 15:17:41 +00:00
Evgeniy Kochetov
aebbce2520 nvme: Refactor active namespace list retrieval
Previous implementation allocated memory just once at the beginning of
active NS list retrieval procedure. It allocated memory for maximum
possible number of active namespaces, i.e. 'cdata.nn'.

This patch changes allocation logic. One page is allocated at the
beginning. If more is needed, reallocation is done with one more
page.

This patch also removes SPDK_MALLOC_DMA flag from allocation since we
don't do RDMA directly into this buffer.

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: Iaa80c4d70c54daaf71dcbf755c63a01a1d83b772
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6502
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>
2021-05-20 15:17:41 +00:00
Michal Berger
fead05c025 test/nvmf: Rework the traps
Declare single trap from nvmftestinit() instead overriding main trap
depending on the use-case (veth vs phy).

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I23c66fc5728510d06eee9837843f0734b2d03dcf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7850
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-20 15:16:21 +00:00
Michal Berger
9b3773db68 scripts/common: Cache pci modalias
Additionally, include the first resolved alias of the module.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I71c7c15398ea36f3dea3340f5c98568ff6b6a68a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7848
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-05-20 15:16:21 +00:00
Michal Berger
5f61a0c919 scripts/common: Cache the pci driver
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ie0ab6b31757b0446c697f59bfc789e78207b6e34
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7847
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-05-20 15:16:21 +00:00
Michal Berger
a3a0651569 autotest: Run dd tests under SPDK_TEST_URING
As these tests were limited to SPDK_TEST_BLOCKBDEV the spdk_dd was
not being tested against liburing. Make sure it is the case now.
Also, fail the test if spdk_dd is not linked to liburing in case
where such tests were requested.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I5704577530048ed4775ea15a6cdacf23380b5072
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7653
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-05-20 15:15:33 +00:00
Tomasz Zawadzki
1c71de70bd perf/nvmf: add FIO I/O rate limit to the config
Added 'rate_iops' FIO option to the performance scripts.

This will be used during tests where limiting factor
has to be artifically imposed, rather than come from
the target/initiator system or enviroment.

One case for this are scheduler tests, to limit
each connection and balance the threads accordingly.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I10bb09be9205a8b7ba90b36cd4e0bf922b0ecbc3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7840
Community-CI: Broadcom CI
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>
2021-05-20 15:14:59 +00:00
Ben Walker
1ae601b573 sock/posix: Avoid extra readv calls after draining recv_pipe
Move from a single flag indicating that the socket is on the
pending_events list to two flags - pipe_has_data and socket_has_data. If
either flag is true, the socket is on the socks_with_data list.

This is necessary to track enough state to avoid doing extra recv()
system calls.

Change-Id: I65e5701dccb0a5bade19f266f164f26706b110d4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7595
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-20 15:14:08 +00:00
Shuhei Matsumoto
4e9adb3bf9 thread: Replace TAILQ by Red Black tree for timed pollers
Use the macros for red black tree provided by Free BSD to manage
timed pollers efficiently.

Allow RB_INSERT() to insert elements with duplicated keys by changing
the compare function to return 1 if two keys are equal.

Check the return code of RB_INSERT() because this is the first use case
for RB tree macros in SPDK. We did the same for RB_REMOVE() by
adding another temporary variable but we remove it from this patch
because it is not so important compared with RB_INSERT().

When a timed poller is inserted, update the cache for the closest (leftmost)
timed poller only if the tree was empty before or the closest (leftmost)
timed poller was actually changed. We do not have to use RB_MIN()
because all duplicated entries are inserted on the right side.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibe253ca8eecc10116548b5eedbcdba8fb961b88d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7722
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-20 15:13:27 +00:00
Shuhei Matsumoto
4eb96aeba0 thread: Inline poller_remove_timer() into thread_poll()
We already hold thehe next closest timed poller in tmp. Inlining
poller_remove_timer() into thread_poll() makes the cache update
more efficient.

After this patch, poller_remove_timer() is called only in a single case
and the case is compiled only on Linux. So add it inside of a temporary
block is much clearner. However it will be used by spdk_poller_reschedule()
in the end of this patch series. So keep
the current position.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2e6858223713eed84f5d70b160da6122edae6d03
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7910
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-20 15:13:27 +00:00
Shuhei Matsumoto
83c197633f thread: Consolidate poller_remove_timer() calls into a single place
This enable us to optimize the cache update when RB tree is supported.

Call poller_remove_timer() after getting the next element because
as TAILQ_FOREACH_SAFE() and RB_FOREACH_SAFE() do, TAILQ_NEXT() may
not be valid after the current element is removed.

Previously, the patch had called poller_remove_timer() before getting
the next element. However, thanks to the nice testing, this bug was
found.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I18afb4412115dc1696cc568610cbe3dc618c2357
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7909
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-20 15:13:27 +00:00
Shuhei Matsumoto
3ca15e33e4 thread: Set poller to PAUSING even when it is in RUNNING
This change is a preparation to first dequeue the closest timed poller
always when it is expired. Previously the poller_remove_timer() calls
were not consistent and difficult to follow.

spdk_poller_pause() sets poller to PAUSING even when it in RUNNING
and move it to PAUSED after returning from its context.

If spdk_poller_pause() and spdk_poller_resume() are called while poller
runs, it is moved to WAITING. Hence thread_execute_poller() and
thread_execute_timed_poller() ignore such cases.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I29340613a2ec0c3529d0886f4d81c0a0fdf8745d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7908
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-20 15:13:27 +00:00
Shuhei Matsumoto
50487701b1 ut/thread: Test if multiple timed pollers are expired simultaneously
Add a little complex test cases to avoid regression by the following
patches.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1c94edd913f0a582868e355be085a1faf9bd1a94
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7913
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-20 15:13:27 +00:00
John Levon
2975e0dbb5 vfio-user: support cmake3
libvfio-user now uses cmake3 if available, so check for that as well as cmake.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Idf7a496d0d3fec21140afeede56337e53ad475fd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7954
Community-CI: Mellanox Build Bot
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>
2021-05-20 15:12:22 +00:00
Jim Harris
f651e22a98 bdev: remove all references to spdk_bdev_open
This API was removed previously, so remove remaining
references in map file and unit tests.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iba2f6a5f5ba590d3996dc133c8181083a33d7405
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7963
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>
2021-05-20 15:02:59 +00:00
Changpeng Liu
f4d2ba4371 test/nvmf: use recommended nvmf_create_subsystem rpc
There are logs like below in existing CI tests:
"nvmf_subsystem_create is deprecated, use nvmf_create_subsystem instead."

Change-Id: Id257ab13120a71ad3d0ae7ed22ed6e0a4f005cf0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7670
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-20 15:00:22 +00:00
Tomasz Zawadzki
706aa1ff08 dpdk: update submodule to DPDK 21.02
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I794f2266e0de175fe85ceea3a01b8db118550ada
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6617
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>
2021-05-19 08:09:58 +00:00
Ziye Yang
5c0160263c bdev/rbd: Revise bdev_rbd_create rpc function.
Revise bdev_rbd_create rpc call to add an optional
parameter "--cluster-name", e.g., "--cluster-name Rados".

Then users can create a rbd bdev with registered
Rados Cluster. This shared strategy can be used to
remove the thread creation overhead if multiple rbds
are connected to the same Ceph cluster.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Ide5800f8fc6b2074805272a59731c666fe279b9a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7584
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
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>
2021-05-19 08:08:39 +00:00
Mao Jiang
4e4d865fa0 test/nvme_cuse: cases for getting cuse ns device
Change-Id: I117b81554b6cf0f6eb1af7bd1050ff06cc351af9
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7442
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-19 07:50:53 +00:00
Jim Harris
40a9b64352 nvme/perf: add -F option for zipf distribution
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I818c5671574f556176a6cc5a0e372735a9e8a51a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7792
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>
Community-CI: Mellanox Build Bot
2021-05-19 07:50:28 +00:00
Jim Harris
6ee7dd5375 nvme/perf: move rand_r seed to ns_entry_
This eliminates the thread-local seed variable.  But
we're also adding zipf distributions in an upcoming
patch, and we'll want to store that context in the
ns_entry rather than making it thread local.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icc4a8b7bdbc9cd35525f2d35c9ada8e3ec0ba76c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7791
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>
Community-CI: Mellanox Build Bot
2021-05-19 07:50:28 +00:00
Jim Harris
bef22f45e7 bdevperf: add -F option for zipf distribution
Currently this will only support a global setting
that must be set on the command line.  We can make
it per-job later, but will require adding float
support to the conf library.

Tested by running bdevperf with some malloc
bdevs.  Performance with low theta values (i.e. 0.2)
are almost identical to random w/o zipf.  But
higher zipf values start to show better performance,
because we get more hits on data that is already
in the CPU cache.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I55b1587cdec2919973b488786d361042ca210606
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7790
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>
Community-CI: Mellanox Build Bot
2021-05-19 07:50:28 +00:00
Jim Harris
760452eefe bdevperf: store the rand_r seed in the bdevperf_job
This eliminates the thread-local seed variable.  But
we're also adding zipf distributions in an upcoming
patch, and we'll want to store that context in the
job rather than making it thread local.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If8079682e7d3da8f989ee6b880edc8d3fcb4fdd8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7789
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>
Community-CI: Mellanox Build Bot
2021-05-19 07:50:28 +00:00
Jim Harris
e6b7e58574 examples: add zipf example app
This app shows how to use the SPDK zipf functionality,
and uses spdk_histogram to show the cumulative
distributions.

Usage:

build/examples/zipf 1.2 100000000 10000

This will generate 10000 random numbers from a range
[0, 100000000) using zipf theta parameter = 1.2.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I36486399b54f57e771cbc5530ae4905afca60b64
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7780
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>
2021-05-19 07:50:28 +00:00
Jim Harris
0346e733e1 histogram: add handling for datapoint == 0
__builtin_clzll(0) is technically undefined, but
returns 64 on all currently tested architectures,
which is the desired value.  So remove the
assert(datapoint != 0) and instead just set clz=64
for that case so that we aren't depending on
undefined behavior.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ibb05f756e07f20a250d24f0c5adecc4dfbc5a056
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7939
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>
Community-CI: Mellanox Build Bot
2021-05-19 07:50:28 +00:00
Changpeng Liu
7e9d5ae123 doc/vhost: update example parameter when starting VM
Some Linux distributions reports kernel panic using the same
command line as we suggested in this document, that's because
number of IO queues is bigger than number of CPUs, so here
just fix it and added a comment on the number of IO queues
parameter.

See issues #1295 and #1737.

Change-Id: Ie1e18d5e83a80523f71d98b8761d13a8d57cc9ab
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7852
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-05-18 21:33:50 +00:00
Rui Chang
d424e2449a test/json_config: Fix json_config test fail for multiple nvme disk config
In json_config test, when there are multiple nvme disks, we see errors like:

ERROR: expected event 'bdev_register:Nvme0n1p1' but got 'bdev_register:Nvme1n1' (whole event line: bdev_register:Nvme1n1:1)

The reason is when there are multiple nvme disks in the system, when
start nvmf_tgt, it will register all the disks in bdev, so there would
be multiple bdev_register events for these disks before we run
create_bdev_subsystem_config. So in create_bdev_subsystem_config we need
add these events to expected events list first.

Signed-off-by: Rui Chang <rui.chang@arm.com>
Change-Id: Ice8f5464975e68ae63fec891ef18dbc7590a9ab5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7858
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-18 12:44:35 +00:00
Alexey Marchuk
6263457ca3 nvmf: Remove spdk_nvmf_request_get_buffers_multi API
It is not used.

Change-Id: I238c5e2b2d557063f8443ca703551e02b35ba2c7
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7882
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>
2021-05-18 12:44:18 +00:00
Alexey Marchuk
019a5361a5 nvmf/rdma: Use contig buffers for multi SGL payload
Currently we allocate buffers perf each SGL descriptor.
That can lead to a problem when we use NVME bdev with
PRP controller and length of the 1st SGL descriptor is
not multiple of block size, i.e. the initiator may send
PRP1 (which is SGL[0]) which end address is page aligned
while start address is not aligned. This is allowed by
the spec. But when we read such a data to a local buffer,
start of the buffer is page aligned when its end is not.
That violates PRP requirements and we can't handle such
request. However if we use contig buffer to write both
PRP1 and PRP2 (SGL[0] and SGL[1]) then we won't meet
this problem.

Some existing unit tests were updated, 1 new was added.

Fixes github issue #1853

Change-Id: Ib2d56112b7b25e235d17bbc6df8dce4dc556e12d
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7259
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>
2021-05-18 12:44:18 +00:00
Richael Zhuang
c07a6a949b event/reactor: fix bug when showing core state
It should print "intr" when target->in_interrupt==1.

Change-Id: I74479da1dc66d937899fdf5c619cdf1a09951918
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7857
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>
2021-05-18 12:44:02 +00:00
Krishna Kanth Reddy
861bf2d1c3 test/nvme: Add test application to verify Simple Copy Command support
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I7bf61d98c444b473ec73f6afaf31ac408af6e409
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7696
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-18 12:43:24 +00:00
Mao Jiang
75f9a150a6 test/nvme_pcie_common: cases for creating and deleting IO queue
Change-Id: I79237a63b0f3b414cb3300bf41ee6193ce35e60f
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7632
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-18 12:42:52 +00:00
Niklas Cassel
99550a756d bdev/fio_plugin: fix typo in README.md
The definition is that:
max active zones >= max open zones.

The REAME.md incorrectly writes max active twice.
Fix this typo in the README.md.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I4b7d24d7bd1efcbe1608d3ee04d8900f83857f5e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7912
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-18 12:42:38 +00:00
Niklas Cassel
6e57273783 nvme/fio_plugin: implement support for fio .get_max_open_zones callback
Implement support for the recently added fio .get_max_open_zones callback.

If our ioengine does not implement this callback, fio will always result
in an error when using --zonemode=zbd, on platforms which does not have a
fio oslib implementation for this callback, e.g. FreeBSD.

On Linux, fio will by default try to parse sysfs, which will of course not
work on SPDK.

Implement this callback so that our ioengine will be able to provide fio
with the proper max open zones limit.

This will ensure that fio will be able to fetch the proper max open zones
limit, regardless of OS.

While our SPDK nvme ioengine did overwrite the max_open_zones option if it
was set to zero, this is a bit of a hack. The new fio callback is the
proper way to inform fio about the max open zones limit, so that fio itself
can have access to the actual device limit.
(Just overwriting the requested max_open_zones option will not allow fio
to know if the requested max_open_zones option exceeds the device limit.)
Remove the SPDK specific hack and update our README.md accordingly.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I532a0fa065b9e215ee6229b9100135e5403f198e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7898
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: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-18 12:42:38 +00:00
Niklas Cassel
ddf27c3d15 nvme/fio_plugin: move get_fio_qpair() out of ifdef and reuse it
Move get_fio_qpair() out of ifdef and reuse it in spdk_fio_queue(),
since the code is next to identical.
The only difference is that get_fio_qpair() returns NULL if qpair->ns
is not set.

Since we know that get_fio_qpair() returns NULL if qpair>ns is not set,
we can also remove the equivalent check in spdk_fio_queue().

Also use ns pointer instead of qpair->ns pointer in two other places
in spdk_fio_queue().

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Ie647a814ff0b7a6f2bb81cbc9d7e95537fbe5256
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7897
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-18 12:42:38 +00:00
Niklas Cassel
afc432ba96 bdev/fio_plugin: implement support for fio .get_max_open_zones callback
Implement support for the recently added fio .get_max_open_zones callback.

If our ioengine does not implement this callback, fio will always result
in an error when using --zonemode=zbd, on platforms which does not have a
fio oslib implementation for this callback, e.g. FreeBSD.

On Linux, fio will by default try to parse sysfs, which will of course not
work on SPDK.

Implement this callback so that our ioengine will be able to provide fio
with the proper max open zones limit.

This will ensure that fio will be able to fetch the proper max open zones
limit, regardless of OS.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Ia9c281290e11e4204d270ba4090edb73212ce20f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7896
Community-CI: Broadcom CI
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: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-18 12:42:38 +00:00
Jim Harris
199fa6015d util: add zipf random number generator
zipf is a power law probability distribution. When
applied to performance testing of block devices, it
will select blocks over the full range of LBAs, but
will more frequently select lower-numbered LBAs.
The theta parameter governs the distribution - higher
values of theta will concentrate the distribution on
a smaller number of LBAs.

Note that fio supports zipf, so adding it to SPDK
will enable our perf tools (bdevperf, nvme-perf) to
provide similar functionality.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7df129c9d61996a2070188c6cd9f1fde631ac208
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7779
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>
2021-05-17 11:29:52 +00:00
Jim Harris
da9766336e nvmf: delay remove subsystem cb until no qpairs remain
We cannot solely rely on the qpair_ctx->count reaching
0, because qpairs that are in process of being
disconnected will immediately invoke the qpair
disconnect cb.

Instead, we need to wait until the poll group
no longer has any qpairs remaining on the subsystem.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I977747d367d14a4bf60f66a1147b3d75679e5179
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7870
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
2021-05-17 09:52:37 +00:00
Richael Zhuang
d92a67be47 spdk_top: fix display of core_freq
When running scheduler/interrupt.sh, the core_freq displayed from
refresh_cores_tab() and show_core() mismatch for lcore 1. We should
get core_freq from cores[] array which has been qsort.

Change-Id: I4eba9b023cfa00700ab82c679d42fff22b85be46
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7854
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-17 09:52:26 +00:00
Ziye Yang
e18eaee2af bdev/rbd: Add cluster register/unregister RPC support
This patch is used to add two rpc calls:
bdev_rbd_register_cluster
bdev_rbd_unregister_cluster

Then in the next patch, rbd bdev constructed on the same cluster object
can share the common Rados_t structure in order to remove the thread creation
overhead and improve the scalability.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I898cc4ffabb8e6721ba5bef099cbf948c64d2c98
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7551
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-17 09:52:18 +00:00
Shuhei Matsumoto
fb68d4e9ac util: Add Free BSD Red-Black tree macros
Copy Free BSD's sys/sys/tree.h to SPDK's include/spdk/tree.h by
changing as little as possible.

A few changes are as follows:
- Remove a few lines located at the head of the file.
- Change the name of ifdef from _SYS_TREE_H_ to SPDK_TREE_H.
- Change the type __uintptr_t to uintptr_t.
- Change the attribute __unused to __attribute__((unused))
- Insert a space to the front and the end of CONSTCOND.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I26488d8fd61f80508cf7d96fbeb6007f12080a01
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7721
Tested-by: SPDK CI Jenkins <sys_sgci@intel.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: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-05-14 10:08:02 +00:00
Shuhei Matsumoto
4748ebef40 thread: Cache the closest timed poller into thread
When we introduce RB tree, getting the closest timed poller is not
O(1) but O(log N). To mitigate such delay, cache the closest timed
poller into thread, and update the cache when its content is changed.

Add unit test cases for this change. They will also clarify the current
behavior of spdk_poller_unregister() and spdk_poller_pause() for
timed pollers.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibb98a54c261859a3210034038d3953e5c93ef8aa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7720
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
2021-05-14 10:08:02 +00:00
Konrad Sztyber
4f11fa5b6c scripts/setup: use test -e to test for msr presence
Current `test -f` never succeeds, because `/dev/cpu/0/msr` is a
character device file.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Iaa28f04866ab24140668ad43351a37f0ccccef65
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7166
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-14 10:06:41 +00:00
Wojciech Malikowski
180d281c7f lib/ftl: Drain retry queue before shutdown
Requests that still reside on retry queue should be
submitted to disk before shutdown.

Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Change-Id: Id2d020fcaef6443d01cfd8628686e9b0f34a1cfa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6771
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-14 10:05:34 +00:00
Alexey Marchuk
4642d7b264 nvmf/rdma: Embed fill_wr_sge into fill_wr_sgl
This patch reduces admount of changes in the next patch,
no functional changes added.
The next patch will add usage of contig IO buffers for
multi SGL payload. To support it we need to pass an
offset to fill_wr_sgl function. Also in the current
version we assume that for 1 iteration we fill 1 IO
buffer, the next patch will change it and we'll need
to swtich to the next IO buffer in special case. That
can't be done easily if we use fill_wr_sge function

Change-Id: Iee8209634637697f700f8fa9fe61ead156b6d622
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7258
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-14 10:03:56 +00:00
Ben Walker
64a9432c00 nvmf/tcp: Don't attempt to offload header digest calculations
The header is small enough that it likely won't ever make sense
to offload the digest computation.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ib6baa201a76d769d978f498f5c65985d5ab06ffd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7766
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
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>
2021-05-14 10:03:05 +00:00
Changpeng Liu
b885e23b95 bdev/iscsi: apply max_unmap and max_unmap_segments to bdev layer
The bdev layer can do the unmap split now based on the backend
device.  For now we only use 1 unmap descriptor, the bdev layer
can help us to do the split.

Fix issue #1888

Change-Id: Iaf740bafd4f2bb4b108133fee2aafd2f53da9b2b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7519
Community-CI: Broadcom CI
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>
2021-05-14 10:00:54 +00:00
Changpeng Liu
2594e757e5 bdev/iscsi: save Block limits VPD unmap settings
Also free scsi_task data structure for the asynchronous
libiscsi APIs.

Change-Id: I0bff706bfb795e51a4b10c357913ae66493dca5d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7513
Community-CI: Broadcom CI
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>
2021-05-14 10:00:54 +00:00
Changpeng Liu
938cc7d959 bdev/iscsi: use req data structure as the input parameter
Change-Id: I70bf01fdb812044e172c4e022819bebd1e865e54
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7572
Community-CI: Broadcom CI
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>
2021-05-14 10:00:54 +00:00
Krishna Kanth Reddy
f795dd6e66 test/unit: Add unit test for Simple Copy Command
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: Ia43f5d0588133027e80dc5707fd5940c44605c68
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7695
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: Jim Harris <james.r.harris@intel.com>
2021-05-14 09:59:54 +00:00
Krishna Kanth Reddy
7a12f4812d lib/nvme: Add support for Simple Copy Command
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I7aae5abca6ba5621e99fd604d146d84401eb45cd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7694
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-14 09:59:54 +00:00
Jaylyn Ren
5f179d8bd1 perf: Fix an error about perf cores usage
There is an error when collecting the cpu usage data in perf.c.

The cpu busy data exceeds 100% when running perf tool with mutli-cores.

Signed-off-by: Jaylyn Ren <jaylyn.ren@arm.com>
Change-Id: I9a00f86a51fb52e115c37199aee6f849b235d868
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7431
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-13 10:27:10 +00:00
Michal Berger
8651ef29ab autotest: Make sure entire EXIT trap is executed
process_core() indicates error where any core files are found. If
that happens to be the case when the trap is called, the remaining
pieces won't be executed due to errexit being enabled. With that
in mind, simply ignore process_core's exit status.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I83527468bd1b41bf92b9ee8189a4c425be914552
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6990
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-13 10:19:49 +00:00
Ziye Yang
00c9dd5879 accel_engine/ioat: If no ioat devices found, we should return.
If no ioat devices are registered, we should return.

Change-Id: I03435946716ef653b230515da32e8ccbdf5a188a
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7834
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-05-13 10:18:48 +00:00
Ziye Yang
9442881ab9 accel_engine: Fix the coredump issue if no idxd engine is found.
The coredump info can be viewed in
https://github.com/spdk/spdk/issues/1935

We face this issue because no idxd device is attached, but we
still register the hw engine by spdk_accel_hw_engine_register
in accel_engine_idxd_init.

Fixes #1935

Change-Id: I537f06e2b2923faac7f2cd6a28903e77f1f6aaa5
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7832
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-05-13 10:18:48 +00:00
Changpeng Liu
6b372f419d nvmf: fix heap corruption of Reservation Report command
We should use `ns->registrants` to count the number of registered
controllers(REGCTL) for Reservation Report command, as `subsystem->ctrlrs`
only list current active sessions(controllers).

Also use the output data buffer directly so that we don't need to calloc/free
during the process of Reservation Report command.

Fix #1928

Change-Id: I650224b751a08416208b8a504b82debff31e92fd
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7822
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: wanghailiang <hailiangx.e.wang@intel.com>
2021-05-13 10:10:42 +00:00
Alexey Marchuk
3ebf25e020 test/unit/nvme: Use page size in nvme_pcie_qpair_construct_destroy
Some systems may have page size other than 4096 bytes

Change-Id: Id56bb1566fff480edbe1a293121fc7a68c74252a
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7820
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
2021-05-13 10:09:45 +00:00
Michal Berger
3c578739e9 scripts/fio-wrapper: Make sure all nvme block devices exist
This is needed before we can start looking up attributes
of the block subsystem under sysfs. In some occasions they
may simply not exist yet at a given time.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I4261d17e92e02acec31b8affaccd0aa11c2b851e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7863
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-13 10:09:03 +00:00
Tomasz Zawadzki
42c82595c3 bdev/aio: respond to create RPC after bdev is examined
This makes use of newly added spdk_bdev_wait_for_examine(),
to only respond to RPC when bdev was fully examined.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If82cd913ab6653e8cc0da38c639b384b6c0303ba
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5482
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-13 10:07:07 +00:00
Tomasz Zawadzki
1c9125e78e test: add bdev_wait_for_examine to static JSON configs
Runtime RPCs such as bdev creation has no chance to wait for
bdev examination to finish. To handle this case commit below
introduced bdev_wait_for_examine RPC, and built it into all newly
saved JSON configurations:
(e57bb1af)lib/bdev: build bdev_wait_for_examine into subsystem

Some tests generate the configuration by hand, rather than
saving it from an existing application.
This patch embeds this RPC into the test configs.

Fixes #1760

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I79f998d722a2d19aa98b78333c64dbd2c1151444
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7861
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-13 10:07:07 +00:00
Tomasz Zawadzki
d69b16dac8 test/iscsi: remove comma from initiator_json_config
Function initiator_json_config is never called with
additional arguments that would fill up the subsystem
JSON.

Handling for the comma is removed.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6ce5648a0eac29cb0f45d210696edf7977dfe89d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7860
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-13 10:07:07 +00:00
Tomasz Zawadzki
64c6ddbf95 bdev/nvme: respond to attach RPC after bdev is examined
This makes use of newly added spdk_bdev_wait_for_examine(),
to only respond to RPC when bdev was fully examined.

Fixes #1760

Issue above was triggered in DD tests where application
finished before the examine had a chance to fully finish.
This patch addresses it by making sure that nvme attach
RPC waits for completion of the examine.
Later patch in series adds the bdev_wait_for_examine RPC
to multiple static configuration files. Making sure similar
issues do no occur for bdev modules which do not have changes
in their RPC as here.
The issue does not occur for JSON configs generated from apps,
see patch:
(e57bb1af)lib/bdev: build bdev_wait_for_examine into subsystem

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ie3ca2933af97a40ae01ecc3eefe2161d2d34c602
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5483
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-13 10:07:07 +00:00
Shuhei Matsumoto
54bc83dcc7 thread: Make struct spdk_thread and enum spdk_thread_state private in thread.c
Move the definition of struct spdk_thread and enum spdk_thread_state
from include/spdk_internal/thread.h to lib/thread/thread.c.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iab8cec9776e76668ebfb3c75064c316d10607421
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7802
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
6edc4abe4b thread: Change remaining direct accesses outside lib/thread to spdk_thread to helper functions
Use spdk_thread_get_last_tsc() and spdk_thread_get_stats() in
unit tests for reactor. As a result, we can change one inclusion
from spdk_internal/thread.h to spdk/thread.h.

This is the same effort as spdk_poller.

The following patches will move the definition of struct spdk_thread and
enum spdk_thread_state from include/spdk_internal/thread.h to
lib/thread/thread.c.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I24d4a52ecf885b6e7db749616ee1f95b82574dc5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7801
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
bd2fae2f0e thread: Change remaining direct accesses to io_channel outside lib/thread to helper functions
This is the same effort as spdk_poller.

The following patches will move the definition of struct spdk_thread and
enum spdk_thread_state from include/spdk_internal/thread.h to
lib/thread/thread.c.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7f7bdfdd7a7b1b834d16d79638a4fd2d63e9daf6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7800
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
5fdb2b761b thread: Make struct spdk_poller and enum spdk_poller_state private in thread.c
Move the definition of struct spdk_poller and enum spdk_poller_state
from include/spdk_internal/thread.h to lib/thread/thread.c.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4480a0b7a2a94ef97ff3185e458221e8c473665d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7799
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
1aec9334d9 thread: Change direct accesses to poller outside lib/thread to helper functions
Most accesses to the struct spdk_poller outside lib/thread have been
done via functions but a few direct accesses remain.

Change these to indirect accesses by addinng a few helper functions
as SPDK internal APIs.

Add spdk_poller_get_name() to get the name of the poller.

Remove spdk_poller_state_str() and add spdk_poller_get_state_str().
Exposing enum spdk_poller_state outside lib/thread is not really
necessary.

This removal requires us to update major SO version.

Add spdk_poller_get_period_ticks() to get the period ticks of the
poller.

Add struct spdk_poller_stats and spdk_poller_get_stats() to get
the stats of the poller.

The next patch will move the definition of struct spdk_poller and
enum spdk_poller_state from include/spdk_internal/thread.h to
lib/thread/thread.c.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id597dae074a15fcd8af09fd9d416a22ce2f403c3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7798
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
9ff6238b88 event/scheduler: Include not spdk_internal/thread.h but spdk/thread.h
It is better if the internal of poller or thread is not accessed
outside lib/thread.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I80d488a111fd9a67a0da32d1e63695ce5a6bcb4c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7776
Community-CI: Mellanox Build Bot
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: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
f5313b5501 thread: Factor out removing timed poller from list into a helper function
The following patches will update the cache to the closest timed
poller when removing it from the list. To do it easier, factor out
the operation to remove a timed poller from timed_pollers list into
a helper function.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I25016d86117b240a2651d1f06e23bea0342211f1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7719
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
c204c3d786 thread: Change TAILQ_FOREACH_SAFE to TAILQ_FIRST() and _NEXT() for timed poller
When we introduce red black tree for timed pollers, we will not use
RB_FOREACH_SAFE() but cache the leftmost (smallest) node and iterate
from it via RB_NEXT() instead.

As another preparation, separate TAILQ_FOREACH_SAFE() into TAILQ_FIRST()
and TAILQ_NEXT().

The next patch will cache the first element to thread and refer it
first.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie03c387b5b3a055c668e7b439a5eb05ed77eaa81
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7718
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
aca41b43a3 thread: Factor out convert period from usec to ticks into a helper function
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1dc0a202aab61a42511d3afac6b6533cfe6d1ade
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7666
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
42ad32da60 thread: Change if-else_if to switch-case blocks of spdk_poller_pause/resume()
It will be sufficiently reasonable to check if the caller thread is valid
even if spdk_poller_pause() or spdk_poller_resume() does nothing.
Besides, let's write all possibles states explicitly in switch - cases.

This refactoring clarifies the logic and makes the following patches easier.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1163eff388fe741d6b6924f474a82b1aa7d18acb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7665
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
3f45ed2467 thread: Change if-else_if to switch-case blocks of thread_execute_poller()
Change if - else if - else blocks of thread_execute_poller() and
thread_execute_timed_poller() to switch - cases blocks and specify
possible states explicitly in these switch - cases blocks.

The code will be simpler and clarified, and then the following patches
will be easier.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2e283894f5d69e1bd67466ae070c5b8bb9014616
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7664
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
54215a1e9b thread: Factor out executing poller or timed poller into helper functions
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8792b698f5de85c24482d6781fc3d47afce0c414
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7663
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
84ec998976 thread: Check if timed poller is expired first in iteration of thread_poll()
There will be no issue even if time poller is unregistered or paused
after it is expired. The iteration is stopped anyway after the head poller
is found not to be expired.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2b394b8b517930a6630dd31f59fcaea12eb80572
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7662
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
cd83ea4a6d thread: Add SPDK internal APIs spdk_thread_get_first/next_active/timed/paused_poller()
The following patches will introduce red black tree to manage
timed pollers efficiently but it will be based on macros available only
in lib/thread/thread.c. Hence then it will be difficult to expose the
internal of timed pollers tree outside the file. On the other hand,
we do not want to include JSON into the file.

Hence add a few SPDK internal APIs to iterate pollers list transparently.

For spdk_thread_get_next_active/timed/pause_poller(), we omit the parameter
thread and get it internally from poller->thread even if the names include
the term "thread". This will be slightly cleaner.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I000801a2e4dc42fa79801a2fd6f2b06e1b769c88
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7717
Community-CI: Broadcom CI
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: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-13 10:03:44 +00:00
Shuhei Matsumoto
d5b7f3c580 thread: Add check if the correct thread called spdk_poller_pause/resume()
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie2156a331bc2384a1cebe66fcddb90ef5aa1c380
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7661
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>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: <dongx.yi@intel.com>
2021-05-13 10:03:44 +00:00
Jonathan Teh
be6a01efb3 nvmf: Allow configurable controller ID range
Add {min,max}_cntlid to spdk_nvmf_subsystem, defaulting to 1 and
0xFFEF, respectively, and add nvmf_subsystem_set_cntlid_range() to
allow the controller range to be configured in the range [min_cntlid,
max_cntlid].

Also add {min,max}_cntlid to the nvmf_create_subsystem RPC to allow
the controller ID range to be specified when creating an nvmf
subsystem.

Signed-off-by: Jonathan Teh <jonathan.teh@mayadata.io>
Change-Id: I936db3bb0c9a38569063a6fd3c11df262dfad776
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7322
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-12 09:18:48 +00:00
Niklas Cassel
acca0749df nvme/fio_plugin: change zone append print to SPDK_DEBUGLOG
Change zone append print to SPDK_DEBUGLOG() instead of an unconditional
print. Since we already print a warning when zone append isn't supported,
there is no need to unconditionally print something for the success case.
This also matches the behavior of the SPDK fio bdev plugin.

Also improve the zone append help text to match the SPDK fio bdev plugin.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Ic7604ea4bdf17e0cddfe2638f3db7944ee652474
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7804
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>
2021-05-12 09:18:10 +00:00
Niklas Cassel
367784a641 bdev/fio_plugin: update README.md and add example zbd config
Update README.md with information specific to zoned block devices.
Additionally, add an example config that can be used to test the
--zonemode=zbd fio option using the virtual zoned block device
SPDK module on top of a Malloc bdev.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I68bbc07ab70ad1ce8e38abc91dd8c15c49f90656
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7758
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: Jim Harris <james.r.harris@intel.com>
2021-05-12 09:18:10 +00:00
Niklas Cassel
e415c253a3 bdev/fio_plugin: add support for --zone_append
Add support for using zone append commands instead of write command,
for bdevs that support it.

In the SPDK NVMe plugin, the target struct (called spdk_fio_qpair) is
allocated in .setup(), but the qpair is first created in .open_file.

In the SPDK bdev plugin, the target struct (called spdk_fio_target)
is allocated in spdk_fio_bdev_open(). This function also creates the
I/O channel. (spdk_fio_bdev_open() is called by .init().)

Since certain options has to be saved in the struct spdk_fio_target,
which is allocated quite late, we cannot reuse spdk_fio_handle_options(),
which has to be called before threads are created.

Therefore, we unfortunately need another option parsing function in the
SPDK bdev plugin.

If we fail to handle any of the per target options, the target is never
added to the list of targets, and is freed immediately.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Iacd1924c8f0d3d324f2a6f1b0a54f86459f39d31
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7727
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>
2021-05-12 09:18:10 +00:00
Mao Jiang
3067ecaa0c nvme/ctrlr: fix namespaces indexed overflow risk
Change-Id: Ied1de194621a02f6eeaafc23ce5ff467760a71aa
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7772
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-12 09:17:38 +00:00
Ziye Yang
b940247b3e bdev/rbd: Use the same Rados cluster object in the same RBD bdev
This patch is design to use the single Rados Cluster
object in the same RBD if there are multiple I/O channels created.

And this patch will be prepared for the next patch to share
the same cluster among different RBD bdevs.

Change-Id: I1509f29a9c1088da308a3f88980f0c7fed26476f
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7601
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>
2021-05-12 08:49:25 +00:00
Changpeng Liu
67eb36c7fa nvme: remove aligned attribute
When testing vfio-user target with QEMU, there is following error log:

ctrlr.c:2143:31: runtime error: member access within misaligned address 0x7fe526a73d98 for type 'struct spdk_nvme_ctrlr_data', which requires 16 byte alignment

For vfio-user transport, the memory buffer is allocated by clients, so
we can't assume the memory is always aligned, just remove the
aligned attribute.

Change-Id: Ie80530415013ebd7bcb8cdabca97d7d0e34857f9
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7797
Community-CI: Broadcom CI
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-05-12 08:48:47 +00:00
ChengqiangMeng
744f401cc9 test/nvme_fabric: Remove priority assert check for rdma.
It's only for tcp now, but the transport here is rdma. So there is no need to assert.

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: Ieffaac9d31a8f9c79a0d9fd226d74268986b7a77
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7823
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
2021-05-12 08:48:28 +00:00
Michal Berger
b96ec35dc8 scripts: Remove fio.py
With https://review.spdk.io/gerrit/c/spdk/spdk/+/7684 there are no
more active uses of it in the test suites.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: If6f8227b68f1fe1a4038cec2b6107eac82ad44de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7698
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-12 08:48:10 +00:00
Michal Berger
19f0c9a0d0 autotest: Replace fio.py with a bash wrapper in tests
fio.py simply wraps itself around fio and doesn't do anything that
would require python to be in use. Having it in a simple bash form
makes it easier to integrate it with autotest's common sh tooling
and to debug any potential issues with the underlying tests.

This also fixes #1919 by making sure only proper nvme devices are
selected for the nvmf targets.

Fixes: #1919.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I111d00df3c7b2517f431cae865e258a665c2ecb3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7684
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-12 08:48:10 +00:00
Changpeng Liu
55189bee6b libvfio-user: update submodule
This update will stop using `struct vfio_device_info` from
<linux/vfio.h>.

Fix issue #1922.

Change-Id: Ia7ad745db8d7ed8f5248ca13e3188ebd540b0e40
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7831
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-12 08:46:29 +00:00
Krishna Kanth Reddy
78a794b9a3 examples/identify: Identification of Simple Copy Command support
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I251f3b1a6c7e36b946ddc8bd8a07b0f588e23c9e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7693
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-11 12:04:54 +00:00
Jim Harris
b549f4113c build: relink apps when vfio-user library is updated
Look for 'vfio_user' in SPDK_LIB_FILES to determine
whether the target application actually needs to be
rebuilt.

Fixes issue #1930.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If3f699c91972e20dc4520e25c655ed11f6843be0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7826
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-11 12:04:36 +00:00
Jim Harris
1f5bae841a build: also look for vfio-user libraries in 'lib'
At least on some Ubuntu distributions, default
vfio-user install puts libs in usr/local/lib instead
of usr/local/lib64.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib312d8ca9b4ce9e858a9a9e76525fc8afd48ced5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7825
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>
Reviewed-by: <dongx.yi@intel.com>
2021-05-11 12:04:36 +00:00
Tomasz Zawadzki
a8fe601853 lib/blob: delay executing blob persist completions
This helps in next patch in series where multiple
completions will be executing.

UT is adjusted since one additional poll is required.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id72377ddef91e40cdbc2bdea6f33c23309b0ca3d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7642
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-11 12:03:57 +00:00
Tomasz Zawadzki
958364b4a0 lib/blob: only verify cluster allocation when I/O is not frozen
During snapshot creation the original blob becomes
a thin provisioned blob that will only the diff of data after
snapshot creation.

Despite the comment in the UT the number of polls before issuing
blob write was hitting blob BEFORE it swapped with new one.

Issuing I/O during this period shall check for io freeze
before checking cluster allocation.

Otherwise bs_io_unit_is_allocated() hits assert for thin
provisioned blob. This is because cluster map of blob is
empty, but properties have not been updated yet.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I742e1a50b14d456ae1e6de13b5111caec3e8322c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7641
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>
2021-05-11 12:03:57 +00:00
Changpeng Liu
d0b4deab2b UT/bdev: add unmap UT to cover the split case
Change-Id: I902c9ce113cfbb2549ecb720951403496dec6d06
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7579
Community-CI: Broadcom CI
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>
2021-05-11 12:03:28 +00:00
Changpeng Liu
218d6ac8cc bdev: add bdev_unmap_split() support
Also for the purpose to avoid a burst of children unmap request,
we will submit at most up to 8 children request at a time for
a big UNMAP command.

Change-Id: Iaf0f18b07517e0a8f84dc04e8c93b95691a1a43c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7518
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-11 12:03:28 +00:00
Changpeng Liu
e6db8e02e5 bdev: add a helper function to process IO split submission
Both UNMAP and R/W will share the some logic to process the submission,
so combine them to a helper function first.

Change-Id: Ia4f234c6a58f078d3e9f88cacaf1510a17f07acc
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7606
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>
2021-05-11 12:03:28 +00:00
jiaqizho
64debe0453 rpc: add a command parser
The changes in the nvmf_create_transport show
how this command parser work. And there have
two benefit for this changed.

1. Simplify the definition of rpc method. no need add
so many args anymore. Also it retains its original
functions, so we can also check the input args.

2. Make the rpc call more versatile, for example.
when user extend the subparsers(add new args
into subparsers), they can pass some private args
into the rpc method by command parser.

Signed-off-by: jiaqizho <jiaqi.zhou@intel.com>
Change-Id: Iaf916e3454f23715cf9216794bb80c65b2b4603f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6652
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>
2021-05-11 12:02:00 +00:00
Mao Jiang
980a139631 test/nvmf/ctrlr_bdev: cases for identify namespace
Change-Id: I315f48185268da696e4047e1c7ac5cf2a4221765
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7285
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-11 12:00:15 +00:00
Swapnil Ingle
2421e99849 scsi: Cache physical block size locally
Addressing review comment from 6cebe9d0.
Minor optimisation to cache result of spdk_u32log2() into local variable
instead of calling it multiple times.

Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Change-Id: I2fd6afd1e3ee461662de3f9d278958664224e106
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7806
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: sunshihao <sunshihao@huawei.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
2021-05-11 11:59:31 +00:00
Shuhei Matsumoto
646f41476d ut/nvme_fabric: Fix access to local variable after returning from the function
Fix issue #1936

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iaa2b8060053d3f798001a6b207a6fcb0335c4b23
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7833
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-11 11:58:46 +00:00
Jim Harris
53447f060f nvmf: remove a bdev_module.h #include
ctrlr_discovery.c doesn't need this #include.
Including it causes bdev_module.h types to be
emitted to the debug symbols at least with some
compilers, which can result in unwanted abidiff
errors.

The unit tests do need it, so just include it
there instead.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iad28f9778ce08b11b52325658583ae9032295f3a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7813
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-11 11:57:01 +00:00
Jim Harris
8a12e2e715 scsi: don't include bdev_module.h
The library itself doesn't need it. The unit tests
do need it, so just include it there.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9aefd303ae12928d45141029436509f185105bd3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7812
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-11 11:57:01 +00:00
Jim Harris
eef5159387 module/blob/bdev: use __SPDK_BDEV_MODULE_ONLY
This module only requires the spdk_bdev_module
APIs, so use this #define to avoid having to
bump so version when spdk_bdev is modified.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I292c38e60cbf21d0d5a6583cb2a2b097c524f3d1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7811
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-11 11:57:01 +00:00
Rafal Stefanowski
8fcb8b966d bdev/ocf: Improve cache line size handling
- Use consistent cache line size units in KiB across RPC calls
and config files. The KiB units are much easier to use then
the bytes units and are more human readable.
- Properly handle cache start when cache line size is incorrect.
- Add test to check if cache line size value is reported correctly.
- Add cache line size info to JSON RPC documentation.

Fixes #1858

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Change-Id: Iec9ede85f6884b64605d2d112947b3f175cbd938
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7614
Community-CI: Broadcom CI
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>
2021-05-11 11:56:04 +00:00
Michal Berger
eb4b79919a pkgdep/git: Bump vanilla qemu to v6.0.0
Older version wasn't providing full support for PMR setup, this one
does.

Rewrite get-pmr such that it supports CMB/PMR sizes greater than 4GB.
Also, since CMB and PMR can coexist in newer versions of qemu try to
detect both under single device.

E.g.:

nvme0:0000:00:04.0:64-bit:prefetchable:0x700000000:0x707ffffff:0x08000000:cmb
nvme0:0000:00:04.0:64-bit:prefetchable:0x400000000:0x5ffffffff:0x200000000:pmr
nvme1:0000:00:05.0:64-bit:prefetchable:0x708000000:0x70fffffff:0x08000000:cmb
nvme2:0000:00:06.0:64-bit:prefetchable:0x600000000:0x6ffffffff:0x100000000:cmb

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ic159f5c12d3ef39db77617f7d64f825356c255a4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7539
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-05-11 11:51:01 +00:00
Ziye Yang
f99d46d5f7 bdev/aio: move disk free operation in spdk_io_device_unregister's call back
Recently, checked the spdk_io_device_unregister function,
it will have deferred free behaviour, and the io_device
will possibly be freed in put_io_channel function.

And this means that it is not safe to directly call:
    spdk_io_device_unregister (io_device, NULL);
    Then free io_device relately resource.

Because there will be channel to use the resources associated
with io_device. Then we will possibly cause a NULL pointer access.

I found this issue in bdev rbd module, and I think that the
same issue could happen in other modules. So it is better to put the
resource free function as the call back function.

Change-Id: Icc1f86d72b672faefb3b7f416030b818a8cf45ce
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7646
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-11 11:50:48 +00:00
Tomasz Zawadzki
47c4304d83 subsystem/nvmf: remove cpu_mask hint when creating poll group
Passing cpu_mask hints that match only single core were
usefull to prevent any accidents when doing round-robin
in case of 'static' scheduler.
In practice this is not required in case of 'static' scheduler,
the threads will be spread out over all reactors anyway.

This hinders other schedulers which try to respect the cpu_mask
hints, as they would not move the thread to any reactor.
Preventing bunching up less used threads on single reactor.

Drawback of this patch is that poll group names will not match
the cores they are on.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5fb308362dd045228ea9fcca24f988388854c054
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7028
Community-CI: Broadcom CI
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: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-11 11:49:52 +00:00
Robert Baldyga
d20f41881b spdk_zmalloc: Remove unnecessary memset()
Normally, unless RTE_MALLOC_DEBUG is set, DPDK zeroes memory in rte_free().
If RTE_MALLOC_DEBUG rte_free() fills memory with poison pattern, but then
(and only then) the memory is zeroed in rte_zmalloc_socket(). Relying on
this behavior allows to avoid unnecessary memset() in spdk_zmalloc() path.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
Change-Id: If3efa4dd22f1568949c3fb529b604bd597ceb32f
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6975
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-11 11:49:06 +00:00
Ziye Yang
c94648ff91 lib/accel: Add the missed seed assignment for chain crc32c support.
We did not find this issue, because we always use seed = 0 to test.
Definitely, we need to assign the seed value.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I6bec1b6d61480cdd7c9e27578dcaf5de2f65cf44
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7716
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-05-10 11:14:37 +00:00
Jonas Pfefferle
19faf91293 nvmf: ctrlr_create - fix missing free qpair_mask on error
This patch fixes missing free of qpair_mask when a listener error
occurs in ctrlr_create.

Signed-off-by: Jonas Pfefferle <pepperjo@japf.ch>
Change-Id: I09162b86d8ac73bf9fc2006a08dcc0a955f222b3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7818
Community-CI: Broadcom CI
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>
2021-05-10 11:14:24 +00:00
paul luse
e8fc521f7d lib/idxd: set error status on any completion error.
Not just one with extra available info.  Also remove the extra
read of the error register, not required.

fixes: #1927

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I28badb45d8cc8d16b72f7019bd2a2044998fc402
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7729
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-05-10 11:13:26 +00:00
Curt Bruns
b89ad84532 nvme: add support for NVME_IOCTL_IO_CMD for cuse
Nvme-cli uses NVME_IOCTL_IO_CMDs for "io-passthru"
commands to cuse devices.  This patch adds support
for that IOCTL.

Signed-off-by: Curt Bruns <curt.e.bruns@gmail.com>
Change-Id: I20e0ac91ba08fce91bc5da1f4a1e454058cdd1e7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7741
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-10 11:13:09 +00:00
Curt Bruns
f3edd7a359 nvme: rename "admin" to "passthru" for cuse
The nvme cuse IOCTLs are actually creating passthru commands
that can be either IO passthru commands or admin commands.
Renaming the routines to correctly reflect that should limit
the confusion when reading the code.  Passthru commands that
are admin commands will go to the spdk_nvme_ctrlr_cmd_admin_raw
interface and passthru commands that are IO will be sent to the
spdk_nvme_ctrlr_cmd_io_raw interface.

Signed-off-by: Curt Bruns <curt.e.bruns@gmail.com>
Change-Id: I8d427fe8b5f503fdb2d193236c77d410d5b13886
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7740
Community-CI: Broadcom CI
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-10 11:13:09 +00:00
Curt Bruns
4c19332b0c nvme: add cuse support for BLKSSZGET IOCTL
Nvme-cli uses BLKSSZGET so support needs to be added for
nvme cuse devices.

Signed-off-by: Curt Bruns <curt.e.bruns@gmail.com>
Change-Id: Ic8316713b2d017c8ff32a225efff6bcb95842799
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7708
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-10 11:13:09 +00:00
Curt Bruns
0ba168fe39 nvme: add SPDK_DEBUGLOG support for nvme_cuse
It is useful to have debug log information in the nvme_cuse
path when debugging IOCTls and flows.

Signed-off-by: Curt Bruns <curt.e.bruns@gmail.com>
Change-Id: Ifef1bb82c96438e2fcbb9ad2fafe3f3eb66bed51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7707
Community-CI: Broadcom CI
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-10 11:13:09 +00:00
Ziye Yang
bcbccf8bb5 lib/nvme_tcp: Refactor the code to generate _nvme_tcp_pdu_payload_handle
The purpose is to prepared for implement the async crc32 caculation
in the future patch.

Change-Id: Ia75f28154c49f08b527d48c63b9da79a6bdfede8
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7794
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-10 11:12:57 +00:00
Ziye Yang
bc35dab91c lib/nvmf: Refactor the code to generate _nvmf_tcp_pdu_payload_handle
The purpose is to prepared for implement the async crc32 caculation
in the future patch.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I49f84ea1966f0acdd6f5aeb7192896f91fd16dee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7793
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-10 11:12:57 +00:00
Ziye Yang
4e0ca20a8a idxd: Do not present pci device info in accel_engine_idxd.c module
Purpose: We will also support the kernel idxd driver, so we do not
need export this feature in the module file.

Change-Id: I965e031497920f527962ba187bccd81de6977b8f
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7336
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>
2021-05-10 11:12:40 +00:00
Konrad Sztyber
a7c37873b4 module/zone_block: don't align size to optimal open zones
There's no good reason to reduce the capacity by aligning it to the
number of optimal open zones.  If such alignment is required by the
users of the zone block bdev, it should be done on their own layer.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic8614a82715e9f064619aa8fdb75d1a0b851490c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7656
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-05-07 20:37:22 +00:00
Ziye Yang
cf41deae8b idxd: update the major so version for libspdk_idxd
Change-Id: I6ad71a65244526e99a36920c630096cc9739d94d
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7809
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-05-07 15:03:44 +00:00
Niklas Cassel
e3997dc23b bdev/fio_plugin: add support for --initial_zone_reset
--initial_zone_reset has to be done before fio creates its threads.
Since --zonemode=zbd only supports --create_serialize=1 (default),
this is possible.

Since this requires an I/O channel, and is called before threads
are created, follow the same pattern as spdk_fio_report_zones()
and simply initialize the thread early if this option is used.

Just like spdk_fio_report_zones(), thread cleanup has to be
called explicitly in case of error. (Since fio will only call
.cleanup() on threads that it has called .init() on.)

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I7d4dedce88309e4c6e5800ed3d56cd5ccb297551
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7726
Community-CI: Broadcom CI
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>
2021-05-07 11:41:46 +00:00
Niklas Cassel
36728cd80d bdev/fio_plugin: implement callbacks needed for fio --zonemode=zbd
Implement callbacks needed for fio --zonemode=zbd, so that we can use fio
to exercise the bdev-zone layer in SPDK.

spdk_fio_report_zones() will be called before SPDK normally initializes
the threads.

spdk_fio_report_zones() simply initializes its spdk thread when called.
Threads not running against a zoned block device are not affected.

Each spdk thread is still destroyed after the fio run has completed,
as normal. If spdk_fio_report_zones() encounters an error, we have
to call spdk_fio_cleanup() so that the thread is added to the global
list of spdk threads that are cleaned up after main loop exit.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Ia094eae8c9e44d8cfc66a5d9b7100f09f9db456a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7725
Community-CI: Broadcom CI
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>
2021-05-07 11:41:46 +00:00
Niklas Cassel
af72965519 bdev/fio_plugin: fix scan-build error
spdk_fio_init_thread() assigns td->io_ops_data.
spdk_fio_init_thread() can return an error, but currently lacks error
handling code.

Add error handling code, and add an assertion that fio_thread
(td->io_ops_data) is assigned when spdk_fio_init_thread() didn't return
an error.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I8de7d59db0373599c90aa57fffa476c6707b6104
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7732
Community-CI: Broadcom CI
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>
2021-05-07 11:41:46 +00:00
Ziye Yang
82e4bfd346 nvme/tcp: Change the type of recv_pdu to pointer.
This is prepared for using the hardware offloading
engine in accel framework. And some fields in nvme_tcp_pdu
needs to be DMA addressable.

Change-Id: I75325e2cd7ff25fe938bea0ac9489a5027e3e0e9
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7770
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: Paul Luse <paul.e.luse@intel.com>
2021-05-07 11:41:24 +00:00
Ziye Yang
f8ac678ec3 lib/nvmf: Change the pdu_in_progress in tqpair to pointer.
This is used to prepare using the accel framework to calculate
the crc32 because some fields in this structure needs to be allocated
in DMA addressable memory.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Ib8def5596e60f4702709da647145c4e2b6d6848f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7767
Community-CI: Broadcom CI
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-05-07 11:41:24 +00:00
Mao Jiang
d16c5b49dd test/nvme_pcie: cases for cmb mapping
Change-Id: I8b781b519aca901f34697f9ff165a92d0511201c
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7490
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>
2021-05-07 11:40:40 +00:00
sunshihao520
cd9619a3db bdev/bdev_nvme: Don't send abort cmd to ctrlr if the reset is running.
Signed-off-by: sunshihao <sunshihao@huawei.com>
Change-Id: Ib16cfaddc00ed0d461fa04b835134de403223553
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7024
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: Changpeng Liu <changpeng.liu@intel.com>
2021-05-07 11:40:20 +00:00
Scott Peterson
f98623bb55 nvmf: define vendor specific log page range
Also add a macro to test a given log page ID.

Signed-off-by: Scott Peterson <scott.d.peterson@intel.com>
Change-Id: Id4d00f5c3d8af76b24ce010d6f922025a31312b4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4115
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-07 11:38:32 +00:00
Mao Jiang
c68200086f test/fabric: cases for fabric discovery
Change-Id: I00c7f6e827fc7d2cd4775129a6acd866245ecdb4
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7690
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-07 11:37:49 +00:00
Mao Jiang
8e3d60a116 test/nvme_pcie_common: cases for pcie qpair construct and destroy
Change-Id: I2ff57cec09139d54743a06d24dc5294f574d8378
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7059
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-05-07 11:37:00 +00:00
Jim Harris
de6e5c30c9 scsi: use SPDK_TRACE_ARG_TYPE #defines
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ifc2a79891ab26643a2783d0e6482d58449a300f5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7764
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: Paul Luse <paul.e.luse@intel.com>
2021-05-07 11:35:38 +00:00
Jim Harris
40cf86f20a nvmf: use SPDK_TRACE_ARG_TYPE #defines
Note: a lot of the TCP and FC trace registers were
specifying '1' which means the arg type is a pointer,
but in reality it is always passing 0 for arg1.  So
this patch just changes them to SPDK_TRACE_ARG_TYPE_INT.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I18d3cedd21e516f16cb2cd0a7f8c16670b1895d7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7763
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-05-07 11:35:38 +00:00
Jim Harris
a7ea7cbc57 iscsi: use SPDK_TRACE_ARG_TYPE #defines
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I033aa060feb0f6e4a9abedd8cf1335b25437fa99
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7762
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: Paul Luse <paul.e.luse@intel.com>
2021-05-07 11:35:38 +00:00
Jim Harris
12cc5e2e50 doc: use SPDK_TRACE_ARG_TYPE #defines
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Idcffe9ae197fc0257b89ca0854fe722fbf1ca916
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7761
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: Paul Luse <paul.e.luse@intel.com>
2021-05-07 11:35:38 +00:00
Jim Harris
469a504bae bdev: use SPDK_TRACE_ARG_TYPE #defines
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iddcc9ab7b5077368a4fbda72e650b381ef42b6cb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7760
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-05-07 11:35:38 +00:00
Jim Harris
a4c37c6a56 ftl: use SPDK_TRACE_ARG_TYPE #defines
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I10a0a2bf3f2bdcef0b4e4c76ee6958151c2b61e6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7759
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: Paul Luse <paul.e.luse@intel.com>
2021-05-07 11:35:38 +00:00
Jim Harris
b8fb7d67be iscsi: track PDU object for WRITE_START/WRITE_DONE events
We already pass the PDU as arg1, so by changing the
trace register descriptions, we can map the PDUs to
more readable IDs when running the spdk_trace app.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iad7106eeb0f5fe738f81da5ee174515d1cf4b6ce
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7757
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: Paul Luse <paul.e.luse@intel.com>
2021-05-07 11:35:38 +00:00
Jim Harris
7e52eb740a iscsi: fix ISCSI_READ_PDU spdk_trace_record
This was accidentally moved to the wrong place as
part of some earlier iSCSI refactoring.  This trace
record should be executed when we have finished
reading all of the data for any PDU, not just those
with immediate data.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib1d17e5e79ff220e9e9b3dd55e247e745bd58019
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7756
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: Paul Luse <paul.e.luse@intel.com>
2021-05-07 11:35:38 +00:00
Jim Harris
3faf457f56 bdev/nvme: do not use DSM to emulate write zeroes
We cannot rely on DSM/DEALLOCATE as a write zeroes
alternative, even if DLFEAT reports that deallocated
blocks will be read as all zeroes.  DEALLOCATE is
advisory, meaning that blocks may not actually be
deallocated.  In cases where they are not deallocated,
they will not be read back later as zeroes.

QEMU 6.0 started reporting DLFEAT as returning zeroes
for deallocated blocks but for some of our write
zeroes tests, blocks aren't actually deallocated.

We may be able to add quirks in the future if we know
that a controller reliably deallocates blocks, but
for now we need to revert this completely.

Note that since bdev/nvme module now does not support
write zeroes in any cases, we need to disable the
write zeroes call in the unit tests.

Fixes issue #1932.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I79f0673774b621a9ffcc46891728cc7719e34cdb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7723
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-07 11:32:23 +00:00
John Levon
bbfbcc1967 vfio-user: add disable-mappable-bar0 flag
It can be useful for testing or development purposes to force clients to write
to doorbells using vfio-user messages instead of directly into shared memory;
add a transport-specific option to disable the shared mapping.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I7ed062fbe211ba27c85d00b12d81a0f84a8322ed
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7554
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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-05-07 11:31:20 +00:00
Changpeng Liu
4f1530c9eb bdev: add bdev_unmap_should_split() function
Change-Id: I2680eef93da13d8378527349cdc5ba36859f89dc
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7517
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-07 11:30:55 +00:00
Changpeng Liu
d4d5e20d29 bdev: rename bdev_io_split to bdev_rw_split
This will help us to add unmap split function, also
remove bdev_io_type_can_split() because we changed
to use swith(io_type) ... case now.

Change-Id: I449d6a9f5bf2d0b43dd124bbfc9e1ca2afddc15a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7516
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: <dongx.yi@intel.com>
2021-05-07 11:30:55 +00:00
Changpeng Liu
f6d5b9cd92 bdev: introduce unmap attributes to bdev layer
The backend device module can report such capabilities
to the bdev layer, and we can split unmap request into
multiple children requests in the bdev layer.

Change-Id: I81daf7e58b797a2673ef102f2a037de20771092e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7515
Community-CI: Broadcom CI
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>
2021-05-07 11:30:55 +00:00
Changpeng Liu
518d28dba9 scsi/bdev: free bdev_io when there are split requests
Only the last bdev_io can be freed without this fix.

Change-Id: I0d05b5d89e38ef60872ebc0f23aaed0c622593c4
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7571
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <dongx.yi@intel.com>
2021-05-07 11:30:55 +00:00
Ziye Yang
20698a4a8d idxd: Split the idxd library into common and user space part.
Purpose: This patch is used to prepare to add the kernel
idxd support later.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: If89665f95d622c7342ab75050664158ec6fc615a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7330
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-05-07 08:56:20 +00:00
Swapnil Ingle
6cebe9d06b nvmf: Support physical block size if exposed by bdev
(Note: this patch was previously applied as b32cfc46 and then reverted
as 63642bef.)

Today the in-guest nvme device shows physical_block_size=512 even though
the backend iSCSI bdev supports physical_block_size=4K

iSCSI targets exposes physical block size using
logical_block_per_physical_block_exponent in READ_CAPACITY_16

NPWG is one of the way to let Linux nvme driver set
physical_block_size of the nvme block device.

This patch adds spdk_bdev.phys_blocklen which is updated if the iSCSI
backend exposes physical_block_size.
Later phys_blocklen is used in nvmf to set NPWG and NAWUPF to report
back during NS identity.
Linux driver uses min(nawupf, npwg) to set physical_block_size.

Similarly in scsi_bdev fill lbppbe in READ_CAP16 response
based on spdk_bdev.phys_blocklen.

Fixes #1884

Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Change-Id: I0b6c81f1937e346d448f49c927eda8c79d2d75c0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7739
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-06 07:14:40 +00:00
Jim Harris
fa79643725 nvmf: remove struct spdk_bdev definition dependencies
1) use spdk_bdev_get_name() accessor
2) use __SPDK_BDEV_MODULE_ONLY #define

The latter allows nvmf to just get the spdk_bdev_module
definitions and APIs that it needs for claiming bdevs
for purposes of avoiding the same namespace used in
different subsystems.

This also ensures that future changes to structures
like spdk_bdev and spdk_bdev_io will not cause
lib/nvmf so version changes.

Note: we include bdev_module.h explicitly in the
nvmf/subsystem unit tests now, before including
subsystem.c, because the unit tests do depend on
knowing the internal structure of spdk_bdev.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2f499a741d19f4749eadb402641f28137245fd23
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7738
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.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>
2021-05-06 07:14:40 +00:00
Jim Harris
2b9ec05ba7 bdev: add __SPDK_BDEV_MODULE_ONLY to bdev_module.h
We have some cases where libraries need the
spdk_bdev_module structure definition and a couple
of related APIs, but not everything else (i.e.
spdk_bdev, spdk_bdev_io), for purposes of avoiding
abidiff errors.

For example, nvmf creates a dummy spdk_bdev_module,
and then uses it with the spdk_bdev_module_claim_bdev
API to ensure multiple subsystems cannot add the same
bdev as a namespace.

But when nvmf includes bdev_module.h, it pulls in the
spdk_bdev structure definition as well.  This means
when the spdk_bdev structure is modified, it requires
a major version bump since abidiff detects the
difference in the debug info.

Alternatives considered:

* We could add a specific suppression into our abidiff
script for nvmf and struct spdk_bdev, but it would be
a risk (albeit very very small one) that we could
add a real dependency on struct spdk_bdev in the future,
and the suppression would hide the difference.

* We could also break out bdev_module.h into multiple
header files, but the ways of doing that either result
in odd file naming, or modifying every bdev module to
include a new header.

* We could add a public bdev API to expose what the
bdev library needs, but that seemed even more intrusive
than this change. nvmf is kind of abusing the bdev_module
API here, and I'd prefer to not promote that kind of
usage by adding something to the bdev API.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie8fdef8ea294d005b9ae7934dde49c62748420d1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7737
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
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>
2021-05-06 07:14:40 +00:00
Jim Harris
3e54a5bb43 bdev: rearrange bdev_module.h
Move some of the bdev_module APIs immediately after
the bdev_module structure definition.  This prepares
for an upcoming patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I78d534ba047048ec27d8d3159666584a52211de3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7736
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-06 07:14:40 +00:00
Mao Jiang
bc7da85481 test/nvme_qpair: cases for getting sgl print information
Change-Id: Ic3cff09a102c4224eda3c4f6e2da0c17e50db303
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7552
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>
2021-05-06 07:13:09 +00:00
Mao Jiang
912dc67755 test/nvme_ctrlr_cmd: cases for command security receiving and sending
Change-Id: I07c7863ddadf333f15cfb2ebb64e7b3dcf5554d1
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7364
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-06 07:12:42 +00:00
Changpeng Liu
ed2942461d nvmf/vfio-user: ignore unmapped DMA regions
libvfio-user DMA APIs report all regions notified by the client, including those
that don't have a corresponding shared mapping.  There are several of these for
a typical VM, so just ignore this case.

Signed-off-by: John Levon <john.levon@nutanix.com>
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Change-Id: I37b06f4bc6d1818a03c8742616ed142f575d3f0e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7532
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>
2021-05-05 14:25:32 +00:00
Mao Jiang
517164a5fd test/nvme_ctrlr: cases for setting arbitration feature and ctrlr state
Change-Id: I7467049e5f5f256704f5eb8fd51a0c9c1c44a581
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7196
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-05 13:33:51 +00:00
Maciej Wawryk
33227bbcc0 test/nvmf: add remove non-existent subsystem listener test
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I3504e874d8ec1c8bacbd394e3d4d208dc155f45c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7038
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-05 13:33:11 +00:00
sunshihao520
2fc1ccae77 lib/nvme: add value check to fix value inversion
When payload_size is 0, we may get wrong cdw10 because of the calculate: 0 - 1,
add value check to fix value inversion bug.

Signed-off-by: sunshihao <sunshihao@huawei.com>
Change-Id: I3bcd38ba981c854ff917282341d32aac47d22b76
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7443
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-05 13:32:30 +00:00
Jim Harris
32999ab917 jsonrpc: use SOCK_NONBLOCK in socket() calls
This allows us to remove separate fcntl() calls to
set O_NONBLOCK.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1a590cfb3b65b3174bb5ef33e060cdc9bb7ac86c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7598
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
2021-05-05 13:31:10 +00:00
Jim Harris
c86075607b nbd: use SOCK_NONBLOCK with socketpair() call
This simplifies the code a bit, removing the need
for the separate fcntl() calls.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4fef8f01a055d1471df87bd979c21d6198e9868a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7596
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: Ben Walker <benjamin.walker@intel.com>
2021-05-05 13:31:10 +00:00
Ziye Yang
988af676da nvmf/tcp: Remove the unnecessary qpair setting.
It is already set by nvmf_tcp_req_pdu_init
when we get the pdu. So we do not set it again.

Change-Id: I034bbc46e600afd802457c0b152e303f16bafba3
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7714
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-05 13:29:37 +00:00
Michal Berger
d97b106f81 pkgdep: Update liburing version to 2.0 release
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I239c6eb2e9919a4605a14d39f4462b3aa5f54883
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7496
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: Monica Kenguva <monica.kenguva@intel.com>
2021-05-05 13:27:16 +00:00
yidong0635
40549bb48e log_rpc: Unify codes in end path.
Unify the end path, and remove duplicate codes.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: Ie36cb2182b2b0b23f36670780b6e7af3652dc94b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7520
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@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>
2021-05-05 13:26:06 +00:00
John Kariuki
b69796f777 scripts/perf: fix json param names
Fixed parameter names in the sample json config file.

Change-Id: I4e221b17c533c0957a325e24043a627b5acb6220
Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7688
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>
2021-05-05 13:25:48 +00:00
Ben Walker
a922a2e24a lvol: Don't include bdev_module.h in the public header
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I8590bdedd8b1c3d0e417694f07f40deb3297ef24
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7728
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
2021-05-04 21:07:42 +00:00
Ben Walker
63642befd3 Revert "nvmf: Support physical block size if exposed by bdev"
This reverts commit b32cfc467b.

This commit fails the ABI checks and only got through because the checks
were disabled until 21.04 hit.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Id26b8f8ba551193d99b1ccbd31b35378b4095a20
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7731
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-04 00:48:34 +00:00
Swapnil Ingle
b32cfc467b nvmf: Support physical block size if exposed by bdev
Today the in-guest nvme device shows physical_block_size=512 even though
the backend iSCSI bdev supports physical_block_size=4K

iSCSI targets exposes physical block size using
logical_block_per_physical_block_exponent in READ_CAPACITY_16

NPWG is one of the way to let Linux nvme driver set
physical_block_size of the nvme block device.

This patch adds spdk_bdev.phys_blocklen which is updated if the iSCSI
backend exposes physical_block_size.
Later phys_blocklen is used in nvmf to set NPWG and NAWUPF to report
back during NS identity.
Linux driver uses min(nawupf, npwg) to set physical_block_size.

Similarly in scsi_bdev fill lbppbe in READ_CAP16 response
based on spdk_bdev.phys_blocklen.

Fixes #1884

Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Change-Id: I0b6c81f1937e346d448f49c927eda8c79d2d75cf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7310
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-05-03 18:59:34 +00:00
Mao Jiang
eb76ccb04c test/nvme_tcp: cases for connecting sock and sending icreq
Change-Id: Iece99816ad67ac585b6285cbd43e415425b75239
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6821
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-04-30 09:49:44 +00:00
jwyka
cddfa0241a lib/nvme: allign cuse ctx data to 4k
We have seen that dptr was not alligned to 4k using cuse. Added allignment of data in cuse ctx to 4k same as it is done in nvme_allocate_request_user_copy
Signed-off-by: jwyka <jakub.wyka@intel.com>
Change-Id: Ic5c2482eae20d64ba467016eb61f5255467f70a9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7453
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>
Community-CI: Broadcom CI
2021-04-30 07:36:12 +00:00
Tomasz Zawadzki
469d8f32d0 so_ver: reenable test preventing increasing SO version
This check was disabled after 21.01 LTS to allow for
clear break of SO versions. Now that SPDK 21.04 is being
released, this test should be reenabled.

See following patch for details:
(e4070ee0)so_ver: increase all major versions

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8a299a340338e7a2ab3439b81153818778b4c93a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7616
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
2021-04-30 07:06:12 +00:00
Liu Xiaodong
ac0c36d72a test: add functional test for reactor_set_intr
test script 'test/interrupt/reactor_set_intr.sh' will
do various reactor set intr operations on interrupt_tgt
without spdk_thread and with spdk_thread.

Change-Id: Ie5af1dc68b0272c34a91e8a66b78088c3794907c
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7348
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-04-29 07:10:26 +00:00
Tomasz Zawadzki
50935184c8 lib/blob: force execution of queued persists
When performing snapshot creation the I/O is frozen
during the process. The blob persists for extent page
allocation is delayed until snapshot creation is finished.

This results in multiple blob persists executing one after
the other, with only intent of writing out updated extent table
pointing to new extent pages.
Since blob->state is marked DIRTY before issuing each persist,
but a single persist completion marks state CLEAR.

Blob serialize correctly expects each persist to contain
dirtied metadata, in order to avoid unnecessary md writes.
Since all other instances of marking blob DIRTY is explicit,
assert in blob serialize is left as is.

Instead when running the queued up blob persists, the blob
state is marked DIRTY.

Side effect is that it will write out same md in some cases.

Fixes #1909

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I39f37299f3f0ebfccbdd4063781b5ecce286e993
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7640
Community-CI: Mellanox Build Bot
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>
2021-04-29 07:10:13 +00:00
Nick Connolly
0fdd826a00 ut/nvme_ctrlr_cmd: add missing mutex init
Add missing mutex init for ctrlr ctrlr_lock.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: Ib3d665a28e91a72d1f1f6d09c374583ff731fb6f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7613
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: Changpeng Liu <changpeng.liu@intel.com>
2021-04-29 07:10:05 +00:00
Jim Harris
5354d0c63f nvme: reset mapping_length correctly for contig SGL
spdk_vtophys() takes a mapping_length parameter, so
it can return the length for which the returned
virtual address is valid.

But spdk_vtophys() will only return the max
between the valid length and the input mapping_length
parameter.

So the nvme SGL building code for contiguous buffers
was broken, since it would only set the mapping_length
once, before the loop started.  Worst case, if a buffer
started just before (maybe 256 bytes) before a huge page
boundary, each time through the loop we would create
a new SGL for only 256 bytes at a time, very quickly
running out of SGL entries for a large buffer.

Fixes #1852.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7659
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-04-29 07:09:43 +00:00
Jim Harris
6fd1cc3716 nvme: remove IDENTIFY_CNS quirk from normal QEMU SSDs
The IDENTIFY_CNS quirk was applied as part of QEMU
OCSSD handling in commit 6442451b.  But it was applied
not only to the OCSSD dev ID, but also the dev ID
for non-OCSSD NVMe controllers.

Starting with QEMU 5.2, QEMU will allocate a default
256 namespaces, but only some are active (associated
with the backing disks specified by the user).  QEMU
supports IDENTIFY_CNS, but since this quirk was set,
we wouldn't send a real IDENTIFY_CNS and instead
would just populate a fake list where all namespaces
were considered active.  This causes breakage in
a few places - mainly where we iterate through
the active namespaces, and then are surprised that
calling spdk_nvme_ns_is_active() returns false.

It was also breaking bdev_nvme_attach_controller RPC,
since by default we can only support returning 128
names, but since all of the namespaces were deemed
active, it was trying to return 256.

Fixes #1916.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7658
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-04-29 07:09:43 +00:00
Mao Jiang
9ed384dab0 test/nvme_pcie: cases for building PRP and SGL request
Change-Id: I41c13f95b36308154dfa61ef8c6c54592ee7525d
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7143
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-04-27 08:38:12 +00:00
Karol Latecki
e1fe11875b autobuild: enable -Wno-stringop-overflow for DPDK builds only for GCC > 10
Use -Wno-stringop-overflow only for GCC > 10.
Change made to use the same condition as in
dpdkbuild/Makefile.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I6a396e250807f46720ff5dcaf21f13d802404a1b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7537
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-04-27 08:37:12 +00:00
Karol Latecki
71b4e2a968 autobuild: build mainline DPDK with -Werror only for GCC > 5
DPDK now officially supports only GCC > 4.9.0.
Some older systems like Centos7  (gcc 4.8.5) can still
build DPDK, but sometimes fail due to -Werror enabled.
Disable this option to increase build success chance.

Fixes #1891

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I0950ad01e2d8361851e9ac42c556004980e00ff4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7536
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-04-27 08:37:12 +00:00
Rui Chang
8af74b5ac7 test/setup: fix failure in allowed() when there is only one device
If there is only one device in ${devs[*]}, we see failure backtrace:
========== Backtrace start: ==========

in /home/jenkins/spdk_repo/spdk/test/setup/acl.sh:41 -> allowed([])
     ...
   36  	}
   37
   38  	allowed() {
   39  		PCI_ALLOWED="${devs[0]}" setup output config \
   40  			| grep "Skipping denied controller at " \
=> 41  			| grep -v "${devs[0]}"
   42  		verify "${devs[@]:1}"
   43  		setup reset
   44  	}
   45
   46  	setup reset

Signed-off-by: Rui Chang <rui.chang@arm.com>
Change-Id: I9aba6b19f6de6bea7149e0f39da8d5d8d6978a4e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7467
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-04-27 08:36:35 +00:00
Mao Jiang
a417658803 test/nvme_ns: cases for identifying id descriptor and find descriptor
Change-Id: I20d0a798423ee08f4a9e019aa62b93981586d134
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7161
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-04-27 08:35:27 +00:00
Tomasz Zawadzki
5f106e26c9 version: SPDK 21.07 pre
This is first commit that should go into latest SPDK
after the code freeze for SPDK 21.04.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I515772a0c90a362bd4a23a7717281a8d7a9e4393
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7615
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-04-27 08:29:12 +00:00
Alexey Marchuk
2fd97e28bf sock: Deprecate enable_zerocopy_send in sock_impl_set_options RPC
This deprecated parameter will be removed in SPDK 21.07

Change-Id: I2b2fbcc798bb50fa6f9dfe35045f66e41c1ceaa9
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7608
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-04-27 08:13:32 +00:00
Alexey Marchuk
8e85b675fc sock: Add new params to configure zcopy for server, client sockets
When zcero copy send is enabled and used by initiator,
it could significantly increase latency in some payloads.
To enable more fine graing configuration of zero copy
send feature, add new parameters enable_zerocopy_send_server
and enable_zerocopy_send_client to spdk_sock_impl_opts to
enable/disable zcopy for specific type of sockets.
Exisiting enable_zerocopy_send parameter affects all types
of sockets.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I111c75608f8826980a56e210c076ab8ff16ddbdc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7457
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-04-27 08:13:32 +00:00
813 changed files with 52257 additions and 20321 deletions

View File

@ -7,6 +7,8 @@ assignees: ''
---
# Bug report
<!--- Provide a general summary of the issue in the Title above -->
## Expected Behavior

View File

@ -7,6 +7,8 @@ assignees: ''
---
# CI Intermittent Failure
<!--- Provide a [test_name] where the issue occurred and brief description in the Title above. -->
<!--- Name of the test can be found by last occurrence of: -->
<!--- ************************************ -->

View File

@ -1,6 +1,337 @@
# Changelog
## v21.04: (Upcoming Release)
## v21.10.1: (Upcoming Release)
## v21.10: DMA lib, Async NVMe driver, Container scripts
Structure `spdk_nvmf_target_opts` has been extended with new member `discovery_filter` which allows to specify
filtering rules applied during discovery log generation. Refer to `enum spdk_nvmf_tgt_discovery_filter` for more info.
### bdev
New API `spdk_bdev_get_memory_domains` has been added, it allows to get SPDK memory domains used by bdev.
New API functions `spdk_bdev_readv_blocks_ext` and `spdk_bdev_writev_blocks_ext` have been added.
These functions accept `spdk_bdev_ext_io_opts` structure with extended IO request
options, e.g. DMA memory domain which describes data that may belong to another memory domain and
can't be accessed directly.
Added `async_fini_start` to allow bdev modules to complete the `fini_start` asynchronously,
with new `spdk_bdev_module_fini_start_done` API.
Deprecated `spdk_bdev_module_finish_done()` API, which will be removed in SPDK 22.01.
Bdev modules should use `spdk_bdev_module_fini_done()` instead.
The `ocssd` bdev has been removed. The Open Channel specification has been largely superseded by
zoned namespaces, few if any devices have been brought to market, and there is little reason to
continue to support this. OCSSD support in the nvme driver will remain for now.
### dma
A new library, lib/dma, has been added. This library provides the necessary infrastructure for
handling systems and devices with multiple memory domains. For example, a PCIe add-in card with an
SoC may be running SPDK on the SoC. That SoC has its own local memory, but SPDK may be controlling
devices that can also access the host system memory. This library provides infrastructure to enumerate
the memory domains and request hardware perform DMA transfers between them.
### dpdk
Updated DPDK submodule to DPDK 21.08.
### event
Added the `disable_signal_handlers` flag to the `spdk_app_opts` struct.
### idxd
Added `spdk_idxd_get_socket` to query the socket that the idxd device
is on.
### json
Added API to allow for writing and decoding of new types:
- `spdk_json_write_named_uint16`
- `spdk_json_write_named_uint8`
- `spdk_json_write_uint16`
- `spdk_json_write_uint8`
- `spdk_json_number_to_uint8`
- `spdk_json_decode_uint8`
### log
Added API `spdk_log_to_syslog_level` to return syslog level based on SPDK's
log level.
### nvme
Added new functions `spdk_nvme_zns_set_zone_desc_ext` and `spdk_nvme_zns_ext_report_zones`
to set zone descriptor extension and to get extended zone report respectively.
New API `spdk_nvme_ctrlr_get_memory_domains` has been added, it allows to get SPDK memory domains used by nvme controller.
New API functions `spdk_nvme_ns_cmd_readv_ext` and `spdk_nvme_ns_cmd_writev_ext`
have been added. These functions accept `spdk_nvme_ns_cmd_ext_io_opts` structure with extended IO request
options, e.g. DMA memory domain which describes data that may belong to another memory domain and
can't be accessed directly.
Added a new function `spdk_nvme_ctrlr_get_regs_bpinfo` to get boot partition info of a controller.
Added new functions `spdk_nvme_ctrlr_write_boot_partition`,
`spdk_nvme_ctrlr_read_boot_partition_start` and `spdk_nvme_ctrlr_read_boot_partition_poll`
to write and read the boot partitions of a controller.
Added `spdk_nvme_ctrlr_get_opts` to retrieve the current controller options.
Added `async_mode` to `spdk_nvme_io_qpair_opts` to enable creation of submission and completion
queues asynchronously. This mode is currently supported at PCIe layer,
which tracks the qpair creation with state machine and returns to the user immediately.
Default mode is set to false to create io qpairs synchronously.
Added `spdk_nvme_ctrlr_get_regs_cc` to retrieve NVMe controller CC (Configuration) register.
Added `spdk_nvme_ctrlr_prepare_for_reset` to inform the driver that the application is preparing
to reset the specified NVMe controller. This function allows the driver to make decisions
knowing that a reset is about to happen.
### nvmf
Added `oncs` to `struct spdk_nvmf_ctrlr_data` so that the transport layer
can decide support RESERVATION feature or not.
An `opts_size` element was added in the `spdk_nvmf_ns_opts` structure to solve the
ABI compatibility issue between different SPDK version. An new option `anagrpid` was
added in the `spdk_nvmf_ns_opts` structure.
An new parameter `anagrpid` was added to the RPC `nvmf_subsystem_add_ns`.
An new parameter `anagrpid` was added to the RPC `nvmf_subsystem_listener_set_ana_state`.
`spdk_nvmf_subsystem_destroy` is now can be asynchronous, it accepts a callback and callback argument.
A new parameter, `poll_groups_mask` was added to the `nvmf_set_config` RPC that allows specifying
a subset of cores for the nvmf poll groups. This helps to avoid imbalances when some cores are
busy with periodic timer tasks that run very frequently.
A new parameter, `commit` was added to `nvmf_bdev_ctrlr_end_zcopy` that allows indicating whether
the buffers should be committed.
Added `listen_dump_opts` to `spdk_nvmf_transport_ops` so that the transport layer can display
listen opts.
Added `fabrics_connect_timeout_us` to `bdev_nvme_attach_controller` RPC to allow specifying
timeout for connect operation.
Added `multipath` to `bdev_nvme_attach_controller` RPC to allow specifying multipath behavior.
### scheduler
New API for implementing schedulers and governors. Please see `include/spdk/scheduler.h` for details.
### scsi
New functions, `spdk_scsi_dev_get_first_lun` and `spdk_scsi_dev_get_next_lun`
have been added to iterate LUNs of a SCSI device.
Each SCSI device supports 256 LUNs at the maximum now and the macro constant
`SPDK_SCSI_DEV_MAX_LUN` was removed.
### trace_parser
A new library, lib/trace_parser, has been added. This library provides functions that parse traces
recorded by an SPDK application. That includes merging traces from multiple cores,
sorting them by their timestamp and constructing trace entries spanning across multiple buffers.
### util
The `spdk_fd_group_add` API now takes a `name` parameter.
## v21.07
### accel_fw
Added API `spdk_accel_submit_copy_crc32c` to perform a CRC32C while copying data.
Added API `spdk_accel_batch_prep_copy_crc32c` to batch CRC32C + copy commands.
Added API `spdk_accel_submit_copy_crc32cv` to submit chained CRC32C + copy commands.
### bdev
Change `spdk_bdev_read_blocks_with_md` arg offset definition from int64_t to uint64_t.
Red-black tree has been used to organize the bdev names and aliases uniformly
to provide faster lookup.
Removed ZCOPY emulation: The bdev module can be checked to see if it supports ZCOPY
and if not supported then use existing READ/WRITE commands.
Added iov to spdk_bdev_zcopy_start.
### dpdk
Updated DPDK submodule to DPDK 21.05.
### idxd
Remove the `probe_cb` parameter in `spdk_idxd_probe` function. And remove the definition
of `spdk_idxd_probe_cb` function pointer. It should be implemented in idxd_user.c.
Added API `spdk_idxd_submit_copy_crc32c` to perform a CRC32C while copying data.
Added API `spdk_idxd_batch_prep_copy_crc32c` to prepare a batch operation to perform
a CRC32C while copying data.
We have userspace idxd driver under accel_engine library (module/accel/idxd/accel_engine).
And kernel idxd driver usage is also added under the accel_engine library. This approach
implemented a wrapper library to use IDXD device by leveraging the kernel DSA driver in
SPDK idxd library (lib/idxd). Then users can leverage the RPC later to configure how to
use the DSA device by user space driver or kernel driver.
### init
Added new `init` library that initializes the SPDK subsystems, which previously was
internal to application framework. That functionality has been made public and for
use by applications which don't leverage SPDK's application framework.
### iscsi
New parameters, `pdu_pool_size`, `immediate_data_pool_size`, and `data_out_pool_size`,
were added to the RPC `iscsi_set_options` to run iSCSI target with varying amount of
available memory.
### json
Added API `spdk_json_write_named_uint128` and `spdk_json_write_uint128` to perform
the uint128 related data.
### net
Removed deprecated `net` library.
Added support for ZCOPY. ZCOPY is used in preference to READ and WRITE if the
bdev module supports ZCOPY and the bdev module has ZCOPY enabled.
### nvme
`spdk_nvme_map_prps` and `spdk_nvme_map_cmd` were moved to nvmf/vfio-user as internal APIs
as vfio-user is the only user for the above two APIs.
Added a new function `spdk_nvme_ns_cmd_copy` to submit a Simple Copy Command to a Namespace.
Update the `spdk_nvme_generic_command_status_code` structure with new status code
according to the definition in NVMe 1.4 spec.
`spdk_nvme_ctrlr_get_default_ctrlr_opts` now sets `use_cmb_sqs` to false. This means
that if a controller has a CMB and supports SQs in the CMB, SPDK will not use
the CMB for SQs by default - the user must set `use_cmb_sqs` to true in
the `spdk_nvme_ctrlr_opts` structure prior to controller attach.
Add a new function `spdk_nvme_detach_poll` to simplify a common use case to continue
polling until all detachments complete.
Added new argument `timeout_admin_us` to `spdk_nvme_ctrlr_register_timeout_callback` so callers
can specify a different timeout for admin commands vs. io commands.
An existing function `spdk_nvme_detach_async` was updated to add one or more detachments
to an active context while it is being polled.
Rename a variable in the member `cmic` of the struct `spdk_nvme_ctrlr_data` from
`multi_host` to `multi_ctrlr`. The variable means that the NVM subsystem may have two or
more controllers if set to 1. However `multi_host` had indicated a particular use case
such that the NVM subsystem is used by multiple hosts.
A new option `disable_read_ana_log_page` was added to struct `spdk_nvme_ctrlr_opts` to disable
reading ANA log page. The upper layer is expected to read ANA log page instead if `true`.
The default value is `false`.
New APIs, `spdk_nvme_ctrlr_reset_async` and `spdk_nvme_ctrlr_reset_poll_async`, have been added to
reset a controller asynchronously.
New RPC `bdev_nvme_reset_controller` was added, to reset an NVMe controller.
Added `spdk_nvme_ns_get_nguid` function to get NGUID for the given namespace.
Added `spdk_nvme_ctrlr_is_fabrics` function to indicate whether a ctrlr handle
is associated with a fabrics controller.
### nvmf
Added `min_cntlid` and `max_cntlid` to `nvmf_create_subsystem` to limit the controller ID range.
Added `spdk_nvmf_subsystem_get_min_cntlid` and `spdk_nvmf_subsystem_get_max_cntlid` to request those values.
`spdk_nvmf_request_get_buffers_multi` API is removed.
Added the `nvmf_set_crdt` RPC for setting command retry delay times.
Expanded `spdk_nvmf_poll_group_stat` with current qpair count statistics.
Removed following deprecated APIs:
- `spdk_nvmf_poll_group_get_stat` (function in `nvmf.h`),
- `spdk_nvmf_transport_poll_group_get_stat` (function in `nvmf.h`),
- `spdk_nvmf_transport_poll_group_free_stat`(function in `nvmf.h`),
- `spdk_nvmf_rdma_device_stat` (struct in `nvmf.h`),
- `spdk_nvmf_transport_poll_group_stat` (struct in `nvmf.h`),
- `poll_group_get_stat` (transport op in `nvmf_transport.h`),
- `poll_group_free_stat` (transport op in `nvmf_transport.h`).
### rpc
New RPC `bdev_rbd_register_cluster` and `bdev_rbd_unregister_cluster` was added, it allows to create
and delete the rados object cluster, then users can choose the cluster to create related rbd
device.
Revised `bdev_rbd_create` parameter, it allows to use an optional parameter `--cluster-name`
to create a rbd bdev with an already registered Rados Cluster Object.
New RPC `bdev_rbd_get_clusters_info` was added, it allows to get the info of the registered
Rados Cluster names.
New optional parameter, `timeout_admin_us`, added to the bdev_nvme_set_options RPC.
Revised a parameter `--stripe-size_kb` to `--stripe-size-kb` of `bdev_raid_create` method
provided in `scripts/rpc.py` for consistency.
An new optional parameter `config_kernel_mode` was added to the RPC `idxd_scan_accel_engine`,
and this is used to enable using the kernel mode IDXD driver.
Removed deprecated parameter `enable-zerocopy-send` of RPC `sock_impl_set_options`,
use `enable-zerocopy-send-server` or `enable-zerocopy-send-client` instead.
Removed deprecated parameter `disable-zerocopy-send` of RPC `sock_impl_set_options`,
use `disable-zerocopy-send-server` or `disable-zerocopy-send-client` instead.
### rpm
Removed deprecated `pkg/spdk.spec`, please use `rpmbuild/spdk.spec` instead.
See [RPM documentation](https://spdk.io/doc/rpm.html) for more details.
### thread
Red-black tree has been used for timed pollers to provide faster insertion and deletion
and for io_devices to provide faster lookup.
Removed `spdk_io_channel` structure from public header and moved it to thread_internal.h.
### trace
Added `spdk_trace_register_description_ext` function to register variable number of tracepoint arguments.
Added ability to chain multiple trace entries together to extend the size of the argument buffer.
### util
Red-black tree macros has been added by using the macros provided by the FreeBSD operating system
under the same BSD license.
Add an new macro `SPDK_SIZEOF_MEMBER` to get the size of a member of a struct.
`spdk_crc32c_iov_update` function was added to support calculating the crc32c of the iovs.
Added zipf random number generator with power law probability distribution.
When applied to performance testing of block devices, it will select blocks over
the full range of LBAs, but will more frequently select lower-numbered LBAs.
## v21.04
### accel
@ -161,6 +492,17 @@ For `bdev_raid_create` RPC, the deprecated parameter `strip_size` was removed.
New RPC `bdev_nvme_get_transport_statistics` was added, it allows to get transport statistics
of nvme poll groups.
Parameter `enable-zerocopy-send` of RPC `sock_impl_set_options` is deprecated and will be removed in SPDK 21.07,
use `enable-zerocopy-send-server` or `enable-zerocopy-send-client` instead.
Parameter `disable-zerocopy-send` of RPC `sock_impl_set_options` is deprecated and will be removed in SPDK 21.07,
use `disable-zerocopy-send-server` or `disable-zerocopy-send-client` instead.
Added cmd_parser.py used to parse the args from argparse. There are
two benefit to use command parser:
- Simplify the definition of rpc method. It will reduce the rpc method code.
- Make the rpc call more versatile. User can add private args into rpc method.
### rpm
Added support for new RPM spec, rpmbuild/spdk.spec, which can be used for packaging the
@ -179,6 +521,12 @@ sockets to be marked using the SO_MARK socket option as a hint for which hardwar
queue they should be associated with. This mode leverages that by setting the same
value for all sockets within a poll group.
New parameters `enable_zerocopy_send_server` and `enable_zerocopy_send_client` were added
to struct spdk_sock_impl_opts, these parameters enable or disable zero copy send for server
and client sockets which are created using `spdk_sock_listen` and `spdk_sock_listen_ext` (server);
`spdk_sock_connect` and `spdk_sock_connect_ext` (client) functions. Existing parameter
`enable_zerocopy_send` enables or disables zero copy send for both server and client sockets.
### thread
A new API `spdk_io_channel_get_io_device` was added to get the io_device for the specified
@ -196,7 +544,7 @@ into or out of interrupt mode.
Added the `bdev_virtio_blk_set_hotplug` RPC for the virtio blk pci device.
## v21.01:
## v21.01
### bdev
@ -377,7 +725,7 @@ into `bdev_set_options` function.
Added optional `packed_ring_recovery` parameter to `vhost_create_blk_controller` RPC
enabling packed ring live recovery.
## v20.10:
## v20.10
### accel
@ -1178,11 +1526,11 @@ of logical blocks for write operation.
New zone-related fields were added to the result of the `get_bdevs` RPC call:
- `zoned`: indicates whether the device is zoned or a regular
block device
- `zone_size`: number of blocks in a single zone
- `max_open_zones`: maximum number of open zones
- `optimal_open_zones`: optimal number of open zones
- `zoned`: indicates whether the device is zoned or a regular
block device
- `zone_size`: number of blocks in a single zone
- `max_open_zones`: maximum number of open zones
- `optimal_open_zones`: optimal number of open zones
The `zoned` field is a boolean and is always present, while the rest is only available for zoned
bdevs.
@ -1606,7 +1954,7 @@ Preliminary support for cross compilation is now available. Targeting an older
CPU on the same architecture using your native compiler can be accomplished by
using the `--target-arch` option to `configure` as follows:
~~~
~~~bash
./configure --target-arch=broadwell
~~~
@ -1614,7 +1962,7 @@ Additionally, some support for cross-compiling to other architectures has been
added via the `--cross-prefix` argument to `configure`. To cross-compile, set CC
and CXX to the cross compilers, then run configure as follows:
~~~
~~~bash
./configure --target-arch=aarm64 --cross-prefix=aarch64-linux-gnu
~~~
@ -1902,19 +2250,19 @@ for which the memory is contiguous in the physical memory address space.
The following functions were removed:
- spdk_pci_nvme_device_attach()
- spdk_pci_nvme_enumerate()
- spdk_pci_ioat_device_attach()
- spdk_pci_ioat_enumerate()
- spdk_pci_virtio_device_attach()
- spdk_pci_virtio_enumerate()
- spdk_pci_nvme_device_attach()
- spdk_pci_nvme_enumerate()
- spdk_pci_ioat_device_attach()
- spdk_pci_ioat_enumerate()
- spdk_pci_virtio_device_attach()
- spdk_pci_virtio_enumerate()
They were replaced with generic spdk_pci_device_attach() and spdk_pci_enumerate() which
require a new spdk_pci_driver object to be provided. It can be one of the following:
- spdk_pci_nvme_get_driver()
- spdk_pci_ioat_get_driver()
- spdk_pci_virtio_get_driver()
- spdk_pci_nvme_get_driver()
- spdk_pci_ioat_get_driver()
- spdk_pci_virtio_get_driver()
spdk_pci_hook_device() and spdk_pci_unhook_device() were added. Those allow adding a virtual
spdk_pci_device into the SPDK PCI subsystem. A virtual device calls provided callbacks for
@ -2093,12 +2441,12 @@ Dropped support for DPDK 16.07 and earlier, which SPDK won't even compile with r
The following RPC commands deprecated in the previous release are now removed:
- construct_virtio_user_scsi_bdev
- construct_virtio_pci_scsi_bdev
- construct_virtio_user_blk_bdev
- construct_virtio_pci_blk_bdev
- remove_virtio_scsi_bdev
- construct_nvmf_subsystem
- construct_virtio_user_scsi_bdev
- construct_virtio_pci_scsi_bdev
- construct_virtio_user_blk_bdev
- construct_virtio_pci_blk_bdev
- remove_virtio_scsi_bdev
- construct_nvmf_subsystem
### Miscellaneous
@ -2282,11 +2630,11 @@ respectively.
The following RPC commands have been deprecated:
- construct_virtio_user_scsi_bdev
- construct_virtio_pci_scsi_bdev
- construct_virtio_user_blk_bdev
- construct_virtio_pci_blk_bdev
- remove_virtio_scsi_bdev
- construct_virtio_user_scsi_bdev
- construct_virtio_pci_scsi_bdev
- construct_virtio_user_blk_bdev
- construct_virtio_pci_blk_bdev
- remove_virtio_scsi_bdev
The `construct_virtio_*` ones were replaced with a single `construct_virtio_dev`
command that can create any type of Virtio bdev(s). `remove_virtio_scsi_bdev`
@ -2303,12 +2651,12 @@ Added jsonrpc-client C library intended for issuing RPC commands from applicatio
Added API enabling iteration over JSON object:
- spdk_json_find()
- spdk_json_find_string()
- spdk_json_find_array()
- spdk_json_object_first()
- spdk_json_array_first()
- spdk_json_next()
- spdk_json_find()
- spdk_json_find_string()
- spdk_json_find_array()
- spdk_json_object_first()
- spdk_json_array_first()
- spdk_json_next()
### Blobstore
@ -2848,7 +3196,8 @@ See the [Pmem Block Device](http://www.spdk.io/doc/bdev.html#bdev_config_pmem) d
A userspace driver for Virtio SCSI devices has been added.
The driver is capable of creating block devices on top of LUNs exposed by another SPDK vhost-scsi application.
See the [Virtio SCSI](http://www.spdk.io/doc/virtio.html) documentation and [Getting Started](http://www.spdk.io/doc/bdev.html#bdev_config_virtio_scsi) guide for more information.
See the [Virtio SCSI](http://www.spdk.io/doc/virtio.html) documentation and
[Getting Started](http://www.spdk.io/doc/bdev.html#bdev_config_virtio_scsi) guide for more information.
### Vhost target
@ -3074,33 +3423,33 @@ in app/iscsi_tgt and a documented configuration file can be found at etc/spdk/sp
This release also significantly improves the existing NVMe over Fabrics target.
- The configuration file format was changed, which will require updates to
any existing nvmf.conf files (see `etc/spdk/nvmf.conf.in`):
- `SubsystemGroup` was renamed to `Subsystem`.
- `AuthFile` was removed (it was unimplemented).
- `nvmf_tgt` was updated to correctly recognize NQN (NVMe Qualified Names)
when naming subsystems. The default node name was changed to reflect this;
it is now "nqn.2016-06.io.spdk".
- `Port` and `Host` sections were merged into the `Subsystem` section
- Global options to control max queue depth, number of queues, max I/O
size, and max in-capsule data size were added.
- The Nvme section was removed. Now a list of devices is specified by
bus/device/function directly in the Subsystem section.
- Subsystems now have a Mode, which can be Direct or Virtual. This is an attempt
to future-proof the interface, so the only mode supported by this release
is "Direct".
- Many bug fixes and cleanups were applied to the `nvmf_tgt` app and library.
- The target now supports discovery.
- The configuration file format was changed, which will require updates to
any existing nvmf.conf files (see `etc/spdk/nvmf.conf.in`):
- `SubsystemGroup` was renamed to `Subsystem`.
- `AuthFile` was removed (it was unimplemented).
- `nvmf_tgt` was updated to correctly recognize NQN (NVMe Qualified Names)
when naming subsystems. The default node name was changed to reflect this;
it is now "nqn.2016-06.io.spdk".
- `Port` and `Host` sections were merged into the `Subsystem` section
- Global options to control max queue depth, number of queues, max I/O
size, and max in-capsule data size were added.
- The Nvme section was removed. Now a list of devices is specified by
bus/device/function directly in the Subsystem section.
- Subsystems now have a Mode, which can be Direct or Virtual. This is an attempt
to future-proof the interface, so the only mode supported by this release
is "Direct".
- Many bug fixes and cleanups were applied to the `nvmf_tgt` app and library.
- The target now supports discovery.
This release also adds one new feature and provides some better examples and tools
for the NVMe driver.
- The Weighted Round Robin arbitration method is now supported. This allows
the user to specify different priorities on a per-I/O-queue basis. To
enable WRR, set the `arb_mechanism` field during `spdk_nvme_probe()`.
- A simplified "Hello World" example was added to show the proper way to use
the NVMe library API; see `examples/nvme/hello_world/hello_world.c`.
- A test for measuring software overhead was added. See `test/lib/nvme/overhead`.
- The Weighted Round Robin arbitration method is now supported. This allows
the user to specify different priorities on a per-I/O-queue basis. To
enable WRR, set the `arb_mechanism` field during `spdk_nvme_probe()`.
- A simplified "Hello World" example was added to show the proper way to use
the NVMe library API; see `examples/nvme/hello_world/hello_world.c`.
- A test for measuring software overhead was added. See `test/lib/nvme/overhead`.
## v16.06: NVMf userspace target
@ -3128,13 +3477,13 @@ user code.
supported on any attached controller.
- Added support for the Write Zeroes command.
- `examples/nvme/perf` can now report I/O command latency from the
the controller's viewpoint using the Intel vendor-specific read/write latency
log page.
the controller's viewpoint using the Intel vendor-specific read/write latency
log page.
- Added namespace reservation command support, which can be used to coordinate
sharing of a namespace between multiple hosts.
- Added hardware SGL support, which enables use of scattered buffers that
don't conform to the PRP list alignment and length requirements on supported
NVMe controllers.
don't conform to the PRP list alignment and length requirements on supported
NVMe controllers.
- Added end-to-end data protection support, including the ability to write and
read metadata in extended LBA (metadata appended to each block of data in the
buffer) and separate metadata buffer modes.
@ -3155,7 +3504,8 @@ user code.
## v1.2.0: IOAT user-space driver
This release adds a user-space driver with support for the Intel I/O Acceleration Technology (I/OAT, also known as "Crystal Beach") DMA offload engine.
This release adds a user-space driver with support for the Intel I/O Acceleration Technology
(I/OAT, also known as "Crystal Beach") DMA offload engine.
- IOAT
- New user-space driver supporting DMA memory copy offload

19
CONFIG
View File

@ -3,6 +3,7 @@
#
# Copyright (c) Intel Corporation.
# All rights reserved.
# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -76,6 +77,9 @@ CONFIG_UNIT_TESTS=y
# Build examples
CONFIG_EXAMPLES=y
# Build apps
CONFIG_APPS=y
# Build with Control-flow Enforcement Technology (CET)
CONFIG_CET=n
@ -86,6 +90,10 @@ CONFIG_ENV=
# This directory should contain 'include' and 'lib' directories for your DPDK
# installation.
CONFIG_DPDK_DIR=
# Automatically set via pkg-config when bare --with-dpdk is set
CONFIG_DPDK_LIB_DIR=
CONFIG_DPDK_INC_DIR=
CONFIG_DPDK_PKG_CONFIG=n
# This directory should contain 'include' and 'lib' directories for WPDK.
CONFIG_WPDK_DIR=
@ -134,6 +142,9 @@ CONFIG_PMDK_DIR=
# Enable the dependencies for building the compress vbdev
CONFIG_REDUCE=n
# Enable mlx5_pci dpdk compress PMD, enabled automatically if CONFIG_REDUCE=y and libmlx5 exists
CONFIG_REDUCE_MLX5=n
# Requires libiscsi development libraries.
CONFIG_ISCSI_INITIATOR=n
@ -171,4 +182,12 @@ CONFIG_FUSE=n
CONFIG_RAID5=n
# Build with IDXD support
# In this mode, SPDK fully controls the DSA device.
CONFIG_IDXD=n
# Build with USDT support
CONFIG_USDT=n
# Build with IDXD kernel support.
# In this mode, SPDK shares the DSA device with the kernel.
CONFIG_IDXD_KERNEL=n

View File

@ -40,8 +40,9 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
DIRS-y += lib
DIRS-y += module
DIRS-$(CONFIG_SHARED) += shared_lib
DIRS-y += app include
DIRS-y += include
DIRS-$(CONFIG_EXAMPLES) += examples
DIRS-$(CONFIG_APPS) += app
DIRS-y += test
DIRS-$(CONFIG_IPSEC_MB) += ipsecbuild
DIRS-$(CONFIG_ISAL) += isalbuild
@ -57,11 +58,13 @@ export MAKE_PID := $(shell echo $$PPID)
ifeq ($(SPDK_ROOT_DIR)/lib/env_dpdk,$(CONFIG_ENV))
ifeq ($(CURDIR)/dpdk/build,$(CONFIG_DPDK_DIR))
ifneq ($(SKIP_DPDK_BUILD),1)
ifneq ($(CONFIG_DPDK_PKG_CONFIG),y)
DPDKBUILD = dpdkbuild
DIRS-y += dpdkbuild
endif
endif
endif
endif
ifeq ($(OS),Windows)
ifeq ($(CURDIR)/wpdk/build,$(CONFIG_WPDK_DIR))
@ -94,12 +97,7 @@ endif
all: mk/cc.mk $(DIRS-y)
clean: $(DIRS-y)
$(Q)rm -f include/spdk/config.h
$(Q)rm -rf build/bin
$(Q)rm -rf build/fio
$(Q)rm -rf build/examples
$(Q)rm -rf build/include
$(Q)rm -rf build/lib/pkgconfig
$(Q)find build/lib ! -name .gitignore -type f -delete
$(Q)rm -rf build
install: all
$(Q)echo "Installed to $(DESTDIR)$(CONFIG_PREFIX)"

View File

@ -18,7 +18,7 @@ The development kit currently includes:
* [vhost target](http://www.spdk.io/doc/vhost.html)
* [Virtio-SCSI driver](http://www.spdk.io/doc/virtio.html)
# In this readme
## In this readme
* [Documentation](#documentation)
* [Prerequisites](#prerequisites)
@ -129,7 +129,9 @@ Boolean (on/off) options are configured with a 'y' (yes) or 'n' (no). For
example, this line of `CONFIG` controls whether the optional RDMA (libibverbs)
support is enabled:
CONFIG_RDMA?=n
~~~{.sh}
CONFIG_RDMA?=n
~~~
To enable RDMA, this line may be added to `mk/config.mk` with a 'y' instead of
'n'. For the majority of options this can be done using the `configure` script.
@ -221,6 +223,13 @@ configuring 8192MB memory.
sudo HUGEMEM=8192 scripts/setup.sh
~~~
There are a lot of other environment variables that can be set to configure
setup.sh for advanced users. To see the full list, run:
~~~{.sh}
scripts/setup.sh --help
~~~
<a id="examples"></a>
## Example Code

View File

@ -43,7 +43,7 @@ CFLAGS += -I$(SPDK_ROOT_DIR)/lib
C_SRCS := iscsi_tgt.c
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event_iscsi event_net
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event event_iscsi
ifeq ($(SPDK_ROOT_DIR)/lib/env_dpdk,$(CONFIG_ENV))
SPDK_LIB_LIST += env_dpdk_rpc

View File

@ -37,7 +37,6 @@
#include "spdk/event.h"
#include "iscsi/iscsi.h"
#include "spdk/log.h"
#include "spdk/net.h"
static int g_daemon_mode = 0;

View File

@ -39,7 +39,7 @@ APP = nvmf_tgt
C_SRCS := nvmf_main.c
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event_nvmf
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event event_nvmf
ifeq ($(SPDK_ROOT_DIR)/lib/env_dpdk,$(CONFIG_ENV))
SPDK_LIB_LIST += env_dpdk_rpc

View File

@ -39,6 +39,6 @@ APP = spdk_dd
C_SRCS := spdk_dd.c
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event_bdev
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event event_bdev
include $(SPDK_ROOT_DIR)/mk/spdk.app.mk

View File

@ -41,7 +41,7 @@ C_SRCS := spdk_tgt.c
SPDK_LIB_LIST = $(ALL_MODULES_LIST)
SPDK_LIB_LIST += event_iscsi event_nvmf
SPDK_LIB_LIST += event event_iscsi event_nvmf
ifeq ($(SPDK_ROOT_DIR)/lib/env_dpdk,$(CONFIG_ENV))
SPDK_LIB_LIST += env_dpdk_rpc

View File

@ -39,6 +39,6 @@ APP = spdk_top
C_SRCS := spdk_top.c
SPDK_LIB_LIST = rpc
LIBS=-lncurses -lpanel -lmenu
LIBS=-lpanel -lmenu -lncurses
include $(SPDK_ROOT_DIR)/mk/spdk.app.mk

File diff suppressed because it is too large Load Diff

View File

@ -38,6 +38,8 @@ include $(SPDK_ROOT_DIR)/mk/spdk.modules.mk
APP = spdk_trace
SPDK_NO_LINK_ENV = 1
SPDK_LIB_LIST += json trace_parser
CXX_SRCS := trace.cpp
include $(SPDK_ROOT_DIR)/mk/spdk.app_cxx.mk

View File

@ -32,60 +32,47 @@
*/
#include "spdk/stdinc.h"
#include "spdk/env.h"
#include "spdk/json.h"
#include "spdk/likely.h"
#include "spdk/string.h"
#include "spdk/util.h"
#include <map>
extern "C" {
#include "spdk/trace.h"
#include "spdk/trace_parser.h"
#include "spdk/util.h"
}
static struct spdk_trace_histories *g_histories;
static struct spdk_trace_parser *g_parser;
static const struct spdk_trace_flags *g_flags;
static struct spdk_json_write_ctx *g_json;
static bool g_print_tsc = false;
/* This is a bit ugly, but we don't want to include env_dpdk in the app, while spdk_util, which we
* do need, uses some of the functions implemented there. We're not actually using the functions
* that depend on those, so just define them as no-ops to allow the app to link.
*/
extern "C" {
void *
spdk_realloc(void *buf, size_t size, size_t align)
{
assert(false);
return NULL;
}
void
spdk_free(void *buf)
{
assert(false);
}
} /* extern "C" */
static void usage(void);
struct entry_key {
entry_key(uint16_t _lcore, uint64_t _tsc) : lcore(_lcore), tsc(_tsc) {}
uint16_t lcore;
uint64_t tsc;
};
class compare_entry_key
{
public:
bool operator()(const entry_key &first, const entry_key &second) const
{
if (first.tsc == second.tsc) {
return first.lcore < second.lcore;
} else {
return first.tsc < second.tsc;
}
}
};
typedef std::map<entry_key, spdk_trace_entry *, compare_entry_key> entry_map;
entry_map g_entry_map;
struct object_stats {
std::map<uint64_t, uint64_t> start;
std::map<uint64_t, uint64_t> index;
std::map<uint64_t, uint64_t> size;
std::map<uint64_t, uint64_t> tpoint_id;
uint64_t counter;
object_stats() : start(), index(), size(), tpoint_id(), counter(0) {}
};
struct object_stats g_stats[SPDK_TRACE_MAX_OBJECT];
static char *g_exe_name;
static int g_verbose = 1;
static uint64_t g_tsc_rate;
static uint64_t g_first_tsc = 0x0;
static float
get_us_from_tsc(uint64_t tsc, uint64_t tsc_rate)
@ -93,10 +80,19 @@ get_us_from_tsc(uint64_t tsc, uint64_t tsc_rate)
return ((float)tsc) * 1000 * 1000 / tsc_rate;
}
static const char *
format_argname(const char *name)
{
static char namebuf[16];
snprintf(namebuf, sizeof(namebuf), "%s: ", name);
return namebuf;
}
static void
print_ptr(const char *arg_string, uint64_t arg)
{
printf("%-7.7s0x%-14jx ", arg_string, arg);
printf("%-7.7s0x%-14jx ", format_argname(arg_string), arg);
}
static void
@ -107,14 +103,13 @@ print_uint64(const char *arg_string, uint64_t arg)
* for FLUSH WRITEBUF when writev() returns -1 due to full
* socket buffer.
*/
printf("%-7.7s%-16jd ", arg_string, arg);
printf("%-7.7s%-16jd ", format_argname(arg_string), arg);
}
static void
print_string(const char *arg_string, uint64_t arg)
print_string(const char *arg_string, const char *arg)
{
char *str = (char *)&arg;
printf("%-7.7s%.8s ", arg_string, str);
printf("%-7.7s%-16.16s ", format_argname(arg_string), arg);
}
static void
@ -128,64 +123,46 @@ print_size(uint32_t size)
}
static void
print_object_id(uint8_t type, uint64_t id)
print_object_id(const struct spdk_trace_tpoint *d, struct spdk_trace_parser_entry *entry)
{
printf("id: %c%-15jd ", g_histories->flags.object[type].id_prefix, id);
/* Set size to 128 and 256 bytes to make sure we can fit all the characters we need */
char related_id[128] = {'\0'};
char ids[256] = {'\0'};
if (entry->related_type != OBJECT_NONE) {
snprintf(related_id, sizeof(related_id), " (%c%jd)",
g_flags->object[entry->related_type].id_prefix,
entry->related_index);
}
snprintf(ids, sizeof(ids), "%c%jd%s", g_flags->object[d->object_type].id_prefix,
entry->object_index, related_id);
printf("id: %-17s", ids);
}
static void
print_float(const char *arg_string, float arg)
{
printf("%-7s%-16.3f ", arg_string, arg);
printf("%-7s%-16.3f ", format_argname(arg_string), arg);
}
static void
print_arg(uint8_t arg_type, const char *arg_string, uint64_t arg)
print_event(struct spdk_trace_parser_entry *entry, uint64_t tsc_rate, uint64_t tsc_offset)
{
if (arg_string[0] == 0) {
printf("%24s", "");
return;
}
switch (arg_type) {
case SPDK_TRACE_ARG_TYPE_PTR:
print_ptr(arg_string, arg);
break;
case SPDK_TRACE_ARG_TYPE_INT:
print_uint64(arg_string, arg);
break;
case SPDK_TRACE_ARG_TYPE_STR:
print_string(arg_string, arg);
break;
}
}
static void
print_event(struct spdk_trace_entry *e, uint64_t tsc_rate,
uint64_t tsc_offset, uint16_t lcore)
{
struct spdk_trace_tpoint *d;
struct object_stats *stats;
struct spdk_trace_entry *e = entry->entry;
const struct spdk_trace_tpoint *d;
float us;
size_t i;
d = &g_histories->flags.tpoint[e->tpoint_id];
stats = &g_stats[d->object_type];
if (d->new_object) {
stats->index[e->object_id] = stats->counter++;
stats->tpoint_id[e->object_id] = e->tpoint_id;
stats->start[e->object_id] = e->tsc;
stats->size[e->object_id] = e->size;
}
d = &g_flags->tpoint[e->tpoint_id];
us = get_us_from_tsc(e->tsc - tsc_offset, tsc_rate);
printf("%2d: %10.3f ", lcore, us);
printf("%2d: %10.3f ", entry->lcore, us);
if (g_print_tsc) {
printf("(%9ju) ", e->tsc - tsc_offset);
}
if (g_histories->flags.owner[d->owner_type].id_prefix) {
printf("%c%02d ", g_histories->flags.owner[d->owner_type].id_prefix, e->poller_id);
if (g_flags->owner[d->owner_type].id_prefix) {
printf("%c%02d ", g_flags->owner[d->owner_type].id_prefix, e->poller_id);
} else {
printf("%4s", " ");
}
@ -193,94 +170,180 @@ print_event(struct spdk_trace_entry *e, uint64_t tsc_rate,
printf("%-*s ", (int)sizeof(d->name), d->name);
print_size(e->size);
print_arg(d->arg1_type, d->arg1_name, e->arg1);
if (d->new_object) {
print_object_id(d->object_type, stats->index[e->object_id]);
print_object_id(d, entry);
} else if (d->object_type != OBJECT_NONE) {
if (stats->start.find(e->object_id) != stats->start.end()) {
us = get_us_from_tsc(e->tsc - stats->start[e->object_id],
tsc_rate);
print_object_id(d->object_type, stats->index[e->object_id]);
print_float("time:", us);
if (entry->object_index != UINT64_MAX) {
us = get_us_from_tsc(e->tsc - entry->object_start, tsc_rate);
print_object_id(d, entry);
print_float("time", us);
} else {
printf("id: N/A");
}
} else if (e->object_id != 0) {
print_arg(SPDK_TRACE_ARG_TYPE_PTR, "object: ", e->object_id);
print_ptr("object", e->object_id);
}
for (i = 0; i < d->num_args; ++i) {
switch (d->args[i].type) {
case SPDK_TRACE_ARG_TYPE_PTR:
print_ptr(d->args[i].name, (uint64_t)entry->args[i].pointer);
break;
case SPDK_TRACE_ARG_TYPE_INT:
print_uint64(d->args[i].name, entry->args[i].integer);
break;
case SPDK_TRACE_ARG_TYPE_STR:
print_string(d->args[i].name, entry->args[i].string);
break;
}
}
printf("\n");
}
static void
process_event(struct spdk_trace_entry *e, uint64_t tsc_rate,
uint64_t tsc_offset, uint16_t lcore)
print_event_json(struct spdk_trace_parser_entry *entry, uint64_t tsc_rate, uint64_t tsc_offset)
{
if (g_verbose) {
print_event(e, tsc_rate, tsc_offset, lcore);
struct spdk_trace_entry *e = entry->entry;
const struct spdk_trace_tpoint *d;
size_t i;
d = &g_flags->tpoint[e->tpoint_id];
spdk_json_write_object_begin(g_json);
spdk_json_write_named_uint64(g_json, "lcore", entry->lcore);
spdk_json_write_named_uint64(g_json, "tpoint", e->tpoint_id);
spdk_json_write_named_uint64(g_json, "tsc", e->tsc);
if (g_flags->owner[d->owner_type].id_prefix) {
spdk_json_write_named_string_fmt(g_json, "poller", "%c%02d",
g_flags->owner[d->owner_type].id_prefix,
e->poller_id);
}
if (e->size != 0) {
spdk_json_write_named_uint32(g_json, "size", e->size);
}
if (d->new_object || d->object_type != OBJECT_NONE || e->object_id != 0) {
char object_type;
spdk_json_write_named_object_begin(g_json, "object");
if (d->new_object) {
object_type = g_flags->object[d->object_type].id_prefix;
spdk_json_write_named_string_fmt(g_json, "id", "%c%" PRIu64, object_type,
entry->object_index);
} else if (d->object_type != OBJECT_NONE) {
object_type = g_flags->object[d->object_type].id_prefix;
if (entry->object_index != UINT64_MAX) {
spdk_json_write_named_string_fmt(g_json, "id", "%c%" PRIu64,
object_type,
entry->object_index);
spdk_json_write_named_uint64(g_json, "time",
e->tsc - entry->object_start);
}
}
spdk_json_write_named_uint64(g_json, "value", e->object_id);
spdk_json_write_object_end(g_json);
}
/* Print related objects array */
if (entry->related_index != UINT64_MAX) {
spdk_json_write_named_string_fmt(g_json, "related", "%c%" PRIu64,
g_flags->object[entry->related_type].id_prefix,
entry->related_index);
}
if (d->num_args > 0) {
spdk_json_write_named_array_begin(g_json, "args");
for (i = 0; i < d->num_args; ++i) {
switch (d->args[i].type) {
case SPDK_TRACE_ARG_TYPE_PTR:
spdk_json_write_uint64(g_json, (uint64_t)entry->args[i].pointer);
break;
case SPDK_TRACE_ARG_TYPE_INT:
spdk_json_write_uint64(g_json, entry->args[i].integer);
break;
case SPDK_TRACE_ARG_TYPE_STR:
spdk_json_write_string(g_json, entry->args[i].string);
break;
}
}
spdk_json_write_array_end(g_json);
}
spdk_json_write_object_end(g_json);
}
static void
process_event(struct spdk_trace_parser_entry *e, uint64_t tsc_rate, uint64_t tsc_offset)
{
if (g_json == NULL) {
print_event(e, tsc_rate, tsc_offset);
} else {
print_event_json(e, tsc_rate, tsc_offset);
}
}
static int
populate_events(struct spdk_trace_history *history, int num_entries)
static void
print_tpoint_definitions(void)
{
int i, num_entries_filled;
struct spdk_trace_entry *e;
int first, last, lcore;
const struct spdk_trace_tpoint *tpoint;
size_t i, j;
lcore = history->lcore;
e = history->entries;
num_entries_filled = num_entries;
while (e[num_entries_filled - 1].tsc == 0) {
num_entries_filled--;
/* We only care about these when printing JSON */
if (!g_json) {
return;
}
if (num_entries == num_entries_filled) {
first = last = 0;
for (i = 1; i < num_entries; i++) {
if (e[i].tsc < e[first].tsc) {
first = i;
}
if (e[i].tsc > e[last].tsc) {
last = i;
}
spdk_json_write_named_uint64(g_json, "tsc_rate", g_flags->tsc_rate);
spdk_json_write_named_array_begin(g_json, "tpoints");
for (i = 0; i < SPDK_COUNTOF(g_flags->tpoint); ++i) {
tpoint = &g_flags->tpoint[i];
if (tpoint->tpoint_id == 0) {
continue;
}
} else {
first = 0;
last = num_entries_filled - 1;
}
/*
* We keep track of the highest first TSC out of all reactors.
* We will ignore any events that occured before this TSC on any
* other reactors. This will ensure we only print data for the
* subset of time where we have data across all reactors.
*/
if (e[first].tsc > g_first_tsc) {
g_first_tsc = e[first].tsc;
}
spdk_json_write_object_begin(g_json);
spdk_json_write_named_string(g_json, "name", tpoint->name);
spdk_json_write_named_uint32(g_json, "id", tpoint->tpoint_id);
spdk_json_write_named_bool(g_json, "new_object", tpoint->new_object);
i = first;
while (1) {
g_entry_map[entry_key(lcore, e[i].tsc)] = &e[i];
if (i == last) {
break;
}
i++;
if (i == num_entries_filled) {
i = 0;
spdk_json_write_named_array_begin(g_json, "args");
for (j = 0; j < tpoint->num_args; ++j) {
spdk_json_write_object_begin(g_json);
spdk_json_write_named_string(g_json, "name", tpoint->args[j].name);
spdk_json_write_named_uint32(g_json, "type", tpoint->args[j].type);
spdk_json_write_named_uint32(g_json, "size", tpoint->args[j].size);
spdk_json_write_object_end(g_json);
}
spdk_json_write_array_end(g_json);
spdk_json_write_object_end(g_json);
}
return (0);
spdk_json_write_array_end(g_json);
}
static int
print_json(void *cb_ctx, const void *data, size_t size)
{
ssize_t rc;
while (size > 0) {
rc = write(STDOUT_FILENO, data, size);
if (rc < 0) {
fprintf(stderr, "%s: %s\n", g_exe_name, spdk_strerror(errno));
abort();
}
size -= rc;
}
return 0;
}
static void usage(void)
{
fprintf(stderr, "usage:\n");
fprintf(stderr, " %s <option> <lcore#>\n", g_exe_name);
fprintf(stderr, " option = '-q' to disable verbose mode\n");
fprintf(stderr, " '-c' to display single lcore history\n");
fprintf(stderr, " '-t' to display TSC offset for each event\n");
fprintf(stderr, " '-s' to specify spdk_trace shm name for a\n");
@ -291,25 +354,24 @@ static void usage(void)
fprintf(stderr, " -i or -p must be specified)\n");
fprintf(stderr, " '-f' to specify a tracepoint file name\n");
fprintf(stderr, " (-s and -f are mutually exclusive)\n");
fprintf(stderr, " '-j' to use JSON to format the output\n");
}
int main(int argc, char **argv)
{
void *history_ptr;
struct spdk_trace_history *history;
int fd, i, rc;
int lcore = SPDK_TRACE_MAX_LCORE;
uint64_t tsc_offset;
const char *app_name = NULL;
const char *file_name = NULL;
int op;
char shm_name[64];
int shm_id = -1, shm_pid = -1;
uint64_t trace_histories_size;
struct stat _stat;
struct spdk_trace_parser_opts opts;
struct spdk_trace_parser_entry entry;
int lcore = SPDK_TRACE_MAX_LCORE;
uint64_t tsc_offset, entry_count;
const char *app_name = NULL;
const char *file_name = NULL;
int op, i;
char shm_name[64];
int shm_id = -1, shm_pid = -1;
bool json = false;
g_exe_name = argv[0];
while ((op = getopt(argc, argv, "c:f:i:p:qs:t")) != -1) {
while ((op = getopt(argc, argv, "c:f:i:jp:s:t")) != -1) {
switch (op) {
case 'c':
lcore = atoi(optarg);
@ -326,9 +388,6 @@ int main(int argc, char **argv)
case 'p':
shm_pid = atoi(optarg);
break;
case 'q':
g_verbose = 0;
break;
case 's':
app_name = optarg;
break;
@ -338,6 +397,9 @@ int main(int argc, char **argv)
case 't':
g_print_tsc = true;
break;
case 'j':
json = true;
break;
default:
usage();
exit(1);
@ -356,107 +418,65 @@ int main(int argc, char **argv)
exit(1);
}
if (file_name) {
fd = open(file_name, O_RDONLY);
} else {
if (json) {
g_json = spdk_json_write_begin(print_json, NULL, 0);
if (g_json == NULL) {
fprintf(stderr, "Failed to allocate JSON write context\n");
exit(1);
}
}
if (!file_name) {
if (shm_id >= 0) {
snprintf(shm_name, sizeof(shm_name), "/%s_trace.%d", app_name, shm_id);
} else {
snprintf(shm_name, sizeof(shm_name), "/%s_trace.pid%d", app_name, shm_pid);
}
fd = shm_open(shm_name, O_RDONLY, 0600);
file_name = shm_name;
}
if (fd < 0) {
fprintf(stderr, "Could not open %s.\n", file_name);
usage();
exit(-1);
opts.filename = file_name;
opts.lcore = lcore;
opts.mode = app_name == NULL ? SPDK_TRACE_PARSER_MODE_FILE : SPDK_TRACE_PARSER_MODE_SHM;
g_parser = spdk_trace_parser_init(&opts);
if (g_parser == NULL) {
fprintf(stderr, "Failed to initialize trace parser\n");
exit(1);
}
rc = fstat(fd, &_stat);
if (rc < 0) {
fprintf(stderr, "Could not get size of %s.\n", file_name);
usage();
exit(-1);
}
if ((size_t)_stat.st_size < sizeof(*g_histories)) {
fprintf(stderr, "%s is not a valid trace file\n", file_name);
usage();
exit(-1);
}
/* Map the header of trace file */
history_ptr = mmap(NULL, sizeof(*g_histories), PROT_READ, MAP_SHARED, fd, 0);
if (history_ptr == MAP_FAILED) {
fprintf(stderr, "Could not mmap %s.\n", file_name);
usage();
exit(-1);
}
g_histories = (struct spdk_trace_histories *)history_ptr;
g_tsc_rate = g_histories->flags.tsc_rate;
if (g_tsc_rate == 0) {
fprintf(stderr, "Invalid tsc_rate %ju\n", g_tsc_rate);
usage();
exit(-1);
}
if (g_verbose) {
printf("TSC Rate: %ju\n", g_tsc_rate);
}
/* Remap the entire trace file */
trace_histories_size = spdk_get_trace_histories_size(g_histories);
munmap(history_ptr, sizeof(*g_histories));
if ((size_t)_stat.st_size < trace_histories_size) {
fprintf(stderr, "%s is not a valid trace file\n", file_name);
usage();
exit(-1);
}
history_ptr = mmap(NULL, trace_histories_size, PROT_READ, MAP_SHARED, fd, 0);
if (history_ptr == MAP_FAILED) {
fprintf(stderr, "Could not mmap %s.\n", file_name);
usage();
exit(-1);
}
g_histories = (struct spdk_trace_histories *)history_ptr;
if (lcore == SPDK_TRACE_MAX_LCORE) {
for (i = 0; i < SPDK_TRACE_MAX_LCORE; i++) {
history = spdk_get_per_lcore_history(g_histories, i);
if (history->num_entries == 0 || history->entries[0].tsc == 0) {
continue;
}
if (g_verbose && history->num_entries) {
printf("Trace Size of lcore (%d): %ju\n", i, history->num_entries);
}
populate_events(history, history->num_entries);
}
g_flags = spdk_trace_parser_get_flags(g_parser);
if (!g_json) {
printf("TSC Rate: %ju\n", g_flags->tsc_rate);
} else {
history = spdk_get_per_lcore_history(g_histories, lcore);
if (history->num_entries > 0 && history->entries[0].tsc != 0) {
if (g_verbose && history->num_entries) {
printf("Trace Size of lcore (%d): %ju\n", lcore, history->num_entries);
}
spdk_json_write_object_begin(g_json);
print_tpoint_definitions();
spdk_json_write_named_array_begin(g_json, "entries");
}
populate_events(history, history->num_entries);
for (i = 0; i < SPDK_TRACE_MAX_LCORE; ++i) {
if (lcore == SPDK_TRACE_MAX_LCORE || i == lcore) {
entry_count = spdk_trace_parser_get_entry_count(g_parser, i);
if (entry_count > 0) {
printf("Trace Size of lcore (%d): %ju\n", i, entry_count);
}
}
}
tsc_offset = g_first_tsc;
for (entry_map::iterator it = g_entry_map.begin(); it != g_entry_map.end(); it++) {
if (it->first.tsc < g_first_tsc) {
tsc_offset = spdk_trace_parser_get_tsc_offset(g_parser);
while (spdk_trace_parser_next_entry(g_parser, &entry)) {
if (entry.entry->tsc < tsc_offset) {
continue;
}
process_event(it->second, g_tsc_rate, tsc_offset, it->first.lcore);
process_event(&entry, g_flags->tsc_rate, tsc_offset);
}
munmap(history_ptr, trace_histories_size);
close(fd);
if (g_json != NULL) {
spdk_json_write_array_end(g_json);
spdk_json_write_object_end(g_json);
spdk_json_write_end(g_json);
}
spdk_trace_parser_cleanup(g_parser);
return (0);
}

View File

@ -39,7 +39,7 @@ APP = vhost
C_SRCS := vhost.c
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event_vhost event_nbd
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event event_vhost event_nbd
ifeq ($(SPDK_ROOT_DIR)/lib/env_dpdk,$(CONFIG_ENV))
SPDK_LIB_LIST += env_dpdk_rpc

View File

@ -14,6 +14,10 @@ source "$1"
source "$rootdir/test/common/autotest_common.sh"
source "$rootdir/scripts/common.sh"
if [[ -n $EXTERNAL_MAKE_HUGEMEM ]]; then
export EXTERNAL_MAKE_HUGEMEM
fi
out=$output_dir
if [ -n "$SPDK_TEST_NATIVE_DPDK" ]; then
scanbuild_exclude=" --exclude $(dirname $SPDK_RUN_EXTERNAL_DPDK)"
@ -41,9 +45,9 @@ function ocf_precompile() {
# So we precompile OCF now for further use as standalone static library
./configure $(echo $config_params | sed 's/--enable-coverage//g')
$MAKE $MAKEFLAGS include/spdk/config.h
CC=gcc CCAR=ar $MAKE $MAKEFLAGS -C lib/env_ocf exportlib O=$rootdir/build/ocf.a
CC=gcc CCAR=ar $MAKE $MAKEFLAGS -C lib/env_ocf exportlib O=$rootdir/ocf.a
# Set config to use precompiled library
config_params="$config_params --with-ocf=/$rootdir/build/ocf.a"
config_params="$config_params --with-ocf=/$rootdir/ocf.a"
# need to reconfigure to avoid clearing ocf related files on future make clean.
./configure $config_params
}
@ -51,7 +55,17 @@ function ocf_precompile() {
function build_native_dpdk() {
local external_dpdk_dir
local external_dpdk_base_dir
local compiler_version
local compiler
compiler=${CC:-gcc}
if [[ $compiler != *clang* && $compiler != *gcc* ]]; then
echo "Unsupported compiler detected ($compiler), failing the test" >&2
return 1
fi
compiler_version=$("$compiler" -dumpversion)
compiler_version=${compiler_version%%.*}
external_dpdk_dir="$SPDK_RUN_EXTERNAL_DPDK"
external_dpdk_base_dir="$(dirname $external_dpdk_dir)"
@ -65,8 +79,17 @@ function build_native_dpdk() {
git clone --branch $SPDK_TEST_NATIVE_DPDK --depth 1 http://dpdk.org/git/dpdk "$external_dpdk_base_dir"
git -C "$external_dpdk_base_dir" log --oneline -n 5
dpdk_cflags="-fPIC -g -Werror -fcommon"
dpdk_cflags="-fPIC -g -fcommon"
dpdk_ldflags=""
dpdk_ver=$(< "$external_dpdk_base_dir/VERSION")
if [[ $compiler == *gcc* && $compiler_version -ge 5 ]]; then
dpdk_cflags+=" -Werror"
fi
if [[ $compiler == *gcc* && $compiler_version -ge 10 ]]; then
dpdk_cflags+=" -Wno-stringop-overflow"
fi
# the drivers we use
# net/i40e driver is not really needed by us, but it's built as a workaround
@ -76,17 +99,29 @@ function build_native_dpdk() {
DPDK_ALL_DRIVERS=($(find "$external_dpdk_base_dir/drivers" -mindepth 1 -type d | sed -n "s#^$external_dpdk_base_dir/drivers/##p"))
if [[ "$SPDK_TEST_CRYPTO" -eq 1 ]]; then
git clone --branch v0.54 --depth 1 https://github.com/intel/intel-ipsec-mb.git "$external_dpdk_base_dir/intel-ipsec-mb"
intel_ipsec_mb_ver=v0.54
intel_ipsec_mb_drv=crypto/aesni_mb
intel_ipsec_lib=""
if ge "$dpdk_ver" 21.11.0; then
# Minimum supported version of intel-ipsec-mb, for DPDK >= 21.11, is 1.0.
# Source of the aesni_mb driver was moved to ipsec_mb. .{h,so,a} were moved
# to ./lib.
# https://github.com/dpdk/dpdk/commit/918fd2f1466b0e3b21a033df7012a77a83665582.
intel_ipsec_mb_ver=v1.0
intel_ipsec_mb_drv=crypto/ipsec_mb
intel_ipsec_lib=lib
fi
git clone --branch "$intel_ipsec_mb_ver" --depth 1 https://github.com/intel/intel-ipsec-mb.git "$external_dpdk_base_dir/intel-ipsec-mb"
cd "$external_dpdk_base_dir/intel-ipsec-mb"
$MAKE $MAKEFLAGS all SHARED=y EXTRA_CFLAGS=-fPIC
DPDK_DRIVERS+=("crypto")
DPDK_DRIVERS+=("crypto/aesni_mb")
DPDK_DRIVERS+=("$intel_ipsec_mb_drv")
DPDK_DRIVERS+=("crypto/qat")
DPDK_DRIVERS+=("compress/qat")
DPDK_DRIVERS+=("common/qat")
dpdk_cflags+=" -I$external_dpdk_base_dir/intel-ipsec-mb"
dpdk_ldflags+=" -L$external_dpdk_base_dir/intel-ipsec-mb"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$external_dpdk_base_dir/intel-ipsec-mb
dpdk_cflags+=" -I$external_dpdk_base_dir/intel-ipsec-mb/$intel_ipsec_lib"
dpdk_ldflags+=" -L$external_dpdk_base_dir/intel-ipsec-mb/$intel_ipsec_lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$external_dpdk_base_dir/intel-ipsec-mb/$intel_ipsec_lib"
fi
if [[ "$SPDK_TEST_REDUCE" -eq 1 ]]; then
@ -103,6 +138,14 @@ function build_native_dpdk() {
DPDK_DRIVERS+=("compress/isal")
DPDK_DRIVERS+=("compress/qat")
DPDK_DRIVERS+=("common/qat")
if ge "$dpdk_ver" 21.02.0; then
# SPDK enables REDUCE_MLX in case supported version of DPDK is detected
# so make sure proper libs are built.
DPDK_DRIVERS+=("bus/auxiliary")
DPDK_DRIVERS+=("common/mlx5")
DPDK_DRIVERS+=("common/mlx5/linux")
DPDK_DRIVERS+=("compress/mlx5")
fi
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$isal_dir/build/lib/pkgconfig"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$isal_dir/build/lib"
fi
@ -113,23 +156,12 @@ function build_native_dpdk() {
cd $external_dpdk_base_dir
if [ "$(uname -s)" = "Linux" ]; then
dpdk_cflags+=" -Wno-stringop-overflow"
# Fix for freeing device if not kernel driver configured.
# TODO: Remove once this is merged in upstream DPDK
if grep "20.08.0" $external_dpdk_base_dir/VERSION; then
wget https://github.com/spdk/dpdk/commit/64f1ced13f974e8b3d46b87c361a09eca68126f9.patch -O dpdk-pci.patch
wget https://github.com/spdk/dpdk/commit/c2c273d5c8fbf673623b427f8f4ab5af5ddf0e08.patch -O dpdk-qat.patch
elif grep "20.11\|21.02" $external_dpdk_base_dir/VERSION; then
wget https://github.com/karlatec/dpdk/commit/3219c0cfc38803aec10c809dde16e013b370bda9.patch -O dpdk-pci.patch
wget https://github.com/karlatec/dpdk/commit/adf8f7638de29bc4bf9ba3faf12bbdae73acda0c.patch -O dpdk-qat.patch
else
wget https://github.com/karlatec/dpdk/commit/eac05db0580091ef8e4d338aa5d2210695521894.patch -O dpdk-pci.patch
wget https://github.com/karlatec/dpdk/commit/d649d5efb7bb404ce59dea81768adeb994b284f7.patch -O dpdk-qat.patch
if [[ $dpdk_ver == 20.11* ]]; then
patch -p1 < "$rootdir/test/common/config/pkgdep/patches/dpdk/20.11/dpdk_pci.patch"
patch -p1 < "$rootdir/test/common/config/pkgdep/patches/dpdk/20.11/dpdk_qat.patch"
elif [[ $dpdk_ver == 21.08* ]]; then
patch -p1 < "$rootdir/test/common/config/pkgdep/patches/dpdk/21.08/dpdk_qat.patch"
fi
git config --local user.name "spdk"
git config --local user.email "nomail@all.com"
git am dpdk-pci.patch
git am dpdk-qat.patch
fi
meson build-tmp --prefix="$external_dpdk_dir" --libdir lib \
@ -158,6 +190,7 @@ function make_fail_cleanup() {
function scanbuild_make() {
pass=true
"$rootdir/configure" $config_params --without-shared
$scanbuild $MAKE $MAKEFLAGS > $out/build_output.txt && rm -rf $out/scan-build-tmp || make_fail_cleanup
xtrace_disable
@ -255,12 +288,9 @@ function build_doc() {
function autobuild_test_suite() {
run_test "autobuild_check_format" ./scripts/check_format.sh
run_test "autobuild_external_code" sudo -E --preserve-env=PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH $rootdir/test/external_code/test_make.sh $rootdir
if [ "$SPDK_TEST_OCF" -eq 1 ]; then
run_test "autobuild_ocf_precompile" ocf_precompile
fi
run_test "autobuild_check_so_deps" $rootdir/test/make/check_so_deps.sh $1
./configure $config_params --without-shared
run_test "scanbuild_make" scanbuild_make
$MAKE $MAKEFLAGS
run_test "autobuild_generated_files_check" porcelain_check
run_test "autobuild_header_dependency_check" header_dependency_check
run_test "autobuild_make_install" $MAKE $MAKEFLAGS install DESTDIR="$SPDK_WORKSPACE" prefix=/usr
@ -268,6 +298,11 @@ function autobuild_test_suite() {
run_test "autobuild_build_doc" build_doc
}
function unittest_build() {
"$rootdir/configure" $config_params --without-shared
$MAKE $MAKEFLAGS
}
if [ $SPDK_RUN_VALGRIND -eq 1 ]; then
run_test "valgrind" echo "using valgrind"
fi
@ -291,12 +326,17 @@ $MAKE cc_version
$MAKE cxx_version
echo "** END ** Info for Hostname: $HOSTNAME"
if [ "$SPDK_TEST_AUTOBUILD" -eq 1 ]; then
if [[ $SPDK_TEST_OCF -eq 1 ]]; then
run_test "autobuild_ocf_precompile" ocf_precompile
fi
if [[ $SPDK_TEST_AUTOBUILD -eq 1 ]]; then
run_test "autobuild" autobuild_test_suite $1
elif [[ $SPDK_TEST_UNITTEST -eq 1 ]]; then
run_test "unittest_build" unittest_build
elif [[ $SPDK_TEST_SCANBUILD -eq 1 ]]; then
run_test "scanbuild_make" scanbuild_make
else
if [ "$SPDK_TEST_OCF" -eq 1 ]; then
run_test "autobuild_ocf_precompile" ocf_precompile
fi
# if we aren't testing the unittests, build with shared objects.
./configure $config_params --with-shared
run_test "make" $MAKE $MAKEFLAGS

View File

@ -11,6 +11,7 @@ fi
source "$1"
rootdir=$(readlink -f $(dirname $0))
testdir=$rootdir # to get the storage space for tests
source "$rootdir/test/common/autotest_common.sh"
function build_rpms() (
@ -20,7 +21,7 @@ function build_rpms() (
unset -v LD_LIBRARY_PATH
install_uninstall_rpms() {
rpms=("$HOME/rpmbuild/RPMS/x86_64/"spdk{,-devel,{,-dpdk}-libs}-$version-1.x86_64.rpm)
rpms=("$builddir/rpm/x86_64/"spdk{,-devel,{,-dpdk}-libs}-$version-1.x86_64.rpm)
sudo rpm -i "${rpms[@]}"
rpms=("${rpms[@]##*/}") rpms=("${rpms[@]%.rpm}")
@ -31,11 +32,12 @@ function build_rpms() (
}
build_rpm() {
MAKEFLAGS="$MAKEFLAGS" SPDK_VERSION="$version" DEPS=no "$rootdir/rpmbuild/rpm.sh" "$@"
BUILDDIR=$builddir MAKEFLAGS="$MAKEFLAGS" SPDK_VERSION="$version" DEPS=no "$rootdir/rpmbuild/rpm.sh" "$@"
install_uninstall_rpms
}
version="test_shared"
builddir=$SPDK_TEST_STORAGE/test-rpm
run_test "build_shared_rpm" build_rpm --with-shared
if [[ -n $SPDK_TEST_NATIVE_DPDK ]]; then

View File

@ -12,11 +12,14 @@ if [[ ! -f $conf ]]; then
echo "ERROR: $conf doesn't exist"
exit 1
fi
source "$conf"
echo "Test configuration:"
cat "$conf"
# Runs agent scripts
$rootdir/autobuild.sh "$conf"
sudo -E $rootdir/autotest.sh "$conf"
if ((SPDK_TEST_UNITTEST == 1 || SPDK_RUN_FUNCTIONAL_TEST == 1)); then
sudo -E $rootdir/autotest.sh "$conf"
fi
$rootdir/autopackage.sh "$conf"

View File

@ -35,11 +35,6 @@ if [ $(uname -s) = Linux ]; then
echo "|$rootdir/scripts/core-collector.sh %P %s %t $output_dir/coredumps" > /proc/sys/kernel/core_pattern
echo 2 > /proc/sys/kernel/core_pipe_limit
# Make sure that the hugepage state for our VM is fresh so we don't fail
# hugepage allocation. Allow time for this action to complete.
echo 1 > /proc/sys/vm/drop_caches
sleep 3
# make sure nbd (network block device) driver is loaded if it is available
# this ensures that when tests need to use nbd, it will be fully initialized
modprobe nbd || true
@ -50,7 +45,7 @@ if [ $(uname -s) = Linux ]; then
fi
fi
trap "process_core; autotest_cleanup; exit 1" SIGINT SIGTERM EXIT
trap "process_core || :; autotest_cleanup; exit 1" SIGINT SIGTERM EXIT
timing_enter autotest
@ -92,6 +87,17 @@ rm -f /var/tmp/spdk*.sock
# Load the kernel driver
./scripts/setup.sh reset
# Delete all leftover lvols and gpt partitions
# Matches both /dev/nvmeXnY on Linux and /dev/nvmeXnsY on BSD
# Filter out nvme with partitions - the "p*" suffix
for dev in $(ls /dev/nvme*n* | grep -v p || true); do
if ! block_in_use "$dev"; then
dd if=/dev/zero of="$dev" bs=1M count=1
fi
done
sync
if [ $(uname -s) = Linux ]; then
# OCSSD devices drivers don't support IO issues by kernel so
# detect OCSSD devices and block them (unbind from any driver).
@ -135,15 +141,6 @@ if [[ $(uname -s) == Linux ]]; then
nvme_namespace_revert
fi
# Delete all leftover lvols and gpt partitions
# Matches both /dev/nvmeXnY on Linux and /dev/nvmeXnsY on BSD
# Filter out nvme with partitions - the "p*" suffix
for dev in $(ls /dev/nvme*n* | grep -v p || true); do
dd if=/dev/zero of="$dev" bs=1M count=1
done
sync
timing_exit cleanup
# set up huge pages
@ -151,19 +148,6 @@ timing_enter afterboot
./scripts/setup.sh
timing_exit afterboot
if [[ $SPDK_TEST_CRYPTO -eq 1 || $SPDK_TEST_REDUCE -eq 1 ]]; then
# Make sure that memory is distributed across all NUMA nodes - by default, all goes to
# node0, but if QAT devices are attached to a different node, all of their VFs will end
# up under that node too and memory needs to be available there for the tests.
CLEAR_HUGE=yes HUGE_EVEN_ALLOC=yes ./scripts/setup.sh
./scripts/setup.sh status
if [[ $SPDK_TEST_USE_IGB_UIO -eq 1 ]]; then
./scripts/qat_setup.sh igb_uio
else
./scripts/qat_setup.sh
fi
fi
# Revert existing OPAL to factory settings that may have been left from earlier failed tests.
# This ensures we won't hit any unexpected failures due to NVMe SSDs being locked.
opal_revert_cleanup
@ -178,6 +162,13 @@ if [ $SPDK_TEST_UNITTEST -eq 1 ]; then
fi
if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
if [[ $SPDK_TEST_CRYPTO -eq 1 || $SPDK_TEST_REDUCE -eq 1 ]]; then
if [[ $SPDK_TEST_USE_IGB_UIO -eq 1 ]]; then
./scripts/qat_setup.sh igb_uio
else
./scripts/qat_setup.sh
fi
fi
timing_enter lib
run_test "rpc" test/rpc/rpc.sh
@ -187,6 +178,7 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
run_test "spdkcli_tcp" test/spdkcli/tcp.sh
run_test "dpdk_mem_utility" test/dpdk_memory_utility/test_dpdk_mem_info.sh
run_test "event" test/event/event.sh
run_test "thread" test/thread/thread.sh
run_test "accel_engine" test/accel_engine/accel_engine.sh
if [ $SPDK_TEST_BLOCKDEV -eq 1 ]; then
@ -194,7 +186,21 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
run_test "bdev_raid" test/bdev/bdev_raid.sh
run_test "bdevperf_config" test/bdev/bdevperf/test_config.sh
if [[ $(uname -s) == Linux ]]; then
run_test "spdk_dd" test/dd/dd.sh
run_test "reactor_set_interrupt" test/interrupt/reactor_set_interrupt.sh
run_test "reap_unregistered_poller" test/interrupt/reap_unregistered_poller.sh
fi
fi
if [[ $(uname -s) == Linux ]]; then
if [[ $SPDK_TEST_BLOCKDEV -eq 1 || $SPDK_TEST_URING -eq 1 ]]; then
# The crypto job also includes the SPDK_TEST_BLOCKDEV in its configuration hence the
# dd tests are executed there as well. However, these tests can take a significant
# amount of time to complete (up to 4min) on a physical system leading to a potential
# job timeout. Avoid that by skipping these tests - this should not affect the coverage
# since dd tests are still run as part of the vg jobs.
if [[ $SPDK_TEST_CRYPTO -eq 0 ]]; then
run_test "spdk_dd" test/dd/dd.sh
fi
fi
fi
@ -204,20 +210,31 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
if [ $SPDK_TEST_NVME -eq 1 ]; then
run_test "blockdev_nvme" test/bdev/blockdev.sh "nvme"
run_test "blockdev_nvme_gpt" test/bdev/blockdev.sh "gpt"
if [[ $(uname -s) == Linux ]]; then
run_test "blockdev_nvme_gpt" test/bdev/blockdev.sh "gpt"
fi
run_test "nvme" test/nvme/nvme.sh
if [[ $SPDK_TEST_NVME_PMR -eq 1 ]]; then
run_test "nvme_pmr" test/nvme/nvme_pmr.sh
fi
if [[ $SPDK_TEST_NVME_SCC -eq 1 ]]; then
run_test "nvme_scc" test/nvme/nvme_scc.sh
fi
if [[ $SPDK_TEST_NVME_BP -eq 1 ]]; then
run_test "nvme_bp" test/nvme/nvme_bp.sh
fi
if [[ $SPDK_TEST_NVME_CUSE -eq 1 ]]; then
run_test "nvme_cuse" test/nvme/cuse/nvme_cuse.sh
fi
if [[ $SPDK_TEST_NVME_CMB -eq 1 ]]; then
run_test "nvme_cmb" test/nvme/cmb/cmb.sh
fi
run_test "nvme_rpc" test/nvme/nvme_rpc.sh
# Only test hotplug without ASAN enabled. Since if it is
# enabled, it catches SEGV earlier than our handler which
# breaks the hotplug logic.
if [ $SPDK_RUN_ASAN -eq 0 ]; then
run_test "nvme_hotplug" test/nvme/hotplug.sh root
run_test "nvme_hotplug" test/nvme/hotplug.sh
fi
fi
@ -344,6 +361,8 @@ trap - SIGINT SIGTERM EXIT
# catch any stray core files
process_core
[[ -f "$output_dir/udev.log" ]] && rm -f "$output_dir/udev.log"
if hash lcov && ! [[ "$CC_TYPE" == *"clang"* ]]; then
# generate coverage data and combine with baseline
$LCOV -q -c -d $src -t "$(hostname)" -o $out/cov_test.info

View File

@ -1 +0,0 @@
# Placeholder

102
configure vendored
View File

@ -35,6 +35,7 @@ function usage() {
echo " --disable-tests Disable building of functional tests"
echo " --disable-unit-tests Disable building of unit tests"
echo " --disable-examples Disable building of examples"
echo " --disable-apps Disable building of apps"
echo ""
echo "Specifying Dependencies:"
echo "--with-DEPENDENCY[=path] Use the given dependency. Optionally, provide the"
@ -98,6 +99,8 @@ function usage() {
echo " No path required."
echo " wpdk Build using WPDK to provide support for Windows (experimental)."
echo " The argument must be a directory containing lib and include."
echo " usdt Build with userspace DTrace probes enabled."
echo " No path required."
echo ""
echo "Environment variables:"
echo ""
@ -163,7 +166,7 @@ fi
#check nasm only on x86
if [[ $arch == x86_64* ]]; then
ver=$(nasm -v 2> /dev/null | awk '{print $3}')
ver=$(nasm -v 2> /dev/null | awk '{print $3}' | awk -Fr '{print $1}')
if lt "$ver" 2.14; then
# ISA-L, compression & crypto require NASM version 2.14 or newer.
CONFIG[ISAL]=n
@ -263,6 +266,12 @@ for i in "$@"; do
--disable-examples)
CONFIG[EXAMPLES]=n
;;
--enable-apps)
CONFIG[APPS]=y
;;
--disable-apps)
CONFIG[APPS]=N
;;
--enable-werror)
CONFIG[WERROR]=y
;;
@ -275,6 +284,17 @@ for i in "$@"; do
--disable-cet)
CONFIG[CET]=n
;;
--with-dpdk)
if pkg-config --exists libdpdk; then
CONFIG[DPDK_LIB_DIR]=$(pkg-config --variable=libdir libdpdk)
CONFIG[DPDK_INC_DIR]=$(pkg-config --variable=includedir libdpdk)
CONFIG[DPDK_PKG_CONFIG]=y
CFLAGS="${CFLAGS:+$CFLAGS }$(pkg-config --cflags libdpdk)"
else
echo "libdpdk.pc not found, aborting"
exit 1
fi
;;
--with-dpdk=*)
check_dir "$i"
CONFIG[DPDK_DIR]=$(readlink -f ${i#*=})
@ -448,10 +468,17 @@ for i in "$@"; do
;;
--with-idxd)
CONFIG[IDXD]=y
CONFIG[IDXD_KERNEL]=n
;;
--without-idxd)
CONFIG[IDXD]=n
;;
--with-usdt)
CONFIG[USDT]=y
;;
--without-usdt)
CONFIG[USDT]=n
;;
--)
break
;;
@ -472,7 +499,7 @@ BUILD_CMD+=(-I/usr/local/include -L/usr/local/lib)
if [[ "${CONFIG[VFIO_USER]}" = "y" ]]; then
if ! hash cmake; then
if ! bash -c "command -v cmake3 cmake" > /dev/null; then
echo "ERROR: --with-vfio-user requires cmake"
echo "Please install then re-run this script"
exit 1
@ -502,6 +529,10 @@ if [[ "${CONFIG[IDXD]}" = "y" ]]; then
echo "ERROR: IDXD cannot be used due to CPU incompatiblity."
exit 1
fi
if [ -e /usr/include/accel-config/libaccel_config.h ]; then
CONFIG[IDXD_KERNEL]=y
fi
fi
# Detect architecture and force no ISA-L if non-x86 or non-aarch64 architecture
@ -520,7 +551,7 @@ fi
if [ -z "${CONFIG[ENV]}" ]; then
CONFIG[ENV]=$rootdir/lib/env_dpdk
echo "Using default SPDK env in ${CONFIG[ENV]}"
if [ -z "${CONFIG[DPDK_DIR]}" ]; then
if [[ -z "${CONFIG[DPDK_DIR]}" && "${CONFIG[DPDK_PKG_CONFIG]}" == n ]]; then
if [ ! -f "$rootdir"/dpdk/config/meson.build ]; then
echo "DPDK not found; please specify --with-dpdk=<path> or run:"
echo
@ -532,7 +563,7 @@ if [ -z "${CONFIG[ENV]}" ]; then
fi
fi
else
if [ -n "${CONFIG[DPDK_DIR]}" ]; then
if [[ -n "${CONFIG[DPDK_DIR]}" || "${CONFIG[DPDK_PKG_CONFIG]}" == y ]]; then
echo "--with-env and --with-dpdk are mutually exclusive."
exit 1
fi
@ -549,6 +580,14 @@ else
CONFIG[VIRTIO]="n"
fi
if [[ "${CONFIG[DPDK_PKG_CONFIG]}" == y ]]; then
if [[ "${CONFIG[SHARED]}" == n ]]; then
# dpdk-devel doesn't provide static libs
echo "Build against packaged DPDK requested, enabling shared libraries"
CONFIG[SHARED]=y
fi
fi
if [[ $sys_name == "Windows" ]]; then
if [ -z "${CONFIG[WPDK_DIR]}" ]; then
if [ ! -f "$rootdir"/wpdk/Makefile ]; then
@ -694,6 +733,43 @@ if [[ "${CONFIG[REDUCE]}" = "y" ]]; then
echo "Please install then re-run this script."
exit 1
fi
CONFIG[REDUCE_MLX5]="y"
# Check if libmlx5 exists to enable mlx5_pci compress PMD
if ! echo -e '#include <spdk/stdinc.h>\n' \
'#include <infiniband/mlx5dv.h>\n' \
'#include <infiniband/verbs.h>\n' \
'int main(void) { return 0; }\n' \
| "${BUILD_CMD[@]}" -lmlx5 -I${rootdir}/include -c - 2> /dev/null; then
echo "libmlx5 is not found, so disabling DPDK mlx5_pci compress PMD"
CONFIG[REDUCE_MLX5]="n"
fi
if [[ "${CONFIG[DPDK_PKG_CONFIG]}" = "y" ]]; then
# Check if librte_compress_mlx5 exists in DPDK package
if [ ! -f "${CONFIG[DPDK_LIB_DIR]}"/librte_compress_mlx5.so ]; then
echo "librte_compress_mlx5 is not found, so disabling DPDK mlx5_pci compress PMD"
CONFIG[REDUCE_MLX5]="n"
fi
else
# Check DPDK version to determine if mlx5_pci driver is supported
dpdk_ver=""
if [[ "${CONFIG[DPDK_DIR]}" == "$rootdir/dpdk/build" ]]; then
# DPDK_DIR points at our submodule so ./build may not exist yet. Use
# absolute path to lookup the version.
dpdk_ver=$(< "$rootdir/dpdk/VERSION")
elif [[ -f "${CONFIG[DPDK_DIR]}"/../VERSION ]]; then
dpdk_ver=$(< "${CONFIG[DPDK_DIR]}"/../VERSION)
else
echo "Cannot get DPDK version, so disabling DPDK mlx5_pci compress PMD"
CONFIG[REDUCE_MLX5]="n"
fi
# mlx5_pci is supported by DPDK >- 21.02.0
if [[ -n $dpdk_ver ]] && lt "$dpdk_ver" 21.02.0; then
echo "DPDK version ${dpdk_ver} doesn't support mlx5_pci compress PMD"
CONFIG[REDUCE_MLX5]="n"
fi
fi
fi
if [[ "${CONFIG[NVME_CUSE]}" = "y" ]]; then
@ -830,6 +906,20 @@ if [[ "${CONFIG[ISAL]}" = "y" ]]; then
cd $rootdir
fi
# For ARM Neoverse-N1 platform, debug build needs gcc version newer than 8.4
if [[ "${CONFIG[DEBUG]}" = "y" && $arch = aarch64* && "$CC_TYPE" = "gcc" ]]; then
GCC_VERSION=$($CC -dumpfullversion)
PART_NUM=$(grep -i -m 1 "CPU part" /proc/cpuinfo | awk '{print $4}')
if [[ "$(printf '%s\n' "8.4.0" "$GCC_VERSION" | sort -V | head -n1)" != "8.4.0" ]]; then
if [[ $PART_NUM = 0xd0c ]]; then
echo "WARNING: For ARM Neoverse-N1 platform, debug build needs GCC version newer than 8.4."
echo " Will work around this by using armv8.2-a+crypto as target architecture for now."
CONFIG[ARCH]=armv8.2-a+crypto
fi
fi
fi
# We are now ready to generate final configuration. But first do sanity
# check to see if all keys in CONFIG array have its reflection in CONFIG file.
if (($(grep -cE "^\s*CONFIG_[[:alnum:]_]+=" "$rootdir/CONFIG") != ${#CONFIG[@]})); then
@ -837,7 +927,7 @@ if (($(grep -cE "^\s*CONFIG_[[:alnum:]_]+=" "$rootdir/CONFIG") != ${#CONFIG[@]})
echo "BUG: Some configuration options are not present in CONFIG file. Please update this file."
echo "Missing options in CONFIG (+) file and in current config (-): "
diff -u --label "CONFIG file" --label "CONFIG[@]" \
<(sed -r -e '/^\s*$/d; /^\s*#.*/d; s/(CONFIG_[[:alnum:]_]+)=.*/\1/g' CONFIG | sort) \
<(sed -r -e '/^[[:space:]]*$/d; /^[[:space:]]*#.*/d; s/(CONFIG_[[:alnum:]_]+)=.*/\1/g' CONFIG | sort) \
<(printf "CONFIG_%s\n" "${!CONFIG[@]}" | sort)
exit 1
fi
@ -845,7 +935,7 @@ fi
echo -n "Creating mk/config.mk..."
cp -f $rootdir/CONFIG $rootdir/mk/config.mk
for key in "${!CONFIG[@]}"; do
sed -i.bak -r "s#^\s*CONFIG_${key}=.*#CONFIG_${key}\?=${CONFIG[$key]}#g" $rootdir/mk/config.mk
sed -i.bak -r "s#[[:space:]]*CONFIG_${key}=.*#CONFIG_${key}\?=${CONFIG[$key]}#g" $rootdir/mk/config.mk
done
# On FreeBSD sed -i 'SUFFIX' - SUFFIX is mandatory. So no way but to delete the backed file.
rm -f $rootdir/mk/config.mk.bak

View File

@ -1,4 +1,6 @@
# ABI and API Deprecation {#deprecation}
# Deprecation
## ABI and API Deprecation {#deprecation}
This document details the policy for maintaining stability of SPDK ABI and API.
@ -10,26 +12,9 @@ Each entry must describe what will be removed and can suggest the future use or
Specific future SPDK release for the removal must be provided.
ABI cannot be removed without providing deprecation notice for at least single SPDK release.
# Deprecation Notices {#deprecation-notices}
## Deprecation Notices {#deprecation-notices}
## net
### bdev
The net library is deprecated and will be removed in the 21.07 release.
## nvmf
The following APIs have been deprecated and will be removed in SPDK 21.07:
- `spdk_nvmf_poll_group_get_stat` (function in `nvmf.h`),
- `spdk_nvmf_transport_poll_group_get_stat` (function in `nvmf.h`),
- `spdk_nvmf_transport_poll_group_free_stat`(function in `nvmf.h`),
- `spdk_nvmf_rdma_device_stat` (struct in `nvmf.h`),
- `spdk_nvmf_transport_poll_group_stat` (struct in `nvmf.h`),
- `poll_group_get_stat` (transport op in `nvmf_transport.h`),
- `poll_group_free_stat` (transport op in `nvmf_transport.h`).
Please use `spdk_nvmf_poll_group_dump_stat` and `poll_group_dump_stat` instead.
## rpm
`pkg/spdk.spec` is considered to be deprecated and scheduled for removal in SPDK 21.07.
Please use `rpmbuild/spdk.spec` instead and see
[RPM documentation](https://spdk.io/doc/rpm.html) for more details.
Deprecated `spdk_bdev_module_finish_done()` API, which will be removed in SPDK 22.01.
Bdev modules should use `spdk_bdev_module_fini_done()` instead.

View File

@ -814,6 +814,7 @@ INPUT += \
concurrency.md \
containers.md \
../deprecation.md \
distributions.md \
event.md \
ftl.md \
gdb_macros.md \
@ -843,6 +844,7 @@ INPUT += \
spdk_top.md \
ssd_internals.md \
system_configuration.md \
usdt.md \
userspace.md \
vagrant.md \
vhost.md \

View File

@ -1,11 +1,9 @@
SPDK Documentation
==================
# SPDK Documentation
The current version of the SPDK documentation can be found online at
http://www.spdk.io/doc/
Building the Documentation
==========================
## Building the Documentation
To convert the documentation into HTML run `make` in the `doc`
directory. The output will be located in `doc/output/html`. Before

View File

@ -10,14 +10,17 @@ acceleration capabilities. ISA/L is used for optimized CRC32C calculation within
the software module.
The framework includes an API for getting the current capabilities of the
selected module. See [`spdk_accel_get_capabilities`](https://spdk.io/doc/accel__engine_8h.html) for more details. For the software module, all capabilities will be reported as supported. For the hardware modules, only functions accelerated by hardware will be reported however any function can still be called, it will just be backed by software if it is not reported as a supported capability.
selected module. See [`spdk_accel_get_capabilities`](https://spdk.io/doc/accel__engine_8h.html) for more details.
For the software module, all capabilities will be reported as supported. For the hardware modules, only functions
accelerated by hardware will be reported however any function can still be called, it will just be backed by
software if it is not reported as a supported capability.
# Acceleration Framework Functions {#accel_functions}
## Acceleration Framework Functions {#accel_functions}
Functions implemented via the framework can be found in the DoxyGen documentation of the
framework public header file here [accel_engine.h](https://spdk.io/doc/accel__engine_8h.html)
# Acceleration Framework Design Considerations {#accel_dc}
## Acceleration Framework Design Considerations {#accel_dc}
The general interface is defined by `/include/accel_engine.h` and implemented
in `/lib/accel`. These functions may be called by an SPDK application and in
@ -32,7 +35,7 @@ optimized implementation. For example, IOAT does not support the dualcast funct
in hardware but if the IOAT module has been initialized and the public dualcast API
is called, it will actually be done via software behind the scenes.
# Acceleration Low Level Libraries {#accel_libs}
## Acceleration Low Level Libraries {#accel_libs}
Low level libraries provide only the most basic functions that are specific to
the hardware. Low level libraries are located in the '/lib' directory with the
@ -46,9 +49,21 @@ functions exposed by the individual low level libraries. Thus, code written this
way needs to be certain that the underlying hardware exists everywhere that it runs.
The low level library for IOAT is located in `/lib/ioat`. The low level library
for DSA is in `/liv/idxd` (IDXD stands for Intel(R) Data Acceleration Driver).
for DSA is in `/lib/idxd` (IDXD stands for Intel(R) Data Acceleration Driver).
In `/lib/idxd` folder, SPDK supports to leverage both user space and kernel space driver
to drive DSA devices. And the following describes each usage scenerio:
# Acceleration Plug-In Modules {#accel_modules}
Leveraging user space idxd driver: The DSA devices are managed by the user space
driver in a dedicated SPDK process, then the device cannot be shared by another
process. The benefit of this usage is no kernel dependency.
Leveraging kernel space driver: The DSA devices are managed by kernel
space drivers. And the Work queues inside the DSA device can be shared among
different processes. Naturally, it can be used in cloud native scenerio. The drawback of
this usage is the kernel dependency, i.e., idxd driver must be supported and loaded
in the kernel.
## Acceleration Plug-In Modules {#accel_modules}
Plug-in modules depend on low level libraries to interact with the hardware and
add additional functionality such as queueing during busy conditions or flow
@ -57,14 +72,18 @@ the complete implementation of the acceleration component. A module must be
selected via startup RPC when the application is started. Otherwise, if no startup
RPC is provided, the framework is available and will use the software plug-in module.
## IOAT Module {#accel_ioat}
### IOAT Module {#accel_ioat}
To use the IOAT engine, use the RPC [`ioat_scan_accel_engine`](https://spdk.io/doc/jsonrpc.html) before starting the application.
## IDXD Module {#accel_idxd}
### IDXD Module {#accel_idxd}
To use the DSA engine, use the RPC [`idxd_scan_accel_engine`](https://spdk.io/doc/jsonrpc.html) with an optional parameter of `-c` and provide a configuration number of either 0 or 1. These pre-defined configurations determine how the DSA engine will be setup in terms
of work queues and engines. The DSA engine is very flexible allowing for various configurations of these elements to either account for different quality of service requirements or to isolate hardware paths where the back end media is of varying latency (i.e. persistent memory vs DRAM). The pre-defined configurations are as follows:
To use the DSA engine, use the RPC [`idxd_scan_accel_engine`](https://spdk.io/doc/jsonrpc.html). With an optional parameter
of `-c` and providing a configuration number of either 0 or 1, users can determine which pre-defined configuration can be used.
With an optional parameter of `-k` to use kernel or user space driver. These pre-defined configurations determine how the DSA engine
will be setup in terms of work queues and engines. The DSA engine is very flexible allowing for various configurations of
these elements to either account for different quality of service requirements or to isolate hardware paths where the back
end media is of varying latency (i.e. persistent memory vs DRAM). The pre-defined configurations are as follows:
0: A single work queue backed with four DSA engines. This is a generic configuration
that enables the hardware to best determine which engine to use as it pulls in new
@ -80,14 +99,50 @@ of service parameters on the work queues that are not currently utilized by
the module. Specialized use of DSA may require different configurations that
can be added to the module as needed.
## Software Module {#accel_sw}
When a new channel starts, a DSA device will be assigned to the channel. The accel
idxd module has been tuned for the most likely best performance case. The result
is that there is a limited number of channels that can be supported based on the
number of DSA devices in the system. Additionally, for best performance, the accel
idxd module will only use DSA devices on the same socket as the requesting
channel/thread. If an error occurs on initialization indicating that there are no
more DSA devices available either try fewer threads or, if on a 2 socket system,
try spreading threads across cores if possible.
### How to use kernel idxd driver (#accel_idxd_kernel)
There are several dependencies to leverage kernel idxd driver for driving DSA devices.
1 Linux kernel support: To leverage kernel space idxd driver, you need to have a Linux kernel with
`idxd` driver loaded with scalable mode. And currently SPDK uses the character device while `idxd` driver is
enabled in the kernel. So when booting the machine, we need to add additional configuration in
the grub, i.e, revise the kernel boot commandline `intel_iommu=on,sm_on` with VT-d turned on in BIOS.
2 User library dependency: Users need to install `idxd-config` library. For example, users can
download the library from [idxd-config repo](https://github.com/intel/idxd-config). After the
library is installed, users can use the `accel-config` command to configure the work queues(WQs)
of the idxd devices managed by the kernel with the following steps:
```bash
accel-config disable-wq dsa0/wq0.1
accel-config disable-device dsa0
accel-config config-wq --group-id=0 --mode=dedicated --wq-size=16 --type=user --name="MyApp1"
--priority=10 --block-on-fault=1 dsa0/wq0.1
accel-config config-engine dsa0/engine0.1 --group-id=0
accel-config enable-device dsa0
accel-config enable-wq dsa0/wq0.1
```
For more details on the usage of `idxd-config`, please refer to
[idxd-config usage](https://github.com/intel/idxd-config/tree/master/Documentation/accfg).
### Software Module {#accel_sw}
The software module is enabled by default. If no hardware engine is explicitly
enabled via startup RPC as discussed earlier, the software module will use ISA-L
if available for functions such as CRC32C. Otherwise, standard glibc calls are
used to back the framework API.
## Batching {#batching}
### Batching {#batching}
Batching is exposed by the acceleration framework and provides an interface to
batch sets of commands up and then submit them with a single command. The public

View File

@ -151,7 +151,7 @@ Whenever the `CPU mask` is mentioned it is a string in one of the following form
The following CPU masks are equal and correspond to CPUs 0, 1, 2, 8, 9, 10, 11 and 12:
~~~
~~~bash
0x1f07
0x1F07
1f07

View File

@ -1,10 +1,11 @@
# Block Device User Guide {#bdev}
# Target Audience {#bdev_ug_targetaudience}
## Target Audience {#bdev_ug_targetaudience}
This user guide is intended for software developers who have knowledge of block storage, storage drivers, issuing JSON-RPC commands and storage services such as RAID, compression, crypto, and others.
This user guide is intended for software developers who have knowledge of block storage, storage drivers, issuing JSON-RPC
commands and storage services such as RAID, compression, crypto, and others.
# Introduction {#bdev_ug_introduction}
## Introduction {#bdev_ug_introduction}
The SPDK block device layer, often simply called *bdev*, is a C library
intended to be equivalent to the operating system block storage layer that
@ -26,7 +27,7 @@ device underneath (please refer to @ref bdev_module for details). SPDK
provides also vbdev modules which creates block devices on existing bdev. For
example @ref bdev_ug_logical_volumes or @ref bdev_ug_gpt
# Prerequisites {#bdev_ug_prerequisites}
## Prerequisites {#bdev_ug_prerequisites}
This guide assumes that you can already build the standard SPDK distribution
on your platform. The block device layer is a C library with a single public
@ -39,14 +40,14 @@ directly from SPDK application by running `scripts/rpc.py rpc_get_methods`.
Detailed help for each command can be displayed by adding `-h` flag as a
command parameter.
# Configuring Block Device Modules {#bdev_ug_general_rpcs}
## Configuring Block Device Modules {#bdev_ug_general_rpcs}
Block devices can be configured using JSON RPCs. A complete list of available RPC commands
with detailed information can be found on the @ref jsonrpc_components_bdev page.
# Common Block Device Configuration Examples
## Common Block Device Configuration Examples
# Ceph RBD {#bdev_config_rbd}
## Ceph RBD {#bdev_config_rbd}
The SPDK RBD bdev driver provides SPDK block layer access to Ceph RADOS block
devices (RBD). Ceph RBD devices are accessed via librbd and librados libraries
@ -69,7 +70,7 @@ To resize a bdev use the bdev_rbd_resize command.
This command will resize the Rbd0 bdev to 4096 MiB.
# Compression Virtual Bdev Module {#bdev_config_compress}
## Compression Virtual Bdev Module {#bdev_config_compress}
The compression bdev module can be configured to provide compression/decompression
services for an underlying thinly provisioned logical volume. Although the underlying
@ -81,7 +82,12 @@ for detailed information.
The vbdev module relies on the DPDK CompressDev Framework to provide all compression
functionality. The framework provides support for many different software only
compression modules as well as hardware assisted support for Intel QAT. At this
time the vbdev module supports the DPDK drivers for ISAL and QAT.
time the vbdev module supports the DPDK drivers for ISAL, QAT and mlx5_pci.
mlx5_pci driver works with BlueField 2 SmartNIC and requires additional configuration of DPDK
environment to enable compression function. It can be done via SPDK event library by configuring
`env_context` member of `spdk_app_opts` structure or by passing corresponding CLI arguments in the
following form: `--allow=BDF,class=compress`, e.g. `--allow=0000:01:00.0,class=compress`.
Persistent memory is used to store metadata associated with the layout of the data on the
backing device. SPDK relies on [PMDK](http://pmem.io/pmdk/) to interface persistent memory so any hardware
@ -128,7 +134,7 @@ all volumes, if used it will return the name or an error that the device does no
`rpc.py bdev_compress_get_orphans --name COMP_Nvme0n1`
# Crypto Virtual Bdev Module {#bdev_config_crypto}
## Crypto Virtual Bdev Module {#bdev_config_crypto}
The crypto virtual bdev module can be configured to provide at rest data encryption
for any underlying bdev. The module relies on the DPDK CryptoDev Framework to provide
@ -165,7 +171,7 @@ To remove the vbdev use the bdev_crypto_delete command.
`rpc.py bdev_crypto_delete CryNvmeA`
# Delay Bdev Module {#bdev_config_delay}
## Delay Bdev Module {#bdev_config_delay}
The delay vbdev module is intended to apply a predetermined additional latency on top of a lower
level bdev. This enables the simulation of the latency characteristics of a device during the functional
@ -196,13 +202,13 @@ Example command:
`rpc.py bdev_delay_delete delay0`
# GPT (GUID Partition Table) {#bdev_config_gpt}
## GPT (GUID Partition Table) {#bdev_config_gpt}
The GPT virtual bdev driver is enabled by default and does not require any configuration.
It will automatically detect @ref bdev_ug_gpt on any attached bdev and will create
possibly multiple virtual bdevs.
## SPDK GPT partition table {#bdev_ug_gpt}
### SPDK GPT partition table {#bdev_ug_gpt}
The SPDK partition type GUID is `7c5222bd-8f5d-4087-9c00-bf9843c7b58c`. Existing SPDK bdevs
can be exposed as Linux block devices via NBD and then can be partitioned with
@ -228,9 +234,9 @@ Example command
`rpc.py nbd_stop_disk -n /dev/nbd0`
## Creating a GPT partition table using NBD {#bdev_ug_gpt_create_part}
### Creating a GPT partition table using NBD {#bdev_ug_gpt_create_part}
~~~
~~~bash
# Expose bdev Nvme0n1 as kernel block device /dev/nbd0 by JSON-RPC
rpc.py nbd_start_disk Nvme0n1 /dev/nbd0
@ -252,7 +258,7 @@ rpc.py nbd_stop_disk /dev/nbd0
# Nvme0n1p1 in SPDK applications.
~~~
# iSCSI bdev {#bdev_config_iscsi}
## iSCSI bdev {#bdev_config_iscsi}
The SPDK iSCSI bdev driver depends on libiscsi and hence is not enabled by default.
In order to use it, build SPDK with an extra `--with-iscsi-initiator` configure option.
@ -265,7 +271,7 @@ with `iqn.2016-06.io.spdk:init` as the reported initiator IQN.
The URL is in the following format:
`iscsi://[<username>[%<password>]@]<host>[:<port>]/<target-iqn>/<lun>`
# Linux AIO bdev {#bdev_config_aio}
## Linux AIO bdev {#bdev_config_aio}
The SPDK AIO bdev driver provides SPDK block layer access to Linux kernel block
devices or a file on a Linux filesystem via Linux AIO. Note that O_DIRECT is
@ -288,7 +294,7 @@ To delete an aio bdev use the bdev_aio_delete command.
`rpc.py bdev_aio_delete aio0`
# OCF Virtual bdev {#bdev_config_cas}
## OCF Virtual bdev {#bdev_config_cas}
OCF virtual bdev module is based on [Open CAS Framework](https://github.com/Open-CAS/ocf) - a
high performance block storage caching meta-library.
@ -315,7 +321,7 @@ During removal OCF-cache will be stopped and all cached data will be written to
Note that OCF has a per-device RAM requirement. More details can be found in the
[OCF documentation](https://open-cas.github.io/guide_system_requirements.html).
# Malloc bdev {#bdev_config_malloc}
## Malloc bdev {#bdev_config_malloc}
Malloc bdevs are ramdisks. Because of its nature they are volatile. They are created from hugepage memory given to SPDK
application.
@ -328,7 +334,7 @@ Example command for removing malloc bdev:
`rpc.py bdev_malloc_delete Malloc0`
# Null {#bdev_config_null}
## Null {#bdev_config_null}
The SPDK null bdev driver is a dummy block I/O target that discards all writes and returns undefined
data for reads. It is useful for benchmarking the rest of the bdev I/O stack with minimal block
@ -345,7 +351,7 @@ To delete a null bdev use the bdev_null_delete command.
`rpc.py bdev_null_delete Null0`
# NVMe bdev {#bdev_config_nvme}
## NVMe bdev {#bdev_config_nvme}
There are two ways to create block device based on NVMe device in SPDK. First
way is to connect local PCIe drive and second one is to connect NVMe-oF device.
@ -367,7 +373,7 @@ To remove an NVMe controller use the bdev_nvme_detach_controller command.
This command will remove NVMe bdev named Nvme0.
## NVMe bdev character device {#bdev_config_nvme_cuse}
### NVMe bdev character device {#bdev_config_nvme_cuse}
This feature is considered as experimental. You must configure with --with-nvme-cuse
option to enable this RPC.
@ -391,14 +397,14 @@ with command:
`rpc.py bdev_nvme_cuse_unregister -n Nvme0`
# Logical volumes {#bdev_ug_logical_volumes}
## Logical volumes {#bdev_ug_logical_volumes}
The Logical Volumes library is a flexible storage space management system. It allows
creating and managing virtual block devices with variable size on top of other bdevs.
The SPDK Logical Volume library is built on top of @ref blob. For detailed description
please refer to @ref lvol.
## Logical volume store {#bdev_ug_lvol_store}
### Logical volume store {#bdev_ug_lvol_store}
Before creating any logical volumes (lvols), an lvol store has to be created first on
selected block device. Lvol store is lvols vessel responsible for managing underlying
@ -437,7 +443,7 @@ Example commands
`rpc.py bdev_lvol_delete_lvstore -l lvs`
## Lvols {#bdev_ug_lvols}
### Lvols {#bdev_ug_lvols}
To create lvols on existing lvol store user should use `bdev_lvol_create` RPC command.
Each created lvol will be represented by new bdev.
@ -448,7 +454,7 @@ Example commands
`rpc.py bdev_lvol_create lvol2 25 -u 330a6ab2-f468-11e7-983e-001e67edf35d`
# Passthru {#bdev_config_passthru}
## Passthru {#bdev_config_passthru}
The SPDK Passthru virtual block device module serves as an example of how to write a
virtual block device module. It implements the required functionality of a vbdev module
@ -460,7 +466,7 @@ Example commands
`rpc.py bdev_passthru_delete pt`
# Pmem {#bdev_config_pmem}
## Pmem {#bdev_config_pmem}
The SPDK pmem bdev driver uses pmemblk pool as the target for block I/O operations. For
details on Pmem memory please refer to PMDK documentation on http://pmem.io website.
@ -486,7 +492,7 @@ Example command
`rpc.py bdev_pmem_delete_pool /path/to/pmem_pool`
To create bdev based on pmemblk pool file user should use `bdev_pmem_create ` RPC
To create bdev based on pmemblk pool file user should use `bdev_pmem_create` RPC
command.
Example command
@ -497,7 +503,7 @@ To remove a block device representation use the bdev_pmem_delete command.
`rpc.py bdev_pmem_delete pmem`
# RAID {#bdev_ug_raid}
## RAID {#bdev_ug_raid}
RAID virtual bdev module provides functionality to combine any SPDK bdevs into
one RAID bdev. Currently SPDK supports only RAID 0. RAID functionality does not
@ -517,7 +523,7 @@ Example commands
`rpc.py bdev_raid_delete Raid0`
# Split {#bdev_ug_split}
## Split {#bdev_ug_split}
The split block device module takes an underlying block device and splits it into
several smaller equal-sized virtual block devices. This serves as an example to create
@ -539,7 +545,7 @@ To remove the split bdevs, use the `bdev_split_delete` command with th
`rpc.py bdev_split_delete bdev_b0`
# Uring {#bdev_ug_uring}
## Uring {#bdev_ug_uring}
The uring bdev module issues I/O to kernel block devices using the io_uring Linux kernel API. This module requires liburing.
For more information on io_uring refer to kernel [IO_uring] (https://kernel.dk/io_uring.pdf)
@ -556,7 +562,7 @@ To remove a uring bdev use the `bdev_uring_delete` RPC.
`rpc.py bdev_uring_delete bdev_u0`
# Virtio Block {#bdev_config_virtio_blk}
## Virtio Block {#bdev_config_virtio_blk}
The Virtio-Block driver allows creating SPDK bdevs from Virtio-Block devices.
@ -577,7 +583,7 @@ Virtio-Block devices can be removed with the following command
`rpc.py bdev_virtio_detach_controller VirtioBlk0`
# Virtio SCSI {#bdev_config_virtio_scsi}
## Virtio SCSI {#bdev_config_virtio_scsi}
The Virtio-SCSI driver allows creating SPDK block devices from Virtio-SCSI LUNs.

View File

@ -73,6 +73,7 @@ length | 100% of bdev size | End I/O at `offset`+`length` on the bdev
rw | | Type of I/O pattern
Available rw types:
- read
- randread
- write

View File

@ -1,6 +1,6 @@
# Blobstore Programmer's Guide {#blob}
# In this document {#blob_pg_toc}
## In this document {#blob_pg_toc}
* @ref blob_pg_audience
* @ref blob_pg_intro
@ -295,19 +295,23 @@ contribute to the Blobstore effort itself.
The Blobstore owns the entire storage device. The device is divided into clusters starting from the beginning, such
that cluster 0 begins at the first logical block.
LBA 0 LBA N
+-----------+-----------+-----+-----------+
| Cluster 0 | Cluster 1 | ... | Cluster N |
+-----------+-----------+-----+-----------+
```text
LBA 0 LBA N
+-----------+-----------+-----+-----------+
| Cluster 0 | Cluster 1 | ... | Cluster N |
+-----------+-----------+-----+-----------+
```
Cluster 0 is special and has the following format, where page 0 is the first page of the cluster:
+--------+-------------------+
| Page 0 | Page 1 ... Page N |
+--------+-------------------+
| Super | Metadata Region |
| Block | |
+--------+-------------------+
```text
+--------+-------------------+
| Page 0 | Page 1 ... Page N |
+--------+-------------------+
| Super | Metadata Region |
| Block | |
+--------+-------------------+
```
The super block is a single page located at the beginning of the partition. It contains basic information about
the Blobstore. The metadata region is the remainder of cluster 0 and may extend to additional clusters. Refer

View File

@ -1,8 +1,8 @@
# BlobFS (Blobstore Filesystem) {#blobfs}
# BlobFS Getting Started Guide {#blobfs_getting_started}
## BlobFS Getting Started Guide {#blobfs_getting_started}
# RocksDB Integration {#blobfs_rocksdb}
## RocksDB Integration {#blobfs_rocksdb}
Clone and build the SPDK repository as per https://github.com/spdk/spdk
@ -68,7 +68,7 @@ At this point, RocksDB is ready for testing with SPDK. Three `db_bench` paramet
SPDK has a set of scripts which will run `db_bench` against a variety of workloads and capture performance and profiling
data. The primary script is `test/blobfs/rocksdb/rocksdb.sh`.
# FUSE
## FUSE
BlobFS provides a FUSE plug-in to mount an SPDK BlobFS as a kernel filesystem for inspection or debug purposes.
The FUSE plug-in requires fuse3 and will be built automatically when fuse3 is detected on the system.
@ -79,7 +79,7 @@ test/blobfs/fuse/fuse /usr/local/etc/spdk/rocksdb.json Nvme0n1 /mnt/fuse
Note that the FUSE plug-in has some limitations - see the list below.
# Limitations
## Limitations
* BlobFS has primarily been tested with RocksDB so far, so any use cases different from how RocksDB uses a filesystem
may run into issues. BlobFS will be tested in a broader range of use cases after this initial release.

View File

@ -4,3 +4,4 @@ Section describing tools used by CI to verify integrity of the submitted
patches ([status](https://ci.spdk.io)).
- @subpage shfmt
- @subpage distributions

View File

@ -88,7 +88,7 @@ In these examples, the value "X" will represent the special value (2^64-1) descr
### Initial Creation
```
```text
+--------------------+
Backing Device | |
+--------------------+
@ -123,7 +123,7 @@ In these examples, the value "X" will represent the special value (2^64-1) descr
store the 16KB of data.
* Write the chunk map index to entry 2 in the logical map.
```
```text
+--------------------+
Backing Device |01 |
+--------------------+
@ -157,7 +157,7 @@ In these examples, the value "X" will represent the special value (2^64-1) descr
* Write (2, X, X, X) to the chunk map.
* Write the chunk map index to entry 0 in the logical map.
```
```text
+--------------------+
Backing Device |012 |
+--------------------+
@ -205,7 +205,7 @@ In these examples, the value "X" will represent the special value (2^64-1) descr
* Free chunk map 1 back to the free chunk map list.
* Free backing IO unit 2 back to the free backing IO unit list.
```
```text
+--------------------+
Backing Device |01 34 |
+--------------------+

View File

@ -1,6 +1,6 @@
# Message Passing and Concurrency {#concurrency}
# Theory
## Theory
One of the primary aims of SPDK is to scale linearly with the addition of
hardware. This can mean many things in practice. For instance, moving from one
@ -56,7 +56,7 @@ data isn't mutated very often, but is read very frequently, and is often
employed in the I/O path. This of course trades memory size for computational
efficiency, so it is used in only the most critical code paths.
# Message Passing Infrastructure
## Message Passing Infrastructure
SPDK provides several layers of message passing infrastructure. The most
fundamental libraries in SPDK, for instance, don't do any message passing on
@ -110,7 +110,7 @@ repeatedly call `spdk_thread_poll()` on each `spdk_thread()` that exists. This
makes SPDK very portable to a wide variety of asynchronous, event-based
frameworks such as [Seastar](https://www.seastar.io) or [libuv](https://libuv.org/).
# The event Framework
## The event Framework
The SPDK project didn't want to officially pick an asynchronous, event-based
framework for all of the example applications it shipped with, in the interest
@ -122,7 +122,7 @@ signal handlers to cleanly shutdown, and basic command line option parsing.
Only established applications should consider directly integrating the lower
level libraries.
# Limitations of the C Language
## Limitations of the C Language
Message passing is efficient, but it results in asynchronous code.
Unfortunately, asynchronous code is a challenge in C. It's often implemented by
@ -140,6 +140,7 @@ function `foo` performs some asynchronous operation and when that completes
function `bar` is called, then function `bar` performs some operation that
calls function `baz` on completion, a good way to write it is as such:
```c
void baz(void *ctx) {
...
}
@ -151,6 +152,7 @@ calls function `baz` on completion, a good way to write it is as such:
void foo(void *ctx) {
async_op(bar, ctx);
}
```
Don't split these functions up - keep them as a nice unit that can be read from bottom to top.
@ -162,6 +164,7 @@ them in C we can still write them out by hand. As an example, here's a
callback chain that performs `foo` 5 times and then calls `bar` - effectively
an asynchronous for loop.
```c
enum states {
FOO_START = 0,
FOO_END,
@ -244,6 +247,7 @@ an asynchronous for loop.
run_state_machine(sm);
}
```
This is complex, of course, but the `run_state_machine` function can be read
from top to bottom to get a clear overview of what's happening in the code

View File

@ -4,12 +4,12 @@ This is a living document as there are many ways to use containers with
SPDK. As new usages are identified and tested, they will be documented
here.
# In this document {#containers_toc}
## In this document {#containers_toc}
* @ref kata_containers_with_spdk_vhost
* @ref spdk_in_docker
# Using SPDK vhost target to provide volume service to Kata Containers and Docker {#kata_containers_with_spdk_vhost}
## Using SPDK vhost target to provide volume service to Kata Containers and Docker {#kata_containers_with_spdk_vhost}
[Kata Containers](https://katacontainers.io) can build a secure container
runtime with lightweight virtual machines that feel and perform like
@ -23,7 +23,7 @@ In addition, a container manager like Docker, can be configured easily to launch
a Kata container with an SPDK vhost-user block device. For operating details, visit
Kata containers use-case [Setup to run SPDK vhost-user devices with Kata Containers and Docker](https://github.com/kata-containers/documentation/blob/master/use-cases/using-SPDK-vhostuser-and-kata.md#host-setup-for-vhost-user-devices)
# Containerizing an SPDK Application for Docker {#spdk_in_docker}
## Containerizing an SPDK Application for Docker {#spdk_in_docker}
There are no SPDK specific changes needed to run an SPDK based application in
a docker container, however this quick start guide should help you as you
@ -78,7 +78,8 @@ Your output should look something like this:
~~~{.sh}
$ sudo docker run --privileged -v //dev//hugepages://dev//hugepages hello:1.0
Starting SPDK v20.01-pre git sha1 80da95481 // DPDK 19.11.0 initialization...
[ DPDK EAL parameters: hello_world -c 0x1 --log-level=lib.eal:6 --log-level=lib.cryptodev:5 --log-level=user1:6 --iova-mode=pa --base-virtaddr=0x200000000000 --match-allocations --file-prefix=spdk0 --proc-type=auto ]
[ DPDK EAL parameters: hello_world -c 0x1 --log-level=lib.eal:6 --log-level=lib.cryptodev:5 --log-level=user1:6 --iova-mode=pa
--base-virtaddr=0x200000000000 --match-allocations --file-prefix=spdk0 --proc-type=auto ]
EAL: No available hugepages reported in hugepages-1048576kB
Initializing NVMe Controllers
Attaching to 0000:06:00.0

64
doc/distributions.md Normal file
View File

@ -0,0 +1,64 @@
# distributions {#distributions}
## In this document {#distros_toc}
* @ref distros_overview
* @ref linux_list
* @ref freebsd_list
## Overview {#distros_overview}
CI pool uses different flavors of `Linux` and `FreeBSD` distributions which are
used as a base for all the tests run against submitted patches. Below is the
listing which covers all currently supported versions and the related CI
jobs (see [status](https://ci.spdk.io) as a reference).
## Linux distributions {#linux_list}
* Fedora: Trying to follow new release as per the release cycle whenever
possible. Currently at `Fedora33`.
```list
- autobuild-vg-autotest
- clang-vg-autotest
- iscsi*-vg-autotest
- nvme-vg-autotest
- nvmf*-vg-autotest
- scanbuild-vg-autotest
- unittest-vg-autotest
- vhost-initiator-vg-autotest
```
Jobs listed below are run on bare-metal systems where version of
Fedora may vary. In the future these will be aligned with the
`vg` jobs.
```list
- BlobFS-autotest
- crypto-autotest
- nvme-phy-autotest
- nvmf*-phy-autotest
- vhost-autotest
```
* Ubuntu: Last two LTS releases. Currently `20.04` and `18.04`.
```list
- ubuntu18-vg-autotest
- ubuntu20-vg-autotest
```
* CentOS: Maintained releases. Currently `7.9` and `8.2`.
```list
- centos7-vg-autotest
- centos8-vg-autotest
```
## FreeBSD distributions {#freebsd_list}
* FreeBSD: Production release. Currently `12.2`.
```list
- freebsd-vg-autotest
```

View File

@ -14,7 +14,7 @@ concurrency.
The event framework public interface is defined in event.h.
# Event Framework Design Considerations {#event_design}
## Event Framework Design Considerations {#event_design}
Simple server applications can be written in a single-threaded fashion. This
allows for straightforward code that can maintain state without any locking or
@ -27,9 +27,9 @@ synchronization. Unfortunately, in many real-world cases, the connections are
not entirely independent and cross-thread shared state is necessary. SPDK
provides an event framework to help solve this problem.
# SPDK Event Framework Components {#event_components}
## SPDK Event Framework Components {#event_components}
## Events {#event_component_events}
### Events {#event_component_events}
To accomplish cross-thread communication while minimizing synchronization
overhead, the framework provides message passing in the form of events. The
@ -45,7 +45,7 @@ asynchronous operations to achieve concurrency. Asynchronous I/O may be issued
with a non-blocking function call, and completion is typically signaled using
a callback function.
## Reactors {#event_component_reactors}
### Reactors {#event_component_reactors}
Each reactor has a lock-free queue for incoming events to that core, and
threads from any core may insert events into the queue of any other core. The
@ -54,7 +54,7 @@ in first-in, first-out order as they are received. Event functions should
never block and should preferably execute very quickly, since they are called
directly from the event loop on the destination core.
## Pollers {#event_component_pollers}
### Pollers {#event_component_pollers}
The framework also defines another type of function called a poller. Pollers
may be registered with the spdk_poller_register() function. Pollers, like
@ -66,10 +66,18 @@ intended to poll hardware as a replacement for interrupts. Normally, pollers
are executed on every iteration of the main event loop. Pollers may also be
scheduled to execute periodically on a timer if low latency is not required.
## Application Framework {#event_component_app}
### Application Framework {#event_component_app}
The framework itself is bundled into a higher level abstraction called an "app". Once
spdk_app_start() is called, it will block the current thread until the application
terminates by calling spdk_app_stop() or an error condition occurs during the
initialization code within spdk_app_start(), itself, before invoking the caller's
supplied function.
### Custom shutdown callback {#event_component_shutdown}
When creating SPDK based application user may add custom shutdown callback which
will be called before the application framework starts the shutdown process.
To do that set shutdown_cb function callback in spdk_app_opts structure passed
to spdk_app_start(). Custom shutdown callback should call spdk_app_stop() before
returning to continue application shutdown process.

View File

@ -5,11 +5,11 @@ implementing bdev_zone interface.
It handles the logical to physical address mapping, responds to the asynchronous
media management events, and manages the defragmentation process.
# Terminology {#ftl_terminology}
## Terminology {#ftl_terminology}
## Logical to physical address map
### Logical to physical address map
* Shorthand: L2P
- Shorthand: L2P
Contains the mapping of the logical addresses (LBA) to their on-disk physical location. The LBAs
are contiguous and in range from 0 to the number of surfaced blocks (the number of spare blocks
@ -17,7 +17,7 @@ are calculated during device formation and are subtracted from the available add
spare blocks account for zones going offline throughout the lifespan of the device as well as
provide necessary buffer for data [defragmentation](#ftl_reloc).
## Band {#ftl_band}
### Band {#ftl_band}
A band describes a collection of zones, each belonging to a different parallel unit. All writes to
a band follow the same pattern - a batch of logical blocks is written to one zone, another batch
@ -27,6 +27,7 @@ well as their validity, as some of the data will be invalidated by subsequent wr
logical address. The L2P mapping can be restored from the SSD by reading this information in order
from the oldest band to the youngest.
```text
+--------------+ +--------------+ +--------------+
band 1 | zone 1 +--------+ zone 1 +---- --- --- --- --- ---+ zone 1 |
+--------------+ +--------------+ +--------------+
@ -42,20 +43,23 @@ from the oldest band to the youngest.
+--------------+ +--------------+ +--------------+
parallel unit 1 pu 2 pu n
```
The address map and valid map are, along with a several other things (e.g. UUID of the device it's
part of, number of surfaced LBAs, band's sequence number, etc.), parts of the band's metadata. The
metadata is split in two parts:
```text
head metadata band's data tail metadata
+-------------------+-------------------------------+------------------------+
|zone 1 |...|zone n |...|...|zone 1 |...| | ... |zone m-1 |zone m|
|block 1| |block 1| | |block x| | | |block y |block y|
+-------------------+-------------+-----------------+------------------------+
```
* the head part, containing information already known when opening the band (device's UUID, band's
sequence number, etc.), located at the beginning blocks of the band,
* the tail part, containing the address map and the valid map, located at the end of the band.
- the head part, containing information already known when opening the band (device's UUID, band's
sequence number, etc.), located at the beginning blocks of the band,
- the tail part, containing the address map and the valid map, located at the end of the band.
Bands are written sequentially (in a way that was described earlier). Before a band can be written
to, all of its zones need to be erased. During that time, the band is considered to be in a `PREP`
@ -64,15 +68,16 @@ is being written. Then the band moves to the `OPEN` state and actual user data c
band. Once the whole available space is filled, tail metadata is written and the band transitions to
`CLOSING` state. When that finishes the band becomes `CLOSED`.
## Ring write buffer {#ftl_rwb}
### Ring write buffer {#ftl_rwb}
* Shorthand: RWB
- Shorthand: RWB
Because the smallest write size the SSD may support can be a multiple of block size, in order to
support writes to a single block, the data needs to be buffered. The write buffer is the solution to
this problem. It consists of a number of pre-allocated buffers called batches, each of size allowing
for a single transfer to the SSD. A single batch is divided into block-sized buffer entries.
```text
write buffer
+-----------------------------------+
|batch 1 |
@ -89,6 +94,7 @@ for a single transfer to the SSD. A single batch is divided into block-sized buf
| |entry 1|entry 2| |entry n| |
| +-----------------------------+ |
+-----------------------------------+
```
When a write is scheduled, it needs to acquire an entry for each of its blocks and copy the data
onto this buffer. Once all blocks are copied, the write can be signalled as completed to the user.
@ -97,9 +103,9 @@ After that operation is completed the whole batch can be freed. For the whole ti
the `rwb`, the L2P points at the buffer entry instead of a location on the SSD. This allows for
servicing read requests from the buffer.
## Defragmentation and relocation {#ftl_reloc}
### Defragmentation and relocation {#ftl_reloc}
* Shorthand: defrag, reloc
- Shorthand: defrag, reloc
Since a write to the same LBA invalidates its previous physical location, some of the blocks on a
band might contain old data that basically wastes space. As there is no way to overwrite an already
@ -108,12 +114,14 @@ situation in which all of the bands contain some valid data and no band can be e
can be executed anymore. Therefore a mechanism is needed to move valid data and invalidate whole
bands, so that they can be reused.
```text
band band
+-----------------------------------+ +-----------------------------------+
| ** * * *** * *** * * | | |
|** * * * * * * *| +----> | |
|* *** * * * | | |
+-----------------------------------+ +-----------------------------------+
```
Valid blocks are marked with an asterisk '\*'.
@ -133,78 +141,22 @@ index of its zones (3) (how many times the band was written to). The lower the r
higher its age (2) and the lower its write count (3), the higher the chance the band will be chosen
for defrag.
# Usage {#ftl_usage}
## Usage {#ftl_usage}
## Prerequisites {#ftl_prereq}
### Prerequisites {#ftl_prereq}
In order to use the FTL module, a device capable of zoned interface is required e.g. `zone_block`
bdev or OCSSD `nvme` bdev.
## FTL bdev creation {#ftl_create}
### FTL bdev creation {#ftl_create}
Similar to other bdevs, the FTL bdevs can be created either based on JSON config files or via RPC.
Both interfaces require the same arguments which are described by the `--help` option of the
`bdev_ftl_create` RPC call, which are:
- bdev's name
- base bdev's name (base bdev must implement bdev_zone API)
- UUID of the FTL device (if the FTL is to be restored from the SSD)
## FTL usage with OCSSD nvme bdev {#ftl_ocssd}
This option requires an Open Channel SSD, which can be emulated using QEMU.
The QEMU with the patches providing Open Channel support can be found on the SPDK's QEMU fork
on [spdk-3.0.0](https://github.com/spdk/qemu/tree/spdk-3.0.0) branch.
## Configuring QEMU {#ftl_qemu_config}
To emulate an Open Channel device, QEMU expects parameters describing the characteristics and
geometry of the SSD:
- `serial` - serial number,
- `lver` - version of the OCSSD standard (0 - disabled, 1 - "1.2", 2 - "2.0"), libftl only supports
2.0,
- `lba_index` - default LBA format. Possible values can be found in the table below (libftl only supports lba_index >= 3):
- `lnum_ch` - number of groups,
- `lnum_lun` - number of parallel units
- `lnum_pln` - number of planes (logical blocks from all planes constitute a chunk)
- `lpgs_per_blk` - number of pages (smallest programmable unit) per chunk
- `lsecs_per_pg` - number of sectors in a page
- `lblks_per_pln` - number of chunks in a parallel unit
- `laer_thread_sleep` - timeout in ms between asynchronous events requesting the host to relocate
the data based on media feedback
- `lmetadata` - metadata file
|lba_index| data| metadata|
|---------|-----|---------|
| 0 | 512B| 0B |
| 1 | 512B| 8B |
| 2 | 512B| 16B |
| 3 |4096B| 0B |
| 4 |4096B| 64B |
| 5 |4096B| 128B |
| 6 |4096B| 16B |
For more detailed description of the available options, consult the `hw/block/nvme.c` file in
the QEMU repository.
Example:
```
$ /path/to/qemu [OTHER PARAMETERS] -drive format=raw,file=/path/to/data/file,if=none,id=myocssd0
-device nvme,drive=myocssd0,serial=deadbeef,lver=2,lba_index=3,lnum_ch=1,lnum_lun=8,lnum_pln=4,
lpgs_per_blk=1536,lsecs_per_pg=4,lblks_per_pln=512,lmetadata=/path/to/md/file
```
In the above example, a device is created with 1 channel, 8 parallel units, 512 chunks per parallel
unit, 24576 (`lnum_pln` * `lpgs_per_blk` * `lsecs_per_pg`) logical blocks in each chunk with logical
block being 4096B. Therefore the data file needs to be at least 384G (8 * 512 * 24576 * 4096B) of
size and can be created with the following command:
```
fallocate -l 384G /path/to/data/file
```
- bdev's name
- base bdev's name (base bdev must implement bdev_zone API)
- UUID of the FTL device (if the FTL is to be restored from the SSD)
## Configuring SPDK {#ftl_spdk_config}
@ -212,7 +164,7 @@ To verify that the drive is emulated correctly, one can check the output of the
(assuming that `scripts/setup.sh` was called before and the driver has been changed for that
device):
```
```bash
$ build/examples/identify
=====================================================
NVMe Controller at 0000:00:0a.0 [1d1d:1f1f]
@ -226,40 +178,6 @@ Model Number: QEMU NVMe Ctrl
... other info ...
Namespace OCSSD Geometry
=======================
OC version: maj:2 min:0
... other info ...
Groups (channels): 1
PUs (LUNs) per group: 8
Chunks per LUN: 512
Logical blks per chunk: 24576
... other info ...
```
In order to create FTL on top Open Channel SSD, the following steps are required:
1) Attach OCSSD NVMe controller
2) Create OCSSD bdev on the controller attached in step 1 (user could specify parallel unit range
and create multiple OCSSD bdevs on single OCSSD NVMe controller)
3) Create FTL bdev on top of bdev created in step 2
Example:
```
$ scripts/rpc.py bdev_nvme_attach_controller -b nvme0 -a 00:0a.0 -t pcie
$ scripts/rpc.py bdev_ocssd_create -c nvme0 -b nvme0n1
nvme0n1
$ scripts/rpc.py bdev_ftl_create -b ftl0 -d nvme0n1
{
"name": "ftl0",
"uuid": "3b469565-1fa5-4bfb-8341-747ec9fca9b9"
}
```
## FTL usage with zone block bdev {#ftl_zone_block}

View File

@ -1,6 +1,6 @@
# GDB Macros User Guide {#gdb_macros}
# Introduction
## Introduction
When debugging an spdk application using gdb we may need to view data structures
in lists, e.g. information about bdevs or threads.
@ -125,7 +125,7 @@ nqn "nqn.2016-06.io.spdk.umgmt:cnode1", '\000' <repeats 191 times>
ID 1
~~~
# Loading The gdb Macros
## Loading The gdb Macros
Copy the gdb macros to the host where you are about to debug.
It is best to copy the file either to somewhere within the PYTHONPATH, or to add
@ -146,7 +146,7 @@ the PYTHONPATH, so I had to manually add the directory to the path.
(gdb) spdk_load_macros
~~~
# Using the gdb Data Directory
## Using the gdb Data Directory
On most systems, the data directory is /usr/share/gdb. The python script should
be copied into the python/gdb/function (or python/gdb/command) directory under
@ -155,7 +155,7 @@ the data directory, e.g. /usr/share/gdb/python/gdb/function.
If the python script is in there, then the only thing you need to do when
starting gdb is type "spdk_load_macros".
# Using .gdbinit To Load The Macros
## Using .gdbinit To Load The Macros
.gdbinit can also be used in order to run automatically run the manual steps
above prior to starting gdb.
@ -168,7 +168,7 @@ source /opt/km/install/tools/gdb_macros/gdb_macros.py
When starting gdb you still have to call spdk_load_macros.
# Why Do We Need to Explicitly Call spdk_load_macros
## Why Do We Need to Explicitly Call spdk_load_macros
The reason is that the macros need to use globals provided by spdk in order to
iterate the spdk lists and build iterable representations of the list objects.
@ -196,7 +196,7 @@ Error occurred in Python command: No symbol table is loaded. Use the "file"
command.
~~~
# Macros available
## Macros available
- spdk_load_macros: load the macros (use --reload in order to reload them)
- spdk_print_bdevs: information about bdevs
@ -205,7 +205,7 @@ command.
- spdk_print_nvmf_subsystems: information about nvmf subsystems
- spdk_print_threads: information about threads
# Adding New Macros
## Adding New Macros
The list iteration macros are usually built from 3 layers:

View File

@ -1,6 +1,6 @@
# Getting Started {#getting_started}
# Getting the Source Code {#getting_started_source}
## Getting the Source Code {#getting_started_source}
~~~{.sh}
git clone https://github.com/spdk/spdk
@ -8,7 +8,7 @@ cd spdk
git submodule update --init
~~~
# Installing Prerequisites {#getting_started_prerequisites}
## Installing Prerequisites {#getting_started_prerequisites}
The `scripts/pkgdep.sh` script will automatically install the bare minimum
dependencies required to build SPDK.
@ -24,7 +24,7 @@ Option --all will install all dependencies needed by SPDK features.
sudo scripts/pkgdep.sh --all
~~~
# Building {#getting_started_building}
## Building {#getting_started_building}
Linux:
@ -57,7 +57,7 @@ can enable it by doing the following:
make
~~~
# Running the Unit Tests {#getting_started_unittests}
## Running the Unit Tests {#getting_started_unittests}
It's always a good idea to confirm your build worked by running the
unit tests.
@ -70,7 +70,7 @@ You will see several error messages when running the unit tests, but they are
part of the test suite. The final message at the end of the script indicates
success or failure.
# Running the Example Applications {#getting_started_examples}
## Running the Example Applications {#getting_started_examples}
Before running an SPDK application, some hugepages must be allocated and
any NVMe and I/OAT devices must be unbound from the native kernel drivers.

View File

@ -1,10 +1,10 @@
# IDXD Driver {#idxd}
# Public Interface {#idxd_interface}
## Public Interface {#idxd_interface}
- spdk/idxd.h
# Key Functions {#idxd_key_functions}
## Key Functions {#idxd_key_functions}
Function | Description
--------------------------------------- | -----------
@ -19,7 +19,7 @@ spdk_idxd_submit_crc32c() | @copybrief spdk_idxd_submit_crc32c()
spdk_idxd_submit_dualcast | @copybrief spdk_idxd_submit_dualcast()
spdk_idxd_submit_fill() | @copybrief spdk_idxd_submit_fill()
# Pre-defined configurations {#idxd_configs}
## Pre-defined configurations {#idxd_configs}
The RPC `idxd_scan_accel_engine` is used to both enable IDXD and set it's
configuration to one of two pre-defined configs:

View File

@ -1,41 +1,41 @@
# Storage Performance Development Kit {#mainpage}
# Introduction
## Introduction
@copydoc intro
# Concepts
## Concepts
@copydoc concepts
# User Guides
## User Guides
@copydoc user_guides
# Programmer Guides
## Programmer Guides
@copydoc prog_guides
# General Information
## General Information
@copydoc general
# Miscellaneous
## Miscellaneous
@copydoc misc
# Driver Modules
## Driver Modules
@copydoc driver_modules
# Tools
## Tools
@copydoc tools
# CI Tools
## CI Tools
@copydoc ci_tools
# Performance Reports
## Performance Reports
@copydoc performance_reports

View File

@ -1,10 +1,10 @@
# I/OAT Driver {#ioat}
# Public Interface {#ioat_interface}
## Public Interface {#ioat_interface}
- spdk/ioat.h
# Key Functions {#ioat_key_functions}
## Key Functions {#ioat_key_functions}
Function | Description
--------------------------------------- | -----------

View File

@ -1,6 +1,6 @@
# iSCSI Target {#iscsi}
# iSCSI Target Getting Started Guide {#iscsi_getting_started}
## iSCSI Target Getting Started Guide {#iscsi_getting_started}
The Storage Performance Development Kit iSCSI target application is named `iscsi_tgt`.
This following section describes how to run iscsi from your cloned package.
@ -32,7 +32,7 @@ To ensure the SPDK iSCSI target has the best performance, place the NICs and the
same NUMA node and configure the target to run on CPU cores associated with that node. The following
command line option is used to configure the SPDK iSCSI target:
~~~
~~~bash
-m 0xF000000
~~~
@ -45,35 +45,35 @@ The iSCSI target is configured via JSON-RPC calls. See @ref jsonrpc for details.
### Portal groups
- iscsi_create_portal_group -- Add a portal group.
- iscsi_delete_portal_group -- Delete an existing portal group.
- iscsi_target_node_add_pg_ig_maps -- Add initiator group to portal group mappings to an existing iSCSI target node.
- iscsi_target_node_remove_pg_ig_maps -- Delete initiator group to portal group mappings from an existing iSCSI target node.
- iscsi_get_portal_groups -- Show information about all available portal groups.
- iscsi_create_portal_group -- Add a portal group.
- iscsi_delete_portal_group -- Delete an existing portal group.
- iscsi_target_node_add_pg_ig_maps -- Add initiator group to portal group mappings to an existing iSCSI target node.
- iscsi_target_node_remove_pg_ig_maps -- Delete initiator group to portal group mappings from an existing iSCSI target node.
- iscsi_get_portal_groups -- Show information about all available portal groups.
~~~
~~~bash
/path/to/spdk/scripts/rpc.py iscsi_create_portal_group 1 10.0.0.1:3260
~~~
### Initiator groups
- iscsi_create_initiator_group -- Add an initiator group.
- iscsi_delete_initiator_group -- Delete an existing initiator group.
- iscsi_initiator_group_add_initiators -- Add initiators to an existing initiator group.
- iscsi_get_initiator_groups -- Show information about all available initiator groups.
- iscsi_create_initiator_group -- Add an initiator group.
- iscsi_delete_initiator_group -- Delete an existing initiator group.
- iscsi_initiator_group_add_initiators -- Add initiators to an existing initiator group.
- iscsi_get_initiator_groups -- Show information about all available initiator groups.
~~~
~~~bash
/path/to/spdk/scripts/rpc.py iscsi_create_initiator_group 2 ANY 10.0.0.2/32
~~~
### Target nodes
- iscsi_create_target_node -- Add an iSCSI target node.
- iscsi_delete_target_node -- Delete an iSCSI target node.
- iscsi_target_node_add_lun -- Add a LUN to an existing iSCSI target node.
- iscsi_get_target_nodes -- Show information about all available iSCSI target nodes.
- iscsi_create_target_node -- Add an iSCSI target node.
- iscsi_delete_target_node -- Delete an iSCSI target node.
- iscsi_target_node_add_lun -- Add a LUN to an existing iSCSI target node.
- iscsi_get_target_nodes -- Show information about all available iSCSI target nodes.
~~~
~~~bash
/path/to/spdk/scripts/rpc.py iscsi_create_target_node Target3 Target3_alias MyBdev:0 1:2 64 -d
~~~
@ -83,30 +83,30 @@ The Linux initiator is open-iscsi.
Installing open-iscsi package
Fedora:
~~~
~~~bash
yum install -y iscsi-initiator-utils
~~~
Ubuntu:
~~~
~~~bash
apt-get install -y open-iscsi
~~~
### Setup
Edit /etc/iscsi/iscsid.conf
~~~
~~~bash
node.session.cmds_max = 4096
node.session.queue_depth = 128
~~~
iscsid must be restarted or receive SIGHUP for changes to take effect. To send SIGHUP, run:
~~~
~~~bash
killall -HUP iscsid
~~~
Recommended changes to /etc/sysctl.conf
~~~
~~~bash
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_sack = 0
@ -124,13 +124,14 @@ net.core.netdev_max_backlog = 300000
### Discovery
Assume target is at 10.0.0.1
~~~
~~~bash
iscsiadm -m discovery -t sendtargets -p 10.0.0.1
~~~
### Connect to target
~~~
~~~bash
iscsiadm -m node --login
~~~
@ -139,13 +140,13 @@ they came up as.
### Disconnect from target
~~~
~~~bash
iscsiadm -m node --logout
~~~
### Deleting target node cache
~~~
~~~bash
iscsiadm -m node -o delete
~~~
@ -153,7 +154,7 @@ This will cause the initiator to forget all previously discovered iSCSI target n
### Finding /dev/sdX nodes for iSCSI LUNs
~~~
~~~bash
iscsiadm -m session -P 3 | grep "Attached scsi disk" | awk '{print $4}'
~~~
@ -165,19 +166,19 @@ After the targets are connected, they can be tuned. For example if /dev/sdc is
an iSCSI disk then the following can be done:
Set noop to scheduler
~~~
~~~bash
echo noop > /sys/block/sdc/queue/scheduler
~~~
Disable merging/coalescing (can be useful for precise workload measurements)
~~~
~~~bash
echo "2" > /sys/block/sdc/queue/nomerges
~~~
Increase requests for block queue
~~~
~~~bash
echo "1024" > /sys/block/sdc/queue/nr_requests
~~~
@ -191,33 +192,34 @@ Assuming we have one iSCSI Target server with portal at 10.0.0.1:3200, two LUNs
#### Configure iSCSI Target
Start iscsi_tgt application:
```
```bash
./build/bin/iscsi_tgt
```
Construct two 64MB Malloc block devices with 512B sector size "Malloc0" and "Malloc1":
```
```bash
./scripts/rpc.py bdev_malloc_create -b Malloc0 64 512
./scripts/rpc.py bdev_malloc_create -b Malloc1 64 512
```
Create new portal group with id 1, and address 10.0.0.1:3260:
```
```bash
./scripts/rpc.py iscsi_create_portal_group 1 10.0.0.1:3260
```
Create one initiator group with id 2 to accept any connection from 10.0.0.2/32:
```
```bash
./scripts/rpc.py iscsi_create_initiator_group 2 ANY 10.0.0.2/32
```
Finally construct one target using previously created bdevs as LUN0 (Malloc0) and LUN1 (Malloc1)
with a name "disk1" and alias "Data Disk1" using portal group 1 and initiator group 2.
```
```bash
./scripts/rpc.py iscsi_create_target_node disk1 "Data Disk1" "Malloc0:0 Malloc1:1" 1:2 64 -d
```
@ -225,14 +227,14 @@ with a name "disk1" and alias "Data Disk1" using portal group 1 and initiator gr
Discover target
~~~
~~~bash
$ iscsiadm -m discovery -t sendtargets -p 10.0.0.1
10.0.0.1:3260,1 iqn.2016-06.io.spdk:disk1
~~~
Connect to the target
~~~
~~~bash
iscsiadm -m node --login
~~~
@ -240,7 +242,7 @@ At this point the iSCSI target should show up as SCSI disks.
Check dmesg to see what they came up as. In this example it can look like below:
~~~
~~~bash
...
[630111.860078] scsi host68: iSCSI Initiator over TCP/IP
[630112.124743] scsi 68:0:0:0: Direct-Access INTEL Malloc disk 0001 PQ: 0 ANSI: 5
@ -263,35 +265,37 @@ Check dmesg to see what they came up as. In this example it can look like below:
You may also use simple bash command to find /dev/sdX nodes for each iSCSI LUN
in all logged iSCSI sessions:
~~~
~~~bash
$ iscsiadm -m session -P 3 | grep "Attached scsi disk" | awk '{print $4}'
sdd
sde
~~~
# iSCSI Hotplug {#iscsi_hotplug}
## iSCSI Hotplug {#iscsi_hotplug}
At the iSCSI level, we provide the following support for Hotplug:
1. bdev/nvme:
At the bdev/nvme level, we start one hotplug monitor which will call
spdk_nvme_probe() periodically to get the hotplug events. We provide the
private attach_cb and remove_cb for spdk_nvme_probe(). For the attach_cb,
we will create the block device base on the NVMe device attached, and for the
remove_cb, we will unregister the block device, which will also notify the
upper level stack (for iSCSI target, the upper level stack is scsi/lun) to
handle the hot-remove event.
At the bdev/nvme level, we start one hotplug monitor which will call
spdk_nvme_probe() periodically to get the hotplug events. We provide the
private attach_cb and remove_cb for spdk_nvme_probe(). For the attach_cb,
we will create the block device base on the NVMe device attached, and for the
remove_cb, we will unregister the block device, which will also notify the
upper level stack (for iSCSI target, the upper level stack is scsi/lun) to
handle the hot-remove event.
2. scsi/lun:
When the LUN receive the hot-remove notification from block device layer,
the LUN will be marked as removed, and all the IOs after this point will
return with check condition status. Then the LUN starts one poller which will
wait for all the commands which have already been submitted to block device to
return back; after all the commands return back, the LUN will be deleted.
When the LUN receive the hot-remove notification from block device layer,
the LUN will be marked as removed, and all the IOs after this point will
return with check condition status. Then the LUN starts one poller which will
wait for all the commands which have already been submitted to block device to
return back; after all the commands return back, the LUN will be deleted.
@sa spdk_nvme_probe
# iSCSI Login Redirection {#iscsi_login_redirection}
## iSCSI Login Redirection {#iscsi_login_redirection}
The SPDK iSCSI target application supports iSCSI login redirection feature.

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,8 @@
# JSON-RPC Remote access {#jsonrpc_proxy}
SPDK provides a sample python script `rpc_http_proxy.py`, that provides http server which listens for JSON objects from users. It uses HTTP POST method to receive JSON objects including methods and parameters described in this chapter.
SPDK provides a sample python script `rpc_http_proxy.py`, that provides http server which listens for JSON
objects from users. It uses HTTP POST method to receive JSON objects including methods and parameters
described in this chapter.
## Parameters
@ -26,9 +28,10 @@ Status 200 with resultant JSON object included on success.
## Client side
Below is a sample python script acting as a client side. It sends `bdev_get_bdevs` method with optional `name` parameter and prints JSON object returned from remote_rpc script.
Below is a sample python script acting as a client side. It sends `bdev_get_bdevs` method with optional `name`
parameter and prints JSON object returned from remote_rpc script.
~~~
~~~python
import json
import requests
@ -45,7 +48,10 @@ if __name__ == '__main__':
Output:
~~~
~~~python
python client.py
[{u'num_blocks': 2621440, u'name': u'Malloc0', u'uuid': u'fb57e59c-599d-42f1-8b89-3e46dbe12641', u'claimed': True, u'driver_specific': {}, u'supported_io_types': {u'reset': True, u'nvme_admin': False, u'unmap': True, u'read': True, u'nvme_io': False, u'write': True, u'flush': True, u'write_zeroes': True}, u'qos_ios_per_sec': 0, u'block_size': 4096, u'product_name': u'Malloc disk', u'aliases': []}]
[{u'num_blocks': 2621440, u'name': u'Malloc0', u'uuid': u'fb57e59c-599d-42f1-8b89-3e46dbe12641', u'claimed': True,
u'driver_specific': {}, u'supported_io_types': {u'reset': True, u'nvme_admin': False, u'unmap': True, u'read': True,
u'nvme_io': False, u'write': True, u'flush': True, u'write_zeroes': True}, u'qos_ios_per_sec': 0, u'block_size': 4096,
u'product_name': u'Malloc disk', u'aliases': []}]
~~~

View File

@ -9,7 +9,7 @@ mixing of SPDK event framework dependent code and lower level libraries. This do
is aimed at explaining the structure, naming conventions, versioning scheme, and use cases
of the libraries contained in these two directories.
# Directory Structure {#structure}
## Directory Structure {#structure}
The SPDK libraries are divided into two directories. The `lib` directory contains the base libraries that
compose SPDK. Some of these base libraries define plug-in systems. Instances of those plug-ins are called
@ -17,24 +17,24 @@ modules and are located in the `module` directory. For example, the `spdk_sock`
`lib` directory while the implementations of socket abstractions, `sock_posix` and `sock_uring`
are contained in the `module` directory.
## lib {#lib}
### lib {#lib}
The libraries in the `lib` directory can be readily divided into four categories:
- Utility Libraries: These libraries contain basic, commonly used functions that make more complex
libraries easier to implement. For example, `spdk_log` contains macro definitions that provide a
consistent logging paradigm and `spdk_json` is a general purpose JSON parsing library.
libraries easier to implement. For example, `spdk_log` contains macro definitions that provide a
consistent logging paradigm and `spdk_json` is a general purpose JSON parsing library.
- Protocol Libraries: These libraries contain the building blocks for a specific service. For example,
`spdk_nvmf` and `spdk_vhost` each define the storage protocols after which they are named.
`spdk_nvmf` and `spdk_vhost` each define the storage protocols after which they are named.
- Storage Service Libraries: These libraries provide a specific abstraction that can be mapped to somewhere
between the physical drive and the filesystem level of your typical storage stack. For example `spdk_bdev`
provides a general block device abstraction layer, `spdk_lvol` provides a logical volume abstraction,
`spdk_blobfs` provides a filesystem abstraction, and `spdk_ftl` provides a flash translation layer
abstraction.
between the physical drive and the filesystem level of your typical storage stack. For example `spdk_bdev`
provides a general block device abstraction layer, `spdk_lvol` provides a logical volume abstraction,
`spdk_blobfs` provides a filesystem abstraction, and `spdk_ftl` provides a flash translation layer
abstraction.
- System Libraries: These libraries provide system level services such as a JSON based RPC service
(see `spdk_jsonrpc`) and thread abstractions (see `spdk_thread`). The most notable library in this category
is the `spdk_env_dpdk` library which provides a shim for the underlying Data Plane Development Kit (DPDK)
environment and provides services like memory management.
(see `spdk_jsonrpc`) and thread abstractions (see `spdk_thread`). The most notable library in this category
is the `spdk_env_dpdk` library which provides a shim for the underlying Data Plane Development Kit (DPDK)
environment and provides services like memory management.
The one library in the `lib` directory that doesn't fit into the above classification is the `spdk_event` library.
This library defines a framework used by the applications contained in the `app` and `example` directories. Much
@ -48,7 +48,7 @@ Much like the `spdk_event` library, the `spdk_env_dpdk` library has been archite
can be readily replaced by an alternate environment shim. More information on replacing the `spdk_env_dpdk`
module and the underlying `dpdk` environment can be found in the [environment](#env_replacement) section.
## module {#module}
### module {#module}
The component libraries in the `module` directory represent specific implementations of the base libraries in
the `lib` directory. As with the `lib` directory, much care has been taken to avoid dependencies on the
@ -58,10 +58,10 @@ There are seven sub-directories in the `module` directory which each hold a diff
sub-directories can be divided into two types.
- plug-in libraries: These libraries are explicitly tied to one of the libraries in the `lib` directory and
are registered with that library at runtime by way of a specific constructor function. The parent library in
the `lib` directory then manages the module directly. These types of libraries each implement a function table
defined by their parent library. The following table shows these directories and their corresponding parent
libraries:
are registered with that library at runtime by way of a specific constructor function. The parent library in
the `lib` directory then manages the module directly. These types of libraries each implement a function table
defined by their parent library. The following table shows these directories and their corresponding parent
libraries:
<center>
| module directory | parent library | dependent on event library |
@ -73,15 +73,15 @@ libraries:
</center>
- Free libraries: These libraries are highly dependent upon a library in the `lib` directory but are not
explicitly registered to that library via a constructor. The libraries in the `blob`, `blobfs`, and `env_dpdk`
directories fall into this category. None of the libraries in this category depend explicitly on the
`spdk_event` library.
explicitly registered to that library via a constructor. The libraries in the `blob`, `blobfs`, and `env_dpdk`
directories fall into this category. None of the libraries in this category depend explicitly on the
`spdk_event` library.
# Library Conventions {#conventions}
## Library Conventions {#conventions}
The SPDK libraries follow strict conventions for naming functions, logging, versioning, and header files.
## Headers {#headers}
### Headers {#headers}
All public SPDK header files exist in the `include` directory of the SPDK repository. These headers
are divided into two sub-directories.
@ -105,7 +105,7 @@ Other header files contained directly in the `lib` and `module` directories are
by source files of their corresponding library. Any symbols intended to be used across libraries need to be
included in a header in the `include/spdk_internal` directory.
## Naming Conventions {#naming}
### Naming Conventions {#naming}
All public types and functions in SPDK libraries begin with the prefix `spdk_`. They are also typically
further namespaced using the spdk library name. The rest of the function or type name describes its purpose.
@ -114,15 +114,15 @@ There are no internal library functions that begin with the `spdk_` prefix. This
enforced by the SPDK continuous Integration testing. Functions not intended for use outside of their home
library should be namespaced with the name of the library only.
## Map Files {#map}
### Map Files {#map}
SPDK libraries can be built as both static and shared object files. To facilitate building libraries as shared
objects, each one has a corresponding map file (e.g. `spdk_nvmf` relies on `spdk_nvmf.map`). SPDK libraries
not exporting any symbols rely on a blank map file located at `mk/spdk_blank.map`.
# SPDK Shared Objects {#shared_objects}
## SPDK Shared Objects {#shared_objects}
## Shared Object Versioning {#versioning}
### Shared Object Versioning {#versioning}
SPDK shared objects follow a semantic versioning pattern with a major and minor version. Any changes which
break backwards compatibility (symbol removal or change) will cause a shared object major increment and
@ -141,7 +141,7 @@ Shared objects are versioned independently of one another. This means that `libs
with the same suffix are not necessarily compatible with each other. It is important to source all of your
SPDK libraries from the same repository and version to ensure inter-library compatibility.
## Linking to Shared Objects {#so_linking}
### Linking to Shared Objects {#so_linking}
Shared objects in SPDK are created on a per-library basis. There is a top level `libspdk.so` object
which is a linker script. It simply contains references to all of the other spdk shared objects.
@ -149,15 +149,15 @@ which is a linker script. It simply contains references to all of the other spdk
There are essentially two ways of linking to SPDK libraries.
1. An application can link to the top level shared object library as follows:
~~~{.sh}
~~~{.sh}
gcc -o my_app ./my_app.c -lspdk -lspdk_env_dpdk -ldpdk
~~~
~~~
2. An application can link to only a subset of libraries by linking directly to the ones it relies on:
~~~{.sh}
~~~{.sh}
gcc -o my_app ./my_app.c -lpassthru_external -lspdk_event_bdev -lspdk_bdev -lspdk_bdev_malloc
-lspdk_log -lspdk_thread -lspdk_util -lspdk_event -lspdk_env_dpdk -ldpdk
~~~
~~~
In the second instance, please note that applications need only link to the libraries upon which they
directly depend. All SPDK libraries have their dependencies specified at object compile time. This means
@ -172,7 +172,7 @@ itself need to be supplied to the linker. In the examples above, these are `spdk
respectively. This was intentional and allows one to easily swap out both the environment and the
environment shim.
## Replacing the env abstraction {#env_replacement}
### Replacing the env abstraction {#env_replacement}
SPDK depends on an environment abstraction that provides crucial pinned memory management and PCIe
bus management operations. The interface for this environment abstraction is defined in the
@ -184,6 +184,7 @@ modifications to the spdk source directly.
Any environment can replace the `spdk_env_dpdk` environment by implementing the `include/env.h` header
file. The environment can either be implemented wholesale in a single library or as a two-part
shim/implementation library system.
~~~{.sh}
# single library
gcc -o my_app ./my_app.c -lspdk -lcustom_env_implementation
@ -192,7 +193,7 @@ shim/implementation library system.
gcc -o my_app ./my_app.c -lspdk -lcustom_env_shim -lcustom_env_implementation
~~~
# SPDK Static Objects {#static_objects}
## SPDK Static Objects {#static_objects}
SPDK static objects are compiled by default even when no parameters are supplied to the build system.
Unlike SPDK shared objects, the filename does not contain any versioning semantics. Linking against

View File

@ -1,38 +1,48 @@
# Logical Volumes {#logical_volumes}
The Logical Volumes library is a flexible storage space management system. It provides creating and managing virtual block devices with variable size. The SPDK Logical Volume library is built on top of @ref blob.
The Logical Volumes library is a flexible storage space management system. It provides creating and managing virtual
block devices with variable size. The SPDK Logical Volume library is built on top of @ref blob.
# Terminology {#lvol_terminology}
## Terminology {#lvol_terminology}
## Logical volume store {#lvs}
### Logical volume store {#lvs}
* Shorthand: lvolstore, lvs
* Type name: struct spdk_lvol_store
A logical volume store uses the super blob feature of blobstore to hold uuid (and in future other metadata). Blobstore types are implemented in blobstore itself, and saved on disk. An lvolstore will generate a UUID on creation, so that it can be uniquely identified from other lvolstores.
By default when creating lvol store data region is unmapped. Optional --clear-method parameter can be passed on creation to change that behavior to writing zeroes or performing no operation.
A logical volume store uses the super blob feature of blobstore to hold uuid (and in future other metadata).
Blobstore types are implemented in blobstore itself, and saved on disk. An lvolstore will generate a UUID on
creation, so that it can be uniquely identified from other lvolstores.
By default when creating lvol store data region is unmapped. Optional --clear-method parameter can be passed
on creation to change that behavior to writing zeroes or performing no operation.
## Logical volume {#lvol}
### Logical volume {#lvol}
* Shorthand: lvol
* Type name: struct spdk_lvol
A logical volume is implemented as an SPDK blob created from an lvolstore. An lvol is uniquely identified by its UUID. Lvol additional can have alias name.
A logical volume is implemented as an SPDK blob created from an lvolstore. An lvol is uniquely identified by
its UUID. Lvol additional can have alias name.
## Logical volume block device {#lvol_bdev}
### Logical volume block device {#lvol_bdev}
* Shorthand: lvol_bdev
* Type name: struct spdk_lvol_bdev
Representation of an SPDK block device (spdk_bdev) with an lvol implementation.
A logical volume block device translates generic SPDK block device I/O (spdk_bdev_io) operations into the equivalent SPDK blob operations. Combination of lvol name and lvolstore name gives lvol_bdev alias name in a form "lvs_name/lvol_name". block_size of the created bdev is always 4096, due to blobstore page size. Cluster_size is configurable by parameter.
Size of the new bdev will be rounded up to nearest multiple of cluster_size.
By default lvol bdevs claim part of lvol store equal to their set size. When thin provision option is enabled, no space is taken from lvol store until data is written to lvol bdev.
By default when deleting lvol bdev or resizing down, allocated clusters are unmapped. Optional --clear-method parameter can be passed on creation to change that behavior to writing zeroes or performing no operation.
A logical volume block device translates generic SPDK block device I/O (spdk_bdev_io) operations into the
equivalent SPDK blob operations. Combination of lvol name and lvolstore name gives lvol_bdev alias name in
a form "lvs_name/lvol_name". block_size of the created bdev is always 4096, due to blobstore page size.
Cluster_size is configurable by parameter. Size of the new bdev will be rounded up to nearest multiple of
cluster_size. By default lvol bdevs claim part of lvol store equal to their set size. When thin provision
option is enabled, no space is taken from lvol store until data is written to lvol bdev.
By default when deleting lvol bdev or resizing down, allocated clusters are unmapped. Optional --clear-method
parameter can be passed on creation to change that behavior to writing zeroes or performing no operation.
## Thin provisioning {#lvol_thin_provisioning}
### Thin provisioning {#lvol_thin_provisioning}
Thin provisioned lvols rely on dynamic cluster allocation (e.g. when the first write operation on a cluster is performed), only space required to store data is used and unallocated clusters are obtained from underlying device (e.g. zeroes_dev).
Thin provisioned lvols rely on dynamic cluster allocation (e.g. when the first write operation on a cluster is performed), only space
required to store data is used and unallocated clusters are obtained from underlying device (e.g. zeroes_dev).
Sample write operations of thin provisioned blob are shown on the diagram below:
@ -42,11 +52,13 @@ Sample read operations and the structure of thin provisioned blob are shown on t
![Reading clusters from thin provisioned blob](lvol_thin_provisioning.svg)
## Snapshots and clone {#lvol_snapshots}
### Snapshots and clone {#lvol_snapshots}
Logical volumes support snapshots and clones functionality. User may at any given time create snapshot of existing logical volume to save a backup of current volume state.
When creating snapshot original volume becomes thin provisioned and saves only incremental differences from its underlying snapshot. This means that every read from unallocated cluster is actually a read from the snapshot and
every write to unallocated cluster triggers new cluster allocation and data copy from corresponding cluster in snapshot to the new cluster in logical volume before the actual write occurs.
Logical volumes support snapshots and clones functionality. User may at any given time create snapshot of existing
logical volume to save a backup of current volume state. When creating snapshot original volume becomes thin provisioned
and saves only incremental differences from its underlying snapshot. This means that every read from unallocated cluster
is actually a read from the snapshot and every write to unallocated cluster triggers new cluster allocation and data copy
from corresponding cluster in snapshot to the new cluster in logical volume before the actual write occurs.
The read operation is performed as shown in the diagram below:
![Reading cluster from clone](lvol_clone_snapshot_read.svg)
@ -54,32 +66,38 @@ The read operation is performed as shown in the diagram below:
The write operation is performed as shown in the diagram below:
![Writing cluster to the clone](lvol_clone_snapshot_write.svg)
User may also create clone of existing snapshot that will be thin provisioned and it will behave in the same way as logical volume from which snapshot is created.
There is no limit of clones and snapshots that may be created as long as there is enough space on logical volume store. Snapshots are read only. Clones may be created only from snapshots or read only logical volumes.
User may also create clone of existing snapshot that will be thin provisioned and it will behave in the same way as logical volume
from which snapshot is created. There is no limit of clones and snapshots that may be created as long as there is enough space on
logical volume store. Snapshots are read only. Clones may be created only from snapshots or read only logical volumes.
A snapshot can be removed only if there is a single clone on top of it. The relation chain will be updated accordingly. The cluster map of clone and snapshot will be merged and entries for unallocated clusters in the clone
will be updated with addresses from the snapshot cluster map. The entire operation modifies metadata only - no data is copied during this process.
A snapshot can be removed only if there is a single clone on top of it. The relation chain will be updated accordingly.
The cluster map of clone and snapshot will be merged and entries for unallocated clusters in the clone will be updated with
addresses from the snapshot cluster map. The entire operation modifies metadata only - no data is copied during this process.
## Inflation {#lvol_inflation}
### Inflation {#lvol_inflation}
Blobs can be inflated to copy data from backing devices (e.g. snapshots) and allocate all remaining clusters. As a result of this operation all dependencies for the blob are removed.
Blobs can be inflated to copy data from backing devices (e.g. snapshots) and allocate all remaining clusters. As a result of this
operation all dependencies for the blob are removed.
![Removing backing blob and bdevs relations using inflate call](lvol_inflate_clone_snapshot.svg)
## Decoupling {#lvol_decoupling}
### Decoupling {#lvol_decoupling}
Blobs can be decoupled from their parent blob by copying data from backing devices (e.g. snapshots) for all allocated clusters. Remaining unallocated clusters are kept thin provisioned.
Note: When decouple is performed, only single dependency is removed. To remove all dependencies in a chain of blobs depending on each other, multiple calls need to be issued.
Blobs can be decoupled from their parent blob by copying data from backing devices (e.g. snapshots) for all allocated clusters.
Remaining unallocated clusters are kept thin provisioned.
Note: When decouple is performed, only single dependency is removed. To remove all dependencies in a chain of blobs depending
on each other, multiple calls need to be issued.
# Configuring Logical Volumes
## Configuring Logical Volumes
There is no static configuration available for logical volumes. All configuration is done trough RPC. Information about logical volumes is kept on block devices.
There is no static configuration available for logical volumes. All configuration is done trough RPC. Information about
logical volumes is kept on block devices.
# RPC overview {#lvol_rpc}
## RPC overview {#lvol_rpc}
RPC regarding lvolstore:
```
```bash
bdev_lvol_create_lvstore [-h] [-c CLUSTER_SZ] bdev_name lvs_name
Constructs lvolstore on specified bdev with specified name. During
construction bdev is unmapped at initialization and all data is
@ -111,7 +129,7 @@ bdev_lvol_rename_lvstore [-h] old_name new_name
RPC regarding lvol and spdk bdev:
```
```bash
bdev_lvol_create [-h] [-u UUID] [-l LVS_NAME] [-t] [-c CLEAR_METHOD] lvol_name size
Creates lvol with specified size and name on lvolstore specified by its uuid
or name. Then constructs spdk bdev on top of that lvol and presents it as spdk bdev.

View File

@ -92,7 +92,7 @@ SPDK must be allocated using spdk_dma_malloc() or its siblings. The buffers
must be allocated specifically so that they are pinned and so that physical
addresses are known.
# IOMMU Support
## IOMMU Support
Many platforms contain an extra piece of hardware called an I/O Memory
Management Unit (IOMMU). An IOMMU is much like a regular MMU, except it

View File

@ -2,3 +2,4 @@
- @subpage peer_2_peer
- @subpage containers
- @subpage rpms

View File

@ -9,32 +9,32 @@ do not poll frequently enough, events may be lost. All events are identified by
monotonically increasing integer, so missing events may be detected, although
not recovered.
# Register event types {#notify_register}
## Register event types {#notify_register}
During initialization the sender library should register its own event types using
`spdk_notify_type_register(const char *type)`. Parameter 'type' is the name of
notification type.
# Get info about events {#notify_get_info}
## Get info about events {#notify_get_info}
A consumer can get information about the available event types during runtime using
`spdk_notify_foreach_type`, which iterates over registered notification types and
calls a callback on each of them, so that user can produce detailed information
about notification.
# Get new events {#notify_listen}
## Get new events {#notify_listen}
A consumer can get events by calling function `spdk_notify_foreach_event`.
The caller should specify last received event and the maximum number of invocations.
There might be multiple consumers of each event. The event bus is implemented as a
circular buffer, so older events may be overwritten by newer ones.
# Send events {#notify_send}
## Send events {#notify_send}
When an event occurs, a library can invoke `spdk_notify_send` with two strings.
One containing the type of the event, like "spdk_bdev_register", second with context,
for example "Nvme0n1"
# RPC Calls {#rpc_calls}
## RPC Calls {#rpc_calls}
See [JSON-RPC documentation](jsonrpc.md/#rpc_notify_get_types)

View File

@ -1,17 +1,17 @@
# NVMe Driver {#nvme}
# In this document {#nvme_toc}
## In this document {#nvme_toc}
* @ref nvme_intro
* @ref nvme_examples
* @ref nvme_interface
* @ref nvme_design
* @ref nvme_fabrics_host
* @ref nvme_multi_process
* @ref nvme_hotplug
* @ref nvme_cuse
- @ref nvme_intro
- @ref nvme_examples
- @ref nvme_interface
- @ref nvme_design
- @ref nvme_fabrics_host
- @ref nvme_multi_process
- @ref nvme_hotplug
- @ref nvme_cuse
# Introduction {#nvme_intro}
## Introduction {#nvme_intro}
The NVMe driver is a C library that may be linked directly into an application
that provides direct, zero-copy data transfer to and from
@ -29,23 +29,23 @@ devices via NVMe over Fabrics. Users may now call spdk_nvme_probe() on both
local PCI busses and on remote NVMe over Fabrics discovery services. The API is
otherwise unchanged.
# Examples {#nvme_examples}
## Examples {#nvme_examples}
## Getting Start with Hello World {#nvme_helloworld}
### Getting Start with Hello World {#nvme_helloworld}
There are a number of examples provided that demonstrate how to use the NVMe
library. They are all in the [examples/nvme](https://github.com/spdk/spdk/tree/master/examples/nvme)
directory in the repository. The best place to start is
[hello_world](https://github.com/spdk/spdk/blob/master/examples/nvme/hello_world/hello_world.c).
## Running Benchmarks with Fio Plugin {#nvme_fioplugin}
### Running Benchmarks with Fio Plugin {#nvme_fioplugin}
SPDK provides a plugin to the very popular [fio](https://github.com/axboe/fio)
tool for running some basic benchmarks. See the fio start up
[guide](https://github.com/spdk/spdk/blob/master/examples/nvme/fio_plugin/)
for more details.
## Running Benchmarks with Perf Tool {#nvme_perf}
### Running Benchmarks with Perf Tool {#nvme_perf}
NVMe perf utility in the [examples/nvme/perf](https://github.com/spdk/spdk/tree/master/examples/nvme/perf)
is one of the examples which also can be used for performance tests. The fio
@ -79,7 +79,7 @@ perf -q 1 -o 4096 -w write -r 'trtype:PCIe traddr:0000:04:00.0' -t 300 -e 'PRACT
perf -q 1 -o 4096 -w read -r 'trtype:PCIe traddr:0000:04:00.0' -t 200 -e 'PRACT=0,PRCKH=GUARD'
~~~
# Public Interface {#nvme_interface}
## Public Interface {#nvme_interface}
- spdk/nvme.h
@ -103,9 +103,9 @@ spdk_nvme_ctrlr_process_admin_completions() | @copybrief spdk_nvme_ctrlr_process
spdk_nvme_ctrlr_cmd_io_raw() | @copybrief spdk_nvme_ctrlr_cmd_io_raw()
spdk_nvme_ctrlr_cmd_io_raw_with_md() | @copybrief spdk_nvme_ctrlr_cmd_io_raw_with_md()
# NVMe Driver Design {#nvme_design}
## NVMe Driver Design {#nvme_design}
## NVMe I/O Submission {#nvme_io_submission}
### NVMe I/O Submission {#nvme_io_submission}
I/O is submitted to an NVMe namespace using nvme_ns_cmd_xxx functions. The NVMe
driver submits the I/O request as an NVMe submission queue entry on the queue
@ -117,21 +117,21 @@ spdk_nvme_qpair_process_completions().
@sa spdk_nvme_ns_cmd_read, spdk_nvme_ns_cmd_write, spdk_nvme_ns_cmd_dataset_management,
spdk_nvme_ns_cmd_flush, spdk_nvme_qpair_process_completions
### Fused operations {#nvme_fuses}
#### Fused operations {#nvme_fuses}
To "fuse" two commands, the first command should have the SPDK_NVME_IO_FLAGS_FUSE_FIRST
io flag set, and the next one should have the SPDK_NVME_IO_FLAGS_FUSE_SECOND.
In addition, the following rules must be met to execute two commands as an atomic unit:
- The commands shall be inserted next to each other in the same submission queue.
- The LBA range, should be the same for the two commands.
- The commands shall be inserted next to each other in the same submission queue.
- The LBA range, should be the same for the two commands.
E.g. To send fused compare and write operation user must call spdk_nvme_ns_cmd_compare
followed with spdk_nvme_ns_cmd_write and make sure no other operations are submitted
in between on the same queue, like in example below:
~~~
~~~c
rc = spdk_nvme_ns_cmd_compare(ns, qpair, cmp_buf, 0, 1, nvme_fused_first_cpl_cb,
NULL, SPDK_NVME_CMD_FUSE_FIRST);
if (rc != 0) {
@ -149,7 +149,7 @@ The NVMe specification currently defines compare-and-write as a fused operation.
Support for compare-and-write is reported by the controller flag
SPDK_NVME_CTRLR_COMPARE_AND_WRITE_SUPPORTED.
### Scaling Performance {#nvme_scaling}
#### Scaling Performance {#nvme_scaling}
NVMe queue pairs (struct spdk_nvme_qpair) provide parallel submission paths for
I/O. I/O may be submitted on multiple queue pairs simultaneously from different
@ -182,7 +182,7 @@ require that data should be done by sending a request to the owning thread.
This results in a message passing architecture, as opposed to a locking
architecture, and will result in superior scaling across CPU cores.
## NVMe Driver Internal Memory Usage {#nvme_memory_usage}
### NVMe Driver Internal Memory Usage {#nvme_memory_usage}
The SPDK NVMe driver provides a zero-copy data transfer path, which means that
there are no data buffers for I/O commands. However, some Admin commands have
@ -202,12 +202,12 @@ Each submission queue entry (SQE) and completion queue entry (CQE) consumes 64 b
and 16 bytes respectively. Therefore, the maximum memory used for each I/O queue
pair is (MQES + 1) * (64 + 16) Bytes.
# NVMe over Fabrics Host Support {#nvme_fabrics_host}
## NVMe over Fabrics Host Support {#nvme_fabrics_host}
The NVMe driver supports connecting to remote NVMe-oF targets and
interacting with them in the same manner as local NVMe SSDs.
## Specifying Remote NVMe over Fabrics Targets {#nvme_fabrics_trid}
### Specifying Remote NVMe over Fabrics Targets {#nvme_fabrics_trid}
The method for connecting to a remote NVMe-oF target is very similar
to the normal enumeration process for local PCIe-attached NVMe devices.
@ -228,11 +228,11 @@ single NVM subsystem directly, the NVMe library will call `probe_cb`
for just that subsystem; this allows the user to skip the discovery step
and connect directly to a subsystem with a known address.
## RDMA Limitations
### RDMA Limitations
Please refer to NVMe-oF target's @ref nvmf_rdma_limitations
# NVMe Multi Process {#nvme_multi_process}
## NVMe Multi Process {#nvme_multi_process}
This capability enables the SPDK NVMe driver to support multiple processes accessing the
same NVMe device. The NVMe driver allocates critical structures from shared memory, so
@ -243,7 +243,7 @@ The primary motivation for this feature is to support management tools that can
to long running applications, perform some maintenance work or gather information, and
then detach.
## Configuration {#nvme_multi_process_configuration}
### Configuration {#nvme_multi_process_configuration}
DPDK EAL allows different types of processes to be spawned, each with different permissions
on the hugepage memory used by the applications.
@ -269,7 +269,7 @@ Example: identical shm_id and non-overlapping core masks
./perf -q 8 -o 131072 -w write -c 0x10 -t 60 -i 1
~~~
## Limitations {#nvme_multi_process_limitations}
### Limitations {#nvme_multi_process_limitations}
1. Two processes sharing memory may not share any cores in their core mask.
2. If a primary process exits while secondary processes are still running, those processes
@ -280,7 +280,7 @@ Example: identical shm_id and non-overlapping core masks
@sa spdk_nvme_probe, spdk_nvme_ctrlr_process_admin_completions
# NVMe Hotplug {#nvme_hotplug}
## NVMe Hotplug {#nvme_hotplug}
At the NVMe driver level, we provide the following support for Hotplug:
@ -300,11 +300,11 @@ At the NVMe driver level, we provide the following support for Hotplug:
@sa spdk_nvme_probe
# NVMe Character Devices {#nvme_cuse}
## NVMe Character Devices {#nvme_cuse}
This feature is considered as experimental.
## Design
### Design
![NVMe character devices processing diagram](nvme_cuse.svg)
@ -326,9 +326,9 @@ immediate response, without passing them through the ring.
This interface reserves one additional qpair for sending down the I/O for each controller.
## Usage
### Usage
### Enabling cuse support for NVMe
#### Enabling cuse support for NVMe
Cuse support is disabled by default. To enable support for NVMe-CUSE devices first
install required dependencies
@ -337,7 +337,7 @@ sudo scripts/pkgdep.sh --fuse
~~~
Then compile SPDK with "./configure --with-nvme-cuse".
### Creating NVMe-CUSE device
#### Creating NVMe-CUSE device
First make sure to prepare the environment (see @ref getting_started).
This includes loading CUSE kernel module.
@ -367,7 +367,7 @@ $ ls /dev/spdk/
nvme0 nvme0n1
~~~
### Example of using nvme-cli
#### Example of using nvme-cli
Most nvme-cli commands can point to specific controller or namespace by providing a path to it.
This can be leveraged to issue commands to the SPDK NVMe-CUSE devices.
@ -381,7 +381,7 @@ sudo nvme id-ns /dev/spdk/nvme0n1
Note: `nvme list` command does not display SPDK NVMe-CUSE devices,
see nvme-cli [PR #773](https://github.com/linux-nvme/nvme-cli/pull/773).
### Examples of using smartctl
#### Examples of using smartctl
smartctl tool recognizes device type based on the device path. If none of expected
patterns match, SCSI translation layer is used to identify device.
@ -395,7 +395,7 @@ the NVMe device.
...
~~~
## Limitations
### Limitations
NVMe namespaces are created as character devices and their use may be limited for
tools expecting block devices.

View File

@ -3,7 +3,7 @@
@sa @ref nvme_fabrics_host
@sa @ref nvmf_tgt_tracepoints
# NVMe-oF Target Getting Started Guide {#nvmf_getting_started}
## NVMe-oF Target Getting Started Guide {#nvmf_getting_started}
The SPDK NVMe over Fabrics target is a user space application that presents block devices over a fabrics
such as Ethernet, Infiniband or Fibre Channel. SPDK currently supports RDMA and TCP transports.
@ -186,7 +186,8 @@ Basic Types
year = 4 * digit ;
month = '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' ;
digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' ;
hex digit = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' ;
hex digit = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | '0' |
'1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' ;
NQN Definition
NVMe Qualified Name = ( NVMe-oF Discovery NQN | NVMe UUID NQN | NVMe Domain NQN ), '\0' ;

View File

@ -1,28 +1,30 @@
# NVMe-oF Target Tracepoints {#nvmf_tgt_tracepoints}
# Introduction {#tracepoints_intro}
## Introduction {#tracepoints_intro}
SPDK has a tracing framework for capturing low-level event information at runtime.
Tracepoints provide a high-performance tracing mechanism that is accessible at runtime.
They are implemented as a circular buffer in shared memory that is accessible from other
processes. The NVMe-oF target is instrumented with tracepoints to enable analysis of
both performance and application crashes. (Note: the SPDK tracing framework should still
be considered experimental. Work to formalize and document the framework is in progress.)
both performance and application crashes and it has to be configured beforehand using
this [guide](https://spdk.io/doc/nvmf.html).
(Note: the SPDK tracing framework should still be considered experimental.
Work to formalize and document the framework is in progress.)
# Enabling Tracepoints {#enable_tracepoints}
## Enabling Tracepoints {#enable_tracepoints}
Tracepoints are placed in groups. They are enabled and disabled as a group. To enable
the instrumentation of all the tracepoints group in an SPDK target application, start the
target with -e parameter set to 0xFFFF:
~~~
~~~bash
build/bin/nvmf_tgt -e 0xFFFF
~~~
To enable the instrumentation of just the NVMe-oF RDMA tracepoints in an SPDK target
application, start the target with the -e parameter set to 0x10:
~~~
~~~bash
build/bin/nvmf_tgt -e 0x10
~~~
@ -30,7 +32,7 @@ When the target starts, a message is logged with the information you need to vie
the tracepoints in a human-readable format using the spdk_trace application. The target
will also log information about the shared memory file.
~~~{.sh}
~~~bash
app.c: 527:spdk_app_setup_trace: *NOTICE*: Tracepoint Group Mask 0xFFFF specified.
app.c: 531:spdk_app_setup_trace: *NOTICE*: Use 'spdk_trace -s nvmf -p 24147' to capture a snapshot of events at runtime.
app.c: 533:spdk_app_setup_trace: *NOTICE*: Or copy /dev/shm/nvmf_trace.pid24147 for offline analysis/debug.
@ -41,20 +43,20 @@ exits. This ensures the file can be used for analysis after the application exi
shared memory files are in /dev/shm, and can be deleted manually to free shm space if needed. A system
reboot will also free all of the /dev/shm files.
# Capturing a snapshot of events {#capture_tracepoints}
## Capturing a snapshot of events {#capture_tracepoints}
Send I/Os to the SPDK target application to generate events. The following is
an example usage of perf to send I/Os to the NVMe-oF target over an RDMA network
interface for 10 minutes.
~~~
~~~bash
./perf -q 128 -s 4096 -w randread -t 600 -r 'trtype:RDMA adrfam:IPv4 traddr:192.168.100.2 trsvcid:4420'
~~~
The spdk_trace program can be found in the app/trace directory. To analyze the tracepoints on the same
system running the NVMe-oF target, simply execute the command line shown in the log:
~~~{.sh}
~~~bash
build/bin/spdk_trace -s nvmf -p 24147
~~~
@ -62,13 +64,13 @@ To analyze the tracepoints on a different system, first prepare the tracepoint f
tracepoint file can be large, but usually compresses very well. This step can also be used to prepare
a tracepoint file to attach to a GitHub issue for debugging NVMe-oF application crashes.
~~~{.sh}
~~~bash
bzip2 -c /dev/shm/nvmf_trace.pid24147 > /tmp/trace.bz2
~~~
After transferring the /tmp/trace.bz2 tracepoint file to a different system:
~~~{.sh}
~~~bash
bunzip2 /tmp/trace.bz2
build/bin/spdk_trace -f /tmp/trace
~~~
@ -77,7 +79,7 @@ The following is sample trace capture showing the cumulative time that each
I/O spends at each RDMA state. All the trace captures with the same id are for
the same I/O.
~~~
~~~bash
28: 6026.658 ( 12656064) RDMA_REQ_NEED_BUFFER id: r3622 time: 0.019
28: 6026.694 ( 12656140) RDMA_REQ_RDY_TO_EXECUTE id: r3622 time: 0.055
28: 6026.820 ( 12656406) RDMA_REQ_EXECUTING id: r3622 time: 0.182
@ -124,7 +126,7 @@ the same I/O.
28: 6033.056 ( 12669500) RDMA_REQ_COMPLETED id: r3564 time: 100.211
~~~
# Capturing sufficient trace events {#capture_trace_events}
## Capturing sufficient trace events {#capture_trace_events}
Since the tracepoint file generated directly by SPDK application is a circular buffer in shared memory,
the trace events captured by it may be insufficient for further analysis.
@ -133,31 +135,31 @@ spdk_trace_record is used to poll the spdk tracepoint shared memory, record new
and store all entries into specified output file at its shutdown on SIGINT or SIGTERM.
After SPDK nvmf target is launched, simply execute the command line shown in the log:
~~~{.sh}
~~~bash
build/bin/spdk_trace_record -q -s nvmf -p 24147 -f /tmp/spdk_nvmf_record.trace
~~~
Also send I/Os to the SPDK target application to generate events by previous perf example for 10 minutes.
~~~{.sh}
~~~bash
./perf -q 128 -s 4096 -w randread -t 600 -r 'trtype:RDMA adrfam:IPv4 traddr:192.168.100.2 trsvcid:4420'
~~~
After the completion of perf example, shut down spdk_trace_record by signal SIGINT (Ctrl + C).
To analyze the tracepoints output file from spdk_trace_record, simply run spdk_trace program by:
~~~{.sh}
~~~bash
build/bin/spdk_trace -f /tmp/spdk_nvmf_record.trace
~~~
# Adding New Tracepoints {#add_tracepoints}
## Adding New Tracepoints {#add_tracepoints}
SPDK applications and libraries provide several trace points. You can add new
tracepoints to the existing trace groups. For example, to add a new tracepoints
to the SPDK RDMA library (lib/nvmf/rdma.c) trace group TRACE_GROUP_NVMF_RDMA,
define the tracepoints and assigning them a unique ID using the SPDK_TPOINT_ID macro:
~~~
~~~c
#define TRACE_GROUP_NVMF_RDMA 0x4
#define TRACE_RDMA_REQUEST_STATE_NEW SPDK_TPOINT_ID(TRACE_GROUP_NVMF_RDMA, 0x0)
...
@ -168,17 +170,19 @@ You also need to register the new trace points in the SPDK_TRACE_REGISTER_FN mac
within the application/library using the spdk_trace_register_description function
as shown below:
~~~
~~~c
SPDK_TRACE_REGISTER_FN(nvmf_trace)
{
spdk_trace_register_object(OBJECT_NVMF_RDMA_IO, 'r');
spdk_trace_register_description("RDMA_REQ_NEW", "",
TRACE_RDMA_REQUEST_STATE_NEW,
OWNER_NONE, OBJECT_NVMF_RDMA_IO, 1, 1, "cmid: ");
OWNER_NONE, OBJECT_NVMF_RDMA_IO, 1,
SPDK_TRACE_ARG_TYPE_PTR, "cmid: ");
...
spdk_trace_register_description("NEW_RDMA_REQ_NAME", "",
NEW_TRACE_POINT_NAME,
OWNER_NONE, OBJECT_NVMF_RDMA_IO, 0, 1, "cmid: ");
OWNER_NONE, OBJECT_NVMF_RDMA_IO, 0,
SPDK_TRACE_ARG_TYPE_PTR, "cmid: ");
}
~~~
@ -187,7 +191,7 @@ application/library to record the current trace state for the new trace points.
The following example shows the usage of the spdk_trace_record function to
record the current trace state of several tracepoints.
~~~
~~~c
case RDMA_REQUEST_STATE_NEW:
spdk_trace_record(TRACE_RDMA_REQUEST_STATE_NEW, 0, 0, (uintptr_t)rdma_req, (uintptr_t)rqpair->cm_id);
...

View File

@ -1,6 +1,6 @@
# SPDK Structural Overview {#overview}
# Overview {#dir_overview}
## Overview {#dir_overview}
SPDK is composed of a set of C libraries residing in `lib` with public interface
header files in `include/spdk`, plus a set of applications built out of those
@ -77,13 +77,13 @@ directory and include the headers by prefixing `spdk/` like this:
Most of the headers here correspond with a library in the `lib` directory. There
are a few headers that stand alone, however. They are:
- `assert.h`
- `barrier.h`
- `endian.h`
- `fd.h`
- `mmio.h`
- `queue.h` and `queue_extras.h`
- `string.h`
- `assert.h`
- `barrier.h`
- `endian.h`
- `fd.h`
- `mmio.h`
- `queue.h` and `queue_extras.h`
- `string.h`
There is also an `spdk_internal` directory that contains header files widely included
by libraries within SPDK, but that are not part of the public API and would not be

View File

@ -3,14 +3,14 @@
Please note that the functionality discussed in this document is
currently tagged as experimental.
# In this document {#p2p_toc}
## In this document {#p2p_toc}
* @ref p2p_overview
* @ref p2p_nvme_api
* @ref p2p_cmb_copy
* @ref p2p_issues
# Overview {#p2p_overview}
## Overview {#p2p_overview}
Peer-2-Peer (P2P) is the concept of DMAing data directly from one PCI
End Point (EP) to another without using a system memory buffer. The
@ -22,7 +22,7 @@ In this section of documentation we outline how to perform P2P
operations in SPDK and outline some of the issues that can occur when
performing P2P operations.
# The P2P API for NVMe {#p2p_nvme_api}
## The P2P API for NVMe {#p2p_nvme_api}
The functions that provide access to the NVMe CMBs for P2P
capabilities are given in the table below.
@ -33,7 +33,7 @@ spdk_nvme_ctrlr_map_cmb() | @copybrief spdk_nvme_ctrlr_map_cmb
spdk_nvme_ctrlr_unmap_cmb() | @copybrief spdk_nvme_ctrlr_unmap_cmb()
spdk_nvme_ctrlr_get_regs_cmbsz() | @copybrief spdk_nvme_ctrlr_get_regs_cmbsz()
# Determining device support {#p2p_support}
## Determining device support {#p2p_support}
SPDK's identify example application displays whether a device has a controller
memory buffer and which operations it supports. Run it as follows:
@ -42,7 +42,7 @@ memory buffer and which operations it supports. Run it as follows:
./build/examples/identify -r traddr:<pci id of ssd>
~~~
# cmb_copy: An example P2P Application {#p2p_cmb_copy}
## cmb_copy: An example P2P Application {#p2p_cmb_copy}
Run the cmb_copy example application.
@ -53,7 +53,7 @@ This should copy a single LBA (LBA 0) from namespace 1 on the read
NVMe SSD to LBA 0 on namespace 1 on the write SSD using the CMB as the
DMA buffer.
# Issues with P2P {#p2p_issues}
## Issues with P2P {#p2p_issues}
* In some systems when performing peer-2-peer DMAs between PCIe EPs
that are directly connected to the Root Complex (RC) the DMA may

View File

@ -1,5 +1,19 @@
# Performance Reports {#performance_reports}
## Release 21.07
- [SPDK 21.07 NVMe Bdev Performance Report](https://ci.spdk.io/download/performance-reports/SPDK_nvme_bdev_perf_report_2107.pdf)
- [SPDK 21.07 NVMe-oF TCP Performance Report](https://ci.spdk.io/download/performance-reports/SPDK_tcp_perf_report_2107.pdf)
- [SPDK 21.07 NVMe-oF RDMA Performance Report](https://ci.spdk.io/download/performance-reports/SPDK_rdma_perf_report_2107.pdf)
- [SPDK 21.07 Vhost Performance Report](https://ci.spdk.io/download/performance-reports/SPDK_vhost_perf_report_2107.pdf)
## Release 21.04
- [SPDK 21.04 NVMe Bdev Performance Report](https://ci.spdk.io/download/performance-reports/SPDK_nvme_bdev_perf_report_2104.pdf)
- [SPDK 21.04 NVMe-oF TCP Performance Report](https://ci.spdk.io/download/performance-reports/SPDK_tcp_perf_report_2104.pdf)
- [SPDK 21.04 NVMe-oF RDMA Performance Report](https://ci.spdk.io/download/performance-reports/SPDK_rdma_perf_report_2104.pdf)
- [SPDK 21.04 Vhost Performance Report](https://ci.spdk.io/download/performance-reports/SPDK_vhost_perf_report_2104.pdf)
## Release 21.01
- [SPDK 21.01 NVMe Bdev Performance Report](https://ci.spdk.io/download/performance-reports/SPDK_nvme_bdev_perf_report_2101.pdf)

View File

@ -8,21 +8,21 @@ when SPDK adds or modifies library dependencies.
If your application is using the SPDK nvme library, you would use the following
to get the list of required SPDK libraries:
~~~
~~~bash
PKG_CONFIG_PATH=/path/to/spdk/build/lib/pkgconfig pkg-config --libs spdk_nvme
~~~
To get the list of required SPDK and DPDK libraries to use the DPDK-based
environment layer:
~~~
~~~bash
PKG_CONFIG_PATH=/path/to/spdk/build/lib/pkgconfig pkg-config --libs spdk_env_dpdk
~~~
When linking with static libraries, the dependent system libraries must also be
specified. To get the list of required system libraries:
~~~
~~~bash
PKG_CONFIG_PATH=/path/to/spdk/build/lib/pkgconfig pkg-config --libs spdk_syslibs
~~~
@ -33,7 +33,7 @@ the `-Wl,--no-as-needed` parameters while with static libraries `-Wl,--whole-arc
is used. Here is an example Makefile snippet that shows how to use pkg-config to link
an application that uses the SPDK nvme shared library:
~~~
~~~bash
PKG_CONFIG_PATH = $(SPDK_DIR)/build/lib/pkgconfig
SPDK_LIB := $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" pkg-config --libs spdk_nvme
DPDK_LIB := $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" pkg-config --libs spdk_env_dpdk
@ -44,7 +44,7 @@ app:
If using the SPDK nvme static library:
~~~
~~~bash
PKG_CONFIG_PATH = $(SPDK_DIR)/build/lib/pkgconfig
SPDK_LIB := $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" pkg-config --libs spdk_nvme
DPDK_LIB := $(shell PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" pkg-config --libs spdk_env_dpdk

View File

@ -18,4 +18,6 @@ a new version of the *env* library. The new implementation can be
integrated into the SPDK build by updating the following line
in CONFIG:
CONFIG_ENV?=$(SPDK_ROOT_DIR)/lib/env_dpdk
```bash
CONFIG_ENV?=$(SPDK_ROOT_DIR)/lib/env_dpdk
```

View File

@ -1,10 +1,10 @@
# RPMs {#rpms}
# In this document {#rpms_toc}
## In this document {#rpms_toc}
* @ref building_rpms
# Building SPDK RPMs {#building_rpms}
## Building SPDK RPMs {#building_rpms}
To build basic set of RPM packages out of the SPDK repo simply run:

View File

@ -1,13 +1,13 @@
# shfmt {#shfmt}
# In this document {#shfmt_toc}
## In this document {#shfmt_toc}
* @ref shfmt_overview
* @ref shfmt_usage
* @ref shfmt_installation
* @ref shfmt_examples
# Overview {#shfmt_overview}
## Overview {#shfmt_overview}
The majority of tests (and scripts overall) in the SPDK repo are written
in Bash (with a quite significant emphasis on "Bashism"), thus a style
@ -15,7 +15,7 @@ formatter, shfmt, was introduced to help keep the .sh code consistent
across the entire repo. For more details on the tool itself, please see
[shfmt](https://github.com/mvdan/sh).
# Usage {#shfmt_usage}
## Usage {#shfmt_usage}
On the CI pool, the shfmt is run against all the updated .sh files that
have been committed but not merged yet. Additionally, shfmt will pick
@ -36,7 +36,7 @@ Please, see ./scripts/check_format.sh for all the arguments the shfmt
is run with. Additionally, @ref shfmt_examples has more details on how
each of the arguments behave.
# Installation {#shfmt_installation}
## Installation {#shfmt_installation}
The shfmt can be easily installed via pkgdep.sh:
@ -55,7 +55,7 @@ SHFMT_DIR_OUT=/and_link_it_here \
./scripts/pkgdep.sh -d
~~~
# Examples {#shfmt_examples}
## Examples {#shfmt_examples}
~~~{.sh}
#######################################

View File

@ -1,10 +1,22 @@
# spdk_top {#spdk_top}
The spdk_top application is designed to resemble the standard top in that it provides a real-time insights into CPU cores usage by SPDK lightweight threads and pollers. Have you ever wondered which CPU core is used most by your SPDK instance? Are you building your own bdev or library and want to know if your code is running efficiently? Are your new pollers busy most of the time? The spdk_top application uses RPC calls to collect performance metrics and displays them in a report that you can analyze and determine if your code is running efficiently so that you can tune your implementation and get more from SPDK.
The spdk_top application is designed to resemble the standard top in that it provides a real-time insights into CPU cores usage by SPDK
lightweight threads and pollers. Have you ever wondered which CPU core is used most by your SPDK instance? Are you building your own bdev
or library and want to know if your code is running efficiently? Are your new pollers busy most of the time? The spdk_top application uses
RPC calls to collect performance metrics and displays them in a report that you can analyze and determine if your code is running efficiently
so that you can tune your implementation and get more from SPDK.
Why doesn't the classic top utility work for SPDK? SPDK uses a polled-mode design; a reactor thread running on each CPU core assigned to an SPDK application schedules SPDK lightweight threads and pollers to run on the CPU core. Therefore, the standard Linux top utility is not effective for analyzing the CPU usage for polled-mode applications like SPDK because it just reports that they are using 100% of the CPU resources assigned to them. The spdk_top utility was developed to analyze and report the CPU cycles used to do real work vs just polling for work. The utility relies on instrumentation added to pollers to track when they are doing work vs. polling for work. The spdk_top utility gets the fine grained metrics from the pollers, analyzes and report the metrics on a per poller, thread and core basis. This information enables users to identify CPU cores that are busy doing real work so that they can determine if the application needs more or less CPU resources.
Why doesn't the classic top utility work for SPDK? SPDK uses a polled-mode design; a reactor thread running on each CPU core assigned to
an SPDK application schedules SPDK lightweight threads and pollers to run on the CPU core. Therefore, the standard Linux top utility is
not effective for analyzing the CPU usage for polled-mode applications like SPDK because it just reports that they are using 100% of the
CPU resources assigned to them. The spdk_top utility was developed to analyze and report the CPU cycles used to do real work vs just
polling for work. The utility relies on instrumentation added to pollers to track when they are doing work vs. polling for work. The
spdk_top utility gets the fine grained metrics from the pollers, analyzes and report the metrics on a per poller, thread and core basis.
This information enables users to identify CPU cores that are busy doing real work so that they can determine if the application
needs more or less CPU resources.
## Run spdk_top
# Run spdk_top
Before running spdk_top you need to run the SPDK application whose performance you want to analyze using spdk_top.
Run the spdk_top application
@ -13,19 +25,19 @@ Run the spdk_top application
./build/bin/spdk_top
~~~
# Bottom menu
## Bottom menu
Menu at the bottom of SPDK top window shows many options for changing displayed data. Each menu item has a key associated with it in square brackets.
* Quit - quits the SPDK top application.
* TAB selection - allows to select THREADS/POLLERS/CORES tabs.
* Previous page/Next page - scrolls up/down to the next set of rows displayed. Indicator in the bottom-left corner shows current page and number of all available pages.
* Columns - enables/disables chosen columns in a column pop-up window.
* Sorting - allows to sort displayed data by column in a sorting pop-up.
* Refresh rate - takes user input from 0 to 255 and changes refresh rate to that value in seconds.
* Switch tab - allows to select THREADS/POLLERS/CORES tabs.
* Previous page/Next page - scrolls up/down to the next set of rows displayed. Indicator in the bottom-left corner shows current page and number
of all available pages.
* Item details - displays details pop-up window for highlighted data row. Selection is changed by pressing UP and DOWN arrow keys.
* Total/Interval - changes displayed values in all tabs to either Total time (measured since start of SPDK application) or Interval time (measured since last refresh).
* Help - displays help pop-up window.
## Threads Tab
# Threads Tab
The threads tab displays a line item for each spdk thread. The information displayed shows:
* Thread name - name of SPDK thread.
@ -34,12 +46,14 @@ The threads tab displays a line item for each spdk thread. The information displ
* Idle/Busy - how many microseconds the thread was idle/busy.
\n
By pressing ENTER key a pop-up window appears, showing above and a list of pollers running on selected thread (with poller name, type, run count and period).
By pressing ENTER key a pop-up window appears, showing above and a list of pollers running on selected
thread (with poller name, type, run count and period).
Pop-up then can be closed by pressing ESC key.
To learn more about spdk threads see @ref concurrency.
# Pollers Tab
## Pollers Tab
The pollers tab displays a line item for each poller. The information displayed shows:
* Poller name - name of currently selected poller.
@ -53,13 +67,20 @@ The pollers tab displays a line item for each poller. The information displayed
Poller pop-up window can be displayed by pressing ENTER on a selected data row and displays above information.
Pop-up can be closed by pressing ESC key.
# Cores Tab
## Cores Tab
The cores tab provides insights into how the application is using the CPU cores assigned to it. The information displayed for each core shows:
* Core - core number.
* Thread count - number of threads currently running on core.
* Poller count - total number of pollers running on core.
* Idle/Busy - how many microseconds core was idle (including time when core ran pollers but did not find any work) or doing actual work.
* Intr - whether this core is in interrupt mode or not.
\n
Pressing ENTER key makes a pop-up window appear, showing above information, along with a list of threads running on selected core. Cores details window allows to select a thread and display thread details pop-up on top of it. To close both pop-ups use ESC key.
Pressing ENTER key makes a pop-up window appear, showing above information, along with a list of threads running on selected core. Cores details
window allows to select a thread and display thread details pop-up on top of it. To close both pop-ups use ESC key.
## Help Window
Help window pop-up can be invoked by pressing H key inside any tab. It contains explanations for each key used inside the spdk_top application.

View File

@ -7,21 +7,21 @@ This experimental version was added for v18.04 to get early feedback
that can be incorporated as spdkcli becomes more fully-featured
for the next SPDK release.
### Install needed dependencies
## Install needed dependencies
All dependencies should be handled by scripts/pkgdep.sh script.
Package dependencies at the moment include:
- configshell
- configshell
### Run SPDK application instance
## Run SPDK application instance
~~~{.sh}
./scripts/setup.sh
./build/bin/vhost -c vhost.json
~~~
### Run SPDK CLI
## Run SPDK CLI
Spdkcli should be run with the same privileges as SPDK application.
In order to use SPDK CLI in interactive mode please use:
@ -33,11 +33,11 @@ Use "help" command to get a list of available commands for each tree node.
It is also possible to use SPDK CLI to run just a single command,
just use the command as an argument to the application.
For example, to view current configuration and immediately exit:
~~~{.sh}
~~~{.sh}
scripts/spdkcli.py ls
~~~
### Optional - create Python virtual environment
## Optional - create Python virtual environment
You can use Python virtual environment if you don't want to litter your
system Python installation.

View File

@ -2,7 +2,7 @@
This system configuration guide describes how to configure a system for use with SPDK.
# IOMMU configuration {#iommu_config}
## IOMMU configuration {#iommu_config}
An IOMMU may be present and enabled on many platforms. When an IOMMU is present and enabled, it is
recommended that SPDK applications are deployed with the `vfio-pci` kernel driver. SPDK's
@ -21,7 +21,7 @@ version they are using has a bug where `uio_pci_generic` [fails to bind to NVMe
In these cases, users can build the `igb_uio` kernel module which can be found in dpdk-kmods repository.
To ensure that the driver is properly bound, users should specify `DRIVER_OVERRIDE=/path/to/igb_uio.ko`.
# Running SPDK as non-priviledged user {#system_configuration_nonroot}
## Running SPDK as non-priviledged user {#system_configuration_nonroot}
One of the benefits of using the `VFIO` Linux kernel driver is the ability to
perform DMA operations with peripheral devices as unprivileged user. The
@ -29,7 +29,7 @@ permissions to access particular devices still need to be granted by the system
administrator, but only on a one-time basis. Note that this functionality
is supported with DPDK starting from version 18.11.
## Hugetlbfs access
### Hugetlbfs access
Make sure the target user has RW access to at least one hugepage mount.
A good idea is to create a new mount specifically for SPDK:
@ -44,7 +44,7 @@ Then start SPDK applications with an additional parameter `--huge-dir /mnt/spdk_
Full guide on configuring hugepage mounts is available in the
[Linux Hugetlbpage Documentation](https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt)
## Device access {#system_configuration_nonroot_device_access}
### Device access {#system_configuration_nonroot_device_access}
`VFIO` device access is protected with sysfs file permissions and can be
configured with chown/chmod.
@ -62,7 +62,7 @@ Let's assume we want to use PCI device `0000:04:00.0`. First of all, verify
that it has an IOMMU group assigned:
~~~{.sh}
$ readlink "/sys/bus/pci/devices/0000:00:04.0/iommu_group"
readlink "/sys/bus/pci/devices/0000:00:04.0/iommu_group"
~~~
The output should be e.g.
@ -86,7 +86,7 @@ devices, use the following:
# chown spdk /dev/vfio/5
~~~
## Memory constraints {#system_configuration_nonroot_memory_constraints}
### Memory constraints {#system_configuration_nonroot_memory_constraints}
As soon as the first device is attached to SPDK, all of SPDK memory will be
mapped to the IOMMU through the VFIO APIs. VFIO will try to mlock that memory and
@ -100,7 +100,7 @@ The limit can be checked by running the following command as target user:
(output in kilobytes)
~~~{.sh}
$ ulimit -l
ulimit -l
~~~
On Ubuntu 18.04 this returns 16384 (16MB) by default, which is way below
@ -111,18 +111,18 @@ try to map not only its reserved hugepages, but also all the memory that's
shared by its vhost clients as described in the
[Vhost processing guide](https://spdk.io/doc/vhost_processing.html#vhost_processing_init).
### Increasing the memlock limit permanently
#### Increasing the memlock limit permanently
Open the `/etc/security/limits.conf` file as root and append the following:
```
```bash
spdk hard memlock unlimited
spdk soft memlock unlimited
```
Then logout from the target user account. The changes will take effect after the next login.
### Increasing the memlock for a specific process
#### Increasing the memlock for a specific process
Linux offers a `prlimit` utility that can override limits of any given process.
On Ubuntu, it is a part of the `util-linux` package.

View File

@ -1,6 +1,6 @@
# ComponentName Programmer's Guide {#componentname_pg}
# In this document {#componentname_pg_toc}
## In this document {#componentname_pg_toc}
@ref componentname_pg_audience
@ref componentname_pg_intro

200
doc/usdt.md Normal file
View File

@ -0,0 +1,200 @@
# Userspace DTrace (USDT) {#usdt}
## Package Dependencies
These dependencies are needed for building bpftrace and
the sys/sdt.h header file that SPDK libraries will include
for DTRACE_PROBE macro definitions.
Fedora:
libbpf
gtest-devel
gmock-devel
bcc-devel
systemtap-sdt-devel
llvm-devel
bison
flex
Ubuntu:
systemtap-sdt-dev
libbpfcc-dev
libclang-7-dev
bison
flex
## Building bpftrace
We have found issues with the packaged bpftrace on both Ubuntu 20.04
and Fedora 33. So bpftrace should be built and installed from source.
```bash
git clone https://github.com/iovisor/bpftrace.git
mkdir bpftrace/build
cd bpftrace/build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
```
## bpftrace.sh
bpftrace.sh is a helper script that facilitates running bpftrace scripts
against a running SPDK application. Here is a typical usage:
```bash
scripts/bpftrace.sh `pidof spdk_tgt` scripts/bpf/nvmf.bt
```
Attaching to USDT probes requires the full path of the binary in the
probe description. SPDK bpftrace scripts can be written with an __EXE__
marker instead of a full path name, and bpftrace.sh will dynamically
replace that string with the full path name using information from procfs.
It is also useful to filter certain kernel events (such as system calls)
based on the PID of the SPDK application. SPDK bpftrace scripts can be
written with a __PID__ marker, and bpftrace.sh will dynamically replace
that string with the PID provided to the script.
## Configuring SPDK Build
```bash
./configure --with-usdt
```
## Start SPDK application and bpftrace script
From first terminal:
```bash
build/bin/spdk_tgt -m 0xC
```
From second terminal:
```bash
scripts/bpftrace.sh `pidof spdk_tgt` scripts/bpf/nvmf.bt
```
nvmf.bt will print information about nvmf subsystem and poll
group info state transitions.
From third terminal:
```bash
scripts/rpc.py <<EOF
nvmf_create_transport -t tcp
nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001 -m 10
nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t tcp -a 127.0.0.1 -s 4420
bdev_null_create null0 1000 512
nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 null0
EOF
```
This creates the nvmf tcp transport, a new nvmf subsystem that listens on a tcp
port, and a null bdev which is added as a namespace to the new nvmf subsystem.
You will see output from the second terminal that looks like this:
```bash
2110.935735: nvmf_tgt reached state NONE
2110.954316: nvmf_tgt reached state CREATE_TARGET
2110.967905: nvmf_tgt reached state CREATE_POLL_GROUPS
2111.235982: nvmf_tgt reached state START_SUBSYSTEMS
2111.253560: nqn.2014-08.org.nvmexpress.discovery change state from INACTIVE to ACTIVE start
2111.260278: nqn.2014-08.org.nvmexpress.discovery on thread 2 state to ACTIVE start
2111.264281: nqn.2014-08.org.nvmexpress.discovery on thread 2 state to ACTIVE done
2111.284083: nqn.2014-08.org.nvmexpress.discovery change state from INACTIVE to ACTIVE done
2111.289197: nvmf_tgt reached state RUNNING
2111.271573: nqn.2014-08.org.nvmexpress.discovery on thread 3 state to ACTIVE start
2111.279787: nqn.2014-08.org.nvmexpress.discovery on thread 3 state to ACTIVE done
2189.921492: nqn.2016-06.io.spdk:cnode1 change state from INACTIVE to ACTIVE start
2189.952508: nqn.2016-06.io.spdk:cnode1 on thread 2 state to ACTIVE start
2189.959125: nqn.2016-06.io.spdk:cnode1 on thread 2 state to ACTIVE done
2190.005832: nqn.2016-06.io.spdk:cnode1 change state from INACTIVE to ACTIVE done
2189.969058: nqn.2016-06.io.spdk:cnode1 on thread 3 state to ACTIVE start
2189.999889: nqn.2016-06.io.spdk:cnode1 on thread 3 state to ACTIVE done
2197.859104: nqn.2016-06.io.spdk:cnode1 change state from ACTIVE to PAUSED start
2197.879199: nqn.2016-06.io.spdk:cnode1 on thread 2 state to PAUSED start
2197.883416: nqn.2016-06.io.spdk:cnode1 on thread 2 state to PAUSED done
2197.902291: nqn.2016-06.io.spdk:cnode1 change state from ACTIVE to PAUSED done
2197.908939: nqn.2016-06.io.spdk:cnode1 change state from PAUSED to ACTIVE start
2197.912644: nqn.2016-06.io.spdk:cnode1 on thread 2 state to ACTIVE start
2197.927409: nqn.2016-06.io.spdk:cnode1 on thread 2 state to ACTIVE done
2197.949742: nqn.2016-06.io.spdk:cnode1 change state from PAUSED to ACTIVE done
2197.890812: nqn.2016-06.io.spdk:cnode1 on thread 3 state to PAUSED start
2197.897233: nqn.2016-06.io.spdk:cnode1 on thread 3 state to PAUSED done
2197.931278: nqn.2016-06.io.spdk:cnode1 on thread 3 state to ACTIVE start
2197.946124: nqn.2016-06.io.spdk:cnode1 on thread 3 state to ACTIVE done
2205.859904: nqn.2016-06.io.spdk:cnode1 change state from ACTIVE to PAUSED start
2205.891392: nqn.2016-06.io.spdk:cnode1 on thread 2 state to PAUSED start
2205.896588: nqn.2016-06.io.spdk:cnode1 on thread 2 state to PAUSED done
2205.920133: nqn.2016-06.io.spdk:cnode1 change state from ACTIVE to PAUSED done
2205.905900: nqn.2016-06.io.spdk:cnode1 on thread 3 state to PAUSED start
2205.914856: nqn.2016-06.io.spdk:cnode1 on thread 3 state to PAUSED done
2206.091084: nqn.2016-06.io.spdk:cnode1 change state from PAUSED to ACTIVE start
2206.099222: nqn.2016-06.io.spdk:cnode1 on thread 2 state to ACTIVE start
2206.105445: nqn.2016-06.io.spdk:cnode1 on thread 2 state to ACTIVE done
2206.119271: nqn.2016-06.io.spdk:cnode1 change state from PAUSED to ACTIVE done
2206.109144: nqn.2016-06.io.spdk:cnode1 on thread 3 state to ACTIVE start
2206.115636: nqn.2016-06.io.spdk:cnode1 on thread 3 state to ACTIVE done
```
Now stop the bpftrace.sh running in the second terminal, and start
it again with the send_msg.bt script. This script keeps a count of
functions executed as part of an spdk_for_each_channel or
spdk_thread_send_msg function call.
```bash
scripts/bpftrace.sh `pidof spdk_tgt` scripts/bpf/send_msg.bt
```
From the third terminal, create another null bdev and add it as a
namespace to the cnode1 subsystem.
```bash
scripts/rpc.py <<EOF
bdev_null_create null1 1000 512
nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 null1
EOF
```
Now Ctrl-C the bpftrace.sh in the second terminal, and it will
print the final results of the maps.
```bash
@for_each_channel[subsystem_state_change_on_pg]: 2
@send_msg[_finish_unregister]: 1
@send_msg[_call_completion]: 2
@send_msg[put_io_channel]: 4
@send_msg[_call_channel]: 4
```
## TODOs and known limitations
- add definitions for common nvmf data structures - then we can pass the subsystem pointer
itself as a probe parameter and let the script decide which fields it wants to access
(Note: these would need to be kept up-to-date with the C definitions of the struct - it is
not possible to include the header files in a bpftrace script)
- investigate using pahole to generate data structure definitions that can be included in
bpftrace scripts; this would allow us to pass the subsystem pointer itself as a probe
argument, and let the script decide which fields it wants to access; for example,
`pahole -E -C spdk_nvmf_subsystem build/bin/spdk_tgt` gets us close to what we need,
but there are some limiters:
- our structures have char arrays (not char pointers) for things like subnqn; large
arrays like these cannot currently be passed to bpftrace printf without generating
a stack space error (probe points are limited to 512 bytes of stack); we could
modify SPDK to have the char array for storage, and a char pointer that points to
that storage, the latter could easily then be used in bpftrace scripts
- our structures include fields with their enum types instead of int; bpftrace will
complain it does not know about the enum (pahole doesn't print out enum
descriptions); information on enums can be found in the applications .debug_info
section, but we would need something that can convert that into a file we can
include in a bpftrace script
- Note that bpftrace prints are not always printed in exact chronological order; this can
be seen especially with spdk_for_each_channel iterations, where we execute trace points
on multiple threads in a very short period of time, and those may not get printed to the
console in exact order; this is why the nvmf.bt script prints out a msec.nsec timestamp
so that the user can understand the ordering and even pipe through sort if desired
- flesh out more DTrace probes in the nvmf code

View File

@ -11,3 +11,4 @@
- @subpage blobfs
- @subpage jsonrpc
- @subpage jsonrpc_proxy
- @subpage usdt

View File

@ -1,6 +1,6 @@
# User Space Drivers {#userspace}
# Controlling Hardware From User Space {#userspace_control}
## Controlling Hardware From User Space {#userspace_control}
Much of the documentation for SPDK talks about _user space drivers_, so it's
important to understand what that means at a technical level. First and
@ -53,7 +53,7 @@ with the
[NVMe Specification](http://nvmexpress.org/wp-content/uploads/NVM_Express_Revision_1.3.pdf)
to initialize the device, create queue pairs, and ultimately send I/O.
# Interrupts {#userspace_interrupts}
## Interrupts {#userspace_interrupts}
SPDK polls devices for completions instead of waiting for interrupts. There
are a number of reasons for doing this: 1) practically speaking, routing an
@ -69,7 +69,7 @@ technologies such as Intel's
will ensure that the host memory being checked is present in the CPU cache
after an update by the device.
# Threading {#userspace_threading}
## Threading {#userspace_threading}
NVMe devices expose multiple queues for submitting requests to the hardware.
Separate queues can be accessed without coordination, so software can send

View File

@ -1,6 +1,6 @@
# Vagrant Development Environment {#vagrant}
# Introduction {#vagrant_intro}
## Introduction {#vagrant_intro}
[Vagrant](https://www.vagrantup.com/) provides a quick way to get a basic
NVMe enabled virtual machine sandbox running without the need for any
@ -22,7 +22,7 @@ vagrant plugin install vagrant-proxyconf
In case you want use kvm/libvirt you should also install `vagrant-libvirt`
# VM Configuration {#vagrant_config}
## VM Configuration {#vagrant_config}
To create a configured VM with vagrant you need to run `create_vbox.sh` script.
@ -47,7 +47,7 @@ world example application.
vagrant --help
~~~
# Running An Example {#vagrant_example}
## Running An Example {#vagrant_example}
The following shows sample output from starting up a Ubuntu18 VM,
compiling SPDK on it and running the NVMe sample application `hello_world`.

View File

@ -1,6 +1,6 @@
# vhost Target {#vhost}
# Table of Contents {#vhost_toc}
## Table of Contents {#vhost_toc}
- @ref vhost_intro
- @ref vhost_prereqs
@ -11,7 +11,7 @@
- @ref vhost_advanced_topics
- @ref vhost_bugs
# Introduction {#vhost_intro}
## Introduction {#vhost_intro}
A vhost target provides a local storage service as a process running on a local machine.
It is capable of exposing virtualized block devices to QEMU instances or other arbitrary
@ -28,12 +28,12 @@ techniques as other components in SPDK. Since SPDK is polling for vhost submiss
it can signal the VM to skip notifications on submission. This avoids VMEXITs on I/O
submission and can significantly reduce CPU usage in the VM on heavy I/O workloads.
# Prerequisites {#vhost_prereqs}
## Prerequisites {#vhost_prereqs}
This guide assumes the SPDK has been built according to the instructions in @ref
getting_started. The SPDK vhost target is built with the default configure options.
## Vhost Command Line Parameters {#vhost_cmd_line_args}
### Vhost Command Line Parameters {#vhost_cmd_line_args}
Additional command line flags are available for Vhost target.
@ -41,7 +41,7 @@ Param | Type | Default | Description
-------- | -------- | ---------------------- | -----------
-S | string | $PWD | directory where UNIX domain sockets will be created
## Supported Guest Operating Systems
### Supported Guest Operating Systems
The guest OS must contain virtio-scsi or virtio-blk drivers. Most Linux and FreeBSD
distributions include virtio drivers.
@ -49,7 +49,7 @@ distributions include virtio drivers.
installed separately. The SPDK vhost target has been tested with recent versions of Ubuntu,
Fedora, and Windows
## QEMU
### QEMU
Userspace vhost-scsi target support was added to upstream QEMU in v2.10.0. Run
the following command to confirm your QEMU supports userspace vhost-scsi.
@ -74,7 +74,7 @@ Run the following command to confirm your QEMU supports userspace vhost-nvme.
qemu-system-x86_64 -device vhost-user-nvme,help
~~~
# Starting SPDK vhost target {#vhost_start}
## Starting SPDK vhost target {#vhost_start}
First, run the SPDK setup.sh script to setup some hugepages for the SPDK vhost target
application. This will allocate 4096MiB (4GiB) of hugepages, enough for the SPDK
@ -100,9 +100,9 @@ To list all available vhost options use the following command.
build/bin/vhost -h
~~~
# SPDK Configuration {#vhost_config}
## SPDK Configuration {#vhost_config}
## Create bdev (block device) {#vhost_bdev_create}
### Create bdev (block device) {#vhost_bdev_create}
SPDK bdevs are block devices which will be exposed to the guest OS.
For vhost-scsi, bdevs are exposed as SCSI LUNs on SCSI devices attached to the
@ -121,9 +121,9 @@ will create a 64MB malloc bdev with 512-byte block size.
scripts/rpc.py bdev_malloc_create 64 512 -b Malloc0
~~~
## Create a vhost device {#vhost_vdev_create}
### Create a vhost device {#vhost_vdev_create}
### Vhost-SCSI
#### Vhost-SCSI
The following RPC will create a vhost-scsi controller which can be accessed
by QEMU via /var/tmp/vhost.0. At the time of creation the controller will be
@ -152,7 +152,7 @@ To remove a bdev from a vhost-scsi controller use the following RPC:
scripts/rpc.py vhost_scsi_controller_remove_target vhost.0 0
~~~
### Vhost-BLK
#### Vhost-BLK
The following RPC will create a vhost-blk device exposing Malloc0 bdev.
The device will be accessible to QEMU via /var/tmp/vhost.1. All the I/O polling
@ -171,7 +171,7 @@ extra `-r` or `--readonly` parameter.
scripts/rpc.py vhost_create_blk_controller --cpumask 0x1 -r vhost.1 Malloc0
~~~
## QEMU {#vhost_qemu_config}
### QEMU {#vhost_qemu_config}
Now the virtual machine can be started with QEMU. The following command-line
parameters must be added to connect the virtual machine to its vhost controller.
@ -195,21 +195,21 @@ SPDK malloc block device by specifying bootindex=0 for the boot image.
Finally, specify the SPDK vhost devices:
### Vhost-SCSI
#### Vhost-SCSI
~~~{.sh}
-chardev socket,id=char0,path=/var/tmp/vhost.0
-device vhost-user-scsi-pci,id=scsi0,chardev=char0
~~~
### Vhost-BLK
#### Vhost-BLK
~~~{.sh}
-chardev socket,id=char1,path=/var/tmp/vhost.1
-device vhost-user-blk-pci,id=blk0,chardev=char1
~~~
## Example output {#vhost_example}
### Example output {#vhost_example}
This example uses an NVMe bdev alongside Mallocs. SPDK vhost application is started
on CPU cores 0 and 1, QEMU on cores 2 and 3.
@ -280,9 +280,9 @@ host:~# taskset -c 2,3 qemu-system-x86_64 \
-drive file=guest_os_image.qcow2,if=none,id=disk \
-device ide-hd,drive=disk,bootindex=0 \
-chardev socket,id=spdk_vhost_scsi0,path=/var/tmp/vhost.0 \
-device vhost-user-scsi-pci,id=scsi0,chardev=spdk_vhost_scsi0,num_queues=4 \
-device vhost-user-scsi-pci,id=scsi0,chardev=spdk_vhost_scsi0,num_queues=2 \
-chardev socket,id=spdk_vhost_blk0,path=/var/tmp/vhost.1 \
-device vhost-user-blk-pci,chardev=spdk_vhost_blk0,num-queues=4
-device vhost-user-blk-pci,chardev=spdk_vhost_blk0,num-queues=2
~~~
Please note the following two commands are run on the guest VM.
@ -310,9 +310,9 @@ vhost.c:1006:session_shutdown: *NOTICE*: Exiting
We can see that `sdb` and `sdc` are SPDK vhost-scsi LUNs, and `vda` is SPDK a
vhost-blk disk.
# Advanced Topics {#vhost_advanced_topics}
## Advanced Topics {#vhost_advanced_topics}
## Multi-Queue Block Layer (blk-mq) {#vhost_multiqueue}
### Multi-Queue Block Layer (blk-mq) {#vhost_multiqueue}
For best performance use the Linux kernel block multi-queue feature with vhost.
To enable it on Linux, it is required to modify kernel options inside the
@ -331,7 +331,11 @@ to set `num_queues=4` to saturate physical device. Adding too many queues might
vhost performance degradation if many vhost devices are used because each device will require
additional `num_queues` to be polled.
## Hot-attach/hot-detach {#vhost_hotattach}
Some Linux distributions report a kernel panic when starting the VM if the number of I/O queues
specified via the `num-queues` parameter is greater than number of vCPUs. If you need to use
more I/O queues than vCPUs, check that your OS image supports that configuration.
### Hot-attach/hot-detach {#vhost_hotattach}
Hotplug/hotremove within a vhost controller is called hot-attach/detach. This is to
distinguish it from SPDK bdev hotplug/hotremove. E.g. if an NVMe bdev is attached
@ -344,7 +348,7 @@ to hot-attach/detach the bdev from a Vhost-BLK device. If Vhost-BLK device expos
an NVMe bdev that is hotremoved, all the I/O traffic on that Vhost-BLK device will
be aborted - possibly flooding a VM with syslog warnings and errors.
### Hot-attach
#### Hot-attach
Hot-attach is done by simply attaching a bdev to a vhost controller with a QEMU VM
already started. No other extra action is necessary.
@ -353,7 +357,7 @@ already started. No other extra action is necessary.
scripts/rpc.py vhost_scsi_controller_add_target vhost.0 0 Malloc0
~~~
### Hot-detach
#### Hot-detach
Just like hot-attach, the hot-detach is done by simply removing bdev from a controller
when QEMU VM is already started.
@ -368,22 +372,22 @@ Removing an entire bdev will hot-detach it from a controller as well.
scripts/rpc.py bdev_malloc_delete Malloc0
~~~
# Known bugs and limitations {#vhost_bugs}
## Known bugs and limitations {#vhost_bugs}
## Vhost-NVMe (experimental) can only be supported with latest Linux kernel
### Vhost-NVMe (experimental) can only be supported with latest Linux kernel
Vhost-NVMe target was designed for one new feature of NVMe 1.3 specification, Doorbell
Buffer Config Admin command, which is used for emulated NVMe controller only. Linux 4.12
added this feature, so a new Guest kernel later than 4.12 is required to test this feature.
## Windows virtio-blk driver before version 0.1.130-1 only works with 512-byte sectors
### Windows virtio-blk driver before version 0.1.130-1 only works with 512-byte sectors
The Windows `viostor` driver before version 0.1.130-1 is buggy and does not
correctly support vhost-blk devices with non-512-byte block size.
See the [bug report](https://bugzilla.redhat.com/show_bug.cgi?id=1411092) for
more information.
## QEMU vhost-user-blk
### QEMU vhost-user-blk
QEMU [vhost-user-blk](https://git.qemu.org/?p=qemu.git;a=commit;h=00343e4b54ba) is
supported from version 2.12.

View File

@ -1,6 +1,6 @@
# Virtualized I/O with Vhost-user {#vhost_processing}
# Table of Contents {#vhost_processing_toc}
## Table of Contents {#vhost_processing_toc}
- @ref vhost_processing_intro
- @ref vhost_processing_qemu
@ -8,7 +8,7 @@
- @ref vhost_processing_io_path
- @ref vhost_spdk_optimizations
# Introduction {#vhost_processing_intro}
## Introduction {#vhost_processing_intro}
This document is intended to provide an overview of how Vhost works behind the
scenes. Code snippets used in this document might have been simplified for the
@ -18,12 +18,10 @@ reference.
Reading from the
[Virtio specification](http://docs.oasis-open.org/virtio/virtio/v1.0/virtio-v1.0.html):
```
The purpose of virtio and [virtio] specification is that virtual environments
and guests should have a straightforward, efficient, standard and extensible
mechanism for virtual devices, rather than boutique per-environment or per-OS
mechanisms.
```
> The purpose of virtio and [virtio] specification is that virtual environments
> and guests should have a straightforward, efficient, standard and extensible
> mechanism for virtual devices, rather than boutique per-environment or per-OS
> mechanisms.
Virtio devices use virtqueues to transport data efficiently. Virtqueue is a set
of three different single-producer, single-consumer ring structures designed to
@ -47,28 +45,26 @@ SPDK to expose a vhost device is Vhost-user protocol.
The [Vhost-user specification](https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/interop/vhost-user.txt;hb=HEAD)
describes the protocol as follows:
```
[Vhost-user protocol] is aiming to complement the ioctl interface used to
control the vhost implementation in the Linux kernel. It implements the control
plane needed to establish virtqueue sharing with a user space process on the
same host. It uses communication over a Unix domain socket to share file
descriptors in the ancillary data of the message.
The protocol defines 2 sides of the communication, master and slave. Master is
the application that shares its virtqueues, in our case QEMU. Slave is the
consumer of the virtqueues.
In the current implementation QEMU is the Master, and the Slave is intended to
be a software Ethernet switch running in user space, such as Snabbswitch.
Master and slave can be either a client (i.e. connecting) or server (listening)
in the socket communication.
```
> [Vhost-user protocol] is aiming to complement the ioctl interface used to
> control the vhost implementation in the Linux kernel. It implements the control
> plane needed to establish virtqueue sharing with a user space process on the
> same host. It uses communication over a Unix domain socket to share file
> descriptors in the ancillary data of the message.
>
> The protocol defines 2 sides of the communication, master and slave. Master is
> the application that shares its virtqueues, in our case QEMU. Slave is the
> consumer of the virtqueues.
>
> In the current implementation QEMU is the Master, and the Slave is intended to
> be a software Ethernet switch running in user space, such as Snabbswitch.
>
> Master and slave can be either a client (i.e. connecting) or server (listening)
> in the socket communication.
SPDK vhost is a Vhost-user slave server. It exposes Unix domain sockets and
allows external applications to connect.
# QEMU {#vhost_processing_qemu}
## QEMU {#vhost_processing_qemu}
One of major Vhost-user use cases is networking (DPDK) or storage (SPDK)
offload in QEMU. The following diagram presents how QEMU-based VM
@ -76,7 +72,7 @@ communicates with SPDK Vhost-SCSI device.
![QEMU/SPDK vhost data flow](img/qemu_vhost_data_flow.svg)
# Device initialization {#vhost_processing_init}
## Device initialization {#vhost_processing_init}
All initialization and management information is exchanged using Vhost-user
messages. The connection always starts with the feature negotiation. Both
@ -90,13 +86,13 @@ physically-discontiguous regions and Vhost-user specification puts a limit on
their number - currently 8. The driver sends a single message for each region with
the following data:
* file descriptor - for mmap
* user address - for memory translations in Vhost-user messages (e.g.
translating vring addresses)
* guest address - for buffers addresses translations in vrings (for QEMU this
is a physical address inside the guest)
* user offset - positive offset for the mmap
* size
- file descriptor - for mmap
- user address - for memory translations in Vhost-user messages (e.g.
translating vring addresses)
- guest address - for buffers addresses translations in vrings (for QEMU this
is a physical address inside the guest)
- user offset - positive offset for the mmap
- size
The Master will send new memory regions after each memory change - usually
hotplug/hotremove. The previous mappings will be removed.
@ -108,24 +104,24 @@ as they use common SCSI I/O to inquiry the underlying disk(s).
Afterwards, the driver requests the number of maximum supported queues and
starts sending virtqueue data, which consists of:
* unique virtqueue id
* index of the last processed vring descriptor
* vring addresses (from user address space)
* call descriptor (for interrupting the driver after I/O completions)
* kick descriptor (to listen for I/O requests - unused by SPDK)
- unique virtqueue id
- index of the last processed vring descriptor
- vring addresses (from user address space)
- call descriptor (for interrupting the driver after I/O completions)
- kick descriptor (to listen for I/O requests - unused by SPDK)
If multiqueue feature has been negotiated, the driver has to send a specific
*ENABLE* message for each extra queue it wants to be polled. Other queues are
polled as soon as they're initialized.
# I/O path {#vhost_processing_io_path}
## I/O path {#vhost_processing_io_path}
The Master sends I/O by allocating proper buffers in shared memory, filling
the request data, and putting guest addresses of those buffers into virtqueues.
A Virtio-Block request looks as follows.
```
```c
struct virtio_blk_req {
uint32_t type; // READ, WRITE, FLUSH (read-only)
uint64_t offset; // offset in the disk (read-only)
@ -135,7 +131,7 @@ struct virtio_blk_req {
```
And a Virtio-SCSI request as follows.
```
```c
struct virtio_scsi_req_cmd {
struct virtio_scsi_cmd_req *req; // request data (read-only)
struct iovec read_only_buffers[]; // scatter-gatter list for WRITE I/Os
@ -149,7 +145,7 @@ to be converted into a chain of such descriptors. A single descriptor can be
either readable or writable, so each I/O request consists of at least two
(request + response).
```
```c
struct virtq_desc {
/* Address (guest-physical). */
le64 addr;
@ -186,7 +182,7 @@ proper data and interrupts the guest by doing an eventfd_write on the call
descriptor for proper virtqueue. There are multiple interrupt coalescing
features involved, but they are not be discussed in this document.
## SPDK optimizations {#vhost_spdk_optimizations}
### SPDK optimizations {#vhost_spdk_optimizations}
Due to its poll-mode nature, SPDK vhost removes the requirement for I/O submission
notifications, drastically increasing the vhost server throughput and decreasing

View File

@ -1,6 +1,6 @@
# Virtio driver {#virtio}
# Introduction {#virtio_intro}
## Introduction {#virtio_intro}
SPDK Virtio driver is a C library that allows communicating with Virtio devices.
It allows any SPDK application to become an initiator for (SPDK) vhost targets.
@ -20,7 +20,7 @@ This Virtio library is currently used to implement two bdev modules:
@ref bdev_config_virtio_scsi and @ref bdev_config_virtio_blk.
These modules will export generic SPDK block devices usable by any SPDK application.
# 2MB hugepages {#virtio_2mb}
## 2MB hugepages {#virtio_2mb}
vhost-user specification puts a limitation on the number of "memory regions" used (8).
Each region corresponds to one file descriptor, and DPDK - as SPDK's memory allocator -

View File

@ -1,6 +1,6 @@
# VMD driver {#vmd}
# In this document {#vmd_toc}
## In this document {#vmd_toc}
* @ref vmd_intro
* @ref vmd_interface
@ -10,7 +10,7 @@
* @ref vmd_app
* @ref vmd_led
# Introduction {#vmd_intro}
## Introduction {#vmd_intro}
Intel Volume Management Device is a hardware logic inside processor's Root Complex
responsible for management of PCIe NVMe SSDs. It provides robust Hot Plug support
@ -19,11 +19,11 @@ and Status LED management.
The driver is responsible for enumeration and hooking NVMe devices behind VMD
into SPDK PCIe subsystem. It also provides API for LED management and hot plug.
# Public Interface {#vmd_interface}
## Public Interface {#vmd_interface}
- spdk/vmd.h
# Key Functions {#vmd_key_functions}
## Key Functions {#vmd_key_functions}
Function | Description
--------------------------------------- | -----------
@ -33,7 +33,7 @@ spdk_vmd_set_led_state() | @copybrief spdk_vmd_set_led_state()
spdk_vmd_get_led_state() | @copybrief spdk_vmd_get_led_state()
spdk_vmd_hotplug_monitor() | @copybrief spdk_vmd_hotplug_monitor()
# Configuration {#vmd_config}
## Configuration {#vmd_config}
To enable VMD driver enumeration, the following steps are required:
@ -75,7 +75,7 @@ Example:
$ ./scripts/rpc.py bdev_nvme_attach_controller -b NVMe1 -t PCIe -a 5d0505:01:00.0
```
# Application framework {#vmd_app_frame}
## Application framework {#vmd_app_frame}
When application framework is used, VMD section needs to be added to the configuration file:
@ -98,7 +98,7 @@ $ ./build/bin/spdk_tgt --wait_for_rpc
$ ./scripts/rpc.py enable_vmd
$ ./scripts/rpc.py framework_start_init
```
# Applications w/o application framework {#vmd_app}
## Applications w/o application framework {#vmd_app}
To enable VMD enumeration in SPDK application that are not using application framework
e.g nvme/perf, nvme/identify -V flag is required - please refer to app help if it supports VMD.
@ -107,7 +107,7 @@ Applications need to call spdk_vmd_init() to enumerate NVMe devices behind the V
spdk_nvme_(probe|connect).
To support hot plugs spdk_vmd_hotplug_monitor() needs to be called periodically.
# LED management {#vmd_led}
## LED management {#vmd_led}
VMD LED utility in the [examples/vmd/led](https://github.com/spdk/spdk/tree/master/examples/vmd/led)
could be used to set LED states.

99
docker/README.md Normal file
View File

@ -0,0 +1,99 @@
# SPDK Docker suite
This suite is meant to serve as an example of how SPDK can be encapsulated
into docker container images. The example containers consist of SPDK NVMe-oF
target sharing devices to another SPDK NVMe-oF application. Which serves
as both initiator and target. Finally a traffic generator based on FIO
issues I/O to the connected devices.
## Prerequisites
docker: We recommend version 20.10 and above because it supports cgroups v2 for
customization of host resources like CPUs, memory, and block I/O.
docker-compose: We recommend using 1.29.2 version or newer.
kernel: Hugepages must be allocated prior running the containers and hugetlbfs
mount must be available under /dev/hugepages. Also, tmpfs should be mounted
under /dev/shm. Depending on the use-case, some kernel modules should be also
loaded into the kernel prior running the containers.
proxy: If you are working behind firewall make sure dockerd is aware of the
proxy. Please refer to:
[docker-proxy](https://docs.docker.com/config/daemon/systemd/#httphttps-proxy)
To pass `$http_proxy` to docker-compose build use:
~~~{.sh}
docker-compose build --build-arg PROXY=$http_proxy
~~~
## How-To
`docker-compose.yaml` shows an example deployment of the storage containers based on SPDK.
Running `docker-compose build` creates 5 docker images:
- build_base
- storage-target
- proxy-container
- traffic-generator-nvme
- traffic-generator-virtio
The `build_base` image provides the core components required to containerize SPDK
applications. The fedora:33 image from the Fedora Container Registry is used and then SPDK is installed. SPDK is installed out of `build_base/spdk.tar.gz` provided.
See `build_base` folder for details on what's included in the final image.
Running `docker-compose up` creates 3 docker containers:
-- storage-target: Contains SPDK NVMe-oF target exposing single subsystem to
`proxy-container` based on malloc bdev.
-- proxy-container: Contains SPDK NVMe-oF target connecting to `storage-target`
and then exposing the same devices to `traffic-generator-nvme` using NVMe-oF and
to `traffic-generator-virtio` using Virtio.
-- traffic-generator-nvme: Contains FIO using SPDK plugin to connect to `proxy-container`
and runs a sample workload.
-- traffic-generator-virtio: Contains FIO using SPDK plugin to connect to `proxy-container`
and runs a sample workload.
Each container is connected to a separate "spdk" network which is created before
deploying the containers. See `docker-compose.yaml` for the network's detailed setup and ip assignment.
All the above boils down to:
~~~{.sh}
cd docker
tar -czf build_base/spdk.tar.gz --exclude='docker/*' -C .. .
docker-compose build
docker-compose up
~~~
The `storage-target` and `proxy-container` can be started as services.
Allowing for multiple traffic generator containers to connect.
~~~{.sh}
docker-compose up -d proxy-container
docker-compose run traffic-generator-nvme
docker-compose run traffic-generator-virtio
~~~
Enviroment variables to containers can be passed as shown in
[docs](https://docs.docker.com/compose/environment-variables/).
For example extra arguments to fio can be passed as so:
~~~{.sh}
docker-compose run -e FIO_ARGS="--minimal" traffic-generator-nvme
~~~
As each container includes SPDK installation it is possible to use rpc.py to
examine the final setup. E.g.:
~~~{.sh}
docker-compose exec storage-target rpc.py bdev_get_bdevs
docker-compose exec proxy-container rpc.py nvmf_get_subsystems
~~~
## Caveats
- If you run docker < 20.10 under distro which switched fully to cgroups2
(e.g. f33) make sure that /sys/fs/cgroup/systemd exists otherwise docker/build
will simply fail.
- Each SPDK app inside the containers is limited to single, separate CPU.

View File

@ -0,0 +1,40 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) Intel Corporation
FROM fedora:33 AS base
# Generic args
ARG PROXY
ARG NO_PROXY
ENV http_proxy=$PROXY
ENV https_proxy=$PROXY
ENV no_proxy=$NO_PROXY
COPY spdk.tar.gz /spdk.tar.gz
COPY pre-install /install
RUN /install
# We are doing a multi-stage build here. This means that previous image,
# base, is going to end up as an intermediate one, untagged, <none> - this
# image can be then manually removed (--force-rm doesn't work here. Go
# figure).
FROM fedora:33 AS spdk
LABEL maintainer=spdk.io
# Proxy configuration must be set for each build separately...
ARG PROXY
ARG NO_PROXY
ENV http_proxy=$PROXY
ENV https_proxy=$PROXY
ENV no_proxy=$NO_PROXY
# Copy SPDK's RPMs built during pre-install step.
COPY --from=base /tmp/*.rpm /tmp/
COPY --from=base /tmp/fio /tmp/
# Wrap up the image
COPY post-install /install
RUN /install

20
docker/build_base/post-install Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e
dnf install -y /tmp/*.rpm
# Be nice for docker exec and link SPDK scripts|binaries under common PATH
# location like /usr/bin.
ln -sf $(ls -1dpA /usr/local/bin/* | grep -v "/$") /usr/bin
ln -sf $(ls -1dpA /usr/local/bin/fio/* | grep -v "/$") /usr/bin
ln -s /usr/libexec/spdk/scripts/rpc.py /usr/bin
ln -s /usr/libexec/spdk/scripts/rpc_http_proxy.py /usr/bin
ln -s /usr/libexec/spdk/scripts/setup.sh /usr/bin
ln -s /usr/libexec/spdk/include/spdk /usr/include
ln -s /usr/libexec/spdk/scripts/ /usr
mkdir -p /usr/src/fio
mv /tmp/fio /usr/src/fio
dnf clean all
rm -f /tmp/*.rpm

44
docker/build_base/pre-install Executable file
View File

@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -e
spdk_repo=$(mktemp -dt "spdk.XXXXXX")
spdk_tar=/spdk.tar.gz
cleanup() {
rm -f "$HOME/rpmbuild/rpm/x86_64/"*.rpm
rm -f "$spdk_tar"
rm -rf "$spdk_repo"
}
trap 'cleanup' EXIT
if [[ ! -e $spdk_tar ]]; then
printf 'Missing %s\n' "$spdk_tar" >&2
exit 1
fi
tar -C "$spdk_repo" -xf "$spdk_tar"
# Required for building RPM
dnf install -y rpm-build
# Spice it a bit with supported sources
"$spdk_repo/scripts/pkgdep.sh" -d
"$spdk_repo/test/common/config/vm_setup.sh" --test-conf=fio
# HACK: In case we received a .tar with built SPDK we need to overwrite the
# configuration to update all the paths make would need to lookup - this is
# needed since we execute inside a different mount namespace so we won't be
# able to find any absoulte paths that were used prior creating the .tar.
"$spdk_repo/configure" > /dev/null
# Deploy SPDK inside the container
DEPS="no" "$spdk_repo/rpmbuild/rpm.sh" \
--with-shared \
--with-virtio \
--with-fio
mv "$HOME/rpmbuild/rpm/x86_64/"*.rpm /tmp
mv "/usr/src/fio/fio" /tmp
dnf clean all

View File

@ -0,0 +1,80 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) Intel Corporation
version: "3.8"
services:
build_base:
image: spdk
build:
context: build_base
container_name: build_base
storage-target:
image: spdk-app
build:
context: spdk-app
container_name: storage-target
depends_on:
- build_base
networks:
spdk:
ipv4_address: 192.168.42.2
volumes:
- /dev/hugepages:/dev/hugepages
- ./spdk-app/storage-target.conf:/config
environment:
- SPDK_ARGS=-m 0x2
privileged: true
proxy-container:
image: spdk-app
build:
context: spdk-app
container_name: proxy-container
depends_on:
- storage-target
networks:
spdk:
ipv4_address: 192.168.42.3
volumes:
- /dev/hugepages:/dev/hugepages
- ./spdk-app/proxy-container.conf:/config
- vhost-user:/vhost-user
environment:
- SPDK_ARGS=-m 0x4 -S /vhost-user
privileged: true
traffic-generator-virtio:
image: traffic-generator
build:
context: traffic-generator
container_name: traffic-generator-virtio
depends_on:
- proxy-container
networks:
spdk:
volumes:
- /dev/hugepages:/dev/hugepages
- ./traffic-generator/conf-virtio:/config
- vhost-user:/vhost-user
- ./traffic-generator/fio-virtio.conf:/fio.conf
privileged: true
traffic-generator-nvme:
image: traffic-generator
build:
context: traffic-generator
container_name: traffic-generator-nvme
depends_on:
- proxy-container
networks:
spdk:
volumes:
- /dev/hugepages:/dev/hugepages
- ./traffic-generator/conf-nvme:/config
- ./traffic-generator/fio-nvme.conf:/fio.conf
privileged: true
networks:
spdk:
name: "spdk"
ipam:
config:
- subnet: 192.168.42.0/29
gateway: 192.168.42.1
volumes:
vhost-user:

View File

@ -0,0 +1,17 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) Intel Corporation
FROM spdk
# Generic args
ARG PROXY
ARG NO_PROXY
ENV http_proxy=$PROXY
ENV https_proxy=$PROXY
ENV no_proxy=$NO_PROXY
COPY init /init
ENTRYPOINT ["/init"]

32
docker/spdk-app/init Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env bash
app=spdk_tgt args=() limit_args=()
# Override default app
if [[ -n $SPDK_APP ]]; then
app=$SPDK_APP
fi
# Define extra arguments to the app
if [[ -n $SPDK_ARGS ]]; then
args=($SPDK_ARGS)
fi
# Limit the app with to following options,
# to allow for minimal impact on the host.
limit_args+=("--no-pci")
limit_args+=("--num-trace-entries" 0)
# if set, don't include limit_args[] on the cmdline
if [[ ! -v SPDK_NO_LIMIT ]]; then
args+=("${limit_args[@]}")
fi
if [[ -e /config ]]; then
args+=("--json" "/config")
fi
# Wait a bit to make sure ip is in place
sleep 2s
exec "$app" "${args[@]}"

View File

@ -0,0 +1,80 @@
{
"subsystems": [
{
"subsystem": "bdev",
"config": [
{
"method": "bdev_nvme_attach_controller",
"params": {
"name": "Nvme0",
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "192.168.42.2",
"trsvcid": "4420",
"subnqn": "nqn.2016-06.io.spdk:cnode1",
"prchk_reftag": false,
"prchk_guard": false
}
}
]
},
{
"subsystem": "nvmf",
"config": [
{
"method": "nvmf_create_transport",
"params": {
"trtype": "TCP",
"io_unit_size": 8192
}
},
{
"method": "nvmf_create_subsystem",
"params": {
"nqn": "nqn.2016-06.io.spdk:cnode1",
"allow_any_host": true,
"serial_number": "SPDK00000000000001",
"model_number": "SPDK bdev Controller",
"max_namespaces": 32,
"min_cntlid": 1,
"max_cntlid": 65519
}
},
{
"method": "nvmf_subsystem_add_ns",
"params": {
"nqn": "nqn.2016-06.io.spdk:cnode1",
"namespace": {
"nsid": 1,
"bdev_name": "Nvme0n1"
}
}
},
{
"method": "nvmf_subsystem_add_listener",
"params": {
"nqn": "nqn.2016-06.io.spdk:cnode1",
"listen_address": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "192.168.42.3",
"trsvcid": "4420"
}
}
}
]
},
{
"subsystem": "vhost",
"config": [
{
"method": "vhost_create_blk_controller",
"params": {
"ctrlr": "VirtioBlk0",
"dev_name": "Nvme0n2"
}
}
]
}
]
}

View File

@ -0,0 +1,81 @@
{
"subsystems": [
{
"subsystem": "bdev",
"config": [
{
"method": "bdev_malloc_create",
"params": {
"name": "Malloc0",
"num_blocks": 131072,
"block_size": 512
}
},
{
"method": "bdev_malloc_create",
"params": {
"name": "Malloc1",
"num_blocks": 131072,
"block_size": 512
}
}
]
},
{
"subsystem": "nvmf",
"config": [
{
"method": "nvmf_create_transport",
"params": {
"trtype": "TCP",
"io_unit_size": 8192
}
},
{
"method": "nvmf_create_subsystem",
"params": {
"nqn": "nqn.2016-06.io.spdk:cnode1",
"allow_any_host": true,
"serial_number": "SPDK00000000000001",
"model_number": "SPDK bdev Controller",
"max_namespaces": 32,
"min_cntlid": 1,
"max_cntlid": 65519
}
},
{
"method": "nvmf_subsystem_add_ns",
"params": {
"nqn": "nqn.2016-06.io.spdk:cnode1",
"namespace": {
"nsid": 1,
"bdev_name": "Malloc0"
}
}
},
{
"method": "nvmf_subsystem_add_ns",
"params": {
"nqn": "nqn.2016-06.io.spdk:cnode1",
"namespace": {
"nsid": 2,
"bdev_name": "Malloc1"
}
}
},
{
"method": "nvmf_subsystem_add_listener",
"params": {
"nqn": "nqn.2016-06.io.spdk:cnode1",
"listen_address": {
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "192.168.42.2",
"trsvcid": "4420"
}
}
}
]
}
]
}

View File

@ -0,0 +1,17 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) Intel Corporation
FROM spdk
# Generic args
ARG PROXY
ARG NO_PROXY
ENV http_proxy=$PROXY
ENV https_proxy=$PROXY
ENV no_proxy=$NO_PROXY
COPY init /init
ENTRYPOINT ["/init"]

View File

@ -0,0 +1,22 @@
{
"subsystems": [
{
"subsystem": "bdev",
"config": [
{
"method": "bdev_nvme_attach_controller",
"params": {
"name": "Nvme0",
"trtype": "TCP",
"adrfam": "IPv4",
"traddr": "192.168.42.3",
"trsvcid": "4420",
"subnqn": "nqn.2016-06.io.spdk:cnode1",
"prchk_reftag": false,
"prchk_guard": false
}
}
]
}
]
}

View File

@ -6,12 +6,10 @@
{
"method": "bdev_virtio_attach_controller",
"params": {
"vq_count": 2,
"traddr": "Malloc.0",
"dev_type": "blk",
"vq_size": 512,
"name": "VirtioBlk0",
"trtype": "user"
"trtype": "user",
"traddr": "/vhost-user/VirtioBlk0",
"dev_type": "blk"
}
}
]

View File

@ -0,0 +1,17 @@
[global]
ioengine=spdk_bdev
spdk_json_conf=/config
spdk_mem=1024
thread=1
direct=1
rw=randread
ramp_time=0
norandommap=1
time_based=1
bs=4k
numjobs=1
runtime=10
[filename0]
filename=Nvme0n1
iodepth=128

View File

@ -0,0 +1,18 @@
[global]
ioengine=spdk_bdev
spdk_json_conf=/config
spdk_single_seg=1
spdk_mem=1024
thread=1
direct=1
rw=randread
ramp_time=0
norandommap=1
time_based=1
bs=4k
numjobs=1
runtime=10
[filename0]
filename=VirtioBlk0
iodepth=128

14
docker/traffic-generator/init Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
args=()
# Define extra arguments to the app
if [[ -n $FIO_ARGS ]]; then
args+=($FIO_ARGS)
fi
# Wait a bit to make sure ip is in place
sleep 2s
export LD_PRELOAD=/usr/local/bin/fio/spdk_bdev
exec /usr/src/fio/fio "${args[@]}" /fio.conf

2
dpdk

@ -1 +1 @@
Subproject commit eb16786836e3a8380bb86fde67efa2ee0d9d3852
Subproject commit 22e79be44fd5609b7f43236d8be9b68303e99e81

View File

@ -3,6 +3,7 @@
#
# Copyright (c) Intel Corporation.
# All rights reserved.
# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -66,6 +67,9 @@ endif
ifeq ($(CONFIG_REDUCE),y)
DPDK_DRIVERS += compress compress/isal
ifeq ($(CONFIG_REDUCE_MLX5),y)
DPDK_DRIVERS += common/mlx5 compress/mlx5 bus/auxiliary
endif
DPDK_CFLAGS += -I$(ISAL_DIR)
DPDK_LDFLAGS += -L$(ISAL_DIR)/.libs -lisal
endif
@ -137,7 +141,7 @@ ifeq ($(MAKE_PID),)
MAKE_PID := $(shell echo $$PPID)
endif
MAKE_NUMJOBS := $(shell ps T | sed -nE 's/\s*$(MAKE_PID)\s.* (-j|--jobs=)( *[0-9]+).*/\1\2/p')
MAKE_NUMJOBS := $(shell ps T | sed -nE 's/[[:space:]]*$(MAKE_PID)[[:space:]].* (-j|--jobs=)( *[0-9]+).*/\1\2/p')
all: $(SPDK_ROOT_DIR)/dpdk/build-tmp
$(Q)# DPDK doesn't handle nested make calls, so unset MAKEFLAGS

View File

@ -34,7 +34,8 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
DIRS-y += accel bdev blob ioat nvme sock vmd nvmf
DIRS-y += accel bdev blob ioat nvme sock vmd nvmf util
DIRS-$(CONFIG_IDXD) += idxd
ifeq ($(OS),Linux)
DIRS-$(CONFIG_VHOST) += interrupt_tgt

View File

@ -39,6 +39,6 @@ APP = accel_perf
C_SRCS := accel_perf.c
SPDK_LIB_LIST = $(ACCEL_MODULES_LIST) event_accel
SPDK_LIB_LIST = $(ACCEL_MODULES_LIST) event event_accel
include $(SPDK_ROOT_DIR)/mk/spdk.app.mk

View File

@ -49,6 +49,10 @@ static uint64_t g_tsc_end;
static int g_rc;
static int g_xfer_size_bytes = 4096;
static int g_queue_depth = 32;
/* g_allocate_depth indicates how many tasks we allocate per worker. It will
* be at least as much as the queue depth.
*/
static int g_allocate_depth = 0;
static int g_ops_per_batch = 0;
static int g_threads_per_core = 1;
static int g_time_in_sec = 5;
@ -62,7 +66,6 @@ static enum accel_capability g_workload_selection;
static struct worker_thread *g_workers = NULL;
static int g_num_workers = 0;
static pthread_mutex_t g_workers_lock = PTHREAD_MUTEX_INITIALIZER;
uint64_t g_capabilites;
struct worker_thread;
static void accel_done(void *ref, int status);
@ -78,14 +81,13 @@ struct ap_task {
uint32_t iov_cnt;
void *dst;
void *dst2;
uint32_t crc_dst;
struct worker_thread *worker;
int status;
int expected_status; /* used for the compare operation */
TAILQ_ENTRY(ap_task) link;
};
struct accel_batch {
int status;
int cmd_count;
struct spdk_accel_batch *batch;
struct worker_thread *worker;
@ -120,16 +122,22 @@ dump_user_config(struct spdk_app_opts *opts)
printf("Core mask: %s\n\n", opts->reactor_mask);
printf("Accel Perf Configuration:\n");
printf("Workload Type: %s\n", g_workload_type);
if (g_workload_selection == ACCEL_CRC32C) {
if (g_workload_selection == ACCEL_CRC32C || g_workload_selection == ACCEL_COPY_CRC32C) {
printf("CRC-32C seed: %u\n", g_crc32c_seed);
printf("vector size: %u\n", g_crc32c_chained_count);
printf("vector count %u\n", g_crc32c_chained_count);
} else if (g_workload_selection == ACCEL_FILL) {
printf("Fill pattern: 0x%x\n", g_fill_pattern);
} else if ((g_workload_selection == ACCEL_COMPARE) && g_fail_percent_goal > 0) {
printf("Failure inject: %u percent\n", g_fail_percent_goal);
}
printf("Transfer size: %u bytes\n", g_xfer_size_bytes);
if (g_workload_selection == ACCEL_COPY_CRC32C) {
printf("Vector size: %u bytes\n", g_xfer_size_bytes);
printf("Transfer size: %u bytes\n", g_xfer_size_bytes * g_crc32c_chained_count);
} else {
printf("Transfer size: %u bytes\n", g_xfer_size_bytes);
}
printf("Queue depth: %u\n", g_queue_depth);
printf("Allocate depth: %u\n", g_allocate_depth);
printf("# threads/core: %u\n", g_threads_per_core);
printf("Run time: %u seconds\n", g_time_in_sec);
if (g_ops_per_batch > 0) {
@ -146,49 +154,78 @@ usage(void)
printf("accel_perf options:\n");
printf("\t[-h help message]\n");
printf("\t[-q queue depth per core]\n");
printf("\t[-C for crc32c workload, use this value to configre the io vector size to test (default 1)\n");
printf("\t[-C for crc32c workload, use this value to configure the io vector size to test (default 1)\n");
printf("\t[-T number of threads per core\n");
printf("\t[-n number of channels]\n");
printf("\t[-o transfer size in bytes]\n");
printf("\t[-t time in seconds]\n");
printf("\t[-w workload type must be one of these: copy, fill, crc32c, compare, dualcast\n");
printf("\t[-w workload type must be one of these: copy, fill, crc32c, copy_crc32c, compare, dualcast\n");
printf("\t[-s for crc32c workload, use this seed value (default 0)\n");
printf("\t[-P for compare workload, percentage of operations that should miscompare (percent, default 0)\n");
printf("\t[-f for fill workload, use this BYTE value (default 255)\n");
printf("\t[-y verify result if this switch is on]\n");
printf("\t[-b batch this number of operations at a time (default 0 = disabled)]\n");
printf("\t[-a tasks to allocate per core (default: same value as -q)]\n");
printf("\t\tCan be used to spread operations across a wider range of memory.\n");
}
static int
parse_args(int argc, char *argv)
{
int argval = 0;
switch (argc) {
case 'a':
case 'b':
g_ops_per_batch = spdk_strtol(optarg, 10);
case 'C':
case 'f':
case 'T':
case 'o':
case 'P':
case 'q':
case 's':
case 't':
argval = spdk_strtol(optarg, 10);
if (argval < 0) {
fprintf(stderr, "-%c option must be non-negative.\n", argc);
usage();
return 1;
}
break;
default:
break;
};
switch (argc) {
case 'a':
g_allocate_depth = argval;
break;
case 'b':
g_ops_per_batch = argval;
break;
case 'C':
g_crc32c_chained_count = spdk_strtol(optarg, 10);
g_crc32c_chained_count = argval;
break;
case 'f':
g_fill_pattern = (uint8_t)spdk_strtol(optarg, 10);
g_fill_pattern = (uint8_t)argval;
break;
case 'T':
g_threads_per_core = spdk_strtol(optarg, 10);
g_threads_per_core = argval;
break;
case 'o':
g_xfer_size_bytes = spdk_strtol(optarg, 10);
g_xfer_size_bytes = argval;
break;
case 'P':
g_fail_percent_goal = spdk_strtol(optarg, 10);
g_fail_percent_goal = argval;
break;
case 'q':
g_queue_depth = spdk_strtol(optarg, 10);
g_queue_depth = argval;
break;
case 's':
g_crc32c_seed = spdk_strtol(optarg, 10);
g_crc32c_seed = argval;
break;
case 't':
g_time_in_sec = spdk_strtol(optarg, 10);
g_time_in_sec = argval;
break;
case 'y':
g_verify = true;
@ -201,6 +238,8 @@ parse_args(int argc, char *argv)
g_workload_selection = ACCEL_FILL;
} else if (!strcmp(g_workload_type, "crc32c")) {
g_workload_selection = ACCEL_CRC32C;
} else if (!strcmp(g_workload_type, "copy_crc32c")) {
g_workload_selection = ACCEL_COPY_CRC32C;
} else if (!strcmp(g_workload_type, "compare")) {
g_workload_selection = ACCEL_COMPARE;
} else if (!strcmp(g_workload_type, "dualcast")) {
@ -239,6 +278,7 @@ _get_task_data_bufs(struct ap_task *task)
{
uint32_t align = 0;
uint32_t i = 0;
int dst_buff_len = g_xfer_size_bytes;
/* For dualcast, the DSA HW requires 4K alignment on destination addresses but
* we do this for all engines to keep it simple.
@ -247,7 +287,7 @@ _get_task_data_bufs(struct ap_task *task)
align = ALIGN_4K;
}
if (g_workload_selection == ACCEL_CRC32C) {
if (g_workload_selection == ACCEL_CRC32C || g_workload_selection == ACCEL_COPY_CRC32C) {
assert(g_crc32c_chained_count > 0);
task->iov_cnt = g_crc32c_chained_count;
task->iovs = calloc(task->iov_cnt, sizeof(struct iovec));
@ -256,6 +296,10 @@ _get_task_data_bufs(struct ap_task *task)
return -ENOMEM;
}
if (g_workload_selection == ACCEL_COPY_CRC32C) {
dst_buff_len = g_xfer_size_bytes * g_crc32c_chained_count;
}
for (i = 0; i < task->iov_cnt; i++) {
task->iovs[i].iov_base = spdk_dma_zmalloc(g_xfer_size_bytes, 0, NULL);
if (task->iovs[i].iov_base == NULL) {
@ -280,17 +324,19 @@ _get_task_data_bufs(struct ap_task *task)
}
}
task->dst = spdk_dma_zmalloc(g_xfer_size_bytes, align, NULL);
if (task->dst == NULL) {
fprintf(stderr, "Unable to alloc dst buffer\n");
return -ENOMEM;
}
if (g_workload_selection != ACCEL_CRC32C) {
task->dst = spdk_dma_zmalloc(dst_buff_len, align, NULL);
if (task->dst == NULL) {
fprintf(stderr, "Unable to alloc dst buffer\n");
return -ENOMEM;
}
/* For compare we want the buffers to match, otherwise not. */
if (g_workload_selection == ACCEL_COMPARE) {
memset(task->dst, DATA_PATTERN, g_xfer_size_bytes);
} else {
memset(task->dst, ~DATA_PATTERN, g_xfer_size_bytes);
/* For compare we want the buffers to match, otherwise not. */
if (g_workload_selection == ACCEL_COMPARE) {
memset(task->dst, DATA_PATTERN, dst_buff_len);
} else {
memset(task->dst, ~DATA_PATTERN, dst_buff_len);
}
}
if (g_workload_selection == ACCEL_DUALCAST) {
@ -318,8 +364,6 @@ _get_task(struct worker_thread *worker)
return NULL;
}
task->worker = worker;
task->worker->current_queue_depth++;
return task;
}
@ -343,10 +387,14 @@ _submit_single(struct worker_thread *worker, struct ap_task *task)
g_xfer_size_bytes, accel_done, task);
break;
case ACCEL_CRC32C:
rc = spdk_accel_submit_crc32cv(worker->ch, (uint32_t *)task->dst,
rc = spdk_accel_submit_crc32cv(worker->ch, &task->crc_dst,
task->iovs, task->iov_cnt, g_crc32c_seed,
accel_done, task);
break;
case ACCEL_COPY_CRC32C:
rc = spdk_accel_submit_copy_crc32cv(worker->ch, task->dst, task->iovs, task->iov_cnt,
&task->crc_dst, g_crc32c_seed, accel_done, task);
break;
case ACCEL_COMPARE:
random_num = rand() % 100;
if (random_num < g_fail_percent_goal) {
@ -402,8 +450,12 @@ _batch_prep_cmd(struct worker_thread *worker, struct ap_task *task,
*(uint8_t *)task->src,
g_xfer_size_bytes, accel_done, task);
break;
case ACCEL_COPY_CRC32C:
rc = spdk_accel_batch_prep_copy_crc32c(worker->ch, batch, task->dst, task->src, &task->crc_dst,
g_crc32c_seed, g_xfer_size_bytes, accel_done, task);
break;
case ACCEL_CRC32C:
rc = spdk_accel_batch_prep_crc32cv(worker->ch, batch, (uint32_t *)task->dst,
rc = spdk_accel_batch_prep_crc32cv(worker->ch, batch, &task->crc_dst,
task->iovs, task->iov_cnt, g_crc32c_seed, accel_done, task);
break;
default:
@ -419,7 +471,7 @@ _free_task_buffers(struct ap_task *task)
{
uint32_t i;
if (g_workload_selection == ACCEL_CRC32C) {
if (g_workload_selection == ACCEL_CRC32C || g_workload_selection == ACCEL_COPY_CRC32C) {
if (task->iovs) {
for (i = 0; i < task->iov_cnt; i++) {
if (task->iovs[i].iov_base) {
@ -438,7 +490,6 @@ _free_task_buffers(struct ap_task *task)
}
}
static void _batch_done(void *cb_arg);
static void
_build_batch(struct worker_thread *worker, struct ap_task *task)
{
@ -507,16 +558,17 @@ _drain_batch(struct worker_thread *worker)
}
static void
_batch_done(void *cb_arg)
batch_done(void *arg1, int status)
{
struct accel_batch *worker_batch = (struct accel_batch *)cb_arg;
struct accel_batch *worker_batch = (struct accel_batch *)arg1;
struct worker_thread *worker = worker_batch->worker;
int rc;
assert(worker);
assert(TAILQ_EMPTY(&worker->in_use_batches) == 0);
if (worker_batch->status) {
SPDK_ERRLOG("error %d\n", worker_batch->status);
if (status) {
SPDK_ERRLOG("error %d\n", status);
}
worker->current_queue_depth--;
@ -548,33 +600,30 @@ _batch_done(void *cb_arg)
}
}
static void
batch_done(void *cb_arg, int status)
static int
_vector_memcmp(void *_dst, struct iovec *src_iovs, uint32_t iovcnt)
{
struct accel_batch *worker_batch = (struct accel_batch *)cb_arg;
assert(worker_batch->worker);
worker_batch->status = status;
spdk_thread_send_msg(worker_batch->worker->thread, _batch_done, worker_batch);
}
static uint32_t
_update_crc32c_iov(struct iovec *iov, int iovcnt, uint32_t crc32c)
{
int i;
uint32_t i;
uint32_t ttl_len = 0;
uint8_t *dst = (uint8_t *)_dst;
for (i = 0; i < iovcnt; i++) {
assert(iov[i].iov_base != NULL);
assert(iov[i].iov_len != 0);
crc32c = spdk_crc32c_update(iov[i].iov_base, iov[i].iov_len, crc32c);
if (memcmp(dst, src_iovs[i].iov_base, src_iovs[i].iov_len)) {
return -1;
}
dst += src_iovs[i].iov_len;
ttl_len += src_iovs[i].iov_len;
}
return crc32c;
if (ttl_len != iovcnt * g_xfer_size_bytes) {
return -1;
}
return 0;
}
static void
_accel_done(void *arg1)
accel_done(void *arg1, int status)
{
struct ap_task *task = arg1;
struct worker_thread *worker = task->worker;
@ -583,11 +632,22 @@ _accel_done(void *arg1)
assert(worker);
assert(worker->current_queue_depth > 0);
if (g_verify && task->status == 0) {
if (g_verify && status == 0) {
switch (g_workload_selection) {
case ACCEL_COPY_CRC32C:
sw_crc32c = spdk_crc32c_iov_update(task->iovs, task->iov_cnt, ~g_crc32c_seed);
if (task->crc_dst != sw_crc32c) {
SPDK_NOTICELOG("CRC-32C miscompare\n");
worker->xfer_failed++;
}
if (_vector_memcmp(task->dst, task->iovs, task->iov_cnt)) {
SPDK_NOTICELOG("Data miscompare\n");
worker->xfer_failed++;
}
break;
case ACCEL_CRC32C:
sw_crc32c = _update_crc32c_iov(task->iovs, task->iov_cnt, ~g_crc32c_seed);
if (*(uint32_t *)task->dst != sw_crc32c) {
sw_crc32c = spdk_crc32c_iov_update(task->iovs, task->iov_cnt, ~g_crc32c_seed);
if (task->crc_dst != sw_crc32c) {
SPDK_NOTICELOG("CRC-32C miscompare\n");
worker->xfer_failed++;
}
@ -623,9 +683,9 @@ _accel_done(void *arg1)
}
if (task->expected_status == -EILSEQ) {
assert(task->status != 0);
assert(status != 0);
worker->injected_miscompares++;
} else if (task->status) {
} else if (status) {
/* Expected to pass but the accel engine reported an error (ex: COMPARE operation). */
worker->xfer_failed++;
}
@ -634,6 +694,8 @@ _accel_done(void *arg1)
worker->current_queue_depth--;
if (!worker->is_draining) {
TAILQ_INSERT_TAIL(&worker->tasks_pool, task, link);
task = _get_task(worker);
if (g_ops_per_batch == 0) {
_submit_single(worker, task);
worker->current_queue_depth++;
@ -740,7 +802,7 @@ _init_thread(void *arg1)
int i, rc, num_batches;
int max_per_batch;
int remaining = g_queue_depth;
int num_tasks = g_queue_depth;
int num_tasks = g_allocate_depth;
struct accel_batch *tmp;
struct accel_batch *worker_batch = NULL;
struct display_info *display = arg1;
@ -818,6 +880,7 @@ _init_thread(void *arg1)
task = worker->task_base;
for (i = 0; i < num_tasks; i++) {
TAILQ_INSERT_TAIL(&worker->tasks_pool, task, link);
task->worker = worker;
if (_get_task_data_bufs(task)) {
fprintf(stderr, "Unable to get data bufs\n");
goto error;
@ -848,6 +911,7 @@ _init_thread(void *arg1)
for (i = 0; i < g_ops_per_batch; i++) {
task = _get_task(worker);
worker->current_queue_depth++;
if (task == NULL) {
goto error;
}
@ -877,6 +941,7 @@ _init_thread(void *arg1)
/* Submit as singles when no batching is enabled or we ran out of batches. */
for (i = 0; i < remaining; i++) {
task = _get_task(worker);
worker->current_queue_depth++;
if (task == NULL) {
goto error;
}
@ -899,22 +964,27 @@ error:
spdk_app_stop(-1);
}
static void
accel_done(void *cb_arg, int status)
static inline void
identify_accel_engine_usage(void)
{
struct ap_task *task = (struct ap_task *)cb_arg;
struct worker_thread *worker = task->worker;
struct spdk_io_channel *ch;
uint64_t capabilities;
assert(worker);
ch = spdk_accel_engine_get_io_channel();
assert(ch != NULL);
task->status = status;
spdk_thread_send_msg(worker->thread, _accel_done, task);
capabilities = spdk_accel_get_capabilities(ch);
if ((capabilities & g_workload_selection) != g_workload_selection) {
SPDK_WARNLOG("The selected workload is not natively supported by the current engine\n");
SPDK_WARNLOG("The software engine will be used instead.\n\n");
}
spdk_put_io_channel(ch);
}
static void
accel_perf_start(void *arg1)
{
struct spdk_io_channel *accel_ch;
struct spdk_cpuset tmp_cpumask = {};
char thread_name[32];
uint32_t i;
@ -922,14 +992,7 @@ accel_perf_start(void *arg1)
struct spdk_thread *thread;
struct display_info *display;
accel_ch = spdk_accel_engine_get_io_channel();
g_capabilites = spdk_accel_get_capabilities(accel_ch);
spdk_put_io_channel(accel_ch);
if ((g_capabilites & g_workload_selection) != g_workload_selection) {
SPDK_WARNLOG("The selected workload is not natively supported by the current engine\n");
SPDK_WARNLOG("The software engine will be used instead.\n\n");
}
identify_accel_engine_usage();
g_tsc_rate = spdk_get_ticks_hz();
g_tsc_end = spdk_get_ticks() + g_time_in_sec * g_tsc_rate;
@ -966,7 +1029,7 @@ main(int argc, char **argv)
pthread_mutex_init(&g_workers_lock, NULL);
spdk_app_opts_init(&opts, sizeof(opts));
opts.reactor_mask = "0x1";
if (spdk_app_parse_args(argc, argv, &opts, "C:o:q:t:yw:P:f:b:T:", NULL, parse_args,
if (spdk_app_parse_args(argc, argv, &opts, "a:C:o:q:t:yw:P:f:b:T:", NULL, parse_args,
usage) != SPDK_APP_PARSE_ARGS_SUCCESS) {
g_rc = -1;
goto cleanup;
@ -975,6 +1038,7 @@ main(int argc, char **argv)
if ((g_workload_selection != ACCEL_COPY) &&
(g_workload_selection != ACCEL_FILL) &&
(g_workload_selection != ACCEL_CRC32C) &&
(g_workload_selection != ACCEL_COPY_CRC32C) &&
(g_workload_selection != ACCEL_COMPARE) &&
(g_workload_selection != ACCEL_DUALCAST)) {
usage();
@ -989,7 +1053,18 @@ main(int argc, char **argv)
goto cleanup;
}
if (g_workload_selection == ACCEL_CRC32C &&
if (g_allocate_depth > 0 && g_queue_depth > g_allocate_depth) {
fprintf(stdout, "allocate depth must be at least as big as queue depth\n");
usage();
g_rc = -1;
goto cleanup;
}
if (g_allocate_depth == 0) {
g_allocate_depth = g_queue_depth;
}
if ((g_workload_selection == ACCEL_CRC32C || g_workload_selection == ACCEL_COPY_CRC32C) &&
g_crc32c_chained_count == 0) {
usage();
g_rc = -1;

View File

@ -40,6 +40,6 @@ FIO_PLUGIN := spdk_bdev
C_SRCS = fio_plugin.c
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event_bdev
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event event_bdev
include $(SPDK_ROOT_DIR)/mk/spdk.fio.mk

View File

@ -1,64 +1,83 @@
# Introduction
This directory contains a plug-in module for fio to enable use
with SPDK. Fio is free software published under version 2 of
the GPL license.
This directory contains a plug-in module for fio to enable use with SPDK. Fio is free software
published under version 2 of the GPL license.
# Compiling fio
## Compiling fio
Clone the fio source repository from https://github.com/axboe/fio
Clone the [fio source repository](https://github.com/axboe/fio)
```bash
git clone https://github.com/axboe/fio
cd fio
```
Compile the fio code and install:
```bash
make
make install
```
# Compiling SPDK
## Compiling SPDK
Clone the SPDK source repository from https://github.com/spdk/spdk
Clone the [SPDK source repository](https://github.com/spdk/spdk)
```bash
git clone https://github.com/spdk/spdk
cd spdk
git submodule update --init
```
Then, run the SPDK configure script to enable fio (point it to the root of the fio repository):
```bash
cd spdk
./configure --with-fio=/path/to/fio/repo <other configuration options>
```
Finally, build SPDK:
```bash
make
```
**Note to advanced users**: These steps assume you're using the DPDK submodule. If you are using your
own version of DPDK, the fio plugin requires that DPDK be compiled with -fPIC. You can compile DPDK
with -fPIC by modifying your DPDK configuration file and adding the line:
EXTRA_CFLAGS=-fPIC
```bash
EXTRA_CFLAGS=-fPIC
```
# Usage
## Usage
To use the SPDK fio plugin with fio, specify the plugin binary using LD_PRELOAD when running
fio and set ioengine=spdk_bdev in the fio configuration file (see example_config.fio in the same
directory as this README).
directory as this README). Following example command assumes `fio` is in your system `$PATH` environment variable.
LD_PRELOAD=<path to spdk repo>/build/fio/spdk_bdev fio
```bash
LD_PRELOAD=<path to spdk repo>/build/fio/spdk_bdev fio
```
The fio configuration file must contain one new parameter:
The fio configuration file must contain parameter pointing to a JSON configuration file containing SPDK bdev configuration:
spdk_json_conf=./examples/bdev/fio_plugin/bdev.json
```bash
spdk_json_conf=./examples/bdev/fio_plugin/bdev.json
```
You can specify which block device to run against by setting the filename parameter
to the block device name:
filename=Malloc0
```bash
filename=Malloc0
```
Or for NVMe devices:
filename=Nvme0n1
```bash
filename=Nvme0n1
```
fio by default forks a separate process for every job. It also supports just spawning a separate
thread in the same process for every job. The SPDK fio plugin is limited to this latter thread
@ -71,3 +90,206 @@ engine's full path via the ioengine parameter - LD_PRELOAD is recommended to avo
When testing random workloads, it is recommended to set norandommap=1. fio's random map
processing consumes extra CPU cycles which will degrade performance over time with
the fio_plugin since all I/O are submitted and completed on a single CPU core.
### Step-by-step usage examples
These examples assume you have built fio and SPDK with `--with-fio` option enabled.
#### Using fio bdev plugin with local NVMe storage
- Bind local NVMe drives to userspace driver
- Run gen_nvme.sh script to create a JSON file with bdev subsystem configuration
```bash
scripts/gen_nvme.sh --json-with-subsystems > /tmp/bdev.json
cat /tmp/bdev_local.json | jq
{
"subsystems": [
{
"subsystem": "bdev",
"config": [
{
"method": "bdev_nvme_attach_controller",
"params": {
"trtype": "PCIe",
"name": "Nvme0",
"traddr": "0000:0a:00.0"
}
},
{
"method": "bdev_nvme_attach_controller",
"params": {
"trtype": "PCIe",
"name": "Nvme1",
"traddr": "0000:85:00.0"
}
}
]
}
]
}
```
- Prepare fio configuration file
```bash
cat /tmp/fio.conf
[global]
ioengine=/spdk/build/fio/spdk_bdev
spdk_json_conf=/tmp/bdev.json
thread=1
direct=1
group_reporting=1
bs=4k
rw=randread
rwmixread=70
time_based=1
runtime=10
norandommap=1
[filename0]
filename=Nvme0n1
filename=Nvme1n1
iodepth=8
```
- Run fio with spdk bdev plugin
```bash
/usr/src/fio/fio /tmp/fio.conf
```
#### Using fio bdev plugin as NVMe-oF initiator with remote storage
- Start SPDK NVMe-oF Target process and configure it with block devices and NVMe-oF subsystems
```bash
build/bin/nvmf_tgt &
sleep 3
scripts/rpc.py bdev_malloc_create 10 512 -b Malloc0
scripts/rpc.py nvmf_create_transport -t TCP
scripts/rpc.py nvmf_create_subsystem nqn.2018-09.io.spdk:cnode1 -a -s S000001
scripts/rpc.py nvmf_subsystem_add_listener nqn.2018-09.io.spdk:cnode1 -t tcp -f ipv4 -s 4420 -a 10.0.0.1
scripts/rpc.py nvmf_subsystem_add_ns nqn.2018-09.io.spdk:cnode1 Malloc0
```
- Run gen_nvme.sh script to prepare a JSON file containing bdev subsystem configuration
for initiator which will allow it to connect to target
```bash
scripts/gen_nvme.sh --json-with-subsystems --mode=remote \
--trid=tcp:10.0.0.1:4420:nqn.2018-09.io.spdk:cnode1 > /tmp/bdev.json
cat /tmp/bdev.json | jq
{
"subsystems": [
{
"subsystem": "bdev",
"config": [
{
"method": "bdev_nvme_attach_controller",
"params": {
"trtype": "tcp",
"adrfam": "IPv4",
"name": "Nvme0",
"subnqn": "nqn.2018-09.io.spdk:cnode1",
"traddr": "10.0.0.1",
"trsvcid": "4420"
}
}
]
}
]
}
```
- Prepare fio configuration file
```bash
cat /tmp/fio.conf
[global]
ioengine=/spdk/build/fio/spdk_bdev
spdk_json_conf=/tmp/bdev.json
thread=1
direct=1
group_reporting=1
bs=4k
rw=randread
rwmixread=70
time_based=1
runtime=10
norandommap=1
[filename0]
filename=Nvme0n1
iodepth=8
```
- Run fio bdev plugin as initiator
```bash
/usr/src/fio/fio /tmp/fio.conf
```
## Zoned Block Devices
SPDK has a zoned block device API (bdev_zone.h) which currently supports Open-channel SSDs,
NVMe Zoned Namespaces (ZNS), and the virtual zoned block device SPDK module.
If you wish to run fio against a SPDK zoned block device, you can use the fio option:
```bash
zonemode=zbd
```
It is recommended to use a fio version newer than version 3.26, if using --numjobs > 1.
If using --numjobs=1, fio version >= 3.23 should suffice.
See zbd_example.fio in this directory for a zoned block device example config.
### Maximum Open Zones
Most zoned block devices have a resource constraint on the amount of zones which can be in an opened
state at any point in time. It is very important to not exceed this limit.
You can control how many zones fio will keep in an open state by using the
`--max_open_zones` option.
If you use a fio version newer than 3.26, fio will automatically detect and set the proper value.
If you use an old version of fio, make sure to provide the proper --max_open_zones value yourself.
### Maximum Active Zones
Zoned block devices may also have a resource constraint on the number of zones that can be active at
any point in time. Unlike `max_open_zones`, fio currently does not manage this constraint, and
there is thus no option to limit it either.
Since the max active zones limit (by definition) has to be greater than or equal to the max open
zones limit, the easiest way to work around that fio does not manage this constraint, is to start
with a clean state each run (except for read-only workloads), by resetting all zones before fio
starts running its jobs by using the engine option:
```bash
--initial_zone_reset=1
```
### Zone Append
When running fio against a zoned block device you need to specify --iodepth=1 to avoid
"Zone Invalid Write: The write to a zone was not at the write pointer." I/O errors.
However, if your zoned block device supports Zone Append, you can use the engine option:
```bash
--zone_append=1
```
To send zone append commands instead of write commands to the zoned block device.
When using zone append, you will be able to specify a --iodepth greater than 1.

View File

@ -0,0 +1,26 @@
{
"subsystems": [
{
"subsystem": "bdev",
"config": [
{
"method": "bdev_malloc_create",
"params": {
"name": "Malloc0",
"num_blocks": 2097152,
"block_size": 512
}
},
{
"method": "bdev_zone_block_create",
"params": {
"base_bdev": "Malloc0",
"name": "Zone0",
"zone_capacity": 262144,
"optimal_open_zones": 8
}
}
]
}
]
}

View File

@ -34,8 +34,10 @@
#include "spdk/stdinc.h"
#include "spdk/bdev.h"
#include "spdk/bdev_zone.h"
#include "spdk/accel_engine.h"
#include "spdk/env.h"
#include "spdk/init.h"
#include "spdk/thread.h"
#include "spdk/log.h"
#include "spdk/string.h"
@ -48,6 +50,12 @@
#include "fio.h"
#include "optgroup.h"
#ifdef for_each_rw_ddir
#define FIO_HAS_ZBD (FIO_IOOPS_VERSION >= 26)
#else
#define FIO_HAS_ZBD (0)
#endif
/* FreeBSD is missing CLOCK_MONOTONIC_RAW,
* so alternative is provided. */
#ifndef CLOCK_MONOTONIC_RAW /* Defined in glibc bits/time.h */
@ -58,8 +66,11 @@ struct spdk_fio_options {
void *pad;
char *conf;
char *json_conf;
char *log_flags;
unsigned mem_mb;
int mem_single_seg;
int initial_zone_reset;
int zone_append;
};
struct spdk_fio_request {
@ -71,6 +82,7 @@ struct spdk_fio_target {
struct spdk_bdev *bdev;
struct spdk_bdev_desc *desc;
struct spdk_io_channel *ch;
bool zone_append_enabled;
TAILQ_ENTRY(spdk_fio_target) link;
};
@ -89,12 +101,24 @@ struct spdk_fio_thread {
TAILQ_ENTRY(spdk_fio_thread) link;
};
struct spdk_fio_zone_cb_arg {
struct spdk_fio_target *target;
struct spdk_bdev_zone_info *spdk_zones;
int completed;
uint64_t offset_blocks;
struct zbd_zone *fio_zones;
unsigned int nr_zones;
};
static bool g_spdk_env_initialized = false;
static const char *g_json_config_file = NULL;
static int spdk_fio_init(struct thread_data *td);
static void spdk_fio_cleanup(struct thread_data *td);
static size_t spdk_fio_poll_thread(struct spdk_fio_thread *fio_thread);
static int spdk_fio_handle_options(struct thread_data *td, struct fio_file *f,
struct spdk_bdev *bdev);
static int spdk_fio_handle_options_per_target(struct thread_data *td, struct fio_file *f);
static pthread_t g_init_thread_id = 0;
static pthread_mutex_t g_init_mtx = PTHREAD_MUTEX_INITIALIZER;
@ -196,8 +220,8 @@ spdk_fio_bdev_init_start(void *arg)
{
bool *done = arg;
spdk_app_json_config_load(g_json_config_file, SPDK_DEFAULT_RPC_ADDR,
spdk_fio_bdev_init_done, done, true);
spdk_subsystem_init_from_json_config(g_json_config_file, SPDK_DEFAULT_RPC_ADDR,
spdk_fio_bdev_init_done, done, true);
}
static void
@ -263,6 +287,21 @@ spdk_init_thread_poll(void *arg)
}
spdk_unaffinitize_thread();
if (eo->log_flags) {
char *tok = strtok(eo->log_flags, ",");
do {
rc = spdk_log_set_flag(tok);
if (rc < 0) {
SPDK_ERRLOG("unknown spdk log flag %s\n", tok);
rc = EINVAL;
goto err_exit;
}
} while ((tok = strtok(NULL, ",")) != NULL);
#ifdef DEBUG
spdk_log_set_print_level(SPDK_LOG_DEBUG);
#endif
}
spdk_thread_lib_init(NULL, 0);
/* Create an SPDK thread temporarily */
@ -403,6 +442,27 @@ out:
return rc;
}
static bool
fio_redirected_to_dev_null(void)
{
char path[PATH_MAX] = "";
ssize_t ret;
ret = readlink("/proc/self/fd/1", path, sizeof(path));
if (ret == -1 || strcmp(path, "/dev/null") != 0) {
return false;
}
ret = readlink("/proc/self/fd/2", path, sizeof(path));
if (ret == -1 || strcmp(path, "/dev/null") != 0) {
return false;
}
return true;
}
/* Called for each thread to fill in the 'real_file_size' member for
* each file associated with this thread. This is called prior to
* the init operation (spdk_fio_init()) below. This call will occur
@ -416,16 +476,18 @@ spdk_fio_setup(struct thread_data *td)
unsigned int i;
struct fio_file *f;
/* we might be running in a daemonized FIO instance where standard
* input and output were closed and fds 0, 1, and 2 are reused
* for something important by FIO. We can't ensure we won't print
* anything (and so will our dependencies, e.g. DPDK), so abort early.
* (is_backend is an fio global variable)
/*
* If we're running in a daemonized FIO instance, it's possible
* fd 1/2 were re-used for something important by FIO. Newer fio
* versions are careful to redirect those to /dev/null, but if we're
* not, we'll abort early, so we don't accidentally write messages to
* an important file, etc.
*/
if (is_backend) {
if (is_backend && !fio_redirected_to_dev_null()) {
char buf[1024];
snprintf(buf, sizeof(buf),
"SPDK FIO plugin won't work with daemonized FIO server.");
"SPDK FIO plugin is in daemon mode, but stdout/stderr "
"aren't redirected to /dev/null. Aborting.");
fio_server_text_output(FIO_LOG_ERR, buf, sizeof(buf));
return -1;
}
@ -455,6 +517,7 @@ spdk_fio_setup(struct thread_data *td)
for_each_file(td, f, i) {
struct spdk_bdev *bdev;
int rc;
if (strcmp(f->file_name, "*") == 0) {
continue;
@ -468,7 +531,13 @@ spdk_fio_setup(struct thread_data *td)
f->real_file_size = spdk_bdev_get_num_blocks(bdev) *
spdk_bdev_get_block_size(bdev);
f->filetype = FIO_TYPE_BLOCK;
fio_file_set_size_known(f);
rc = spdk_fio_handle_options(td, f, bdev);
if (rc) {
return rc;
}
}
return 0;
@ -528,21 +597,48 @@ spdk_fio_bdev_open(void *arg)
f->engine_data = target;
rc = spdk_fio_handle_options_per_target(td, f);
if (rc) {
SPDK_ERRLOG("Failed to handle options for: %s\n", f->file_name);
f->engine_data = NULL;
spdk_put_io_channel(target->ch);
spdk_bdev_close(target->desc);
free(target);
fio_thread->failed = true;
return;
}
TAILQ_INSERT_TAIL(&fio_thread->targets, target, link);
}
}
/* Called for each thread, on that thread, shortly after the thread
* starts.
*
* Also called by spdk_fio_report_zones(), since we need an I/O channel
* in order to get the zone report. (fio calls the .report_zones callback
* before it calls the .init callback.)
* Therefore, if fio was run with --zonemode=zbd, the thread will already
* be initialized by the time that fio calls the .init callback.
*/
static int
spdk_fio_init(struct thread_data *td)
{
struct spdk_fio_thread *fio_thread;
int rc;
spdk_fio_init_thread(td);
/* If thread has already been initialized, do nothing. */
if (td->io_ops_data) {
return 0;
}
rc = spdk_fio_init_thread(td);
if (rc) {
return rc;
}
fio_thread = td->io_ops_data;
assert(fio_thread);
fio_thread->failed = false;
spdk_thread_send_msg(fio_thread->thread, spdk_fio_bdev_open, td);
@ -644,6 +740,17 @@ typedef enum fio_q_status fio_q_status_t;
typedef int fio_q_status_t;
#endif
static uint64_t
spdk_fio_zone_bytes_to_blocks(struct spdk_bdev *bdev, uint64_t offset_bytes, uint64_t *zone_start,
uint64_t num_bytes, uint64_t *num_blocks)
{
uint32_t block_size = spdk_bdev_get_block_size(bdev);
*zone_start = (offset_bytes / (spdk_bdev_get_zone_size(bdev) * block_size)) *
spdk_bdev_get_zone_size(bdev);
*num_blocks = num_bytes / block_size;
return (offset_bytes % block_size) | (num_bytes % block_size);
}
static fio_q_status_t
spdk_fio_queue(struct thread_data *td, struct io_u *io_u)
{
@ -666,9 +773,21 @@ spdk_fio_queue(struct thread_data *td, struct io_u *io_u)
spdk_fio_completion_cb, fio_req);
break;
case DDIR_WRITE:
rc = spdk_bdev_write(target->desc, target->ch,
io_u->buf, io_u->offset, io_u->xfer_buflen,
spdk_fio_completion_cb, fio_req);
if (!target->zone_append_enabled) {
rc = spdk_bdev_write(target->desc, target->ch,
io_u->buf, io_u->offset, io_u->xfer_buflen,
spdk_fio_completion_cb, fio_req);
} else {
uint64_t zone_start, num_blocks;
if (spdk_fio_zone_bytes_to_blocks(target->bdev, io_u->offset, &zone_start,
io_u->xfer_buflen, &num_blocks) != 0) {
rc = -EINVAL;
break;
}
rc = spdk_bdev_zone_append(target->desc, target->ch, io_u->buf,
zone_start, num_blocks, spdk_fio_completion_cb,
fio_req);
}
break;
case DDIR_TRIM:
rc = spdk_bdev_unmap(target->desc, target->ch,
@ -755,6 +874,308 @@ spdk_fio_invalidate(struct thread_data *td, struct fio_file *f)
return 0;
}
#if FIO_HAS_ZBD
static int
spdk_fio_get_zoned_model(struct thread_data *td, struct fio_file *f, enum zbd_zoned_model *model)
{
struct spdk_bdev *bdev;
if (f->filetype != FIO_TYPE_BLOCK) {
SPDK_ERRLOG("Unsupported filetype: %d\n", f->filetype);
return -EINVAL;
}
bdev = spdk_bdev_get_by_name(f->file_name);
if (!bdev) {
SPDK_ERRLOG("Cannot get zoned model, no bdev with name: %s\n", f->file_name);
return -ENODEV;
}
if (spdk_bdev_is_zoned(bdev)) {
*model = ZBD_HOST_MANAGED;
} else {
*model = ZBD_NONE;
}
return 0;
}
static void
spdk_fio_bdev_get_zone_info_done(struct spdk_bdev_io *bdev_io, bool success, void *arg)
{
struct spdk_fio_zone_cb_arg *cb_arg = arg;
unsigned int i;
int handled_zones = 0;
if (!success) {
spdk_bdev_free_io(bdev_io);
cb_arg->completed = -EIO;
return;
}
for (i = 0; i < cb_arg->nr_zones; i++) {
struct spdk_bdev_zone_info *zone_src = &cb_arg->spdk_zones[handled_zones];
struct zbd_zone *zone_dest = &cb_arg->fio_zones[handled_zones];
uint32_t block_size = spdk_bdev_get_block_size(cb_arg->target->bdev);
zone_dest->type = ZBD_ZONE_TYPE_SWR;
zone_dest->len = spdk_bdev_get_zone_size(cb_arg->target->bdev) * block_size;
zone_dest->capacity = zone_src->capacity * block_size;
zone_dest->start = zone_src->zone_id * block_size;
zone_dest->wp = zone_src->write_pointer * block_size;
switch (zone_src->state) {
case SPDK_BDEV_ZONE_STATE_EMPTY:
zone_dest->cond = ZBD_ZONE_COND_EMPTY;
break;
case SPDK_BDEV_ZONE_STATE_IMP_OPEN:
zone_dest->cond = ZBD_ZONE_COND_IMP_OPEN;
break;
case SPDK_BDEV_ZONE_STATE_EXP_OPEN:
zone_dest->cond = ZBD_ZONE_COND_EXP_OPEN;
break;
case SPDK_BDEV_ZONE_STATE_FULL:
zone_dest->cond = ZBD_ZONE_COND_FULL;
break;
case SPDK_BDEV_ZONE_STATE_CLOSED:
zone_dest->cond = ZBD_ZONE_COND_CLOSED;
break;
case SPDK_BDEV_ZONE_STATE_READ_ONLY:
zone_dest->cond = ZBD_ZONE_COND_READONLY;
break;
case SPDK_BDEV_ZONE_STATE_OFFLINE:
zone_dest->cond = ZBD_ZONE_COND_OFFLINE;
break;
default:
spdk_bdev_free_io(bdev_io);
cb_arg->completed = -EIO;
return;
}
handled_zones++;
}
spdk_bdev_free_io(bdev_io);
cb_arg->completed = handled_zones;
}
static void
spdk_fio_bdev_get_zone_info(void *arg)
{
struct spdk_fio_zone_cb_arg *cb_arg = arg;
struct spdk_fio_target *target = cb_arg->target;
int rc;
rc = spdk_bdev_get_zone_info(target->desc, target->ch, cb_arg->offset_blocks,
cb_arg->nr_zones, cb_arg->spdk_zones,
spdk_fio_bdev_get_zone_info_done, cb_arg);
if (rc < 0) {
cb_arg->completed = rc;
}
}
static int
spdk_fio_report_zones(struct thread_data *td, struct fio_file *f, uint64_t offset,
struct zbd_zone *zones, unsigned int nr_zones)
{
struct spdk_fio_target *target;
struct spdk_fio_thread *fio_thread;
struct spdk_fio_zone_cb_arg cb_arg;
uint32_t block_size;
int rc;
if (nr_zones == 0) {
return 0;
}
/* spdk_fio_report_zones() is only called before the bdev I/O channels have been created.
* Since we need an I/O channel for report_zones(), call spdk_fio_init() to initialize
* the thread early.
* spdk_fio_report_zones() might be called several times by fio, if e.g. the zone report
* for all zones does not fit in the buffer that fio has allocated for the zone report.
* It is safe to call spdk_fio_init(), even if the thread has already been initialized.
*/
rc = spdk_fio_init(td);
if (rc) {
return rc;
}
fio_thread = td->io_ops_data;
target = f->engine_data;
assert(fio_thread);
assert(target);
block_size = spdk_bdev_get_block_size(target->bdev);
cb_arg.target = target;
cb_arg.completed = 0;
cb_arg.offset_blocks = offset / block_size;
cb_arg.fio_zones = zones;
cb_arg.nr_zones = spdk_min(nr_zones, spdk_bdev_get_num_zones(target->bdev));
cb_arg.spdk_zones = calloc(1, sizeof(*cb_arg.spdk_zones) * cb_arg.nr_zones);
if (!cb_arg.spdk_zones) {
SPDK_ERRLOG("Could not allocate memory for zone report!\n");
rc = -ENOMEM;
goto cleanup_thread;
}
spdk_thread_send_msg(fio_thread->thread, spdk_fio_bdev_get_zone_info, &cb_arg);
do {
spdk_fio_poll_thread(fio_thread);
} while (!cb_arg.completed);
/* Free cb_arg.spdk_zones. The report in fio format is stored in cb_arg.fio_zones/zones. */
free(cb_arg.spdk_zones);
rc = cb_arg.completed;
if (rc < 0) {
SPDK_ERRLOG("Failed to get zone info: %d\n", rc);
goto cleanup_thread;
}
/* Return the amount of zones successfully copied. */
return rc;
cleanup_thread:
spdk_fio_cleanup(td);
return rc;
}
static void
spdk_fio_bdev_zone_reset_done(struct spdk_bdev_io *bdev_io, bool success, void *arg)
{
struct spdk_fio_zone_cb_arg *cb_arg = arg;
spdk_bdev_free_io(bdev_io);
if (!success) {
cb_arg->completed = -EIO;
} else {
cb_arg->completed = 1;
}
}
static void
spdk_fio_bdev_zone_reset(void *arg)
{
struct spdk_fio_zone_cb_arg *cb_arg = arg;
struct spdk_fio_target *target = cb_arg->target;
int rc;
rc = spdk_bdev_zone_management(target->desc, target->ch, cb_arg->offset_blocks,
SPDK_BDEV_ZONE_RESET,
spdk_fio_bdev_zone_reset_done, cb_arg);
if (rc < 0) {
cb_arg->completed = rc;
}
}
static int
spdk_fio_reset_zones(struct spdk_fio_thread *fio_thread, struct spdk_fio_target *target,
uint64_t offset, uint64_t length)
{
uint64_t zone_size_bytes;
uint32_t block_size;
int rc;
assert(fio_thread);
assert(target);
block_size = spdk_bdev_get_block_size(target->bdev);
zone_size_bytes = spdk_bdev_get_zone_size(target->bdev) * block_size;
for (uint64_t cur = offset; cur < offset + length; cur += zone_size_bytes) {
struct spdk_fio_zone_cb_arg cb_arg = {
.target = target,
.completed = 0,
.offset_blocks = cur / block_size,
};
spdk_thread_send_msg(fio_thread->thread, spdk_fio_bdev_zone_reset, &cb_arg);
do {
spdk_fio_poll_thread(fio_thread);
} while (!cb_arg.completed);
rc = cb_arg.completed;
if (rc < 0) {
SPDK_ERRLOG("Failed to reset zone: %d\n", rc);
return rc;
}
}
return 0;
}
static int
spdk_fio_reset_wp(struct thread_data *td, struct fio_file *f, uint64_t offset, uint64_t length)
{
return spdk_fio_reset_zones(td->io_ops_data, f->engine_data, offset, length);
}
#endif
#if FIO_IOOPS_VERSION >= 30
static int spdk_fio_get_max_open_zones(struct thread_data *td, struct fio_file *f,
unsigned int *max_open_zones)
{
struct spdk_bdev *bdev;
bdev = spdk_bdev_get_by_name(f->file_name);
if (!bdev) {
SPDK_ERRLOG("Cannot get max open zones, no bdev with name: %s\n", f->file_name);
return -ENODEV;
}
*max_open_zones = spdk_bdev_get_max_open_zones(bdev);
return 0;
}
#endif
static int
spdk_fio_handle_options(struct thread_data *td, struct fio_file *f, struct spdk_bdev *bdev)
{
struct spdk_fio_options *fio_options = td->eo;
if (fio_options->initial_zone_reset && spdk_bdev_is_zoned(bdev)) {
#if FIO_HAS_ZBD
int rc = spdk_fio_init(td);
if (rc) {
return rc;
}
rc = spdk_fio_reset_zones(td->io_ops_data, f->engine_data, 0, f->real_file_size);
if (rc) {
spdk_fio_cleanup(td);
return rc;
}
#else
SPDK_ERRLOG("fio version is too old to support zoned block devices\n");
#endif
}
return 0;
}
static int
spdk_fio_handle_options_per_target(struct thread_data *td, struct fio_file *f)
{
struct spdk_fio_target *target = f->engine_data;
struct spdk_fio_options *fio_options = td->eo;
if (fio_options->zone_append && spdk_bdev_is_zoned(target->bdev)) {
if (spdk_bdev_io_type_supported(target->bdev, SPDK_BDEV_IO_TYPE_ZONE_APPEND)) {
SPDK_DEBUGLOG(fio_bdev, "Using zone appends instead of writes on: '%s'\n",
f->file_name);
target->zone_append_enabled = true;
} else {
SPDK_WARNLOG("Falling back to writes on: '%s' - bdev lacks zone append cmd\n",
f->file_name);
}
}
return 0;
}
static struct fio_option options[] = {
{
.name = "spdk_conf",
@ -793,6 +1214,35 @@ static struct fio_option options[] = {
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_INVALID,
},
{
.name = "log_flags",
.lname = "log flags",
.type = FIO_OPT_STR_STORE,
.off1 = offsetof(struct spdk_fio_options, log_flags),
.help = "SPDK log flags to enable",
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_INVALID,
},
{
.name = "initial_zone_reset",
.lname = "Reset Zones on initialization",
.type = FIO_OPT_INT,
.off1 = offsetof(struct spdk_fio_options, initial_zone_reset),
.def = "0",
.help = "Reset Zones on initialization (0=disable, 1=Reset All Zones)",
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_INVALID,
},
{
.name = "zone_append",
.lname = "Use zone append instead of write",
.type = FIO_OPT_INT,
.off1 = offsetof(struct spdk_fio_options, zone_append),
.def = "0",
.help = "Use zone append instead of write (1=zone append, 0=write)",
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_INVALID,
},
{
.name = NULL,
},
@ -823,6 +1273,14 @@ struct ioengine_ops ioengine = {
.iomem_free = spdk_fio_iomem_free,
.io_u_init = spdk_fio_io_u_init,
.io_u_free = spdk_fio_io_u_free,
#if FIO_HAS_ZBD
.get_zoned_model = spdk_fio_get_zoned_model,
.report_zones = spdk_fio_report_zones,
.reset_wp = spdk_fio_reset_wp,
#endif
#if FIO_IOOPS_VERSION >= 30
.get_max_open_zones = spdk_fio_get_max_open_zones,
#endif
.option_struct_size = sizeof(struct spdk_fio_options),
.options = options,
};
@ -852,3 +1310,5 @@ static void fio_exit spdk_fio_unregister(void)
}
unregister_ioengine(&ioengine);
}
SPDK_LOG_REGISTER_COMPONENT(fio_bdev)

View File

@ -0,0 +1,18 @@
[global]
ioengine=spdk_bdev
spdk_json_conf=./examples/bdev/fio_plugin/bdev_zoned.json
thread=1
direct=1
time_based
runtime=10
rw=randwrite
bs=16K
zonemode=zbd
max_open_zones=8
initial_zone_reset=1
zone_append=1
iodepth=64
[test]
filename=Zone0
numjobs=1

View File

@ -37,6 +37,6 @@ APP = hello_bdev
C_SRCS := hello_bdev.c
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event_bdev
SPDK_LIB_LIST = $(ALL_MODULES_LIST) event event_bdev
include $(SPDK_ROOT_DIR)/mk/spdk.app.mk

View File

@ -38,6 +38,6 @@ APP = blobcli
C_SRCS := blobcli.c
# Don't link bdev_lvol in blobcli - otherwise this utility cannot operate on an lvolstore
SPDK_LIB_LIST = $(filter-out bdev_lvol,$(ALL_MODULES_LIST)) event_bdev
SPDK_LIB_LIST = $(filter-out bdev_lvol,$(ALL_MODULES_LIST)) event event_bdev
include $(SPDK_ROOT_DIR)/mk/spdk.app.mk

Some files were not shown because too many files have changed in this diff Show More