Commit Graph

1463 Commits

Author SHA1 Message Date
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
Tsuyoshi Uchida
b28125b9de bdev/nvme: add CSTS in blockdev_nvme_dump_config_json (#85)
* bdev/nvme: add CSTS in blockdev_nvme_dump_config_json

* bdev/nvme: delete shst

- delete shst
- change from spdk_json_write_string_fmt to spdk_json_write_uint32
2016-12-12 16:57:20 -07:00
Daniel Verkamp
4714e34d6e nvme/rdma: reset discovery trid for each entry
Don't leave garbage from previous discover entries in the trid we are
returning to the user.

Change-Id: I60ae5932db4a95cedb8df1ff98a2479220b55ce4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-12 15:31:25 -07:00
Ben Walker
ec0b5d2ba1 nvme: Clean up redundant arguments in transport_ctrlr_construct
The other simplifications to probe_info and trid made the
trtype argument redundant.

Change-Id: Ie7bea4e2204e690dc4909eeacd065e0722b53272
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-12 10:49:17 -07:00
Ben Walker
32e838af3c nvme: Remove probe_info, just use transport_id
The probe_info was reduced to just containing a
transport_id, so remove probe_info entirely.

Change-Id: Ica9a22d126cd14e282decd3eea1a0afe0460f099
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-12 10:49:17 -07:00
Ben Walker
6c2e170dc7 nvme: Remove pci_id from probe_info
This can be obtained by parsing traddr into a pci_addr,
then getting a handle to the pci_dev and asking for all
of the pci information.

Change-Id: I1948cbd3ec65611293192ef5558ace19dd444d4c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-12 10:49:13 -07:00
Ben Walker
3da43e64e4 nvme: Remove pci_addr from probe_info
This can be obtained by parsing the traddr.

Change-Id: Idaf35066cbf900c87e771a44934de99fb5420001
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-12 10:46:50 -07:00
Ben Walker
9511b2a20b env: Add spdk_pci_get_device
This function will return a device handle from a pci
address.

Change-Id: I323d92c71014ef571f3df9f19c2ec887844707e8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-12 10:13:16 -07:00
Isaac Otsiabah
5bc79e9c3d bdev/nvme: add option to reset on I/O timeout
Change-Id: I7128a1f2916af8470b0564025f5f30e299ab992b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-10 16:21:09 -07:00
Isaac Otsiabah
7c60aec01e nvme: add I/O timeout callback
Change-Id: Ie6220590467b88fe1e63b4b0f8a01221fc0c1206
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-10 16:17:18 -07:00
Isaac Otsiabah
a4cc346b17 nvme: convert nvme_tracker list to a TAILQ
Change-Id: I822529b28b683f707604c07721040f22689961c4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-10 15:45:53 -07:00
Daniel Verkamp
ea3a2772ac nvme: do not attach DPDK driver if user does not want to attach
This bug was preventing multiple calls to spdk_nvme_probe() from
working, since the first call would return 0 from all of the DPDK driver
init callbacks and prevent other devices from ever being enumerated in
subsequent calls.

Reported-by: Tsuyoshi Uchida <tuchida@us.fujitsu.com>
Change-Id: I871aa170bbd03be111604eeabe3a7a7a4f40ce89
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-09 15:04:26 -07:00
Ben Walker
4caf3c563a env: Add a function to convert pci addr to string
Convert an spdk_pci_addr to a string.

Change-Id: Idab0a16822cc37d7095d19f062dfca65356211e8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-09 14:39:51 -07:00
Ben Walker
8a9c1d4011 nvme: Make striping a quirk
Use the standard quirk mechanism to specify which devices
need software assisted striping.

Change-Id: Id8156876a90b4caf9d687637e14c7ad4a66ceda6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-09 14:38:42 -07:00
Cunyin Chang
2bd8c87a4c example: Add input parameters for expected hotplug count.
Change-Id: Iac626b05b72b26097d8742d6f427c9cd007a5da4
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-08 20:36:10 -07:00
Tsuyoshi Uchida
3560b00f20 scsi: no check lun->dev in spdk_scsi_lun_deletable (#82)
We don't need check lun->dev in spdk_scsi_lun_deletable.
Whichever dev is null or not null, spdk_scsi_lun_delete works
appropriately.
2016-12-08 18:41:03 -07:00
Daniel Verkamp
8fac961254 nvmf_tgt: don't report vendor ID for virtual mode
The emulated NVMe controller exposed by virtual subsystems does not
provide the Intel vendor-specific commands and behaviors, so it should
not use the 0x8086 vendor ID.

Change-Id: Iab4f0513d30f610feb62b1899da1b6316f11691c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-08 17:00:40 -07:00
Daniel Verkamp
d5670b97ff test/nvmf: delete outdated, unused nvmf_ut
It is causing confusion and is not compiled or run.

Change-Id: I182bbec9ac2520e171214e4e50be60edd6fd8984
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-08 17:00:26 -07:00
Daniel Verkamp
fbb277ea58 changelog: fill out major 16.12 features
Change-Id: I09f3505049970645aca33191c80d893a68828a76
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-08 16:59:56 -07:00
Ben Walker
d3f66cdb2b nvme: Hotplug events just place new controllers in the init list.
This way, all new controllers discovered will be initialized
in parallel.

Change-Id: Iebedb3905eb2787a3708f74425afae40ca31253d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-08 15:22:48 -07:00
Ben Walker
34100924e4 nvme: Rename nvme_probe_one to nvme_ctrlr_probe
Simplify the arguments as well.

Change-Id: I653e1aad4e574cf95d793b41b749cb19e0024c2b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-08 15:22:48 -07:00
Ben Walker
7473d6b37c nvme: Call the probe_cb if a device isn't claimed
If the first call to spdk_nvme_probe probes a device and
the driver elects not to take it, still call the probe
callback for that device on subsequence calls to
spdk_nvme_probe.

Change-Id: If06467cf6796c827a0bbfba6e36d5b91534526fc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-08 15:22:48 -07:00
Ben Walker
11ef5d396b nvme: Move hotplug monitor check inside _spdk_nvme_probe
Move this down a level so it happens on all paths.

Change-Id: Iea9913f0e102353882466c8dea4ee39abb857520
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-08 15:22:47 -07:00
Ben Walker
06557b0a4d nvme: Add remove callback to transport scan
Scanning the transport may result in both new
devices and removed devices, so pass the callback
for both operations.

Change-Id: I6f73dbe6fd7cf61575c354b43f8ae3e2a01e2965
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-08 15:22:47 -07:00
Ben Walker
d70ff832bf nvme: nvme_transport_ctrlr_scan now takes a transport id
Simplify the arguments to nvme_transport_ctrlr_scan to take
a transport id that identifies the discovery service (or
NULL to scan PCIe).

Further, separate scan into two functions - scan and attach.
Scan is for scanning an entire bus, attach is for a specific
device.

Change-Id: I464f351a02a04bc5a45096dcf5dc8fc5ac489041
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-08 15:22:47 -07:00