Commit Graph

27 Commits

Author SHA1 Message Date
Daniel Verkamp
1c7b6f8dab nvmf: add spdk_ prefix to nvmf_find_subsystem()
Change-Id: I02a44c3790830b3918dca418c6bb85e82ddac273
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363298
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-01 19:43:45 -04:00
Daniel Verkamp
6a2710d5d3 nvmf.h: fix function declaration formatting
Only function definitions should be split between the return type and
the function name, not declarations.

Change-Id: Iff67e3265dd82a8929ca388fd2dcd2f6ee52166e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363297
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-01 19:43:45 -04:00
Daniel Verkamp
81344a66ef nvmf: make spdk_nvmf_ctrlr_ops contents private
This structure is not part of the public API and shouldn't be in
spdk/nvmf.h.

Change-Id: I29fbb269d3ab77cd9fa9908726abc7c7a4c6d8c1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363296
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-01 19:43:45 -04:00
Daniel Verkamp
5f3841f0e3 nvmf: allow NQN to be 223 bytes + null terminator
An ECN to the NVMe 1.3 specification has clarified that the NQN may
contain 223 bytes before the null terminator.  Make all of our NQN
length checks consistently enforce this behavior.

Change-Id: Iebfd57d11abea64964c7a6ad9d886e40efa243c3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-18 14:36:39 -07:00
Daniel Verkamp
45cab335bc include: move standard includes into spdk/stdinc.h
This is the first step toward isolating standard C and POSIX headers
into a single replaceable header file.

Change-Id: I527297f5e7260b01103018ad3429922962ee9add
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-08 10:11:01 -07:00
GangCao
f75fe7394a nvmf: add an outstanding admin IO tracker in direct mode
Change-Id: I06e0de6dc28115f0cb53151d67138f9271093687
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-15 08:02:39 -07:00
GangCao
7224a42d9d nvmf: add a periodical admin poller for AER event in direct mode
Change-Id: Ib8cba61fe3d531f9228d0c385913d63914ba8093
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-15 08:02:39 -07:00
Cunyin Chang
e58e56c9c6 nvmf: Add support of hotplug for nvmf virtual mode.
Change-Id: I941d119e6b74eadfccd7eb7675b2f7b46d2b5907
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-14 14:53:56 -07:00
GangCao
360d3813b0 nvmf: add the unique subsystem id
Change-Id: I0369b7462a12aec76d52dd357d72989886de5a54
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-10 13:06:55 +08:00
GangCao
4cdd929b66 nvmf: introduce the global and per subsystem listen addresses
Change-Id: I276a71a3280c41b215a9cf4ca85247bd397a85e5
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-07 12:56:13 -07:00
Daniel Verkamp
88a7271315 nvmf: combine set_aer_callback and attach
Change-Id: Icb6aab97aa78862b19c1fa68fac2b7ac44feea90
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-06 17:15:31 -07:00
Daniel Verkamp
cc85d7ef68 nvmf: move io_channel allocation to virtual.c
Change-Id: Ibe0464a539b7545d7f911d6af13a1bd3f7bd3cd9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-06 17:15:31 -07:00
Ziye Yang
0801877b7d nvmf,direct: add AER support in direct mode.
After checking the code, aerl in our session is 0,
so there will be only 1 AER. So currently,
we will only handle 1 AER case.

When the AER event is triggered by real NVMe device owned
by the subsystem, it notifies all sessions belonging to
the subsystem.

Change-Id: Ia80fb0f03e893c20d8dd14afbed8db10db38301c
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-01 10:47:52 -07:00
Daniel Verkamp
84d904841f util: move common helper functions to util.h
These were repeated a few different places, so pull them into a common
header file.

Change-Id: Id807fa2cfec0de2e0363aeb081510fb801781985
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-10 09:38:52 -07:00
GangCao
200217a47e nvmf: poll the NVMe subsystem once under more sessions case
Change-Id: Ie13a787eb0ff3b6b95fb6796871ac0b747b992ad
Signed-off-by: GangCao <gang.cao@intel.com>
2017-02-07 14:54:28 -07:00
Daniel Verkamp
ad063db506 nvmf: apply const to several char * arguments
These strings are not modified by the functions they are passed to, so
they can be const char *.

Change-Id: I11532f232990a305d706c14aac1b0f8f93b8f576
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-02 09:45:29 -07:00
Ben Walker
1cbbfb86fa nvmf: Make cntlid globally unique.
The code doesn't actually use this property of cntlid
for anything yet, but we will need it later.

Change-Id: I5fd514d75b903cc8769e7b9f196a4624e9cf876c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-01-20 10:02:32 -07:00
Daniel Verkamp
6ca517d460 nvmf: split subsystem lookup from host check
This allows us to print better error messages when connecting to a
subsystem that exists but does not allow a specific host.

Additionally, we can now return the correct error code for a host that
is not allowed.

Change-Id: I16cd4ac2745cf50bb54601b464b0d23954f86fda
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-23 16:34:13 -07:00
Changpeng Liu
a3ed1795cd nvmf: add subsystem check on creation and cleanup for nvmf rpc
Change-Id: I85826c99c450426c26870ae261a7b7c8daeba031
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-11-23 10:27:54 -07:00
Ben Walker
b43db69a44 nvmf: Remove spdk_nvmf_transport from public API
The details of the structure were removed earlier, but
now remove all references even to a pointer to the
structure. The user can refer to transports by their
string name.

Change-Id: I273356f46329ea5372dcd951eda6f14767477d69
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-11-16 08:11:46 -07:00
Ben Walker
bb5d8e506c nvmf: Combine nvmf_tgt_init and nvmf_transport_init
Change-Id: I6d0f92842f3b8626bc2c25b38bfa7f7ddea5e7cc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-11-16 08:11:46 -07:00
Ben Walker
3cbed2ed86 nvmf: Add some accessors for subsystem data
This is a step toward abstracting away the definition
of the subsystem.

Change-Id: I88b2aa107b27152620f51a1ca2a153792b4c85e9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-11-16 08:11:46 -07:00
Ben Walker
f1017d7769 nvmf: Remove num from subsystem
It wasn't used for anything.

Change-Id: Ifc8c97481490f6389a739a37df03dea6c88ec692
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-11-16 08:11:46 -07:00
Daniel Verkamp
fd6ebca7a8 nvmf: only save PCI address in direct ctrlr data
The NVMe over Fabrics target was storing the PCI device pointer for each
direct-mode controller, but it only really needs the PCI address, which
is exposed via the get_nvmf_subsystems RPC.

Also update the same code path to use the new spdk_pci_device_get_addr()
function for brevity.

Change-Id: I0708b3331b7c279c1a86f0d7459b5deb40dd7c89
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-01 09:40:36 -07:00
Ben Walker
cfafcc3edd nvmf: Init transport before adding listeners
Change-Id: I1fbaca75c6b95127ff2b6ac7c0ea0f0a918b9405
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-20 16:22:58 -07:00
Ben Walker
93ab45d68c nvmf: Add an accessor for transport name
This allows the entire transport structure definition
to become private.

Change-Id: I9ca19edbfc3cfb75b9b113a89bb2b90bc499ab16
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-14 15:26:45 -07:00
Ben Walker
1e6ffa0394 nvmf: Add a public API header
This changes as little code as possible while still creating
a single public API header. This enables future clean up
of the public API and clarification of the exposed
concepts.

Change-Id: I780e7a5a9afd27acf0276516bd71b896ad301c50
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-14 15:26:31 -07:00