Commit Graph

44 Commits

Author SHA1 Message Date
Ben Walker
76abc37913 nvmf: Rename alloc_rdma_reqs and make it public
This is going to be used elsewhere in the code, so
name it according to the public naming convention
and make it public.

Change-Id: I0dcb88e902c5e609fe6acd06ad06743203fcaa60
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-29 14:00:17 -07:00
Ben Walker
6bd23031ae nvmf: Add alloc_rdma_req function
Break out the code to allocate a single rdma request
to be used elsewhere.

Change-Id: I687ce5ec862831fed5300157bfb4bf980d22c782
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-29 14:00:17 -07:00
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
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
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
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
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
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
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
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
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
c917957bff nvmf: Remove rx_desc pointer from tx_desc
The nvmf_request structure holds the pair of pointers
for rx_desc and tx_desc.

Change-Id: I3e735979bbdcdc0e70ad78762e289849d41158ba
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 09:25:17 -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
90c28166c0 nvmf: use cm_id context to store conn pointer
Instead of searching the global list of connections to find a matching
cm_id, we can just store the pointer back to the spdk_nvmf_conn in the
rdma_cm_id context field.

Change-Id: I39ea16be6a633a1136d65743747b63b600f20e63
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-23 11:54:54 -07:00
Daniel Verkamp
54b538d1cb nvmf: move RDMA resource defaults to rdma.c
Change-Id: I98e92b4351b64ce87117341d86b1d39d8a826e72
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-20 14:24:47 -07:00
Ziye Yang
6ec18cd05b nvmf: add nvmf_ibv_send_wr_init and nvmf_trace_ibv_sge
The purpose is to reduce duplicated code.

Change-Id: I84b14fd3d0286f358cc1877250477a4cc538d210
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-06-20 09:20:46 -07:00
Ben Walker
dc6a0a2bd2 nvmf: Rename init_grp.h/c to host.h/c
Match the names in the specification.

Change-Id: Ic3f95220efea4dfbdf209af43db20da26ae232b6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-17 13:31:05 -07:00
Ben Walker
422b147499 nvmf: Standardize names in init_grp.h
Prefix with spdk_nvmf_host.

Change-Id: I053030febf5b7157cc2c7075ac6170bc59ce0ced
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-17 13:31:05 -07:00
Ben Walker
6eb1bee64b nvmf: Rename spdk_nvmf_init_grp to spdk_nvmf_host
Host is the term used in the specification.

Change-Id: Ie9a06e3ff176e00e2fdcdc5bede701fe768d4b35
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-17 13:31:05 -07:00
Ben Walker
ba37804100 nvmf: Don't allocate our own RDMA protection domain
If we just pass NULL to rdma_create_qp, it will do
the right thing.

Change-Id: I9621a5110ace6237a1e47c6e5defb4cac3afc4ae
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-10 11:19:33 -07:00
Ben Walker
309a97f782 nvmf: Use RDMA CM wrappers for registering memory
The wrappers are much simpler to use than the low
level ib verbs calls.

Change-Id: I4b09a96a60020bc27df9396d40d955733f618837
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-10 11:19:33 -07:00
Ben Walker
1b17e4ee35 nvmf: Combine nvmf_rdma_conn_init and nvmf_rdma_qp_init
They are only ever called in sequence and do related
operations.

Change-Id: I825abe08deba1dafb405757bb4f2d52062a801ca
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-10 11:19:33 -07:00
Daniel Verkamp
c78d4d0b6c nvmf: move includes from nvmf.h where they're used
Most of the #include statements in nvmf.h aren't part of the public API.

Change-Id: I0d43dd542a28744a91a4fd0c4c806a991d1e194e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-09 14:25:26 -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