Commit Graph

5332 Commits

Author SHA1 Message Date
Shuhei Matsumoto
67a03bc73a ut/bdev_nvme: spdk_nvme_detach() stub calls ut_detach_ctrlr() if ctrlr is attached by ut_attach_ctrlr()
bdev_nvme_delete() calls spdk_nvme_detach() in the end. However,
previously spdk_nvme_detach() stub did nothing and ut_detach_ctrlr()
was called separately if ctrlr wass attached by ut_detach_ctrlr().

This was to differentiate the two cases, ctrlr is statically assigned
or dynamically attached by ut_detach_ctrlr().

This might be a little confusing. Hence by adding a flag, attached,
to ctrlr, merge ut_detach_ctrlr() into spdk_nvme_detach(), and remove
ut_detach_ctrlr() calls.

Besides, change one SPDK_CU_ASSERT_FATAL to return NULL because the
other cases do that and the callers for ut_attach_ctrlr() already have
SPDK_CU_ASSERT_FATAL.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2a73f57c6031819d3ae441a6874127ff5d53fc04
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7311
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-12 09:51:03 +00:00
Shuhei Matsumoto
d9e3ffea48 ut/bdev_nvme: Use bdev_nvme_find_io_path() in unit tests
This will make the following change simpler and testing
bdev_nvme_find_io_path() will be good.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iac82bdba88e4abfa41c2ce04f10ce41a6b7dbd71
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7106
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: Paul Luse <paul.e.luse@intel.com>
2021-04-12 09:51:03 +00:00
Shuhei Matsumoto
6d573781b5 lib/iscsi: Rename current_datain_offset of task by current_data_offset
The following patches will aggregate multiple Data-OUT PDUs into a
single write subtask and we will not be able to use reqh->buffer_offset
to track the current offset of large write I/O to submit write subtasks.

On the other hand, each iscsi_task or iscsi_subtask is only read or write

Hence rename current_datain_offset of iscsi_task by current_data_offset
in this patch.

The next patch will use it to track the current offset of large write I/O

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I922582c5b9474a3c512f81d0f0425158a38a9a8d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6423
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>
2021-04-12 09:49:31 +00:00
Shuhei Matsumoto
acdeb53f4b lib/iscsi: Increase buffer size to 64KB at most when more Data-OUT PDUs follow
The following patches will want to aggregate multiple Data-OUT PDUs
into the same data buffer, but it will be 64KB at most.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I72eabbeae0b027c2fbff2a5837d180b06b0a1b49
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6418
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-04-12 09:49:31 +00:00
Shuhei Matsumoto
2ef97692bc lib/iscsi: Create subtask after reading data segment for Data-OUT PDU
The following patches will change the handler for Data-OUT PDU to
submit subtask only when 64KB data is read or F bit is set.

Previously, we had created a subtask when processing header and
before reading data segment.  Creating a subtask beforehand is not
convenient for the following changes.

Hence create a subtask after reading data segment.

If LUN is removed while processing the Data-OUT PDU, the corresponding
primary task will be terminated by iscsi_clear_all_transfer_task(),
and any subtask completion is not sent to initiator. Hence we can
reject the received Data-OUT PDU safely.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifb6d6988676080b458b31d12fef065f3c1de0cb6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6415
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>
2021-04-12 09:49:31 +00:00
Jin Yu
59237d22b8 lib: add a hotplug lib for device
The hotplug lib can be used for pcie devices
such as nvme, virtio_blk and virtio scsi.

For the sigbus handler, there is only one in a
process and it should handle all the devices.

And align nvme to the hotplug lib

Add the ADD uevent support for allowing the
device hotplug.

Change-Id: I82cd3b4af38ca24cee8b041a215a85c4a69e60f7
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5653
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: <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-04-12 09:48:21 +00:00
Michal Berger
f40b0b1629 pgkdep/git: Upgrade ice driver to 1.4.11
The old 1.2.1 version doesn't compile against latest 5.11.x kernels
(e.g. due to recent changes in include/net/xdp.h) so upgrade to the
latest compatible release.

Also, move the url to sourceforge since ice is released more often
there under e1000 project.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I08b7beae922addeb877fe321679151b02bd253db
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7011
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-04-12 09:43:31 +00:00
Michal Berger
0f8bff29f8 pkgpdep/git: Patch QAT to adjust for changes in recent kernels 5.11.x
Most notably, crypto/sha.h was split into two separate header files,
crypto/sha1.h and crypto/sha2.h.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I43ae61034f743bf4aae7f2f29919eec92d851f01
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7010
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>
Community-CI: Mellanox Build Bot
2021-04-12 09:43:31 +00:00
Michal Berger
c09b139e61 test/nvmf: Use rxe_cfg to get rxe-enabled net devices
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Iafc067f880525f25363db1adf9a94a9fc9215455
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6994
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
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-04-12 09:41:20 +00:00
Ben Walker
2ab0506ef7 test/nvmf: Don't load kernel modules for custom transports
For custom transports, skip the kernel module loading and
unloading steps.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I193c62ffa0a9a5060b4bc504b39db3b6f660e1a3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3584
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-04-10 03:49:40 +00:00
Ben Walker
0254ef6d2b sock: Fix return code for adding a socket to a group twice
Also fix the comment. It's never going to make sense to add a socket
to a group twice.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Id4845b77114aef32bbe4ea0e53d2e1fde8e116f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7204
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-04-09 17:15:57 +00:00
Michal Berger
c84ecccca3 vhost/windows: Make sure host drive is properly cleaned up
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I53ec43c62f5ab7bef2719119252eec3c7c6b90d9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7269
Reviewed-by: Karol Latecki <karol.latecki@intel.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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-04-08 16:38:39 +00:00
Shuhei Matsumoto
0247a9945a thread: Add spdk_io_channel_get_io_device() to get io_device from io_channel
This will be useful as the same purpose as
spdk_io_channel_iter_get_io_device() and will be used in the
following patches.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id45f5980c65543703b91df2afeb47448232fe503
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7237
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-04-08 16:10:26 +00:00
Shuhei Matsumoto
2b8661d6ac bdev/nvme: Move nvme_ctrlr_depopulate_namespace_done() to common.c
Moving nvme_ctrlr_depopulate_namespace_done() to common.c removes the
stub from bdev_ocssd_ut.c and will simplify the upcoming changes.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia94a88ca77518c7df08b52aa9298cdea5997ca1e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7135
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-04-08 16:10:26 +00:00
Shuhei Matsumoto
610dd86b8c bdev/nvme: Inline nvme_bdev_ns_to_bdev() and remove it
nvme_bdev_ns_to_bdev() was introduced because nvme_ns->bdev may be
removed to support multipath. However, it is unlikely now.

Hence it is easier to read to stop using nvme_bdev_ns_to_bdev() and
access nvme_ns->bdev directly.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iaf35455218761bafd03060a21110ad1c4098b1db
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7098
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-04-08 16:10:26 +00:00
Shuhei Matsumoto
08e2210ace bdev/nvme: Merge callback and spdk_nvme_detach() into bdev_nvme_add_trid()
This change separates failover case more clearly, and will make
the following changes simpler.

Merge spdk_nvme_detach() and populate_namespaces_cb() into
bdev_nvme_add_secondary_trid(). Then change the return type of
bdev_nvme_add_secondary_trid() to void and move the comment to the
head of it.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0eb706728cf1b9ad7031eb66e11880a47e2ba767
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7044
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>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-04-08 16:10:26 +00:00
Shuhei Matsumoto
0e3de45def bdev/nvme: Refactor add_trid() and rename it by add_secondary_trid()
Clean up bdev_nvme_add_trid() by factoring out comparison of namespaces
and comparison of trids into helper functions, bdev_nvme_compare_namespaces()
and bdev_nvme_compare_trids(), respectively.

Then rename bdev_nvme_add_trid() by bdev_nvme_add_secondary_trid().

Rename is for clarification and clean-up is for the next patch.
The next patch will merge spdk_nvme_detach() and populate_namespaces_cb()
into the renamed bdev_nvme_secondary_trid(). Clean-up makes the
next patch simpler.

One note is that checking if the type of trid is not PCIe is done
by holding mutex now to prioritize clean up.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idc8652329dd2c721d101a724ec1a57a66c4174a7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7094
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-04-08 16:10:26 +00:00
Alexey Marchuk
c3853598b1 nvme/ut: Add test to cover failed split of SGL list
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Iff99d5402ffaf3a526a2ac04539672d47a0a1ccb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7093
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-04-05 22:58:57 +00:00
Michal Berger
7347f60bbc autotest: Use rpc_cmd() for rpc plugin-based tests
Also, create a common dir which will hold symlinks to all existing
plugins used in the tests. Location of the actual lib is not changed
so the relation to the given test suite is clearly preserved.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Icb70bbc61fbfa3325a357d5dd93f554ff132a3b9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7146
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-04-02 08:22:42 +00:00
Michal Berger
31f8d52d13 test/bdev: Switch to rpc_cmd()
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I01eb2e6b6da1e633278a1998ca8982ea8a132720
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7088
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: Jim Harris <james.r.harris@intel.com>
2021-04-02 08:22:42 +00:00
Michal Berger
08d4dce28c test/common: Allow rpc_cmd() to execute multiple commands
This allows to pass to rpc_cmd() sets of commands via stdin. E.g.:

rpc_cmd <<-CMDS
	bdev_malloc_create -b Malloc0 32 512
	bdev_malloc_create -b Malloc1 32 512
	bdev_malloc_create -b Malloc2 32 512
CMDS

Since rpc.py is already running in a server mode, this is slightly
faster than grouping commands and running scripts/rpc.py directly.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I29fbcf3f2751400980d35b4de2cce2da1cd2bf2a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7087
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-04-02 08:22:42 +00:00
Michal Berger
9aa3c063da test/common: Don't disable unit tests for scan|auto builds
Unittest job is now split into three smaller jobs, each of them
requires unit tests to be built.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ibc0dfbf6f7395a9dfe23242b532fb5cb1f8dd8f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6839
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-04-01 11:20:35 +00:00
Mao Jiang
b69356a85d test/nvme_ctrlr: cases for ctrlr adding and removing process
Change-Id: Ie3a5d31e8d5da50935491804e31b2078e6893a1f
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7077
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-03-31 08:52:08 +00:00
Ziye Yang
f0956d33fb nvmf/tcp: Move the accel_engine into the poll group.
With this change, each polling group will use one
accel_engine channel. This change will be more suitable
to utlize the underlying accelerated device.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Ibab183a1f65baff7e58529ee05e96b1b04731285
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7055
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-03-30 11:50:20 +00:00
Michal Berger
85d48c64a9 autotest: Make sure core dumps are generated for ASAN and UBSAN
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I7d85daa3a5c90cdc250caca386a14078928df4c1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6997
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-03-30 11:49:17 +00:00
ChengqiangMeng
dfe8d308a1 unittest/nvme_ns: increase code coverage
nvme_ns_has_supported_iocs_specific_data and nvme_ctrlr_identify_ns_iocs_specific
and nvme_ns_free_zns_specific_data code comprehensive coverage.

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: I2a3d26fbfbdd052978c7af282ce88ca4f3da83b7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6719
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-03-30 11:48:54 +00:00
Changpeng Liu
5922706ccb test/nvmf_vfio_user: simplify the creation of Unix domain socket
We only need to create an empty directory for vfio-user device,
the softlink isn't required anymore, so remove it.

Change-Id: Ie3f9ce73d287be3651f4ac06483888ac0f693700
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6954
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-30 11:46:32 +00:00
Shuhei Matsumoto
1aa2537480 bdev/nvme: Merge populate_namespaces() and its callback into nvme_bdev_ctrlr_create()
The following changes will require nvme_bdev_ctrlr_create() to be
asynchronous. As a preparation, merge nvme_ctrlr_populate_namespaces()
and populate_namespaces_cb() into nvme_bdev_ctrlr_create().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I623f927da072d746b4bd83314c0f5bcb9cc34ef0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7043
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-03-30 11:43:24 +00:00
Shuhei Matsumoto
cb8aa8abc5 bdev/nvme: Not try freeing qpair when it is NULL, and add test scenario
The API spdk_nvme_ctrlr_free_io_qpair() returns immediately if the
passed qpair is NULL, but calling spdk_nvme_ctrlr_free_io_qpair()
with NULL should be avoided.

This patch cleans up the code to ensure that nvme_ch->qpair is NULL if
disconnected and spdk_nvme_ctrlr_free_io_qpair() is called only if
nvme_ch->qpair is not NULL.

Then add a test scenario that two reset requests were submitted
simultaneously and the first reset request failed and then the second
reset request also failed. This verifies the refactoring done in the
next patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iae461f7f826b0e1a4607a17e528c04a642242d6e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7041
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-03-30 11:43:24 +00:00
Niklas Cassel
059dcf1da1 bdev/nvme: add support for zoned namespaces
Add support for zoned namespaces in the bdev/nvme module.

Query the namespace type, and if a zoned namespace is found, set the
bdev struct members needed by the bdev_zone.h APIs.

Note that while vbdev_zone_block and bdev_ocssd have zone locks,
bdev/nvme does not need any kind of zone lock, because NVMe ZNS
supports append natively.

The whole point of the zone append command is that you don't need any
locks, even when having multiple writers, since the drive will return
back the Assigned LBA where the blocks were actually written.

If a SPDK application will utilize writes instead of zone appends,
the SPDK application itself will need a per zone lock in order to
make sure that there is only one outstanding write.

Adding zone locks in bdev/nvme would reduce the performance of zone
appends, for no reason at all.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Ibacdb9b6e839624aba869c9949231343db5914be
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6911
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-03-29 10:17:45 +00:00
Niklas Cassel
9f5852d049 bdev/zone: add support for max zone append size
Add support in bdev_zone.h for getting the maximum zone append data
transfer size.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I61203e64d51601232c6578a090fa52975364c1f3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6910
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-03-29 10:17:45 +00:00
Changpeng Liu
04cd292237 nvme/quirk: add MDTS excludes interleaved metadata quirk
The specification for Maximum Data Transfer Size (MDTS) says this field
should include the length of metadata, if metadata is interleaved with the
logical block data.  However, some drives can support MDTS without counting
the interleaved metadata, so for this case SPDK will only use data length
without interleaved metadata length.

Change-Id: I29920a25885699e2689be043b87122367be0e416
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6813
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-03-29 07:38:37 +00:00
Mao Jiang
cd468b987d test/nvme_io_msg: cases for io_msg_ctrlr register and unregister
Change-Id: Icd91870712ee977c3f9d803e68e8cb4c4b2ff0e6
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6797
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-03-29 07:35:04 +00:00
Karol Latecki
b7423187a2 autotest.sh: call rdma_device_init only for RDMA tests
Check test flags before calling rdma_device_init if
it's really needed, so that we don't call it when doing
TCP tests.

Change-Id: I2675a008cf84c7c4084cb83b44c279d2a497c3cb
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6998
Tested-by: SPDK CI Jenkins <sys_sgci@intel.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>
2021-03-29 07:34:38 +00:00
Michal Berger
18020ec73b test/setup: Add tests for different block devices' setups
nvme_mount - basic test verifying if setup.sh sees mounted nvme
             devices (either partitions or the entire drive).

lvm_mount - test verifying if setup.sh sees nvme devices when
            they are part of dm setup.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Id250b4081b3e04a7f5b26401d2ae1b226fdb2d8f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5311
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: Mellanox Build Bot
2021-03-29 07:24:14 +00:00
Michal Berger
d69b091262 test/setup: Check if correct driver is in use
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I9023a311442c01ef18d05903bed2eb1513f58a0f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5310
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-03-29 07:24:14 +00:00
Michal Berger
d60bc77142 test/setup: Add tests for hugepages allocation
These tests are meant to "predict" the right number of hugepages
given setup.sh instance will set, depending on its environment
options (HUGENODE, HUGEMEM, etc.).

Change-Id: Iaf441e69d25dd59941891e1d5c3c2b0dbd77644d
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5309
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2021-03-29 07:24:14 +00:00
Michal Berger
ec94874c1e test/setup: Add initital tests for setup.sh
This is first commit from the series introducing funcrional tests
for setup.sh. Issues like #1689, #1691 showed that major changes
to setup.sh may result in quite unexpected behavior. thus to avoid
any regression, we should make sure  the core of its functionality
is properly tested.

For now, only Linux systems are supported tests-wise.

The tests are explicitly run after all OCSSD are put into PCI_BLOCKED
to make sure they won't be picked up by the tests.

Change-Id: Iac036e693bdbaac476faea3d2128cf4d95434cb2
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5308
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-03-29 07:24:14 +00:00
Karol Latecki
cd94246487 test/common: remove sed commands in vm_setup.sh
Some time ago Qemu submodules links were changed to
use https:// instead of git:// so there's no need
to sed this.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: If4b16e7b887af5028d208498da8d81c2fa2101d5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6847
Tested-by: SPDK CI Jenkins <sys_sgci@intel.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>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
2021-03-29 07:20:50 +00:00
Karol Latecki
253c1785e5 test/common: install vfio-user-pci capable Qemu fork
Fork needed to run Vhost tests using vfio-user.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: Iedfa85083e51c08592c9f512c6650415b49deda8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6846
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.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>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
2021-03-29 07:20:50 +00:00
Karol Latecki
5c3852713c test/vhost: add vfio-user option
Add option to connect Qemu VMs to vfio-user sockets.
This needs additional option to vhost_run to run nvmf_tgt
instead of vhost binary (currently the only way to create
vfio-user sockets) and an additional function to find
connected devices in the VMs.

Change-Id: Iaae234a11f4431a307e1da9c9a2eee123290f5a3
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6700
Tested-by: SPDK CI Jenkins <sys_sgci@intel.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>
2021-03-29 07:20:50 +00:00
Karol Latecki
9f5f5da819 test/vhost: use getopts in vhost_run function
Use getopts instead of using positional args. This
will be needed in future commits when more optional
parameters will be added.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: If575fd871f906de5f9d89b2f3972fa54e3208147
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6682
Tested-by: SPDK CI Jenkins <sys_sgci@intel.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>
2021-03-29 07:20:50 +00:00
paul luse
48c057814b test/idxd: fix allocation issue with unit test
Fixes issue #1847

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I34109935b5e8187192239fa34ff43946d0e7632f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7016
Tested-by: SPDK CI Jenkins <sys_sgci@intel.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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
2021-03-26 08:22:41 +00:00
ChengqiangMeng
844d94b8a7 unittest/nvme_rdma: increase code coverage for nvme_rdma_req
nvme_rdma_req put/get/init code comprehensive coverage.

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: I5ee5ec43410a8eef7a82f8ee304fd28393a46618
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6925
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-03-24 12:00:23 +00:00
Maciej Szwed
aaac48880d env: Register external memory with DPDK
DPDK has added APIs for registering externally allocated
memory regions. Use them instead of doing our own thing.

We have to postpone spdk_mem_unregister call in
memory_hotplug_cb() because SPDK mutex (g_spdk_mem_map_mutex)
and DPDK mutex (memory_hotplug_lock) may overlap
and cause deadlock when one thread is calling spdk_free()
(locks memory_hotplug_lock first and then tries to lock
g_spdk_mem_map_mutex) and another one is calling
vhost_session_mem_unregister() (locks g_spdk_mem_map_mutex
first and then tries to lock memory_hotplug_lock).


Change-Id: I547b4ffc3987ef088a1b659addba1456ad760a71
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3560
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>
2021-03-24 11:59:59 +00:00
Ziye Yang
d515bf739d bdev/nvme: Use the accelerated_engine
This patch really uses the accelrated engine.
Currently, we only offload the crc32c caculation,
but it can be extended.

Change-Id: If0e4c6a44b6e1e10e03f7eca355bed418d67326b
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6760
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-03-23 10:09:39 +00:00
Michal Berger
bfe83fd373 pkgdep: Add rpmdevtools package
Tools from this package are needed to handle the RPMs build.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I516341e0917998eae9c54d3194f1e091f4e5e9df
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6548
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Monica Kenguva <monica.kenguva@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-03-23 10:08:51 +00:00
Michal Berger
07596cf183 check_so_deps: Make sure number of processed .so files is updated
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ibb5a7fd6cce53a14ce4acd63085e066db32b059b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6840
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-03-23 10:08:37 +00:00
Michal Berger
432eb6c21d pkgdep/git: Update location of the irdma driver
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I1074c18998fc758baa2a27449d32e7a3f9538c67
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6896
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
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-03-23 10:05:00 +00:00
Pawel Piatek
191e6ab8d2 test/nvmf: fix non-root mode
- pass LD_LIBRARY_PATH
- use $SUDO_USER instead $USER
- support --huge-dir param via $SPDK_HUGE_DIR environment variable

Signed-off-by: Pawel Piatek <pawelx.piatek@intel.com>
Change-Id: Ib42fe8a10b2c5b7d8a888605da04fee98a600515
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6171
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: Ben Walker <benjamin.walker@intel.com>
2021-03-23 10:03:11 +00:00