Commit Graph

39 Commits

Author SHA1 Message Date
Daniel Verkamp
c53c5c6a9b nvmf: stub out CC.EN reset path
It is not implemented yet, but add a message to remind us to write it
later.

Change-Id: Ic1c35a0d35f728bc63b38c334d9c622493bee967
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 09:20:20 -07:00
Daniel Verkamp
b9a67e983a nvmf: remove nvmf_property_set() shutdown flag
Property Set of CC.SHN is not supposed to terminate the session - remove
the commented-out code that was attempting to do this.

Change-Id: I1db230df9be549764287a8fd45ccdebea1d22a8b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 09:20:20 -07:00
Daniel Verkamp
8a2395d0e6 nvmf: update CSTS when host writes CC.SHN
Set CSTS.SHST = 10b to indicate that shutdown is complete, and
CSTS.RDY = 0 to match the state of CC.EN.

Change-Id: Ia651c34427526a38f22cba3910df2cf7d4bedd92
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 09:20:20 -07:00
Daniel Verkamp
543b6d0932 nvmf: remove definitions that duplicate NVMe
These NVMf spec structure definitions are the same as the equivalent
NVMe structs.

Change-Id: I21c45973b7843e3767c48f97ec42e7b446df296f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 16:34:48 -07:00
Daniel Verkamp
70601d5e0e nvmf: add Doxygen comments to discovery log page
Also add the missing ASQSZ field.

Change-Id: I67e67a6b4076de226d30882aa40afd78bc8be2af
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 16:34:46 -07:00
Ben Walker
677a2dc5d7 nvmf: Merge conn.[ch] into session.[ch]
There was only one function and a structure declaration
left.

Change-Id: I63277b4182120e7a76a925ed0bf7378ec7c23f20
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-15 14:45:26 -07:00
Ben Walker
2b9d85c448 nvmf: Remove host.[ch] and port.[ch]
These can be simplified and merged into the subsystem.

Remove the concept of mappings from subsystems and replace
it with a list of hosts and ports. The host is optional -
not specifying a host means any host can connect.

Change-Id: Ib3786acb40a34b7e10935af55f4b6756d40cc906
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-15 14:35:24 -07:00
Daniel Verkamp
21c450e187 nvmf: add transport function pointer table
Make the core NVMf to transport interface generic and allow for multiple
transport types to be registered.

Change-Id: I0a2767a47d55999c45f788ae1318bb50af60ab4e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 13:11:03 -07:00
Ben Walker
d6a499fec2 nvmf: Move poller from connection to subsystem
Change-Id: Iea6be8156152367c0fd48b8cee8e2ca1e67f340a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-15 12:22:53 -07:00
Changpeng Liu
3c96acb4f4 nvmf: fix double free of session structure when exit the NVMf process
Change-Id: Iea34ca82898e58633c6f7edd2ab8ff04f5484220
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-07-15 10:15:03 -07:00
Daniel Verkamp
49e0054f18 nvmf: clean up redundant function name in TRACELOG
Change-Id: I87a01e0fe8c1437c084757e66377ac50ca83a0c2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-14 13:32:33 -07:00
Daniel Verkamp
c3ed14d3a0 nvmf: refactor Connect command handling
Set a status code in the response capsule for each possible error case.

Also enforce CC.EN == 1 before I/O connect.
The NVMf spec requires that the controller is enabled before any I/O
queue Connect commands are allowed.

Change-Id: If56d6b4d6bedad00e9e845e77f05f715e3969f8b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-14 12:58:17 -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
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
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
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
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
Daniel Verkamp
554701492c nvmf: simplify property handling
Create a list of valid properties with get and set callbacks (set is
optional to allow read-only fields).

Remove handling for fields declared as "reserved" in the NVMe over
Fabrics 1.0 specification.

Also simplify the vcprop structure to only contain the required fields.

Change-Id: I14d3ddfd008c62b75fce8e64d193c87fb6f7b5ad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-07 15:52:49 -07:00
Daniel Verkamp
a9df326a0e nvmf: only allow one Controller per Subsystem
Multiple NVMe controllers within a subsystem does not work correctly,
since we would need to virtualize the controller data, namespace IDs,
and so on.  For now, only allow pass-through mapping of a single NVMe
controller per subsystem.

Change-Id: Ib2d3576d2856c46a086f38eb6bec56f3e7a73575
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-07 15:09:30 -07:00
Daniel Verkamp
0e93df5c34 nvme: combine CAP register into one 64-bit union
Previously, we used cap_lo and cap_hi to represent the 32-bit halves of
the full CAP register.  However, it is simpler to keep them in a single
64-bit structure, and is no less efficient on 64-bit platforms.

Also name the NSSRS field from NVMe 1.2, which was previously reserved.

Change-Id: I1d5d9b0dccbb12373b4aed3db29c883881d43223
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-07 13:52:16 -07:00
Changpeng Liu
4fbe54f10e nvmf: add discovery subsystem to NVMf target
Change-Id: I4ee79ad268ae75208feddd62e22d6210a9c0d944
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-06-30 16:20:09 -07:00
Ziye Yang
88669436f9 nvmf: remove unnecessary nvmf.h
The function call of spdk_nvmf_check_pools can be
directly put in nvmf.c.

Reason: This pool is created by nvmf subsystem,
it should be recycled by this subsystem.

Change-Id: I49e49bcb56079fc25d26b1f5078a1808c2f8e189
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-06-28 12:45:33 -07:00
Daniel Verkamp
20f9d86541 nvmf: clean up tracelogs
Change-Id: I57993bde54502a6e65a5379438ce1f7fb7ddffc6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-28 09:32:52 -07:00
Daniel Verkamp
cef7ad58ec nvmf: remove unused nvmf_session::vcfeat field
Change-Id: Icebadbf3d49c957f7ae908627b69e5b0773cc6a5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 13:01:39 -07:00
Daniel Verkamp
2a3e39a154 nvmf: add spdk_ prefix to struct nvmf_request
Also finish up the req_state -> req conversion.

Change-Id: I131dd52dcd36a790b942e06f0207a3274cc04ffc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 10:24:00 -07:00
Ben Walker
63da8147ed nvmf: Remove nvmf_*_cmd.c files
They each only had 1 function left that belonged
in the session.c file.

Change-Id: I405902b02e9316d2dc02d3732d8bc085c2b84d31
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 11:31:18 -07:00
Ben Walker
6b10df3576 nvme: Update nvme_spec.h to 1.2.1
This moves some definitions from nvmf_spec.h to
nvme_spec.h based on the latest publication.

Change-Id: I51b0abd16f7d034696239894aea5089f8ac70c40
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 09:18:14 -07:00
Daniel Verkamp
81d9213894 nvmf: use nvmf_request instead of rx_desc in trace
The nvmf_request object is generic and is mapped 1:1 with rx_desc.

Change-Id: I397224a3859c3c93d6eca99f7ba7c53ce7963f57
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-23 14:36:30 -07:00
Daniel Verkamp
1d3ee6c5f1 nvmf: remove nvmf_request cb_fn field
It is always set to nvmf_process_async_completion and is only used
within the library.

Also rename nvmf_process_async_completion to spdk_nvmf_request_complete
to clarify its purpose.

Change-Id: Ie737fb60688329bfe329a8553c4a40ff2e5f8f1d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-23 11:12:19 -07:00
Ziye Yang
450bb7605b nvmf: replace all malloc with calloc in nvmf library
Change-Id: Ibf6719996ef683d8efc82068b2294ce0f75c54f9
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-06-21 17:01:25 -07:00
GangCao
88726edf83 nvmf: correct the function input parameter name
Change-Id: Ie4d5f2ba141aac9bdfe3c83290de1ab88c24a908
Signed-off-by: GangCao <gang.cao@intel.com>
2016-06-08 12:55:14 -07:00
Daniel Verkamp
0f912a0eaf nvmf: add NVMe over Fabrics userspace target
Change-Id: I739916824d033bd1a8f8b7f5def09e58f23d13cb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-06 15:21:25 -07:00