Commit Graph

1221 Commits

Author SHA1 Message Date
Daniel Verkamp
62d7cded7a nvme: split out transport-specific ctrlr structure
Change-Id: Icba2a44ff8ff35df09b3f1d8e3282a784e397a06
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-18 10:35:02 -07:00
Daniel Verkamp
c655efd6a9 nvme: move create and delete I/O queue commands to PCIe
These are specific to local NVMe PCIe devices, so move them out of the
generic NVMe code into the PCIe transport.

Change-Id: Iea2056a4c438b7d3a303b4b5e977ce7aa9e58c05
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-18 10:14:00 -07:00
Daniel Verkamp
a5790100f2 nvme: add ctrlr construct/destruct to transport
Change-Id: I66842497a02bdb586d38ddc4a38d5b444a9d5dad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-18 10:13:37 -07:00
Daniel Verkamp
03aead3903 nvme: add qpair operations to transport
Change-Id: Id354ba13515d54bb54a8293569ee83ea72111183
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-18 10:13:37 -07:00
Cunyin Chang
706bace35a test: Create malloc bdev dynamically for nvmf test cases.
Change-Id: I64ec6eb16ff8480ce95fbd2c07d479c4d05965e9
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-18 09:51:32 -07:00
Cunyin Chang
0482640657 rpc: Rename construct_aio_lun to construct_aio_bdev
Change-Id: Iff2d030b854bfda77ed1e5eeea6f46119a5bb50a
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-18 09:51:31 -07:00
Cunyin Chang
134dce2669 rpc: Rename construct_malloc_lun to construct_malloc_bdev
Change-Id: I72f21881264226499a9cd64c72f3ab1b4808b2ec
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-18 09:51:31 -07:00
Cunyin Chang
83620f4e09 test: Add test case for nvme bdev construction.
Change-Id: Iff256c9df8bc6954a18291caa7cc452e7bbe78fc
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-18 09:51:31 -07:00
Ziye Yang
94566ccf21 scsi, param: remove multi_negot_sess_params
There is no string defined, so remove it.

Change-Id: I4abfe0a561efcaeabe522e826ef64f65b24c2386
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-10-18 07:59:23 -07:00
Ben Walker
93ab45d68c nvmf: Add an accessor for transport name
This allows the entire transport structure definition
to become private.

Change-Id: I9ca19edbfc3cfb75b9b113a89bb2b90bc499ab16
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-14 15:26:45 -07:00
Ben Walker
1e6ffa0394 nvmf: Add a public API header
This changes as little code as possible while still creating
a single public API header. This enables future clean up
of the public API and clarification of the exposed
concepts.

Change-Id: I780e7a5a9afd27acf0276516bd71b896ad301c50
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-14 15:26:31 -07:00
Ziye Yang
07965d9860 rbd: Enable rbd compilation in automation test
When /usr/include/rbd and /usr/include/rados
are detected, enable rbd compilation in autotest.

Change-Id: Ibcd8d444b83402af1996b1e382be204a87dbc6e9
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-10-14 14:04:15 -07:00
GangCao
9a1d4a00cc test: check valid pointer in spdk_zmalloc before assigning value
Change-Id: I05f70a7aec000e57d20d56cf272bd39e64d5bcc8
Signed-off-by: GangCao <gang.cao@intel.com>
2016-10-14 12:59:40 -07:00
Pawel Wodkowski
39512fde74 bdev/aio: cleanup spdk_bdev_io_complete() calling
Only call spdk_bdev_io_complete() where IO error is seen.

Change-Id: I829e4c589dbcb47017e810035837a4c61c3428f9
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-10-14 12:59:29 -07:00
Daniel Verkamp
b0e9620b4f nvme: add qpair create and delete to transport
Change-Id: Ibc057972c7eb84ada95fb173d559255e5c86c5ba
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-14 12:46:58 -07:00
Daniel Verkamp
179f122cab nvme: add register access functions to transport
Change-Id: I2e80879e69770b42ea751a8ade7110ac9f4b6d13
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-14 12:46:58 -07:00
Daniel Verkamp
a00852c1fc nvme: add PCI ID accessor to transport
Change-Id: I1776c21d7479f3ef69fe254b8dc4b6d64bbe48bc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-14 12:46:58 -07:00
Daniel Verkamp
d7b7dbfb78 nvme: introduce transport abstraction
This will allow factoring out PCIe-specific code into a swappable
transport so that NVMe over Fabrics host support can be added.

Change-Id: I4df74dd268d655e3b36e8d6114ebe7d79a24844d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-14 12:46:58 -07:00
Ben Walker
b697d2809d env: Adjust for API changes to DPDK PCI in 16.11
Change-Id: Ie76d2d18f65f079f465afef4be5154fa53ab3783
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-14 12:44:16 -07:00
Pawel Wodkowski
0bd08c4536 nvme: don't call request callback if it is inactive
Change-Id: I150ed2dc7cea91f262ee0773c892069a56b68902
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-10-14 11:07:50 -07:00
Jim Harris
9459848ce5 iscsi: fix iscsi task refcount for out of order write completions
For large writes that require multiple SCSI tasks (one for immediate
data, then one or more for R2T-solicited data), we bump the refcount
for the task associated with the initial immediate data PDU, to
ensure it does not get freed until all of the child tasks are
completed.  But in some cases this initial immediate data PDU could
complete after all of the R2T-soliciated data PDUs.  The
completion code was not handling this case correctly which would
result in the iSCSI connection thinking it still had outstanding
SCSI tasks when the connection closed.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9f9c5322755462d1918fde0075c87c84295cb10c
2016-10-14 11:07:50 -07:00
Pawel Wodkowski
eef39e8d35 ext4test: mount with sync option and print dev stats
Mounting with sync to do more IO during test.
Print dev stats after umounting.
Do not change directory to mounted system, as this is preventing cleanup
trap to umount used path in case of failure.

Change-Id: I2f444b67b1f293c9d7c939f8f94aa5756e20aa26
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-10-14 11:07:50 -07:00
Pawel Wodkowski
2025e8f3ce test: bdevio: extend test for vector io
Change tests to use read/write vector and non-vector versions.

Change-Id: I5a97568d3dc2f61d44721f4b0c75331baad417bb
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-10-14 19:46:40 +02:00
Pawel Wodkowski
113f8e23a7 bdev: enable IO vector operations
This patch enables vector operation for bdev drivers aio, malloc and
nvme.
The rbd driver still handle only one vector.

Change-Id: Ie2c1f6853bfd54ebd8039df9a0305854ca3297b9
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-10-14 16:21:24 +02:00
Cunyin Chang
f1fcdeb341 script: Add method to construct rbd bdev.
Change-Id: I2c1e083628ac5a1402b8e89bdf05ca2ed55bc1a5
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-13 22:07:53 -07:00
Cunyin Chang
b66913d2d4 bdev: Add rpc interface for rbd.
Change-Id: I7ae271d8c687fc438ad74760877479a3d22e70c6
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-13 22:07:53 -07:00
Cunyin Chang
e578cfe3d4 bdev: Add public function spdk_bdev_rbd_create().
Make sure the function reentrant, prepare for rpc method.

Change-Id: Ie5230e4ac6c9a750e8e779c5e0b67134729c07e3
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-13 22:07:53 -07:00
Cunyin Chang
076c7d5953 bdev: return error code when try to add duplicate nvme bdev.
Change-Id: Ifdab98324481b110442b08f03669b697d728b851
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-13 20:36:57 -07:00
Cunyin Chang
d7635243b9 bdev/nvme: replace the structure nvme_bdf_whitelist with spdk_pci_addr.
Change-Id: I6a4e4304f166fb744164ee5eb113a9185b2425b2
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-13 20:36:56 -07:00
Jim Harris
8e03aa1f3c bdev/malloc: create a malloc_task context
This prepares for future scatter-gather support.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie21c4d86c1e932dcaf63cf13d7a7198890595d79
2016-10-13 16:05:42 -07:00
Jim Harris
52d2405f70 bdev/malloc: simplify read/write return values
Return void in main I/O path, and have functions
explicitly complete the I/O back to the bdev layer
if any failures are encountered.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia729b0af555f87c2fb36b92e79a47d19a325de7a
2016-10-13 16:05:41 -07:00
Cunyin Chang
72b4cda87f bdev: remove unused field in data struct nvme_bdf_whitelist
Change-Id: Ib21ef75515277d84cb12cdb6733137cbbe2e4ebc
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-14 01:55:16 +08:00
Cunyin Chang
e1f93d26db script: Add method to construct nvme bdev
Change-Id: I0b81fca543783e918eb1cd5f0d1cb0dd0e5de69c
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-14 01:54:46 +08:00
Cunyin Chang
9d15f4bfcc bdev: Add rpc interface for nvme
Change-Id: I0de3c68dc3a02559ca5f302aa541a91ffb1ddb42
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-14 01:54:13 +08:00
Cunyin Chang
1fad9da400 bdev: add public function spdk_bdev_nvme_create().
Add public function which could be used by rpc method.

Change-Id: Id9d2938801e0acdf0f9827ef2990a54c75aec22a
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-14 01:53:31 +08:00
Tsuyoshi Uchida
0af0aa4b2e nvme: change a return value of nvme_ctrlr_cmd_format (#45) 2016-10-13 17:26:33 +00:00
GangCao
f81888b2f9 nvme: add PCI BDF in spdk_nvme_ctrlr to check whether same ctrlr
Change-Id: Ic8eb395bbfcc688e9c999a6d0026b70c24d386e3
Signed-off-by: GangCao <gang.cao@intel.com>
2016-10-13 09:50:32 -07:00
Jim Harris
2848c8d1d3 nvmf: defer start of subsystem until fully initialized
Starting the subsystem consists of firing an event
to the subsystem poller's lcore and performing
I/O channel initialization (for virtual NVMe
subsystems) before starting the poller.

Previously the subsystem would be started immediately
when created, which was before the subsystem's
mode and other parameters (such as a virtual subsystem's
bdevs) have been set.  This resulted in no I/O channels
being allocated in virtual subsystem mode.

So break out the start code into a new
nvmf_tgt_start_subsystem() function, which clients
must call after fully initializing a subsystem created
with nvmf_tgt_create_subsystem().

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I56534668887ef99d2e892844acd12194920c3245
2016-10-13 09:12:21 -07:00
Ziye Yang
89b216a2a1 bdev, rbd: Add flush support
Change-Id: I779d52b1af868c7e614faf37a50fecba65757536
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-10-13 09:09:31 -07:00
Ziye Yang
9dd0f89486 bdev, rbd: Remove the lock and introduce polling strategy
This patch removes the lock in RBD module. And it requires
the librbd library supports rbd_poll_io_events function.

Change-Id: I040a7d8369ab4f69f41d1d0233115f885168f019
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-10-13 09:09:30 -07:00
Cunyin Chang
37a7fff634 iscsi/rpc: change get_target_nodes parallel arrays to objects
This patch makes lun_name:lun_id pair as one object,
the same for the pg_tag:ig_tag.

Change-Id: Ib08450d12bde9b8388d4ae41e214cc0ba64c8b1e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-13 09:05:43 -07:00
Daniel Verkamp
5ec0b3227d nvmf/rpc: make sure NVMe device is found in create
Extend the check added in commit
7552ee5512 ("nvmf_tgt: fail if NVMe
controller is not found") to the RPC interface.

Also remove the default PCI address from rpc.py, since it is not a
useful default - the user must specify a PCI address, which will vary
depending on the configuration of the machine.

Change-Id: If9a4e19ef2a84c9d839b467abc011046613f7168
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Daniel Verkamp
4afe9d1acb nvmf/rpc: make hosts parameter optional in create
Instead of a magical "All" value for allowing all hosts, allow the
caller of construct_nvmf_subsystem to omit the "hosts" parameter.

Change-Id: I97c7ae806a0be7142fb59708d47023e42e127fcc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Daniel Verkamp
45c041449f nvmf/rpc: don't allow namespaces in direct mode
create_nvmf_subsystem should not allow the user to specify any
namespaces in direct mode.

Also remove the default Malloc0 namespace in rpc.py; the user
should be required to specify the list in virtual mode.

Change-Id: I3aaf7c64b9ceee89a3f7db15760a669527adb29d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Daniel Verkamp
0c8a5d8ce6 nvmf/rpc: rename listen_addrs -> listen_addresses
Change the output of get_nvmf_subsystems to be consistent with
construct_nvmf_subsystem.

Change-Id: I6987f6cbd916a870e9b15f0faa3cce2ed6d49795
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Daniel Verkamp
b94e0dfdb2 nvmf/rpc: represent pci_address consistently
The get_nvmf_subsystems RPC reported the PCI address of direct-mode
NVMe devices as individual integers, but the construct_nvmf_subsystem
call requires pci_address in a string format (%x:%x:%x.%x).

Change get_nvmf_subsystems to format the PCI address in the same way
that construct_nvmf_subsystem takes as a parameter for consistency.

Change-Id: I6e55e9a9e73dd425fd560d609b86a2f839c53c61
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Jim Harris
de16fcca32 nvme: fix sgl processing for single sge payloads > 4KB
For the nvme readv/writev APIs, the PRP checking logic was
incorrectly failing single SGE payloads that were larger
than 4KB.  This patch adds a test case for this scenario,
and fixes the PRP checking logic.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6357d620599666046d2cb74d7923dac1f75418c5
2016-10-12 14:51:58 -07:00
Jim Harris
68cdd81a83 test: add new ext4test
This test will create a malloc and NVMe iSCSI target node,
perform an iSCSI login, create and mount a filesystem, then
copy the SPDK contents to the mount and do a build.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I00291e6ca768dd4b685086cf1479098558b9329f
2016-10-12 14:49:49 -07:00
Daniel Verkamp
df4dbfb28c bdevio: #include <pthread.h>
Explicitly include the pthread header after removing some headers that
implicitly included it.

Change-Id: I39fe272acfcc63d3888d2430137de2c3426f1af6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-12 10:00:13 -07:00
Ben Walker
02a17e193e env: Replace DPDK atomics with gcc standard calls
Use standard GCC style atomic operations instead of
the DPDK calls. The DPDK calls end up translating
to the gcc standard inline calls in the generic
case anyway.

Change-Id: I0ea760c4e23c3660b082a803bbc174de7250f365
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-12 09:53:32 -07:00