Commit Graph

107 Commits

Author SHA1 Message Date
Ben Walker
aceb76d2b5 nvmf: Post recv_desc immediately when they are allocated.
This avoids two loops back to back.

Change-Id: I42cb774defedf484869b0322eac84125b6b62330
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-29 14:00:17 -07:00
Ziye Yang
9620917a86 nvmf: Remove the cmd_type variable.
When Debug is not defined, SPDK_TRACELOG will do nothing,
thus cmd_type is an unused variable, and will trigger the
compilation warnings. And this patch will solve this issue

Change-Id: I821f7601a16c98e514227aee2e18fbfa61928bea
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-06-29 10:49:27 -07:00
Ben Walker
9efe055ec1 nvmf: Remove pending list for RDMA operations.
The queue depth allowed for incoming commands is set
such that we can do the maximum number of RDMA reads
necessary. There is never a case where a READ will need
to be queued anymore.

Change-Id: I4f7e7f4a59f6358065b82f36a5e22744af210d07
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-28 14:53:24 -07:00
Ben Walker
3bf5869912 nvmf: Simplify queue depth parameters
There were 4 variables tracking queue depths. In reality,
only one is needed once the minimum is computed correctly.

Change-Id: I9bb890e92a33a3c7bd6e27cbd31d6bee7ca0cf3d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-28 14:45:32 -07:00
Daniel Verkamp
42111e78de nvmf: replace IQN references with NQN
NVMe over Fabrics defines its own NVMe Qualified Name (NQN) format; it
does not use iSCSI Qualified Names.

Also change the default node base for nvmf_tgt to "nqn.2016-06.io.spdk".

Change-Id: I2b73c1426ef1d8c83cc2df499d79228ea61257cd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-28 14:38:15 -07:00
Daniel Verkamp
20b632d00e nvmf: fix host ID printing
Fix the sizes of the UUID fields to match RFC 4122.

Change-Id: I1458a22579f455cde0a67ee3ce616e78d5c810c2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-28 14:38:15 -07:00
Daniel Verkamp
19fec6bb9c nvme: add remove callback to spdk_nvme_probe()
This will allow removal notifications to be propagated to the library
user (e.g. for hotplug).

The callback is currently unused, but this at least prepares the API for
the future hotplug support.

Based on a patch by Dave Jiang <dave.jiang@intel.com>

Change-Id: I20b1c2dbf5e084e0b45a7e51205aba4514ee9a95
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-28 14:21:58 -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
226b4b7a93 nvmf: extract keyed SGL fields in rdma.c
Drop the RDMA-specific fields from spdk_nvmf_request and get them
directly from the command SGL in the transport-specific read function.

Change-Id: Icd06a9018a8c341213fbc8d26d3d7cbf2fb32d30
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 16:08:13 -07:00
Daniel Verkamp
8b419899b4 nvmf: remove unused spdk_nvmf_request::entries
Change-Id: I4ed0cbf906400dd2c9f10f3ec98b988aaec412e8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 15:50:44 -07:00
Daniel Verkamp
29d4ad597f nvmf: combine tx_desc + rx_desc into rdma_request
Change-Id: I5fa886e0eeed08bd2fb03c237a2a8129c1df4720
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 15:45:15 -07:00
Daniel Verkamp
996705f1b8 nvmf: do not dealloc tx_desc in RDMA error cases
The connection will be closed in these cases anyway, so just let the
normal connection cleanup deal with the active tx_desc.

Change-Id: I96c68d5802e189bb82b180cc3c7d7c3f4135be1f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 14:32:18 -07:00
Daniel Verkamp
6419922466 nvmf: check status of nvmf_check_rdma_completions
If the transport poll routine fails, we need to close the connection.

Change-Id: Ie534b0f05e6642c31e0450865e309a784abbe744
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 14:19:32 -07:00
Daniel Verkamp
d63007e5ca nvmf: clean up nvmf_recv() error path
If spdk_nvmf_request_exec() fails, the connection will be closed anyway,
so just leave the tx_desc in the active array; it will be cleaned up in
the normal connection cleanup path.

Change-Id: Ie4f60bd6001658403dd7e1c6a47d40be756ef6f2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 14:14:02 -07:00
Daniel Verkamp
3d9ef1a94e nvmf: set status in spdk_nvmf_request_prep_data()
If an invalid SGL is specified, send a response with a status code
indicating what the error was rather than silently dropping the command.

Change-Id: I12d1fd847d3bc0ea8de7698e934626c2586a7452
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 13:56:38 -07:00
Daniel Verkamp
f358b0093f nvmf: move request_complete call into request_exec
Make all command processing functions return a bool to indicate
asynchronous (false) or synchronous (true) completion.

Change-Id: I7c2e4d28fa473b36ff26c902e4bb69f38b64d18d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 13:46:19 -07:00
Daniel Verkamp
7cf7ed0764 nvmf: switch request.c traces to SPDK_TRACE_NVMF
Only use SPDK_TRACE_RDMA within the RDMA transport code.

Change-Id: Ie15fd24bb142a68f3661929267ebe396b556c351
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 13:22:01 -07:00
Daniel Verkamp
558347432f nvmf: simplify nvmf_check_rdma_completions()
The error case could only be reached with tx_desc != NULL in one case,
so move the cleanup code there and drop the goto.

Change-Id: I7aace6b40dd75ef8d86fb173f9d58110e929b082
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 13:13:03 -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
8e6ef319f6 nvmf: eliminate redundant CID in spdk_nvmf_request
Change-Id: I58ac25c1a7e0d4f1fe32349fff74178843cb5b20
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 12:52:19 -07:00
Daniel Verkamp
08cc45fec4 nvmf: make internal functions private to rdma.c
Change-Id: Id073674f5be7b164afa9d83ba34ad6f83883f12f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 12:28:28 -07:00
Daniel Verkamp
6e5f700bea nvmf: move RDMA connection handling to rdma.c
Also split the generic nvmf_trace_command() function out of
the RDMA-specific handler and move it to request.c

Change-Id: If29b89db33c5e080c9816977ae5b18b90884e775
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 10:24:01 -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
Daniel Verkamp
9bc34acdbc nvmf: move RDMA conn values to spdk_nvmf_rdma_conn
Change-Id: I60997d6d5d228855953c149e0abcd7f950ed741c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 10:23:09 -07:00
Daniel Verkamp
d5cf9030ac nvmf: remove nvmf_recv() SQ overflow handling
The overflow condition can't happen unless there is a programming error
in the nvmf_tgt library; we can only possibly receive command capsules
(sq entries from the point of view of the host) if we have posted a RDMA
Recv for the command capsule memory region.

This means that we also don't need to track sq_tail in the NVMf library.

Change-Id: I101509080c744528871e72fa46d188e2850c928a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 10:23:09 -07:00
Daniel Verkamp
d9709895fa nvmf: simplify control flow in nvmf_recv()
Get rid of the gotos.

Change-Id: I884e3fe6131fdd55731dcf28bf1de43bc5c2c724
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 10:23:09 -07:00
Daniel Verkamp
a5b405c687 nvmf: move length, xfer, and data init to request
Change-Id: I976c6624d5701fe9e1b6fd1a0aca069b26a9247f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 10:23:09 -07:00
Daniel Verkamp
f9db32ec3d nvmf: remove double immediate completion handling
The "immediate completion" cases in spdk_nvmf_request_exec() already
call spdk_nvmf_request_complete(), so the ret == 1 case in nvmf_recv()
is bogus.

Also fix a couple of spdk_nvmf_request_complete() calls in
nvmf_process_admin_cmd() that should be handled by its caller.

Change-Id: I41b865d5e6e7fec08087faf9c6f3da3b057a5fb2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 10:23:09 -07:00
Daniel Verkamp
bfa9931b3a nvmf: remove Create/Delete I/O SQ/CQ commands
These are not supported (and did not actually function) in NVMe over
Fabrics.  Queue creation is handled automatically when new connections
are initiated.

Change-Id: If3a10e5df2f0625537b2c453cd8c835e570fa31e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 10:23:08 -07:00
Daniel Verkamp
2e550d5165 nvmf: factor out RDMA-specific request completion
Move toward making request.c transport agnostic.

Change-Id: I25fbe74fff21a5c23138e1a6e2d40bc6a4a984ec
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 10:23:03 -07:00
Daniel Verkamp
e067f3302d nvmf: pass nvmf_request to nvmf_post_rdma_read()
Make nvmf_post_rdma_read() interface generic (don't require a tx_desc).

Change-Id: I331a93eed4bb1912a47a88bb904cf392fcc364c6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 10:21:30 -07:00
Daniel Verkamp
a435e9eeee nvmf: pass bb and in-capsule data to prep_data
This fixes an oversight that allowed in-capsule data block SGLs to
potentially refer to more than the received in-capsule data size.

It also makes spdk_nvmf_request_prep_data() less dependent on the
RDMA-specific rx_desc/tx_desc structures.

Change-Id: I34d61aca4cf5ba033849673116d16ec90488dcd4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 10:21:29 -07:00
Cunyin Chang
b86bd41aa6 nvmf: Remove unused return value.
Change-Id: I5df0339cfaa5877612705c5dce17b1fd69967208
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-06-27 09:19:17 -07:00
Daniel Verkamp
73a701d7d0 nvmf: remove unused spdk_nvmf_capsule_rsp
It is the same as spdk_nvme_cpl, aside from reserved fields.

Change-Id: I62b0718dd58c998b4d26a0d1b44ee16d37eff25d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 09:13:35 -07:00
Daniel Verkamp
8999f448ef nvmf: move BB SGL adjustment into rdma.c
The RDMA read and write commands can determine the desired length based
on the nvmf_request length field.

Change-Id: I97b63289556e7de3c19c5a17ecbacbbbdfc10425
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 09:13:35 -07:00
Daniel Verkamp
5248414d61 nvmf: give tx_desc/rx_desc bufs meaningful names
Replace the generic "msg_buf" naming with command and response.

Change-Id: I19baff43b41a5eb7db9be9d7feec33d17112e320
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 09:13:35 -07:00
Daniel Verkamp
f0242ce745 nvmf: remove bb pools and replace with rte_malloc
The mempool functionality is never used at runtime - all bounce buffers
were immediately assigned to a rx_desc.

Change-Id: Ie2195059858e34b30b07e104739f046c13abc335
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 09:13:34 -07:00
Daniel Verkamp
31d2a116c8 nvmf: remove rx_desc and tx_desc mempools
The RDMA tx_desc and rx_desc pools were only used at startup; all
descriptors are immediately allocated and put into a queue, and the
mempool functionality was never used at runtime.

Change-Id: I2882274962550191a555c8483b8f7be2854b32ec
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 09:12:42 -07:00
Ben Walker
e7dce1cfc0 nvmf: Move tx/rx descriptor management to rdma.c
This is an implementation detail of the RDMA layer.

Change-Id: Ib97d6fbd593789eed0b6e746972b8882a3320995
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 12:42:26 -07:00
Ben Walker
41aadf1591 nvmf: Move processing of pending RDMA reads into rdma.c
This code is operating on a list owned by the RDMA
connection, so move it to rdma.c

Change-Id: I8b81f9d1ffc1df489c9b698969725ed0d1db6a06
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 12:40:20 -07:00
Ben Walker
5677fe3c8d nvmf: Move *_desc lists into nvmf_rdma_conn
These are an implementation detail of RDMA, so move
them into the RDMA portion of the connection.

Change-Id: I68d146019c5d78fbf5e9968abfd7baed2a54a2ed
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 12:26:43 -07:00
Ben Walker
0216e537f7 nvmf: Add spdk_nvmf_rdma_conn structure
Separate out the RDMA connection from the
NVMf connection. For now, the RDMA connection
is just embedded in the NVMf connection, but
eventually they will have different lifetimes.

Change-Id: I9407d94891e22090bff90b8415d88a4ac8c3e95e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 12:04:41 -07:00
Ben Walker
1fe2ab57d6 nvmf: Simplify acceptor
Remove an extra layer of functions.

Change-Id: Ic08628031d9055d973af4aed12ab245f5ff6887b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 11:57:43 -07:00
Ben Walker
1b9cc2a9bc nvmf: Group rdma globals into a structure
This structure will be expanded in future patches.

Change-Id: Ibb04917134243560e09a2a255844739eb33fab65
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 11:44:10 -07:00
Ben Walker
68ba9e1f86 nvmf: Move fabric command handlers to request.c
Now all request processing is in request.c

Change-Id: I27db190f566a4134e5c09566f87c3d0922b3f569
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 11:31:28 -07:00
Ben Walker
744dd009c0 nvmf: Remove unused conn arguments from several functions.
Change-Id: I2c1df9e649dad9c5a74aca0e9ce9fca68068017f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 11:31:27 -07:00
Ben Walker
a4cbf50037 nvmf: request struct now has a pointer to conn
The request needs to know which connection specifically
it is associated with.

Change-Id: I492b9968b4d2e307b5af44edee0778478b32d2ba
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 11:31:27 -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
d7fbeda710 nvmf: Move process_*_cmd functions to request.h/c
Change-Id: I16481463a8735f71387c69dd9ca4e187d743d8fc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 11:30:59 -07:00