Commit Graph

14611 Commits

Author SHA1 Message Date
Nick Connolly
a4e1d715f7 mk: support file extension for executables
Some platforms require that a specific file extension is used for
executables. Append $(EXEEXT) to $(APP) definitions to accommodate
this. The name EXEEXT has been chosen for consistency with automake
which uses the same variable for the same purpose.

Add extensions for generated files used by Windows to the 'clean' target
(.obj, .lib, .pdb) and add output files to .gitignore.

Tested using a cross compiler that forces a .exe suffix and verifying
that all LINK messages include the correct suffix and that a second
call to make does nothing (showing that the targets match the
generated executables).

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: Ief012f6294d2f94b23c8b4f9747e21a0dfb91e96
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6494
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-15 09:29:10 +00:00
Nick Connolly
9854c138f7 mk: add support for mingw builds
MinGW builds require a thin layer above the standard libraries to
provide POSIX functionality that is missing on Windows. Add support
for building this.

MinGW cross builds are experimental and work is ongoing to integrate
them into the CI and test environment. Including the changes at this
stage is being done to facilitate that process.

The layer has been arranged in the same way as DPDK and is
accessed as an external build using ./configure --with-wpdk=<dir>.
Support has also been added for using a default ./wpdk in
preparation for reaching the required level of stability.

The help text for ./configure indicates that support for --with-wpdk
is experimental.

Further details and instructions can be found at https://wpdk.github.io.

Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: Iff0f705789f19fb193dcb3c9090c3e90613a8d9a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6589
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-15 08:55:11 +00:00
Monica Kenguva
7e42c6d826 rpc: Document ocssd create and delete bdev
Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Change-Id: Ic1b73fbfe3c2cb6b0434422c190e16e9d40ec21b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6850
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>
2021-03-15 08:54:51 +00:00
Maciej Szwed
fa67893428 rocksdb: Switch default RocksDB branch to latest (6.15.fb)
!Do not merge this patch before RocksDB patches are merged:

https: //review.spdk.io/gerrit/c/spdk/rocksdb/+/6485
https: //review.spdk.io/gerrit/c/spdk/rocksdb/+/6486

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ie13ff102ddf627026013dcb8b41cb3ee205eaaeb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6761
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-03-15 08:53:39 +00:00
Ben Walker
f046750c32 event: Add return code to spdk_rpc_initialize
This is an internal API used in several places. The call can fail, so
make sure it can report that correctly.

Change-Id: Iac0ed2c8299c9dd3d2556070278a2224c3807b7b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6640
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-03-12 08:38:10 +00:00
Ziye Yang
0731c2273d bdev/rbd: Change some function type from int to void
Purpose: Make the code clean and remove duplicated code.

Change-Id: I6cc8b94af24f89301531bd38d766afb53898e0ed
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6811
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
2021-03-12 08:36:11 +00:00
ChengqiangMeng
df2b5b8983 unittest/nvme_tcp: increase code coverage for nvme_tcp_qpair_send_h2c_term_req
nvme_tcp_qpair_send_h2c_term_req code comprehensive coverage.

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: Ic562bf2b6f895667143f98bb504a7abef8cfda23
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6791
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-03-12 08:35:21 +00:00
Mao Jiang
11f119e25d test/nvme_cuse: build nvme_cuse unittest file
Include cuse_nvme_submit_io_read/write cases.

Change-Id: Id55ec798167a36a7fb6e1d9ddb032299d476962e
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6651
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-03-12 08:31:11 +00:00
Monica Kenguva
5678c2f472 rpc: Document bdev_nvme_apply_firmware
Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Change-Id: Ie022f1a6f03e58514283e37b9428670d28f68bbf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6634
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-03-12 08:30:34 +00:00
Mao Jiang
35a33d8c69 test/nvme_transport: cases for nvme_transport polling group
Change-Id: I2cc0ea6207de37815e88dd6aad00e43e6596b64d
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6730
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>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-03-12 08:30:21 +00:00
ChengqiangMeng
001afcbdb7 unittest/nvme_ns: increase code coverage for nvme_ns's several func
include test_nvme_ns_set_identify_data,
test_spdk_nvme_ns_get_values(Most functions that simply get values),
test_spdk_nvme_ns_is_active,
and spdk_nvme_ns_supports(Judge whether extended_lba and compare are supported).
The above func is completed.

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: I916173a195692045ee0ee3fa408a1696e0eb5b1e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6511
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Mellanox Build Bot
2021-03-12 08:21:23 +00:00
Liu Xiaodong
22412af1d2 nbd: get nbd_stop procedure in async
It is possible that nbd pthread is created but not executed,
then spdk_nbd_stop is call before nbd_pthread's execution,
but nbd pthread starts to execute while nbd is totally stopped.

This patch can get spdk_stop_nbd aligned with nbd pthread.

Change-Id: I57cc92b94d36cd706616c9058134f716f0812892
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6278
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
2021-03-12 08:21:00 +00:00
Liu Xiaodong
4c6c794be3 nbd: use retry_poller and retry_count
This is better naming to represent their usage.
retry_poller and count can also be used to do
async nbd_stop procedure in the following patch.

Change-Id: Ie5a74e4add3f1a6c7257df00aded8b5d52a09955
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6277
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-03-12 08:21:00 +00:00
Shuhei Matsumoto
2c436c00a0 bdev/ocssd: Get io_channel from not nvme_ch but bdev_io when processing pending requests
The next patch will add nvme_bdev_channel and we will not be able to
io_channel from nvme_ch anymore.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8ba93e66657d21da58df63f3ad6dde4b155fc174
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6612
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>
2021-03-12 08:20:46 +00:00
Shuhei Matsumoto
e1489743ed bdev/nvme: Add mutex per nvme_bdev_ctrlr
Add mutex per nvme_bdev_ctrlr and replace g_bdev_nvme_mutex by it
for possible cases. These are just drop-in-replacement.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib1d5eebd65e514cfe96ad60a9004d9bace7b4f6b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6693
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>
2021-03-12 08:20:46 +00:00
Shuhei Matsumoto
83f27434d3 bdev/nvme: Merge bdev_nvme_remove_trid() into bdev_nvme_delete()
This will make us easier to maintain the operation to delete
nvme_bdev_ctrlr and its trids. The added unit test cases guard us
from degradation.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I400d4092020e89bacaebc7be045a456b8760ed8d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6688
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-03-12 08:20:46 +00:00
Shuhei Matsumoto
3eb0b6b167 bdev/nvme: Factor out the common part of remove_cb() and bdev_nvme_delete()
By adding the second parameter, hotplug, factor out the common part
of remove_cb() and bdev_nvme_delete() into a helper function
_bdev_nvme_delete().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5becbc7a7a94e852510e6a2745afb9c533d21713
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6692
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>
2021-03-12 08:20:46 +00:00
Shuhei Matsumoto
620e0ea043 ut/bdev_nvme: Add test cases for bdev_nvme_remove_trid()
The following patches will refactor bdev_nvme_remove_trid() and merge
it into bdev_nvme_delete(). Add test cases for bdev_nvme_remove_trid()
to avoid degradation by the following patches.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I42da17c62843ead9a30ab9a06463df4b679e561d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6686
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
2021-03-12 08:20:46 +00:00
Tomasz Zawadzki
13f868977e module/bdev: remove deprecated API
spdk_vbdev_register() was deprecated in SPDK 19.04.
config_text field in spdk_bdev_module was deprecated in SPDK 20.10.
spdk_bdev_part_base_construct() was deprecated in SPDK 20.10.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib795ccdf61154c168032ccf8b81ea77e5e663851
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6628
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-03-09 08:54:53 +00:00
Tomasz Zawadzki
99935996f2 lib/bdev: move to spdk_bdev_part_base_construct_ext()
spdk_bdev_part_base_construct() is deprecated so this patch
moves remaining instances to spdk_bdev_part_base_construct_ext().

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Iccd4b15933bec41885adfaf4fc4ce2abedd2d6c7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6627
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-03-09 08:54:53 +00:00
Tomasz Zawadzki
a6b1e2c57d lib/bdev: remove deprecated spdk_bdev_open()
spdk_bdev_open() was deprecated in SPDK 19.10.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I12f51a237ddc43219d35b5c647dc60d10461d429
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6626
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: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:54:53 +00:00
Alexey Marchuk
47afb9280f nvme/rdma: Use RDMA provider API to post recv WRs
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I47cc1a21af1104f681519e542edaf66e363bb214
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6296
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-03-09 08:54:12 +00:00
Alexey Marchuk
3caf2e710f nvmf/rdma: Add new statistic to count idle polls
This statistic is incremented when we don't reap
anything from the CQ. Together with the total number
of polls it can be useful to estimate idle percentage.

Change-Id: I61b51d049b0bc506fb8a896e225187e46e75a564
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6295
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>
2021-03-09 08:54:12 +00:00
Alexey Marchuk
36ac75b94c nvmf/rdma: Use new RDMA statistics
Change-Id: I11c7793301be9dbe9d4c92e482a97fc6146cc355
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6294
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>
2021-03-09 08:54:12 +00:00
Richael Zhuang
201aa63471 sock: introduce SO_INCOMING_CPU to get placement_id
Leverage SO_INCOMING_CPU to get the CPU affinity of connections
(sockets). And allocate the connections to specific poll groups,
which aims to utilize cache locality.

From our test:
6 P4600 NVMe on target,target uses 8 cores, NIC irqs are bound to
these 8 cores, and initiator side uses 24 and 32 cores,
we can get 11%~17% randwrite performance boost for posix, and 8%~12%
for uring.

Change-Id: I011e0a21502c85adcccd4a14fbe9838b43f54976
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5748
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-03-09 08:53:52 +00:00
Jim Harris
9713bfe90d rpc.py: print better message if cannot connect
We need to catch the JSONRPCException when we cannot
connect, so that the error message can be printed
more cleanly. Also suggest to the user that maybe
they don't have an SPDK application running when
it cannot connect.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I497bed86573d5bf07a2b48b3d6682a2427aa4987
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6754
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-03-09 08:53:36 +00:00
Jim Harris
38736d993d nvme: zero shadow doorbell registers when freeing qpair
The shadow registers need to be zero when the qpair is
created.  This happens automatically when a given qid
is used for the first time, since the page is allocated
with zmalloc. But if a qid is reused, we need to make
sure its shadow registers are cleared *before* we create
the qpair again with the same qid.

So clear the registers in nvme_pcie_ctrlr_delete_io_qpair,
just after the cq is deleted.

Fixes issue #1795.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I08c30d1ea248559a01b802cd132dd57199b491b5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6752
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-03-09 08:53:36 +00:00
ChengqiangMeng
34429830bd unittest/nvmf_rdma: increase code coverage for nvme_rdma_qpair_process_cm_event
nvme_rdma_qpair_process_cm_event code comprehensive coverage.

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: I15a8aef83a8919124eee89111a0134fee8853fcf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6689
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
2021-03-09 08:53:27 +00:00
Jim Harris
22e5037e0c scsi: relax spdk_scsi_task_gather_data assert
If the iov_len is 0, it is OK for the iov_base to be
NULL.

Reported-by: Yi Ren <yunye.ry@alibaba-inc.com>
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I45c9be68fc2975bf2abd91a9d77935ce516c5210
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6706
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-03-09 08:53:21 +00:00
Maciej Szwed
24014d63bd rocksdb: Change absolut SPDK path in RocksDB build to relative path
Because of recent changes in RocksDB Makefile we cannot
use absolute path during its build any more. Change it
to relative path.

RocksDB Makefile change:
80f71b5863 (diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R463)

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I3a4fd010b2d9d8eb0dd3b7bf159d582aa5032669
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6735
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
2021-03-09 08:50:27 +00:00
Konrad Sztyber
b665fd8672 test/external_code: out-of-tree NVMe driver tests
These tests compile the driver both as a shared object and statically
linking it to the identify application.  Additionally, in both
configurations, the app is used to list all available NVMe controllers,
as well as print information about each one indivdually.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I127caf08acad11241bf685b392617ab4b810226b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6680
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-03-09 08:28:22 +00:00
Konrad Sztyber
ae53ab2ddd test/external_code: renamed test case titles
Replaced the "_tc[0-9]+" suffix with a more descriptive title describing
the test case being executed.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Id1c2f6dcf155d8ae99dc490983ab4bb1451bfefd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6764
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-03-09 08:28:22 +00:00
Konrad Sztyber
a115aeff36 test/external_code: bind to all PCI devices
Removed the PCI_ALLOWED="NONE" line from setup.sh calls to bind to all
available PCI devices.  It'll allow the out-of-tree NVMe driver tests
from the following patch to execute properly, as they require NVMe
devices to be attachable from SPDK.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I56e89a6b853f02343803bb6ec704ea3c0a8bd12f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6679
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
183ac8884d external_code/identify: print controller identify data
The application will now print some of the fields from the identify
controller data.

The code has been copied from `examples/nvme/identify`, but, for the
sake of simplicity, trimmed down to printing reduced number of fields.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I838c47deffb0b877344f3cad0e88b6aca19790ea
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6678
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
e4d271f302 external_code/nvme: send identify controller during init
Now that it's possible to both submit the identify controller command
and process its completion, the initialization flow has been updated to
issue that command and update controller's identify data (which can be
retrieved via nvme_ctrlr_get_data()).

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Iee0e85f431275a5e6f1767db1d807de7fba6cdcc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6677
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
71c69ddfc3 external_code/nvme: process completion queue
Added function that check the completion queue for completed commands,
executes their callbacks, and puts the associated requests back onto the
free request queue.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I0f04c0d173a7058d4d4f7e59e573ce48130ff024
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6676
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-03-09 08:28:22 +00:00
Konrad Sztyber
c4d01aa5b7 external_code/nvme: identify command submission
This patch adds code required for sending identify controller admin
command.  It means allocating an NVMe request, filling spdk_nvme_cmd
structure, and submitting the command by writing the command to the
submission queue and ringing the doorbell.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I69934213a350df03852860eeaeadc2a456c7673c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6675
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-03-09 08:28:22 +00:00
Konrad Sztyber
48a89ec7d3 external_code/nvme: introduced nvme_ctrlr_get_data()
This function allows the user to retrieve the controller's identify
data.  Currently, that buffer is zeroed, but it'll be populated by the
identify command.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I91a99feef25ecf94c43cf144c12ac3c541c76cd9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6674
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
5555513653 external_code/nvme: basic controller initialization flow
Added a simple controller enablement state machine based on the CC.EN
and CSTS.RDY bits.  The admin queue registers are also filled during
this process, so it's now possible to send admin requests.

To simplify the code, there are no timeouts for a controller to
transition from a specific state to the next one or for the whole
initialization process.  This means that if a controller gets stuck, the
code will hang indefinitely too.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I93f5a5931d7b24780da242e601dcdf2bec5f6552
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6673
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
a2d3ea8cb3 external_code/nvme: initial controller initialization definitions
After enumerating and attaching NVMe controllers, they're now
initialized at the end of nvme_probe()/nvme_connect().  For now, they're
immediately marked as initialized, but subsequent patches will replace
it with an actual initialization.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I22137bb10e871c7e79c28053c8ec98a835e11147
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6672
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
07dc433a2f external_code/nvme: queue pair initialization
This patch adds NVMe submission/completion queue pair definitions.
These definitions are required to keep track of outstanding NVMe
requests.  The admin queue pair is now instantiated with the minumum
number of entries (2).

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2ced3ce7d210408d66cc17de1e66d86b1a1dbf79
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6671
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
210e0db7e0 external_code/nvme: retrieve page size and doorbell stride
These values are needed for managing a submission/completion queue pair,
which will be added in the subsequent patch.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I80ac0d607160f06a13014b7dea95ae8172290aee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6670
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
7da17fb378 external_code/nvme: enable PCIe bus master and disable INTx irqs
It allows the controller to issue memory read/writes (the bus master
enable bit) and disables the ability to generate INTx interrupts which
won't be serviced.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I3b041f1ea7c2bc275b609afcc3d1e4f655aee4c5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6669
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
ad9ccbbf52 external_code/nvme: controller register access functions
Added getters/setters providing access to several of the NVMe
controller's registers.  Only the registers that are needed for the
initialization are implemented.

For now all of them are unused, so they're marked as external to avoid
the -Wunused-function warnings.  The subsequent patches will make use of
them and mark as static appropriately.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7012583f74e87720f6915afca69474ad1bb1e377
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6668
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
c2ca187c1e external_code/nvme: map controller's registers
The controller's memory register space (located in the first BAR) is now
mapped.  The functions for accessing individual registers from this area
will be added in the following patch.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ie5f88079a46152ba8d68e534d5e4c0c2bef84ef3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6667
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
86b1b71f5f external_code/identify: use nvme_connect() if an address is provided
The identify app can now be used in two modes:
 - without any parameters it'll attach to all available NVMe controllers
   and print each one out,
 - with a single parameter specifying the BDF address of the controller
   it'll only attach and print out information about that controller.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I02c7a8a072f1db5fdfd428a5ab84163f26338a09
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6666
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
5802856ece external_code/nvme: direct NVMe device connect
Added interface, nvme_connect(), for connecting an NVMe device specified
by a BDF address.  Similarly to spdk_nvme_connect(), it returns a
pointer to an NVMe controller representing requested device.

Under the hood, it uses spdk_nvme_pci_device_attach() to attach the
PCI device.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I15c7cabae07539cb97aba810385d26f223abfd6d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6665
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
29342a9ed8 external_code/nvme: device attach/detach
The NVMe devices can now be enumerated, attached, and detached.  To
simplify the driver, the probing step has been omitted - all available
controllers are attached and need to be detached later.

The driver registers itself as a PCI driver via a call to
SPDK_PCI_DRIVER_REGISTER() and then uses spdk_pci_enumerate() to
enumerate available NVMe devices and attach them.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Id03e2f4365f4f7ca98178be70278d0c4b7b34b26
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6664
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:28:22 +00:00
Konrad Sztyber
91b30e7aec test/external_code: initial definitions for basic NVMe driver
This patch introduces initial definitions for a stripped down version of
an out-of-tree NVMe driver.  It's purpose is to showcase SPDK's
interfaces for writing user-space drivers for various types of devices.
The choice of NVMe as the example is based on the fact that it can be
emulated by QEMU and the code can be borrowed from SPDK's regular NVMe
driver.

This driver will only provide the most basic functionalities (e.g.
device probing, controller initialization, only admin queue support,
etc.) and won't have support for any device quirks.  Therefore, it's
only intented to be used with emulated devices.

In addition, an application utilizing the driver to list all available
NVMe controllers and print their identify data will be added.  It'll
be a very basic, stripped down version of `examples/nvme/identify`.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I67c748aabf75a37ca72dfb74301a610f7c4ae2bc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6663
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-09 08:28:22 +00:00
Shuhei Matsumoto
e8cde79560 bdev/nvme: Return the created ctrlr directly from nvme_bdev_ctrlr_create()
This also simplifies the code.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I32ca5e24779dc60e0ff4cf2610951cce55d06c75
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6622
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>
2021-03-08 10:49:54 +00:00