Commit Graph

485 Commits

Author SHA1 Message Date
Jim Harris
456540bcf5 Revert "test/nvme/host: test perf with QD 128"
This reverts commit c1e6d94269.
2016-12-20 16:40:46 -07:00
Daniel Verkamp
c1e6d94269 test/nvme/host: test perf with QD 128
Change-Id: Ic4658e82b90896f5041fe3aa2c7d5e6eaac3b878
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-20 13:49:57 -07:00
Ben Walker
a96a6ecf58 nvme: Rename nvme_qpair_construct to nvme_qpair_init
This function initializes the members of an existing
qpair struct. It doesn't construct one from scratch.

Change-Id: I0b9afac1ad25cfb217efd146702f693c74f5f697
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
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
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
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
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
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
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
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
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
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
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
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
Ben Walker
4af9f06c73 nvme: Rename discover_info to transport_id
This is a small step toward making discovery more like
scanning a local PCI bus.

Change-Id: Ie7149ad060f2eeb56939b1241187bdf09681f2aa
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-08 11:48:21 -07:00
GangCao
17bcc76d30 test: update core mask for multi-process nightly tests
Change-Id: I096512a3c6c3845e12368181cac4b1503a7e8d07
Signed-off-by: GangCao <gang.cao@intel.com>
2016-12-07 13:37:21 -07:00
GangCao
acbec41597 test: make concurrent applications run on different cores
Change-Id: Ie619f63074a3bcdf592ac1f4ec25da6ea38de626
Signed-off-by: GangCao <gang.cao@intel.com>
2016-12-07 13:36:57 -07:00
Ziye Yang
0d7ce601cb nvmf host/test: upgrade the test script to use spdk's own identify
Change-Id: Icb02a38767698da0eff79db90999d616c6e5e3a8
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-12-07 12:34:02 -07:00
Daniel Verkamp
6c68441e14 test/nvmf: don't echo newlines when configuring kernel target
If we use regular 'echo' without -n when setting up the kernel target
sysfs entries, the traddr and trsvcid will contain the newlines, so use
echo -n to prevent the newlines from being added.

Change-Id: I924ffc0d1957eed25e97a12fe12d43d390176c05
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-07 12:34:02 -07:00
Ben Walker
5b8c0c5ace nvme: Rename spdk_nvme_transport to spdk_nvme_transport_type
It's not the whole transport - it's just an enum for the
type of transport.

Change-Id: Ia435a21792f221ddf50ddf4f0923c6152622eccb
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-07 09:47:00 -07:00
Ziye Yang
87eb023afe nvme/rdma: Add identification test for kernel nvmf target
Change-Id: Ibcfdf1a451f88e186ae328560c21480c81dc44b3
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-12-06 16:35:50 -07:00
Changpeng Liu
144065f30c iscsi: fix big READ task release process for ERL1
When we enabled the ERL1 configuation, for the DATAIN task release
process, we will queue the task to the SNACK list firstly, and then
remove the list when got ACK from initiator, but for this part of
logic, the reference count of primary task was not released correctly.

Change-Id: Ic5959cf644c74f676be0b84c5650292dc426b2d8
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-12-06 13:00:32 -07:00
Daniel Verkamp
145e9014b9 test: temporarily disable NVMe multi-process tests
There is an intermittent bug in the multi-process support causing test
failures, so disable the tests for now until the multi-process code is
fixed.

Change-Id: I778004c8276390accb06eab5b86265169886c45f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-06 10:38:50 -07:00
Daniel Verkamp
801388a796 Add missing .gitignore files for binaries
Change-Id: I2a2b23fb5e71ff4c0b9c85e0709968e8d7e75f63
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-06 09:51:00 -07:00
Daniel Verkamp
f93fd72680 env: split PCI drivers into individual files
Change the PCI enumeration API to individual functions per device type
so that only the drivers that are actually in use get linked into the
final executable.  All of the common code is still shared internally in
the env_dpdk library.

Change-Id: I2ba83afe59202a510f999a0674e23e60b6581221
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-06 09:30:55 -07:00
GangCao
bb726d516b nvme: add multi-process support
This version of multi-process support needs to have DPDK 16.11 builtin.

Change-Id: I3352944516f327800b4bd640347afc6127d82ed4
Signed-off-by: GangCao <gang.cao@intel.com>
2016-12-02 12:24:22 -07:00
Ziye Yang
4a0c1021fc nvme: update nvme perf program to test nvmf target
1 update nvme_rdma.c to fix the I/O queue creation bug.
2 update examples/nvme/perf/perf.c
3 add perf.sh

Change-Id: Ic7d4845219deb93bc042e34abbb7b2e05793ccd8
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-12-02 08:41:12 -07:00
Cunyin Chang
e8c63cdde0 nvme: Add support for hotplug.
Change-Id: Iac504ce15e4ea3100e5afa31764fcfff7f979dbb
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-01 10:21:59 +08:00
Cunyin Chang
d1a37e98e6 nvme: Make the nvme_transport_ctrlr_scan() could scan a specific device.
Change-Id: I74f7582f5175742e96268dc9c0cc83db2e1eaea0
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-01 10:17:41 +08:00
Daniel Verkamp
a9e436911f nvme: remove transport qpair_destroy() function
Each transport should handle its own qpair cleanup internally.

Change-Id: I7dd737be820ea6bad686f4aad7d74044fad58a47
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-30 17:10:39 -07:00
Daniel Verkamp
ba16e46349 nvme: pass opts and probe_info to nvme_attach()
Let the transport access the controller options during
ctrlr_construct().

Change-Id: I83590c111e75c843685dd9315f0f08416168356d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-30 17:10:39 -07:00
Cunyin Chang
bdbea32857 test: Add autotest for ip migration.
Change-Id: Ic62badb272655b68883d3fe3484b2e67e01837e4
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-11-30 16:57:00 -07:00
Daniel Verkamp
4ea7938965 test/iscsi_tgt/fio: remove FIO job state file
The information in this file is not useful after the test has finished,
so rather than copying it to the build output directory, just delete it
like all of the other tests using FIO.

Change-Id: I8495a2956b03f376b391ed501aaa61a857bfa490
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-30 16:37:58 -07:00
Daniel Verkamp
8b45a830c4 test/nvmf: put host tests into a timing group
Change-Id: I4efecdd273a8a83ee9f2bb249141129a0ba82ee3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-30 09:56:51 -07:00
Daniel Verkamp
9589f0371a test/nvmf/host/identify: remove unrelated cruft
This script is testing the SPDK NVMe-oF host and target code, so the
kernel nvme-rdma driver should not need to be loaded.

It is also not running FIO, so it doesn't need to clean up the FIO
job state files.

Change-Id: I3cfe619abf36885df4bdc6eecebf0e197fb869be
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-30 09:56:51 -07:00
Daniel Verkamp
c454900960 log: print trace flag names in SPDK_TRACELOG()
Change-Id: I962ee098818f48563e67f9b4214bc3519eee48b4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-28 13:15:08 -07:00
Jim Harris
fae782b66f ext4test: add ISCSI_APP and NO_NVME parameters
This allows this test script to be used with different
iSCSI target binaries, as well as optionally turning off
configuration of an NVMe-based target node.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id6841e71d7842117756346cfd0fe1853a1ea5c6a
2016-11-28 11:37:37 -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
Jim Harris
f7504f8ad5 test/util: add pci unit test
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia893503c1d8a65c9fc73ef6a09fa3a1302d08767
2016-11-23 11:29:43 -07:00
Jim Harris
076fb28427 test/env: move vtophys to subdirectory
This prepares for some additional env tests.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I577faad44fb9ae5c83785b406728224b16396f26
2016-11-23 11:29:42 -07:00
Jim Harris
4db2eb4053 test/iscsi: add pdu test
As part of this commit, stop building the iscsi
tests on FreeBSD.  This new pdu test links in
object files from the iscsi library, some of which
do not build currently on FreeBSD with our default
error/warning levels.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icb6a3dc17aa62882d0477f7734d2701ea09a3f36
2016-11-23 11:29:41 -07:00
Daniel Verkamp
1cb7e396a7 json: add printf-style spdk_json_write_string_fmt()
Change-Id: I9ea18072d4e54344f145a0b2d16aa6ab7f4d5e03
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 16:32:35 -07:00
Daniel Verkamp
7d5bcb4893 nvme: remove spdk_nvme_transport_type from API
Use the NVMe over Fabrics spec definitions for TRTYPE rather than the
internal library transport type.

Change-Id: Idead559a8f8d95274fc580d10e82033822e6eda8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 13:42:00 -07:00
Daniel Verkamp
16ae39419d nvme: untangle internal enum_cb complexity
Change-Id: I73ddb996a652b78534ce49e5d4e43b269940ec4d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 13:41:38 -07:00
Jim Harris
407b550ff4 build: define SPDK_LIB_LIST to simplify building dependencies and linker args
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia969f9e5ed01f4b58cec2559133347d836118131
2016-11-22 11:45:48 -07:00
Jim Harris
2655503ff7 build: make a common mk file for nvmf unit tests
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7adcb863f991a8a9939430a7f15009b971ec937b
2016-11-22 11:45:48 -07:00
Jim Harris
5616e0880d build: create a common mk file for nvme library tests and examples
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ief0f99b7f014cf905d08e2c0cd9dc99653bd0bb8
2016-11-22 11:45:47 -07:00
Jim Harris
afa8cfbc88 test/nvme: rename nvme_sgl.c to sgl.c
This enables some future Makefile simplifications.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I28e001e0e261d6c9f556cf53585e223f64cf0ae0
2016-11-22 11:45:47 -07:00
Daniel Verkamp
cf3fb7bb7d bdev/rpc: add driver-specific data to get_bdevs
Change-Id: Ieb37c9fdb55b36b62adcb421ab1d0426052d23a4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-21 12:35:57 -07:00
Pawel Wodkowski
a1948352a3 lib/scsi: handle scattered input/output buffers for non IO commands
Fix buffer overflow/underflow for commands with alloc length scattered
into multiple preallocated buffers (eg. INQUIRY)

Change-Id: If6f7cabc7a6a7fb384bb015e14dc38548f484d0f
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-11-21 10:52:35 -07:00
Ziye Yang
246c39a7ee nvme: Add nvme over fabrics support
Change-Id: I6f6259e77baa5dc5861f31ec4a9034e15297d333
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-11-18 13:58:44 -07:00
Daniel Verkamp
44e60dc47d build: consolidate library outputs in build/lib
Make it easier to use SPDK libraries by putting them all in a single
directory that can be added with -L rather than scattered around the
source tree.

Change-Id: I5c0f5dd6e7058b5f92fa9bc41548190ffc064761
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-17 13:15:09 -07:00
Daniel Verkamp
19d56fead7 test: move RBD test pool setup to autotest.sh
Leave the RBD pool configured and running throughout the tests so that
it can be used in multiple test scripts.

Change-Id: I056ef29bd8d97fa63f1ca78ee728f9c51f4bdf41
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-17 12:46:37 -07:00
Daniel Verkamp
d27b24c94b log: split internal TRACELOG macro into new header
The SPDK_TRACELOG macro depends on a CONFIG setting (DEBUG), so it
should not be part of the public API.

Create a new include/spdk_internal directory for headers that should
only be used within SPDK, not exported for public use.

Change-Id: I39b90ce57da3270e735ba32210c4b3a3468c460b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-16 13:33:51 -07:00
Daniel Verkamp
075e15c164 scsi/init_ut: use the public conf API
Rather than building a configuration file data structure up by hand,
just write the configuration to a temporary file and read it via the
spdk_conf_read() API.

Change-Id: I07b9fefc307fd2e07185c8655f22d6f188425327
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-16 10:33:16 -07:00
GangCao
ec5b6fed61 nvme: add ref to track the shared usage of ctrlr among processes
Considering the process can be terminated in the cases like ctrl+c,
kill command or memory fault, the ref is tracked in the per process
structure spdk_nvme_controller_process and whenever there is other
process attaches or detaches the controller, a scan will be issued
to cleanup those unexpectedly exited processes.

Change-Id: Ib4f974f567a865748d42da4ead49edd383dfc752
Signed-off-by: GangCao <gang.cao@intel.com>
2016-11-16 10:27:45 -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
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
8cd385908c bdevperf: don't exit on I/O failure during reset
The outstanding I/O at the time of reset are expected to fail, so don't
exit with an error code.

This could use some better validation to make sure failures only happen
during the reset, but this at least gets the nightly tests running
again.

Change-Id: Ibf5e6962fabd1a556a64591c65012ffacc1fd1d1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-15 10:13:49 -07:00
Tsuyoshi Uchida
81d60e6f30 scsi: fix panic issue of spdk_scsi_dev_queue_task
When task->lun is NULL, spdk_scsi_dev_queue_task panics. This patch
fixes it.
2016-11-10 13:29:12 -07:00
GangCao
621f96f7aa util/bit_array: use spdk_realloc for process sharing
Change-Id: I8fe49388e7bec9306474f27de7c17e767dfa19e8
Signed-off-by: GangCao <gang.cao@intel.com>
2016-11-09 15:04:20 -07:00
Pawel Wodkowski
8b449060eb lib/scsi: allocate only requested amount of data
Remove 4k allocation size in spdk_scsi_task_alloc_data(). From now on
all commands must obay allocation length.

Change-Id: Ica9384c62d431483ae1d0bd2e6fdee18b570861f
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-11-09 12:33:15 -07:00
Pawel Wodkowski
0244b5d78d scsi_bdev: respect allocation length in MODE SENSE 6 and 10
This refactor MODE SENSE 6 and 10 related functions to respect buffer
size parameter.

Change-Id: I03bad456bac0554a8bf7b56f69d1f9cf5b1991f6
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-11-09 10:52:34 -07:00
Pawel Wodkowski
f30f0c76f1 scsi: refactor usage of iov from spdk_scsi_task
This patch is preparation for fixing alloc_len overrun in SENSE 6/10 and
READCAP 6/10. To simplify code forbid usage of iov outside of
scsi/task.c.

This also drop SPDK_SCSI_TASK_ALLOC_BUFFER flag that obfuscate code. As
a replacement assume that if field alloc_len is non zero it mean that
iov.buffer is internally allocated. Functions
spdk_scsi_task_free_data(), spdk_scsi_task_set_data() and
spdk_scsi_task_alloc_data() manage this field.

Change-Id: Ife357a5bc36121f93a4c5d259b9a5a01559e7708
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-11-09 10:19:53 -07:00
Daniel Verkamp
1f3d48b22d bdev: move spdk_bdev_fn_table into bdev_module.h
The bdev function table should not be part of the public API.

Change-Id: I5d6f40d1b37c4471041c1c9d6253a3f92e9e9701
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-09 09:59:39 -07:00
Ziye Yang
8dc39f6203 test/rbd: Enable fio test for iSCSI target while using RBD as LUN
Change-Id: Idc138e2207e522113384ebc132447e2fb321e137
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-11-09 08:57:54 -07:00
Daniel Verkamp
0aec36be1f nvme: return virtual address in SGL callback
Instead of the next_sge callback returning the physical address
directly, make it return the virtual address and convert to physical
address inside the NVMe library.

This is necessary for NVMe over Fabrics host support, since the RDMA
userspace API requires virtual addresses rather than physical addresses.
It is also more consistent with the normal non-SGL NVMe functions that
already take virtual addresses.

Change-Id: I79a7af64ead987535f6bf3057b2b22aef3171c5b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-09 08:57:40 -07:00
John Kariuki
ac2aee6725 added nvmf subsystem discovery via RPC
Change-Id: Ia2bcc5e8b4d1b1f5ca698e65cdc6ec3a4fd4aa8e
Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
2016-11-07 14:07:37 -07:00
Tsuyoshi Uchida
6583441f54 bdev: add members for SCSI sense information in spdk_bdev_io (#59)
Custom bdev modules can return any SCSI status and SCSI sense
information to a host by this patch. This is usefull when a custome bdev
module detect an error in the module and need to return meaningful
information to a host.
2016-11-07 13:14:47 -07:00
Daniel Verkamp
1ffec5d53a nvme: convert transport type to an enum
Function pointers will not work for the DPDK multi-process model (they
can have different addresses in different processes), so define a
transport enum and dispatch functions that switch on the transport type
instead.

Change-Id: Ic16866786eba5e523ce533e56e7a5c92672eb2a5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-07 10:42:18 -07:00
Daniel Verkamp
52bbb267d8 event: process events in batches
Since we are usually going to be removing multiple events from the queue
at once, use the DPDK burst dequeue interface to improve efficiency.

Also rework the event queue runner to always process a fixed maximum
number of events per timeslice for simplicity.  This removes the
rte_ring_count() call from the hot path and improves fairness between
events and pollers.

Now that events are dequeued in bulk, we can also put the event objects
back into the mempool in bulk.  Add an env wrapper around
rte_mempool_put_bulk() and use it to free all of the events at once.

Basic performance benchmark using test/lib/event/event/event -t 10
is improved: previously ~40 million events per second, now ~46 million
events per second.

Change-Id: I432e8a48774a087eec2be3a64c38c339608af42a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-07 09:32:25 -07:00
Liang Yan
e3580da167 test: Use lspci to discover default kernel drivers
Instead of searching /sys for devices and checking which
driver happens to be loaded, use lspci. The lspci tool is
a bit smarter - it knows which driver is loaded now but
also which driver is the default driver the kernel wants
to load for that type of device. It's that default that
we need.

Change-Id: I1dc01ab6eac233e85f42316567bde2f4ed2203c6
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
2016-11-02 16:37:40 -07:00
Daniel Verkamp
cc1146a8b5 iscsi: move iSCSI-specific SenseLength into PDU
This removes the 2 bytes of SenseLength from the beginning of the SCSI
sense_data buffer, so now the offsets within sense.data match up to the
expected values from the SCSI spec.

Change-Id: I9188560096a9ec5a8fcf83bec95201521b127494
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-02 14:15:09 -07:00
Daniel Verkamp
fcb00f3780 nvme: expand probe information to a struct
spdk_nvme_probe() will now provide a struct spdk_nvme_probe_info to the
probe and attach callbacks in place of the PCI device pointer.

This struct contains the useful information that could be retrieved from
the PCI device during probe.

The goal of this change is to allow expansion of the probe information
in the future when other transports (specifically, NVMe over Fabrics)
are added that do not necessarily use PCI addressing or device IDs.

Change-Id: I59a2a9e874e248ce5fa1d7f4b57c8056962ff3cd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-02 14:15:02 -07:00
GangCao
bfc8bc87fb nvme: add the per process admin cpl queue for multi-process case
Change-Id: Ie67e3414db807160092bb10812a586b7230e0a89
Signed-off-by: GangCao <gang.cao@intel.com>
2016-11-01 16:48:21 -07:00
Daniel Verkamp
ed1e7ca2d7 env: add struct spdk_pci_id and getter function
Use the new public PCI ID structure in the NVMe library to replace the
previously private struct pci_id.

Change-Id: I267d343917f60bdae949a824bc0fe67457cbbc0d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-01 09:40:36 -07:00
Daniel Verkamp
c0527befc5 env: clean up PCI address comparison function
- Split the part that gets a PCI device's address into its own function,
  spdk_pci_device_get_addr(). This is useful outside of the comparison
  function and is orthogonal to comparing addresses.
- Make the comparison function take two addresses instead of a device
  and an address.  The more general form will be useful with addresses
  that are not directly associated with a device.  Because of this, also
  rename the function from spdk_pci_device_compare_addr() to
  spdk_pci_addr_compare().
- Return a signed value similar to strcmp() so that addresses can be
  ordered, not just compared for equality.

Change-Id: Idf304454af09ea57f1e1d5dc3a39b077378cecad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-01 09:40:36 -07:00
GangCao
075ba523bd nvme: set the qprio when constructing the qpair
Change-Id: Id5b35c023b975cc07fe721e4749bac6a0c803719
Signed-off-by: GangCao <gang.cao@intel.com>
2016-10-31 13:41:22 -07:00
Daniel Verkamp
91d7bf5d15 test/nvmf: use bdev names from construct_*_bdev
Replace hard-coded list of Malloc0 Malloc1 with dynamically-generated
list based on the names that were returned from the bdev creation RPC
calls.

Change-Id: I2171b650fa540184de0e6dfd6bb5f66611e9c0d8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-31 11:19:24 -07:00
Daniel Verkamp
0404c306cb bdev: make construct RPCs return the bdev names
When creating a bdev via the RPC interface, there was no way to know
what name it was assigned (other than predicting it based on the
numbering scheme).  Change all of the relevant RPC interfaces to return
an array of bdev names so they can be used to construct LUNs/subsystems
dynamically in scripts.

Change-Id: I8e03349bdc81afd3d69247396a20df5fcf050f40
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-31 11:17:46 -07:00
Daniel Verkamp
93de96b412 nvme: add Keep Alive Timeout feature support
Add a field to struct spdk_nvme_ctrlr_opts that allows the user to
specify a keep alive timeout, and add automatic submission of Keep Alive
commands to spdk_nvme_ctrlr_process_admin_completions().

Change-Id: Ib282299a571d8edc59c7933418751bc3a6c98b40
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-31 10:28:55 -07:00
Daniel Verkamp
fc411e38a0 json: add jsoncat test tool
jsoncat parses the input file using the SPDK JSON parsing library, then
prints it back out using the SPDK JSON writing library.

Change-Id: I6f35533cdb4977306ff50be9a706a783a62cdfc1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-31 10:23:12 -07:00
Daniel Verkamp
0d8e28a171 calsoft.py: fix error reporting
Report all of the tests that failed (and remove some overly fancy
Python magic that didn't work anyway).

Change-Id: I4ee47e845fe4727c69f84b505ea5ae19a15a9270
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-31 09:35:21 -07:00
Tsuyoshi Uchida
a5f0327897 scsi: translate nvme error to scsi error (#54)
This patch translates NVMe status code to SCSI sense according to NVM
Express: SCSI Translation Reference.

http://nvmexpress.org/wp-content/uploads/NVM_Express_-_SCSI_Translation_Reference-1_5_20150624_Gold.pdf
2016-10-28 13:06:45 -07:00
Piotr Pelplinski
a2d0fa5351 spdk: add support for readv and writev in scsi layer
This patch adds support for spdk_bdev_readv in scsi layer.
It also fixes write so that it uses multiple iov's instead of one.
Currently we should use only task->iov (for single vector operation)
or task->iovs (for multiple vector operations).

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Ia3b2f6d18fd212b11d7b63b11dc46ec5bbc74788
2016-10-26 04:24:08 -07:00
Wenbo Wang
8bf37ee769 nvme: change nvme_intel.c to nvme_quirks.c
Make the quirks mechanism generic in preparation for quirks for devices
from other vendors.

Change-Id: Ic003b020a38f1b966021db30e3f2bce9cf6a1a0d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-24 17:01:26 -07:00
Piotr Pelplinski
074b6d2430 spdk: remove iobuf from spdk_scsi_task
This patch removes reduntant field in spdk_scsi_task and
fixes all logic to use iov.iov_base

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Ie2fa1e2357b6383c118d05aec9206d1c60537d40
2016-10-24 09:11:05 -07:00
Ben Walker
4ebf15eedf iscsi: Use Python to parse output of lspci
Instead of using shell commands, use python to parse the output
of lspci. This is considered more "Pythonic".

Change-Id: I88ef0fe8cbfbcaa9c5d323552a82ef63e46f52cf
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-24 08:29:53 -07:00
Daniel Verkamp
bee15d8be0 nvme: move PCIe-specific definitions to nvme_pcie
Add a transport function to get the max data transfer size to break the
dependency on NVME_MAX_XFER_SIZE.

Change-Id: I846d12878bdd8b80903ca1b1b49b3bb8e2be98bb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-21 09:06:30 -07:00
Daniel Verkamp
b33e29efd3 nvme: split out transport-specific qpair structure
Change-Id: I45c6b8a92389e3dc7fd5d9862ef165fd16f6253e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-21 09:06:29 -07:00
Daniel Verkamp
ff3869789a nvme: add transport ctrlr_enable function
Move the PCIe-specific admin queue setup to nvme_pcie_ctrlr_enable.

Change-Id: Ic3f5625fa804f719040ba86b7fc3bf82fcc057c0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-21 09:06:29 -07:00
Ziye Yang
51b9664203 scsi: Make scsi sense data build more clear
Change-Id: I072abaae2d00ab84d7322f3dadd8dd30608b1a1c
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-10-21 08:54:01 -07:00
Tsuyoshi Uchida
b13fecd3b3 bdev: check status parameter instead of bdev_io->status
A status member of spdk_bdev_io structure is set after the if block.
Therefore a status parameter should be checked instead of a status
member.

Change-Id: I4030a7fcdb36d9c589802ec5b4e424591dc2a3b6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-20 15:16:09 -07:00
Daniel Verkamp
76469b2cf7 nvme: cache CAP register in spdk_nvme_ctrlr
The value of CAP should not change during the lifetime of a controller,
so read it once during ctrlr_construct and store it in the ctrlr.

Change-Id: I089d4141b4e0c9aae6c53abf9bb0ef6577dabe0b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-20 12:56:45 -07:00
Daniel Verkamp
a987bd16c2 nvme: convert adminq to a qpair pointer
Rather than embedding adminq directly in the spdk_nvme_ctrlr structure,
change it to a pointer to a spdk_nvme_qpair.  This is necessary to allow
the transport to extend the qpair structure.

Change-Id: I041685d5037088cf56d046fe99bf204edcfc57b1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-20 12:56:45 -07:00
Liang Yan
57c99c9027 nvmf/test: update request unit test
Change-Id: I04a8facc237ec75ecd23cafa686da1f20707f4dc
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
2016-10-20 12:00:27 -07:00