Change the return type of spdk_channel_msg from
void to int. If this msg executed in a failure,
we do not need continue sending the message to other
threads, we can just tell the original thread, and
let the orgiginal thread call the spdk_channel_for_each_cpl
call back.
Thus we can track the qpair creation/destroy case for bdev
reset in nvme bdev module;
Change-Id: Ide9dffd1f84a29fcf61d8339a9ece2a0245d968d
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/387284
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>
Change-Id: I8ea8c59a0c67176c0c0c39abf807afad61ff3828
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387689
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>
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>