Commit Graph

589 Commits

Author SHA1 Message Date
Ben Walker
95ac75aabe nvmf: Add synchronization primitives for subsystems
This allows the user to pause a subsystem, make some
modifications, and then resume it.

Change-Id: Ia18371023d8fc66e1797fda293a01b68c0a61c96
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/392422
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-03 11:58:11 -05:00
Ben Walker
1545c8eb5e nvmf: Fix bug when resizing sgroups array
Change-Id: I366b941a60d1fb00951591e7f631a65e8a449904
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/392566
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-20 21:38:25 -05:00
Ben Walker
fd0770fecb nvmf: Delete subsystems when target is destroyed
Change-Id: I102954505c2c53458aae30f6d15b46e008355501
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/392565
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-20 21:38:25 -05:00
Philipp Skadorov
6d98264552 nvmf/rdma: decrement r/w counter if ibv_post_send fails
The outstanding r/w requests counter is not decremented
back if IB r/w request fails.

As the result, the rdma qpair stops pumping the requests
after the number of ibv_post_send failures reaches
the threshold for outstanding r/w requests for that qpair.

The patch decrements qpair's r/w counter back in case of
ibv_post_send returns an error.

Change-Id: I8fa0f2905974a50037034962e4d2a001290a06a9
Signed-off-by: Philipp Skadorov <philipp.skadorov@wdc.com>
Reviewed-on: https://review.gerrithub.io/391799
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-15 16:42:51 -05:00
Ben Walker
2a0772e3b8 nvmf/rdma: Create one cq per thread instead of per connection
This greatly increases the efficiency when the target is scaled
to many connections. Now all connections being handled by a given
thread can be polled in O(1), whereas before it was O(n) where
n was the number of connections.

Change-Id: I9f695f68093d73e6538df416b0f1aabef07119ff
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/391491
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-15 16:26:33 -05:00
Cunyin Chang
bdcb0d709a nvmf: add support of hotplug for nvmf.
Change-Id: Iebd5b75e3525e77bf256f5b7f52aa2504d7a68c3
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/390549
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-15 16:14:02 -05:00
Cunyin Chang
7f5864be20 nvmf: Add public interface of remove ns from subsystem.
Change-Id: I9c2746dd54a13f3dae0ac2bab1d5fced931e8591
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/391699
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-15 16:14:02 -05:00
Cunyin Chang
0b99cd6f1e nvmf: remove the data structure spdk_nvmf_subsystem_add_ns_ctx.
Add pointer of subsystem in namespace data structure, then we can remove
the spdk_nvmf_subsystem_add_ns_ctx.

Change-Id: I2d024f10d35fdac64fc34d0cb6523cfca74a8164
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/391697
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-15 12:22:20 -05:00
Ben Walker
5165aee686 channel: Make spdk_for_each_channel support async operations
While iterating, allow the user to perform asynchronous
operations. To continue iteration, the user is expected
to call spdk_for_each_channel_continue.

Change-Id: Ifd7d03d5fbf17cf13843704274b036d49ca0484a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/391309
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-12-14 12:05:07 -05:00
Ben Walker
33376dd136 nvmf: Add subsystem iterators
Add functions to iterate the list of subsystems for a given
target.

Change-Id: Id3831f656033092224168b353788ae87238bf800
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388294
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-12 15:01:17 -05:00
Ben Walker
8b79ef3372 nvmf: Remove poll group from controller
Now rely entirely on the user to create and poll
the poll groups.

Change-Id: I66baaa2d0f493390a055a32e6c902f5e2f574534
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/385954
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-12 15:01:17 -05:00
Cunyin Chang
fcccf16767 nvmf: close all the bdevs when delete subsystems.
Change-Id: Ie3c7c8d960b0074b86e983e0e8bf04de2d99f61f
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/390365
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-08 17:14:40 -05:00
Daniel Verkamp
bedc405f35 nvmf: add duplicate QID check in I/O Connect
Disallow multiple I/O queues for the same controller with the same queue
ID.  NVMe-oF 1.0 ECN 001 specifies that this condition should return a
status value of Command Sequence Error.

Change-Id: I41126ddec388a985c403025e099ab15da5d3987c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390662
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-08 14:08:19 -05:00
Daniel Verkamp
ea1c15791f log: rename SPDK_TRACE_* to SPDK_LOG_*
Disambiguate the log components from the trace functionality
(include/spdk/trace.h).

The internal spdk_trace_flag structure and related functions will be
renamed in a later commit - this is just a find and replace on
SPDK_TRACE_* and SPDK_LOG_REGISTER_TRACE_FLAG().

Change-Id: I617bd5a9fbe35ffb44ae6020b292658c094a0ad6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376421
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-07 12:23:19 -05:00
Ben Walker
ba3d96e855 nvmf: Reject RDMA connections with correct error codes
Change-Id: I8b77f8aa8e20a277d0a5e53688d7cef8674d6244
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/390497
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-06 17:54:10 -05:00
Ben Walker
ee691fef8b nvmf: Refactor spdk_nvmf_rdma_qpair_create
Move some of the code out of the function and rename it
to spdk_nvmf_rdma_qpair_initialize. In the future, the
operations left in initialize will end up being
deferred until the qpair is assigned to a poll group.
However, for this patch there is no functional change.

Change-Id: I0f64489ffbf1f8957358d3b1781acc430b77717c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389650
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-06 17:54:10 -05:00
Ben Walker
55a624ed09 nvmf: Rename variables from rdma_qpair to rqpair
Some places used the convention 'rqpair' and others
'rdma_qpair'. For consistency, name them all 'rqpair'.

Change-Id: I131833d14efdfdbcbb99bea5d64cbcf99d9ec90b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389649
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-04 16:02:16 -05:00
Ben Walker
e26e0e2689 nvmf: Look up bdev channel from poll group instead of namespace
Change-Id: I9afa07b5dae99955ba87d7c8130b2ce6f04e7941
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389641
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-04 16:02:16 -05:00
Ben Walker
d0733ff3b7 nvmf: qpairs now point to their poll group instead of thread
There is a 1:1 correspondence between the two, but it is much
more useful to have a pointer to the poll group.

Change-Id: I8494b0573a9b2cce5819545548d0c65a18bdbe86
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389640
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-04 16:02:16 -05:00
Ben Walker
d5268e6c25 nvmf: Move spdk_nvmf_poll_group_[add|remove] to public API
These aren't used quite yet, but they'll need to be called
by the user's application.

Change-Id: Id1fc44859350451a3e224f725add60d3a878d077
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389639
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-04 16:02:16 -05:00
Ben Walker
c3080c5aa6 nvmf: Update poll group channel maps when a new namespace is added.
There isn't a way to remove a namespace just yet, but at least
adding one works.

Change-Id: I99416d1bc9cbc0e2303c16040d2311a07829cbea
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388293
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-04 16:02:16 -05:00
Ben Walker
ad876c00d3 nvmf: Add a channel map to the poll group
As of this patch, it is unused.

Change-Id: I15f42b8cc43e3792ae69c91f3911b7853d5b5664
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388292
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-01 16:41:57 -05:00
Ben Walker
3580546bd1 nvmf: Implement the poll group as an io_channel
It has all the same properties of uniqueness, so
implement it as an io_channel to take advantage
of the other infrastructure for message passing
already available.

Change-Id: I1777b91f0597a5a43ac0d0bbfdf878e874eb04f3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388291
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-01 16:41:57 -05:00
Ben Walker
7b57e9f973 nvmf: Stop subsystems from the thread they were started on
This correctly puts all of the I/O channels on the right
thread during shutdown.

Change-Id: I432c8cb981a68b40639f8876dae42597a9e6a85f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389637
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-01 16:41:57 -05:00
Changpeng Liu
415a1485cf nvmf: align the data buffers for AIO backend
Currently SPDK NVMeoF will allocate data buffer from mempool, however,
some data buffers may not block size aligned, this is okay for NVMe
backend but will fail for AIO backend. 4KiB aligned data buffers
should be okay for most AIO backends.

Change-Id: If7b9c2962d716addbd755e80e59620377f2ba488
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/389245
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-30 00:01:33 -05:00
Tomasz Zawadzki
161a300275 VPP: change sockets from FIONBIO to O_NONBLOCK type
There are two ways to set stockets to nonblocking type:
- ioctl with FIONBIO
- fcntl with O_NONBLOCK
Those two should be equivalent for sockets used in SPDK.

During testing it was shown that VPP interprets only
the second type, so this patch changes all occurences of it.

When here, more descriptive error logs were set in case of
failure.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ifa5b30e3a4fa04fe23f41fa2ae9dab4b01dd7d3c
Reviewed-on: https://review.gerrithub.io/388816
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-29 11:23:32 -05:00
Ben Walker
eaaddf3d48 nvmf: Poll groups now automatically register pollers
This simplifies the public API and requirements for
user applications.

Change-Id: Ibb0d25a7838a0fa683f39e79cb4fef78adf6aee8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388040
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-28 15:29:35 -05:00
Cunyin Chang
07a521db1c nvmf: remove ununsed tail entry.
Change-Id: I4587d7bcea1f5eabfaacb489db24942d7b45a22c
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/388716
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-27 18:44:09 -05:00
Cunyin Chang
5de74d085d nvmf: Fix the bug when destroy rdma queue pair.
We probably do not allocate the mgmt_channel when we destroy the
rdma queue pair, add the judgment before put the io channnel.

Change-Id: I528c9686907c04c5025ff9d3872f24f2996e9d33
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/388159
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-20 16:48:15 -05:00
Ben Walker
ea134c5cbf nvmf: Store subsystems in array instead of a list
This helps enforce uniqueness of the subsystem id and
allows for quick lookup by that id.

Change-Id: I4d2948892839d42b8c2b2a406682848415ad2bd6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/376251
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-15 17:54:13 -05:00
Daniel Verkamp
7ea544b46a nvmf: move poll groups to public API
The end goal is to have the application create one poll group per core.
Then each poll group will have a single CQ per network device and an I/O
channel per back-end storage device to poll.

This is just the first step toward that, which is to wire up the
creation of the per-core poll groups in the application.

Note that the app poll groups don't do anything yet.  We'll need
additional library API changes to make the library use the existing poll
groups, rather than creating a new poll group per subsystem as we do
right now.

Change-Id: I2d4e2a5e5aa354d37714750f1d5b1d1e4ab9edce
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/381887
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-09 12:51:18 -05:00
Ziye Yang
5b707a6e87 nvmf/rdma: Solve the qpair thread and channel issue.
According to the current code, rdma qpair is always created
by the thread on acceptor_core, thus we need to
change the related I/O channel during polling if the core
configured for subsystem is not same with the acceptor core.\

With this patch, we can run NVMe-oF tgt with multiple cores,
and each subsystem can configure different core to handle.

Change-Id: I6163a871f65115e545a4f3fd9cc46b3bafb13249
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/383683
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-09 12:39:31 -05:00
Ziye Yang
c1b68ce131 nvmf/rdma: remove this include since it is not used
Change-Id: Ibdfa8be770d7bfcb2baaf29fa5b32dea064ffbd0
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/383383
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-03 20:20:25 -04:00
Ziye Yang
43727fb7e5 nvmf/rdma: Add the buffer size check for data_buf_pool
Change-Id: I65e84971f2d55f27b0c0c1a1b226fc4da4b3cf89
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/382763
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-01 15:45:35 -04:00
Seth Howell
8bfcbf0c8a rdma: in qpair_destroy, free recvs struct array
Fixing a memory leak.

Change-Id: I410986bb9d73818b0dd141a24a28a81a37bd8937
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/384109
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-27 13:06:21 -04:00
Ziye Yang
6f95c32590 lib/nvmf: Create a shared buffer waiting list
Our previous implementation makes the buffer allocation
in an unfair way and this patch can solve this issue.

With this patch, we can use limited buffer to support
high I/O depth.

Change-Id: I0e7a073c0b4539090218aa461d50620287bb4b63
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/382528
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-18 12:50:51 -04:00
Ziye Yang
847c1c3ad4 nvmf/rdma: Remove rdmq_req if there is error or obtaining buf.
For the normal case, we can avoid re-adding it into
pending data buf list if there is no buffer.

Change-Id: I400e3c6c60bb1d1df13782faf2dd32ca2bd897a3
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/382402
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-13 15:13:31 -04:00
Daniel Verkamp
d2582f88ab nvmf: simplify spdk_nvmf_request_exec()
A few small tweaks to make this function easier to read:
- Return void (the return value is always 0 and never used)
- Split out Fabrics/admin queue processing 'if' block
- Remove unnecessary switch on status (it can only be 2 values)

Additionally, simplify the I/O command checking logic: we don't need to
check for CC.EN = 1, because it is only possible for I/O queues to be
created after CC.EN is set to 1.

Change-Id: Ib4c39a6e0d9e28912dbb0f0737fd223be0a80207
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/379218
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-29 13:03:24 -04:00
Daniel Verkamp
8011d8c0e6 nvmf: don't allow 0xFFFFFFFF as a NSID
FFFFFFFFh is reserved for the broadcast NSID and can't be used as a
NSID for a specific namespace.

Change-Id: I64a3cc80993d7b34324823462f4d992d1415773f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/378849
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-09-19 17:16:59 -04:00
Daniel Verkamp
5323a02613 nvmf: move fabrics command processing to ctrlr.c
This is the final set of command processing functions (admin and I/O
commands were already handled in ctrlr.c), and it allows us to clean up
the ctrlr.c API some more.

Change-Id: Ic73c56c44d7fd64bfaa72b6f5f6f0984b4dfa053
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/378018
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-19 17:14:52 -04:00
Daniel Verkamp
4ff0eba871 nvmf: merge connect handling into single function
Combine nvmf_process_connect() into spdk_nvmf_ctrlr_connect() to
simplify the logic and keep it all together in one function.

This also allows us to move the invalid connect helper function and
macros back out of the header into a static function in one file.

Change-Id: Ia3bd80d0309392520d51bf8f5830d3f23332c5e3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/378016
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-19 17:14:52 -04:00
Daniel Verkamp
6b8096d815 nvmf: remove subsystem IDs
These are not used in the current code.

We introduced the concept of a subsystem ID to prepare for a future
scaling strategy, but the poll group scaling strategy turns out to
not need subsystem IDs.

Change-Id: Ibd27cc0d446c7cda34db76787e1e9c233c399f44
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/378015
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-19 17:14:52 -04:00
Daniel Verkamp
f4a4ddd8a1 nvmf: add subsystem ctrlr management functions
This moves the subsystem->ctrlrs list management fully into the
subsystem code, which will help simplify thread safety considerations
once we start adding locks.

Change-Id: Ibc118923f1bd520f1e524cde5d45ccfcc69aee1e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376025
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-19 17:14:52 -04:00
Ben Walker
21ea290192 nvmf: cntlid is now only unique within a subsystem
Previously we made cntlid globally unique as part of
a strategy for scaling connections that never panned
out. Now, we have a new strategy and don't need cntlid
to be globally unique, so relax the restrictions
and simplify the code.

Change-Id: I167772f5e7d37183715bf9967b0102529144bb2b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/376250
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-19 17:14:52 -04:00
Daniel Verkamp
b0a80710ec nvmf: don't generate cntlids in reserved range
The NVMe-oF 1.0 spec says:

"The NVM subsystem shall not allocate a Controller ID in the range FFF0h
to FFFFh as a valid Controller ID"

Change-Id: If0b7dc4948e40b3bdf370a1da97199a25d362e71
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376247
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
2017-09-19 17:14:52 -04:00
Daniel Verkamp
65cac5fbe0 nvmf: store transport in listener structure
Avoid having to look up transports during discovery later.

Change-Id: I0207a822f05b02de4798d3e966603c073ea14062
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/377991
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-19 17:14:52 -04:00
Daniel Verkamp
0caab4e1da nvmf: add Write Zeroes support
Change-Id: I743f5e4d1c24ad5ef9f1fef4c2678e347b179a9f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/377260
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-14 17:41:52 -04:00
Daniel Verkamp
5eb129647d nvmf/bdev: refactor read/write into separate funcs
This makes it easier to unit test the individual functions and also
easier to follow the logic.

These helpers will also be used in the upcoming Write Zeroes function.

Also cleans up the variable names to be consistent with the rest of the
code.

Change-Id: I69847b6a052fb7baff058ed8e5b79904ddf2ec6d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/377259
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-14 17:41:52 -04:00
Ben Walker
496ba0d273 nvmf: Temporarily remove hot plug support
The current hot plug support assumes only one thread
can access a subsystem at a time, but now that we're
changing that this will need to be reworked. In the
interest of making it easier to change the threading
model, remove hot plug support temporarily. We'll add
it back in once the threading model changes are done.

Change-Id: I15b75b402b85aa62f5ba864a64cde1de3cdb4ba3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/376417
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-13 12:54:49 -04:00
GangCao
03305949f9 nvmf: only pass the msg to initialized thread
Change-Id: I73cf34e0184f67a855afe980f5645df25baf4714
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/377652
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-08 17:13:36 -04:00