Commit Graph

485 Commits

Author SHA1 Message Date
Daniel Verkamp
ad063db506 nvmf: apply const to several char * arguments
These strings are not modified by the functions they are passed to, so
they can be const char *.

Change-Id: I11532f232990a305d706c14aac1b0f8f93b8f576
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-02 09:45:29 -07:00
Daniel Verkamp
b913ad119e test/bdev: shorten bdevperf autotest
Change-Id: I1234f7dbb4a96b5790bb70800148cf6827810b4d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-01 16:44:24 -07:00
Daniel Verkamp
0a701f3a1c test/event: run autotests for shorter times
Change-Id: I1e70e15236b123608972fab00fddd1d157134a8a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-02-01 16:44:24 -07:00
Daniel Verkamp
018e6afff2 nvme: remove ctrlr_get_pci_id transport callback
The PCIe transport initializes the quirks directly, so the generic hook
to get PCI ID is no longer necessary.  This path was dead code.

Change-Id: I25bdaa598db53e4312a264d9d8356d1b416696e5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-31 14:50:40 -07:00
Daniel Verkamp
a384110d7a nvme: move nvme_qpair_fail() call to generic code
The logic to fail queue pairs when the controller is failed should be
handled in the generic code, not in the individual transports.

This also allows nvme_qpair_fail() to be private to nvme_qpair.c.

Change-Id: I6194576dceb35073b9af8847e59314900028637c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-31 14:50:40 -07:00
Daniel Verkamp
378fc7787c test: clean up redundant process_core invocations
The main autotest.sh script automatically runs process_core as needed.
Individual test scripts should not be calling it.

Change-Id: I19d8799cd39f37f4768d8d89d3ece6aa993a6c95
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-30 14:08:38 -07:00
Daniel Verkamp
b33a298dd7 test/nvmf: drop unnecessary chmod of /dev/nvme-fabrics
The autotest.sh script is already running as root, so we should not need
to change the permissions on /dev/nvme-fabrics.  This block has just
been cargo-culted across the various NVMe-oF test scripts.

Change-Id: I078ebf102d3fc354e42be9c6f1fc37481ffae291
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-30 14:08:38 -07:00
Daniel Verkamp
2c0bc38754 bdev: add "split" virtual blockdev example
This virtual block device takes an underlying block device and splits it
into several smaller equal-sized block devices.

Change-Id: I6f6e686c1177b2e4885f7e88809ad329caae55bd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-30 13:51:18 -07:00
Daniel Verkamp
efccac8c7e bdev/nvme: remove NvmeLunsPerNs and LunSizeInMB
These were only intended for testing and should be replaced by a virtual
blockdev that can be layered on top of any kind of bdev.

Change-Id: I3ba2cc94630a6c6748d96e3401fee05aaabe20e0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-30 13:51:18 -07:00
Daniel Verkamp
b809cdd3ab env: add spdk_mempool_create() socket_id parameter
Change-Id: I8ab0bb2c6e1fdf1681fbd049a096c1768e54dc27
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-30 13:05:30 -07:00
Fan Lu
23dd35a729 test/nvme: add nvme_ns unit test
Change-Id: I4c32a3dfad21e759d63c23683b119a1eb5870545
Signed-off-by: Fan Lu <lux.fan@intel.com>
2017-01-30 09:57:38 -07:00
Fan Lu
fb85072562 test/nvmf:add virtual.c unit test
Change-Id: I48aab13b93f3b231c799a82e0044fa3eae8d5df1
Signed-off-by: Fan Lu <lux.fan@intel.com>
2017-01-27 10:54:28 -07:00
Cunyin Chang
5f3e922a6a nvme: Fail the qpair if it is marked as failure when process the completion queue.
This make sure the qpair failure could be started from upper level application.

Change-Id: I7e04fe36929cc634ddf0078db96fbc40afb38f8c
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-01-25 16:31:52 -07:00
Daniel Verkamp
7a8840c09b nvme/identify: convert NVMe-oF to -r TRID format
Change-Id: I620331e2a865d399bddf2e5759f0a832f9c2e86b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-25 16:31:38 -07:00
Daniel Verkamp
f3b3fe5b36 autotest: remove duplicated unit test invocations
Now that unittest.sh is run as part of the automated tests, drop the
various unit test calls scattered throughout the tree.

Change-Id: Iea98314bb7f04620d72d81d25e24f8e706b50ce1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-25 15:19:23 -07:00
Ben Walker
91d7d20c4e event: add a reactor benchmark tool
Change-Id: I57c7ed3475b19ffb8d00354eabb23ba86294164b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-01-25 11:10:06 -07:00
Jim Harris
59408ad2ef test/event: rename event to event_perf
While here, make it clear this is a benchmark that
tests internal APIs.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie5a57fdcee12b47568542721095c49d28ece5529
2017-01-24 16:42:12 -07:00
Ben Walker
9dd801c86c nvmf: Rename spdk_nvmf_globals to spdk_nvmf_tgt
Change-Id: Iaa1cd5e2f89d82f34b5d3d9fcb914a4f51c5d1e1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-01-23 16:46:56 -07:00
Ben Walker
06b9c46561 nvmf: Add utility functions to create/destroy listen addresses.
Change-Id: I58c21caa8f7f0b564c6d8684fe6c7501e810dfa0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-01-23 16:46:55 -07:00
Ben Walker
ec38ec127c nvmf: Handle wrap-around for global cntlids
64k sessions over the lifetime of a single target is something
that really could happen, so handle this case.

Change-Id: Iaed92b9ff6cd078fcd7c1efe88cf0c860c77c4ac
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-01-23 16:46:55 -07:00
Tsuyoshi Uchida
5ee4728d0c log: define prioritynames[] (#102) 2017-01-23 16:07:29 -07:00
Daniel Verkamp
094524ba9e test/nvme/host: test perf with QD 128
This reverts commit 456540bcf5.

Change-Id: I90ddf9f5adb0546e2819408b46e414e979528e48
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-20 17:07:48 -07:00
Daniel Verkamp
df33e630aa test/nvme: run quirks unit test
Change-Id: Ie0d7709f6f5524b6ec80bfce40260d3e518c23d4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-20 17:06:14 -07:00
Daniel Verkamp
96b1f7e078 test/iscsi: move g_spdk_iscsi definition to individual tests
Defining g_spdk_iscsi in test/lib/iscsi/common.c leads to duplicate
definitions in the pdu unit test.

Change-Id: I280d11a64a923fea2f2c0cb1dd391449b9a471fb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-20 15:10:44 -07:00
Daniel Verkamp
d14c2443e4 test/nvme_ns_cmd_ut: remove duplicate g_spdk_nvme_driver definition
This test already links nvme.c via OTHER_FILES, which provides the
g_spdk_nvme_driver definition.

Also make g_request static while we're here, since it is only used
within this test file.

Change-Id: I9f1a2a7b3d40d2ea0989f6f781a4d220afbd3f0e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-20 15:10:44 -07:00
Daniel Verkamp
f8ee49a963 test/nvmf/direct: add gitignore for binary
Change-Id: I4e189a26998e669b9f7f802a7889d72e08259fc1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-20 09:20:01 -07:00
Daniel Verkamp
042452af55 nvme/perf: convert -r argument to TRID format
Change-Id: Ib0568ace157c19c9a86741b7d46fcf5cdb8cdb69
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-19 14:05:57 -07:00
Daniel Verkamp
be8a9d6966 nvme: add transport ID string parsing function
Change-Id: I33c15c8a56c25667567b373d21a117cca1f756c7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-19 14:05:57 -07:00
Fan Lu
57fbfa0abe test/nvmf:add direct.c unit test
Change-Id: I5259aa2fc1dd22d662a14d44aa8015bc55c430e9
Signed-off-by: Fan Lu <lux.fan@intel.com>
2017-01-19 11:13:33 -07:00
Daniel Verkamp
c2721e8ebe test/log: verify that log facility is not NULL
Make the static analyzer happy.

Change-Id: I431b98af167d268f7e91c1f6d507c2c19d10ae25
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-18 16:07:47 -07:00
Jim Harris
133c4a70c1 bdevperf: save offset and unmap desc in bdevperf_task
This is preferable to rooting around the bdev_io structure
directly - which will no longer work if we want to support
modifying bdev_io structures in place for simple
bdev transformations like partitions.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0c5007030d8a8b84649397c5ec55351497604fc0
2017-01-18 16:06:45 -07:00
Ziye Yang
0a573526b6 nvme/pcie: Add the support to probe nvme by pci_addr
Currently we use the pci functions provided by DPDK,
it identifies the device by class id related
info but not by pci bdf info, so we can add the filering
by pci_addr in pcie_nvme_enum_cb function.

Change-Id: I5942e98853f00fc10fa6aae5c113517653d1b357
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-01-18 15:30:45 -07:00
Tsuyoshi Uchida
950b48de61 log: use facilitynames to set/get log facility (#81)
* log: use facilitynames to set/get log facility

Define our own facilitynames[] instead of defining SYSLOG_NAMES
2017-01-17 11:20:34 -07:00
Jim Harris
86e8a920bf nvme: split non-compliant SGLs into multiple requests
Since nvme_ns_cmd.c now walks the SGL, some of the test code
needs to also be updated to initialize and return correct values
such as ctrlr->flags and sge_length.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I521213695def35d0897aabf57a0638a6c347632e
2017-01-17 07:51:09 -07:00
Daniel Verkamp
38c09e5eed json/parse: rewrite and simplify number parsing
Convert the number parsing function into a linear sequence with a goto
label for each state, rather than a single loop with a state variable.

This makes the code easier to read and also improves speed (better
branch prediction and smaller inner loops for the common case).

On my test system, jsoncat citylots.json > /dev/null improves from
~1.7s to ~1.2s.

This changes behavior of some number parsing test cases: inputs matching
the number grammar as defined by JSON will be returned even if there is
trailing garbage, consistent with the rest of the parser.  For example,
the input 01 will be parsed as a valid number 0 followed by trailing 1.
This only makes any difference when the full input is a single
number value, since if the value was nested in an object or array, the
trailing garbage will not match the expected syntax and the whole parse
will fail with SPDK_JSON_PARSE_INVALID (e.g. [00 will parse the first 0
as a number and then fail on the second 0, since only a comma or right
square bracket would be accepted).

Change-Id: Ifabfaed611219b3e0a06c8677190a28b87e8a13b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-13 13:18:50 -07:00
Ziye Yang
d61ddd3c93 nvme/rdma: Support directly connect via trid
Preivously, we only supports probe the NVMf target
via discovery info, now we can support to directly
to connect it.

Change-Id: I08ce1d95de6744286357e68b48c97b773b902ac8
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-01-13 10:57:03 -07:00
Daniel Verkamp
0a845cb2bc bdevio: print I/O target bdev information
Change-Id: Icdff86fa7dbf9a44400a9b4796a2671fcc9bf75a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-11 16:49:39 -07:00
Daniel Verkamp
249a68e92b bdev: add API to claim block devices
Claim the block devices used by iSCSI LUNs and NVMe-oF subsystems so
they can't accidentally be reused.

This will also be used by virtual block devices to allow layering of
bdevs.

Change-Id: I5384923fbf24f13f4ce720a797c5a628053d49f4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-11 16:49:39 -07:00
Daniel Verkamp
a96dc2592e bdev: remove event dependency from I/O callback
Use a plain function pointer + callback context for the bdev I/O
completion callback.  This is possible now because each I/O channel will
be polled on the core that submitted the I/O.

Change-Id: I29ee8e4a3430df11c74845adab840395b9bc5010
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-09 12:09:36 -07:00
Jim Harris
292c9c42aa scsi: simplify lun task execution
An old prototype SPDK AHCI driver would return
TASK_SET_FULL if all NCQ slots were full on a given
disk.  This would kick the SCSI task back to the LUN
to be retried later.  Since then, we have pushed
responsibility onto the bdev modules themselves
to handle this kind of queueing/retry logic.

Removing this logic allows us to make some additional
changes that enable tasks to get completed inline without
an extra event callback to handle completion.  We also
no longer need to worry about checking if pending tasks
need to be executed in the complete_task() routine, since
the execute() routine will now always exhaust the pending_task
list.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If2dc3ab017e0dbc225c8f627e1f87c5a8e9b1e3e
2017-01-09 11:37:25 -07:00
Daniel Verkamp
f3c45ea0b3 test/nvme: move nvme_pcie unit tests to a new file
The PCIe-specific unit tests still need to be updated; this patch just
moves the existing tests over and stubs out the necessary external
functions.

Change-Id: Ia6d46013231d8880df111b744523d02b56b9b37a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-09 11:36:27 -07:00
Daniel Verkamp
f80c0f4fdd nvme: remove transport ctrlr_attach callback
Now that the hotplug code is isolated in nvme_pcie.c, it can call the
PCIe transport attach function directly.

Change-Id: I2df3b9168473b537cc9b13367e06d3d3b6fa22be
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-09 11:36:27 -07:00
Jim Harris
d2ae4f0723 test/bdev: do not free io channels in completion callback context
A future patch will call the bdev callback routine directly, rather
than deferring the callback routine to an event.  So for these
tests we will no longer be able to free io channels in the context
of the callback routine - otherwise it will result in freeing
an NVMe I/O queue pair in the callback routine and then return
to the NVMe driver which will try to reference the now deleted
qpair.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0e4dcc5d9c5a78e8b78a4147b430570fd140d478
2017-01-06 11:17:46 -07:00
Jim Harris
9073b6de8c test/bdev: simplify bdevio spdk function execution
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1c21f313a059b1f4dc8417dafe1f7ec584a245f3
2017-01-06 11:17:46 -07:00
Daniel Verkamp
df8129fb39 nvme: move num_entries to transport-specific qpairs
The spdk_nvme_qpair::num_entries value is never used in the common code,
so move it to the individual transport qpairs to make it clear that it
is a transport-specific implementation detail.

Change-Id: I5c8f0de4fcd808912ba6d248cf5cee816079fd32
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 15:49:09 -07:00
Daniel Verkamp
7ac9a4ecbb event: remove spdk_event_allocate() next parameter
The 'next' event pointer was never used in the entire code base (always
NULL).

Change-Id: I75f999d3a2e10512d86edec1a5a46ef263e2635b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
c3ede774c7 event: remove spdk_event_t typedef
Use 'struct spdk_event *' directly for consistency with the rest of the
API.

Change-Id: Ib41a9bf47f5b18f4aebf5f4dee055455cb12ef7d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
44ef085bed event: pass arg1 and arg2 directly to event fn
This allows the elimination of the spdk_event_get_arg1() and
spdk_event_get_arg2() macros, which accessed the event structure
directly; this was preventing the event structure definition from being
moved out of the public API header.

Change-Id: I74eced799ad7df61ff0b1390c63fb533e3fae8eb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Daniel Verkamp
2931a3efef event: remove 'complete' parameter from poller_register
The spdk_poller_register() function provides a way to pass an event to
call once the poller is registered, but it is always NULL in the current
code base.

Change-Id: I459bf40ae4d050589577d113b7984f1563aaa9cc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-05 11:57:18 -07:00
Cunyin Chang
6152d5bf8f nvme: move hot-plug logic to nvme pcie layer.
Change-Id: I2042b34e4284a9c59aa3092ccd061c075748880c
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-01-03 16:56:13 -07:00