Commit Graph

3685 Commits

Author SHA1 Message Date
Daniel Mrzyglod
30dfc6d505 scripts/vagrant: add vagrant-libvirt provider
This patch add another provider for libvirt.
There are still few additional problems in vagrant-libvirt like:
-most recent vagrant-libvirt (0.0.39+)
-most recent qemu 2.10+
-must be run as: vagrant up --provider=libvirt

Change-Id: I6ad3497cd06bb1a490259c0afc93c6ea610967f8
Signed-off-by: Daniel Mrzyglod <daniel.mrzyglod@gmail.com>
Reviewed-on: https://review.gerrithub.io/389551
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 17:36:45 -05:00
Ben Walker
55a624ed09 nvmf: Rename variables from rdma_qpair to rqpair
Some places used the convention 'rqpair' and others
'rdma_qpair'. For consistency, name them all 'rqpair'.

Change-Id: I131833d14efdfdbcbb99bea5d64cbcf99d9ec90b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389649
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>
2017-12-04 16:02:16 -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
d0733ff3b7 nvmf: qpairs now point to their poll group instead of thread
There is a 1:1 correspondence between the two, but it is much
more useful to have a pointer to the poll group.

Change-Id: I8494b0573a9b2cce5819545548d0c65a18bdbe86
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389640
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>
2017-12-04 16:02:16 -05:00
Ben Walker
d5268e6c25 nvmf: Move spdk_nvmf_poll_group_[add|remove] to public API
These aren't used quite yet, but they'll need to be called
by the user's application.

Change-Id: Id1fc44859350451a3e224f725add60d3a878d077
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389639
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>
2017-12-04 16:02:16 -05:00
Ben Walker
ac4870ffa1 nvmf: Move type declarations to top of nvmf.h
Gather all of the type declarations at the top for
clarity.

Change-Id: I447fb9b1ad43fe91ef3fffcbb4e109c56a0b90eb
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389638
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>
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
Dariusz Stojaczyk
48aced6ebc virtio: move virtio_dev allocation to upper layers
This allows the to use a virtio_dev allocated as
a part of bigger struct - possibly a SCSI/BLK
specific wrapper.

As a part of this refactor, multiple vdev-related
functions have been renamed to keep the API clean.

Change-Id: If84bf03e4a1642869c2f1ba93939fb32c8fb5d57
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/388298
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 15:03:43 -05:00
Paul Luse
04f528938d bdev-virtio: add test unit ready and start/stop to scan sequence
Tested with bdevio, hardcoded TUR response to test the start/stop
unit code

Change-Id: I5038e6bcce9fcd423f1b93c8bb8b466ee3817654
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/387183
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-04 14:39:27 -05:00
Cunyin Chang
e0ba4da0b1 bdev/null: unregister the null bdev when app exit.
Change-Id: I4f5bbf1f1d271faec80ef5fdb0e551ee1649ef7e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/389922
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-12-04 14:36:56 -05:00
Daniel Verkamp
a5be238025 bdev/malloc: use spdk/queue.h macros for bdev list
Change-Id: I4966d19b06d37bbcf4527cbd9c206e9a553e8fd2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390083
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-04 14:36:19 -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
Xiaodong Liu
c45a589901 nbd: avoid payload malloc when its size is 0
Some nbd io type has no payload, like NBD_CMD_DISC.

Change-Id: I17babf625f51d32bf07fa7a9b6a7396660b39cd5
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/389779
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-04 11:55:12 -05:00
Shuhei Matsumoto
863eb9e04e iscsi: Remove gropu_state from IG and PG
By supporting the management based on linked list for PG and IG
the group state of PG and IG are no longer necessary.

Change-Id: I249424cacd2d27dda4e4cb2182442d0d1e9bfb8e
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/388863
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
Shuhei Matsumoto
f4e892fe14 iscsi: make target management thread-safe by linked list
Current fixed sized array for iSCSI target is not thread safe.
When newly created targets are inserted into the array, multiple
targets may be inserted into the same position. Linked list is
better than fixed size array to support dynamic reconfiguration.

Change-Id: I4db5a3ec16844db06e0cfcd2aef1f97952f15afa
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/385371
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
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
Jim Harris
42e0a6531f doc/vhost: make some updates to vhost documentation
1) Rename to "User's Guide".
2) Link to @ref getting_started.
3) Note that QEMU 2.10 now supports userspace vhost-scsi, and
   the SPDK patches are only needed for vhost-blk.

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

Reviewed-on: https://review.gerrithub.io/389412
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: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-12-01 17:13:25 -05:00
Cunyin Chang
7b02b40282 bdev/malloc: unregister the malloc bdev when app exit.
Change-Id: Ifca98f355b3a5ac65831843945cb2998429c6f59
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/389921
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-12-01 17:10:09 -05:00
Pawel Kaminski
3effc335eb test/lvol: Check if lvol store exists after vhost reboot
Change-Id: I65c25842b9e965ea0816f9dfc8ef62b820da001e
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/388813
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-01 17:08:35 -05:00
Pawel Kaminski
08ff0eaa9e test/lvol: Check if lvol store is removed after vhost reboot
Fix: Add condition to some test cases
because there are more possible return values
in check_get_lvol_stores function.

Change-Id: Id035d1edc52252f009277c9afd5f07f8875e0dcc
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/388242
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-01 17:08:35 -05:00
Daniel Verkamp
5c40019fcc doc: add 'sudo' to pkgdep invocation
Also add a small description of what the script does.

Change-Id: I8a9373d204e7abc83772b5d5a95de30ca260dd7c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389916
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-12-01 17:08:12 -05:00
Changpeng Liu
d557196414 vhost: move spdk_vhost_init/fini to vhost library
Althrough the two functions are empty now, but they are not
vhost_scsi specific.

Change-Id: I331a455374f7dd92fd76cab255a43072baceb0dd
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/389477
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-01 17:07:45 -05:00
Cunyin Chang
a2b1035349 log: add helper function to get log name.
Change-Id: Ie1d58f98e0b049edf2fb9eb95649a55d33061a91
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/389673
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-01 17:07:19 -05:00
Daniel Verkamp
47dc18d2d3 bdev/null: free Null bdev names on shutdown
Use the existing bdev_null_destruct() function instead of open-coding
the bdev cleanup; the bdev_null_finish() path neglected to free the bdev
name.

Change-Id: Ie74be39b0475674f70c3999bbe2f21caab2e2e20
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389867
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-12-01 17:03:35 -05:00
Daniel Verkamp
c0cf813e11 test/nvme: disable AER in nightly tests
Currently, the nightly tests are hanging due to the AER test program,
which waits for a temperature threshold event to occur.  The QEMU
emulated NVMe controller (as well as the SPDK NVMe-oF target virtual
controller) don't emulate this condition, so the test never finishes.

Change-Id: I41a216f77ffbb3beaef2fdf7533fe62c36033fc6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389908
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-12-01 17:00:54 -05:00
Cunyin Chang
89dedde148 bdev/pmem: unregister pmem bdev when app exit.
Change-Id: I6ad0d74df8a445700fdb55531e496d8fb8df8132
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/389923
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-12-01 16:44:57 -05:00
Ben Walker
ad876c00d3 nvmf: Add a channel map to the poll group
As of this patch, it is unused.

Change-Id: I15f42b8cc43e3792ae69c91f3911b7853d5b5664
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388292
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-01 16:41:57 -05:00
Ben Walker
3580546bd1 nvmf: Implement the poll group as an io_channel
It has all the same properties of uniqueness, so
implement it as an io_channel to take advantage
of the other infrastructure for message passing
already available.

Change-Id: I1777b91f0597a5a43ac0d0bbfdf878e874eb04f3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388291
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-01 16:41:57 -05:00
Ben Walker
7b57e9f973 nvmf: Stop subsystems from the thread they were started on
This correctly puts all of the I/O channels on the right
thread during shutdown.

Change-Id: I432c8cb981a68b40639f8876dae42597a9e6a85f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389637
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-01 16:41:57 -05:00
Dariusz Stojaczyk
84eb1451ea virtio: fix potential memory leak in virtio_dev_init
When device was reinitialized, the old
virtqueue memory used to leak. While
here, also added a doc for virtio_dev_init.

Change-Id: I9bb8dbfa5d68deeb73e71567a7e51b82f869537a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/388297
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-01 16:41:20 -05:00
Daniel Verkamp
222ebc1912 doc/jsonrpc: add app RPC method documentation
Change-Id: Ia688b082f2b5a74b78ebd1fe7a3f0ae33e084a8c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389920
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-12-01 16:40:06 -05:00
Daniel Verkamp
54fb60177a lvol: clean up includes in lvol.h
All SPDK public API headers should include spdk/stdinc.h first.

Additionally, the other headers included in lvol.h aren't needed;
spdk/queue.h was unused, and spdk/blob.h can be replaced with a forward
declaration of struct spdk_bs_dev.

Change-Id: I89fad764efbb4c088ce325392f8237c1a869a895
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389895
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-01 16:36:12 -05:00
Daniel Verkamp
d6427151bb lvol: remove vbdev APIs from public lvol.h API
The vbdev_* functions that were declared in lvol.h are all internal to
the lvol vbdev implementation; they don't need to be in the public
header.

vbdev_get_lvs_bdev_by_lvs() is moved to the top of the file so it
doesn't need a forward declaration (no code change).

Change-Id: I98282d3cb0008da5c5b5059eee335219dc929f1c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389894
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-12-01 16:36:12 -05:00
Daniel Verkamp
c6d32d39af lvol: pass UUID as a string in public API
Modify the vbdev_get_lvol_store_by_uuid() API function to take the UUID
as a string instead of a uuid_t, since this simplifies the calling code.

This also allows us to remove #include <uuid/uuid.h> from the public
API, giving us the freedom to change the underlying UUID implementation
later if necessary without breaking API.

Change-Id: Ib360281f384f95722c5ab64e75dcf3603f826e4c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389893
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-01 16:36:12 -05:00
Daniel Verkamp
f5acc37221 lvol: pass lvol store to vbdev_lvol_create()
All of the call sites already have a lvs pointer; there's no need to
look up the lvs by UUID again.

Change-Id: Icef54d84e7c89f682ea47f10b282839ab4237ce0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389892
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-01 16:36:12 -05:00
GangCao
5aae23aa08 test/bdev: handle the error case the IO channel is not setup
This issue may be hit under some large IO and large queue
depth cases where much memory will be consumed and the channel
may be failed to create due to insufficient memory.

The general fix here is that we need to properly handle
the error case that the channel is not created due to this
or that reason.

Change-Id: Icf58a7c8a9cba625ef1b8da6b8bf68ef72ef5546
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/386051
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-01 15:13:51 -05:00
Daniel Verkamp
24c8d965b0 rte_virtio: make vhost_msg_strings static
The array of message strings is now only used in vhost_user.c, so it
doesn't need to be exported.

Change-Id: I40163b95a52a1762eb3639db5553814bf1299959
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389652
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: Ben Walker <benjamin.walker@intel.com>
2017-12-01 14:35:30 -05:00
Daniel Verkamp
f3e0bfd7ef bdev: remove get_ctx_size functions that return 0
The bdev module get_ctx_size callback is only necessary if it returns a
non-zero size.

Change-Id: I00ca366b8a1949bdb091c5e8aefb19cb606481d0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389900
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-01 13:25:16 -05:00
Daniel Verkamp
474632ba7b bdev/nvme: simplify spdk_bdev_nvme_get_ctrlr()
Rather than iterating over the g_nvme_bdevs list to determine if a bdev
is an NVMe bdev, we can just compare the module pointer.

Also, the function can take a spdk_bdev pointer directly rather than
casting from a void pointer.

Change-Id: Iccf3c9b3263e9b2d67d07d037dc00d1cbc0f22a1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389899
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>
2017-12-01 13:24:45 -05:00
Cunyin Chang
c9b18a9f3f bdev/nvme: optimization of the process when destruct the nvme bdev.
This patch will make sure the nvme bdev work in correct way when we delete
bdev by using rpc method and then exit the app.

Change-Id: I19172440d46d96c7396282e1bef07d98ab601390
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/389930
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>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-12-01 13:17:09 -05:00
Cunyin Chang
6d65bfcfe2 bdev/nvme: unregister all nvme bdev when the app exit.
replace the bdev_nvme_destruct() with spdk_bdev_unregister(),
clean all the resource in the bdev layer.

Change-Id: Ic4b85dee6225f42babe868796a8c24dec5c22af6
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/389855
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>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-12-01 13:17:09 -05:00
Sebastian Basierski
2b415f2c89 vhost: Reduces size of vhost app coredump file.
Fixes #215

Change-Id: Ib65d9479e87c6007fa903b02a37d82e3d319e290
Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>
Reviewed-on: https://review.gerrithub.io/388615
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-01 12:56:04 -05:00
Pawel Kaminski
70643bf2a3 test/vhost: Remove ip address from rpc command
Change-Id: I552c46b2bfb01640dd19a6478b56d69574044e70
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/389845
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-01 12:55:35 -05:00
GangCao
d9174e1e42 setup: add the SKIP_PCI parameter in setup.sh
User may only want to configure hugepage and no configure
on the PCI devices. Add the SKIP_PCI parameter to offer
this option.

If user only wants to configure hugepage, can run:
SKIP_PCI=1 ./scripts/setup.sh

The default behavior is that PCI devices will be configured.

Change-Id: I8302efd5a09f2885e00fa8ed00d398219c11dde7
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/389473
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-01 12:08:11 -05:00
GangCao
55ac2263af setup: add the configure and reset pci functions in setup.sh
Introduce several new functions configure_linux_pci, reset_linux_pci and
configure_freebsd_pci for the PCI devices relatd operations.

Change-Id: Ifdaddd314ba01fd73ff700d231a6aeae5ec7c480
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/387265
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>
2017-12-01 12:08:11 -05:00
Daniel Verkamp
e9ac7a7252 bdev_svc: convert to spdk_app_parse_args()
Use the common SPDK application argument parsing function.

This adds support for several more common options to the bdev_svc test
tool.

Change-Id: Iccccf158164182aa36d0837210d8b189be3b6cd6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389866
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-12-01 11:49:23 -05:00