Commit Graph

1637 Commits

Author SHA1 Message Date
Ben Walker
ee80b31cb7 nvme/rdma: Delete config_rdma_req
The code is clearer if this function is incorporated
into its only caller.

Change-Id: I33901cddf80ae27896b2acfd1b9e7d212f21f5f3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-19 12:51:50 -07:00
Ben Walker
414702426d nvme/rdma: Rename nvme_rdma_bind_addr to resolve_addr
This is resolving the address and route to the target, not
binding a socket to an address.

Change-Id: I80055481ed2e020410a1e186a4e7371b60faaee9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-19 12:51:50 -07:00
Ben Walker
42dc2836bc nvme/rdma: Add a utility for getting the next cm event
Change-Id: Ia7650e729ab233be6464fb0a190c9cd29f462fcf
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-19 12:51:50 -07:00
Ben Walker
fa97f35f06 nvme/rdma: Remove unused code in nvme_rdma_connect
Change-Id: I4f63136f57d074a9f7ff6027f2e8f6fb8a9c8dae
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-19 12:51:50 -07:00
Ben Walker
df46c41a4c nvme: Unify spdk_nvme_discover and spdk_nvme_probe
They were very close to the same already, so finish the job.

Change-Id: Ifba9e3b2d11a3e70cbfbe46f57a67552db2757ed
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-19 11:22:57 -07:00
Ben Walker
c00bce397d nvme: Move nvme_hotplug_monitor up in the file
Avoid having to forward declare.

Change-Id: Ib1e5629f855fa70ba77247972823a8418a5fc7a9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-19 11:22:53 -07:00
Daniel Verkamp
8d4aaa2dd1 autobuild: log current git version and date
Change-Id: I665b84b6df1dfda9a12627d438bf5d3def58e5f6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-16 10:27:28 -07:00
Daniel Verkamp
b8da09b629 nvme/rdma: the NVMe SGL should use rkey, not lkey
We should be sending the bounce buffer's remote key to the target so it
can put it into an RDMA SGE on the remote side.

Change-Id: Icded155ad2292c67baa722f001c9c07178bc2754
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 16:39:53 -07:00
Daniel Verkamp
b74979421f nvme/rdma: remove write-only rdma_req->bb_len
Change-Id: Ied1bee7c8db87cca890d94e519ec07ae3fc658b2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 16:39:53 -07:00
Daniel Verkamp
e8184c1f25 nvme/rdma: change max queue size from 127 to 128
There is no particular reason for this to be 127; make it 128 to at
least be consistent with the PCIe transport.

Change-Id: I60500e0044d3549ba6350e1f35f09d624848bd21
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 16:39:28 -07:00
Ben Walker
b2a86421f4 nvme/rdma: Fix specification of R/W queue depth
The meaning of the parameters was swapped.

Change-Id: I3f4938c446fd06afd1852bcf08e779b7b988855d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-15 16:35:00 -07:00
Ben Walker
375da65762 nvme/rdma: Remove nvmf_cm_construct
This function was only called from one place and saved no
lines of code.

Change-Id: If5e653732df57c1f2c93e20cf4f286eac31df91c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-15 16:35:00 -07:00
Daniel Verkamp
f8baa259a1 test/nvme/hotplug: print an error if counts mismatch
Change-Id: I99339b16051011c9685d9d8afb79463eba01bfc4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 16:29:34 -07:00
Daniel Verkamp
6854710d6d likely.h: fix spdk_likely condition
The __builtin_expect(), as written before, would have generated the
right branch taken/not taken condition, but the return value was the
opposite of the cond value.

We need to double-not the value to convert it to a 0/1 value while
preserving its original 0/non-zero sense.

Change-Id: I38101ff3ed8e89fc6516cfcdf7d642651545e4ff
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 13:01:08 -07:00
Ziye Yang
01529c676b nvmf: get correct len for the get log page command
Change-Id: I58aa594d5ef75f7440e99371b1d97f171f3a9a6e
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-12-15 11:37:21 -07:00
Daniel Verkamp
d24ea9009a nvme: add offset to spdk_nvme_ctrlr_cmd_get_log_page()
Change-Id: I1af4950995062f892062f29db85da2a8dd793d85
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 11:16:14 -07:00
Daniel Verkamp
9938985766 nvme/rdma: queue request if no rdma_req available
This matches the behavior of nvme_pcie, which queues a request if no
tracker is available.

Change-Id: Idbf6c951c89451cfea22ec6bc553ff46f988f818
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 11:13:09 -07:00
Daniel Verkamp
ee82713678 nvme/rdma: clean up nvme_rdma_req_init()
Make the caller pre-allocate an rdma_req and change req_init() so it
only does initialization, not allocation.

This is necessary to distinguish between rdma_req allocation failure and
other types of failures, which will become important in future patches
when requests will be queued if rdma_req allocation fails.

Change-Id: Ie6edebc1b5f05001b42fc959a29ce0ea6875e41e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 11:09:50 -07:00
Daniel Verkamp
be92f47fa8 nvme/rdma: merge rdma_qpair_construct into alloc_reqs
Simplify the control flow and match the name of the function to its
purpose.

Change-Id: I65bad7e3b2ef710ca29eff9799b8dcaae3999315
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 11:09:50 -07:00
Daniel Verkamp
0eb3125531 nvme: remove transport qpair_construct callback
Make the qpair construct functions private to the transports - it
doesn't need to be called from generic code.

Change-Id: I5f730a4bcf60ce231fe27bc8f4c3c39cb647dd2d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 11:09:49 -07:00
Daniel Verkamp
988906135c nvme: determine io_queue_size at startup
Add a transport callback to return the maximum queue size, and enforce
it in the generic nvme_ctrlr layer.

This allows the user to tell what io_queue_size was actually selected by
the transport via the ctrlr_opts returned during attach_cb.

Change-Id: I8a51332cc01c6655e2a3a171bb92877fe48ea267
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 11:09:48 -07:00
Daniel Verkamp
f505f57b36 nvme: add ctrlr function to set initial CAP value
Change-Id: Id7f68f279f87a08844015efcd35a790944b3bfbe
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 11:09:25 -07:00
Daniel Verkamp
fb31963c4b nvme/rdma: register cmds as a single MR per queue
Equivalent to commit 6ab28a201b except now
for commands instead of responses.

Change-Id: Ibe4382dc0f65c1b90c2cee2ad285bbdd21b96a89
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 10:58:23 -07:00
Daniel Verkamp
5ab3a71e2a nvme/rdma: remove unnecessary bb_sgl
The only field of bb_sgl that was actually used is lkey, and that is
already stored in bb_mr.

Change-Id: I790369a06ce223f88e356df20a9d9a74a93ff225
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 10:52:27 -07:00
Daniel Verkamp
9cc423f061 scripts/rpc.py: add Unix socket support
Change-Id: I0750563f4fc706ddd803c9679f63aa006427c8a5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 08:06:33 -07:00
Daniel Verkamp
347db37f6c rpc: allow listening on a Unix socket
Change-Id: I320d1a560a1c3d13d8751465752284305d8d9c0b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 08:06:33 -07:00
Daniel Verkamp
71e54bb941 rpc: add listen address configuration option
This also changes the default listen address from 0.0.0.0 (accept any
connection) to 127.0.0.1 (accept only connections from the local host).

Change-Id: I3de09c582c95126d240795550a56be7aedea639c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 08:06:33 -07:00
Daniel Verkamp
e6d1a5ac36 jsonrpc_server: allow user to specify socket type
Change-Id: I811d8c4e3659775519ca61dae31c1fe17cd7142a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 08:06:33 -07:00
Daniel Verkamp
0f6c389e69 changelog: add bdev changes and NVMe multi-process
Change-Id: Ib68feab08123d6b631a506cd9024c39eb36c5832
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-14 15:09:01 -07:00
Cunyin Chang
94cf5c00d2 test: Add autotest for hotplug.
Change-Id: I5822c36a7374b680a3b213b8768afd834daf59d9
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-14 15:04:33 -07:00
Cunyin Chang
d77a04d148 example: Replace the printf with fprintf to stderr.
This patch will make sure the information will show up
on console immediately.

Change-Id: I0080866a40de35fb9deef840551ff212759b0191
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-14 15:04:33 -07:00
Daniel Verkamp
de1b00657c nvmf_tgt: implement log page offset for discovery
Generate the full discovery log page in a memory buffer, then copy just
the requested part of it for each Get Log Page call.

Change-Id: I12730c59c0395cdac57aaab96337e938952e3011
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-14 12:15:19 -07:00
Ziye Yang
002815a4d9 bdev/nvme: Pass nvme_library_fini to SPDK_BDEV_MODULE_REGISTER
Change-Id: Ifb36e1b89bdc2347520795c1d1520db82158c41b
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-12-14 12:13:38 -07:00
Daniel Verkamp
5848faab5c nvme/rdma: split discovery probe into a new function
Refactor the discover log page processing into a loop that calls a
function for each log page entry.  This sets us up to add support for
multiple Get Log Page calls to handle larger discovery service lists.

Change-Id: I85676ada375d0dadda2a3f4ab6331123ac7aaf60
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-14 11:03:38 -07:00
Daniel Verkamp
32e6dd1573 nvme/rdma: bounds check discovery log page numrec
Change-Id: Ic7bcd6b7f42510be68f70fb3526a344754ecbbc0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-14 11:03:38 -07:00
Daniel Verkamp
03be4c1c59 nvmf_tgt: extract offset from Get Log Page command
Note that the offset is not actually used yet, just sanity checked.

Change-Id: I9464dc934e94e3d38ac0d474fce876552650f92b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-14 11:01:51 -07:00
Daniel Verkamp
86fc646fac nvmf_tgt: update the discovery generation count
This allows hosts to determine when the discovery log page has changed
when reading it across multiple Get Log Page calls.

Change-Id: I3c3459959c6246a88938e4f82e3e0046419e7d00
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-14 11:01:51 -07:00
Daniel Verkamp
ec591eaf41 nvmf_tgt: insert new subsystems at end of list
This keeps the existing subsystem list (and therefore the discovery
service log page) in order when new subsystems are added dynamically.

Change-Id: I071639be0fef4139f8f017b433185c786ae55378
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-14 11:01:51 -07:00
Jim Harris
a9616e8497 setup.sh: allow overriding of NRHUGE
Default is still 1024 2MB huge pages, but user can
override this by setting a different value in the
environment.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8d189d3a71f474469a44b6eb41b4443591863f3c
2016-12-14 10:27:28 -07:00
Daniel Verkamp
23fc6682fb nvme/rdma: use trid.adrfam when resolving address
Change-Id: I3c3c0faa808e6047d1f9297dc6985597cc0c4aaf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-14 10:14:10 -07:00
Daniel Verkamp
0346dd775e nvme: add ADRFAM (address family) to transport ID
This isn't used yet in the NVMe library, but it will be necessary later
for supporting non-IPv4 addresses.

Change-Id: I167ce63ad25b0e0c9aa192b12d764c8d078e67f9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-14 10:14:10 -07:00
Daniel Verkamp
9c5df2c4bf nvme: make NULL trid equivalent to probing PCIe
Change-Id: I286c23d96d1d21abd102adf51c3d4675e131b11d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-13 15:29:53 -07:00
Daniel Verkamp
92ee5fc4be nvme: rename queue_size option to io_queue_size
This better describes what the field controls (it does not affect the
admin queue size).

Change-Id: I851ae46fb4ed0fce819af07ae235824e0fc817e6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-13 15:23:13 -07:00
Pawel Wodkowski
8a62ba51f2 lib/nvme: change in payload offset propagation path
For requests split in _nvme_ns_cmd_split_request() the payload offset is
set after children are created using recurrent call _nvme_ns_cmd_rw().
This makes impossible to reset SGL to proper offset in
incomming patches that split non-PRP complaint SGL requests.

To change this the payload offset is set after each request is allocated
in _nvme_ns_cmd_rw() not in _nvme_ns_cmd_split_request().


Change-Id: I9d3b2e3bbd9d93a4c8a37e1db8c4e01276e2cacb
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-12-13 10:40:02 -07:00
Pawel Wodkowski
636b078b09 lib/nvme: extract function for setting up request cmd
This is preparation for handling non-PRP compliant SGL.

Change-Id: I445790f9802292971256cf821d9730814c95a073
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-12-13 10:23:20 -07:00
Pawel Wodkowski
bcf546bb00 lib/nvme: extract function for removing child requests
This is preparation for handling non-PRP compliant SGL.

Change-Id: I49c3745498411c5ff9e17cd08f181d4d434c2d08
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-12-13 10:23:11 -07:00
Cunyin Chang
ca618b2751 nvme: Fix the bug for address parse when get hot insert event.
Change-Id: Ic346173cb88a774ac4288ad3a5aa08fb3fe909ec
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-13 10:06:17 -07:00
Ziye Yang
69fa44fc88 rbd: change the product name of rbd to "Ceph Rbd Disk"
Comply with the definition format used by other bdev
modules

Change-Id: Iac108bac540687b32fea4bb70374c22534c60aa0
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-12-13 09:24:31 -07:00
Ziye Yang
aeaa76a5f3 scsi: Change T10 vendor ID from Intel to INTEL
The vendor ID for Intel shoudl be "INTEL", according
to the following page:
http://www.t10.org/lists/vid-alph.htm#VID_V

Change-Id: Ib9611e5604c8b5e3eaec8101548aaf4a3c45597a
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-12-13 09:24:31 -07:00
Ziye Yang
c21e9fa5fb nvme/rdma: move ibv_send_wr/ibv_recv_wr usage from stack to heap
It will be more safe to do in this way.

Change-Id: I2bbe97ac72dc9f8b0e32a183f9aec5a628e0830a
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-12-12 17:07:56 -07:00