This seems to be cleaning up the pending_recv list to account for the
missed cases in the previous patches in this series. Now that we're
correctly cleaning up the list, don't do this.
Note that if an EPOLLIN event is received but the application never does
a read/recv, the socket will remain in the pending recv list. The next
poll will get another EPOLLIN event, but the logic already handles that
case.
Additionally, left a TODO for a performance optimization.
Change-Id: I1cdde500a5c76554401a89de766d35b7a486b207
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6746
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>
If there was an EPOLLIN event the socket gets adding to the pending_recv
list. But if the application then does a very large read, it will bypass
the logic that clears the socket from the pending_recv list. Fix this.
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ia0ba86012f7c6dfd14eb43ba6eeed94dbbce90ce
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6744
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>
from pending_recv list
If the upper layer performs a read/recv, it should still remove the
socket from the pending_recv list.
Change-Id: I32ca8ecccbfe1e53ecc7d6f57343c2727e84b851
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6743
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>
Add a check and only free g_hotplug_probe_ctx once.
This is to fix below issue:
https://github.com/spdk/spdk/issues/1849
Change-Id: I7387495890830badd06a7341d9ac4d149ca1c9f4
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7002
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
This patch really uses the accelrated engine.
Currently, we only offload the crc32c caculation,
but it can be extended.
Change-Id: If0e4c6a44b6e1e10e03f7eca355bed418d67326b
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6760
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Separate bdev_nvme_reset() and _bdev_nvme_reset() by making
bdev_nvme_reset() call _bdev_nvme_reset_start(), and then
remove the ctx parameter from _bdev_nvme_reset().
This clarifies the next patch and reduces the size of the next patch.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I76b0f2f5b83445845a313203e594dca0be150bc3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6949
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>
We need to pass bio only when the reset request came from the upper
layer. Previously, bdev_nvme_reset() called _bdev_nvme_reset() and
_bdev_nvme_reset() had the second parameter, ctx, to pass bio to
for_each_channel(). However, it was not clean.
Let's separate bdev_nvme_reset() which processes a reset request
came from the upper layer and _bdev_nvme_reset() which proesses
an internal reset request by adding a helper function
_bdev_nvme_reset_start().
The next patch will remove the second parameter, ctx, from
_bdev_nvme_reset() for clarification and further refactorings.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2bd00e3abb56fe8d540b8af55743ee92ca9cd526
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6948
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>
The recent refactoring removed the destruct poller and change the
reset processing to destruct ctrlr after its completion by conditionally
sending message.
But differentiating callback function is difficult if we reset multiple
ctrlrs.
If nvme_bdev_ctrlr->destruct is set, any new reset cannot start. So we can
use an new variable and always execute the callback function.
Add an new variable pending_destruct to struct nvme_bdev_ctrlr, and set
pending_destruct if ctrlr->ref is zero and ctrlr->destruct is true, and
then start destruct ctrlr if ctrlr->destruct_after_reset is set after
clearing pending resets.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9f34c42a40c5a5da54611e7871aef8c58117a56a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6714
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
The following patches will cache and use spdk_nvme_ns pointer rather than
nvme_bdev_ns pointer in I/O paths. As a preparation, change a few cases
to get spdk_nvme_ctrlr pointer from spdk_nvme_ns.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ief5f01f85f46e2ad822af5b5abb13a14f28a0c6a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6834
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This will make the following changes a little easier.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I97ce4fb03d02679f5be152b04c33650bf5164f2a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6833
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Purpose: To setup an accelerated function callback
for created spdk_nvme_poll_group. In this patch,
we just create the interface. The real usage of this
call back will be provided in the other patch.
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I0d936aa4eba4dbfcc0137942156b9f2919eb5b78
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6758
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Previously, not nvme_bdev_ctrlr but spdk_nvme_ctrlr pointer had been
passed to spdk_get_io_channel() in nvme_rpc_io_cmd_bdev_nvme().
There was no unit test for bdev_nvme_get_io_qpair(), and so add
unit test for it to guard us from degradation.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I00fdc14ea6467162c5fb90d04389883d7c409a17
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6920
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
OCF now includes on its own only small part of env, that is crucial for
compiling headers for casadm - an OCL management tool. The idea behind
this is to reduce the amount of included stuff when it is not needed.
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Change-Id: I58fef2be3ccb1cce743093ed973ba54cdbb605e1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6413
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This is the only reason the event.h header is included here
and it isn't necessary.
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I4c0a9828cfede1ccd1c9263ad66b354ba167f434
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6919
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I191ad5e3b153fb563256eba1aa695716f66db788
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6377
Community-CI: Broadcom CI
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>
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>
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>
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>
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>
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>
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>
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>
nvme_bdev_ctrlr is valid while populating namespaces of the
nvme_bdev_ctrlr regardless of the result. nvme_bdev_ns holds
nvme_bdev_ctrlr by its pointer, ctrlr. Hence it is not necessary for
nvme_ctrlr_populate_namespaces_done() to use nvme_bdev_ctrlr_get_by_name()
to get nvme_bdev_ctrlr.
To simplify the code, add nvme_bdev_ctrlr parameter to
nvme_ctrlr_populate_namespaces_done() and remove the
nvme_bdev_ctrlr_get_by_name() call from nvme_ctrlr_populate_namespaces_done().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic2013842fad16ea0de49c18b5b853d147c23a6b2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6621
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: <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
bdev_nvme_no_pi_readv() had not been used for bdev_nvme_no_pi_readv() yet.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9bf815b36ef0daa2f1248f618a9c7e2f1ea62346
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6603
Community-CI: Broadcom CI
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>
spdk_bdev_part_base_construct_ext is called by spdk_bdev_part_base_construct.
there's already an example if a base bdev is an abnormal case we need to do
spdk_bdev_part_base_free to close the base bdev.
From constructing a successful part base bdev util finishing vbdev_split_create.
there're except failure cases to exit.
if a bdev is open and when runs into bdev_unregister_unsafe, it's in an EBUSY
state, bdev will not finished from the list. That spdk_io_device_unregister
will no be executed in spdk_bdev_unregister.
That a subsytem with it callback which is app_reactors_stop can't be finished.
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: Idc156557f936da5f2618421ede2619f1f2e29c51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6599
Community-CI: Broadcom CI
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Use the same style compared the code in posix_sock_close.
Thus if we cannot close sock->fd, i.e., we leak the fd,
but we can still free the memory related with uring sock.
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Id2f0e8a2c7065f100c2b009e76a49b528fd221b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6539
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
In nvme_bdev_ctrlr_create, calloc will be called with a zero size
allocation request if the number of namespaces is zero. The behaviour
is implementation defined if the size of the space requested is zero -
calloc will either return a pointer that mustn't be dereferenced, or
NULL. If NULL is returned, the nvme_bdev_ctrlr_create will fail.
Only call calloc if there are a non-zero number of namespaces.
Otherwise, leave the namespaces pointer with a NULL value. All
references to namespaces[] are either known to be safe, or occur
in the context of looping through the namespaces which will be
skipped if the count is zero. The exception to this is in
vbdev_opal_create, where an assert has been added to match
equivalent code in bdev_ocssd_create_bdev.
Tested by running unit tests on a system that returns a null pointer
for a zero size allocation.
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I058b0683fd9b3a20bf90e54db93ca48b9bb4e40e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6551
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: sunshihao <sunshihao@huawei.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
The statement causes this issue is:
assert(group_impl->num_removed_socks < MAX_EVENTS_PER_POLL);
The call trace is:
The previous solution is:
commitid with: e71e81b631
But with this solution, it will always add the sock
into the removed_socks list even if it is not under polling
context by sock_group_impl_poll_count. So it will exceed the size of
removed_socks array if sock_group_impl_poll_count function will not be
called. And we should not use a large array, because it is just a workaround,
it just hides the bug.
So our current solution is:
1 Remove the code in sock layer, i.e., rollback the commit
e71e81b631. This patch is
not the right fix. The sock->cb_fn's NULL pointer case is
caused by the cb_fn of write operation (if the
spdk_sock_group_remove_sock is inside the cb_fn). And it is not
caused by the epoll related cache issue described in commit
"e7181.." commit, but caused by the following situation:
(1)The socket's cb_fn is set to NULL which is caused by
spdk_sock_group_remove_sock by the socket itself
inside a call back function from a write operation.
(2) And the socket is already in the pending_recv list. It is
not caused by the epoll event issue, e.g., socket A changes Socket B's
cb_fn. By the way, A socket A should never remove a socket B from a polling group.
If it really does it, it should use spdk_thread_sendmsg to make sure
it happens in the next round.
2 Add the code check in each posix, uring implementation module.
If sock->cb_fn is NULL, we will not return the socket to the active socks list.
And this is enough to address the issue.
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I79187f2f1301c819c46a5c3bdd84372f75534f2f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6472
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
When there is not enough memory needed to start cache, print
relevant message and inform about possible solutions.
Fixes#1763
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Change-Id: I911dcb4e86ad7e3f2e2b051678736d4e88869db5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6078
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
When multipath is supported, nvme_bdev will be got via bdev_subsystem.
To make such change transparent, add a helper function
nvme_bdev_ns_to_bdev() and use it for some cases.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia5ad0b87178bc739ba0a75789f9f26b860241a04
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5801
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
By the recent changes, the linked list nvme_ns->bdevs has only a
single bdev at the maximum. Hence replace it by the pointer
nvme_ns->bdev, and remove the linked list pointer nvme_bdev->tailq.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib976e15bb128ba8479070b58e5f4c43fb9dcf479
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6230
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>
By the last changes, not only standard namespace but also ocssd
namespace has only one nvme_bdev, and standard namespace processes
only the head of nvme_ns->bdevs.
This patch changes the common and standard namespace specific
part to process only the head of nvme_ns->bdevs.
The following patch will replace the linked list nvme_ns->bdevs
by the pointer nvme_ns->bdev.
Add a particular error case that nvme_bdev is failed to create even
if ctrlr has one namespace. If ctrlr has one namespace but the
corresponding bdev is failed to create, nvme_ns->populated should
be false and hence nvme_ns->bdevs should not be accessed. However
the code had not assumed such case.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5495882fad8c8a012305177179a46d4373ba75f5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5800
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>
Remove range instance from struct bdev_ocssd_range, and additionally
remove range pointer from struct bdev_ocssd_create_ctx.
Then remove the definition of struct bdev_ocssd_range.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5cb38d17ff2ec852878b481b8974983922fe25d2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6225
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: Konrad Sztyber <konrad.sztyber@intel.com>
The range parameter was deprecated from bdev_ocssd_create(), and
hence one ocssd_bdev can be created per one ocssd_ns now.
Hence process only one ocssd_bdev per one ocssd_ns. The following
patches will replace a linked list nvme_ns->bdevs by a pointer
nvme_ns->bdev.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I824d26f4d2f73326238a6426634e28cfd655a04d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6224
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>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
The user only specifies the starting address of a zone to which to
append to and the actual location is expected to be returned in
bdev_io->u.bdev.offset_blocks.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Icc2e9f5461a746d19686d5288075f03d09bf1b19
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6441
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Default to using epoll unless __FreeBSD__ is defined. Add macros SPDK_KEVENT
and SPDK_EPOLL to indicate whether epoll or kevent is present. The macros
match the naming convention for SPDK_ZEROCOPY which controls zero copy
in a similar way.
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: I4c46fb94b254cb075427bfe07a8085887254c45a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6466
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Remove ocssd_bdev_parameter from bdev_ocssd_from_disk_lba(),
bdev_ocssd_to_disk_lba(), and bdev_ocssd_to_chunk_info_offset()
including unit tests.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iaf52e3e33609e9f1fe13050e95020bad688dc6ae
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6223
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Remove helper functions, ocssd_range_num_parallel_units() and
bdev_ocssd_num_parallel_units(), and get number of parallel units
directly from ocssd_ns->geometry.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2b8c4765442aff4642ad1eaa38df6694ee7ed43d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6221
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
It has been confirmed that there is no affected use case in
the SPDK community when we remove the range parameter from
the bdev_ocssd_create RPC.
Hence, remove the range parameter from the bdev_ocssd_create RPC,
remove range parameter from bdev_ocssd_create_bdev(), remove range
info from ocssd_bdev_config_json(), and then update unit tests
accordingly.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1b0a541b61bf26732fd028dc43becb7ca2384f8e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6220
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Recent refactoring added a critical bug that no media event is pushed
to the target bdev.
Fix the bug by changing return to break.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia674ea2c9c21d08dd23b50a0f726da55011d4be4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6455
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
When socket is being created and zcopy is disabled
by the config, we can return from posix_sock_alloc
function before we try to set quick_ack
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I6670b8337e70ec12b18a5e6753674fbef9e95648
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6382
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>
A single sock connection can call posix_sock_flush,
and this sock may not belong to a polling group.
So add the check in sock_check_zcopy to avoid such issue.
Fixes#1788
Change-Id: Id0a2f80ad0f3cdb7fc736a3be3211e49513751b1
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6334
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Function bdev_nvme_create accpets new parameter - ctrlr
opts which is passed and filled by RPC handler. That
will allow us to add config parameters for other ctrlr
options with minimal changes.
Change-Id: I96ac1b21e7a3816c652765cddade75423eb843ca
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6023
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
To allow SO_MINOR updates on LTS for the whole year it is supported,
the major version for all components needs to be increased.
This is to prevent scenario where two versions exists with matching
versions, but conflicting ABI.
Ex. Next SPDK release adds an API call increasing the minor version,
then LTS needs just a subset of those additions.
Increasing major so version after LTS, allows the quarterly releases
to update versions as needed. Yet allowing LTS to increase minor
version separately.
Disabled test for increasing SO version without ABI change, as
that is goal of this patch. This check shall be removed with SPDK 21.04
release.
This patch:
- increases SO_VER by 1 for all components
- resets SO_MINOR to 0 for all components
- removes suppressions for ABI tests
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I44d01154430a074103bd21c7084f44932e81fe72
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6167
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: Jim Harris <james.r.harris@intel.com>
Our userspace driver already supports the SIZE_MAX
and SEG_MAX features so add these two flags in supported
features.
Change-Id: Ibcbe423dbc1e2e8a31a53b34650c59243d35ba04
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6232
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
When zero copy is enabled in initiator, there could
be the case that a socket connection does not belong
to a polling group, i.e, the application does not use
socket polling group. Then we should actively call
_sock_check_zcopy in posix_sock_flush function when zero
copy policy is enabled.
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Idceaa7557eb265daa878db40c922494c3de35ea8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5423
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Mellanox Build Bot
This was experimental code. Besides being simpler it makes perf
analysis easier and gives complete control of whether batching
is used to the application. The framework will now not use
DSA batches for internal operations.
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ic3139c40371dad64c3bc77818f0ad3f8c31d9af6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5849
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
For flow control reasons we have to resize the bit arrays we
use to manage flow as channels come and go. However since
channels are assigned to devices, until the channel count
reaches the device count there's no sharing so no resize of
the array is needed. So, when we use a device for the first
time there's no need to run through the rest of the channels
and re-balance.
Same thing is done on destruction. The code to free idxd
specific resources was moved from the rebalance function to
the idxd put channel function which is a much more logical
place for it as well.
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ib4df163286906f413dd6429dc6833af7b68e208c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5846
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>
In NVMF TCP initiator when zero copy is disabled,
all requests are completed when we receive EPOLLIN event
for socket, add socket to pending_recv list and call socket's
callback which calls qpair_process_completions. As part of
completions processing on NVME level we receive the number
of completions and resubmit the same number of queued requests.
When zero copy is enabled, some transport requests can be
completed when we receive and process EPOLLERR event, it
happens out of qpair_process_completions context. So part
of requests can be completed, transport level contains
free requests but NVME layer don't have info about it
until it calls qpair_process_completions. And there is
a chance that on posix level when we poll sockets we
receive only EPOLLERR flag without EPOLLIN. In this
case we can complete several requests but don't call
qpair_process_completion so we don't resubmit queued
requests. It may lead to a hang in the end of test run
when there are no mo requests to be completed on transport
level (no EPOLLIN event) and we receive EPOLERR only,
so we can't resubmit queured requests.
This patch fixes this problem, it add a socket to
group's pending_recv list if we received EPOLERR
event and completed at least 1 socket request.
So socket's callback can be called even without
EPOLLIN event.
Fixes issue #1685
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I21d5c2fe6eb0787aab9531925a7f0e2fe18bafaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6162
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Users can now generate the necessary linker args for their
own applications using something like:
PKG_CONFIG_PATH=build/lib/pkgconfig pkg-config --libs spdk_nvme
Dependencies between libraries are included in the generated
.pc files, so the user only needs to pass the top-level subsystems
or individual SPDK libraries they are using in their application.
Modules will automatically be added to the output if the associated
library is specified. For example, specifying "spdk_bdev" will include
the libraries not only for spdk_bdev, but also all of the bdev modules.
Users still need to supply the -Wl,--no-as-needed or -Wl,--whole-archive
flags. They cannot be added to the .pc files without increasing the length
of the argument string by a factor of 15x to 20x.
Modify the test/external_code/hello_world Makefile to use pkg-config to
ensure this gets tested at some level in our autotest environment.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie48a75f11969d5d775d514cf10bcb82d197eabfd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4371
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
According to kernel, use an inline function spdk_nvme_bytes_to_numd
to transfer paload_size form bytes to numer of dwords.
Signed-off-by: sunshihao <sunshihao@huawei.com>
Change-Id: I8b9ded122bbf4a3c8e46988993ea52404783c0b0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5926
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This helps user to locate whether bdev_io fails in
spdk bdev layer or inside Linux AIO.
SPDK_BDEV_IO_STATUS_AIO_ERROR indicates bdev_io fails
due to Linux AIO or its lower layer's failure.
New functions spdk_bdev_io_complete_aio_status and
spdk_bdev_io_get_aio_status can be used to report out
the errno from Linux AIO.
Change-Id: I32640e4a0459cca057278c02ea5a7522f3408a02
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5690
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Usually null bdev is used in testing.
The resize function provides flexibility
Change-Id: I603db0b85ff13a86d38ccc8dd6f260807393df93
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5797
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Need to manage how we store IO context based on DPDK updates
made in 19.11.
Fixes issue #1671
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: If1183808cd30987b6c999912f563949b7ade7fcb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5799
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>
Community-CI: Mellanox Build Bot
Track whether we attached a controller while
polling the probe ctx. If we didn't when the probe
ctx is done, then it means the controller failed to
attach and we need to free the ctx.
Fixes issue #1723.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia7f040a073e4c824c29c0ed493f8391b69f94174
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5818
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: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
When multipath is supported, nvme_bdev_ns will be got via bdev_subsystem.
To make such change invisible, add a helper function
nvme_bdev_to_bdev_ns() and use it in bdev_nvme_io_type_supported()
and bdev_nvme_dump_info_json().
Inline the function and locate it in common.h to use for ocssd_bdev
too.
ctrlr can be got from ns using spdk_nvme_ns_get_ctrlr().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If85c86737e8194b8e34ed62df04a3968443f23bb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5795
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>
Fctor out getting nvme_ns and qpair pointers in _bdev_nvme_submit_request()
into a helper function bdev_nvme_find_io_path().
bdev_nvme_find_io_path() will be used for ocssd_bdev, and hence
locate it in common.h, inline it because it is used in I/O paths.
ocssd_bdev needs not spdk_nvme_ns but nvme_bdev_ns pointer in I/O paths,
and bdev_nvme_find_io_path() returns nvme_bdev_ns.
Besides, move inclusion of likely.h from bdev_nvme.c and bdev_ocssd.c
to common.h.
The next patch will apply bdev_nvme_find_io_path to ocssd_bdev.
By the following patches, bdev_nvme_find_io_path() will take ANA
state into consideration.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3817c9f56606021ebea90fdfbcf0656df9faba82
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5528
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: Jim Harris <james.r.harris@intel.com>
A nvme_ns is associated with a nvme_bdev_ctrlr, and hence we don't
have to pass nvme_ch to bdev_ocssd_get_zone_info().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia58d335721c87d70ad2544d483dbc8767464c287
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5819
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Previously, value '0' is used to reflect efd's
invalidation. But it is possible that efd is 0
if STDIN is closed. So change related condition
checking, and assign efd to be '-1' in initializing
Change-Id: Iffea09b1f094617ab2edd3fe3b98336ec9084b8a
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5781
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
When we do detect new devices, we would like to get them
attached as quickly as possible. Controller initialization
requires a non-trivial number of admin commands, and when
using async probe, it means that after we have detected
a new device, it will take many iterations of calling
spdk_nvme_probe_poll_async() before the controller is
fully attached.
So when we are actively probing a probe_ctx, create
a new poller that is solely responsible for probing
that context at a much higher frequency.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I72fbe3faef2d72608edb163bd87907902d7c3adc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5646
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: <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Object structure will be different after introducing subsystem.
Let's inline nvme_bdev_attach_bdev_to_ns() and
nvme_bdev_detach_bdev_from_ns() as a preparation.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I93fd43db231780b9e86ebaec1a9fb40f8511dab9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5756
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Factor out the common operation of nvme_ctrlr_depopulate_namespace_done()
and nvme_bdev_attach_bdev_to_ns() into a helper function nvme_bdev_ns_detach().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8efa8bc2c2d455d0fd9e0865ff85fd265d14ee06
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5613
Community-CI: Broadcom CI
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>
Separate reference count of nvme_bdev_ctrlr between nvme_bdev_ctrlr
and nvme_bdev_ns.
Set ctrlr->ref to 1 when creating ctrlr, increment ctrlr->ref when
populating ns, decrement ctrlr->ref when destructing ctrlr or
when ns->ref becomes 0, and destruct ctrlr actually when ctrlr->ref is 0.
Set ns->ref to 1 when populating ns, increment ns->ref when
adding bdev to ns, decrement ns->ref when depopulating ns or removing
bdev from ns, and decrement ns->ctrlr->ref when ns->ref becomes 0.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7810384d97a174d8f55d316e5cdf2a9ef4a11432
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5608
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
For further simplification, merge decrementing reference count of
nvme_bdev_ctrlr into nvme_bdev_ctrlr_destruct().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I604039c3f38a60b316ae465d4649e9eb11bfb6cc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5573
Community-CI: Broadcom CI
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>
destruct_poller had been used to destruct ctrlr after completing reset, but
we can remove destruct_poller and change reset processing to destruct ctrlr
after its completion by itself.
spdk_io_device_unregister() may fail spdk_for_each_channel(). Hence call
nvme_bdev_ctrlr_do_destruct() as the completion function of spdk_for_each_channel().
The first idea was to always run destruct_poller at nvme_bdev_ctrlr_destruct(),
but this patch will be simpler and more intuitive.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I43a400bdb67ab015d707fb9679693bd3d5bfb070
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5607
Community-CI: Broadcom CI
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: <dongx.yi@intel.com>
Purpose: In order to free all the allocated resources.
Our current code uses sync behaviour, and it will not wait for all
the resources are freed if there is active I/Os, and thus we will
not free some resources, e.g., some fds will not be closed.
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Iaf9a606da2049ffd0096860c46d89d094038a5ff
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5601
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Sun Zhenyuan <sunzhenyuan@baidu.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
The following patches will need to update nvme_bdev_ns at
nvme_ctrlr_depopulate_namespace_done(). nvme_bdev_ctrlr can be
got from nvme_bdev_ns, and so this change will cause no issue.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7cbfe0d936a3a757a8792fdf842e1228b2df05e6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4531
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Move nvme_bdev_attach_bdev_to_ns() into nvme_bdev_create() and
change the return type of nvme_bdev_create() to int.
These refactorings are necessary to share a single nvme_bdev among
multiple nvme_bdev_ns.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I81c702bfec15f14c6b4a6588d1d3dfa28a9e3e6d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5650
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This will make us a little easier to understand nvme_bdev and clarify
the difference between nvme_bdev and ocssd_bdev.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If6e93bcc315612ec88c452cf9ae87a3db8ec7855
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5649
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This is a preparation for the next patch.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I20f7b03e15fe8cc74b22ff46040a4eba9cc63231
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5648
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
We do not know if reconnecting I/O qpair succeeded or failed now.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I030c3d8553efac7878da0fe358a624a502dd8656
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5699
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Add an new variable is_failed to struct nvme_bdev_ctrlr_trid, and
set it to true when starting failover or when failover failed, or
set it to false when initializing or failover succeeded.
Then add an new failover trid before all failed trids.
The test log showed that many failover failed because new trid was
added after failed trids.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I220839245c6414b5d3ef69a2fa1b97904d88d8bd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5698
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
We do not know failover is attempted from which path to which path.
Get these information by NOTICELOG.
Failover or reset is serialized by the flag ctrlr->resetting and
ctrlr->failover_in_progress.
Hence it is enough to add such information only to start.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I97400c048b39dc1b70e6aeb71643b5ed1ca23e72
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5695
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Force is not supported in loading-existing-cache scenario,
so it is set to true only when initializing cache as new.
There is already patch in OCF waiting to be merged, that
addresses this problem by creating completely separate
pipelines to load and attach scenarios, thus ignoring the
force flag when cache is being loaded.
Fixes#1708
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Change-Id: I72269e2eacab6dffbecb725592af555e2f3702de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5595
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>
This change clarifies and simplifies the code when we support ANA
multipath because nvme_bdev and nvme_bdev_ns are not associate
directly and nvme_bdev_ns is got from nvme_bdev_subsystem instead.
As a result of this change, remove bdev_ocssd_get_ns_from_bdev()
because it is not used anymore.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I17a6eb4c63aa99e3537d7ad6ce134277c32e8d3e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5562
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Add a small helper function bdev_ocssd_get_zone_size() to get zone_size
directly from ocssd_bdev. We do not need to cache nvme_bdev to get
zone_size by this helper function.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8a6fffac6efaff2cb4cc872c19d85e8e504c5622
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5561
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
I/O submit functions need only qpair, and so let's pass it directly.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I11634f16ddec9371f3857587014e20312234fff8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5560
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Call bdev_ocssd_read() directly when buffer is already allocated
to improve performance and support retry in the bdev module as done
for the standard NVMe bdev.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Icf18148e09b61df7effc84535bea60f49d1c15b3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5559
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Add nvme_bdev_ns pointer to struct bdev_ocssd_create_ctx and use it.
This will be helpful for the upcoming patches because nvme_bdev will
not hold nvme_bdev_ns directly and will have to be got via nvme_bdev_subsystem
instead.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8417ecb049fe7a3f50793db1d570733227f4f6b1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5556
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
The next patch will add nvme_bdev_ns to struct bdev_ocssd_create_ctx.
This patch is a preparation for it.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I37c35e0d89a088dbc5f0a9896c5fd03e22bfa6a5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5555
Community-CI: Broadcom CI
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
We can pass nvme_bdev_ns directly to bdev_ocssd_verify_range() and
actually we don't need to check if bdevs are created on the same
namespace.
For the former, change parameters of bdev_ocssd_verify_range() from
nvme_bdev_ctrlr and nsid to nvme_bdev_ns. For the latter, remove the
check but add assert to nvme_bdev_attach_bdev_to_ns() instead.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I23c3a0ad02fa2b9f4c8149d9b02660140b2d3951
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5554
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
As same as the last patch, change bdev_ocssd_lba_in_range() to take
ocssd_ns as an additional parameter.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id8ceffa8ccaa279d6036408b8730e7b896b23b1a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5539
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
As same as the last patch, change bdev_ocssd_to_chunk_info_offset()
to take ocssd_ns as an additional parameter.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I05eae4206cad0511029b9b5c97b4e87facf109ab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5538
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
As same as the last patch, change bdev_ocssd_from_disk_lba() to take
ocssd_ns as an additional parameter.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2612df739137f687cf9aa8699c54885836742b88
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5537
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
As same as the last patch, change bdev_ocssd_to_disk_lba() to take
ocssd_ns as an additional parameter.
In unit tests, get ocssd_ns from not ocssd_bdev but nvme_bdev_ctrlr
because direct association between nvme_bdev and nvme_bdev_ns will be
removed when supporting ANA multipath.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8e86b43bfe435fb2732e29e0fb6926d7572b29e2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5536
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
When the NVMe bdev module supports ANA multipath, struct nvme_bdev
will not have nvme_bdev_ns pointer directly and will get via
nvme_bdev_subsystem.
The patch series starting from this patch will change helper functions
to get both ocssd_bdev and ocssd_ns as parameters to make the
upcoming changes easier.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iacec2eadc9e56ae7b84ee3c313c8986f55983a08
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5535
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
bdev_nvme_submit_request() calls bdev_nvme_get_buf_cb() directly
when the buffer is already allocated. This is for performance improvement
but will be helpful for the upcoming multipath feature to retry
read I/O submission because buffer should be allocated only once.
By reading the code a little more critically, bdev_nvme_submit_request()
can call bdev_nvme_readv() directly in this case, and do in this patch.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I005c70deabf7fbfe84b7029e9ef103ae122605e1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5558
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
nvme_bdev_ctrlr pointer is already cached to nvme_io_channel.
Hence let's remove it from the helper functions, bdev_nvme_create_qpair()
and bdev_nvme_destroy_qpair().
The following minor fixes are done together in this patch.
Fix the error paths of bdev_nvme_create_qpair() because
bdev_nvme_destroy_qpair() cannot be used as is in this case.
When calling bdev_ocssd_destroy_io_channel(), check if nvme_ch->ocssd_ch
is not NULL instead of spdk_nvme_ctrlr_is_ocssd_supported().
Cache nvme_bdev_ctrlr to nvme_io_channel just before calling
bdev_nvme_create_qpair() because the pointer is more associated
with qpair.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic96b7d0fa27dd1f32d573eecdc9d4eacc5593bde
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5511
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Factor out each RPC configuration from bdev_nvme_config_json() and
bdev_ocssd_namespace_config_json() into a helper function, respectively.
These changes will make us easier to introduce subsystem into the
NVMe bdev module.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I297f3fb47893d45463e742834c58d2b1213a4b01
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5468
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
When a device is removed, we should use the remove_cb
that was specified when the device was originally probed
and attached, if one was set.
Also add a new spdk_nvme_ctrlr_set_remove_cb API. This
can be used for cases where a different remove_ctx is
desired than was specified for the probe call. This
also enables setting a remove_cb when using connect APIs
which do not have a way currently to provide a remove_cb.
This also requires fixing the bdev nvme module, which
was depending on the previously errant behavior.
Fixes issue #1715.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id848b39040099ff7a21fe57ea6b194a8c25ae015
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5510
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
It is recommended to read CSTS when there is a timeout.
If CSTS.CFS (Controller Fatal Status) is set, we should
reset the controller.
But if an admin command on a fabrics controller times
out, reading CSTS submits another fabrics command that
could also timeout. Even worse, we are recursively
polling the admin queue for completions in this case.
Fixes issue #1716.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I23d31f6302375c52eba6f4370748d622fbd25ca7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5513
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>
This was missed when this option was added recently in
46a348597 (rpc: add keep alive parameter in bdev nvme).
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I38fa2d4fc7c995bb0cea89b7b8cb51b2ce72aaa0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5512
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
The backend device such as virtio-blk or virtio-scsi
may support the SIZE_MAX and SEG_MAX. Then SPDK needs
to split the big IO. Add this feature in bdev.
Change-Id: I2442e14121ccf141682964425e96382fec482af3
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4600
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Add keep alive timetout parameter in bdev_nvme_set_options.
NVMe bdev can set this value especially when we test with
bdevperf.
Fix github issue: #1690
Change-Id: I255c935671b74cdb615a8d393e7d7e84524f3c23
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5306
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
SPDK supports two latest DPDK LTS releases and DPDK 20.11
is out now.
Remove all functionality and checks for versions <= DPDK 19.11.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9c354b7bc56d35a9ab04375f9f5255ca914d53e1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5344
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>
This can be done via explicit options on the
application command line instead.
This has the added benefit of removing a usage of
whitelist/blacklist which we are working to
remove from the SPDK repository.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5739e281f1c29fc8a5d175f5bbc916cd7d926fe4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5274
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
In other places, nvme_ns->populated has been used to check an namespace
is active for an existing nvme_bdev_ctrlr. We do not need to call
spdk_nvme_ctrlr_is_active_ns() again. Follow it in this patch.
Besides, factor out the namespace comparison into a small helper
function bdev_nvme_compare_ns(). It will be used to check if two
controllers have the common namespace for ANA multipath.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8aad2f58aae1fd45ca0dd981dded1c406f215ac0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5359
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>
Previously, we separated two cases, creating an new nvme_bdev_ctrlr
and adding an new path to an existing nvme_bdev_ctrlr as early as
possible.
However, we can merge creating an new connection between these two
cases. In this patch, connect_attach_cb() calls bdev_nvme_add_trid()
and then calls spdk_nvme_detach() if the nvme_bdev_ctrlr whose name is
ctx->base_name already exists.
This will simplify ANA multipath feature.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2eec92dbf96e979690a1087c5c4fc306a29f15de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5329
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>
Move bdev_nvme_add_trid() up in a file to locate it before
connect_attach_cb(). The next patch will change bdev_nvme_add_trid()
to be called by connect_attach_cb() to merge the connect operation
for failover case.
bdev_nvme_add_trid() will be associated more closely with
connect_attach_cb() and bdev_nvme_create(). To make it clear,
move bdev_nvme_remove_trid() down before bdev_nvme_delete() too.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia5eb491baea57d715aadc07f206b94884334efaf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5328
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>
Even if we use TAILQ_FOREACH_SAFE(), it is not safe to lock and unlock
while linked list is parsed.
To fix such erroneous implementation, use SPDK message.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I79a126560ccd847149d4d06bb3d2111e43060ff7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5321
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>
Factor out the common operation to destruct nvme_bdev_ctrlr further
into an new helper function _nvme_bdev_ctrlr_destruct() from
remove_cb(), bdev_nvme_delete(), and bdev_nvme_library_fini().
The next patch will use SPDK message to fix the race condition
by locking/unlocking during linked list parse.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If5392bebcf830fac6165aa424b06aec0c9274dc8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5320
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>
Currently only nvme bdev module implements this interface. Bdev module
context (in this case spdk_nvme_ctrlr opaque handle) allows for nvme
interface usage for additional management.
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I6302c9229d5f7f294a3c1472d9e8dc1519637ffb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4924
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
The purpose is to reduce the duplicated functions
in posix and uring implmentation.
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Ia0568b2490d362e7e78fa59b3ca88a60313ba0bd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5284
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This is the end of the series to make the code of ocssd_bdev more
similar with nvme_bdev.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9dfc2634292ec581d6787500e46e74ad3b95aa90
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5251
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>
Extract and pass contents of spdk_bdev_io to I/O submit functions.
Besides, adjust the coding style for I/O submit function calls
with nvme_bdev.
The next patch will replace spdk_bdev_io parameter by bdev_ocssd_io
parameter for I/O submit functions.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2556d4a3c092d4ffacd47bbfc95db060da477bc3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5250
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>
nvme_bdev passes not spdk_bdev_io but nvme_bdev_io pointer to I/O
submit functions, and gets spdk_bdev_io pointer from nvme_bdev_io
pointer in its completion callback functions.
This is very clean because spdk_bdev_io is processed by the generic bdev
layer and nvme_bdev_io is processed by the NVMe bdev module.
The patch series changes ocssd_bdev to pass not spdk_bdev_io but
bdev_ocssd_io pointer to its I/O submit functions.
This patch is the first of the series and add ocssd_bdev parameter
to I/O submit functions. ocssd_bdev pointer is got from
bdev_io->bdev->ctxt. Hence this patch removes one dependency on
spdk_bdev_io.
One noticeable small change is that get_zone_info() gets zone_info
from not bdev_io->bdev but nvme_bdev->disk to advance removing
the dependency on spdk_bdev_io.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia3127ceb1fc8923e321a1404edbb19b63f5fde5d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5248
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Locating bdev_ocssd_num_parallel_units() and bdev_ocssd_num_zones()
closer to the related helper functions makes us a little easier to
understand the code.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0d96034bf26b2b1a39d879654ca2b30289349e4d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5127
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>
There are many duplicated codes about sending response for writing bool result.
That we need a function to do this.
Then we can reduce many codes.
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: Ic439111b1e9ca1013f8c657ab925f0c27a7be699
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5033
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Following a previous patch, cache pointers to spdk_nvme_ctrlr and
spdk_nvme_ns in bdev_nvme_dump_info_json().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I769d112f815e29262d52faee5ec17ccb914a7154
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5104
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>
bdev_nvme_failover() updates trid of spdk_nvme_ctrlr using
spdk_nvme_ctrlr_set_trid(). Hence trid of spdk_nvme_ctrlr is always
up-to-date.
Hence bdev_nvme_dump_info_json() can query trid simply by calling
spdk_nvme_ctrlr_get_transport_id(). The queried trid is a const
parameter. Hence add const to nvme_bdev_dump_trid_json().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id04881f9e7596b910bdf26c4f14f1ebcb3cdbbee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5103
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
bdev_nvme_io_type_supported() queries NVMe driver to return if the
specified IO type is supported. To clarify it, cache pointers to
struct spdk_nvme_ctrlr and spdk_nvme_ns.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0956506e720722216e03cb808f61737ada617329
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5102
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
In the following patches, nvme_bdev_subsystem will be added and nvme_bdev_ns
will be added to not nvme_bdev but nvme_bdev_subsystem.
To do it easier, factor out creating an NVMe bdev into an new helper
function nvme_bdev_create().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifa902912ba1ea979153b04ef4ac9fae10c09b7e2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5018
Community-CI: Broadcom CI
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>
bdev_nvme_reset() has been called only by a single caller now.
Hence pass nvme_ch to bdev_nvme_reset() to queue I/O easily.
This will improve readability and clarify the logic.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idc22cb499fcf8455a2b04d44688f999344abc352
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4992
Community-CI: Broadcom CI
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>
Factor out the common operation between internal calls and bdev I/O
calls of bdev_nvme_reset() into an new helper function
_bdev_nvme_reset().
This is to improve readability and to clean-up the operation only
for bdev I/O calls in the next patch.
Replace bdev_nvme_reset() by _bdev_nvme_reset() for internal calls.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7580a8fb40d5a1d694d5f913cde770ca95a0b0c8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4991
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
_bdev_nvme_reset_ctrlr will figure out what it really does.
_bdev_nvme_reset will be used by an new helper function in the
next patch.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I890f962529a663ea412bcd416ef9ba31fadfbf61
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4990
Community-CI: Broadcom CI
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>
bdev_nvme_delete() had called nvme_bdev_ctrlr_get_by_name() and
then called remove_cb(). But nvme_bdev_ctrlr_get_by_name() had not
been guarded by lock and remove_cb() parsed the list again by using
spdk_nvme_ctrlr as a key.
These were not safe and efficient.
This patch refines bdev_nvme_delete() to inline remove_cb() into
it and acquire mutex before calling nvme_bdev_ctrlr_get_by_name().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibf39859809efa6f22899353c53b7b1eef58aa470
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4842
Community-CI: Broadcom CI
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>
Add the second parameter remove and include path removal into
bdev_nvme_failover(). Additionally, bdev_nvme_failover() returns
only two return values, 0 or -EAGAIN, and hence change
bdev_nvme_remove_trid() to return the return value of
bdev_nvme_failover() directly.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ife560f886e32ecec23691e01e87069502e27cc0c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4867
Community-CI: Broadcom CI
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>
nvme_bdev_ctrlr_destruct() had checked first if poller is already
registered. On the other hand, nvme_bdev_ctrlr_destruct() had been
used as a poller function.
Hence nvme_bdev_ctrlr_destruct() had no way to unregister poller
if destruct and reset controller were raced.
This patch fixes the issue. The previous patch ensures nvme_bdev_ctrlr_destruct()
is called only once.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iba5424c42a4a3e5f03575df2616ec2a817e38f51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4827
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Checking if destruct is false and setting destruct to true are
separated by mutex in remove_cb() and bdev_nvme_library_fini().
It was possible that multiple threads called nvme_bdev_ctrlr_destruct()
because the caller could call nvme_bdev_ctrlr_destruct() before
setting destruct to true after knowing it was false.
This patch ensures that nvme_bdev_ctrlr_destruct() is called only once.
Set ctrlr->destruct to true without releasing mutex after checking
if ctrlr->destruct is false.
If destruct is set to true before calling nvme_ctrlr_depopulate_namespaces(),
nvme_ctrlr_depopulate_namespace_done() may call nvme_bdev_ctrlr_destruct()
because it is likely that reference count is zero and destruct is true.
In this case, remove_cb() or bdev_nvme_library_fini() cannot call
nvme_bdev_destruct() after returning from nvme_ctrlr_depopulate_namespaces().
On the other hand, if a controller has no namespace,
nvme_ctrlr_depopulate_namespaces() does nothing and
nvme_ctrlr_depopulate_namespace_done() is not called. Hence
remove_cb() or bdev_nvme_library_fini() has to call nvme_bdev_destruct()
after returning nvme_ctrlr_depopulate_namespaces().
To unify both cases, initialize reference count to one as a sentinel value
and remove_cb() and bdev_nvme_library_fini() decrement reference count
and then calls nvme_bdev_ctrlr_destruct() if reference count is zero
after returning from nvme_ctrlr_depopulate_namespaces().
Additionally, add assert to check if reference count is not negative
to find bug in future.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8a617b5aa4d0a9faff832e63c2ed4b353341dd6b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4817
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
subnqn will be used to manage subsystem, and so add it to the output
of bdev_nvme_dump_info_json().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id28023754fa19d14aa9297f4e6676d235f024e0f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4974
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
To improve readability and make the following patches easier,
factor out the common operation of bdev_nvme_create_cb() and
_bdev_nvme_reset_create_qpair() into bdev_nvme_create_qpair(),
and factor out the main operation of bdev_nvme_destroy_cb()
into bdev_nvme_destroy_qpair(). bdev_nvme_destroy_qpair() is used
in the error path of bdev_nvme_create_qpair().
Updating g_opts.io_queue_requests again is no harm and so is done
in bdev_nvme_create_qpair().
Use the term nvme_ch in bdev_nvme_create_cb() and bdev_nvme_destroy_cb()
for clarification.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie0a4251023037958d122fbb5d7ee72d42238b3ed
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4981
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This change will make the next patch smaller and its review easier.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2784fa74dce98676958180bbf80a9a4f938454db
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5101
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Since spdk_sock_group_poll should do level trigger to
the callback func registered in spdk_sock_group_add_sock,
if there is data in pipe, but not event occurs, poll func
should still reap sock who has data in pipe.
Change-Id: If3a983f80fd04708e45ad0398c7d34018ec52bc7
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5072
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This change removes the necessity to get nvme_bdev_ctrlr by calling
nvme_bdev_ctrlr_get_by_name() and simplifies the code.
bdev_nvme_reset() checks if nvme_bdev_ctrlr->destruct is false first.
Hence we will not degrade stability.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7a3baab666644c3063af404905284c3e16bc62ab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4843
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
OCF metadata updater is handling all the requests at once and when
it finishes the cache can deinitialize, so in the rare circumstances
when the thread is not aware of cache not existing any more, there
is another metadata kick request and check for the random pointer
is performed instead of expected cache.
The solution is to increase/decrease cache ref count prior sending
a message to a thread and after metadata has been updated.
Fixes#1533
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Change-Id: I77d2ae400110fcb4d491350e5fec334245f4bb90
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5030
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Calling spdk_nvme_ns_get_data(ns) on an inactive namespace will crash.
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ib8cfa84e785a4a04dc3b1826c700a22eeec51e3c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5013
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Analyzer treats these as warning, they are unused.
Issue:
bdev_nvme_rpc.c:706:7: warning: Although the value
stored to 'rc' is used in the enclosing expression,
the value is never actually read from 'rc'
if ((rc = spdk_nvme_ctrlr_reset(firm_ctx->ctrlr)) != 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bdev_nvme_rpc.c:851:8: warning: Although the value
stored to 'rc' is used in the enclosing expression,
the value is never actually read from 'rc'
if ((rc = spdk_bdev_open(bdev2, true, NULL, NULL, &desc)) != 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
nvme_rpc.c:375:10: warning: Although the value stored
to 'rc' is used in the enclosing expression, the value is
never actually read from 'rc'
return rc = val->type == SPDK_JSON_VAL_STRING ? -ENOMEM : -EINVAL;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I1d58db97b00ac2d102c1a46d7852c2ce3f559fda
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4824
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
If interrupt is set, related poller functions will be
registered to thread interrupt instead of poller.
interrupt_tgt can create aio bdev now.
Change-Id: Id777a55c8b7dc7a220f94ab837f7039ecea4fcb4
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4273
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
And to eliminate an artificial constraint on # of user descriptors.
The main idea here was to move from a single ring that covered all
user descriptors to a pre-allocated ring per pre-allocated batch.
In addition, the other major change here is in how we poll for
completions. We used to poll the batch rings then the main ring.
Now when commands are prepared their completion address is added to
a per channel list and the poller simply runs through that list
not caring which ring the completion address belongs too. This
simplifies the completion logic considerably and will avoid
polling locations that can't potentially have a completion.
Some minor rework was included as well, mainly getting rid of the
ring_ctrl struct as it didn't serve much of a purpose anyway and
with how things are setup now its easier to read with all the
elements in the channel struct.
Also, a change that came in while this was WIP needed a few fixes
to function correctly. Addressed those and moved them to a
helper function so we have one point of control for xlations.
Added support for NOP in cases where a batch is submitted with
only 1 descriptor.
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ie201b28118823100e908e0d1b08e7c10bb8fa9e7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3654
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>
The new design:
* Supports a generic batching capability in the accel_fw layer
that keeps track of hw accelerated vs sw commands based on
the capabilities of the engine and processes sw commands in the
generic layer while sending a list of commands (not a batch)
to the engines for processing.
* Batch completions are managed via the generic layer, when using
the accel_fw the engines only process commands. With DSA however,
if a list of commands is sent down it will use the DSA public
API to create and send batches but will rely on the generic layer
to complete the batch task itself. When using DSA directly, batching
works as usual (DSA handles batch completion).
* The engine function tables were greatly simplified by replacing
all of the individual entries (copy, fill, crc32c, etc) with one
`submit_tasks` function that is used to both send lists of tasks
for batches or just one task for single shot API.
* Internally batching is now used to re-submit tasks that were queued
for flow control reasons.
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I99c28751df32017c43490a90f4904bdabe79a270
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3555
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
This patch removes callback function for subsystems to
present their options for legacy config.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I63076fc03eff45da5d57fab03501602922a20e3e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4749
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This patch removes function for bdev modules to
present options of the bdevs.
blob_bdev.h refers to the spdk_bdev_module, so would need
to be bumped too.
At this time spdk_bdev_module is left unchanged to prevent
that.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3cacb087c998d928c5d8c2722b7f041d82bb43f1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4748
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
This patch removes legacy config support in iscsi subsystem.
All options through the legacy config are already reflected in JSON.
Following RPCs are corresponding to removed legacy config sections:
Initiator groups - iscsi_create_initiator_group and iscsi_initiator_group_*
Subsystem options - iscsi_set_options
Portal groups - iscsi_create_portal_group
Target node - iscsi_create_target_node and iscsi_target_node_*
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I11326a84d4d580b19db422b8522198eea5a5be0d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4747
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Replace all calls of spdk_bdev_create_bs_dev_from_desc() and
spdk_bdev_open_ext() by calls of spdk_bdev_create_bs_dev_ext()
including unit tests.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idb9dc5a10f6e221c26e82e0194930cb7a2071dae
Change-Id: I61e577db9e26ef3e1c3e2e4093ad66922a178f34
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4723
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>
Change the first parameter of vbdev_lvs_create() from bdev pointer
to bdev name, and then remove spdk_bdev_get_by_name() from
rpc_bdev_lvol_create_lvolstore().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9b0e47f551657f6aa1235af37a8357b0af62d414
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4707
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
spdk_bdev_create_bs_dev_ext() gets not bdev pointer but bdev name
as an argument, and hence vbdev_lvs_create() will get bdev name
accordingly.
However after completing spdk_bdev_create_bs_dev_ext(),
vbdev_lvs_create() has to get bdev pointer from the created bs_dev.
Hence add a function pointer get_base_bdev to struct spdk_bs_dev
and set it to bdev_blob_get_base_bdev() at initialization.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idef0663ace85db0269442212014286669c150069
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4706
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This is a drop-in replacement. The following patches will remove
spdk_bdev_get_by_name() from the operation to create lvol store.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I31688cf98625f1d13012281d89f06d343e2f2cef
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4705
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
spdk_bdev_open_ext() requires the caller to use bdev_event_cb_t
and bdev_event_cb_t is more extensible than bdev_remove_cb_t.
Hence use bdev_event_t as an argument.
spdk_bdev_open_ext() calls spdk_bdev_get_by_name() inside and
spdk_bdev_create_bs_dev_ext() calls spdk_bdev_open_ext() inside.
The caller needs to know if the spdk_bdev_get_by_name() succeeded.
Hence spdk_bdev_create_bs_dev_ext() returns return code by return
value and returns the created bs_dev by double pointer.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1c225bfb66db036439c69c459f39c86684d8a540
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4692
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
- Removed slew of conf.h includes
- No longer require mk vars that include conf
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ica7e8e8bf1d4a5d0b0200bfe689aa13afd77bfaf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4746
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>
Since legacy config is being removed, SPDK_ACCEL_MODULE_REGISTER
macro no longer needs field corresponding to processing this
type of configuration.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I76ca02487a5fb8f9ecc9d33ac6fa514e7226a03b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4636
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This patch removes legacy config support in ioat accel module.
All options through the legacy config are already reflected in JSON.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Iebaeef4cf648874700238f6167462f4958546be2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4635
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This patch removes legacy config support in virtio_blk and virtio_scsi bdev modules.
Most of the options through the legacy config are already reflected in JSON.
Exception to that is "[VirtioPci] Enable" option, which worked for virtio_blk
and virtio_scsi. It then on initialization scanned virtio_pci devices for
presence of blk/scsi. There is no RPC that scans it on demand, nor was it used
in any of the tests. So this patch removes that functionality,
if needed this can be reintroduced as new RPC (or two for each backend).
Module initialization for bdev_virtio_scsi changed to be synchronous.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib0978a4a084795e94993bb9122bd73ed49e14b96
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4667
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This patch removes legacy config support in nvmf subsystem.
All options through the legacy config are already reflected in JSON.
Since the step in target initialization no longer does config
parsing, it was renamed appropriately.
There is no longer a need to delay this step via send msg,
since no callback is used.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5ee080bb1f5bf954f3b00545adb16e7176c35530
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4644
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
This is a step to prepare for deletion of conf.c.
Adding discovery subsystem is now moved out of parsing the legacy config.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Idd36b5443541a1cc542d6837f17798bc6aaf17e9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4664
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This is a step to prepare for deletion of conf.c.
NVMe-oF target application always creates the default 'nvmf_tgt'.
This was done as part of legacy configuration parsing, but does
not belong there at all.
Acceptor poll rate and max subsystems are set via RPC before this
step, or via legacy config. Since this patch creates target before
parsing the config, options defined there no longer change the target.
Parsing of legacy config will be removed further down the series,
so no need to refactor to keep the original functionality.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6f87df0ad3f03b72d6f916de50e5eab6d29dafa9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4663
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This is a step to prepare for deletion of conf.c.
spdk_nvmf_tgt_conf was allocated either by RPC or legacy config.
RPC still had to to allocate that because settings for subsystem
are set before subsystem itself initializes.
This patch removed both allocations and just defines that in the
subsystem. nvmf_set_config RPC can now be called multiple times,
only overwritting values that were passed.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5438a91c1d15070f1f193e29f2000c4b58ea4816
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4662
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>
This patch removes legacy config support in vmd subsystem.
All options through the legacy config are already reflected in JSON.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I45f66809a889b39a05bf4f6856431d922b497c76
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4641
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Except for bdev_ocssd_submit_request(), we can pass nvme_ch instead
of ch to I/O functions, and do the change in this patch.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia9e09300d053fa80ada8286c8df7ec689bdb9aaf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4527
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This change follows the standard nvme bdev.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I83486712d23668e2688e0f1353519cea6dd6fef7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4689
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This changes follows the standard nvme bdev.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8306fef00489b36b57065bde78ccf9d852b5cba9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4688
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This change follows the standard nvme bdev.
Two local variables used ioch for nvme_io_channel and they were
confusing. Rename them by nvme_ch too.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iad42d28e698c3cacc3ebc9df379fc7551bebcb55
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4687
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
As same as the last patch, follow the pattern used by standard nvme
bdev about bdev_ocssd_submit_request().
Extract main operations from bdev_ocssd_submit_request() into
_bdev_ocssd_submit_request().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I286b4d82a356a3f1fac9c052397714cd7ee8497d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4525
Community-CI: Broadcom CI
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
It looks that we do not have any special reason not to follow
standard nvme bdev about bdev_ocssd_reset_sgl() and bdev_ocssd_next_sge(),
and it will be good for ocssd bdev to follow standard nvme bdev.
Add iovs and iovcnt to struct bdev_ocssd_io and rename iov_pos by
iovpos and iov_off by iov_offset.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ied864dc9505b3f1c0a19a8a36031dda9e32eb4d6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4524
Community-CI: Broadcom CI
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
We have two functions, remove_cb() and bdev_nvme_library_fini() to
depopulate all existing namespaces.
Factoring out the operation into a helper function
nvme_ctrlr_depopulate_namespaces() will improve the readability.
Besides, change the line after return value for two functions to
adjust format.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibda921bdc94a50c14cca0ece462f76197efc5ccb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4642
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Swap the resetting case and the non-resetting case. Unlock mutex
before calling spdk_bdev_io_complete(). Use curr_trid instead of
tmp_trid to clarify the meaning of the stored value.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If3b520a16459aba498ac80ed887b9223ac5ca3d8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4523
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Consolidating error paths will be helpful to create and associate
with the creating controller. Fix a couple of memory leaks in error
paths together.
Then rename create_ctrlr() by nvme_bdev_ctrlr_create() to follow
naming conventions and clarify what type of controller is created.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3f9073756198c0b0bc65b67ce84a41233297eac0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4509
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This patch removes legacy config support in uring bdev module.
All options through the legacy config are already reflected in JSON.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I79f9b4458af2fdf0e4683f9cd82b64e9658c5fcb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4672
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This patch removes legacy config support in split bdev module.
All options through the legacy config are already reflected in JSON.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Iaa8e546bbd6357ba93af8164e2f3d8e497fcec06
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4634
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This patch removes legacy config support in passthru bdev module.
All options through the legacy config are already reflected in JSON.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I53ee6e78d210c155a31ae6204472e89756e43e65
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4633
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This patch removes legacy config support in null bdev module.
All options through the legacy config are already reflected in JSON.
While here, added allocation failure check for g_null_read_buf.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I59a28a402e0c61e5636da623bc109e15b36f0584
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4626
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This patch removes legacy config support in malloc bdev module.
All options through the legacy config are already reflected in JSON.
Note that malloc_disk_count needs to be reset for each module initialization.
Otherwise for cases where bdev submodule is reinitialized, the count in
malloc names would grow. This should be addressed separately by making name
parameter required, rather than optional. Which is the case for most (all?)
of the other bdev modules.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ida93c74e7b0be7da19e11d5cc3fda9112824782f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4625
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>
This patch removes legacy config support in GPT bdev module.
Please note that disabling probing only for GPT partition does not
have a corresponding RPC.
Similar functionality is possible for all bdev modules at once via
`bdev_set_options --disable-auto-examine` RPC then followed by
`bdev_examine` RPC for particular bdev.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9a106b3dc0953166264b11c2e95c4433163fcd3c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4624
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
It is not really necessary to replace spdk_bdev_open() by
spdk_bdev_open_ext() for virtio scsi bdev, but spdk_bdev_open() has been
deprecated. Hence do the replacement in this patch.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I995c01c3c5842b306497e32099f6cfe767333091
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4725
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This is a drop-in replacement.
spdk_bdev_open_ext() requires the caller to specify event_cb.
Hence base_bdev_event_cb() calls hotremove_cb() only if event_cb is
not NULL.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I98cd29781412406470a173e9714c65a07288c573
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4690
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
To reduce the patch size, use local variables for descriptor and
bdev pointer before allocating the bdev_zone_block structure.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie33fac33eeb39ccc2b016d2f9c1711fcf76ebd7a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4649
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
There are more transport on the way and we don't want to add
all their various opts into the single, generic structure.
We'll pass the JSON structure to transports instead. Then
the transport code can custom pull from the JSON any param
it wants.
To complement that, transports will now also have their own
JSON config dump callback. This was only done in the generic
nvmf.c so far, with conditions for RDMA and TCP.
Change-Id: I33115a8d56cec829b1c51311a318e0333cc64920
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Signed-off-by: jiaqizho <jiaqi.zhou@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2761
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This is just a drop-in replacement.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I018ef60648122aa672430bb62dc7b1a2e1cd5d7c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4648
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This change removes the call of spdk_bdev_get_by_name() from
raid_bdev_add_base_devices() by passing bdev name instead of bdev
pointer to raid_bdev_add_base_device().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1dc7bb6edbc23513f69e7acdf8ca735494338bfd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4592
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.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>
This is a drop-in replacement. Update unit test together, and the
idea of the update was from the unit test for zone bdev module.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia8d0644f42b9d0a0ad502eebbe3e414abd1de4cf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4591
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.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>
vbdev_crypto_claim() gets bdev name instead of bdev pointer
as a parameter, and open the corresponding base bdev first using
spdk_bdev_open_ext().
The purpose is to fix the race condition due to the time gap
between spdk_bdev_get_by_name() and spdk_bdev_open(). A bdev pointer
is valid only while the bdev is opened.
Resize event is not supported for now.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia0e1ce2ce696f431bb26af94729931c3ffb9a9d0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4588
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.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>
This patch removes legacy config support in error bdev module.
All options through the legacy config are already reflected in JSON.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I348c19f560057b46030aa03adcca073f0906de0a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4623
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This patch removes legacy config support in AIO module.
All options through the legacy config are already reflected in JSON.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I43655ab8d3ca787a7e92072b195f3b73fcf4fdbf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4620
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
By design the opts for each implementation
can not match spdk_sock_impl_opts.
During get_opts for specific implementation
only used fields are filled.
Yet iterating over all spdk_sock_impl_opts fields
would yeild garbage values for unset fields.
This is the case right now when doing save_config RPC
with uring enabled. A garbe value for enable_zerocopy_send
is returned.
sock.c:829:62: runtime error: load of value 165, which is not a valid value for type '_Bool'
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ie0512a7dffc36c8ff89256d08f8a2f4fefcf9e83
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4699
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>
There is no good reason to track every single I/O
to the module and especially not at INFO level behind
a log flag.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I16a772ae4d49d3c1963ca223ef0bc2068b405988
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4713
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>
This is a drop-in replacement of spdk_bdev_part_base_construct() by
spdk_bdev_part_base_construct_ext().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0c719683b5a9cd6dffce057552982d8e44871ab1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4580
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Use spdk_bdev_part_base_construct_ext() to pass bdev_name and
remove the spdk_bdev_get_by_name() call. Remove the created configuration
only if non-zero return code other than -ENODEV is returned.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ieb5ee5d7e1ccc984df1e84205be18c7b93799bba
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4579
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This patch removes the call of spdk_bdev_get_by_name() from
create_compress_bdev() by calling spdk_bdev_open_ext() and then passing
bdev descriptor to _prepare_for_load_init().
vbdev_init_reduce() returns the return code of spdk_bdev_open_ext()
directly if it is error to process the ENODEV case correctly.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie80ce4104ceaa5726db976e33cd35352d5c91703
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4571
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Previously bdev was closed after reduce initialization and was re-opened
before bdev claim.
This patch series will fix the race condition due to the fact that
bdev pointer is valid only while bdev is opened.
Hence keeping bdev open from reduce initialization to bdev claim
is better.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I00914db0aef8547c0826061bb0e500735b0b97a1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4567
Community-CI: Mellanox Build Bot
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
There is nothing left here, so remove it.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib947d42bc577dbebb4650b1be885e05a80f8f8cf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4541
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI
vbdev_delay_register() gets bdev name instead of bdev pointer as a
parameter, and open the corresponding base bdev first using
spdk_bdev_open_ext().
The purpose is to fix the race condition due to the time gap
between spdk_bdev_get_by_name() and spdk_bdev_open(). A bdev pointer
is valid only while the bdev is opened.
Resize event is not supported for now.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib9f43965bcf28f8ca0d16fd2c73219253805f254
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4565
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
vbdev_passthru_register() gets bdev name instead of bdev pointer
as a parameter, and open the corresponding base bdev first using
spdk_bdev_open_ext().
The purpose is to fix the race condition due to the time gap
between spdk_bdev_get_by_name() and spdk_bdev_open(). A bdev pointer
is valid only while the bdev is opened.
Resize event is not supported for now.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib8894cf857ef814f6721e4244237c8156f147426
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4564
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Mellanox Build Bot
Add an new API spdk_nvmf_subsystem_add_ns_ext() to pass not bdev but
bdev_name to fix the race condition due to the time gap between
spdk_bdev_get_by_name() and spdk_bdev_open(). A pointer to a bdev is
valid only while the bdev is opened.
spdk_bdev_open() has been replaced by spdk_bdev_open_ext() but the
issue still existed.
Update the corresponding unit tests accordingly.
Then replace the internal of spdk_nvmf_subsystem_add_ns() by
spdk_nvmf_subsystem_add_ns_ext() call.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifcaa2121129ef22d5e61c9a8f7c640ff37a64485
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4485
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This patch removes the string from register component.
Removed are all instances in libs or hardcoded in apps.
Starting with this patch literal passed to register,
serves as name for the flag.
All instances of SPDK_LOG_* were replaced with just *
in lowercase.
No actual name change for flags occur in this patch.
Affected are SPDK_LOG_REGISTER_COMPONENT() and
SPDK_*LOG() macros.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I002b232fde57ecf9c6777726b181fc0341f1bb17
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4495
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Mellanox Build Bot
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI
Couple log flags did not follow previous scheme of naming
so rename it.
This will simplify next patch that replaces all the literals
with names provided for the flags. Avoiding accidental
changes in log flag names.
SPDK_NOTIFY_RPC -> SPDK_LOG_NOTIFY_RPC
SPDK_LOG_CRYPTO -> SPDK_LOG_VBDEV_CRYPTO
SPDK_TRACE_VBDEV_OCF_VOLUME -> SPDK_LOG_VBDEV_OCF_VOLUME
SPDK_LOG_JSON -> SPDK_LOG_JSON_UTIL
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I00cb0a7994d8aaf28b03828b93b1dbb18215089f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4498
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This makes it more in line with other flags.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I2d2f720a6cf1a6aa0cf3ddc0691c7ffc0adc43fd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4538
Reviewed-by: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This clean up the code a little more. Use the term failover instead
of multipath in the error message.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6b7fb8fe50b19b5639169c03f5242b9d6f14128b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4390
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>
bdev_nvme_add_trid() is used once in the same file.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I738b7e959d13d419e090a019da6e7f1f09aa7109
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4388
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>
PCIe failover is not supported yet and it is not possible that the
controller is included in g_skipped_nvme_ctrlrs for failover cases.
We can consolidate the code to create failover path in bdev_nvme_create().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ide456707a0b66a4b26eaf66392b9b53c3e659d9e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4387
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>
This simpifies the code a little without any degradation.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6006266e250f2d083aa12424809d04fac6a9f8f0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4385
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>
_bdev_nvme_submit_request() already has a pointer to nvme_io_channel.
Passing nvme_io_channel simply to I/O APIs will be reasonable
simplification.
Two admin APIs, bdev_nvme_abort() and bdev_nvme_admin_passthru()
get the associated thread to the spdk_io_channel and set it to
nvme_bdev_io. These APIs get spdk_io_channal from nvme_io_channel using
the container_of macro. These APIs are not performance sensitive.
Using the contaier_of macro will be better than extracting the operation
from these APIs because we can keep the changes local to these APIs.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I67985075d70551e4fe3bb84dfee15f1e4e882451
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4384
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
When NVMe bdev module supports multipath, nvme_bdev will have multiple
nvme_bdev_ns, and I/O APIs need only nvme_bdev_ns. So change the parameter
from nvme_bdev to nvme_bdev_ns for I/O APIs.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1e71abbab856112fdd6a333a89ba5f02f4e63ccd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4382
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>
This is a preparation to pass nvme_bdev_ns instead of nvme_bdev
to I/O APIs.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I095478bc3ad305ba940fca101b74e74c7e8e74ba
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4381
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>