Commit Graph

819 Commits

Author SHA1 Message Date
Daniel Verkamp
ce4fcbce71 nvme: add I/O qpair creation options
Add a new struct spdk_nvme_io_qpair_opts to allow the user to override
controller options on a per-I/O qpair basis.

Existing callers with qprio == 0 can be updated to:

  ... = spdk_nvme_ctrlr_alloc_io_qpair(ctrlr, NULL, 0);

Callers that need to specify a non-default qprio should be updated to:

  struct spdk_nvme_io_qpair_opts opts;
  spdk_nvme_ctrlr_get_default_io_qpair_opts(ctrlr, &opts, sizeof(opts));
  opts.qprio = SPDK_NVME_QPRIO_...;
  ... = spdk_nvme_ctrlr_alloc_io_qpair(ctrlr, &opts, sizeof(opts));

Change-Id: I8ac3ea369535cfde759abbe75e1d974b6450a800
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369676
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-18 18:33:20 -04:00
Ziye Yang
8b6f5d54db bdev,test: move common gpt partition code to autotest_common.sh
Change-Id: I261e6ed578335ab091973f7546035e63a00dbbf4
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/369735
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-18 13:45:51 -04:00
Seth Howell
f03f5e7de8 iscsi: change iscsi_bhs_scsi_req variable names.
These variable names are changed to retain conformity with astyle 3.0.1. Astyle 3.0.1 recognizes 'final' as a keyword and incorrectly formats the iscsi_spec.h file breaking the build. Names were changed to avoid this case and maintain consistency within the struct.

Change-Id: I39c29d768c0ddfd459a9e9212c29cf564dad1963
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/369905
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-18 13:14:16 -04:00
Liang Yan
fe84b2eb02 test/blobfs: test file creation in async mode
Change-Id: I155d956b0492120bf1b0194d0e7303d781bcdb25
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/365106
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-17 18:20:25 -04:00
Daniel Verkamp
0d9842813f test/iscsi: remove gen_nvme from FIO test
The iscsi_tgt fio test script called gen_nvme, but it never actually
used any NVMe bdevs, only Malloc.

Change-Id: I1a4eb16a4aa48f7f5de7a292c2e06a7a1711e181
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369495
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-14 19:35:44 -04:00
Ziye Yang
36a0d1e5d1 test, blockdev: simplify the if statement
Change-Id: I88b4e91181ef87264a71bcbddb56d7a71cc0b084
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/369542
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-14 16:02:44 -04:00
Jim Harris
be9a3b9f69 bdev: pass descriptors for I/O operations
This enables checking permissions - for example,
spdk_bdev_write will fail if the descriptor was not
created with write permissions.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I68b65a560f471f2e0f71a7f42cfa6689b911110f

Reviewed-on: https://review.gerrithub.io/369493
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-14 13:31:30 -04:00
Jim Harris
f71447e80d bdev: remove differentiation between bdev and vbdev modules
We still will sort the bdev_module list so that modules
with an examine() callback are initialized first.  This ensures
they have a chance to initialize before later modules start
registering physical block devices.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I792cfb41b0abe030fe2486a2c872cbf329735932

Reviewed-on: https://review.gerrithub.io/369486
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-14 13:31:30 -04:00
Jim Harris
4fc7e66614 bdev: add vbdev claim/release semantics
vbdev modules still open/close bdevs as normal, but
should open bdevs read only when tasting (i.e. reading
the GPT to see if there are SPDK partitions).  When
a vbdev module is ready to claim the bdev for purposes
of creating virtual bdevs on top of it, it calls
spdk_vbdev_module_claim_bdev().  It can pass its
open descriptor as well to have it promoted to
write access (required for future vbdev modules like
logical volumes).

Note: error vbdev was changed to copy the base bdev
parameters one-by-one instead of a blind memcpy - we
do not want to copy the base bdev's vbdev_claim_module
into the new bdev!

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If2ee67dc78daf96050343c473671aa3402991bb1

Reviewed-on: https://review.gerrithub.io/368628
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-14 13:31:30 -04:00
Jim Harris
86af2ae59f test/bdev: do not hardcode sgdisk directory
At least on Ubuntu, sgdisk gets installed to /sbin, not /usr/sbin.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I59c806d2c93c6a1773aea11d6fc669e3df0e3c08

Reviewed-on: https://review.gerrithub.io/369304
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-14 13:31:30 -04:00
Daniel Verkamp
e283c385e7 iscsi: fix AHS handling
Previously, we had a pdu->ahs pointer that was always NULL (never set
anywhere), and we would try to read data into this NULL pointer if the
initiator ever sent a PDU with a non-zero TotalAHSLength.

Rename the existing ahs_data array in the PDU to just "ahs" to minimize
the necessary changes.  We never actually dereference the ahs structure,
so its type is not important. (We can cast it later if we add support
for anything that requires an AHS.)

Change-Id: I10d19a6e0d99f326794cbe6469eacedadc634c67
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369315
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-14 11:14:21 -04:00
Karol Latecki
86538ffa24 test/vhost: remove tee pipe from vhost start command
Also restoring vhost block tests in autotest.

Change-Id: Idc6a3068650ce28636f4709df5a51029bfddbcdd
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/369470
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-13 19:18:18 -04:00
Daniel Verkamp
2c28fa5426 test/json_util_ut: assert that string is valid
Make sure the output.my_name pointer is not NULL before calling memcmp()
on it.  Fixes static analysis warning about a potential NULL pointer
dereference.

Change-Id: I85faf57c63b0760c4f90d9ee99f6d7e3df121211
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369264
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 18:13:23 -04:00
Daniel Verkamp
cb29ce869f bdev/gpt: dump partition name
Change-Id: I1899a47fa9d9821c16ea648bbe3290f6306d0e3d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368626
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 18:12:52 -04:00
Daniel Verkamp
429672d31b json: add function to write UTF-16LE strings
spdk_json_write_string_utf16le() writes a UTF-16LE string to a
JSON write context.

Change-Id: I413ffb8a3dee6e1b44ec96ce2415fd1b9c36320f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368625
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 18:12:52 -04:00
Daniel Verkamp
229f64942d test/bdev_ut: fix build with --with-vtune
Change-Id: Iaed5e670bef4ef5e588c9df4858f4d1ff240df58
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369273
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <roman.sudarikov@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 18:11:50 -04:00
Dariusz Stojaczyk
fa15dc611a scsi: removed dev->maxlun field
This variable was misleading and unnecessary. Replaced all it's
occurences with SPDK_SCSI_DEV_MAX_LUN.

Change-Id: Iaaf9ed5efb60f9a89585121d2fbec7b43c3723e9
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/368115
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 13:16:55 -04:00
Jim Harris
e075a3dc7a bdev: track number of outstanding examinations
Add a new spdk_vbdev_module_examine_done() API which
vbdev modules can use to notify the generic bdev layer
once a base bdev examination is complete.

This is especially required for asynchronous vbdevs
like GPT which must issue I/O to the base bdev.

As part of this patch, add examine callbacks
for both split and error, which for now only call
this new functions.  Later patches will move code from
the init callback to the examine callback for these
modules.  examine callbacks are now required for all
vbdev modules.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I49f2d012d1675b878bcd23afff427c740c6502c7

Reviewed-on: https://review.gerrithub.io/368831
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-12 12:42:56 -04:00
Jim Harris
be2cb0c535 test/bdevio: add delay before starting unit tests
This is a bit of a workaround for some upcoming changes
where bdev subsystem initialization will not wait for
all vbdevs to finish tasting all bdevs that are registered.

We need to allow those vbdevs to clean up after themselves
after doing their initial tasting, before we start the
unit tests, since the unit tests are blocking and won't
return to the reactor loop to allow asynchronous tasting
I/O to get returned to the vbdev modules.

Eventually we should consider modifying bdevio run
asynchronously, maybe including removing its use of CUnit
for test reporting.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6c425dd2711ce06fb6df1678f08294d6228c9ae4

Reviewed-on: https://review.gerrithub.io/368616
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-12 12:42:56 -04:00
Jim Harris
4794c791de bdev: add pointer to module structure
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic3051b63942770e45be22af0ae03a78a7c543f81

Reviewed-on: https://review.gerrithub.io/368597
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-12 12:42:56 -04:00
Daniel Verkamp
4e003b6714 jsonrpc: allow asynchronous request completion
Move the per-connection send buffer into each request, and allow a
connection to have a queue of responses ready to be sent.

Change-Id: If6b2151691c4cd76f3cf7cde0cdd8f20cac77ceb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368470
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-12 12:10:31 -04:00
Daniel Verkamp
977fd23033 jsonrpc: dynamically allocate request object
This will be necessary when the lifetime of a request can exceed the
lifetime of the values stored in spdk_jsonrpc_server_conn.

Change-Id: Icd9772eb142e3f6ae69303aff1e12bc213f435a4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368455
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 12:10:31 -04:00
Daniel Verkamp
35d46267b8 jsonrpc: remove support for batch requests
This will greatly simplify the implementation of asynchronous requests,
and asynchronous requests also allow clients to submit multiple
overlapped requests, making batches unnecessary for executing multiple
RPCs at once.  Additionally, our RPC client (scripts/rpc.py) does not
use batch requests.

Change-Id: I2529793c54b43acbacd934d82926aa32e286210c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368449
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 12:10:31 -04:00
Daniel Verkamp
ac4398a31d log: set print level when enabling tracelogs
The default print level used by the apps is SPDK_LOG_NOTICE, which will
prevent the tracelogs from being shown.

Change-Id: I5f136e8aa0be0aa7634c7dd72231f2c23b129e51
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368803
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-11 18:02:47 -04:00
Karol Latecki
5dd160bde6 test/vhost: Modify wait time for vhost start in fiotest
Look for open RPC port instead of issuing "sleep" for a
number of seconds.

Change-Id: Id75476ae3d6c39de7f7da2c0878d251384c2bb65
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/364974
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-11 17:27:30 -04:00
Karol Latecki
0abf67ce31 test/vhost: add vhost block option to fiotest
Allow running VMs in fio tests with vhost-block instead of
vhost-scsi.

Change-Id: I89ee437264ddcda0aaefdb71744cee6ce7d451d8
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/365808
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2017-07-10 19:18:16 -04:00
Daniel Verkamp
b509410cb1 nbd: add -t tracelog flag support
Adjust the usage() output so it matches the spdk_tracelog_usage() style.

Change-Id: I2555b7587ebb9a891a08412f045d94f980cd1255
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368802
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-10 18:36:00 -04:00
Ben Walker
58b9ea3ac0 nvme: Simplify the multiprocess tests
Nearly all tests now make extensive use of the stub application,
so they're effectively all testing multiprocess all the time.
Further, we believe it to be the best policy to not attempt
to support scenarios where the primary process crashes unexpectedly.
We consider this equivalent to a kernel panic and all of the
processes will need to be halted and restarted.

Given the two things above, we can make some fairly dramatic
simplifications to the NVMe multiprocess testing. Only
one piece of functionality - multiple simultaneous secondary
processes - was not already tested by the other regular
tests. This patch removes all other multiprocess tests
and adds a simple test of multiple secondaries.

Change-Id: If99f85913b99862f02c3815ea7c10cd80ea3ce02
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/368208
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-10 17:25:53 -04:00
Daniel Verkamp
782b0f1a75 bdev/gpt: dump partition type and unique GUID
Change-Id: Ibb28b8432c94e70f522bdf34c5f4a10e4c25a8bb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368610
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-10 15:36:52 -04:00
Daniel Verkamp
17c5ef7ab0 bdev/gpt: fix UUID/GUID typo
These are UEFI-style GUIDs in little endian byte order, not standard
UUIDs.

Change-Id: I4d61afa2901830c784c24a5e039bba1d98f32e62
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368609
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
2017-07-10 15:36:52 -04:00
Daniel Verkamp
1c9e37f71d bdev/gpt: SPDK GUID should be in partition type
Fix the partition type GUID comparison to actually look at the partition
type GUID, not the unique per-partition GUID, and fix the test to match.

Change-Id: Ie64f1effcc75883f17ccf6240f6469161d2a5aa5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368606
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-10 15:36:52 -04:00
Isaac Otsiabah
6fb1ce422e update_firmware: Allow option to download and enable firmware image.
Support both SPDK_NVME_FW_COMMIT_REPLACE_IMG and SPDK_NVME_FW_COMMIT_REPLACE_AND_ENABLE_IMG.
Return code will specify if conventional reset is required.
For now, return error if subsystem reset is required.

Change-Id: I41a05675a210dd0bbf170517b32ee9e05da9a797
Signed-off-by: Isaac Otsiabah <iotsiabah@us.fujitsu.com>
Reviewed-on: https://review.gerrithub.io/367287
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-07 17:12:57 -04:00
Ziye Yang
7d101fe6c6 blockdev, nvme: Test parsing device exported by NVMe-oF in conf
Change-Id: I9fbb1dc5a487323af099d08ab466fc811f7be79e
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/366703
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-07 13:23:24 -04:00
cunyinch
f2b26eb113 bdev/error: Add support of "reset" for error injection bdev module.
Change-Id: If4cd8392a958eff7bda424b4bde3d48d833cef40
Signed-off-by: cunyinch <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/363682
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-06 15:02:06 -04:00
Daniel Verkamp
2bdec64fbf jsonrpc: modify API to pass request to handler
This will enable asynchronous request handling in a future patch, and it
also removes the need for the RPC handlers to know about request id and
the JSON-RPC rules about notification-only requests.

Change-Id: I25aaa8e48bff8d5594ffcccecb61842b1e31ec3c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368225
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-06 13:48:12 -04:00
Ziye Yang
26d6770f1c GPT: add GPT bdev support
Change-Id: I6a138e1c1d775e8c8bfeede9600f8b0f799ecdad
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/362445
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-06 13:44:37 -04:00
Ziye Yang
5d12c41586 nbd: Add bdev_rpc lib
Add this lib, we can support rpc for bdev module

Change-Id: I21275c14c06787b6c0639170e52f08cae9ae3154
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/368283
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-06 13:44:37 -04:00
Ben Walker
ad474e95bb log: Remove configurable log facility
Always use "Local7" internally. We want the log API
to be generic instead of syslog specific.

Change-Id: I021f719e90c236f123fa1cadebc0c199b87ba077
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365295
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-05 19:28:29 -04:00
Daniel Verkamp
cbe5074056 test/nvme: fix "ExIT" typo in trap statement
Change-Id: Ia9ea94a1dc4e583710374d453302319aa59ce62a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368206
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-05 18:49:02 -04:00
Jim Harris
57d174ff67 bdev: add spdk_bdev_open/close
Retire the old claim/unclaim semantics in favor of
open/close.  Clients must now open a bdev to get
an spdk_bdev_desc, then pass this desc to get an
I/O channel.

This allows multiple clients to open a bdev,
although only one may open a bdev with write
access.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4d319f1278170124169a8a75fd791e926b3f7171

Reviewed-on: https://review.gerrithub.io/367611
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-05 18:04:28 -04:00
Dariusz Stojaczyk
57f9221fab scsi: added spdk_scsi_dev_has_pending_tasks()
Added new function in preparation to implementing device hotremove.

Change-Id: I5b85f76f543b882acf3b0fe40c9e92125594b257
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/366725
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-05 17:11:55 -04:00
GangCao
5066e52d63 nvme: subnqn is case sensitive and update the unit test
Change-Id: I43337b4a51cb2008737ed9a9691707a9bfb04c5c
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/367146
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-05 16:09:20 -04:00
Paul Luse
6052d9a432 nvme.sh: add delay after app startup when they are primary
A short delay is required between starting up a primary and
secondary process with DPDK depending on what the secondary
depends on wrt the primary. As the SPDK sample apps are not
designed to be dependent on each other, when we use them
as primary/secondary in test scripts with no deterministic
synchronization, it is possible for one ore more to hang
resulting in DPDK fatal init failures. Often times this would
show up as a failure to get hugepages in vtophys

A related fix, same failing signature in the same test script,
is also included here where the stub app, which is designed
to act as primary in certain sections of the test script, was
being killed by the test script but the next primary app was
coming up before the process was dead and coming up as a
secondary. A wait was added to assure that the stub process is
gone before the next app tries to start.

Change-Id: If2f6fc25e76b769ad8edafa8e965be246e98dab9
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/367725
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-05 15:40:10 -04:00
Daniel Verkamp
12d75f6323 mock: move MOCK_SET{,_P} semicolons to call sites
This makes them look more like regular function calls and keeps the
coding style consistent.

Change-Id: I019980bb381abb0dec0aae041340a44bbffe23f3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368205
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-05 15:36:49 -04:00
Jim Harris
7f6c737a25 bdev: add virtual to base bdev relationships
Each virtual bdev now has a pointer to its base
bdev, and a base bdev has a pointers to any virtual
bdevs built on top of it.

Also add a new set of leaf iterators, to get only
bdevs that have no virtual bdevs built on top of
them.  These iterators are now used by the bdevio and
bdevperf utilities, in advance of the claim/unclaim
semantics getting removed in a future patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I669783764407cdd4920b5ee121959e2a58c8d436

Reviewed-on: https://review.gerrithub.io/367610
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-05 15:09:46 -04:00
Jim Harris
4ee51dcbc7 test: add unit test framework for bdev.c
No actual tests in this patch - just getting the
framework in place including necessary stub
functions to get the bdev.c unit test file to link.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic54001de814740a2049c7bbc6846d98c5a62a8b3

Reviewed-on: https://review.gerrithub.io/367625
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-05 15:09:46 -04:00
Daniel Verkamp
b0e128db3d nvmf/rpc: add adrfam to listen address
This allows the user to optionally specify the address family for
construct_nvmf_subsystem (default is IPv4).

Note that the RDMA transport still only supports IPv4 because of the way
it binds to the listen address; this will be fixed in a separate patch.

Change-Id: I534ed75f6f81e53559d1bebcd2f34f1a2b210a97
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/367429
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-05 13:01:20 -04:00
Tomasz Zawadzki
ca2a1f291f json/test: remove executable permisions on unrelated files
This patch removes executable flag from couple files
that should not have it.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib4287ec3763a4187a756c18845c61d8b50729820
Reviewed-on: https://review.gerrithub.io/368042
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-05 12:08:05 -04:00
Paul Luse
043d541132 tests: macro-ize the creation and use of wrappers and stubs
Includes macros for wrappers (for syscalls) and stubs
(for SPDK functions) including an example of syscall
wrapper as well as a stub with both pointer and non
pointer values.

Change-Id: I9b19d81d5b9cbf2bbb327f58dbf985b3b253e800
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/366348
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-05 12:00:34 -04:00
wenzhong wu
b5e9e92934 test/lib/nvmf/direct: test function direct_ctrlr_admin_identify_nslist
Change-Id: I3fc2c2c76ec6046120b6aa784659e5faedc24b1d
Signed-off-by: wenzhong wu <wenzhongx.wu@intel.com>
Reviewed-on: https://review.gerrithub.io/361887
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-30 17:44:03 -04:00