Commit Graph

2021 Commits

Author SHA1 Message Date
Liu Xiaodong
021ff6edff bdev: add function to return aio's errno
This helps user to locate whether bdev_io fails in
spdk bdev layer or inside Linux AIO.
SPDK_BDEV_IO_STATUS_AIO_ERROR indicates bdev_io fails
due to Linux AIO or its lower layer's failure.

New functions spdk_bdev_io_complete_aio_status and
spdk_bdev_io_get_aio_status can be used to report out
the errno from Linux AIO.

Change-Id: I32640e4a0459cca057278c02ea5a7522f3408a02
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5690
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
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-01-20 00:13:49 +00:00
Alexey Marchuk
3289ab6d93 rdma: Remove check for translation length
With min supported DPDK >= 19.11 there is no need
to check that the buffer can be split over
several Memory Regions so we can remove this check.
Keep assert that translation length is not less than
request as a sanity check.

Change-Id: If61e673ecde28bbda8eb57a2768085715bed141a
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5938
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>
2021-01-18 13:02:20 +00:00
Ziye Yang
d478edd4ee lib/nvmf: Use the async function to caculate the crc32 for header_digest.
In this patch, we will use the accel library to do the crc32 work for the
header digest when sending the pdu in the target side.

For data digest support, will consider in the further patch.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I3169a158afd633f48bdbeb2cce1ed20e4141ae45
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5472
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-01-15 08:30:34 +00:00
Tomasz Zawadzki
77b6f4bc3e lib/bdev: add spdk_bdev_wait_for_examine()
Add spdk_bdev_wait_for_examine() API to be called
in order to report when examine on all registered bdevs finished.
It will be built in to most bdev modules RPC.

New RPC added to allow
- building it into bdev submodule
- user/orchestration to verify examination status manually

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I27db3ae42eea3e692faeea4c2a01d04586bff438
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5480
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: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-01-15 08:28:57 +00:00
Maciej Szwed
89a922221d event: Fix SPDK_SCHEDULER_REGISTER macro
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I1b7d00f7ae2675e316eb64323966f8696357e7c4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5897
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-01-15 08:28:30 +00:00
Maciej Szwed
cc0d13f7e6 event: Change _spdk_scheduler_period_set() to use usec as argument instead of ticks
That is more inline with other places we
do things like this in SPDK. Also change
argument type to uint64_t.

Change-Id: Ie98f6c37bf53d583431ea9edd7d977075aeaa7a0
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5876
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-01-15 08:28:30 +00:00
Maciej Szwed
584fb373eb scheduler: copy snapshot of thread stats to new spdk_lw_thread field
This will be used by a scheduler while balancing threads
to get information how much busy a thread is.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ib0e897a9bb5d2a71173f60cce7e1d442e67a57f9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5253
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-01-15 08:28:30 +00:00
Michael Haeuptle
02d3d439be nvme: New function to perform a NVMe subsystem reset
This commit introduces spdk_nvme_ctrlr_subsystem_reset to
perform a NVMe subsystem reset according to the NVMe spec.

Signed-off-by: Michael Haeuptle <michael.haeuptle@hpe.com>
Change-Id: If4ffae1bd92d4d16a62ec2b6a01f7373223b5705
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5488
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: Vasuki Manikarnike <vasuki.manikarnike@hpe.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-01-14 16:20:29 +00:00
Alexey Marchuk
7fabdd12b6 rdma: Add functions to support memory translation
This is the first commit in a series which aim is to
unify MRs registration and memory translation in
NVMEoF target and NVME initiator RDMA transports.

Next patches will add usage of new functions in
RDMA transports.

Change-Id: I93153d497fc4554ced14edbe545961b78bda91e3
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5121
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-01-14 16:19:48 +00:00
Naresh Gottumukkala
61dfdd2a48 nvmf/fc: FC Priority tagging and VMID support.
Add support for FC priority tagging and VMID.

Signed-off-by: Naresh Gottumukkala <raju.gottumukkala@broadcom.com>
Change-Id: Ic3b67e4a9bf33308fb08dedd0e2f39344d979f34
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5822
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-01-14 16:18:25 +00:00
Shuhei Matsumoto
6fdc71ec18 lib/thread: Defer exiting thread if thread is unregistering io_device
Current SPDK thread library has a issue which occurs if there is
a race between exiting thread and unregistering io_device.

For example, there are two threads. Thread 1 registers a device
and thread 2 gets a channel of the device. Then if thread 1 starts
exiting and unregisters the device, and then thread 2 puts the channel,
thread 2 sends a message to thread 1 to complete releasing the device,
thread 1 already moved exited. Hence thread 2 failed to send the
message.

This patch fixes the race issue. The code is verified by adding
a unit test case.

In detail, add a count, unregistering_dev, to struct spdk_thread,
increment it if a callback is specified to spdk_io_device_unregister(),
and then decrement it in _finish_unregister(), and thread_exit()
checks if it is zero.

The contents of struct spdk_thread is changed but it is not public
data structure, and hence suppress it for ABI testing.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idf5faa55335c3ea89f47ccce32687a6be2e26c68
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5796
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-01-13 10:07:51 +00:00
Changpeng Liu
2600cd92f5 nvmf: revert 'commit ae207216fb ("nvmf: remove request exec backdoor")'
spdk_nvmf_request_exec_fabrics() is still required because for coming
vfio-user transport, Fabric commands are executed synchronously, and
at that monment, the ADMIN queue was not in active state.

Change-Id: I6c53950680d0ad0ab199f66e88ab34a0af46dc14
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4234
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-01-11 23:18:07 +00:00
Jim Harris
959cfa0fd5 event: add "A" to SPDK_APP_GETOPT_STRING
-A is equivalent to --pci-allowed, which recently
replaced -W/--pci-whitelist.  But we missed adding
"A" to SPDK_APP_GETOPT_STRING, so -A was not actually
working.

Note that bdevperf was using -A to specify that timed
out I/O should be aborted. This patch changes it to
-X to avoid a conflict. It appears that something
broke with this option earlier this year though,
setting it has no actual effect. This should be
investigated separately from this patch.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5645
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-12-31 08:28:08 +00:00
Ziye Yang
9472eecbdb blob: Make the ABI compatibility of spdk_blob_open_opts structure.
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I8627347f44f0a9cb4b50f41ac5effae18b427c6d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5701
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>
2020-12-29 07:55:22 +00:00
Ziye Yang
b47f0f20b7 blob: Make the ABI compatibility of spdk_blob_opts structure.
Change-Id: I1b1806864783e944d8f55c9393228a1954051236
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5687
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>
2020-12-29 07:55:22 +00:00
Ziye Yang
3de9887d6d blob: Make the ABI compatibility for spdk_bs_opts
The purpose of this patch is to make spdk_bs_opts
for compatiblity issue.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I26d2a6bc644feede64d48890c7903f224b1fc306
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5681
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>
2020-12-29 07:55:22 +00:00
Ziye Yang
f420b9ef0a bdev: Make the small and large buffer pool configurable.
This patch includes the following work:

1 Add two fields in spdk_bdev_opts structure and make the
two fields configurable.
2 Update the unit test in bdev_ut.c
3 Revise the set_bdev_options rpc call and add the support
to use the two new fields.

Change-Id: Idd6073b3a3ffaba8161e3ffa9444a9e533e67f6d
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5664
Community-CI: Broadcom CI
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>
2020-12-28 14:05:34 +00:00
Ziye Yang
590b6e7507 nbd: Use async manner to stop nbd device.
Purpose: In order to free all the allocated resources.

Our current code uses sync behaviour, and it will not wait for all
the resources are freed if there is active I/Os, and thus we will
not free some resources, e.g., some fds will not be closed.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Iaf9a606da2049ffd0096860c46d89d094038a5ff
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5601
Community-CI: Broadcom CI
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: Sun Zhenyuan <sunzhenyuan@baidu.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
2020-12-28 14:05:15 +00:00
Jacek Kalwas
2e26faa975 nvmf: add notifications about ns to the transport
It is optional to register i.e. most transports will not need to take
any action. It allows additional verification of ns/bdev capabilities
on transport layer before actual attachment to the subsystem.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I07d96b1d33c2d5433b951cb418ae1a89bf9caea5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5666
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-12-28 13:52:45 +00:00
Jacek Kalwas
8162070997 nvmf: change listen associate description
It is not `only a notification` as by return value association can be
blocked.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I19800bc8e278a335aaee972eecca7b3c7e3ac7e5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5670
Community-CI: Broadcom CI
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>
2020-12-28 13:52:45 +00:00
Jacek Kalwas
18274baf87 Revert "nvmf: allow transport specific options within subsystem"
This reverts commit 6d87bc7a8a.

There is an issue with the desing here i.e. lifetime of the subsystem
opts shall be associated with the subsystem but the transport specific
layer is not having any notification about that. As an alternative to
the transport specific subsystem opts listener interface was extended
in a previous commit.

Change-Id: I75c4e329e411a91694959db18ff1955774f0993e
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5571
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-12-28 13:37:07 +00:00
Jacek Kalwas
9a1c2cabc3 nvmf: introduce function to init listen opts
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I21444725c5fdf5c73db67858adbe02d4108bd751
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5660
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>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-12-28 13:37:07 +00:00
Jacek Kalwas
87a062e688 nvmf: introduce listener opts
With new spdk_nvmf_transport_listen function it should be possible to
add generic options without breaking API/ABI. For now it only delivers
json parameters which can be decoded on a transport specific layer.
This is similar to what was done for spdk_nvmf_transport_create and opts there.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Iaf576248a0b10b408c4a3182785270be3e32ebe4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5570
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>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-12-28 13:37:07 +00:00
Jacek Kalwas
add8fc1575 nvmf: clarify on opts description
New added fields should be put at the end of the struct.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Ibfa9d1967685ff4af6cef78806f403ba15e1ec01
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5642
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-12-21 17:48:50 +00:00
Ziye Yang
d3d077cc01 bdev: Solve the ABI compatibility issue related with spdk_bdev_opts
This change prepares for the potential change in spdk-bdev_opts
in the future in order to maintain the ABI compatibility

Change-Id: I8ce24299173854c14c697bf7e28cf365c23f005f
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5597
Community-CI: Broadcom CI
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>
2020-12-18 09:48:45 +00:00
Shuhei Matsumoto
8c3b9204b1 Revert "lib/nvmf: Add trid to struct spdk_nvmf_qpair"
This reverts commit e21de9a9cc.

Reason for revert: The public API spdk_nvmf_qpair_get_listen_trid() was
overlooked when this patch is created. Then the code to use the trid was
replaced by spdk_nvmf_qpair_get_listen_trid(). To avoid someone from using
the trid in future, revert this patch. struct spdk_nvmf_qpair is defined]
in the public header file, nvmf_transport.h but it is mainly for pluggable
custom transport.
Any custom transport will not use the trid, and so even if we remove it,
we will have no issue.

Change-Id: If4656edf3ac68456e758013d487eb582699750aa
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5614
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
2020-12-18 09:40:13 +00:00
Ziye Yang
48701bd955 lib/event: support ABI compatibility for spdk_app_opts.
This patch is used to support ABI compatability issue for spdk_app_opts.

Fixes #1484

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I6fed777fa15b367f7c3706b8f218d86d56493906
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5330
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>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
2020-12-16 08:40:14 +00:00
Jim Harris
17afd268df nvme: call correct remove_cb when device is removed
When a device is removed, we should use the remove_cb
that was specified when the device was originally probed
and attached, if one was set.

Also add a new spdk_nvme_ctrlr_set_remove_cb API.  This
can be used for cases where a different remove_ctx is
desired than was specified for the probe call.  This
also enables setting a remove_cb when using connect APIs
which do not have a way currently to provide a remove_cb.

This also requires fixing the bdev nvme module, which
was depending on the previously errant behavior.

Fixes issue #1715.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5510
Community-CI: Broadcom CI
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-12-14 14:34:42 +00:00
Ziye Yang
3b16c6ddc2 lib/nvmf: support ABI compatibility for spdk_nvmf_transport_opts
This patch is used to support ABI compatibility related with
spdk_nvmf_transport_opts structure. We add a field opts_size in
spdk_nvmf_transport_opts and change the related two functions.

Fixes issue: 1485

Change-Id: Ifed3dc482bbc8fb54eb7089f7a1931718682f214
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5293
Community-CI: Broadcom CI
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: Jacek Kalwas <jacek.kalwas@intel.com>
2020-12-11 11:10:16 +00:00
Jin Yu
da625683a6 bdev: virtio blk read max size and segs
The backend device such as virtio-blk or virtio-scsi
may support the SIZE_MAX and SEG_MAX. Then SPDK needs
to split the big IO. Add this feature in bdev.

Change-Id: I2442e14121ccf141682964425e96382fec482af3
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4600
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>
2020-12-10 14:39:45 +00:00
Jim Harris
3795c1cfd8 event: replace master_core with main_core in spdk_app_opts
master_core will still be available but deprecated.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6fe9eb7fecb2919795c439a02cb7d9d06a2774d8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5358
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>
2020-12-03 09:41:07 +00:00
Jim Harris
fe137c8970 env: replace master_core with main_core
This helps us remove master/slave terminology from
SPDK and is aligned with similar changes made recently
in DPDK.

While updating nvme/identify to use the new member
name, also replace g_master_core there with g_main_core.
Other nvme utility usage of "master_core" will be updated
in a later patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0ec4e3e9b644bec21b3729809bf5c4d35b10837f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5351
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>
2020-12-03 09:41:07 +00:00
Jim Harris
131e617191 nvmf: remove usage of "whitelist"
NVMf subsystems can have certain hosts that are allowed.
We were previously using the term "whitelist" to refer
to those hosts.  Replace that usage as part of removing
this term from the rest of SPDK.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2878352d83f3911aa8b59629061b818c7f1e5c96
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5282
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>
2020-12-03 09:41:07 +00:00
Jim Harris
9c2b3b3535 event: add pci_allowed/pci_blocked to spdk_app_opts
The old terms pci_whitelist/pci_blacklist are now
deprecated.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6350a6dbe21ceb5965b30241899eead651834dca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5280
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>
2020-12-03 09:41:07 +00:00
Jim Harris
4a6a282411 env: add pci_allowed/pci_blocked to spdk_env_opts
The old pci_whitelist/pci_blacklist are now deprecated.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9fddec0c90691dd385eb21d13be849247f144889
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5279
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>
2020-12-03 09:41:07 +00:00
Jacek Kalwas
296a6d9838 bdev: extend interface with get module ctx
Currently only nvme bdev module implements this interface. Bdev module
context (in this case spdk_nvme_ctrlr opaque handle) allows for nvme
interface usage for additional management.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I6302c9229d5f7f294a3c1472d9e8dc1519637ffb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4924
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-12-01 10:20:56 +00:00
Ben Walker
af07b82fa2 nvmf: The maximum number of namespaces a subsystem may contain must now
always be specified

Previously the parameter was optional and the size could be increased as
necesary. Now, it is required and a hard maximum. Later another function
could be added to dynamically increase or reduce this number if
necessary.

Change-Id: I3524ac737a6b592b4f6ce14ea48d3742a352c70f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4996
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-12-01 10:20:43 +00:00
Ziye Yang
c38a1bc002 sock: create spdk_sock_prep_reqs function.
The purpose is to reduce the duplicated functions
in posix and uring implmentation.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Ia0568b2490d362e7e78fa59b3ca88a60313ba0bd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5284
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-11-27 09:22:30 +00:00
Jacek Kalwas
86e8085d58 env: describe enumerate function detail behavior
2s asynchronous delay is introduced to avoid race conditions between
user space software initialization and in-kernel device handling for
newly inserted devices. Subsequent enumerate call after the delay
shall allow for a successful device attachment.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I273111ae7a588ce5e15e593bbdfb223777c19071
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5060
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>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-11-26 10:15:37 +00:00
Jacek Kalwas
4793391448 env: move attach cb description where typedef is specified
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I148b4b1608b4287add0e7d3b88b676950d44a9a8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5059
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>
2020-11-25 08:52:43 +00:00
Naresh Gottumukkala
0d98a94901 nvmf: Allow asynchronous nvmf transport destroy.
As part of FC transport destroy, FC LLD (Low level Driver) needs to
to do its cleanup which cannot be completed synchronously. So
allow transport destroy to be asynchronous.

FC transport code to use this functionality will be pushed shortly.

Signed-off-by: Naresh Gottumukkala <raju.gottumukkala@broadcom.com>
Change-Id: I104cf7d131e18199abdcf0651df261fe41d666ef
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5180
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>
2020-11-24 08:21:27 +00:00
Jin Yu
4c890c3160 virtio: add transitional virtio device support
SPDK virtio driver does not support the virtio legacy
device but it's ok for the modern and transitional
device. So update the probe function.

From the spec:
Transitional PCI Device ID Virtio Device
0x1000 network card
0x1001 block device
0x1002 memory ballooning (traditional)
0x1003 console
0x1004 SCSI host
0x1005 entropy source
0x1009 9P transport

Transitional Device: a device supporting both drivers conforming to
modern specification, and allowing legacy drivers.

Change-Id: I28cd277fb2b2e07a429082b7d7bd581f254eae9c
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5053
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>
2020-11-20 11:00:53 +00:00
Niklas Cassel
23a1916935 nvme: add function to get the max zone append data transfer size
The zone append command, which is part of the Zoned Namespace Command Set,
has a maximum data transfer size that can be less than or equal to mdts.

Since zone append commands will not be allowed to be split, the user has
to be able to get the maximum zone append data transfer size. Add a
function that returns this limit.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I9da2672ea8a307ff62251c069a42f7540765e08b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5140
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>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-11-20 11:00:18 +00:00
Niklas Cassel
38d59d8b5a nvme: add function to check if controller supports zone append
Zone append is an optional command in the Zoned Namespace Command Set.
Add a convenience function to check if the controller supports the zone
append command.

The ratified NVMe TP 4056 added a CSI field (in cdw14) to the Get Log Page
command. However, since there already exist two public functions to get a
log page (spdk_nvme_ctrlr_cmd_get_log_page() and
spdk_nvme_ctrlr_cmd_get_log_page_ext()), avoid creating a third one for
now, since nvme_ctrlr_get_zns_cmd_and_effects_log() itself can leverage
one of the existing public functions.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I99516dbac8db6714488b4d6cabe64c27f46d6153
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5078
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>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2020-11-20 11:00:18 +00:00
Niklas Cassel
35596d34b0 nvme: make enum spdk_nvme_ctrlr_flags more readable
Make enum spdk_nvme_ctrlr_flags more readable.
Other enums in spdk, e.g. enum accel_capability,
and enum NVME_RDMA_COMPLETION_FLAGS, already define
the enum values using bit shifts.

Do the same for enum spdk_nvme_ctrlr_flags.

No functional change intended.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Ida7d7e4ff7f4cffce85cb2d6ea2bc0168875fdb8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5158
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: Paul Luse <paul.e.luse@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-11-20 11:00:18 +00:00
Niklas Cassel
bd9db7f8c2 nvme: add missing param in doc for spdk_nvme_ctrlr_get_max_xfer_size()
Add missing param keyword in documentation for
spdk_nvme_ctrlr_get_max_xfer_size().

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I0e4242b41b50a12da5a79e6fef135e5f3046ac6e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5139
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: Paul Luse <paul.e.luse@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-11-20 11:00:18 +00:00
Nick Connolly
b869772938 Include: Test for __linux__
Explicitly test for __linux__ which is clearly the intent and
matches the behaviour described in the comments.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I498476f4a214891b897609924e018c5b132afaf2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5143
Community-CI: Mellanox Build Bot
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>
2020-11-19 09:53:21 +00:00
Naresh Gottumukkala
ccd96ead65 nvmf: Allow nvmf_transport_qpair_fini to complete asynchronously.
As part of nvmf_transport_qpair_fini, FC transport needs to cleanup
all the resources used by that QPair on the shared hardware. This
hardware cleanup is asynchronous in nature.

FC transport code to use this functionality will be pushed shortly.

Change-Id: I5606a33dff45971badd74e0cc087b132b56af076
Signed-off-by: Naresh Gottumukkala <raju.gottumukkala@broadcom.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5100
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
2020-11-18 11:28:02 +00:00
yidong0635
d73077b84a lib/jsonrpc: Add a new API to send response for writing bool result.
There are many duplicated codes about sending response for writing bool result.
That we need a function to do this.
Then we can reduce many codes.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: Ic439111b1e9ca1013f8c657ab925f0c27a7be699
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5033
Community-CI: Broadcom CI
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-11-16 15:08:47 +00:00
Madhu Adav MJ
fce9428772 nvmf: Async event support for discovery log change
Added asynchronous event notices for discovery log change
as per nvme fabrics spec 1.1. This allows a host with persistent
connection to discovery controller to automatically connect to any
new subsystem available to the host automatically.

According to nvme fabrics spec 1.1, if the connect command specifies a
non-zero keep alive timer value and the discovery controller does not
support asynchronous events then we need to return Connect Invalid.
Since SPDK does not implement this check instead added support
for asynchronous events in discovery controller.

Change-Id: I4cade5f7d24826ce97a2fa2b4ca688a1d728c1db
Signed-off-by: Madhu Adav MJ <madhu.adav@flipkart.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4870
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI
2020-11-11 00:53:57 +00:00
Jacek Kalwas
7229b8e1c6 env: update description for enumerate function
During enumeration all registered pci devices with exposed access to
userspace are getting probed internally unless not explicitly specified
on denylist. Because of that it becomes not possible to either use such
devices with another application or unbind the driver (e.g. vfio).

Change-Id: I9e84ed1d5dc82db75adcb18936cb6d702ee74d78
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4962
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-11-02 11:19:43 +00:00
Jim Harris
ddf86600bb nvme: continue probing ctrlrs even if one fails
It is possible that a single probe_ctx could be used
to probe multiple newly attached nvme controllers.  If
one of those controllers is removed during this process,
the rest of the controllers do not get probed and can
even get stuck in a zombie state.

It is better to just continue with probing the rest of
the controllers.

Fixes issue #1611.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4945
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Vasuki Manikarnike <vasuki.manikarnike@hpe.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-10-29 08:11:17 +00:00
Alexey Marchuk
85fa43241b nvmf/tcp: Support ICD for fabric/admin commands
According to the SPEC we should support up to 8192 bytes
of ICD for admin and fabric commands. Transport configuration
parameter in_capsule_data_size is applied to all qpair types -
admin and IO. Also we allocate resources when we get a connection
request, so we don't know qpair type at this moment.
Create a list of buffer in TCP poll group to support ICD up
to 8192 bytes when configuration ICD is less than this value.
The number of elements in this pool is hardcoded, it is planned
to add a new configuration parameter later.

Fixes issue #1569
Change-Id: I8589e3e2ea95d515f5503c6de7c1ee40aaf7b6da
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4754
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-10-27 08:40:12 +00:00
Jim Harris
c31ad66893 event: deprecate opts.config_file member
Just always put the config file name in json_config_file,
since we now only support JSON.

If user specifies both -c and --json, it will just take
the latter of the two.  This is similar to if the user
specified --json twice.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Idc21d73acf0e190eda57a7b0c5d9bcfa14e87030
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4858
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
2020-10-26 22:25:47 +00:00
Tomasz Zawadzki
214b9847d0 version: SPDK 21.01 pre
This is first commit that should go into latest SPDK
after the code freeze for SPDK 20.10.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ie7dc39553206ba747dc83ab6af7ddc2fc25d71eb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4854
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: Ben Walker <benjamin.walker@intel.com>
2020-10-23 23:21:14 +00:00
Maciej Szwed
c6adf304bd event: governor implementation
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I9aaa84261144145933d227976a5f89dc89732267
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4028
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-10-23 22:35:53 +00:00
Vitaliy Mysak
7148f33360 event: adopt static scheduler to the new API
Move current scheduler to it's own module
and make use of new API.

Change-Id: I4928aed82603d51de01194c9650709e814f7f61b
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4054
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-10-23 22:35:53 +00:00
Maciej Szwed
0d8a4af849 event: Add lw_thread helper functions required for scheduler
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ifd21adad6116d75170d5a6ff4b6d03470644feab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4338
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-10-23 22:35:53 +00:00
Maciej Szwed
2a146cd936 event: define scheduler API
Add structures and function for new scheduler API.

Change-Id: I8e379db62189eb7c36092265c137f07368650e9b
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4053
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-10-23 22:35:53 +00:00
Liu Xiaodong
4bf6e4bb32 interrupt: apply fd_group in thd and reactor
Each reactor and each thread is assigned with one fd group.
At the same time, each thread is treated as one interrupt source
registered into its corresponding reactor.
The egrp function for reacotr is the only block point waiting
for events.

Change-Id: Id092e66591b07b445342f8ae16dc218d28887427
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4269
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>
2020-10-23 16:23:48 +00:00
Liu Xiaodong
c5d1e7f171 interrupt: new fd_group in lib/util
Interrupt is aiming to support interrupt
mode in SPDK application framework.
fd_group is implemented by epoll on linux.
fd_group can be inserted into thread and reactor
to do epoll_wait internally in order to avoid polling

Change-Id: I9077ad648a97fbd68fd46f43de2e16440bedab0b
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4268
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-10-23 16:23:48 +00:00
Simon A. F. Lund
54219afe5a nvme/spec: add accessors to, and commented members of, zone-descriptors
The struct-accessors are added and named matching the fields defined in
the spec. to be used by the fio_plugin/nvme and other consumers of the
driver-layer. Comments to be consumed doc-generators as well as human
readers of the header-file.

The identify example is updated with the change.

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: I8d6cb82e095c5dcbc06fe892e17ce83dc0062735
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4835
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-10-23 13:47:01 +00:00
Simon A. F. Lund
6fafaa5dc6 nvme/spec: add ZNS zone states and zone types
Added to be used by the fio_plugin/nvme and other consumers of the
driver-layer.

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: I945b0aa93c675ad381ce0a83883c41688b549aee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4834
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-10-23 13:47:01 +00:00
paul luse
17bb748a60 accel: Move non-engine specific batch to the accel_fw layer
The new design:

* Supports a generic batching capability in the accel_fw layer
that keeps track of hw accelerated vs sw commands based on
the capabilities of the engine and processes sw commands in the
generic layer while sending a list of commands (not a batch)
to the engines for processing.

* Batch completions are managed via the generic layer, when using
the accel_fw the engines only process commands. With DSA however,
if a list of commands is sent down it will use the DSA public
API to create and send batches but will rely on the generic layer
to complete the batch task itself. When using DSA directly, batching
works as usual (DSA handles batch completion).

* The engine function tables were greatly simplified by replacing
all of the individual entries (copy, fill, crc32c, etc) with one
`submit_tasks` function that is used to both send lists of tasks
for batches or just one task for single shot API.

* Internally batching is now used to re-submit tasks that were queued
for flow control reasons.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I99c28751df32017c43490a90f4904bdabe79a270
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3555
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: Mellanox Build Bot
2020-10-22 22:43:28 +00:00
Changpeng Liu
c0bf93145a env/memory: return the memory virtual address's file descriptor and offset
For virtio-user library and coming vfio-user feature, the client needs
to send the memory file descriptors to target so that the two processes
can setup shared memory region to do data processing without memory copy.
Currently virtio-user will read /proc/self/maps to get memory file descriptor,
since DPDK already provides this such APIs, so here we can just use it,
for existing virtio-user library we may replace it with the new added
API.

Change-Id: Icfeae465d53826d0c8d1b335287634b03cd174aa
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4428
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-10-21 20:47:01 +00:00
Tomasz Zawadzki
344bb69312 event: remove printing legacy config for apps
Remove spdk_app_get_running_config() that allowed printing
legacy configuration by the apps.
Along with usr1_handler callback that was used to call that
function.

It was only used in iscsi_tgt so it is removed there.

The app_repeat test was using SIGUSR1 to trigger a
spdk_app_stop/spdk_app_start cycle.  But we can use
SIGTERM for that instead.  While here, do a bit of
cleanup in the app_repeat test app.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ie8449e8bcd979b237c68ef94f50fb7a3cb6c19db
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4750
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-10-21 20:44:47 +00:00
Niklas Cassel
6dec7623be nvme: add support for ZNS zone management receive command
Add support for the ZNS zone management receive command.
An internal nvme_zns_zone_mgmt_recv() function is created
that matches the parameters of the zone management receive
function in the ZNS specification.

Convenience functions are provided for the following
Zone Receive Action: Report Zones.

Zone Receive Actions not implemented: Extended Report
Zones.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I23589a602336da5dffccec7230d07026a868e81b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4793
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-10-21 12:18:44 +00:00
Niklas Cassel
be3ff9c0b5 nvme: add function to get ZNS num zones
Add a function to get the number of zones for a zoned namespace.

Since the ZNS specification does not allow zone size == 0,
divide by zero should not be possible on a spec compliant drive.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I15e0ac8a72e244e248b7fb44f7156b182ecd98b4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4792
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
2020-10-21 12:18:44 +00:00
Niklas Cassel
6abee9a205 nvme: add function to get ZNS zone size
Add a function to get the zone size of a zoned namespace.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I89429fa2fd36307a8b34bdf91e3251c68596a48c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4791
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>
Community-CI: Broadcom CI
2020-10-21 12:18:44 +00:00
Tomasz Zawadzki
6511969c3b event: remove subsystem legacy config print
This patch removes callback function for subsystems to
present their options for legacy config.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I63076fc03eff45da5d57fab03501602922a20e3e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4749
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-10-21 02:25:45 +00:00
Tomasz Zawadzki
28ebb8cc78 bdev_module: remove config_text
This patch removes function for bdev modules to
present options of the bdevs.

blob_bdev.h refers to the spdk_bdev_module, so would need
to be bumped too.
At this time spdk_bdev_module is left unchanged to prevent
that.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3cacb087c998d928c5d8c2722b7f041d82bb43f1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4748
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
2020-10-21 02:25:45 +00:00
Shuhei Matsumoto
d8f4bbeb43 lib/nvme: Add spdk_nvme_detach_async() and spdk_nvme_detach_poll_async()
Add two new public APIs, spdk_nvme_detach_async() and
spdk_nvme_detach_poll_async() to detach multiple controllers in parallel
as a simple manner to users.

Hold the target controller to nvme_ctrlr_detach_ctx because users
will free any object which held it after returning spdk_nvme_detach_async().

spdk_nvme_detach_ctx holds all nvme_ctrlr_detach_ctx in a sequence
by linked list.

spdk_nvme_detach_ctx has a boolean variable polling_started to prevent
the user from calling spdk_nvme_detach_async() while
spdk_nvme_detach_poll_async() is called repeatedly.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>i
Change-Id: Ib049c19f7ef24410b963fd5c777a21184f3012d1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4758
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-10-20 16:55:55 +00:00
Niklas Cassel
67475a58f4 nvme: add support for ZNS zone management send command
Add support for the ZNS zone management send command.
An internal nvme_zns_zone_mgmt_send() function is created
that matches the parameters of the zone management send
function in the ZNS specification.

Convenience functions are provided for the following
Zone Send Actions: Close Zone, Finish Zone, Open Zone,
Reset Zone, and Offline Zone.

Zone Send Actions not implemented: Set Zone Descriptor
Extension.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I9cc04776c249d2b9c515438b81a0f06aea4198fe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4682
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-10-20 12:18:56 +00:00
Niklas Cassel
3be2935701 nvme: move ZNS specific functions to their own header file
Move ZNS specific functions to their own header file:
include/spdk/nvme_zns.h.
This is similar to how it's done for e.g. NVMe-oF with
include/spdk/nvmf.h.

This avoids cluttering the nvme.h header with ZNS specific functions.

A SPDK program that wants to use the spdk_nvme_zns_* functions will
need to include include/spdk/nvme_zns.h, however, this is similar
to how e.g. spdk_nvmf namespaced functions work.
This change is safe to do now, since there is no SPDK release with
ZNS so far.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: If39fab4e7a6924cc3bd67aa0c03e9c6de5f8a324
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4681
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-10-20 12:18:56 +00:00
Shuhei Matsumoto
3ea2bffb9e blob/bdev: Add function pointer get_base_bdev to struct spdk_bs_dev
spdk_bdev_create_bs_dev_ext() gets not bdev pointer but bdev name
as an argument, and hence vbdev_lvs_create() will get bdev name
accordingly.

However after completing spdk_bdev_create_bs_dev_ext(),
vbdev_lvs_create() has to get bdev pointer from the created bs_dev.

Hence add a function pointer get_base_bdev to struct spdk_bs_dev
and set it to bdev_blob_get_base_bdev() at initialization.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idef0663ace85db0269442212014286669c150069
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4706
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>
2020-10-20 08:52:29 +00:00
Shuhei Matsumoto
6a72c19ee2 blob/bdev: Add an API spdk_bdev_create_bs_dev_ext()
spdk_bdev_open_ext() requires the caller to use bdev_event_cb_t
and bdev_event_cb_t is more extensible than bdev_remove_cb_t.
Hence use bdev_event_t as an argument.

spdk_bdev_open_ext() calls spdk_bdev_get_by_name() inside and
spdk_bdev_create_bs_dev_ext() calls spdk_bdev_open_ext() inside.
The caller needs to know if the spdk_bdev_get_by_name() succeeded.
Hence spdk_bdev_create_bs_dev_ext() returns return code by return
value and returns the created bs_dev by double pointer.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1c225bfb66db036439c69c459f39c86684d8a540
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4692
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>
2020-10-20 08:52:29 +00:00
Tomasz Zawadzki
a8de86e9aa lib/accel: remove legacy config support for accel module register
Since legacy config is being removed, SPDK_ACCEL_MODULE_REGISTER
macro no longer needs field corresponding to processing this
type of configuration.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I76ca02487a5fb8f9ecc9d33ac6fa514e7226a03b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4636
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>
2020-10-20 02:42:16 +00:00
Darek Stojaczyk
c77c655987 json: add spdk_json_free_object()
After decoding a JSON object we had to free the parsed
strings one-by-one. Not anymore.

Change-Id: I819f1d533e397aa9babca58b5500c38ac01a963d
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2753
Reviewed-by: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-10-19 10:02:10 +00:00
Darek Stojaczyk
f766d1e478 nvmf: let transports parse transport opts from JSON themselves
There are more transport on the way and we don't want to add
all their various opts into the single, generic structure.
We'll pass the JSON structure to transports instead. Then
the transport code can custom pull from the JSON any param
it wants.

To complement that, transports will now also have their own
JSON config dump callback. This was only done in the generic
nvmf.c so far, with conditions for RDMA and TCP.

Change-Id: I33115a8d56cec829b1c51311a318e0333cc64920
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Signed-off-by: jiaqizho <jiaqi.zhou@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2761
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-10-19 09:55:05 +00:00
Tomasz Zawadzki
1a884e94e4 lib/log: do not use spdk_log_get_flag() in macro for log flags
Especially SPDK_INFOLOG() should not call spdk_log_get_flag() function,
instead rely on the log flag structure.

This caused performance degradation in places that used SPDK_INFOLOG
too extensively.

Due to nature of the macros, in the meantime new debug log in
iscsi was improperly named. This wasn't caught because of the
macros reliance on spdk_log_get_flag(), where if name wasn't
registered - no log was printed and no compilation occurred.
Going back to using the structures, gives immediate feedback
that there is no SPDK_LOG_ISCSI log flag.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I262eadb5aee29caa2a5cd719c82ca4963ea24576
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4712
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>
2020-10-16 08:14:59 +00:00
Shuhei Matsumoto
db8bd99588 bdev/part: Add spdk_bdev_part_base_construct_ext() to pass bdev_name
Add an new API spdk_bdev_part_base_construct_ext() to pass not bdev but
bdev_name to fix the race condition due to the time gap between
spdk_bdev_get_by_name() and spdk_bdev_open(). A pointer to a bdev is
valid only while the bdev is opened.

In the new API, spdk_bdev_get_by_name() is included in
spdk_bdev_part_base_construct_ext() and the caller has to know if
the bdev exists or not. Hence spdk_bdev_part_base_construct_ext()
returns return code and returns the created part object by the double
pointer.

Another critical change is that base is just freed if spdk_bdev_open_ext()
failed with -ENODEV. The reason is that if we call spdk_bdev_part_base_free()
for that case, the configuration is removed by the registered callback
and so bdev_examine() will not work.

The following patches will replace spdk_bdev_part_base_construct()
by spdk_bdev_part_base_construct_ext() for the corresponding bdev
modules.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2db027a159559c403cdfbd71800afba590b0f328
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4576
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>
2020-10-16 08:14:34 +00:00
Shuhei Matsumoto
bba9e8dbca bdev/part: Fix wrong doc about return value of spdk_bdev_part_base_construct()
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I133f08648b783d3faa8e1a8d3655812630106dab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4586
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-10-16 08:14:34 +00:00
Ben Walker
5efa3d61ff nvmf: Add spdk_nvmf_subsystem_disconnect_host
This will disconnect all connections to a subsystem from a given
host identified by HOSTNQN.

Change-Id: Ibc9cea1f08a58a05dbac3a0bb47df8d8a58e7c10
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4556
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: Changpeng Liu <changpeng.liu@intel.com>
2020-10-15 08:24:05 +00:00
Tomasz Zawadzki
4e8e97c886 log: remove internal log.h header
There is nothing left here, so remove it.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib947d42bc577dbebb4650b1be885e05a80f8f8cf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4541
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI
2020-10-15 08:23:39 +00:00
Tomasz Zawadzki
324ebbfcb9 log: remove SPDK_ERRLOGDUMP
This macro was used in only single place and served no real
purpose.

spdk_log_dump() is more commonly used directly, so use it.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Idea720cdee767c7c6cdc30db10003ef42b88c4a3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4540
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: Mellanox Build Bot
2020-10-15 08:23:39 +00:00
Tomasz Zawadzki
7b5d9b063d log: remove log levels from internal log.h
There is no need to keep the log level in internal header.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I0f732af4a18fd16d9c5b26efc051f122a117a9e2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4539
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>
2020-10-15 08:23:39 +00:00
Shuhei Matsumoto
a22d8a530f lib/nvmf: Add an API spdk_nvmf_subsystem_add_ns_ext() to pass bdev_name
Add an new API spdk_nvmf_subsystem_add_ns_ext() to pass not bdev but
bdev_name to fix the race condition due to the time gap between
spdk_bdev_get_by_name() and spdk_bdev_open(). A pointer to a bdev is
valid only while the bdev is opened.

spdk_bdev_open() has been replaced by spdk_bdev_open_ext() but the
issue still existed.

Update the corresponding unit tests accordingly.

Then replace the internal of spdk_nvmf_subsystem_add_ns() by
spdk_nvmf_subsystem_add_ns_ext() call.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifcaa2121129ef22d5e61c9a8f7c640ff37a64485
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4485
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>
2020-10-14 08:07:06 +00:00
Tomasz Zawadzki
ffbddd4f3e lib/log: move internal log to public header
This change will allow external libs to register
SPDK log flags and use log macros by external libs.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I03ef088580bbf23bd22ad1a36817ca84c5ba8edd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3954
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-10-14 08:00:35 +00:00
Tomasz Zawadzki
2172c432cf log: simplify SPDK_LOG_REGISTER_COMPONENT
This patch removes the string from register component.
Removed are all instances in libs or hardcoded in apps.

Starting with this patch literal passed to register,
serves as name for the flag.

All instances of SPDK_LOG_* were replaced with just *
in lowercase.
No actual name change for flags occur in this patch.

Affected are SPDK_LOG_REGISTER_COMPONENT() and
SPDK_*LOG() macros.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I002b232fde57ecf9c6777726b181fc0341f1bb17
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4495
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Mellanox Build Bot
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI
2020-10-14 08:00:35 +00:00
Tomasz Zawadzki
1121797b7e log: avoid name conflict with log flags structure
Patch further out the series will be removing "SPDK_LOG_"
portion of the literal. They will be made much shorter and
have potential to conflict with some other structures.

Add SPDK_LOG to the structure itself which will make sure
there is no conflict as is now.

For couple patches the structures will have longer than nessecary
names.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If281fa8b7ae027500b980766d90513f8c3ee187a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4494
Reviewed-by: 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: Jacek Kalwas <jacek.kalwas@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-10-14 08:00:35 +00:00
Ben Walker
eda91a7b07 nvmf: Getting or setting the allow_any_host parameter no longer requires
a pause

This now also takes a lock instead of requiring a pause of the whole
subsystem.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I7de174f3f56d2b3767e723387c4f2257107d8b19
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4581
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: Changpeng Liu <changpeng.liu@intel.com>
2020-10-13 07:48:12 +00:00
Ben Walker
d67119d8bd nvmf: Don't require a full subsystem pause to change the allowed hosts
The list of allowed hosts is only checked during handling of CONNECT
commands - not in the main I/O path. Protect that list with a mutex
instead of requiring a full pause of the subsystem to allow
dynamic management of the allowed hosts without impacting any
active I/O.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I3f7e87cc1fa6de200c422928c07153fc60fab28c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4555
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: Changpeng Liu <changpeng.liu@intel.com>
2020-10-13 07:48:12 +00:00
Ben Walker
d48a7b26b3 env: spdk_vtophys buffer argument is now const
Indicate that this parameter is not modified.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I1e68f6c5ed4cbfaed0495e969ee1a50c31e9ccac
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4583
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-10-13 07:48:05 +00:00
Jacek Kalwas
6d87bc7a8a nvmf: allow transport specific options within subsystem
Change-Id: Id7b7d5205b468237df4c98715ce8d7bc26145f63
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4246
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-10-05 08:23:58 +00:00
Jacek Kalwas
90472b8663 json: new relaxed decode object function
With new funtion it is allowed to successfully parse json values even
if doceder for given key is not found.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I036f263e9050bd2b96aaa3ff61a9542c98365892
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4340
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-10-05 08:23:58 +00:00
Alexey Marchuk
079f2d0abe sock: Add new API to set default sock implementation
When uring is enabled, uring socket implementation is
used to create sockets. We may want to use posix sockets
for some reasons (e.g. performance tests). This patch adds
a new API function to set the socket implementation which
will be used by default, e.g. when no impl_name is passed
to spdk_sock_connect/spdk_sock_listen functions.

Misc changes: include spdk_internal/log.h to register
SOCK log component. The new include header already
includes spdk/sock.h and spdk/queue.h, sow remove
direct inclusion of these headers.

Change-Id: I4abad0a59cd033b15bd43a00e3dbdf313fa6b06c
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4327
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-10-05 08:22:53 +00:00
Niklas Cassel
084a062e81 nvme: add getters for ZNS specific data structures
Add getters to the ZNS specific data structures, so that an
SPDK application, e.g. examples/nvme/identify/identify.c,
has the ability to get and utilize the information in them.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I26056161093cc811acb6840ff7e2068e5f6058f6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4412
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-09-30 07:26:04 +00:00
Niklas Cassel
a7ddda8166 nvme: rename ZNS data structures
We will later create a lib/nvme/nvme_zns.c file containing zoned specific
operations on a namespace. Since the functions in SPDK have to be
namespaced by prepending the name of the library to the function name,
rename the ZNS data structures in order to make them more aligned with
the coming function names of the getters for these data structures.

Renaming these structs are safe, since they are currently not used by
anyone.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Ifd2a99e945806b49f9b213e704acce8d8d2c7037
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4455
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-09-30 07:26:04 +00:00
Changpeng Liu
276c31cd1f event: return const cpumask for spdk_app_get_core_mask() API
Fix issue #1541.

Change-Id: Ia0ecc049387f1e8eb04f1b55f7a7ace0b4b42491
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4306
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-09-29 09:38:53 +00:00
Alexey Marchuk
d819d1f167 sock: Remove unused spdk_sock::max_iovcnt
Remove unused max_iovcnmt and reorder fields to eliminate hole
in spdk_sock structure

Change-Id: Ic78d809399ab6ac785565ce8f2e132549361bc8c
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4212
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-09-29 09:35:47 +00:00
Alexey Marchuk
f0d8396e7a sock: Add option to configure zero copy per socket
A preparation step for enabling zero copy in NVMEoF TCP initiator.
This option will be used to disable zero copy
for admin qpair. This is needed since the admin
qpair's socket is not connected to socket poll group
and we can't receive buffer reclaim notification.

Change-Id: Ibfbb8a156aafcd7ba8975a50f790da7fbd37d96f
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4210
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>
2020-09-29 09:35:47 +00:00
Li Feng
5029fe14b6 scsi: add bdev resize callback support
Currently, the scsi bdev only supports the hotremove event,
and the scsi library uses the deprecated `spdk_bdev_open` function.

In this patch, add the resize event support, so the upper layer
could do more actions, like vhost-scsi could notify the guest os.

For the scsi compatibility, add _ext suffix for some public api.

Change-Id: I3254d4570142893f953f7f42da31efb5a3685033
Signed-off-by: Li Feng <fengli@smartx.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4353
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>
2020-09-28 08:33:18 +00:00
Shuhei Matsumoto
583fa214a3 lib/nvme: Add two public APIs to get ANA group ID and ANA state of the namespace
Add spdk_nvme_ns_get_ana_group_id() and spdk_nvme_ns_get_ana_state()
to getthe ANA group ID and the ANA state of the given namespace,
respectively.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id5f1f7ee488a1eb2a7a77f9986a3bb89146628e0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4354
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-09-25 11:42:44 +00:00
Ben Walker
336157bb8f net: Remove the net_framework subsystem
This was not used by anything. It was intended for use by user-space
TCP stacks.

Change-Id: I416589e421784882c693bcc5b03fe1dbcc4b1bd3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4297
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.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>
2020-09-25 11:30:09 +00:00
Niklas Cassel
069b536766 nvme_spec: add Zoned Namespace Command Set Specific identify data structures
Add the I/O Command Set Specific Identify Namespace Data Structure
and the I/O Command Set Specific Identify Controller Data Structure
for the Zoned Namespace Command Set.

These data structures are defined in the NVMe Zoned Namespace Command
Set Specification.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I1434765ecbb22e1020c6b299cd05ba8a614b1cda
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4310
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-09-22 11:39:53 +00:00
Ben Walker
77ab6f2839 nvmf: Eliminate spdk_nvmf_tgt_accept()
The poller is now created internally to the library whenever a target
is constructed. Applications are not expected to poll for connections
any longer.

Change-Id: I523eb6adcc042c1ba2ed41b1cb41256b8bf63772
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3583
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-09-21 07:55:54 +00:00
Jacek Kalwas
4e06de69b8 nvme: expose functions to manage queue identifiers
In cases where the SPDK nvme driver is being used as a validation/test
vehicle, users may need to allocate a currently unused qid that can be
used for creating queues using the raw interfaces. One example would be
testing N:1 SQ:CQ mappings which are supported by PCIe controllers but
not through the standard SPDK nvme driver APIs.

These new functions fulfill this purpose, and ensure that the allocated
qid will not be used by the SPDK driver for any future queues allocated
through the spdk_nvme_ctrlr_alloc_io_qpair API.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I21c33596ec415c2816728a600972b242da9d971b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3896
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-09-15 07:13:46 +00:00
Jim Harris
0d2a5bbe17 util: add spdk_bit_pool
spdk_bit_pool is a wrapper around spdk_bit_array with the
intentions of providing much better performance for allocating
from a fragmented bit array.  The cost of searching a large bit
array for a cleared bit can become expensive so the spdk_bit_pool
will provide an ability to track extents of recently cleared
bits.

This initial commit does not adding the tracking yet - it is strictly
a wrapper around spdk_bit_array with enough functionality to replace
the use of spdk_bit_pool in SPDK blobstore with equivalent performance.
This will allow us to switch blobstore to use this minimal
wrapper first, and then iteratively improve spdk_bit_pool to provide
the better performance.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I95d0d12db47eac73e0641eb7f94fa5df43d42e45
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3974
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
2020-09-15 07:12:44 +00:00
Jacek Kalwas
8387e97f90 nvmf: simplify listen_associate interface
There is no need for this interface to be async.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I1f21b53e90b7d165b6b5fb2e1226ce7591966b58
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4181
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-09-14 09:18:57 +00:00
Jacek Kalwas
ae207216fb nvmf: remove request exec backdoor
It was introduced for the purpose of executing fabric cmds when
subsystem and qpairs are not active. It was rather workaround than
solution for transport type like vfio-user. spdk_nvmf_request_exec
is a preferred way of passing request obj into nvmf layer.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I4f989de27bfd494c744017599909c2e200f0f233
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4180
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-09-14 09:18:49 +00:00
Ziye Yang
a6db2f3590 sock: enable placement_id configuration in sock layer
This patch is used to enable placement_id getting
in sock layer and also add the rpc support.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I70de57b0ed392a0aefce9d3ff1f61ef924015a87
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4146
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-09-11 10:04:22 +00:00
Ziye Yang
ebb903d46e sock/uring: Add the support for enable_quickack
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: If908173600b7803dcf0e130f185dfdaec70c71c5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4148
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-09-11 10:04:22 +00:00
Ziye Yang
2c80fce02d sock/uring: enable "enable_recv_pipe" in uring sock
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: If62030a011ded73181b88f90fe87586a907af9ae
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4145
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-09-11 10:04:22 +00:00
Niklas Cassel
174a5fe140 nvme: add initial namespace types support
Add support for getting the Command Set Identifier for a given namespace.

The SPDK_NVME_CAP_CSS_IOCS feature can be implemented on top of an old NVMe
specification. If the feature is set, retrieve the NS ID Descriptor List
regardless of the NVMe specification version. The quirk is still respected.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I7b257115ecb0d813ba75201c0f48960c7070dcc9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4085
Community-CI: Broadcom CI
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-09-11 07:29:51 +00:00
Shuhei Matsumoto
e21de9a9cc lib/nvmf: Add trid to struct spdk_nvmf_qpair
Add trid to struct spdk_nvmf_qpair and initialize it at initialization.

admin_qpair->trid will be used to get the corresponding
subsystem_listener via nvmf_subsystem_find_listener() and add it to
struct spdk_nvmf_ctrlr in the next patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0d1a41aede60de88747eff16c7e04f63d0702596
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4009
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-09-04 08:14:18 +00:00
Ziye Yang
03aa8995e9 lib/sock: Fix the coredump issue in sock_map_realese
When tested on Linux 5.8 kernel and configure spdk
with debug mode (--enable-debug), and test SPDK NVMe-oF
tcp transport, and we see the coredump in sock_map_release
with the following statements:
	assert(entry->ref > 0);

After debug, I can confirm that the placement_id value got
from the following function (sock->net_impl->get_placement_id)
changes.
It means that: When the sock is added into the poll group
(spdk_sock_group_add_sock), we get the placement_id (named as
Value(begin)); and when the sock is removed from the poll group
(spdk_sock_group_remove_sock), we get the plaemednt_id on
the same sock (named as Vaule(end)). I found that
Value(begin) ! = Value(end).

So our solution is for a socket, we will get placement_id once,
then we can solve this issue.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Ia1d0cf39247b53410260561aca5af38130cc0abb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3983
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-09-01 07:51:27 +00:00
Vitaliy Mysak
d267d0e874 lib/log: add RPC to toggle timestamps
Allow toggling log timestamps on and off by adding new RPC call.

Change-Id: I34c84bf89fae352ade266fbf7fd20594ff67bced
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2024
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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>
2020-08-31 07:46:36 +00:00
Tomasz Zawadzki
cb6151c357 lib/log: fully remove log backtrace prints
Patch (922d90c8) removed backtrace printing.

Some of API was leftover in header files,
so this patch removes them.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ieb2069e707dee2a196f0cecc283064661a0ae9a9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3953
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-08-28 07:19:40 +00:00
Shuhei Matsumoto
9c08d43ab7 nvme_spec: Update for asymmetric namespace access change notices
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9909335ba2b6c45c4fb8a32403c0364711006640
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3908
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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>
2020-08-27 08:36:51 +00:00
Jacek Kalwas
477d9500a3 env: fix pci driver registration
Registration macro now generates function based on driver's name.
It allows to have multiple registration within single source file.
Similar pattern is used e.g. by SPDK_NVMF_TRANSPORT_REGISTER.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Ied0887e8dae7fe9ca1517313be5eff8f218b7e98
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3895
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-08-27 08:36:43 +00:00
paul luse
c3fd3e95bb lib/accel: change task alloc from global mempool->per chan list
The one large global mempool was a waste of memory for apps that
don't use the accel framework as its always allocated a pool sized
to handle a heavy load with multiple threads.

Instead move to a per channel list of just 1024 tasks greatly
decreasing the memory footprint but still able to scale as more
threads are added.

Also renamed all accel_req to acccel_taak and simply task to
accel_task as this was being touched anyways and not consistent.

fixes issue #1510

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I0e93ca6270323e2df4b739711c5d9b667a52e1eb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3740
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-08-21 08:25:04 +00:00
Changpeng Liu
01b6bd8a92 nvmf: fix the associate timeout value
SPDK poller uses microsecond as the input parameter, so we need to
change the correct value when opts.association_timeout is expressed
by millisecond.

Change-Id: Ia674f0115ea176b998e4c0c70b8ce75b28984701
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3861
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-08-21 08:23:45 +00:00
Changpeng Liu
5d5a9077a3 nvme: don't assert on custom transport
Change-Id: I2d425c127dc070f7bb508f5a61e6304f6042fdf7
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3857
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-08-21 08:23:19 +00:00
Shuhei Matsumoto
6f2265734d lib/nvmf: Optionalize ANA reporting feature
After supporting ANA reporting by default, Linux kernel 5.3 reported
error when parsing NVMe ANA log. The newer kernel fixed the issue
but we should optionalize ANA reporting feature to avoid error for
Linux kernel 5.3 or before.

Add a bool variable ana_reporting to struct spdk_nvmf_subsystem
and disable ANA reporting and initialization of related variables
if it is false. We can expose MNAN (Maximum Number of Allowed
Namespaces) even if ANA reporting is disabled. But MNAN is not
required if ANA reporting is disabled. So do not set MNAN if it is
false too.

Add a public API spdk_nvmf_subsystem_set_ana_reporting() to set
ana_reporting by the nvmf_create_subssytem RPC.

The next patch will add ana_reporting to nvmf_create_subsystem RPC.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Icc77773b4c9513daba2f1a9fdaf951d80574f379
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3850
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-08-21 08:22:40 +00:00
yupeng
2d30df9b0b bdev: add bdev_examine_bdev API
The bdev_examine_bdev api will examine a bdev explicitly. After
disabling the auto_examine feature, a user could call
bdev_examine_bdev to examine a specific bdev he/she wants.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: Ifbbfb6f667287669ddf6175b8208efee39762933
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3219
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-08-20 08:56:53 +00:00
Seth Howell
518a1e013a lib/nvme: make fabrics connect timeout configurable.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: If829d399882ef948d95673c17e5689c91386c21d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3795
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-08-19 07:29:19 +00:00
Tomasz Zawadzki
30a31a16eb sock/vpp: remove VPP implementation
This patch removes implementation of VPP socket abstraction
along with ways to compile it.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I089f7703cfc4fb517f8f80f4368e544bced549b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3734
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-08-17 08:19:46 +00:00
Jacek Kalwas
71cd42e139 nvmf: association timer triggered on shutdown
After CC.EN transitions to ‘0’ (due to shutdown or reset), the
association between the host and controller shall be preserved for at
least 2 minutes. After this time, the association may be removed if
the controller has not been re-enabled.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Change-Id: I4734600067fd4b7306b46f1325fdd5031e81c079
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2984
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>
2020-08-13 07:53:08 +00:00
Seth Howell
4bdfe13d4d lib/nvmf: make spdk_nvmf_qpair_disconnect thread safe.
This function should be the synchronization point for all
disconnects regardless of whether they begin on the transport,
from an RPC, or in response to application termination.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: If3553ab3a9e265b0938c84832cb9f774852d7565
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3674
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-08-12 07:51:15 +00:00
Monica Kenguva
e36bec7a3d nvme_spec: update asymmetric namespace log page
Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Icdd0895c12623f859197964f6cea330c07d137ab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2918
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>
2020-08-12 07:50:44 +00:00
Seth Howell
49ee92a61f lib/nvmf:add spdk_nvmf_transport_stop_listen_async API.
This API differs from spdk_nvmf_tranpsort_stop_listen in
that it also disconnects the qpairs associated with
that listener.

Change-Id: Iadfc6d2debc0ef8f1a8cd5db4f20168aeae8264d
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3279
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-08-11 08:29:14 +00:00
Shuhei Matsumoto
61cd9d308e lib/sock: Add option to enable or disable quick ACK
TCP delayed ACK can be disabled or enabled by enabling or disabling
quick ACK, respectively.

The recently added spdk_sock_impl_opts is helpful for sock library
to control quick ACK.

Hence this patch adds and uses an option enable_quickack. The option
is effective only for the POSIX sock module.

We have spdk_sock_opts now too but spdk_sock_impl_opts will be better
for this case.

This option is not supported on FreeBSD. FreeBSD users can set the
option globally via sysctl if desired.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic89620267acce5872dc8ecaf7a99bb70ae97e993
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3603
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-08-10 11:29:20 +00:00
Ziye Yang
cca62c633f bdev/uring: Do not use IORING_SETUP_IOPOLL.
Because of the Linux kernel has limitation, IORING_SETUP_IOPOLL is only
used for local devices (e.g., local files, pcie NVMe SSDs etc.). However,
it does not work for devices atttached from the remote. So in order to
make bdev uring generic, Let's do not use IORING_SETUP_IOPOLL to create the
uring.

Change-Id: I6aea1ff222a8a0d67ab040ada75aa0ef6730e725
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3587
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-08-04 18:27:56 +00:00
Tomasz Zawadzki
809ab045b0 version: 20.10 pre
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I337b43bcf75b00b78081ca6f252bbd74a7f4abfa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3621
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-07-31 16:08:17 +00:00
Ben Walker
e12a4f6ec8 Revert "thread: add spdk_env_get_primary_core"
This reverts commit 6194cb2e15.

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

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I174276799d650a1365b37a737271a54a796cd455
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3561
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-29 14:58:44 +00:00
paul luse
8d059e7a18 accel: add API to cancel a batch sequence
Added to the framework as well as all 3 engines.  Needed by apps
in the event that they have to fail following the creation of a
batch, allows them to tell the framework to forget about the batch
as they have no intent to send it.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Id94754ab1350e5a969a5fd2306bd59c38f0a0120
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3389
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-07-27 22:43:40 +00:00
Darek Stojaczyk
cdffd22581 env_dpdk: move NVMe PCI driver definition to the nvme lib
Now that drivers can be registered from upper layers there's
no need to keep them centralized inside env.

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

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

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

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

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

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

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

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I2b75764e534562d91484a094c3352266156d8425
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3209
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-07-24 19:38:46 +00:00
Xiaodong Liu
6194cb2e15 thread: add spdk_env_get_primary_core
Change-Id: I5b337477e41da7d424cccc48366ca6018b776ee2
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2448
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-24 15:25:57 +00:00
Xiaodong Liu
ef7c128a8a lib/event: enable repeated spdk_app_start/stop
With this patch, spdk_app_start/stop can be repeatedly
called by users based on their upper level application's
requirement.
Changes are:
* Add reinit ability inside spdk_env_init and related functions
* Clear g_shutdown_sig_received in spdk_app_setup_signal_handlers
* Clear malloc_disk_count in bdev_malloc_initialize

Change-Id: I2d7be52b0e4aac2cb6734cc1237ce72d33b6de0c
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2260
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-24 15:25:57 +00:00
Michael Haeuptle
62649a7d7b lib/nvmf: Support custom admin cmd handler for abort
The new abort functionality doesn't take custom admin cmd
handlers into account.
This commit allows setting a custom admin cmd handler
for abort that provides the ability to influence the
bdev lookup to which the abort is sent to.

Signed-off-by: Michael Haeuptle <michael.haeuptle@hpe.com>
Change-Id: I3a66c6f863f5ee4d89cb2194dffdc6855945fa8a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3485
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-24 07:25:47 +00:00
Evgeniy Kochetov
29f31a90e1 sock: Add sock_impl option to disable zero copy on send
Zero copy send can cause performance degradation with small
payloads. This patch adds an option to disable it if required. By
default zero copy is enabled.

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

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: Ic5ddee42293df2c233ba7ffbe6662de7917ac586
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3343
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-07-24 00:30:45 +00:00
paul luse
6a9e923da2 lib/ioat: add mew API to get the max # of descriptors supported
Needed by follow-on patches to aupport accel_fw batching in IOAT
module.

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

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

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

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

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

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

Change-Id: I9b113572c661f0e0786b6d625e16dc07fe77e778
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2939
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-07-23 20:48:47 +00:00
paul luse
8cee297c3f lib/idxd: add batching support for compare command
Also one small bug fix w/compare in accel_perf as a result
of changes made in accel_perf sicne base compare was added.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Id8e67bd9de9cbd006ac148f4a77807cc3e8e662b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2958
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2020-07-22 23:01:45 +00:00