Commit Graph

5155 Commits

Author SHA1 Message Date
Ben Walker
b1ccb095e4 env: Explicitly fail calls to spdk_malloc with flags of 0
Passing no flags to spdk_malloc is not a valid usage. Instead,
just call POSIX malloc.

Change-Id: I759e2c0c0befeb4983df953edd1529d6359b4c55
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/410479
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-11 16:16:38 +00:00
John Kariuki
8b75f85f2d examples/bdev: add hello world example
This commit adds a simple hello world example that writes the string
"Hello World!" to a bdev. The example can be used on a block device
such as Malloc or virtual bdev such as the passthru vbdev. The
sample bdev.conf configuration file includes a configuration for 2
malloc bdevs and one passthru bdev on top of Malloc0.

Change-Id: I1414183e3ddfac988ef61f24b8271653ac57e7c1
Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-on: https://review.gerrithub.io/407220
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-11 15:22:22 +00:00
Daniel Verkamp
0c7dc65248 env: remove deprecated spdk_pci_get_device()
Change-Id: I4ef46aba6ee2c1aa8e0303b2376ddd52493555b8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410729
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-05-10 19:40:22 +00:00
Changpeng Liu
f3165e3df3 vhost/scsi: remove the support of "Dev" for configuration file
"Dev" was deprecated since v18.01, now we have released v18.04,
so remove the "Dev" support from existing code.

Change-Id: I54c4cf83f78d3b0fdb13e625936c889d7bfaeba9
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/409989
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@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>
2018-05-10 19:39:45 +00:00
Young Tack Jin
6442451b10 nvme: add a quirk for identify 0x2
Change-Id: I9cfc237a8514a1d323313851e14576ba2ba69077
Signed-off-by: Young Tack Jin <youngtack.jin@circuitblvd.com>
Reviewed-on: https://review.gerrithub.io/410529
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>
2018-05-10 19:38:54 +00:00
Shuhei Matsumoto
29c29ff9b6 iscsi: Add JSON config/info dump for portal group.
Support JSON config/info dump for portal group. These are added to
portal_grp.c. Text config dump is moved to portal_grp.c.

Add accesses to g_spdk_iscsi.pg_head are consolidated into
portal_grp.c to extract pg_head from g_spdk_iscsi.

Change-Id: I8c551b067c68a785eb0c7d83d695bde5f7219c2b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407850
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-10 19:38:26 +00:00
Shuhei Matsumoto
8107d04bfb iscsi: Add JSON config/info dump for initiator group.
Support JSON config/info dump for initiator group. These are added
to init_grp.c. Text config dump is moved to init_grp.c too.

Add accesses to g_spdk_iscsi.ig_head are consolidated into
init_grp.c to extract ig_head from g_spdk_iscsi.

Change-Id: I88131d248ed13e42e4da56aed8ae0edc01a65715
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407849
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-10 19:38:26 +00:00
Ben Walker
7740b02e36 nvmf: Keep track of outstanding requests
This will allow us to later quiesce all requests for
a given subsystem.

Change-Id: I50a4df9bf1f65a2fc6668295cf9978d2099f6507
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406450
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>
2018-05-09 23:31:54 +00:00
Ben Walker
16d0fbd0d6 nvmf: Statically size the subsystems arrays
The realloc breaks TAILQs inside the structures, which causes
subtle bugs. Instead, statically allocate all of the subsystem
arrays. This sets up the maximum number of subsystems to be
configurable, but does not actually expose it through the
config file yet.

Change-Id: I7347b6002b6babc0678ce59cd218a454fe3a6f88
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/410521
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>
2018-05-09 23:31:54 +00:00
Dariusz Stojaczyk
bfb73837de ut/bdev_mt: add test case for ENOMEM handling with multiple io targets
Bdev layer has been recently refactored to share
internal module channels for *all* bdevs of the
same bdev module. This makes us return ENOMEM for I/O
of one bdev if another bdev of the same module (nvme, split, etc)
is entirely saturated. This is not the behavior we want,
as these bdevs may not have anything in common.

This `issue` has been fixed just now, but to prevent
it coming back again lets add a unit test for it.

This test case creates two bdevs using two separate
io_devices and checks if ENOMEM handling is somehow common
for these two. It must not be.

Change-Id: Ic32ef4b4347b8856d4b9f91107e6f188ad67978e
Suggested-by: Ben Walker <benjamin.walker@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/409997
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-09 18:19:06 +00:00
Dariusz Stojaczyk
7ac765e66b bdev: create one module channel per io_device
Bdev layer has been recently refactored to share
internal module channels for *all* bdevs of the
same bdev module. This makes us return ENOMEM for I/O
of one bdev if another bdev of the same module (nvme, split, etc)
is entirely saturated. This is not the behavior we want,
as these bdevs may not have anything in common.

This partially reverts commit
e433001 (bdev: Put 3 types of channels in a hierarchy)

Change-Id: Ice0570f92fcaffa6301a282c53eeec8215f354fe
Reported-by: Ben Walker <benjamin.walker@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/409996
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-09 18:19:06 +00:00
Dariusz Stojaczyk
331887f7e2 test/iscsi: disable hotremove tests
iSCSI hotremove is broken. It relies on C undefined
behavior. Some bdev_io may be put after their bdev_channel
has been put (freed) and spdk_bdev_put_io may be reading
freed bdev_channel memory.

iSCSI tasks targetting hotremoved devices are finished
immediately. That's usually fine, but these tasks might
be subtasks of an r2t chain. Once subtasks are freed, their
parent task may be eventually freed as well. If the parent
has finished before the hotremoval, its bdev_io has been
assigned, so freeing the task will put that bdev_io and that's
where undefined behavior hits.

There's an ongoing work towards deferring iSCSI hotremove
if r2t tasks are present, so this test should be reenabled
once that's done.

Change-Id: I7fa741b8749d542bcabb211a0969da5d7742eda3
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/410176
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>
2018-05-09 18:19:06 +00:00
Daniel Verkamp
2aced8c74c bdev/nvme: check passthru cmd size against MDTS
We can't split passthru commands, since we don't know how they behave,
so make sure they do not exceed the NVMe controller's declared maximum
data transfer size.

Change-Id: I27845dcb04d98e5d64a93f66731e6ed9db5fbbe7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410519
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-09 17:20:11 +00:00
Daniel Verkamp
ace321df22 nvme: add API to get maximum data transfer size
Change-Id: I8573732b3049e2a5b471e5a0313e39019fdaad5f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410518
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-05-09 17:20:11 +00:00
Shuhei Matsumoto
abfed22981 iscsi: Add JSON config dump for iSCSI subsystem
Add base of JSON config fump for iSCSI subsystem in this patch.
JSON config dump for target node is already merged and it is added
to the JSON config dump for iSCSI subsystem first.

Besides, spdk_json_write_named_* APIs are applied to JSON config/info
dump for target node to reduce and clean the code in this patch.

Config dump for global parameters will be handled in different patches.

Change-Id: Iee786fbda3683c75a47c55b16d6db0235ac60896
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/406493
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: Ben Walker <benjamin.walker@intel.com>
2018-05-09 17:18:30 +00:00
Daniel Verkamp
432e5f655e nvmf: support transport data block SGL in get_xfer
Transport Data Block descriptors aren't actually used by the
RDMA transport, but this function will likely be used by
other transports in the future.

Change-Id: Ic2b6a1f3a86e350c7b7258d75964a38338bdd3b5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/409940
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-09 16:59:04 +00:00
Daniel Verkamp
60232f67e4 test/nvmf: add semicolons to avoid astyle 3.1 bug
The DEFINE_STUB macro doesn't actually need a trailing semicolon, but
adding one avoids a new astyle 3.1 bug that otherwise causes these stubs
to get reformatted incorrectly.

Change-Id: Idc281d08ba8e1ca0593442b6e4d25add25bea2d7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410068
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-09 16:58:38 +00:00
Daniel Verkamp
87295c3c2c bdev/iscsi: silence clang enum conversion warning
This assignment is converting from the libiscsi sense key enumerated
type to the SPDK one, and clang issues a warning for this case.  We know
that these enums are equivalent, so just add a cast to avoid the
warning.

Change-Id: Ie2619b3ddeda46419df1a37755125bfeb6ddf636
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/409963
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-09 16:57:12 +00:00
Chen Wang
6cfddbc71d vhost/nvme: release the dev before exit
Fix the memory leaks when construct the vhost nvme dev
using the error number of io queues.

Change-Id: Ie63e048b355d8a3d602e0da415dca279c0515a8b
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/410547
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-09 16:55:41 +00:00
Chen Wang
885160c08b test/vhost: fix the test suite name
Change-Id: Id87ace1d8f875f294252874c644572b0993ffc94
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/410533
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-09 16:53:03 +00:00
Ben Walker
6cd524d87c bdev/qos: Break out code to destroy the qos into a separate function
Minimizes a future diff.

Change-Id: Ibc68588f3da2a169863d61a3aa20f384fa33e3dc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/409747
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-08 16:57:06 +00:00
Ben Walker
fa68a0fdbd bdev: Make QoS structure a separate allocation
Future changes will rely on the ability to atomically
swap this data structure out.

Change-Id: I77b93252df63155692271b5665cc040cb83a33d0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/409224
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-08 16:57:06 +00:00
Daniel Verkamp
1d168901c6 vhost/nvme: factor out task completion function
This clarifies the bdev_io completion callbacks, since they can now
assume that they always have a valid bdev_io. All call sites that
originally passed NULL for bdev_io now set an appropriate status code in
the task and complete it with the new spdk_vhost_nvme_task_complete()
function.

Change-Id: Id74aafb28e83e135bbb0a410ff9766dc1b9ece50
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410080
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-07 20:11:02 +00:00
Sai Tallamraju
27a2d1d04d nvmf:Add RNIC HBA userspace library for FreeBSD
Change-Id: I7d929e7520007f29511299442f791038f7a4ce1d
Signed-off-by: John Meneghini <johnm@netapp.com>
Reviewed-on: https://review.gerrithub.io/409539
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>
2018-05-07 16:53:43 +00:00
Seth Howell
142221987e test/lvol: make tests python3 compatible
There needed to ba a couple of changes made with respect to integer
rounding and handling raw binary strings from subprocess calls that were
handled by default in the last version.

Change-Id: Ie0e664a577e0b0fb690058842c5dbe95b2794a26
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/409776
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>
2018-05-04 22:18:55 +00:00
Jim Harris
e8ddb060f8 blob: don't try to claim cluster 0 in recovery code
Thin provisioned blobs mark unallocated clusters with
cluster ID 0.  During recovery from a dirty shutdown,
we must not try to claim cluster 0 - we should ignore
them instead.

Fixes issue #291.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If0dd42416f5de8d9972073bf6ed44eb8bc655415
Reviewed-on: https://review.gerrithub.io/410065
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-04 22:18:03 +00:00
John Meneghini
22898a91b9 git: add .githooks to repository
- Add git pre-commit and pre-push hooks
 - To enable type 'git config core.hooksPath .githooks'
 - For for additional example hooks see the .git/hooks directory

Change-Id: I92155f4083c8547759bfbbfe4df64923548fa4d5
Signed-off-by: Ed Rodriguez <ed.rodriguez@netapp.com>
Signed-off-by: John Meneghini <johnm@netapp.com>
Reviewed-on: https://review.gerrithub.io/409577
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-04 22:17:35 +00:00
Ed Rodriguez
7af03370b0 bdev: Replace fprintf with log message
Change-Id: Ic980f3f2f04db61e3ff7ce305817eede7a09cb5a
Signed-off-by: John Meneghini <johnm@netapp.com>
Signed-off-by: Ed rodriguez <edwinr@netapp.com>
Reviewed-on: https://review.gerrithub.io/410056
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-04 22:16:53 +00:00
Aneesh Pachilangottil
696c6bc27e bdev/nvme: Increase the number of namespaces supported per NVMe device from 32 to 128
When executing construct_nvme_bdev RPC method, if the NVMe SSD has
more than 32 namespace in it, then the response is displayed as invalid.
Increased the maximum number of namespaces supported per NVMe device from
32 to 128.

Change-Id: I79491af662b8d2059ad3e0920040a44a82d50064
Signed-off-by: Aneesh Pachilangottil <aneesh.pachilangottil@wdc.com>
Reviewed-on: https://review.gerrithub.io/409926
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-04 22:16:21 +00:00
Chen Wang
1c02d2a8b5 test/vhost: update the method of function defined
Change-Id: I02b857cdbeec936c7e4502fe3e72f9156b8abdd8
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/409799
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-04 19:19:12 +00:00
Shuhei Matsumoto
9114e3a22e iscsi: Add JSON config/info dump for target node.
Support JSON config/info dump for target node. These are added
to tgt_node.c Text config dump is moved to tgt_node.c too.

All accesses to g_spdk_iscsi.target_head are consolidated into
tgt_node.c to extract target_head from g_spdk_iscsi.

Change-Id: Ibdf57c6ec9457d762c5640483b5810c9a74604ef
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407848
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>
2018-05-04 17:45:48 +00:00
Shuhei Matsumoto
24cf63c47a iscsi: Change the ordering to alloc string of options at initialization
In JSON-RPC, string is allocated unconditionally in decode operation.
Hence if string is allocated in opts_init(), it will be overwritten without
any notice.

This patch is to keep compatibility to the config file and adjust to the
upcoming JSON-RPC for options initialization.

Change-Id: I6c16f2af7f34d052aabceb5bc4ebe2fc9d82714a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407846
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-04 17:45:48 +00:00
Shuhei Matsumoto
c512303c30 iscsi: Don't ignore wrong value of parameters at initialization
In the current implementation, even if global parameters in the config file
are wrong, they are ignored and default values are applied.

Now JSON config file is under development and is a good chance to break with
past and change to reject wrong parameters.

This patch add verify() function into spdk_iscsi_initialize_iscsi_globals().

Besides, this patch fixes the return code of iscsi_initialize_global_params().

Change-Id: I708a1537746fe6ce22c36d1442f7eaf2a201830e
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/406021
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>
2018-05-04 17:45:48 +00:00
Shuhei Matsumoto
8712f366e0 iscsi: Separate set params from create pools at subsystem initialization
Change-Id: Ib540126d24a03ccd5f2a2ff01f36593f42520407
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/408452
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-04 17:45:48 +00:00
Shuhei Matsumoto
bf9806d533 rpc: Add option to get_rpc_methods RPC to output only currently usable RPCs
Change-Id: I2dca34e1acb38d953ca7ac6d2907e1ecf2f19df0
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/408420
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-04 17:45:48 +00:00
Shuhei Matsumoto
5c55a00df3 log: Make log_level and trace related RPCs callable during SPDK startup
Change-Id: I049fea136f1ea37129ec73de98fc021b4b71e3f6
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/408419
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-04 17:45:48 +00:00
Changpeng Liu
24db7333d1 vhost/nvme: remove unused get/set features data buffer
Currently Get/Set features vhost messages use 4096 data buffer, but
it does need this buffer for real usage scenario.

Change-Id: If84f795209d771670449283cef3143f3019baee0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/409613
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>
2018-05-04 16:44:03 +00:00
Changpeng Liu
2cd9f3959d vhost/nvme: move completion irq signal into IO poller context
Previously after IO is finished, we will put completion entry and
irq event notice at the same IO completion callback, for performance
consideration, move the irq event routine into IO poller context, this
can be used to implement interrupt coalescing feature in future.

Change-Id: Ic20b50af47b73ffcb91938802e18b316c07a4d11
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/408943
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-04 16:44:03 +00:00
Changpeng Liu
cb094a03f0 vhost/nvme: ensure the completion queue is not full before post cqes
Change-Id: Iadab3e8f1613a5e13e5a2712f30b714929637a30
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/408775
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>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-05-04 16:44:03 +00:00
Pawel Wodkowski
ebedb9fd25 vhost_nvme: fix info dump
For namespace we need to use array of objects. Remove useless check for
bdev != NULL as this is already guarded by ns_active.

As we are here also switch to new JSON named API.

Change-Id: If8ab15c63ea015731829276e06e5cb5a801620d2
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/409025
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-05-03 22:12:18 +00:00
Ziye Yang
cbbec6dd16 nvmf: make each io qpair recycled by its own thread
This patch selects part of commit:
adfa9f6dc7

In the previous patch, the failed reason is the logic
that admin qpair actively destroys the ioqpair when
the admin qpair is recevied early. For this part,
we need to investigate it later since for multiple core
usage in our current handling case, we possibly have
admin qpair firstly to enter the destruct phase even if
the initiator sends the I/O qpair deletion first. Thus,
the ioqpair deletion can be recycled twice.

And this patch is selecting the part of the logic:
only to make each ioqpair recycled by its own thread.

Change-Id: Ic9cc3fbdf56fa8a75cb5d12a16ce6c3129220bca
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/409363
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-03 21:33:15 +00:00
Seth Howell
86ee572b79 autobuild: On FreeBSD, install the contigmem driver
The contigmem driver is built with dpdk and frequently updated. We
should copy this driver each time we build dpdk in order to maintain
support for FreeBSD

kldload checks the sysctl variable kern.module_path when deciding which
modules to load. Since the values stored in this variable are not
determined by our program, I chose to copy the module to both common
directories for kernel modules in FreeBSD.

Change-Id: I2d439a9cbac5bebb79e6ee48bec47409bb215be9
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/409250
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>
2018-05-03 19:49:53 +00:00
Shuhei Matsumoto
28589dbbe8 rpc: Add start_subsystems_init RPC to start subsystems when -w option is used
RPC state of the RPC server, g_rpc_state is set by spdk_rpc_set_state(state).

If the command line option '-w' is specified, g_rpc_state is initialized to
SPDK_RPC_STARTUP. Otherwise, g_rpc_state is initialized to SPDK_RPC_RUNTIME.

When g_rpc_state is initialized to SPDK_RPC_STARTUP, SPDK start RPC server
and wait for start_subsystems_init RPC.

When SPDK receive start_subsystems_init RPC, SPDK start initialization of
subsystems. The RPC waits for completion of initialization of subsystems.

When SPDK completes initialization of subsystems, SPDK change
g_rpc_state to SPDK_RPC_RUNTIME and then start application.

Upcoming new RPCs to initialize options of NVMf-tgt and iSCSI-tgt will be
able to be allowed before start_subsystems_init RPC is called.

Change-Id: I4fa9c22b64e2fdbc9b9fdb2c47f0018f73f84f7e
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/406919
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-03 19:48:15 +00:00
Shuhei Matsumoto
e008db08e7 rpc: Add state_mask to each RPC method to make sets of RPCs
Add state_mask to each RPC method and state to RPC server, respectively.
State mask of RPC method is set at registration. State of RPC server
is changed according to the state of the SPDK.

When any RPC method is recieved, if the bit of the RPC server is on in
the state mask of the RPC method, it is allowed. Otherwise, it is
rejected.

When any RPC is rejected by state_mask control, the new error code
is returned to describe the error clearly.

Change-Id: I84e52b8725a286e9329d61c56f498aa2c8664ec1
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407397
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-03 19:48:15 +00:00
Liang Yan
cc87019ab6 vhost:Update the device config in vhost.conf.in
Change-Id: I4d0bf222600437221b017533604876b8d6c717e1
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/409797
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-03 19:46:59 +00:00
Jim Harris
9f872d2040 bdev_svc: do not unaffinitize thread if core mask specified
This keeps original behavior, allowing scheduler to move
the thread if no core mask was specified - something the
in-tree test scripts do now.  This original behavior made it
easier to just start bdev_svc as a dumb background process to
speed up nvme test programs running as secondary processes.

But if the user wants to specify a core mask to use bdev_svc
for other purposes, we shouldn't unaffinitize the thread.

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

Reviewed-on: https://review.gerrithub.io/409774
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-03 19:46:48 +00:00
Seth Howell
de139e8c8b rpc: truncate num_blocks in create_pmem_pool
Python2 implicitly truncated the division of pool_size/block_size. If
there is any remainder in pyhton3, the value stored in num_blocks is
kept as a float. The cast to integer truncates this division resulting
in the same behavior between python2 and python3

Change-Id: I0a04bba7f3a74d12890498494bf9e58abb698b77
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/409744
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>
2018-05-03 19:46:28 +00:00
Dariusz Stojaczyk
90dfc392cc event/reactor: take into account ring metadata size in event mempools
See previous patch for some background.

rte_mempool uses the following formula for its ring allocation size:
```
count = rte_align32pow2(mp->size + 1);
sz = sizeof(struct rte_ring) + count * sizeof(void *);
sz = RTE_ALIGN(sz, RTE_CACHE_LINE_SIZE);
```

With count==262144, rte_mempool was trying to allocate
(2MB + sizeof(struct rte_ring) physically contiguous memory.

Change-Id: I69e8cdcbcaaaa8a053540588afa6eb2fd36c525b
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408926
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-03 19:46:11 +00:00
Pawel Wodkowski
f23c48d59b vhost_nvme: add JSON config dump
Change-Id: Iaed49c2bef3f3f16e07c9a0c80106f3bec7cac09
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/409024
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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-03 19:45:42 +00:00
Dariusz Stojaczyk
14cf1ad3ac bdev/virtio/scsi: validate bs and num_blocks before creating a bdev
This becomes especially useful when accidentally
trying to use vhost-blk socket as a vhost-scsi one.
There's no SCSI/Block identification within the protocol,
so blk messages can be interpreted as scsi ones.
This usually results in a bdev being created with
bs==0 && blocksize==0 and leads to a crash.

Nevertheless, this extra check should be here to protect
against malicious/incomplete vhost-scsi targets crashing
entire initiator apps.

Change-Id: I06cfe3852c35fbd3e6a9f9a337a5abe5febaddf2
Signed-off-by: Dariusz Stojaczyk <darek.stojaczyk@gmail.com>
Reviewed-on: https://review.gerrithub.io/409671
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>
2018-05-02 22:10:39 +00:00