Commit Graph

3511 Commits

Author SHA1 Message Date
Ziye Yang
cc57c4a9bc fio_plugin: check the whether the qpair can be allocated.
If it cannot be allocated, we should return error.

Change-Id: I48aa50a8842c35ee112fe7185128b1bc1930176e
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/386369
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: Ben Walker <benjamin.walker@intel.com>
2017-11-15 18:00:07 -05:00
Daniel Verkamp
322cae6af4 build: remove tab from spdk_lib_list_to_files
The tab inside the define ends up in the output when called, which leads
to problems if the output is quoted (the tab will be treated as part of
the filename).

Change-Id: I1038e1650a74861660fa4164dbde065217bc7b99
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/387631
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-11-15 17:57:07 -05:00
Daniel Verkamp
52412ab10b build: include spdk.app.mk in all app Makefiles
This will be used to include common app-specific rules in upcoming
patches (it currently makes no difference).

Change-Id: Ia828ba01c94fc9f70e15db3fc1d9cafda387e912
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/387629
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-11-15 17:57:07 -05:00
Paul Luse
db26b96fc0 blobcli: fix issue with command parsing
Introduced when bdev was added as a required option, logic
problem with command parsing that broke things when in
command mode with, for example, providing a bogus option.

Change-Id: I067bf2783f572c6d4fa7660691bb90c470744130
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/387634
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-11-15 17:55:40 -05:00
Ben Walker
ea134c5cbf nvmf: Store subsystems in array instead of a list
This helps enforce uniqueness of the subsystem id and
allows for quick lookup by that id.

Change-Id: I4d2948892839d42b8c2b2a406682848415ad2bd6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/376251
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-11-15 17:54:13 -05:00
Ben Walker
1f8b6f3752 nvmf_tgt: Destroy poll groups on their respective cores
Destroy the poll group from the core it was created
on.

Change-Id: I6960a356358e8c00ae234149aa3a12eff1a24e05
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/385953
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-11-15 17:54:13 -05:00
Ben Walker
07c639cdec nvmf: Create poll groups on their respective cores
Previously, all of the poll groups were created on the
core doing the configuration. However, creating poll groups
will eventually construct the I/O channels, and that must
be done on the core we plan to use the poll group on.

Change-Id: Iff57ac0e43bb722eb27cf01d7bf55f3946a165eb
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/385515
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-11-15 17:54:13 -05:00
Ben Walker
db3edeb341 nvmf_tgt: Rewrite initialization as a state machine
This is about to become a hot mess of asynchronous operations,
so introduce a state machine to make it easier to follow
the logic.

Change-Id: If67acfd61d4e70e30a95245d5f46112323943459
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/385482
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-11-15 17:54:13 -05:00
Pawel Wodkowski
f7476d444b vhost/test: remove code that build SPDK and QEMU
qemu_build_and_install and spdk_build_and_install are unused for long
time so lets remove them.

As we are here also also remove unused VM_CNT.

Change-Id: I23368b2f2036b9eb82f9ac8e6880242748352e49
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/387560
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-11-15 17:53:19 -05:00
Pawel Wodkowski
32408765d5 test/vhost: small cleanup of spdk_vhost.sh
Fix indentations, rework help message, parametrize VM image.

Change-Id: I4a24c840ae2fec1e77c0e53e2ef6dc227272744b
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/387138
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-15 17:53:19 -05:00
Dariusz Stojaczyk
fbccbb28c7 pci/dpdk: use rte_eal_dev_attach/detach for DPDK 17.11-rc3
DPDK 17.11-rc3 removes pci_probe*
and pci_detach functions. It introduces
different ones - rte_eal_dev_attach/detach.
Those have a slightly different signature.

Change-Id: Iadde9ff37c64190dad41929997f9ff78379f36e1
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/387656
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-11-15 17:52:05 -05:00
Dariusz Stojaczyk
779dd1bc10 env/dpdk: compile with rte_pci and rte_bus_pci for DPDK 17.11-rc1
DPDK 17.11-rc1 moved a part of it's
eal code into two separate libraries.

Change-Id: Ibcea448487a001c30abb68447e3fe2104ba9a7c3
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/387655
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-11-15 17:52:05 -05:00
Dariusz Stojaczyk
db704770d6 env/dpdk: use rte_virt2iova instead of rte_virt2phys for DPDK 17.11
DPDK 17.11-rc3 switched to IOVA-centric
addressing. The old API is still available,
but is deprecated.

Change-Id: I7b54a1e626e39368acd2190dec725dbf30c7a5de
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/387654
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-11-15 17:52:05 -05:00
Dariusz Stojaczyk
c138dfe229 dpdk: include rte_config.h where necessary
DPDK 17.11 removed all rte_config.h includes
from rte_*.h headers, meaning we should either
use gcc param -include rte_config.h (just
like DPDK does), or include this file before
each other rte_*.h include. Since we're using
the latter approach in many places already,
I decided to follow it.

While here, also removed rte_vdev.h dependency
from rte_virtio/virtio_user.c. It's not used
anyway.

Change-Id: I865ee9f828211c03a60fd0446f7a418d5dddd140
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/387653
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-11-15 17:52:05 -05:00
Dariusz Stojaczyk
3c293a883c rte_virtio: remove legacy PCI device support
Legacy PCI code is hard to maintain
and compiles with DPDK 17.05 only.
If we ever need this functionality
in SPDK, we should first add proper
env/pci layer for direct UIO/VFIO
communication, and then revisit this
topic.

Change-Id: I25622c16f467633e01003c9edbb7e6f297c68a86
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/385302
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-15 17:52:05 -05:00
PepperJo
4382434855 nvme/pcie: add memory barrier process completions
Because ppc64 has less strict memory ordering behaviour
than x86 we need to introduce a memory barrier when
polling for completions due to possible reordering
of tracker and cpl access.

Change-Id: Id17116c38b2ba69154c175c539fc97c60897deb0
Signed-off-by: Jonas Pfefferle <jpf@zurich.ibm.com>
Reviewed-on: https://review.gerrithub.io/383728
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-11-15 17:24:19 -05:00
Shuhei Matsumoto
7bcb08c02b iscsi: Load balancing of iSCSI target is not working
When an iSCSI connection is closed, spdk_iscsi_conn_stop_poller()
is called in spdk_iscsi_conn_destruct() or
spdk_iscsi_conn_check_shutdown().

However, through both paths, g_num_connections[] is decremented
twice:
 (1) in spdk_iscsi_conn_stop_poller()
 (2) in spdk_iscsi_conn_free()
This behavior makes g_num_connections[] negative unexpectedly and
for some cases load balancing does not work and the same CPU is
always selected.

How to fix:
spdk_iscsi_conn_stop_poller() is called in the following functions:
- spdk_iscsi_conn_check_shutdown()
- spdk_iscsi_conn_destruct()
- spdk_iscsi_conn_handle_idle().

[Idea 1]
Remove the code to decrement g_num_connections[] from
spdk_iscsi_conn_free().

[Idea 2]
Remove the code to decrement g_num_connections[] from
spdk_iscsi_conn_stop_poller(). Add the code to decrement
g_num_connections[] to __add_idle_conn().

[Idea 1] is simple because just only one line is deleted.

[Idea 2] may be more symmetric than [Idea 1] but to find the right
place to add the code in __add_idle_conn() is not clear and
difficult.

Hence [Idea 1] is proposed.

[Idea 1] may not be the optimal one and more refactoring may be
done.

Change-Id: I81050f4a0e7b3ddd40896f46ab2eb8de14bbcb3a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/384026
Reviewed-by: Cunyin Chang <cunyin.chang@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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-15 13:25:06 -05:00
Daniel Verkamp
441ca5fb5b autotest: add timing markers for vhost tests
We should add more granular timing markers within the vhost tests, but
for now, at least measure the timing of the top-level test categories.

Change-Id: Ic8371d8dffcb1e45fbedd7ef4af448cdee0cef7c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/386558
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-15 13:17:15 -05:00
Ed Rodriguez
85c146ef6e log: Create a separate implementation file for common log flag operations.
Change-Id: I2524b7881885a0784492a8189bf22a0b8c92d470
Signed-off-by: Ed rodriguez <edwinr@netapp.com>
Reviewed-on: https://review.gerrithub.io/386169
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-11-14 15:53:37 -05:00
Shuhei Matsumoto
f9bf9cdd1c iscsi: change the return value of ACL func to bool
The following functions returns 1 and 0 for succcess and error,
respectively:
- spdk_iscsi_tgt_node_allow_ipv6()
- spdk_iscsi_tgt_node_allow_ipv4()
- spdk_iscsi_tgt_node_allow_netmask()
- spdk_iscsi_tgt_node_access()

Using bool for this purpose will avoid our misunderstanding.

Change-Id: I927876e0503c0eee5364e829a4713f9a345996f6
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/383664
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>
2017-11-14 15:44:40 -05:00
Shuhei Matsumoto
92a6988676 iscsi: delete global PG tag check from SendTargets
In the Appendix C. SendTargets Operation in the iSCSI Specification
(RFC7143), there is the following description:

  In a Discovery session, a target MUST return all path information
  (IP address-port pairs and Target Portal Group Tags) for the
  targets on the target Network Entity that the requesting
  initiator is authorized to access.

However no description such that Target Portal Group Tag is used
to check authorization of the requesting initiator.

Moreover, according to the iSCSI Specification (RFC7143),
Target Portal Group Tag is unique within an iSCSI Target Node.

  Tarrget Portal Group Tag identifies a portal group within an
  iSCSI node.

However, current SPDK uses Target Portal Group Tag to check
authorization of the requesting initiator by mistake. This
implementation does not have any compatibility with other storage.

Hence delete the code related with Target Portal Group Tag from
SendTargets function.

Change-Id: If4b79f0d8fe8f5892a798e4f6716045fd18cf0a4
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/383660
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>
2017-11-14 15:44:40 -05:00
Shuhei Matsumoto
335fb0e85f net&iscsi: force overwrite "*" and "[*]" by wildcard
SPDK have used "*" and "[*]" as wildcard address
for iSCSI network portal. These abbreviations may be convenient
but unusual. If "*" or "[*]" is used, output warning message
and forcefully overwrite "*" or "[*]" by "0.0.0.0" or "[::]"
respectively.

After confirming that the usage of "*" and "[*]" is not used any
more, the code for "*" and "[*]" will be deleted.

Change-Id: Ibb8fb0d4598ffa1f7b1690ad6afd10d5ae162612
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/383556
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-11-14 15:44:40 -05:00
GangCao
58fb5a17f0 blob: handle the case that channel is not created
There is case like no memory to create the channel.
Needs to handle this properly.

Change-Id: I5d13d18037e6aa8f057769b1ef345f45597b22af
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/386016
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-14 15:43:08 -05:00
Dariusz Stojaczyk
2c4c7c8870 rte_vhost: mantain separate virtio features field in virtio_net
There are two separate abstraction layers:
* vsocket - which represents a unix domain socket
* virtio_net - which represents a vsocket connection

There can be many connections
on the same socket. vsocket
provides an API to enable/disable
particular virtio features on
the fly, but it's the virtio_net
that uses these features.
virtio_net used to rely on
vsocket->features during
feature negotiation, breaking
the layer encapsulation (and
yet causing a deadlock - two
locks were being locked in a
separate order). Now each
virtio_net device has it's own
copy of vsocket features, created
at the time of virtio_net creation.
vsocket->features have to be
still present, as features can be
enabled/disabled while no
virtio_net device has been
created yet.

Fixes #214

Change-Id: Ic4b2dd8cae6050813fc9a420b2ed30bc5ae60393
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/386294
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-14 15:39:49 -05:00
Ben Walker
eb8571d463 bdev: Fix bug where cpl on finish is called early
The process of spdk_bdev_finish will always result in an
early call to the user's completion notification - prior
to the actual shutdown events happening.

Change-Id: Ib53393deb794b616d2b7ec94cb41502305bd99b7
Reviewed-on: https://review.gerrithub.io/386707
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@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>
2017-11-14 15:08:56 -05:00
Ben Walker
6447eb670a event: Allow spdk_subsystem_fini_next to be called from any core
Change-Id: Idc39c101c23cebe9538d59c0026d169c93c44e23
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/386715
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-11-14 15:08:56 -05:00
Ben Walker
a1133a9b67 event: Remove extra event from subsystem shutdown path
Change-Id: I1b4a64fc5efdb5abd8bdcd9e91a7e8fb06fbfe3a
Reviewed-on: https://review.gerrithub.io/386714
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>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-14 15:08:56 -05:00
Yanbo Zhou
a6fea52116 include/bdev.h:add new comments and fix errors in original.
Change-Id: I0f0e75228561105c1d717e8b879373231bf3cdcd
Signed-off-by: Yanbo Zhou <yanbo.zhou@intel.com>
Reviewed-on: https://review.gerrithub.io/383850
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-14 14:50:08 -05:00
GangCao
fe408c9791 example/identify: list the number of I/O queues
This kind of information can be useful on related model
of Intel SSDs.

Change-Id: Iea8a8f48999ba36e2f6cbf33a892147262891b44
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/385805
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-11-14 14:44:49 -05:00
GangCao
b41a99f2b0 doc: add the example to configure different memory size
A new parameter HUGEMEM added to configure the memory usage

Change-Id: I2ad536520b0855e5b6ae36f5c63ace8a52705ac5
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/385366
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@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-11-14 12:47:25 -05:00
Dariusz Stojaczyk
ec3c0bb2f0 Revert "fio_plugin: allow stopping poller after it's thread has been stopped"
Now that there's a fio_thread
at the time of calling spdk_bdev_finish,
this work-around is no longer
necessary.

This reverts commit ae0f518e4f.

Change-Id: I416ff69552ab863b6722931c9ef086f119439ba5
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/386248
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
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-11-14 12:30:26 -05:00
Dariusz Stojaczyk
a658245f40 fio_plugin: add persistent fio_thread for spdk init/finish
This patch also replaces "temporary"
SPDK threads for init/finish with a
single persistent thread that's created
at the time of init, and destroyed
at the time of finish.

Change-Id: I6da922cb50f06a9c31e22817d06c5dcbf19255b6
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/386247
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
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-11-14 12:30:26 -05:00
Dariusz Stojaczyk
8865e0bf51 fio_plugin: poll all remaining events on thread shutdown
There were unprocessed events in the event ring at the time
of destroying it's thread.

Polling until *done* flag is set is not sufficient. Since a single
fio_getevents call will poll only a single message, any
message positioned after the callback that sets the *done*
flag would not be processed.

Change-Id: I8fee384cb980373672bed4bc498f75774aa64a9e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/385802
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-11-14 12:30:26 -05:00
Dariusz Stojaczyk
4314d72505 fio_plugin: add spdk_fio_poll_thread
Separated SPDK-related code
from the FIO callback spdk_fio_getevents.
This is required for upcoming patches.

Change-Id: I8d30a3f910f29b13344df91fbbff51e00dfa0a0a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/386102
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: Ben Walker <benjamin.walker@intel.com>
2017-11-14 12:30:26 -05:00
Daniel Verkamp
aaa189ae7f nvme: add actual shutdown time to log message
Change-Id: I482ad9e722f6fb775c1c91c8661212250a6914bc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/386722
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
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-11-14 10:54:04 -05:00
Daniel Verkamp
ffee381d82 nvme: allow a minimum of 10 seconds for shutdown
Some devices may report a RTD3E time that is shorter than their actual
shutdown time in practice; force the timeout to be at least 10 seconds
to allow for a reasonable amount of shutdown time.

This doesn't add any extra delay for devices that do complete the
shutdown process within their reported RTD3E time, since we will return
as soon as the device reports that it is finished shutting down.

Change-Id: I365e66ba6a938400be516df170bd3ff288810caf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/386719
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
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-11-14 10:54:04 -05:00
Ziye Yang
a0da65f49d bdevperf: adjust the bdevperf task number.
According to my analysis, the exact number is not
related with core number, which should be calucated
as g_target_count * g_queue_depth. Since each
target will be run I/O by differnet cores.

And it would solve the task number not enough issue.

Change-Id: I483f4609341766123f95b39bff057e95a9d19531
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/386801
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Hailiang Wang <hailiangx.e.wang@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-11-13 18:17:12 -05:00
Jim Harris
618c8f9040 iscsi: cleanup iscsi_subsystem.c
1) Replace some perror() calls with SPDK_ERRLOG
2) Use spdk_conf_section_get_boolval() to simplify the code

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

Reviewed-on: https://review.gerrithub.io/386666
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-11-13 14:58:34 -05:00
Jim Harris
d97476efdf iscsi: shutdown iscsi library as part of subsystem fini path
With the new asynchronous subsystem finish framework, we can
drive shutdown of existing connections as part of the subsystem
finish path instead of a separate spdk_iscsi_shutdown function
called as the shutdown function in response to SIGINT.

This is a step towards enabling a single target app that
supports multiple protocols (i.e. iSCSI + vhost + NVMe-oF).

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

Reviewed-on: https://review.gerrithub.io/386695
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-11-13 14:57:49 -05:00
Jim Harris
6bef902ca5 rpc: add default UNIX domain socket listen address
RPC is a default feature required for almost all usages,
so enable RPC by default, but with a UNIX domain socket
for security reasons.

-r can now be used from the command line to specify
an alternative RPC listen address from the default
/var/tmp/spdk.sock.

Remove the Enable parameter from the Rpc config section
but still allow specifying an alternative listen address
using the Listen parameter as an alternative to the
command line option.  This keeps backward compatibility
for this release for anyone using the configuration file
still.

Remove the Rpc sections from all configuration files
that were using them, except for those that specified
alternate TCP ports for multi-process test cases.  We
can fix these later to use an alternate UNIX domain
socket and to use the command line instead.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ife0d03fcab638c67b659f1eb85348ddc2b55c4c4
Reviewed-on: https://review.gerrithub.io/386561
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-13 14:57:49 -05:00
Jim Harris
fbb9430ec4 app: add spdk_app_parse_args()
This is a helper function that eliminates a lot of
duplicated code in our target applications, specifically
around common command line argument parsing and usage
messages.  This patch only moves the iscsi, nvmf and
vhost targets to use this function, but there are other
test/example applications that could also take advantage
of it to reduce duplicated code and improve consistency.

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

Reviewed-on: https://review.gerrithub.io/386542
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-11-13 14:57:49 -05:00
Jim Harris
246cdd08e1 iscsi, nvmf, vhost: break out common usage text to separate functions
This prepares for moving all of the common usage text into a library
that can be used by all applications using the app framework.

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

Reviewed-on: https://review.gerrithub.io/385929
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-11-13 14:57:49 -05:00
Jim Harris
0489bcb137 iscsi, nvmf, vhost: break out arg parsing into separate functions
This prepares for moving all of the common app framework argument
parsing into a library that can be used by all app framework based
applications.

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

Reviewed-on: https://review.gerrithub.io/385928
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-11-13 14:57:49 -05:00
Shuhei Matsumoto
1b306f4b54 net: spdk_sock_getaddr() support IPv6 transparently
spdk_sock_getaddr() (in lib/net/sock.c) only support IPv4.
Hence IPv6 cannot be used in SPDK iSCSI target.
By adding the code to support IPv6 transparently, IPv6 becomes
available in SPDK iSCSI target.

Change-Id: I236f2c6cb1e61283dde090729fecd8f743cec3fc
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/383672
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>
2017-11-10 18:54:21 -05:00
PepperJo
2e7c008fe2 nvme/pcie: page size alignment rings
cmd and cpl rings must be aligned on page size boundaries.

Change-Id: I103eed32adfaa4388bc7d672ee166973f796b343
Signed-off-by: Jonas Pfefferle <jpf@zurich.ibm.com>
Reviewed-on: https://review.gerrithub.io/383727
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
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-11-10 17:26:15 -05:00
Barry Spinney
dcfbafeb77 barrier: add proper barrier instructions for ARM 64
Add code to implement the write memory barrier and read/write memory
barrier for ARM 64 platforms.

Change-Id: I8b63db25ba1f70a729874ca143db13501d976676
Signed-off-by: Barry Spinney <spinney@mellanox.com>
Reviewed-on: https://review.gerrithub.io/386534
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-10 17:25:32 -05:00
Maciej Szwed
0c06e1ea89 lvol: show total accessible clusters in lvol store
Show total accessible clusters when listing lvol stores
instead of total blocks. This is more readable for user.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I22a14f626816769cf2f494ae30cfd8ee63897771
Reviewed-on: https://review.gerrithub.io/385634
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-11-10 17:24:31 -05:00
Tomasz Zawadzki
5eb52b951c blobstore: store usable number of clusters in blobstore structure
At the moment there was no way to a user of blobstore api to know,
how many clusters are availible to him. Total_clusters describes
number of clusters for metadata and user data.

New field added total_data_clusters, keeping number of clusters
that can be used to create blobs - meaning just user data.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I60555217644557410844f74628375a6b46fd2ac7
Reviewed-on: https://review.gerrithub.io/385633
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-11-10 17:24:31 -05:00
Jim Harris
973a27d08c app: add print_level to opts structure
This allows us to remove some duplicated code from our
main target applications.

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

Reviewed-on: https://review.gerrithub.io/385714
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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-11-10 17:00:58 -05:00
Jim Harris
4bcfef0021 rpc: remove rpc subsystem
RPC is core functionality for SPDK applications and should always
be initialized last (after all subsystems have been initialized).
So make RPC a first class citizen and integrate it with the
app framework directly instead of making it an "optional" subsystem.
Then we initializing it after all subsystems have completed
initialization, and tear it down before tearing down subsystems.

We can also do some other cleanup while here - for example, reactors
are already started when spdk_rpc_initialize() is called, so remove
the extra event that was added during initialization since this is no
longer needed.

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

Reviewed-on: https://review.gerrithub.io/385914
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-10 17:00:58 -05:00