Commit Graph

1023 Commits

Author SHA1 Message Date
Daniel Verkamp
c20aa93181 doc: add README.md for Doxygen and online docs
Change-Id: I9af8a77ac1faccf950669f8e61c6ea4d596209c7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-03 14:23:15 -07:00
Ben Walker
db69cad95c nvme: Handle inactive but allocated namespaces
Namespaces can be allocated but inactive, which causes
the identify namespace command to fail. Handle this
case so that attaching to the controller does not fail.

Change-Id: I9d692f8e7841a9315a737b0a5e44d9b4e4484a13
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-03 13:55:56 -07:00
Daniel Verkamp
d31df7042a test/cpp_headers: autogenerate header test files
Rather than requiring changes to a static list of header files, use the
GNU Make wildcard function to generate a .cpp file per header.

This also tests whether each header includes all of the system headers
for the types it uses.

Change-Id: I05b82510b194533672568019e138d7d1aad2e86b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-03 10:24:18 -07:00
Daniel Verkamp
b827279285 net: include stdint.h for uint*_t types
Change-Id: Iceda29ed5ee7b8c9a41fd4f3ab8b3aa52b596339
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-03 08:41:37 -07:00
Daniel Verkamp
59955a12d2 event: allow unregistering a poller within its poller fn
Modify the spdk_poller_unregister() function so that it works correctly
when unregistering a poller from its own callback function.

Change-Id: I57fa5ebd8a8bad522e34f597b406a4726f1b76ad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-03 08:41:26 -07:00
Jim Harris
08a6cba2f0 util: add stdbool.h include to io_channel.h
A previous commit added use of 'bool' but did not add
a stdbool.h include.  All files including io_channel.h
already were including stdbool.h, but adding it here
so that we do not depend on that for future usages.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iaa88a0747889fe02f327059c99bc751c9ab326f7
2016-09-30 15:30:25 -07:00
Ziye Yang
c1341b0718 bdev: Add RBD support in lib/bdev
This patch will add a new bdev module, rbd.
It can make ceph rbd as the backend of iSCSI
target.

Change-Id: Id5eb3b159ee607052e3c33a2e59d721739fd9977
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-30 15:26:28 -07:00
Ziye Yang
6c4a07ecbe scsi: change spdk_put_task to spdk_scsi_task_put
Change-Id: I2598627523b2a78b68d7e7fdadbb7d8ef44592b9
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-29 15:42:29 -07:00
Daniel Verkamp
19dff91a1b scsi: replace off_t with uint64_t
These offsets are passed to the bdev I/O functions, which take uint64_t
offsets.

Change-Id: I1d597d066dfb64b6c7658906e7ee8e6fb2f8e4db
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-29 13:32:34 -07:00
Daniel Verkamp
bcd1edeae4 nvmf: replace off_t with uint64_t
The offset variable is used to store the result of a uint64_t * uint32_t
multiplication; a signed integer is not the correct type for the result.

Change-Id: If1fb22314ba7e3cec91808cc051678f809c9e58b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-29 13:27:39 -07:00
Daniel Verkamp
a87d8a45a2 iscsi: replace incorrect off_t with ptrdiff_t
This code calculates the difference between two pointers and then stores
it in an off_t, which is intended for file offsets.

In this particular case, the offset will never be large enough to
overflow off_t, but use the correct ptrdiff_t type anyway.

Change-Id: I6b159bf0286a7f5962d08b9894538f4d99c8647b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-29 13:25:32 -07:00
Daniel Verkamp
d5dffc0596 bdev: replace off_t offsets with uint64_t
off_t is problematic for use as a file/block offset: it is signed, and
on 32-bit platforms, it can be 32 bits (depending on the settings of
_FILE_OFFSET_BITS and _LARGEFILE_SOURCE).

The blockdev layer already uses uint64_t to represent offsets; replace
the blockdev module uses of off_t in internal functions with uint64_t
to match.

Change-Id: I77a2e594572c56f1cd8a7a080f985ea5b27c35f3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-29 13:13:32 -07:00
Ziye Yang
aa5c7d54d7 util: fix dev not free issue in spdk_io_device_unregister
The free function is missed for dev in spdk_io_device_
unregister function.

Change-Id: Id212344dfcde2ae4780c631e3443f530ef25cfd1
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-29 11:04:44 -07:00
Ziye Yang
8c00dca640 iscsi: add parameter to simplify process_task_completion
For process_read-task_completion, add a
new paramter and remove the duplicated code
since this function is the critical path

Change-Id: I6a56327def717ee965c701383f01d6745a8c6988
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-29 11:04:31 -07:00
Ben Walker
1ad2c3ea73 nvmf: Add support for multiple sessions per subsystem.
This feature should only be used if clients are coordinating
with one another.

Change-Id: I89a437441a7e3fbcc1e5f6efa1c8e970ade7c2ec
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-09-29 11:04:15 -07:00
liupan1111
0bde77082d Fix some cppcheck errors on lib/iscsi & lib/scsi. (#41)
Fixed error types:
 1 nullPointerRedundantCheck;
 2 unsignedLessThanZero;
 4 invalidPrintfArgType_sint;
 5 arrayIndexThenCheck
2016-09-28 13:55:56 -07:00
Daniel Verkamp
e445f16bac unittest.sh: build log library earlier
Now that the NVMe and I/OAT libraries depend on the log library, log
needs to be built earlier in the Travis-CI unit test script.

Change-Id: I189800934007fe8365cdfd5eb4cd797eed252b73
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-28 13:38:53 -07:00
Daniel Verkamp
109fc9561e test/io_channel: fix one more NULL fatal assert
This was added after the previous SPDK_CU_ASSERT_FATAL change was
merged.

Change-Id: I9d26fcd78157b6c9b232ac1e7484d0939cc90612
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-28 10:28:08 -07:00
Ben Walker
a17ad921e2 Replace RTE_VERIFY with assert
We already require the assert header from the C standard library,
so use that instead of RTE_VERIFY to further isolate DPDK
dependencies.

Change-Id: I4a718af858c88aff6080e33e6c3dd533c077b8f4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-09-28 10:15:56 -07:00
Ben Walker
29004b6738 ioat: Use log library instead of ioat_printf
Change-Id: I10a71b5c83f60d3ef1bbf83b464813405edd1938
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-09-28 10:15:56 -07:00
Ben Walker
b0e349a804 nvme: Use log library instead of nvme_printf
Change-Id: Ic9b2db9bff3a914b3e5021695287157f1e076f9f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-09-28 10:15:55 -07:00
Daniel Verkamp
9e33504370 test/bit_array: add a few more tests
Add some checks to hit paths not covered by the current tests.

Change-Id: If8e7977ab8327eacfa33657d0a167f3b935b0113
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-28 08:32:42 -07:00
Daniel Verkamp
326a0224b2 readme: convert list of features into doc links
Change-Id: I01fa93ca51576c5b356fc2193f81e210ef411908
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-28 08:20:09 -07:00
Jim Harris
32aa4fa0a3 util: add context parameter for unique I/O channels
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I296992b2e03b9b516cfd26726405e49616ad08a5
2016-09-28 07:53:47 -07:00
Jim Harris
c1e3a87bf7 util: add 'unique' parameter to spdk_get_io_channel
Some subsystems may wish to create unique I/O channels
which are not shared across all users of the same I/O
device on the same thread.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3ade3675d57338cf85b6a301285e6f392bd6cd2e
2016-09-28 07:53:47 -07:00
Ziye Yang
ff38547d80 iSCSI: change return value of spdk_iscsi_conn_free_tasks
We need to return -1, when there is still tasks. From the
usage, return 1 is wrong.

Change-Id: Ibf1b53e0be92818c73590c0b4211d34332073c74
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-27 16:34:37 -07:00
Daniel Verkamp
634786e583 test/io_channel: add to autotest and unittest.sh
Also remove libspdk_util.a from the io_channel_ut linker command, since
it already includes the tested C file directly and doesn't depend on any
other util library functions.

Change-Id: I4b3fc4d57b5af4524b53664365f6ba52686e4b80
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-27 16:32:36 -07:00
Daniel Verkamp
93c986865f test/io_channel: use SPDK_CU_ASSERT_FATAL for NULL checks
The test can't continue if a NULL pointer would be dereferenced.

Change-Id: If857057c69679de3be08c4605d15bc2b3892210a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-27 16:32:36 -07:00
Daniel Verkamp
a8cfc54e14 test/lib/scsi: add init_ut gitignore
Change-Id: I0b25963bdb2249c46aa51fb447998a185eb9368d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-27 16:25:14 -07:00
Daniel Verkamp
c85360da36 build: warn about old-style C function definitions
Fix the existing cases (all missing void in parameter lists) and enable
the warning to prevent new ones from being introduced.

Change-Id: Ieaf00b3dfd5daf1e21fcbefb124514882e8996c9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-27 16:23:07 -07:00
Daniel Verkamp
db8b791f9b build: check for warn_unused_result violations
Change-Id: I217d23b31e67752a621d6f66d601f1457fb2bc94
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-27 15:55:01 -07:00
Daniel Verkamp
bb817900c9 test/nvme_impl.h: restore posix_memalign() check
If posix_memalign() fails, it may not have updated buf, so set it to
NULL explicitly.

Change-Id: I756bdc59ec1e31987ad3e6754eec4e2194b95074
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-27 15:34:34 -07:00
GangCao
372942e569 nvme: move global request_mempool allocation into nvme_impl
The user no longer needs to create the request pool.

Change-Id: I83bb8948143d4cc961d232f9f30df3106d5e0eab
Signed-off-by: GangCao <gang.cao@intel.com>
2016-09-27 14:25:39 -07:00
Cunyin Chang
d7734d165b test: Use rpc methods to create nvmf subsystem.
Change-Id: I5db50a2db0b7096a10fb97406d51410c1678dc92
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-09-27 12:04:05 -07:00
Ziye Yang
b1e3279ae0 nvmf: change nvmf_session to spdk_nvmf_session
Make the structure definition consistent

Change-Id: If147066cee041a2a357bc7efcb1f882f914e5b42
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-27 09:57:17 -07:00
Cunyin Chang
658faa3d25 test: Add calsoft test for iscsi target.
Change-Id: Iab3b7bbabc0d327a9c834bc5dbef8c339b19817d
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-09-27 08:13:07 -07:00
Cunyin Chang
3e83ccce9f test: Add idle migration test for iscsi target.
Change-Id: I971b7b61f09902d12c63b160e8b0dd9a7eb9ef51
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-09-27 08:13:07 -07:00
Cunyin Chang
b7a5c653e7 iscsi: optimization for read process.
This patch aimed at avoid run out of large rbuf for read commands

Change-Id: Ibc42b2216e929f8dfa59cba1b32ae8d52a1a345e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-09-27 08:13:07 -07:00
Changpeng Liu
f07a666646 nvmf: check the user's Subsystem configuration is optimal or not
For NUMA architecture, you may get performance drop if your NVMe
devices and transport devices located in different socket, with
this patch, the NVMf target will print a warning message to remind
the user that your configuration is not optimal.

Change-Id: Ia6013ef95984f0ce8c7f1ca86b89c0375686a188
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-09-28 17:51:11 +08:00
Cunyin Chang
d20b90b21e nvmf: Add support for RPC interfaces.
Change-Id: I6f0fe35bf2876df181ad11294b62d64d97dcac2c
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-09-26 16:07:30 -07:00
Ziye Yang
1be062decd iscsi: Extract common statements in spdk_iscsi_append_text
Also this patch removes the unnecessary empty line

Change-Id: I2db31b88796e57298a7df59945868ee7a7750290
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-26 16:05:26 -07:00
GangCao
b9eedbf403 nvme: use nvme_malloc for calloc to share ctrlr->ioq among processes
Change-Id: I480fe43b8ac59c285999eedc2e4c2323c0401a8b
Signed-off-by: GangCao <gang.cao@intel.com>
2016-09-26 16:05:02 -07:00
Jim Harris
0babf8ce81 bdev, copy: move all I/O paths to use I/O channels
bdev and copy modules no longer have check_io functions
now - all polling is done via pollers registered when
I/O channels are created.

Other default resources are also removed - for example,
a qpair is no longer allocated and assigned per bdev
exposed by the nvme driver - the qpairs are only allocated
via I/O channels.  Similar principle also applies to the
aio driver.

ioat channels are no longer allocated and assigned to
lcores - they are dynamically allocated and assigned
to I/O channels when needed.  If no ioat channel is
available for an I/O channel, the copy engine framework
will revert to using memcpy/memset instead.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I99435a75fe792a2b91ab08f25962dfd407d6402f
2016-09-26 14:02:07 -07:00
Jim Harris
fa29c70938 test/bdevio: detach from build
With the I/O channel changes, this test needs to be rewritten
to be event-based.  bdevio uses the spdk_bdev_do_work() function
to poll for completions, which is built on the check_io functions
that are going away when we move to using I/O channels.

Do not delete the code from the tree - just detach it from the
build and the test scripts for now.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I88674988db6ccb3673faf7eb5b3e79b403059fa4
2016-09-26 14:02:07 -07:00
Jim Harris
06cf905c9a nvmf: allocate I/O channel for bdevs in virtual mode
I/O channels are not actually used for I/O yet however.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iaa3774ecacc7ec206c7c0c66e6b2f2d10c8fa785
2016-09-26 14:02:07 -07:00
Jim Harris
68ca0b6315 iscsi: allocate/free I/O channels when connections start/stop on a core
This will start testing the I/O channel allocation paths.  I/O channels
are not actually used for submitting I/O yet however.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I901402633248170324db1e2fc8fb813f7629c2b0
2016-09-26 14:02:07 -07:00
Jim Harris
b5c1e5ada7 event: allocate/free IO channel thread context in reactor
This will help catch any cases where I/O channels are not
released during shutdown.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I96cf93218026b9ef319abcf0662fe258bf75174d
2016-09-26 14:02:07 -07:00
Jim Harris
06ef766bc0 scsi: add spdk_io_channel support
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I189ea68c8550bbaeab79be36cb3c4faba7cd2f69
2016-09-26 14:02:07 -07:00
Jim Harris
746a54bef8 bdev: create new get_channel/put_channel function pointers
Also implement these functions for all of the bdev drivers in
the tree.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Idea97743d601150044b1fe2d9d76e922d46d3ee1
2016-09-26 14:02:07 -07:00
Jim Harris
eb605a8203 copy_engine, ioat: add spdk_io_channel support
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I40db1b39882b68147aee4520cbd056f99901cfe4
2016-09-26 14:02:07 -07:00