Commit Graph

626 Commits

Author SHA1 Message Date
Ben Walker
f20727afbb nvmf: Rename init_grp to host in config parsing
The code for parsing the configuration file still
referred to a host as an init_grp, so fix it.

Change-Id: Ifa250b09de495dd7d393ccc3557fd6d56a54e790
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-14 10:35:22 -07:00
Ben Walker
32a70c1ffc nvmf: Remove subsystem groups
This never really made sense, so replace it with a list of
subsystems.

Change-Id: Ie7a9400083c091ac7142d01c23948200f515bdf7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-14 10:35:21 -07:00
Ben Walker
cf199a3f0f nvmf: Move map from subsystem group to subsystem
Change-Id: I8961f0a3f93a2c088819d207bf70c64147a68533
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-14 10:34:04 -07:00
Ben Walker
b531f5914e nvmf: Remove NodeBase. Each Subsystem now defines its own NQN
This is just extra complication for no real benefit.

Change-Id: I528af98e799d0641e753390fe35ff561fa3d7d76
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-14 10:34:04 -07:00
Dave Jiang
175b12e813 nvme: detect all uio drivers instead of just uio_pci_generic
This allows the custom UIO hotplug driver to be used as well as the
uio_pci_generic driver.

Change-Id: Ica3316ed716827ad305eb4a146d0864d61ff190f
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
2016-07-13 10:34:47 -07:00
Ben Walker
35b3091eba event: Add a lib to configure with rpc
Linking this new library allows applications using
the framework to be killed via an RPC call.

This only works if the RPC subsystem is loaded.

Change-Id: Ifcf91c212add620fe410589eba5490337c635776
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-13 10:13:49 -07:00
Ben Walker
44d131105e log: Add a lib for integrating the log lib with event framework.
Linking this library into an application makes the log
configurable via RPC. This only works if the rpc subsystem
is also loaded.

Change-Id: If1340cf2a845ef159290232c26f341150c98fb9a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-13 10:13:48 -07:00
Ben Walker
548ab005af nvmf: Remove duplicated nqn from subsystem group
The nqn is in the subsystem.

Change-Id: I101dc45b7958d1e9148a09e85604a90936498d8c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-13 09:57:53 -07:00
GangCao
cd393178ca nvmf: replace the LU string with Subsystem string
Change-Id: Ib4f99a680c4b6994ad7744a3e81ce9b5ff1e4a8b
Signed-off-by: GangCao <gang.cao@intel.com>
2016-07-13 09:30:27 -07:00
Daniel Verkamp
cd066abb54 gitignore: ignore .kdev4 (KDevelop) files
Change-Id: Ie493371f53b009b44c4c7fbab24e2a52b8a9c837
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-12 09:08:01 -07:00
Daniel Verkamp
5da444122e nvmf: remove arbitrary 4 RDMA device limit
Use the number of devices returned by ibv_get_device_list() instead of
stopping at 4.

While we're here, drop the unused MAX_SESSIONS_PER_DEVICE definition
too.

Change-Id: I21ca6c6c95b7f2cccc1de4d0a34b95217a522bfc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 17:20:26 -07:00
Daniel Verkamp
82ea261126 nvmf: move nvmf_complete_cmd to request.c
This is the only file that calls it, so it can be static.

Change-Id: I47573b7b38b40ad37e758234245eedbe94ae0a12
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 17:13:53 -07:00
Daniel Verkamp
f6d8e3d421 nvmf: drop nvmf_initialize() and nvmf_shutdown()
These were internal-only APIs; initialize just checks to see that the
pool was initialized (which is already checked internally), and shutdown
just called spdk_nvmf_shutdown_nvme(), which we can call directly.

Change-Id: I95e1b912d61a38fa9934f58df7b1512678303452
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 17:09:49 -07:00
Daniel Verkamp
6dfbcfa883 nvmf: mark debug string array as static
It is not used outside rdma.c.

Change-Id: Ic32aff4e07d6a430688e76b2dd223d5a5a61964e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 17:00:51 -07:00
Daniel Verkamp
411df9ad9b nvmf: make request_release and free_req private
These can be isolated in rdma.c rather than being part of the generic
transport API.

Change-Id: Idc2b969a2f7685420cda2f7c4aa12495ffc3fcbc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 16:58:17 -07:00
Daniel Verkamp
353533e229 nvmf: drop pool size macros
Just calculate the required number of requests once and store it in a
global variable.

Change-Id: Iffeb637a3ac5f69ec89989b84f03699bac483b6e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 16:25:05 -07:00
Daniel Verkamp
6d49820adc nvmf: remove MaxSessionsPerSubsystem config option
There can be only one session per subsystem.

Change-Id: I8ba85a5ebd11dd71fda2a4bafa97a0935609379f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 15:52:02 -07:00
Daniel Verkamp
6e415c4411 nvmf: drop global nvme_request_pool
It is just a duplicate of the NVMe library request_mempool.

Change-Id: I2a5484e5d515b965503b2cfcd8d85ccfcb0dee05
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 15:33:55 -07:00
Daniel Verkamp
dcc055e31f nvmf: move RDMA internal structs into rdma.c
Clean up everything that isn't strictly necessary in rdma.h.

Change-Id: Ied9acbed5f5b64860eae39816cdcb74620009a79
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 15:24:49 -07:00
Daniel Verkamp
1ade6e1dc0 nvmf: nest NVMf conn inside RDMA conn
This essentially turns the current nesting (of RDMA conn inside NVMf
conn) inside out.  Now the transport owns the connection structure and
allocates it when necessary.

Change-Id: Ib5ca84e2a57b16741d84943a5b858e9c3297d44b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 15:03:26 -07:00
Daniel Verkamp
f542245706 nvmf: move conn allocation to transport layer
This sets up the RDMA layer to be able to embed the NVMf conn inside the
RDMA conn.

Change-Id: I5e3714ac8503826504d78d06fb5eaafabd025bb8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 15:02:34 -07:00
Daniel Verkamp
fdc1278440 nvmf: simplify session and connection cleanup
The whole cleanup process is now started by
spdk_shutdown_nvmf_subsystems().  Each subsystem will clean up its
session, if any, and each session will clean up its connections.

Change-Id: I9915d4547751ed4ffc4baa2c45c628698dd0b881
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 15:01:34 -07:00
Daniel Verkamp
9903050dc1 nvmf: remove unused session tailq entry
Change-Id: Iaa8f9281fd448f0f48752aa4ae147756f3462406
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 13:04:12 -07:00
Daniel Verkamp
58f62ad5b1 nvmf: remove unused g_num_connections array
The per-lcore connection counter was incremented and decremented, but it
is no longer actually read.  The lcore allocation should happen at the
session level instead.

Change-Id: I7bdf1b521bfda4892304338d43fad3ed5123c494
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 12:51:20 -07:00
Daniel Verkamp
2eff92ab88 nvmf: drop connection shm and use calloc() instead
Nothing actually maps the shared memory region, so there is no need to
allocate the array of connections that way.

Change-Id: I3d5eca748f892e37fbb0ec52942f1c510e9f9dc8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 12:50:21 -07:00
Ben Walker
1fc4a182bd nvmf: Subsystem now has a pointer to the session
There is only one controller per subsystem, so therefore
there can be 0 or 1 sessions. Change the list of sessions
to a pointer that can be NULL if no session exists.

Change-Id: I2c0d042d9cecacae93da3e806093faf0155ddd6e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 11:20:19 -07:00
Ben Walker
40b0248602 nvmf: Remove cntlid from session
Subsystems only have one controller, so cntlid
is always 0.

Change-Id: I690a1793ad3a696adbaefca856e559dd0177b11a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 11:20:19 -07:00
Ben Walker
a35de42e5d nvmf: Remove max io queue tracking from session
This was intended to track the number of NVMe device
queues per session, but there is only one hardware
queue per session. It was conflated with the number
of RDMA queues in several places as well.

Change-Id: I74a1c56a5d395dea8bee4778882821e904cebcf9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 11:20:19 -07:00
Ben Walker
a644cacb56 nvmf: Remove is_valid from session
Unused.

Change-Id: I992d4cea9b03f6dfe923f4d5ebc4c467d4ab01e5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 11:20:18 -07:00
Ben Walker
d028fb6956 nvmf: Eliminate two stage initialization of sessions
Everything can be done when the session is created.

Change-Id: I7cb38c093b2b1b69460cabba465828eed0cec432
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 11:20:18 -07:00
Ben Walker
49441a5835 nvmf: Don't set reserved fields in vcprop
Change-Id: Iab46cf7d34938d8b07c5480f778eedd1ba455d57
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 11:20:18 -07:00
Ben Walker
011c0a24df nvmf: Remove cntlid from spdk_nvmf_conn
The cntlid is inside the session, so no need for
duplicate data.

Change-Id: I5669ee6393807959506dfec36a7583af77386fc4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 11:20:18 -07:00
Ben Walker
a9c7af9d83 nvmf: Simplify conn lcore allocation
Since we only allocate workers to the master lcore,
remove the logic that places I/O conns on the same
lcore as the admin conn.

The "right" logic would be to place the I/O conn
on the same lcore as the whole session, and this
patch builds toward that.

Change-Id: I8983b56de41062ec834b0a169ba0fa61326c466d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 11:20:18 -07:00
Ben Walker
72a7fd3cff nvmf: Only run on the master lcore.
Temporarily, only run on the master lcore. This makes
some temporary refactoring possible that is required
to move to a truly scalable threading model.

Change-Id: I13a2e03107a27f8ec18b023b15f653d374a137b5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 11:20:18 -07:00
Ben Walker
9113e6a949 nvmf: Sync before unloading the NVMf initiator
This is a bit heavy handed, but really make sure all
activity has ceased.

Change-Id: Iaa1ce16fd9e059f9eaec6712226344d69075b243
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 11:19:54 -07:00
Ben Walker
828dca7351 nvmf: Move some stray session init code to the right place
A connection function was initializing some session data, so
move that code to the function that initializes the session.

Change-Id: I5f2d4349585cb97985a7bbd9fb8d6c66eeaa7d4e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 09:41:48 -07:00
Ben Walker
64f6abea9c nvmf: Sessions now contain a list of connections.
There was an extra layer of indirection complicating
things for no reason. This removes it.

Change-Id: I8d4e654eb17f8f6ec028d775329794f0745fb0f7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 09:41:48 -07:00
Changpeng Liu
2cb8321a35 nvmf: make admin queue has the same size of bounce buffer as IO queues
The NVMf target set the maximum data transfer size(MDTS) to the default value
of 128KB now, and the initiator driver will read the value and set it to the
block layer, so each command sent from initiator will not runoff 128KB.

Change-Id: I1d4f259e887b2fc70c7f1c5406c07c58f7fc9b8d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-07-11 09:13:38 -07:00
Daniel Verkamp
c9090beffe test/nvmf: remove redundant process_core calls
This is handled by autotest.sh already.

Change-Id: I2210df16fc10f36507c469318b278d6f5568e48f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Daniel Verkamp
b6af6bc6c1 test/nvmf: leave modules alone if already loaded
There's no benefit of reloading the NIC drivers (unless the drivers
themselves are buggy), so save some time by skipping the rmmod of
drivers we are about to load.

Change-Id: I05c3fd06042a2e06333d0cac123d24e6cce65b23
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Daniel Verkamp
176856c92b test/nvmf: don't try to unload nvme module
Only nvme-rdma should be loaded as part of the NVMf testing.

Change-Id: I232363bf0988ea9bd99a37df27c39cc8e9732ad5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Daniel Verkamp
18ab3da5ad test/nvmf: clean up filesystem test
Inline function that is only called once.

Fix == bashism.

Create the filesystems on the partition created by parted rather than on
the raw namespace block device.

Add 'sync' invocations to make sure data gets flushed to the block
device we are testing.

Drop the copy-pasted FIO cleanup code (filesystem test does not run
FIO).

Change-Id: Id47d68db208a618841291c4184824031476268f1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Daniel Verkamp
de81deda06 test/nvmf: disable tracelogs for filesystem test
Change-Id: Ia29ae2504afa28dbea6c2800ca3777cdcbde4dc3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Daniel Verkamp
c4bb610d93 test/nvmf: only run RDMA NIC setup once
Change-Id: I69607670de95652f997712ad3e7441718c97e3ab
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Daniel Verkamp
e6a5bb1067 test/nvmf: make sure non-zero returns fail tests
Add 'set -e' to all nvmf test scripts.

Change-Id: I8271268a4b82335adf07719f4bde13e9086b5a77
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Ben Walker
11b0c3cc51 nvmf: Standardize rdma init/fini functions
Change-Id: Ifa453e865e110cd534d34aae1bc036cc9f09b1bd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 09:06:30 -07:00
Daniel Verkamp
5ca81749de nvmf: return error if wc status indicates error
If any completion indicates an error, we need to close the connection.

Change-Id: I50b30aa692ae121932f1baec32f713422ff415ed
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-08 10:55:00 -07:00
Daniel Verkamp
f8296a99c2 nvmf: rename subsystem_grp.[ch] to subsystem.[ch]
NVMf does not have the concept of subsystem groups; the (former)
subsystem_grp files really contain structures and functions related to
individual subsystems.

Change-Id: I4b3a64de799fffb29f8685ea4908d754516815cd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-08 10:54:10 -07:00
Ben Walker
68eb363be7 perf: Write a pattern instead of 0.
Writing 0's hits SSD firmware special cases and gives
unrealistically high performance numbers.

Change-Id: I73c72ee52494075e354dcddd067e3ce49c156204
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-08 08:49:47 -07:00
Ben Walker
c65e726acd nvme: Limit max completions in a single poll
For a single poll of the completion queue, if the user
submits I/O from within their completion callback and their
completion callback is particularly slow to execute, the loop
could potentially continue forever. To support this, we
need to limit the number of completions we'll process
in one batch.

Change-Id: If6bae47e52b36347dbe5622ace68c866ee88a0b2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-07 17:05:17 -07:00