Commit Graph

13878 Commits

Author SHA1 Message Date
Shuhei Matsumoto
0aeab1f13d bdev/nvme: Add nvme_bdev_ctrlr pointer to struct nvme_io_channel
When we support ANA multipath, I/O path will get nvme_bdev_ns from
nvme_bdev_ctrlr->namespaces, and nvme_bdev_ctrlr will be got from
nvme_io_channel.

Hence this patch adds a pointer to nvme_bdev_ctrlr to struct
nvme_io_channel.

As a side effect, nvme_io_channel->ctrlr is helpful to simplify
admin command submit functions, and do it in this patch.

For ocssd_bdev, we will do the similar change later.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6976d1543ccda37dde4b81b2124d88f0d05ed7eb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5055
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-11-25 08:52:15 +00:00
Shuhei Matsumoto
54c4cd0000 bdev/nvme: Pass spdk_nvme_ns and spdk_nvme_qpair pointers directly to I/O submit functions
When we support ANA multipath, we will use spdk_nvme_ns and
spdk_nvme_qpair pointers for I/O submit functions after checking
ANA state of spdk_nvme_ns.

It will be efficient and easy to understand if we unify such check.
The next patch will provide a helper function to do such check.

This patch changes the parameters of I/O submit functions as a
preparation.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic741caa1d7e6df844b875beea776e79d4eb8d6fc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5204
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>
2020-11-25 08:52:15 +00:00
Shuhei Matsumoto
e979e1fd37 bdev/nvme: Add nvme_ch parameter to bdev_nvme_flush()
bdev_nvme_flush() just completes with success now and uses only
bio parameter now, but matching parameters with other similar I/O
APIs will be good for future enhancement and following patches.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I64be668fa781396ef68b6b506b22cb153d7b6850
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5203
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>
2020-11-25 08:52:15 +00:00
Shuhei Matsumoto
1a8c6c4d4a bdev/nvme: Get dif_check_flags via bdev_io->bdev in I/O paths
Using bdev_io->bdev will be more straightforward than using
bdev_io->bdev->ctxt and &nbdev->disk.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie5854ab063b7b21710e9f899dd93340624a8cb49
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5202
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>
2020-11-25 08:52:15 +00:00
Shuhei Matsumoto
3bf79d7c91 bdev/nvme: Use spdk_nvme_ns_get_ctrlr() for I/O passthrough
This changes follows the last patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I057a4e035e4010e5dd8ec8e7de78f91d562383cf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5201
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>
2020-11-25 08:52:15 +00:00
Shuhei Matsumoto
8b26fdd5ea bdev/nvme: Use spdk_nvme_ns_get_max_io_xfer_size() for I/O passthrough
This and the next change will enable us to pass spdk_nvme_ns and
spdk_nvme_qpair as parameters to I/O passthrough APIs. When we support
ANA multipath, ANA state of spdk_nvme_ns will be checked. These changes
follow that.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id38a0e14501ff6402f9b151eaf9e44864079412b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5200
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>
2020-11-25 08:52:15 +00:00
Roman Penyaev
6490dbe4fe thread: don't output error in case of EAGAIN for interrupt mode
Keep silence if nothing to read from message queue.

Signed-off-by: Roman Penyaev <rpenyaev@suse.de>
Change-Id: I6f3df6a58e708aa424fe2c6ebca509c44062d12c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5153
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>
2020-11-25 08:52:02 +00:00
Michal Berger
c0648d4b45 scripts/setup: Check if hugepage files are used before removal
If DPDK was not told to unlink the hugepage backing files during the
hugepage_init, the application will keep them open while holding a
lock on each file. Check if said lock is held, if not, remove the
file.

Change-Id: I738a3d7756c335b63388a2efeb03debd734d9c9e
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5065
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-11-25 08:51:53 +00:00
Michal Berger
bcf9f8ffc4 scripts/setup: Allow to define number of hugepages per node
Change-Id: Ib3ff5ba285a5e7fc70bf2357e4f367b666bc3977
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5046
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-11-25 08:51:53 +00:00
Michal Berger
2b80955c09 scripts/setup: Refactor hugepages allocation for Linux
Main changes:

- By default, allocate all hugepages on node0. On NUMA-aware systems,
  processes will most often use default policy with local node as the
  preffered one for allocations. This usually is node0, thus splitting
  hugepages evenly across the nodes, in default setup, would force
  allocations from a remote node, impacting overall performance (in
  case hugepages on node0 run out). See 68740678e1 as a reference.

- Introduce HUGE_EVEN_ALLOC - force setup.sh to evenly distribute
  hugepages across all the nodes.

- Introduce HUGEPGSZ - overrides default page size

- Introduce CLEAR_HUGE - remove all hugepages on demand before
  allocation is performed.

- HUGENODE - this now can be a list of nodes to use. NRHUGE will be
  set across all the nodes from the list.

Change-Id: I084829edde3c416e7fc6b7b6abe369cc0631fcd7
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5042
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>
2020-11-25 08:51:53 +00:00
Michal Berger
07e251ef42 scripts/setup: Redirect status headers to stderr
This is done so user can easily filter out parts of the output which
are not relevant for additional processing (greping, seding, etc.).

Change-Id: I67eafd1fbeb723224cca6b0026e149cb7f85bfe9
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5152
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>
2020-11-25 08:51:53 +00:00
Michal Berger
7f34367592 scripts/setup: Sort and unify status output on Linux systems
This is done in order to improve the grepability of the output. Sort
is based on the BDF address.

Hugepages statistics are intact.

Change-Id: I121e9a46bfb1550380f233c1d5c06cefb9d4e7a9
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5022
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>
2020-11-25 08:51:53 +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
Shuhei Matsumoto
d4ad1f9cc1 lib/iscsi: Add wait parameter to iscsi_create_portal_group RPC
Add an new optional parameter wait to the RPC, iscsi_create_portal_group
not to listen on portals until it is started explicitly.

Fixes the issue #1676.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic217f1ccceb618e70fdb2aff3f710d262a8a9bdb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5091
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: Changpeng Liu <changpeng.liu@intel.com>
2020-11-24 08:20:37 +00:00
Shuhei Matsumoto
024d286527 lib/iscsi: Add iscsi_start_portal_group RPC to start listening if not yet
Add an new RPC, iscsi_start_portal_group, to start listening on
portals if the specified portal group is not started yet.
The next patch will add an new parameter wait to the existing RPC,
iscsi_create_portal_group.

The RPC allows the specified portal group to be already started,
and returns a success response in this case.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I631d6bccffb38092c95694f922f10648e24d6ff7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5090
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: Changpeng Liu <changpeng.liu@intel.com>
2020-11-24 08:20:37 +00:00
Shuhei Matsumoto
7ac4961b33 lib/iscsi: Factor out internal of rpc_iscsi_delete_portal_group
Factor out the internal of rpc_iscsi_delete_portal_group() into
a function _rpc_iscsi_change_portal_group() and rename the related
data structure to use them for the upcoming RPC,
iscsi_start_portal_group.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I965f1e52f04fb54c6a89987836f89c508441a37e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5089
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-11-24 08:20:37 +00:00
Shuhei Matsumoto
8381b98ef4 lib/iscsi: Add portal_group_resume() and add pause parameter to portal_group_open()
Add an new function iscsi_portal_group_resume() and add an new parameter
pause to iscsi_portal_group_open(). They will be used in the following
patches to pause listening portals while target nodes are created at
start-up because Windows hosts do not retry login.

Pausing and resuming portal group is possible because we can unlisten
temporarily by simply not calling accept(). Any inbound connection
requests are queued to the backlog and once the backlog queue is full,
further inbound connection requests are simply dropped. If we restart
calling accept(), we will dequeue the backlog and be ready for more
connecitons.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If7403f91ebd729b47d98a23e589cba8b35569dc6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5088
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>
2020-11-24 08:20:37 +00:00
Michal Berger
602b134fa2 scripts/setup: List all devices which have active mountpoints
Change-Id: Ib8124e6e144b4f6524e87af1e9ab8b383afe978a
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5171
Community-CI: Mellanox Build Bot
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>
2020-11-23 09:37:22 +00:00
Michal Berger
eb32e8b2f1 scripts/setup: Return all block devices attached to a given controller
Each nvme BDF can have multiple namespaces, hence multiple block
devices, return them all.

Change-Id: I93fe8acf5b1904f05514445eb3e970ef4254caed
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5170
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: John Kariuki <John.K.Kariuki@intel.com>
2020-11-23 09:37:22 +00:00
Michal Berger
06058e9bdb scripts/setup: Revert back to using lsblk for mount checks
lsblk will include all the potential holders|virtual devices given
block device may be part of. This is relevant in case a nvme|virtio
device is part of the lvm|md setup.

Change-Id: I32198ddcf71746c3cbad4a96496a1762a5c201cd
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5167
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-11-23 09:37:22 +00:00
yidong0635
657e50a032 test/bdevperf: Replace code with existed function.
These codes are at the end of bdevperf_construct_jobs,
and they can be replaced by _bdevperf_construct_job_done.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I9bcae562a2a277f6131864ad2ea7b7f565135814
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5181
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>
2020-11-20 17:31:49 +00:00
Nick Connolly
b8c99a3aad lib: Use PRId64 for portability
POSIX defines PRId64/PRIu64/PRIx64 for printing 64-bit values in a
portable way. Replace a few references to %ld to remove the assumption
about the size of a long. Similarly, use %z with size_t arguments.

Where the value being printed is an unsigned 64-bit value, use PRIu64
instead of %ld.

Explicitly test for not __linux__ where that is the intent, rather
than testing for __FreeBSD__.

Cast pointer to uintptr_t before aligning it, rather than using
a specific integer size which may not be large enough to store a
pointer.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: Icfe219e1bbb2d06b3ef05710fac5b7091d340251
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5142
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-11-20 11:01:37 +00:00
Nick Connolly
bb19c18f6a examples: Use PRId64 for portability
POSIX defines PRId64/PRIu64/PRIx64 for printing 64-bit values in a
portable way. Replace a few references to %ld to remove the assumption
about the size of a long.

Where the value being printed is an unsigned 64-bit value, use PRIu64
instead of %ld.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: Ifa558522437f4922b922abf17712173cb5ca1184
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5134
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-11-20 11:01:11 +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
Ziye Yang
0bcaf050d7 nvmf/tcp: Remove the await_req list.
In my thought, this await_req will not have performance improvement,
and it makes the code more complicated, so remove it.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I97d86448fc273098d001a08d914ad45ddac07e16
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5149
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-11-20 11:00:31 +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
Niklas Cassel
efedaf17e8 nvme: remove superfluous parentheses
Remove superfluous parentheses around ctrlr->cdata.mdts.
They provide no value while making the code harder to read.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I4342d87f0e33fd92fe76357eb0379fb1e9c8f98f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5138
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-11-20 11:00:18 +00:00
David Marchand
2e9cd9d7b0 env_dpdk/pci: fix check on 20.11 EAL API change
RTE_DEV_ALLOWED is an enum and has no associated define, hence checking
for its presence will always be false.
We could test for RTE_DEV_WHITELISTED define, but this macro added for
deprecation warning will be dropped in the future.
Switch to a check on DPDK version.

Fixes: 10ed0eb755 ("env_dpdk/pci: adapt to 20.11 EAL changes")
Signed-off-by: David Marchand <david.marchand@redhat.com>
Change-Id: I75270977b580065b36c753266cbaa5fb73f99eb1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5165
Community-CI: Mellanox Build Bot
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 14:24:04 +00:00
Nick Connolly
024179d8ee module: Use PRId64 for portability
POSIX defines PRId64/PRIu64/PRIx64 for printing 64-bit values in a
portable way. Replace a few references to %ld to remove the assumption
about the size of a long. Similarly, use %z with size_t arguments.

Where the value being printed is an unsigned 64-bit value, use PRIu64
instead of %ld.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I0ec4c0cb5e7a8f4b94a1ee6272c8df9ee7f06aa6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5141
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>
2020-11-19 09:59:01 +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
Nick Connolly
5c5a44f008 test: Use PRId64 for portability
POSIX defines PRId64/PRIu64/PRIx64 for printing 64-bit values in a
portable way. Replace a few references to %ld to remove the assumption
about the size of a long. Similarly, use %z with size_t arguments.

Where the value being printed is an unsigned 64-bit value, use PRIu64
instead of %ld.

Add a cast when comparing an enum to an integer value.

Add an explicit uint64_t cast to the definition of BLOCK_CNT to prevent
value truncation.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I093cffe7e79bc04eba012f4ffaf33062a642d062
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5137
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-11-19 09:53:05 +00:00
Nick Connolly
3b461269d2 test/unit/lib/nvmf: Add unit test stubs
With some build environments (e.g. clang, see #1613) linking fails with
unresolved references. This is caused by the inclusion of 'unused code'
which is usually discarded by the linker. The 'unused code' contains
references to functions that have not been 'stubbed' out. The failure
can be seen by removing 'LDFLAGS += -Wl,--gc-sections' in
spdk.unittest.mk

Resolved by adding stubs for missing references. These are never called
so return an arbtrary default value.

Part of a set of independent changes which
Fixes #1613

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: Iab76fbdebb13a9fda652418a0d75148d24c62378
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5082
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-11-19 09:52:39 +00:00
Nick Connolly
e49d3c6612 test/unit/lib/ftl: Add unit test stubs
With some build environments (e.g. clang, see #1613) linking fails with
unresolved references. This is caused by the inclusion of 'unused code'
which is usually discarded by the linker. The 'unused code' contains
references to functions that have not been 'stubbed' out. The failure
can be seen by removing 'LDFLAGS += -Wl,--gc-sections' in
spdk.unittest.mk

Resolved by adding stubs for missing references. These are never called
so return an arbtrary default value.

Added stubs for use when configured with pmem.

Part of a set of independent changes which
Fixes #1613

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I8944b8aaa90f27102ae6b030bfab89898194e5a4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5085
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>
2020-11-19 09:50:13 +00:00
Nick Connolly
afef2104a5 test/unit/lib/idxd: Add unit test stubs
With some build environments (e.g. clang, see #1613) linking fails with
unresolved references. This is caused by the inclusion of 'unused code'
which is usually discarded by the linker. The 'unused code' contains
references to functions that have not been 'stubbed' out. The failure
can be seen by removing 'LDFLAGS += -Wl,--gc-sections' in
spdk.unittest.mk

Resolved by adding stubs for missing references. These are never called
so return an arbtrary default value.

Move include of idxd/idxd.c after definition of movdir64b so that mock
function is used.

Part of a set of independent changes which
Fixes #1613

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I760755122a1d3ca96f12b00b0040ae15471beafa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5110
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>
2020-11-19 09:49:53 +00:00
Nick Connolly
43b185746f test/unit/lib/nvme: Add unit test stubs
With some build environments (e.g. clang, see #1613) linking fails with
unresolved references. This is caused by the inclusion of 'unused code'
which is usually discarded by the linker. The 'unused code' contains
references to functions that have not been 'stubbed' out. The failure
can be seen by removing 'LDFLAGS += -Wl,--gc-sections' in
spdk.unittest.mk

Resolved by adding stubs for missing references. These are never called
so return an arbtrary default value.

Part of a set of independent changes which
Fixes #1613

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I3960ecc572090348c2ccabfc907b7abee89ed97f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5083
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-11-19 09:49:41 +00:00
Nick Connolly
f686aa962c test/unit/lib/vhost: Add unit test stubs
With some build environments (e.g. clang, see #1613) linking fails with
unresolved references. This is caused by the inclusion of 'unused code'
which is usually discarded by the linker. The 'unused code' contains
references to functions that have not been 'stubbed' out. The failure
can be seen by removing 'LDFLAGS += -Wl,--gc-sections' in
spdk.unittest.mk

Resolved by adding stubs for missing references. These are never called
so return an arbtrary default value.

Part of a set of independent changes which
Fixes #1613

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: Ic291ba22cbee121b5c75b80910378b456a217189
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5080
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>
2020-11-19 09:47:54 +00:00
Nick Connolly
c70d03f32a test/unit/lib/iscsi: Add unit test stubs
With some build environments (e.g. clang, see #1613) linking fails with
unresolved references. This is caused by the inclusion of 'unused code'
which is usually discarded by the linker. The 'unused code' contains
references to functions that have not been 'stubbed' out. The failure
can be seen by removing 'LDFLAGS += -Wl,--gc-sections' in
spdk.unittest.mk

Resolved by adding stubs for missing references. These are never called
so return an arbtrary default value.

Part of a set of independent changes which
Fixes #1613

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I63953b666e841942f51f9cc035c6a6521663079d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5084
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>
2020-11-19 09:47:26 +00:00
Nick Connolly
f4b818434b test/unit/lib/scsi: Add unit test stubs
With some build environments (e.g. clang, see #1613) linking fails with
unresolved references. This is caused by the inclusion of 'unused code'
which is usually discarded by the linker. The 'unused code' contains
references to functions that have not been 'stubbed' out. The failure
can be seen by removing 'LDFLAGS += -Wl,--gc-sections' in
spdk.unittest.mk

Resolved by adding stubs for missing references. These are never called
so return an arbtrary default value.

Part of a set of independent changes which
Fixes #1613

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I0a8606f9ec1743f7ca430f68c90b59f5699155b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5081
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>
2020-11-19 09:47:06 +00:00
Nick Connolly
a414e7bbf6 test/unit/lib/sock: Add unit test stubs
With some build environments (e.g. clang, see #1613) linking fails with
unresolved references. This is caused by the inclusion of 'unused code'
which is usually discarded by the linker. The 'unused code' contains
references to functions that have not been 'stubbed' out. The failure can
be seen by removing 'LDFLAGS += -Wl,--gc-sections' in spdk.unittest.mk

Resolved by adding stubs for missing references. These are never called
so return an arbtrary default value.

Part of a set of independent changes which
Fixes #1613

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I7bafbd2b414e1502d54f317d7b671798d564732c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5079
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>
2020-11-19 09:46:52 +00:00
Shuhei Matsumoto
c626ada01d bdev/ocssd: Cache zone pointer from ocdev_io->io.zone and use it
Using ocdev_io->io.zone to update zone is a little confusing,
and so cache zone pointer from ocdev_io->io.zone and use it for
clarification.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iaee9b1fa8a86240022ddf5038a8c86b48476ba78
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5148
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-11-19 09:45:40 +00:00
Shuhei Matsumoto
73d7353f79 bdev/ocssd: Separate write_cb() and append_cb()
This refactoring increases the code size slightly but improves
readability, and will make the following patches easier.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I704eca60fe98e4622e0d39d2e54ead63844156f6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5147
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-11-19 09:45:40 +00:00
Shuhei Matsumoto
f9faa0743d bdev/ocssd: Factor out pushing and notifying media event in chunk_notification_cb()
This is to improve readability even if the factored functions are
used only in a single place.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifa6c7ba4380124a957e66e31123e3743d83e7615
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5146
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-11-19 09:45:40 +00:00
Shuhei Matsumoto
ae3b179a53 bdev/ocssd: Factor out getting chunk info. offset from _get_zone_info()
Factor out getting chunk info. offset into a helper function
bdev_ocssd_to_chunk_info_offset() and locate it next to
bdev_ocssd_to_disk_lba(). This will improve readability a little.

Besides, cache addr_shift first in bdev_ocssd_translate_lba() for
clarification.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4c078e2002638d90b000b97f9f7cda90938d02ca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5132
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>
2020-11-19 09:45:40 +00:00
Shuhei Matsumoto
74438fc588 bdev/ocssd: Extract common operation from from_disk_lba() and lba_in_range()
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifd6b2b76c80d7b12bffdff6f9684b6c8dc3e3ed5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5131
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>
2020-11-19 09:45:40 +00:00
Shuhei Matsumoto
ddc03b4584 bdev/ocssd: Factor out internal of bdev_ocssd_num_parallel_units()
Factor out the internal of bdev_ocssd_num_parallel_units() into an
new inline helper function ocssd_range_num_parallel_units(), and
apply the latter into a few functions.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I16550046ed2d6f543f66711810b30bd45f21c970
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5130
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-11-19 09:45:40 +00:00
Shuhei Matsumoto
f90c6378a5 bdev/ocssd: Clean-up three small helper functions for zone
Clean-up bdev_ocssd_num_zones(), bdev_ocssd_get_zone_by_lba(),
and bdev_ocssd_get_zone_by_slba() to make a little easier to read
and understand.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I13c92dc86dc3855f1ec9ab5ae9d7097607f20512
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5129
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-11-19 09:45:40 +00:00
Shuhei Matsumoto
729f7ec516 bdev/ocssd: Consolidate num_zones() calls in bdev_ocssd_init_zones()
Cache the return value of bdev_ocssd_num_zones() in bdev_ocssd_init_zones()
to improve readability.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If71b40221694e512617389da03720211744f3b5c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5128
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-11-19 09:45:40 +00:00