Change-Id: I864cd8a6c206dfbe62fcb3f72275c1ae51aa4ed7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387688
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>
We always unregister pollers from the core they're running on,
so we don't need the async completion event when unregistering
them. To avoid changing the logic, create events instead.
Change-Id: Ib50d93e1578684bea69200d89a5e0d383acc8cfe
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387685
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>
Register all pollers to the current core. If necessary, send
an event to the correct core before registering.
Change-Id: Ie34cc8b11143a58c0f621c87c409a3d09d929648
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387682
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This is the inverse operation of spdk_io_channel_get_ctx.
Change-Id: Ica6593240dfb05cb53dc7ec910bc0a78270e81c0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387679
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Change-Id: Ib1e184f831eef82432308279c6d8ea43088748ef
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/387273
Reviewed-by: Ziye Yang <optimistyzy@gmail.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>
Use the env abstraction PCI functions to compare PCI addresses so that
details like whether or not domain is specified or whether 0-padding is
present don't affect the comparison.
For example, 0000:01:00.0 should compare equal to 01:00.0.
Change-Id: I9f3aaeb5f8fdbf3e246e31a41b4c09151288015e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/387202
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>
Change-Id: Ibe31b961fec36644cf64716c512429d68e873e88
Signed-off-by: Ed rodriguez <edwinr@netapp.com>
Reviewed-on: https://review.gerrithub.io/386170
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>
Currently when one of lvols fail during loading we end up
with empty lvol store loaded, where we actually should
unload lvol store as well.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I90ce3b79baba0db0d875b106c94924be394aada9
Reviewed-on: https://review.gerrithub.io/385950
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This patch make the cache buffer shift of blobfs configurable. We
can configure the cache buffer shift according workload, it will
help to improve the performance.
Change-Id: Ied1c2e5d6fd9eaa7aa0759c03c654fcf2e77aa23
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/383381
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
There is a race condition here, where kernel could have
outstanding I/O to nbd device at the same time we terminate
the nbd application. In this case, we cannot free the
spdk_nbd_disk since it contains the io structure that
will be referenced when the SPDK poller completes one
of those I/O.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1bde240af904957f4d2bfa358dc673105d266986
Reviewed-on: https://review.gerrithub.io/385927
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
There may have the situation that associated socket does
not have enough memory for the event pool and the related
ring buffer. As the event pool will be created at any
available socket, this will be same for the ring.
The basic idea is to first allocate the memory for the
core associated socket and then try other available sockects
before terminating.
Change-Id: I52c240289899c136b607629c12c0250ad859c8ac
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/385972
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Previously lack of support for specific bdev was not known to user.
This impacts all unmap operations, such as initialization of blobstore.
It should be useful to user to know it will take longer
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I89bf3bc0342558fda9a8964fb5cb1daa3a8ed79e
Reviewed-on: https://review.gerrithub.io/385999
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>
The end goal is to have the application create one poll group per core.
Then each poll group will have a single CQ per network device and an I/O
channel per back-end storage device to poll.
This is just the first step toward that, which is to wire up the
creation of the per-core poll groups in the application.
Note that the app poll groups don't do anything yet. We'll need
additional library API changes to make the library use the existing poll
groups, rather than creating a new poll group per subsystem as we do
right now.
Change-Id: I2d4e2a5e5aa354d37714750f1d5b1d1e4ab9edce
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/381887
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>
When a ctrlr is failed to initialize and to respond other
requests, the nvme_ctrlr_fail() will be always called. Add
a log there to have the traddr information so that applications
can know which ctrlr has the problem.
Change-Id: I951062a51349af81a505472f79e3c00a1ead2fbf
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/386189
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>
According to the current code, rdma qpair is always created
by the thread on acceptor_core, thus we need to
change the related I/O channel during polling if the core
configured for subsystem is not same with the acceptor core.\
With this patch, we can run NVMe-oF tgt with multiple cores,
and each subsystem can configure different core to handle.
Change-Id: I6163a871f65115e545a4f3fd9cc46b3bafb13249
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/383683
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>
Change-Id: I3db00323c20786713750d13a61b1531d8b1ce7f6
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/386087
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>
During tasting, if bdev is already claimed, we send errors on screen.
This is expected behavior so we should send only debug logs.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ic5766cfa3aed88099415991998381de69ee8b8b6
Reviewed-on: https://review.gerrithub.io/384229
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Change-Id: Ibdfa8be770d7bfcb2baaf29fa5b32dea064ffbd0
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/383383
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>
NVMe 1.2 introduced a new Identify Controller field, RTD3E ("RTD3 Entry
Latency"), which allows the device to report the expected time for a
normal shutdown. Use this as the timeout for the shutdown process when
available instead of hard-coding 5 seconds.
Change-Id: I14e7223c81ba397771cf00b49f034f25d21b6e82
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/385301
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: Changpeng Liu <changpeng.liu@intel.com>
spdk_pci_device_claim() can be used to ensure only one process
at a time uses any given PCI device. Previously this was only
used in the bdev_nvme driver - other apps like nvme/perf do
not use spdk_pci_device_claim() and could effectively rip out
the device from a running bdev-based app like the NVMe-oF target.
So instead of modifying all of the nvme apps, put this logic into
the core nvme driver instead so that all applications get the
benefit transparently. Save the fd when the controller is constructed
and then close it when the controller is destructed to handle the
detach (including hotplug) cases.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5dc48a2e41dc06707800f15a9e1f9141477628c6
Reviewed-on: https://review.gerrithub.io/385524
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
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>
This allows users of this interface to then close the fd
when they want to release the claim.
This prepares for calling spdk_pci_device_claim() in the
nvme driver to cover not just the bdev_nvme driver but all
of our nvme example and test applications as well. We'll
want the fd returned so that we can properly close it during
detach (including hotplug) use cases.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8b149cc4e778ba31c0e7045b858c8a1561b6b7af
Reviewed-on: https://review.gerrithub.io/385523
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@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>
If the default config file does not exist, keep the
app's config_file options field as NULL, so that the
app code will not fail when trying to open a non-existent
file.
Also leverage the recent iSCSI and NVMe-oF refactoring,
to just skip trying to read config file parameters if no
config file exists (or the requisite section in the config
file is not present). vhost already handled this so it did
not need to be modified.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic32f0a7a8ce85322a8effd537b62d14732d7b82e
Reviewed-on: https://review.gerrithub.io/385497
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
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>
Previously users would have to pass CHAP and Mutual as
separate words on the DiscoveryAuthMethod line - but
this was problematic since then we would have to check
that the user did not specify Mutual without CHAP.
So instead just make Mutual infer CHAP.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I183d59145abb97198984541157522d6483b18e7c
Reviewed-on: https://review.gerrithub.io/385495
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>
Some invalid parameters would result in an immediate app exit, while
others such as DefaultTime2Wait would adjust an invalid value
rather than causing an app exit.
Instead, be consistent and just ignore any invalid values, with an
error message.
One exception is the CHAP + Mutual check - this will be fixed
in a separate patch.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I867e4a2a5685aec73df5e556d529b0356a9c3070
Reviewed-on: https://review.gerrithub.io/385494
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>
Move all of the code related to reading global iSCSI
parameters to a new function.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iccbb75996b29b0b7a87c602042f13aaf7935d7e1
Reviewed-on: https://review.gerrithub.io/385493
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>
spdk_iscsi_app_read_parameters() does an SPDK_DEBUGLOG
for each of the global parameters - consolidate these
and move them to a separate function.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If1543f9f5846420bf75f7a4aebaf540106f1df69
Reviewed-on: https://review.gerrithub.io/385492
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Modify spdk_iscsi_app_read_parameters() so that it sets
up all of the default values first, and then reads the
config file to update any parameters that may have been
specified.
This is in preparation for breaking out the config file
reading into a separate function that can be skipped
if no config file is available. In this case it will just
use the defaults.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0b9026ea87d171be22085a6baca24e2022cb58dd
Reviewed-on: https://review.gerrithub.io/385491
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>
spdk_iscsi_tgt_node_access() (in lib/iscsi/tgt_node.c) regards
empty netmask of IG as ALL (allow all initiator's IP address).
However any user cannot create IG whose netmask is empty by both
JSON-RPC and config file. Instead user can create IG whose
netmask is ALL.
The code to regard empty netmask of IG as ALL never run in production.
Hence delete the code and add UT to confirm the fix.
Change-Id: Ib7206d0986db9093cfb6b36191be26293ff6c67a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/382920
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>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Group the code fragments of add/delete name and mask of initiators
and create spdk_iscsi_init_grp_add/delete_initiators/netmasks()
functions. Memory alloc/free is done in these functions.
Change-Id: I40f2873c5336a05813c0e34797c109386eda4229
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381246
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: Ziye Yang <optimistyzy@gmail.com>
This function is not used and there is already similar one.
Hence delete this function.
Change-Id: Iff290c4762cf5da7211382e367e5b137ab8fbf7d
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381245
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
FirstBurstLength, MaxBurstLength and MaxRecvDataSegmentLength
cannot be configured, so there is no need to keep global data
members for these parameters - just use the default #defines
instead.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4b47e00a5594da8ec0b87192be4a23c4a2145bde
Reviewed-on: https://review.gerrithub.io/385490
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>
Our iSCSI target does not support disabling InitialR2T,
DataPDUInOrder and DataSequenceInOrder, and will fail
if someone tries to disable them in the config file.
So instead, just do not support these parameters at all.
This simplifies the code and reduces confusion.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icf1e01a6d12b758404769f77aa3f6221e6e3ee0d
Reviewed-on: https://review.gerrithub.io/385489
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>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
This was not used anywhere - sessions default to
DEFAULT_MAXOUTSTANDINGR2T and never look at the global
MaxOutstandingR2T value.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia4874d8d747063f729061124194b60d15ad3ddac
Reviewed-on: https://review.gerrithub.io/385488
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: <shuhei.matsumoto.xt@hitachi.com>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I2077dab7b343e662bdcfd5681b4850c258f0431f
Reviewed-on: https://review.gerrithub.io/385406
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I65e84971f2d55f27b0c0c1a1b226fc4da4b3cf89
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/382763
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: Daniel Verkamp <daniel.verkamp@intel.com>
Modified the above files to add rpc support to update NVMe firmware. Currently,
the path parameter must be local to the RPC Server.
Change-Id: I2b14e37792a2f0a5759e8b13e21137e7f346e58e
Signed-off-by: Isaac Otsiabah <iotsiabah@us.fujitsu.com>
Reviewed-on: https://review.gerrithub.io/369083
Reviewed-by: Paul von Stamwitz <pvonstamwitz@us.fujitsu.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>
As part of the SCSI target scan, request the Block Thin Provisioning VPD
page to determine if the target device supports Unmap, and report it via
the io_type_supported bdev callback.
Change-Id: Id2fdaf3a2cae72e6356a862d40ff772f9d12d144
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/384131
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>
This prepares for adding more steps to the scanning phase. Each step
will put its results into the scan info struct, and the final
alloc_virtio_disk() call will copy the info to the allocated disk at the
end of each target scan.
Change-Id: I836ada42e25c817bb1998328cb592acac25be08d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/384130
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>
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Ic6770371d9d62cbdd40ae0612eb4f7dceccd507f
Reviewed-on: https://review.gerrithub.io/383771
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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>
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Ifbb02f99cd2e5752b2bc9091733b87ddadec11a4
Reviewed-on: https://review.gerrithub.io/383895
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Some devices expect alloc_len
to be the same as payload len.
Kernel vhost-scsi reports:
Expected Transfer Length: 256 does
not match SCSI CDB Length: 255 for
SAM Opcode: 0x12.
Change-Id: I499290c207b77be6757441da002f9fcc9eebcecd
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/383779
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>
Scan requests will be re-sent
if non-critical failure has
happened.
This is actually required, as
some Virtio SCSI devices require
a dummy request to clear it's
POWER ON OCCURED unit attention
status after Virtio device init.
The very first request might fail
with asc = 0x29 (POWER ON, RESET,
OR BUS RESET OCCURED), but
subsequent requests will be
processed correctly.
Change-Id: I809bfe7952062995078f33dccb92192d722e6574
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/383689
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>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1df83cbd6414a1bb8f54328c735950b9476e323b
Reviewed-on: https://review.gerrithub.io/384105
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Virtio spec say that any IRQ requests are only hints. So try to limit
number of interrupts generated by vhost by defining minimum interval
between sending IRQ. Coalescing is disabled by default. Can be enabled
using RPC command 'set_vhost_controller_coalescing'.
Change-Id: I9b96014d004ea0ea022b4498c6b47d30d867091a
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/378130
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>
First this change moves spdk_subsystem_fini() to trigger on
spdk_app_stop(). This ensures that spdk_subsystem_fini() is called
before reactors are stopped in spdk_reactors_stop().
Finish paths for subsystems, bdevs and copy engine is now
asynchronous.
Each of those three mentioned have to make sure they are
asynchronous as well.
Only bdev that currently has requirement for asynchronous finish
are logical volume.
Thus the change in vbdev_lvol.c making it move to next bdev module
only after all lvol stores were unloaded.
Fio_plugin finish of bdev and copy_engine was removed for now.
Next patch in series adds it back with async support.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I80ee2d084f3d82c50bf1329e08996604ae61b1b3
Reviewed-on: https://review.gerrithub.io/381536
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>
The *TODO* section was outdated. Most of
this README's contents have been already
moved to doc/virtio.md and doc/bdev.md.
Change-Id: I2f2108afdc543276c9f08ae053ccebdbd6b1a229
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/384054
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Inserting into g_spdk_lvol_pairs list is done in vbdev_lvs_create_cb,
at that point it is known that it can be used. Meanwhile removing
was done at start of _vbdev_lvs_remove, to prevent possibility to
access it when waiting for destruct callback to complete.
This made checking if the g_spdk_lvol_pairs list is empty unreliable
to detect if all lvs were destroyed - they could still be being
processed and callback not yet called.
This patch removes lvs from global list only after the callback of
_vbdev_lvs_remove is called.
It will be used in future patch during asynchronous
finish of vbdev module to determine when all lvs were removed.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I638fe63a80b3cf00e9773f5a8c7be315d2c05555
Reviewed-on: https://review.gerrithub.io/382986
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>
To avoid code duplication those two functions were merged.
New _vbdev_lvs_remove function deals with differences by
additional argument "destroy".
No functional difference should be observed after this patch.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I09067646ec9b9656f361077c54906a618e4e0c48
Reviewed-on: https://review.gerrithub.io/383908
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>
This patch adds new API to remove logical volume store
from device it is on. It is only used from RPC, when
user explicitly requests. It allows to use the device to
use as any other bdev.
vbdev_lvs_unload() is now only called from hotremove and
during application shutdown. Which makes it possible to
load it again during application start up.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If6452ecc3fff99237d1704ff7cd8de4d7133221d
Reviewed-on: https://review.gerrithub.io/382021
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>
If the bdev doesn't support unmap, we should not send unmap I/O.
Instead, use spdk_bdev_write_zeroes(), which has a fallback in the bdev
layer for devices that don't natively support it.
Change-Id: I1bd05d3518716f8e60501dbb4f9da0fee23cf7c2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383491
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
There is a scenario where we can try do unload or remove
lvol store while lvol present on that lvol store is being
closed or destroyed.
Scenario:
1. send delete_bdev rpc command
2. command returns before lvol is actually closed/destroyed
(does not wait for callback)
3. send destroy_lvol_store rpc command
4. lvs is destroyed before lvol is destroyed
5. lvol destroy callback is called on destroeyd lvol store
Aboive scenario can be reproduced using:
spdk/test/vhost/spdk_vhost.sh --integrity-lvol-scsi
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ie715279195bd4b1145cf05d4f5a8477b4fac87f7
Reviewed-on: https://review.gerrithub.io/383595
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>
Currently deleting bdev does not support asynchronous delete
operations. Because of that results are returned before device
is actually deleted and some operation can be peformed on that
device after removal of this device started.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I305c302d8abd5d7c2c0f947fca70c58396872132
Reviewed-on: https://review.gerrithub.io/383732
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>
It used to be NULL.
Fixes: a85a4452
("bdev_virtio/rpc: add construct_virtio_user_scsi_bdev")
Change-Id: I490b41571e5667cf95b59b2e316006d1ef7381e8
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/383892
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>
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I59cbef4ce1bfe8af113c66c2c9cb9f208440c0aa
Reviewed-on: https://review.gerrithub.io/383887
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>
Make sure the recv() can't write beyond the end of the msg buffer.
Change-Id: Ibc4bb51ac3a1c2a027a458d59356b7a5496eca7e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383646
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Use the correct size types (rather than int) for values passed to and
returned from recv().
Change-Id: I2d38eed63e2d9c9f056d1053e156088fd361c88b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383645
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>
Add a name to each lvol which is persisted as a blob
xattr. lvol names must be unique within its
lvolstore.
While here, fix a few lvol_ut issues that were caught
as part of testing the lvol unique names. Also fix
a couple of tests that registered the wrong string
name with CUnit.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6d24d241e8f52158d14886f928d41823bbc93fa9
Reviewed-on: https://review.gerrithub.io/383567
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
There are some upcoming changes which will deprecate
the old lvsuuid_blobid name in favor of an
lvs_name/lvol_name name where these names are
user-specified.
In preparation for this change, rename the previous
lvol->name to lvol->old_name. This will allow us
to add a new lvol->name but keep the original
old_name during the transition.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I10deb219097fa8726c146ab2427ee7373933b97d
Reviewed-on: https://review.gerrithub.io/383534
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Each lvolstore now has a unique name which is persisted to
metadata. Eventually this will provide a friendlier
way to reference logical volumes, in the form
lvolstore_name/lvol_name.
This patch only covers the unique lvolstore name. An
lvolstore may not be created nor loaded if its name
conflicts with an already loaded blobstore.
Currently there is no way to rename an lvolstore to
resolve a conflict. This will be coming in the future.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I842f13b79776e5b8f81e56de10778c35328e8cd3
Reviewed-on: https://review.gerrithub.io/383533
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Fix up the two existing instances of trailing whitespace in text files,
and add a check to enforce that no new trailing whitespace is added.
Change-Id: I2197bed69bb356142aa6d2e4e8261c7434dd358b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383291
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>
Replace POSIX and standard C #includes with the central SPDK stdinc.h
and remove the rte_virtio exclusion from header checking in
scripts/check_format.sh
Change-Id: Ie53d11de7cd9a51c59957e3c500bd8b9b4c4bc5e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383003
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Remove the exclusion of the rte_virtio code from scripts/check_format.sh
since we will be maintaining this code going forward (unlike rte_vhost,
which we intend to keep up to date with upstream DPDK).
Change-Id: I30c186e566ca777dff552a36af53443d197a8824
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383002
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
If an I/O fails during the write zeroes fallback to write on a split
I/O, the previous code would call spdk_bdev_io_complete() again on the
same I/O, causing infinite recursion.
Fix this by restoring the original user callback before completing the
I/O, as well as using _spdk_bdev_io_complete() rather than
spdk_bdev_io_complete() to avoid double-counting the statistics.
This also preserves the original bdev_io->status code set by the module,
rather than always setting it to SPDK_BDEV_IO_STATUS_FAILED.
Change-Id: Ib71fa6e54eed3d5823652971f7c439e0ff236fc1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383506
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
This patch is a continuation of patch https://review.gerrithub.io/#/c/383252/
on which this series should be rebased. This series introduces
spdk_lvol_open function where reference counter should be also used.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I962db95eaba34c7c18e639076ad86696e8209196
Reviewed-on: https://review.gerrithub.io/383264
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
If we don't delete the super blob, this blob structure
will leak.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I56d0ca4884846aee0c7865f9c600d6c43811373c
Reviewed-on: https://review.gerrithub.io/383311
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
This will be used in a future patch to ensure we do not
allow creating or loading an lvolstore with a names that
matches an already opened lvolstore.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I37e8786f91cd578dd36fbec99ca23609419fc8f8
Reviewed-on: https://review.gerrithub.io/383012
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Currently this is just a free(), but a future patch will
also remove spdk_lvol_stores from a common list.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iff0f14fbe2003448d24f6fb1484f0e95acfe90ff
Reviewed-on: https://review.gerrithub.io/383011
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This patch introduces lvol store and lvols parameters saving
on persistent memories and loading it from saved data on app start.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ia63f0cf3d6365d59f31c5f0a1724636bfe73b5b8
Reviewed-on: https://review.gerrithub.io/375764
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>
The vhost connection can be closed
concurrently from 2 places:
* the connection thread itself
* rte_vhost_driver_unregister
The connection thread will terminate
the connection if any recv error
occured. The unregister function
will terminate the connection
together with the thread.
However, there is no sychronization
between those two. The connection
thread runs in the background
without any mutex.
The rte_vhost_driver_unregister
now signals the connection thread
to terminate itself and waits
until it's killed.
Change-Id: I012e97ebb8a79edcb2c17c28b2fc7e8041bf92b3
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/383085
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
pci_dump_json_config() is used for both legacy and modern PCI virtio
devices, so move it out of the #ifdef PCI_LEGACY_SUPPORT so it is
available when building against older DPDK versions.
Change-Id: I986f9e6a81abda64d77f954b15807d06e35d1748
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383487
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
It is possible that a user will call spdk_bs_unload() with blobs
list not-empty. Instead of just asserting that, now the call fails
with appropriate error.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I83818453d6c90ff9b5bf657c90e12b2f9d5ca013
Reviewed-on: https://review.gerrithub.io/383220
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
17.05-rc4 is the version e.g.
rte_pci_ioport_read function was
introduced in. The bdev_virtio
module previously did not compile
with older DPDK versions.
Change-Id: Ib96d5d7934166acc552515b02bfba25b71929438
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382829
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>
This was looking at req, but req had already been allocated and checked
for NULl previously; this line was intended to be checking lvol_req.
Change-Id: I8603d35fb4582c109e9d02f4964bbd6d21735324
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383312
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Casting pointers without checking their length could
potentially lead to a crash
Change-Id: I7c61e5818ecfbf32bb363858965503341353c51e
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/382420
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Unmap does not guarantee that erased blocks will return all zeroes.
using write_zeroes when unmapping metadata gives the
desired behavior for a blob.
Only metadata pages will be cleared with write_zeroes in this patch;
blob data clusters will still call unmap. This behavior may be made
configurable in a later patch (to allow the user to request zeroing of
clusters rather than just unmapping).
Change-Id: I1b210abac110867ce703bcfdeb634eb45aa9d5c9
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/372004
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
if write_zeroes is not supported by the block device, we can get the
same behavior by simply writing a buffer full of zeroes to the blocks
we want to erase. I also incorporate splitting into the bdev layer to
accomodate large i/o.
Change-Id: I8fa1bfaaf22d7bfc6e3afb6e89d22fa9f7767e55
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/373829
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This is necessary to avoid failing very large write_zeroes operations.
This is the minimal workaround to get the current bdevio tests to pass -
the real fix will be implemented in the bdev layer later.
Change-Id: I4e49f1b4da5d4c7f9507757d6c71ba3880d22437
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/383306
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
There is no need to wait until an atexit() to unlink these - we can do it immediately
since the open refs will still be valid.
Note: changed the remove() calls to unlink() to be more precise, since these are
files and not directories.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib160131bcf3beb9783c6fc4de021f64c43c943a9
Reviewed-on: https://review.gerrithub.io/382697
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
This goes along with previous patch in series.
Adding functionality to remove logical volume store from
device.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6338a35ed02838498a3cd9bb2dddd25803e65f79
Reviewed-on: https://review.gerrithub.io/382020
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>
Currently exposed API allows to load/unload and to
initialize blobstore on a device.
A spdk_bs_destroy() call is added in order to reach
functional parity with spdk_bs_init(). It was not
possible to remove blobstore from device from within
SPDK previously.
spdk_bs_destroy() takes blobstore pointer as argument
(instead of bs_dev), because blobstore has to be already
loaded to destroy it.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I2c493a4407868fcf08fd1766a19fc8463f634ef5
Reviewed-on: https://review.gerrithub.io/382019
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>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I3a86f28056e67b3c237441fb1048ca6ccd081ae7
Reviewed-on: https://review.gerrithub.io/383252
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>
Close and destroy lvol functions should support callback
functions so that they can be processed sequentially
and also give user result.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I9e87fb281916c65c17b2b7e54e91228844962048
Reviewed-on: https://review.gerrithub.io/383230
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>
SPDK can now be compiled without
the virtio driver.
Change-Id: I92999c871d28875d519749a73a7f2230c3881fbe
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382828
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>
We only sync the metadata and data in the runtime of blobstore, which
means we only update the used md bitmap and used clusters bitmap in memory.
if the system crushed, we have no chance to sync the used md bitmap and
used clusters bitmap into disk, then next time when we try to load the
blobstore, all the data will lost, this patch add the logic to recover the
valid data from last dirty shutdown. We will go through all the metadata pages
to find all valid data and rebuild them.
Change-Id: Ieb7c5f932206b1b68fdde0cee35f2d2cb3a4f309
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/376470
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>
A recent patch did some refactoring on how the superblock is
written out - it introduced a bug where on load we would
write out INVALID for super_blob id and a null bstype when
clearing the clean bit.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1d6256e35030645b3e8fda83bfe0f74aeb635733
Reviewed-on: https://review.gerrithub.io/383129
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Some future patches will require specifying an lvol_store
name when calling spdk_lvs_init(). This means that passing
NULL for spdk_lvs_opts will no longer be an option. So
add an spdk_lvs_opts_init() (similar to spdk_bs_opts_init)
which will initialize a default value for the cluster size.
While here, prepend an underscore to spdk_setup_lvs_opts, since
this function is not part of the public SPDK API.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I155bcfd0c396017304bb3d58b7511ada71dade17
Reviewed-on: https://review.gerrithub.io/383030
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
init_grp.c has init_grp_destroy() function but does not have
init_grp_create() function. Hence add init_grp_create() function.
init_grp_create() function check duplication of init groups.
Change-Id: I49c64254846ae4edd7a0bb2cf3250fb6f53239f4
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381243
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
We interpeted max request queue
count as number of all queues.
It did not take into account
eventq and controlq.
This patch also fixes overall
max_queues negotiation for
modern PCI devices.
Fixes 8b0a4a3 ("bdev_virtio: implement multiqueue")
Change-Id: I834cb973772ca5946ac26d18bd3eeb2783f48ea9
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382816
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>
It was wrongly assumed that
each READ will contain at least
one iovec. This could potentially
corrupt the desc array.
Change-Id: I48ca7efbe4bea897e0ad16184452bddcf3daf49b
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/383009
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Only the initial xmit_pkt is checked
against an error, the subsequent
xmits are just asserted. As scan
messages are sent 1-by-1 if the first
request (containing 3 iovectors) has
been enqueued successfully so should
the next ones.
Change-Id: Ie102256a42ef1c67132d606af90ab96771adba10
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382784
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>
In case of not enough free descriptors
the bdev_virtio will fail the I/O with
NOMEM status.
Change-Id: I1cb0cd5453ff70468898bc8e414b53b9c64dbe50
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382783
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>
Previously all bdevs were using
hardcoded name Virtio0.
Change-Id: Ib990027a0edd4e200aa4b6f4689ccb9e0824a9c3
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382926
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: Changpeng Liu <changpeng.liu@intel.com>
This doesn't change any behavior
as queue_idx was always either
0 or -1, but makes it clear that
this function always returns
-1 on error. This is required
by current io_channel implementation.
Change-Id: I2b613ab9ff1e48d5b4aee0cd499bbc0a04cb765c
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382927
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>
Always start bdev pollers on the calling core.
This removes the lcore concept from the bdev poller abstraction and
simplifies the job of spdk_bdev_initialize() callers providing their own
poller and event implementations.
All callers except the NVMe bdev hotplug poller already used the current
core as the parameter. The NVMe HotplugPollCore option was undocumented
and unused in any of the tests or example configuration files, so it
should be safe to remove.
Change-Id: I93b466e1e58901b8785c40cbe296fa46c157850f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382857
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
A single thread that initialized
bdev_virtio subsystem will be used
to poll control queues for all
virtio devices.
Every io_channel will put it's e.g.
RESET requests to the controlq MP-SC
spdk_ring. The controlq poller will
dequeue these requests and put them
into the virtio queue. The same
poller will then poll for completions
and send them to proper threads
that submitted given requests.
Change-Id: I90ae7c5d76dc89cc52ff69cf2a60e27a9314557c
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382201
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>
Added a wrapper for rte_ring_count().
Change-Id: Ia12fde3f250604a0f801309ed1c4706a311e7896
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382919
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@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>
Some error messages were printed
outside of the error-checking
if() condition.
Fixes: bd273d4 ("rte_vhost: replace strerror() with spdk_strerror_r()")
Change-Id: Icf965ae56ffc2e0970572308b38607ac63cdb1f2
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382943
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>
Our previous implementation makes the buffer allocation
in an unfair way and this patch can solve this issue.
With this patch, we can use limited buffer to support
high I/O depth.
Change-Id: I0e7a073c0b4539090218aa461d50620287bb4b63
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/382528
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>
Values from previous bdev_ios
were reused and were taken into
account e.g. in bdev_io_get_buf()
to check if a buffer is already
assigned.
Change-Id: I239aaf83a4ce8a9342c1820e3ac9e9ccf6a28336
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382959
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>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9218b618544def301a4509eda1b266390a80dba5
Reviewed-on: https://review.gerrithub.io/382830
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>
Add newlines to the debug logs.
Also dump the mismatched bstype via SPDK_TRACEDUMP() rather than as a
string, since it may not be null terminated.
Change-Id: Icad567373c56f24aea550903a1370c3734465472
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382855
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Previously, spdk_trace_dump() took a const uint8_t * as the buffer, but
it is more flexible to allow any type to be passed (we are just going to
interpret it as an array of bytes anyway).
Change-Id: I1750316928cd330ed461bb513ff8af37e0170ef3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382854
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Rather than using char arrays to represent blobstore types, just use the
publicly-defined struct spdk_bs_type.
Change-Id: I8bbfd95085e16f9d53106c176038e067ff1266d7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382853
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
These #defines are not currently used, and they have equivalents already
defined in spdk/pci_ids.h:
VIRTIO_PCI_VENDORID == SPDK_PCI_VID_VIRTIO
VIRTIO_PCI_DEVICEID_SCSI_MODERN == PCI_DEVICE_ID_VIRTIO_SCSI_MODERN
Change-Id: I0016ab0a26f4aa7ff4a5ee10f66da867b590e0e6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382734
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
strerror() is potentially not thread safe; use the thread-safe SPDK
wrapper instead.
Change-Id: I5f6f4b0b19a0298b07f71f05aee4574e8b21f5fa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382732
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This patch also introduces
vq->poller_ctx. It will be later
reused for per-virtqueue task pools
to allow multiple threads using
the same virtqueue.
Since at the time of scanning there
is no I/O traffic, this field is
now being used to keep scan base
pointer. It has to be freed if an
initialization error occurs.
Change-Id: Ia54ee6c8402d38218dc811b4994761105d17269a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382199
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>
This is required for virtio-initiator,
where multiple io_channels have to
share the same virtio queue. A single
poller will receive responses from
a virtio queue and send the completions
to the thread that submitted bdev_io.
Change-Id: I951c7655aaa17d41a680d437661afff27d2c3077
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382200
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>
The get_lvol_stores RPC had typos in the free_blocks and total_blocks
fields (they were named "free_num_blocks" and "total_num_blocks", which
didn't match the names of the actual variables).
Change-Id: Ib66b04ec2f0c272048a826bfa59338db1d028e34
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382522
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I85ce977183be4de9efacb66637e7895f22f58508
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382521
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This allows the caller to know which bdev module is exporting the bdev
and therefore how to interpret the driver_specific fields.
Change-Id: I09641645875827eabc0a831fff5b0b5bed6b03d0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382519
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Each virtqueue will now contain
it's own buffer for I/O tasks.
Some of the task struct fields
are now the same across subsequent
I/Os, so they can be now set
just once - at the vdev start/stop.
This simplifies the code, the
debugging process and also introduces
additional sanity check preventing
vhost from processing two requests
with the same id at the same time.
Change-Id: Idcf388e8bf7c92e5536199c35eb0eb6339c00d84
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/369114
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>
This enable storing SPDK specific stuff per queue. First use of
this will be event index feature.
Change-Id: Ieca6fa47a6f2e23bec73d2cda8b0ed8b9185bd28
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/376636
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>
Introducing bstype as a way to identify and verify
blobstore type.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I50267b5408625be10fe0c146ae329016d5509b4a
Reviewed-on: https://review.gerrithub.io/380476
Reviewed-by: Jim Harris <james.r.harris@intel.com>
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>
The virtio bdev should only attempt to issue SBC commands if the SCSI
device is a block device.
Change-Id: Ib29edbd19f9f34bdafe5ea3f7085c57537134625
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382714
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>
The SCSI spec defines two separate fields within the first byte of
the Inquiry data. Define them as bitfields and add enum values for the
peripheral qualifier field.
Change-Id: Ibbb158338da199fc1b67b04c52ec91633577c571
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382713
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>
the function of spdk_iscsi_find_init_grp() is duplicated with
of spdk_iscsi_init_grp_find_by_tag(). The later one should be kept.
Hence delete former one.
Change-Id: I8d397648bd400550445de49c8a7731f0932f5324
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381244
Reviewed-by: John Kariuki <John.K.Kariuki@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>
Change-Id: I6d3669bc19b51fd72af7ea27aa4d2a88dee59e58
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382509
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Remove some magic numbers from the code.
Change-Id: I494d57331888dd03f0bbff1f6beeac46139d7e96
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382348
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>
Virtqueues now have to be "acquired"
by a logical CPU core in order to
perform any traffic on them. The
acquire mechanism is thread-safe to
prevent two reactors accessing the
same virtqueue at the same time.
For now a single virtqueue
may be used by only one io_channel.
Support for shared virtqueues will
be implemented in future.
Added new param "Queues" to the
virtio config file for VirtioUser
bdevs. VirtioPci will use the
max available queues num -
negotiated during QEMU startup.
Change-Id: I3fd4b9d8c470f26ca9b84838b3c64de6f9e48300
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/377337
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>
Replaced old PMD_*LOG with
* SPDK_WARNLOG
* SPDK_ERRLOG
* SPDK_DEBUGLOG
Added 3 new trace flags:
* virtio_dev - SPDK_TRACE_VIRTIO_DEV
* virtio_pci - SPDK_TRACE_VIRTIO_PCI
* virtio_user - SPDK_TRACE_VIRTIO_USER
This patch also makes error
messages to be printed on
non-debug builds. Some messages
should be still reworded, but
that will be done in a separate
patch.
Change-Id: I2dd4c71dfce20cde0ef010a1d91ac6f166bb2c98
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382620
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>
Moved their contents to virtio_dev
files. virtio_queue was already deeply
connected with virtio_dev. There's
no need to keep them separate.
Change-Id: I540c04eb954fe0618817c020f9453aebf3d98ba9
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382619
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>
Simplified some code.
Change-Id: I9fc42da93a4c2df3714775d73508de118a5e6b1a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382618
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>
Documentation of rte_eal_init() lie. At least two parameters (huge-dir
and file-prefix) are held and used internally trought the lifetime of
application.
Change-Id: Ie418b5f2b0d7fbea5c217e47a555a520d3256360
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/382677
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Previously two spdk_events were allocated in spdk_app_start().
Now app allocated spdk_event for function to be called after
initialization is complete. Meanwhile subsystem allocates
its own spdk_event.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I4822f76d30cc2f7b95a86a4ffbfc61b80c0a903e
Reviewed-on: https://review.gerrithub.io/382673
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>
spdk_lvol_destroy() and spdk_lvol_close() behave very similar to
each other. With exception that spdk_lvol_destroy() deletes blob,
after closing the blob.
The order of calls in spdk_lvol_destroy() case:
- spdk_lvo_destroy() calls spdk_bs_md_close_blob()
- _spdk_lvol_delete_blob_cb is callback from closing the blob,
which calls spdk_bs_md_delete_blob()
- _spdk_lvol_close_blob_cb is callback from deleting the blob
The order of calls in spdk_lvol_close() case:
- spdk_lvo_close() calls spdk_bs_md_close_blob()
- _spdk_lvol_close_blob_cb is callback from closing the blob
Lvol was removed from lvol store lvol list in two cases,
spdk_lvol_destroy() and _spdk_lvol_close_blob_cb().
This caused lvol to be removed twice from the list in
lvol destroy case.
This change makes it so it is more clear, that lvol is removed
from lvol store lvol list in both cases and just once.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I204645850ca2c46f03a9035518b00f50c75e2b1a
Reviewed-on: https://review.gerrithub.io/382425
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>
Similar to blobstore unload, lib/lvol assumes that unloading
lvol store is only possible after no lvols on it are open.
Before spdk_lvs_unload() is possible, for each lvol
on that lvol store spdk_lvol_close() or spdk_lvol_destroy()
has to be called.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I86bae67ec322a61fdc0045d799854eecd1f36407
Reviewed-on: https://review.gerrithub.io/382252
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>
Several fields in struct virtio_user_dev are not referenced anywhere (a
few have cleanup code but no other assignments); remove them.
Also drop is_vhost_user_by_type() and virtio_user_handle_cq(), which
aren't used anywhere.
Change-Id: I7c80ccbadbd5263a2886dc9028108b898d6485ae
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382505
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
These are just noise, since we don't enable the unused parameter
warning.
Also remove an unused variable, txvq, in virtio_dev_start() that
had been left behind since it was marked as __rte_unused.
Change-Id: I7bda85ef5f2208dd36d8f1806d8241a04b893123
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382494
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
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>
These were included under #ifdef RTE_EXEC_ENV_LINUXAPP, which is not
defined in the SPDK build system, so they were already not getting
included.
Change-Id: I6b90c8230632647bb9237f86ec52c09133891a2d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382488
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
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>
Replace the DPDK rte_branch_prediction.h likely/unlikely with
spdk/likely.h spdk_likely/spdk_unlikely.
Change-Id: I51ad42ee2b29b8f33436fa960deda67a0dd0b0f0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382486
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Clarify some error messages
and simplify the code.
Change-Id: I586ea55a1d9fa10142d4a9d469b62f1b83076cd5
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/381925
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This function was only useful for old (and incorrect) iSCSI
topology with SPDK. Hence this function can be removed.
Change-Id: I6147382b0731a896df3c988fae0173923a9a85fc
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381242
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
These are identical now that the spdk_bdev_io I/O-specific unions were
combined.
Change-Id: I2579f4fd100c5ebb3550b806c7fdac38c6160a69
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382373
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
For the normal case, we can avoid re-adding it into
pending data buf list if there is no buffer.
Change-Id: I400e3c6c60bb1d1df13782faf2dd32ca2bd897a3
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/382402
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>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: If809fe808150498c7ad6797855fda3097e3b0c84
Reviewed-on: https://review.gerrithub.io/382470
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>
This patch reduce duplicate data structure and make some functions common
for both bs load and unload porcess in the future.
Change-Id: I40b2135e89a705aa5073c1ded4c7b28be4b32f6e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/381912
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>
Three new RPC are added, that allow to control pmem pool file.
- create_pmem_pool(path to file, total file size, block size)
- pmem_pool_info(path to file)
- delete_pmem_pool(path to file)
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id9025b7d988608957700b41f74874159d18c6ad3
Reviewed-on: https://review.gerrithub.io/379006
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>
Remove one use of DPDK-specific functions in the virtio initiator code.
Change-Id: I538185270da83674e937dac64c9b1130fab36ac4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382074
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: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
This is required for adding
optional params for vdevs.
Since virtio-initiator README.md
had to be changed, some outdated
entries from TODO section has
been removed as a part of this
patch as well.
Change-Id: I472a966d8e4166305fb19ad3ab20e53289a1e071
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382347
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>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I68a56666d30a550de4a2dc5a66fb669dfbad12dd
Reviewed-on: https://review.gerrithub.io/379659
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>
Current implementation supports only adding port to scsi_dev.
This change is required to support dynamic remapping of portals.
Change-Id: Idce49aeae43c8861ebe2807df853694f7bacf884
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/379931
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Some problems with indirect descriptors shown. Disable it for now to
have time to investigate it.
Change-Id: I8c6cfff94dc2159ab01f72986a8ae7d42c353e8b
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/382301
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
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>
The construct_malloc_bdev RPC method now takes an optional "name"
parameter to request a specific name for the created bdev, rather than
using the auto-generated Malloc%d-style name.
scripts/rpc.py is updated to add the new optional parameter, and it uses
-b/--name to match the corresponding parameter to construct_nvme_bdev.
Also update one of the test scripts to use the new parameter to get test
coverage.
Change-Id: I1f5bf76f406b8ea8a709d856f7624a38fbfa0d5f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/381728
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>
Change it from error_log to debug_log level to
avoid missleading while there does not have
GPT_PROTECTIVE_MBR type.
Change-Id: I51f7bf2994db227b4c9f1bf80d3bb0e05c047e59
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/382080
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>
For using SoftRoce, there will be packets loss,
so we need to use this value for re-transmission.
retry_count means the maximum number of times that
a data transfer operation should be retried on the
connection when an error occurs.
Change-Id: Ibd81a33d3838bbdf0c054f01666e7ec59bb0a38f
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/382079
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>
bdev_opened field in spdk_bdev structure is no longer required.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ie4a368425b11b1c2e1a3a48b5858857b3935498b
Reviewed-on: https://review.gerrithub.io/381375
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Idd19b8be38a843dfd50710c09d0c6c31773c2f0c
Reviewed-on: https://review.gerrithub.io/380014
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ia6b6e5352ce4da04784fb0a3ea1efd0552650067
Reviewed-on: https://review.gerrithub.io/381548
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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>
Fixed typos, updated comments and
simplified the code.
Change-Id: I7eaa7227518d376d86cd4a6eb0348f1efc7b47fd
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382024
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>
In multiprocess applications some shared memory files are left around
after a primary process exits because they can be used by secondary
processes to init memory. However, all primary dpdk processes create
these folders so we need to delete them after a single process spdk
application exits.
Change-Id: If51be95811fb66632316ae260762e5291641b537
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/381721
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>
This is needed for proper IO channel allocation failure handling.
Change-Id: I795e5bcce5296a52c119d2300974b8cb3fc0d576
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/381187
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>
Closing the framework has to go through all subsystems
without failure, so return codes are unnecessary.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I53c9b4df12d2357e641130869f398b18637e6ff7
Reviewed-on: https://review.gerrithub.io/381681
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>
spdk_app_fini() changed to void, as no operation within it
can fail with meaningful return code.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If77cbf745a8e3fcba4ea24411aa1816f3910cde7
Reviewed-on: https://review.gerrithub.io/381537
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@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>
The task was being aborted before
setting it's free_cb. This
results in i.e. not allowing
vhost device to stop it's pollers,
as it would endlessly wait for
this task to finish.
Change-Id: I0de2d1f21da109db1045e433c07f153316e09997
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/381866
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>
Every descriptor may now contain
a separate descriptor table.
This increases the maximum number
of concurrent IO in a virtqueue
from about (vq->size / 3) to
(vq->size * SPDK_VHOST_IOVS_MAX).
Knowing that SPDK_VHOST_IOVS_MAX
is 128, and assuming that vq->size
is 128 (current hardcoded limit
for QEMU), this gives us over 16k
concurrent possible iovectors
on the fly
Change-Id: I0853d80f6f90d53f8774231972b430a5bf05460e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/373703
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>
Also squashed function has_next_desc
into get_next_desc to simplify the
code.
We can't just mask indexes with
(desc_table_size - 1), since in
indirect descriptors case
desc_table_size might not be a
power of 2.
Change-Id: I8053b0e37c553548d76c7a9cfe6b4dbc11c28cfc
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/373744
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>
It was en empty function before.
Also, don't stop the device in
virtio_user_dev_uninit, the device
is stopped separately before
removing (unititializing) it.
Change-Id: Ib540ee4a55bd3f983b50f35a138c1690daba1d98
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/379156
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>
This patch also resets each device
before destructing it. This is urgently
required for virtio_pci, as it notifies
the QEMU about our shutdown.
This patch fixes running subsequent
bdev_virtio instances in PCI mode within
the same vhost.
Change-Id: I2569251362f2aaf058f6e44f068b280244bd38c1
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/381201
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>
With this new API, callers can attach one specific ctrlr identified by
the transport ID directly along with optional ctrlr opts. If connecting
to multiple controllers, it is still suggested to use spdk_nvme_probe()
and filter the requested controllers with the probe callback.
Two primary use cases:
1) connecting to the NVMe-oF discovery controller
2) more straightforward way to connect a specific controller (avoiding
the probe callback)
A typical usage of this API with specific ctrlr_opts:
1. struct spdk_nvme_ctrlr_opts user_opts = {}
2. Call spdk_nvme_ctrlr_get_default_ctrlr_opts(&user_opts, sizeof(user_opts))
3. Modify the content of the initialized user_opts with user required value like
user_opts.num_io_queues = 8
4. Call spdk_nvme_connect(&trid, &user_opts, sizeof(user_opts))
Change-Id: Idf67ee5966f6753918c12604342c892d2f3bbe3a
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/370634
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>