Commit Graph

2196 Commits

Author SHA1 Message Date
Jacek Kalwas
869929a1ca thread: improve api description
behaviour for spdk_for_each_channel_continue was not clear when user
pass non 0 status, now it is clarified

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I1aa5b5226e1aaf150ef069743f363f46d6c19e6d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10497
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-12-02 08:08:46 +00:00
Josh Soref
0c1fcc7705 spelling: include
Part of #2256

* accelerator
* access
* acknowledge
* address
* adrfam
* aggregation
* allocated
* appearance
* associated
* asynchronously
* authority
* available
* callback
* compare
* construct
* controller
* course
* definitions
* deinitialize
* descriptor
* destroy
* device
* efficiently
* elasticity
* failure
* frequency
* function
* hdgst
* implementation
* indefinitely
* initialization
* initialize
* initiator
* interrupt
* malicious
* management
* milliseconds
* namespace
* negative
* notification
* obtained
* otherwise
* passed
* positive
* request
* responded
* semantics
* sequence
* should
* specified
* structure
* subsystem
* successful
* synchronously
* transport

Change-Id: I808876a3b4b2dc56f95cfc42bc88336cfeec4288
Signed-off-by: Josh Soref <jsoref@gmail.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10404
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-12-01 09:15:13 +00:00
Maciej Szulik
eaee60c1ba fd_group: fix spdk_fd_group_wait ret val description
For any processed events, the function actually returns the number of them, not 0.

Signed-off-by: Maciej Szulik <maciej.szulik@intel.com>
Change-Id: I37bb456925e0b02c51276af169107e609d2bf301
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10229
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-11-22 08:34:26 +00:00
Alexey Marchuk
64fa301f67 rdma: Update for memory map
Add a parameter which determines the owner of the
map - target or initiator. It allows to set different
access flags when creating Memory Regions

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I0016847fe116e193d0954db1c8e65066b4ff82bf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10283
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-11-19 08:29:59 +00:00
Jim Harris
871e32efc0 idxd: add trace events for OP_SUBMIT and OP_COMPLETE
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7409b6f49e88a2d4dd1e32feba91adbd7d86e24f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10194
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-11-17 10:58:17 +00:00
Michael Piszczek
29c0e0dc3e thread: add spdk_poller_get_id
Issue: spdk_top tracked pollers by the poller name string and the
thread_id they are running on. This shows incorrect stats when
multiple pollers exist on the same thread with the same name.
Solution: Added a unique poller id for each poller on a thread and
to allow spdk_top to track pollers by thread_id and poller_id.

Signed-off-by: Michael Piszczek <mpiszczek@ddn.com>
Change-Id: I1879e2afc9a929d1df9e8e35510f0092c5443bdc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5868
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-11-16 09:06:10 +00:00
Niklas Cassel
b7ad5b0b90 bdev/zone: add support for get zone id
In the bdev-zone API, there are a few functions that takes a zone_id:
spdk_bdev_get_zone_info(), spdk_bdev_zone_management(), and the
spdk_bdev_zone_append() functions.

The way a zoned application is usually written is that it starts off
by getting the zone report for all zones (zone_id will be sent in as 0),
and then the application will keep the whole zone report in memory.

Therefore, an application usually have access to the zone_id/zslba for
all zones. However, there are cases, e.g. when getting an error on write,
where the completion callback will only have the lba of the write that
failed.

Add a helper function that can be used to get the zone_id/slba for a
given lba. Having this helper in bdev-zone will avoid SPDK applications
needing to provide their own implementation for this.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I978335f87f7d49bc33aed81afcaa6d9f0af8a1e4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10180
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-11-11 23:23:35 +00:00
Niklas Cassel
01f94ea947 util: add spdk_u64_is_pow2()
There already is a spdk_u32_is_pow2() function that handles uint32_t.
Add a spdk_u64_is_pow2() function that handles uint64_t.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Idc96680dbe280d1510aba94a6900eff64ccb4f03
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10179
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-11-11 23:23:35 +00:00
Ben Walker
504edb1ea5 nvme: Update documentation for spdk_nvme_ctrlr_get_num_ns
Clearly indicate that the value returned by this function has been
misinterpreted so many times that it has been rendered worthless.

Instead, software can use the functions to iterate the active namespaces
as a replacement.

Change-Id: I355f123eac0d33d63716cc333dc674d2ef226dc4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10100
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-11-10 19:36:27 +00:00
Jim Harris
be2d126fd6 nvme/tcp: mark variable as potentially unused
nvme_tcp_build_iovs() calculates the plen for
the iovs, but only uses the calculated value in
an assert, so we get set-but-not-used errors in
release builds.  So mark the variable as unused
to squash those errors.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ifdf72faa6182c0fba622da9e5e2a33e3c6bbaf86
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10125
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-11-09 05:05:29 +00:00
Changpeng Liu
46b355c0ef nvme: add an API to check existing transport type is fabric or not
We already provides the API `spdk_nvme_ctrlr_is_fabrics` to return
input controller is fabrics controller or not, but it needs a controller
data structure as the input, so here we add another API to do the same
thing and it takes the transport type as the input, with this change,
both nvme and nvmf library can use the API.

Also we should treat UINT8_MAX(255) as valid fabrics transport type.

Change-Id: Ib62e7d3eca3da1ddb1a4cc55b0b62e274522f1ce
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10059
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-11-05 00:53:27 +00:00
Alexey Marchuk
3d8904c66b nvmf: Add discovery filtering rules
SPDK nvmf target reports all listeners on all subsystems
in discovery pages, kernel target reports only subsystems
listening on a port where discovery command is received.

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

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

Fixes #2082

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ie981edebb29206793d3310940034dcbb22c52441
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9185
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-10-25 22:57:48 +00:00
Tomasz Zawadzki
077d0f3eac version: SPDK 22.01 pre
This is first commit that should go into latest SPDK
after the code freeze for SPDK 21.10.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Iae3b01b921127c1fc18ffdea6e57d2f830589efa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9957
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-22 18:10:27 +00:00
Krzysztof Karas
98b1301fe4 trace: shorten tpoint names
Some of our tpoints have a name exceeding 24 characters.
Althought this is not problem for SPDK, it might cause
confusion, because error messages are printed.

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

Fixes #2208

Change-Id: I598eb9c1d252d8ca6c83f82e564a6b53037936f4
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9963
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-10-22 18:08:05 +00:00
Krzysztof Karas
70c171602a trace: enable adding relations between traces
Currently we do not have any way to connect traces from different
modules in SPDK. This change modifies our trace library
and app/trace to handle adding relations between trace points
and a trace object.

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

Change-Id: Ia09d01244d923957d589fd37e6d4c98f9f7bbd07
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9620
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-10-21 17:57:33 +00:00
GangCao
9072c4ad0d accel: create SW Engine Channel if HW Engine not supports
Currently either HW Engine Channel or SW Engine Channel will be used.

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

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

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

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

Change-Id: I4ecdcd09ab669a616b37c567b45b1e6499800ec9
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9874
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-10-20 23:04:38 +00:00
Alexey Marchuk
2696886c75 dma: Update translation result to hold iovec pointer
In some cases a single virtually contriguos memory
buffer can be translated to several chunks of memory.
To make such translation possible, update structure
spdk_memory_domain_translation_result to use a pointer
to iovec.
Add a single iov structure or cases where translation
is always 1:1, it will make easier translation callback
implementation. For RDMA transport translation of address
is always 1:1, so treat iovcnt other than 1 as an
error.

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

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

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Change-Id: I89bf25a5ed760967d823f3fc32a466657f45e799
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9777
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-20 22:55:52 +00:00
Alexey Marchuk
0ecbe09bc1 dma: Add infrstructure for push operation
Push operation complements existing pull
operation and allows to implement read data
flow using memory domains.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Change-Id: I0a3ddcb88c433dff7a9c761a99838658c72c43fd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9701
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-20 22:55:52 +00:00
Shuhei Matsumoto
a77188cdea nvme: Add three macros for multipath
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7632d1572c261256d6c759a22f3f40dcd311b7c9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9417
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-10-20 07:23:40 +00:00
Krzysztof Karas
c37e776efe trace: move all trace definitions to a separate file
This is to help with binding trace objects together and
for the convenience (all trace definitions are in one place
instad of being scattered accross multiple files).

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

Signed-off-by: paul Luse <paul.e.luse@intel.com>
Change-Id: Iba9e383ae89ec9f850dcacca45c3bf8410c3b28b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8582
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-19 08:05:23 +00:00
Alexey Marchuk
9efad7468f dma: Rename fetch operation to pull
The new name suits better to the following "data push"
operation

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ic3249f65de203f375477f8e87b0749b9502d165c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9878
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-18 07:56:57 +00:00
Alexey Marchuk
219be8dff1 dma: Change signature of fetch callback
iovs are not needed in the callback

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I29718f1f2e65881628b72dea938e40c60348b85d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9877
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-18 07:56:57 +00:00
Jacek Kalwas
8f8f3f8703 json: add the spdk_json_write_uint8|16 function
Add the paired spdk_json_write_named_uint8|16 function

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Ib7ee9ae4dbe9a4e9cfa28750f0b9a0af597d260c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9788
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-14 09:52:25 +00:00
Jim Harris
f01146ae48 blob: use uint64_t for unmap and write_zeroes lba count
Previous patches (5363eb3c) tried to work around the
32-bit unmap and write_zeroes LBA counts by breaking
up larger operations into smaller chunks of max size
UINT32_MAX lba chunks.

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

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

Fixes issue #2190.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I23998e493a764d466927c3520c7a8c7f943000a6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9737
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-10-14 08:17:16 +00:00
Jacek Kalwas
a827fd7eec json: Added support for 8 bit unsigned value converter in json
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: Id670be974f5d07f5292d338448cb0ada9510b105
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9787
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-12 23:46:49 +00:00
Shuhei Matsumoto
5e87727596 scsi: SCSI device supports 256 LUNs at the maximum by default
Most SCSI hosts, Linux, Windows, VMware, supports 256 LUNs per
device now, and it is not easy to test even if any other non-free
OS or driver supports more than 256 LUNs.

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

Update the CHANGELOG together.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iacde46c3854f326eebfb8befb47d41fce383b027
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9631
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-12 09:10:18 +00:00
Shuhei Matsumoto
f61d81e47c scsi: Add spdk_scsi_dev_get_first/next_lun() to traverse all LUNs
Add two public APIs spdk_scsi_dev_get_first_lun() and
spdk_scsi_dev_get_next_lun() to remove the dependency on the macro
constant SPDK_SCSI_DEV_MAX_LUN from lib/iscsi and lib/vhost.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6546697f823fe9f4fa34e1161f5c7fa912dd2d59
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9608
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-10-11 10:08:22 +00:00
peluse
504bf59148 lib/idxd: only select idxd device that are on the same socket
Prior a regular round robin could result in strange performance
if an idxd device from another socket was used.

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

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: If1654e56e19f7fa964446ef1b9e71debf74979d1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9731
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-07 09:25:48 +00:00
Konrad Sztyber
189b0f0920 lib/trace_parser: method for retrieving entry count
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: If5f1b1bea0d30419be46e704ddd7c2f9556b4627
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9498
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-10-06 07:30:17 +00:00
Konrad Sztyber
279b7babe4 lib/trace_parser: method for iterating over entries
Added a definition of a parsed trace entry and a function allowing for
iterating over these objects.  The difference between a parsed and a
regular trace entry is that it includes more information gathered while
processing the trace file (e.g. lcore, object statistics) and provides a
contigous buffer for trace arguments.

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

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I4d5e30a7abb4860a5ba9db46f64ceae8bd14646f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9433
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-29 08:57:58 +00:00
Konrad Sztyber
6727cc382b lib/trace_parser: method for retrieving tsc offset
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I11fc341b4353c01cd933d6692cf97de3a3744a84
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9432
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-29 08:57:58 +00:00
Konrad Sztyber
41ba2b30e7 lib/trace_parser: method for retrieving trace flags
It gives user access to things like the tsc rate and tracepoint
definitions.

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

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

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

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: If101ca3425d7404abd51b0da2031358d0be44766
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9428
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-29 08:57:58 +00:00
Nick Connolly
1cfdbd429f include/mock.h: prevent expension of syscall name
If a platform defines a syscall using a macro (e.g. #define open _open)
then wrapping it fails because DEFINE_RETURN_MOCK and MOCK_GET
will use the definition to name the ut_ variables, but DEFINE_WRAPPER
will use the original name. This result in an undefined reference when
linking.

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

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I452857ec7df43f7a1a5f093439c7d5cf4683f8ee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9618
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-09-27 20:59:40 +00:00
Alexey Marchuk
9381d8d399 nvme: Update spdk_nvme_ctrlr_get_memory_domain
Allow to return more than one memory domain.
This change aligns bdev and nvme API and provides
more flexibility for custom transports.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ica9b12ad8463c361be6cb62ee2c0513eec0b486d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9546
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-24 07:37:45 +00:00
Alexey Marchuk
ea86c035bb nvme/tcp: NVME TCP poll group statistics
Enable dump of transport stats in functional test.
Update unit tests to support the new statistics

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I815aeea7d07bd33a915f19537d60611ba7101361
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8885
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-24 07:30:06 +00:00
Tomasz Bielecki
85eb3ed86b nvme: Don't mention polling requirement on blocking functions.
The current documentation is misleading. All those functions are
blocking and handle admin queue polling internally.

Signed-off-by: Tomasz Bielecki <tomasz.bielecki@wdc.com>
Change-Id: I1062ef255e4cf10b1532771efe90837eaf1171d6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9222
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-09-23 07:41:25 +00:00
paul luse
549429e12d idxd: move header file to include dir
Used to be in the lib directory but an upcoming patch needs
access to it so move it to a more appropriate location.

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

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I44d11fc620f213b13683d62dca899e2792ca6ed5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9450
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-22 07:00:10 +00:00
Michal Berger
f105046fe3 doc: Fix issues reported by newer Doxygen versions
Issues in question:

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

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

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

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I9322bde021460f4bef8e41050b9cfc6492a14a2c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9541
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2021-09-20 10:49:19 +00:00
Krishna Kanth Reddy
490c83c6ac lib/nvme: NVMe ZNS - Zone Descriptor Extension support
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I11a72f48bf4e39e0547c29cb0213679ab24388b2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9494
Reviewed-by: Klaus Jensen <its@irrelevant.dk>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-09-16 07:21:40 +00:00
Krishna Kanth Reddy
2d6736d153 include/spdk: NVMe spec header changes for Zone Descriptor Extension support
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I4459d9bcd06823ecaabbff4628b7038582b58f95
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9493
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Klaus Jensen <its@irrelevant.dk>
2021-09-16 07:21:40 +00:00
Konrad Sztyber
1bea880598 nvme: asynchronous register operations
This patch introduces asynchronous versions of the ctrlr_(get|set)_reg
functions.  Not all transports need to define them - for those that it
doesn't make sense (e.g. PCIe), the transport layer will call the
synchronous API and queue the callback to be executed during the next
process_completions call.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2e78e72b5eba58340885381cb279f3c28e7995ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8607
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-09-16 07:16:52 +00:00
Andreas Economides
a89d15e46a event: add disable_signal_handlers to the spdk_app_opts struct
Currently, there is no way to prevent spdk_app_start() from calling
app_setup_signal_handlers() and setting SPDK's signal handlers.
We'd like to use our own set of signal handlers, therefore this
patch adds a flag to the spdk_app_opts struct that disables this
behaviour.

Signed-off-by: Andreas Economides <andreas.economides@nutanix.com>
Change-Id: I61d7cd66527d819fd5f687d5cc8a03be4fe10a6a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9380
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-09-15 07:11:42 +00:00
Krishna Kanth Reddy
2f0f20d79b nvme_spec: Update as per the ZNS command set specification
The descriptions and structure member are updated as per the
ZNS command set specification.

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I687824bf9a08e98f0b8b9a49f513607c92de8275
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9445
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-09-10 15:59:19 +00:00
Ben Walker
3875f287dd nvme: Add spdk_nvme_ctrlr_get_opts
This is needed for reporting additional information in JSON RPCs

Change-Id: I45da2ea78cd5415f7536130b6793ca29e929b86e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9338
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-09-08 08:06:23 +00:00
Alexey Marchuk
97385af196 nvmf: Fix double controller destruction when subsys is deleted
When a subsystem is being deleted, we disconnect all qpairs
and when the last qpair for some controller is disconnected,
we start controller desctruction process. This process requires
to send a message to subsystem's thread to remove the controller
from the list in the subsystem and after that send a message to
controller's thread to release resources.
The problem is that the subsystem also destroys all attached
controllers. This order is unpredictable and we may get
heap-use-after-free or double free.

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

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

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