Commit Graph

1228 Commits

Author SHA1 Message Date
Dariusz Stojaczyk
ec6a1afbdb util: add a helper function for parsing capacities (1K, 128M, 2G)
Also used it in parsing `-m` SPDK app param,
meaning that it can now accept numbers
followed by a binary prefix - like 512M or 2G.

Change-Id: If458dc08429237f2cb3f3f661bcaf382468df0f0
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/391670
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-13 21:19:53 -05:00
Jim Harris
d52dbda288 blob: rename bs_md functions
As part of clarifying the API and preparing for some
future changes, rename the following functions:

spdk_bs_md_create_blob => spdk_bs_create_blob
spdk_bs_md_open_blob => spdk_bs_open_blob
spdk_bs_md_delete_blob => spdk_bs_delete_blob
spdk_bs_md_iter_first => spdk_bs_iter_first
spdk_bs_md_iter_next => spdk_bs_iter_next

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

Reviewed-on: https://review.gerrithub.io/391031
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>
2017-12-13 13:06:16 -05:00
Jim Harris
7932847300 blob: remove spdk_bs_io_flush_channel
This function was a nop and is not needed.

lvol was calling this function when an lvol bdev
gets a FLUSH I/O, but that is not needed either.  So
lvol will now report it does not support flush.

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

Reviewed-on: https://review.gerrithub.io/391023
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>
2017-12-13 13:06:16 -05:00
Pawel Kaminski
56905c3877 test/lvol: Replace stop/start vhost with add/delete bdev
Change-Id: Ic960f2fe6966ae6eeb027a7c6a1d6929c741080d
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/388642
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-13 11:26:54 -05:00
Jim Harris
2c3591f183 blob: rename spdk blob metadata functions
spdk_bs_md_resize_blob => spdk_blob_resize
spdk_bs_md_sync_blob => spdk_blob_sync_md
spdk_bs_md_get_xattr_value => spdk_blob_get_xattr_value
spdK_bs_md_get_xattr_names => spdk_blob_get_xattr_names
spdk_blob_md_set_xattr => spdk_blob_set_xattr
spdk_blob_md_remove_xattr => spdk_blob_remove_xattr
spdk_bs_md_close_blob => spdk_blob_close

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

Reviewed-on: https://review.gerrithub.io/391006
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-12 18:36:18 -05:00
Daniel Verkamp
c2009e9e85 scsi: remove spdk_scsi_dev_print() function
Replace the single call to spdk_scsi_dev_print() with a reimplementation
using public SCSI API functions, and also using the SPDK logging
framework instead of printf().

Change-Id: Ifa455f9e6a4a07a35d5dec311a61e9a8afaa0227
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391320
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-12 18:04:20 -05:00
Jim Harris
474fcf64b2 test: remove all uses of strcpy in the code
Then also add a check in check_format.sh and fail if
a new instance is found again.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia35c343e1b7bb44b3b5f4f8484adb9e0d5702d67
Reviewed-on: https://review.gerrithub.io/390916
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>
2017-12-12 17:34:45 -05:00
Ben Walker
8b79ef3372 nvmf: Remove poll group from controller
Now rely entirely on the user to create and poll
the poll groups.

Change-Id: I66baaa2d0f493390a055a32e6c902f5e2f574534
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/385954
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
2017-12-12 15:01:17 -05:00
Daniel Verkamp
2302dc6cdc nbd: add NBD subsystem to apps
Enable the NBD subsystem and RPC methods in the iSCSI target, NVMe-oF
target, vhost target, and bdev_svc test app.

Change-Id: I1c2e53a4c031ae6d4dc0a8e698bbfa085db33154
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391014
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-12 13:36:22 -05:00
Ziye Yang
d3e600066e bdevperf: change the type of time_in_sec to int.
Since we use time_in_sec to judge < 0 case

Change-Id: I8283c8209359acfe1b1d5db8a9d4315e5722c5c6
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/391154
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-12-12 13:35:46 -05:00
Jim Harris
b9b0fee224 blob: decouple spdk_blob from its actual data
Moving forward, the spdk_blob returned to users will
actually be an I/O channel - not the blob structure
itself.  So rename the existing spdk_blob to spdk_blob_data.
spdk_blob_data will continue to contain global state for
the blob.  In the future spdk_blob will point to an
I/O channel for the blob - for now it effectively still
points to the spdk_blob_data, but by changing the
structure names here it will reduce the code churn in
future patches.

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

Reviewed-on: https://review.gerrithub.io/390900
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-12-11 15:33:35 -05:00
Ben Walker
3ef479ab16 bdev: Correctly defer completion of resets until channels are unlocked
Change-Id: I23f71ff38b805723d74aca639489e0079ecdb993
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/390341
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>
2017-12-11 14:58:17 -05:00
Daniel Verkamp
9daf838db0 test/iscsi: only run NVMe-oF test when enabled
Check the SPDK_TEST_NVMF flag before running the iscsi_tgt + NVMe-oF
host test.

Change-Id: I0d545c98f188edefc089fb79e2879d5d307726f5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391027
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-11 11:20:17 -05:00
Daniel Verkamp
59970a89be astyle: enforce braces around single-line statements
Require braces around all conditional statements, e.g.:

    if (cond)
        statement();

becomes:

    if (cond) {
        statement();
    }

This is the style used through most of the SPDK code, but several
exceptions crept in over time.  Add the astyle option to make sure we
are consistent.

Change-Id: I5a71980147fe8dfb471ff42e8bc06db2124a1a7f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390914
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
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: Jim Harris <james.r.harris@intel.com>
2017-12-11 11:19:32 -05:00
Cunyin Chang
fcccf16767 nvmf: close all the bdevs when delete subsystems.
Change-Id: Ie3c7c8d960b0074b86e983e0e8bf04de2d99f61f
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/390365
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>
2017-12-08 17:14:40 -05:00
Pawel Niedzwiecki
30dbca865b test/vhost: test for the vhost-blk readonly feature.
Change-Id: I5dde0555bd7d0e03dea3779dfd59c13ece92696a
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/382835
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-12-08 14:08:58 -05:00
Ziye Yang
e4c4fec260 bdevperf: add the shutdown callback function.
We also caculate the time for still dumping the
performance data.

Change-Id: I59b736268ca57a366666a4bf55458ec3f279f4e7
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/390702
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-08 14:08:43 -05:00
Daniel Verkamp
bedc405f35 nvmf: add duplicate QID check in I/O Connect
Disallow multiple I/O queues for the same controller with the same queue
ID.  NVMe-oF 1.0 ECN 001 specifies that this condition should return a
status value of Command Sequence Error.

Change-Id: I41126ddec388a985c403025e099ab15da5d3987c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390662
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-12-08 14:08:19 -05:00
Daniel Verkamp
fab9349fdc ut/nvmf/ctrlr: add Connect command unit tests
Change-Id: I4d3cced91e804fbbb96a15a09b575ff85960ddef
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390661
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-12-08 14:08:19 -05:00
Daniel Verkamp
2d630f9b75 ut/nvmf/ctrlr: replace stubs with mock.h macros
Change-Id: Ifd00dd647002ea226df826c558232d97d366ab81
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390660
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-08 14:08:19 -05:00
Chen Wang
1594b13993 test/vhost: Fix the lvol bdev name
The lvol bdev which used to create nested lvol store
should be $lb_name.

Change-Id: Ic8d68f8d18bcb0c1d4bca0b4612a4a07ed8b974d
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/390350
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-08 14:06:19 -05:00
Daniel Verkamp
93b71b9091 test/config: install libasan in vm_setup script
This is necessary for SPDK_RUN_ASAN to function properly.

Change-Id: I22f4e8dde225967a3db3718270c2626f178af319
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390858
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-08 12:32:56 -05:00
Daniel Verkamp
ffc0274a08 test/iscsi: initialize igs before adding to ig map
Similar to 759e5934eb (test/iscsi: initialize pgs before adding to pg
map), make sure the spdk_scsi_ig structures are zero-initialized before
passing them to spdk_iscsi_pg_map_add_ig_map().

Fixes Valgrind "Conditional jump or move depends on uninitialised
value(s)" errors in two tests.

Change-Id: I38c095aa7c6a89cb9332618b63fe12a02bcf3c2a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391000
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-08 12:31:19 -05:00
Karol Latecki
7c13831f39 test/vhost: replace remove_vhost_scsi_dev with _target
Change-Id: Ibf243d4e9804acda8ee712253722c963bb0120fc
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/390997
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-08 11:36:32 -05:00
Jim Harris
0fd9bba256 scsi: use lun instead of its name as spdk_scsi_lun_delete param
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7cf52d4d27ee3433da94a034ef320ad811ca6758

Reviewed-on: https://review.gerrithub.io/390842
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-08 09:26:47 -05:00
Jim Harris
759e5934eb test/iscsi: initialize pgs before adding to pg map
This fixes some issues found with Valgrind (incidentally *not*
found with ASAN).

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

Reviewed-on: https://review.gerrithub.io/390909
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
2017-12-08 09:26:47 -05:00
Sebastian Basierski
0709cc48c9 vhost: Switch "Dev" keyword to "Target"
Added new keyword 'Target' that will replace 'Dev'.
'Dev' is still usable, but deprecated and will be removed.

Change-Id: Iafd6114ef2cc5b2f8d58497e9fb454a3a237ed16
Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>
Reviewed-on: https://review.gerrithub.io/388568
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>
2017-12-08 09:25:49 -05:00
Daniel Verkamp
a7d816bfbe ut/scsi/dev: fix memory leak in lun_construct stub
Check if a LUN already exists before allocating the spdk_scsi_lun
structure - this matches the real implementation of
spdk_scsi_lun_construct().

Fixes: e44731d659 ("scsi: Remove the claimed flag from LUN")

Change-Id: I529648f93cd21e9f19ce82ef571cabe9c7e8c49a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390903
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-07 16:52:05 -05:00
Xiaodong Liu
f90beaeff0 nbd: add nbd as one event subsystem
Add g_spdk_nbd to record multi-nbd-disk in the
future. nbd subsystem will be used to init and
finish g_spdk_nbd and its linked spdk_nbd_disk.

Change-Id: Ia67caa57b9920d0080f8b2fa1c8e87615803e5fe
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/390097
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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-12-07 16:23:19 -05:00
Xiaodong Liu
3b9c5e9c6a nbd: put get-bdev and register-poller to lib/nbd
nbd poller is put into spdk_nbd_disk.
nbd test app no longer needs to process spdk_bdev.
This enables upcomming patches to move nbd test app
functionality to SPDK library.

Change-Id: I1b563a49dc9488e8dcc20706be82b17fdbd07ff1
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/390093
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>
2017-12-07 16:23:19 -05:00
Ziye Yang
f8dcdfa99e scsi: Make the pending tasks handling logic correct for reset
In principle, we should not have active tasks, which means
that lun->tasks should be empty. But for the exceptional case,
we may still need to handle those active tasks, to make
the scsi related application continue running instead of quit.

We should not directly call spdk_scsi_lun_complete_task since
those tasks are already sent to bdev layer. And finally, those
tasks will be return (even aborted) by call backs. So we only need to
set task status to condition, but
not call spdk_scsi_lun_complete_task directly.

Change-Id: I6af2bda0f0b1de7b0c655d2ac2980ddca48c1162
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/386817
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-07 13:43:52 -05:00
Shuhei Matsumoto
e44731d659 scsi: Remove the claimed flag from LUN
Struct spdk_scsi_lun has the claimed flag as a member.

However the claimed flag is no longer required.

Moreover the claimed flag itself is not used but
spdk_scsi_lun_claim() and _unclaim() functions are used in the
UT code by hard to understand manner. Moving the logic into
spdk_scsi_lun_construct() and _destruct() in the UT code will
be more natural.

Hence remove the claimed flag from LUN and do a little refactoring
in the UT code.

Change-Id: Ica9680b49bbdb5be7c5c4161210fb3a6dcb35229
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/390566
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-12-07 12:30:19 -05:00
Shuhei Matsumoto
50ec73894c iscsi: Support SCSI port removal when PG map is removed
Currently even if PG mapping is removed from iSCSI target,
corresponding SCSI port is not removed. Hence dynamic
reconfiguration of PG to existing iSCSI target is not supported.

This patch supports dynamic SCSI port removal when the
corresponding PG mapping is removed from the existing target.

Some refactoring for SCSI port addition is also done

Change-Id: Ib06bc10743eb088d023f425742e39bb24f1b0df1
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/389056
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>
2017-12-07 12:28:02 -05:00
Daniel Verkamp
ea1c15791f log: rename SPDK_TRACE_* to SPDK_LOG_*
Disambiguate the log components from the trace functionality
(include/spdk/trace.h).

The internal spdk_trace_flag structure and related functions will be
renamed in a later commit - this is just a find and replace on
SPDK_TRACE_* and SPDK_LOG_REGISTER_TRACE_FLAG().

Change-Id: I617bd5a9fbe35ffb44ae6020b292658c094a0ad6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376421
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-12-07 12:23:19 -05:00
Liang Yan
c1352c2147 test:update common.sh to get port IP in Ubuntu system
The get_available_rdma_ips function can't get port IP in ubuntu
system. Update the function to fix this issue.

Change-Id: I1b8a0b1159ce7919f883a21067de78d5166954b2
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/390613
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-06 18:54:49 -05:00
Changpeng Liu
7e3a11f98b nvme: add doorbell buffer config support
NVMe specification 1.3 added a new Admin command: Doorbell buffer config,
which is used to enhance the performance of host software running in
Virtual Machine, and the Doorbell buffer config feature is only used
for emulated NVMe controllers. There are two buffers: "shadow doorbell"
and "eventidx", host software running in VM will update appropriate
entry in the Shadow doorbell buffer instead of controller's doorbell
registers.

Change-Id: I639ddb5b9a0ca0305bf84035ca2a5e215be06b46
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/383042
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-12-06 17:25:54 -05:00
Ben Walker
2b768821bf blob: spdk_bs_destroy now only zeroes the super block
The function just needs to zero out metadata so that the
blobstore is effectively destroyed. If the user wants
to unmap the rest of the disk after the blobstore is
destroyed, they are free to do so. On future initializations
of blobstores the code will do the unmapping, so performance
is not impacted.

While here, implement the zeroing using the new
write_zeroes functionality instead of allocating a buffer
full of zeroes.

Change-Id: I7f18be0fd5e13a48b171ab3f4d5f5e12876023bc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/390307
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-06 17:21:46 -05:00
Seth Howell
7e4a7b62e1 Add readme and script for fedora 26 vm configuration
This readme and bash script can be used by developers to quickly deploy
a new vm in which to pretest their spdk patches.

Change-Id: I12f805e925dae9120ea8c451c9c5b07df4ffaf4b
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/387673
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-12-06 16:36:05 -05:00
Daniel Verkamp
5f0c99c018 test/vhost/initiator: specify RPC address via -r
Remove the [Rpc] section of the vhost initiator bdev.conf file and use
the bdev_svc -r parameter to set the RPC address instead.

Change-Id: Iaa5f6947b49679082f00d4c30d625ab2e5db8441
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390327
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-05 13:16:57 -05:00
Daniel Verkamp
23c568aabe test/iscsi/ip_migration: remove [Rpc] conf section
A previous commit modified this test to specify the RPC address via
command line, but failed to remove the [Rpc] section from the
configuration file.

Fixes: 59515ed6f8 ("test/iscsi/ip_migration: use UNIX socket for RPC")

Change-Id: Ibd5ac69c8e72fefc7e7b540df280d8a55b0b9946
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390326
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-12-05 13:16:57 -05:00
Daniel Verkamp
56f61c8feb bdev/pmem: require name in construct_pmem_bdev RPC
Change-Id: I3cbb52cd9a4201704423b49eae74935b8a33b0fd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389903
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>
2017-12-04 18:51:14 -05:00
Seth Howell
deb694403f test/iscsi_tgt: increase memory for nvmf_tgt app
The iscsi fio_remote_nvme test was failing because the large malloc bdev
was consuming too many contiguous hugepages and the call to
construct_nvmf_subsystem was failing on some machines. This change increases the memory
allocated for the nvmf_tgt app which solves that problem.

Change-Id: Ibc882d83c5b983baee9b004bfc0970562f7f2e1f
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/390320
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-12-04 18:47:25 -05:00
Ben Walker
e26e0e2689 nvmf: Look up bdev channel from poll group instead of namespace
Change-Id: I9afa07b5dae99955ba87d7c8130b2ce6f04e7941
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389641
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-12-04 16:02:16 -05:00
Ben Walker
c3080c5aa6 nvmf: Update poll group channel maps when a new namespace is added.
There isn't a way to remove a namespace just yet, but at least
adding one works.

Change-Id: I99416d1bc9cbc0e2303c16040d2311a07829cbea
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388293
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-12-04 16:02:16 -05:00
Shuhei Matsumoto
c5e5047d99 iscsi: Manage PG-IG maps of the target by linked list
This patch is a preparation for dynamic reconfiguration of PG-IG maps.

Current PG-IG map is implemented by a fixed-size array. Linked list
will make much easier to support dynamic reconfiguration of PG-IG maps.

Current:
target - (1..n) ---> PG_map (1..1) -> PG
                 |
                 --> IG_map (1..1) -> IG

This proposal:
target - (1..n) -> PG_map --- (1..1) -> PG
                           |
                           -- (1..m) -> IG_map - (1..1) -> IG

Change-Id: I92f668b81cdd8003aff222926f8f1ed96b61e56d
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/385532
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>
2017-12-04 14:21:13 -05:00
Karol Latecki
d07df58419 test/vhost: common.sh fixes for listing VMs
Add nullglob options where appropriate

Change-Id: If55b0b2e19a7834eaf2efc86b2c23fcc71d8b05f
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/389292
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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-04 12:48:54 -05:00
Jim Harris
d12ba75bd1 blob: add per-blob feature flags
Similar flags will be added at the blobstore level in a future
patch.

This allows backwards compatibility - i.e. allow older blobstore
applications to open blobstores created by newer blobstore
applications with new features.  Any blob's using a new feature
should have an associated flag set in one of three new flag masks:

- invalid: if a bit is set in this mask that the application is not
	   aware of, do not allow the blob to be opened
- data_ro: if a bit is set in this mask that the application is not
	   aware of, allow the blob to be opened, but do not allow
	   write I/O nor any operation that changes metadata
- md_ro:   if a bit is set in this mask that the application is not
	   aware of, allow the blob to be opened for performing any
	   kind of I/O, but do not allow any operation that changes
	   metadata

While here, bump SPDK_BS_VERSION to 3.  We intend this to be the
last change made to SPDK_BS_VERSION - future versioning will be
done via blobstore or per-blob feature flags instead.

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

Reviewed-on: https://review.gerrithub.io/388703
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-04 12:07:21 -05:00
Shuhei Matsumoto
c2f38258f9 iscsi: Remove redundant repetition from ACL
The results of access control procedure for login in the
spdk_iscsi_tgt_node_access() is defined in the following table:

   +------------------------------+
   |iscsi name |netmask  |result  |
   +------------------------------+
   +------------------------------+
   |denied     |-        |denied  |
   +------------------------------+
   |allowed    |allowed  |allowed |
   +------------------------------+
   |allowed    |denied   |next IG |
   +------------------------------+
   |not found  |-        |next IG |
   +------------------------------+

However current implementation have redundant repetition in the
spdk_iscsi_tgt_node_access() and the above definition is not
visible. Hence refactor spdk_iscsi_tgt_node_access().

Besides refactor spdk_iscsi_tgt_node_allow_iscsi_name() because
it has redundant repetition too.

Add UT code for these changes.

Change-Id: If06d87c1246c85439ee0482149bd887a7b53b169
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/379935
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-12-04 11:28:52 -05:00
Shuhei Matsumoto
1674f37ac9 iscsi: Rename access control functions of target
Naming rule of access control of iSCSI target does not reveal its
intention. Hence change it before refactoring to avoid unnecessary
repeated procedure.

Change-Id: I4064ec0a5a2b52244b6de3958ee2ab41342d1a57
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381248
Reviewed-by: Jim Harris <james.r.harris@intel.com>
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-12-04 11:28:52 -05:00
Shuhei Matsumoto
eee268fea8 iscsi: Replace "ALL" by "ANY" for access control
In the accessibility control of iSCSI target, "ALL" is used to allow
ANY IP address-port pair or iSCSI name of initiators. However iSCSI
targets cannot know ALL initiators beforehand.

Hence "ANY" will be better than "ALL" and will avoid misunderstanding.

Comments and iscsi_tgt test code are also changed and UT code is added.

Change-Id: Id004d819df6e9ee89f6c1db2e4b4c149be062733
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/385168
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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-04 11:28:52 -05:00