Commit Graph

371 Commits

Author SHA1 Message Date
Anil Veerabhadrappa
9d1e666798 conf: parse "C2HSuccess" parameter for TCP transport only
"C2HSuccess" is only valid for TCP transport. So this parameter
should be looked up only for TCP transport. Without the change,
spdk_nvmf_parse_transport() would bailout early for RDMA and
other transports without every creating them.

Signed-off-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Change-Id: I34bdff2f4ab930516743cd5dbf022d75e60fd85c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459571
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-28 07:03:45 +00:00
Or Gerlitz
6629202cbd nvmf/tcp: Use the success optimization by default
By now (5.1 is released), the Linux kernel initiator supports the
success optimization and further, the version that doesn't support
it (5.0) was EOL-ed. As such, lets open it up @ spdk by default.

Doing so provides a notable performance improvement: running perf with
iodepth of 64, randread, two threads and block size of 512 bytes for 60s
("-q 64 -w randread -o 512 -c 0x5000 -t 60") over the VMA socket acceleration
library and null backing store, we got 730K IOPS with the success
optimization vs 550K without it.

IOPS           MiB/s    Average       min      max
549274.10     268.20     232.99      93.23 3256354.96
728117.57     355.53     175.76      85.93   14632.16

To allow for interop with older kernel initiators, we added
a config knob under which the success optimization can be
enabled or disabled.

Change-Id: Ia4c79f607f82c3563523ae3e07a67eac95b56dbb
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457644
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-26 06:24:03 +00:00
Darek Stojaczyk
29093c7f01 event/app: don't call start_fn twice when json config is used
When JSON config was used, app layer was calling the
app start callback twice - once from internally-sent
"start_subsystem_init" RPC, and once from the app layer
itself.

In case of JSON configs, the callback from within the
RPC was actually called prematurely, as the real RPC
server was still starting in the background at that
point. We still need to start the app from that RPC in
case of `--wait-for-listen` option, but for JSON configs
it doesn't make sense. Just ignore it now and rely on
json config load completion callback to start the app.

Fixes #816

Change-Id: Ib54d624f3167137216c910b2d947bbd1dc5023b1
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458351
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-06-24 15:54:49 +00:00
Darek Stojaczyk
a7d9fc4a4d event: fix segv on json config read failure
If reading the JSON config file has failed, we entered
spdk_app_json_config_load_done(-ERRNO) and tried to
close a client connection that was never initiated,
which resulted in NULL dereference.

To fix it, just check if client_conn != NULL before
attempting to close it.

Change-Id: I7340567c45e795f77110c2914e94ba83fa8d1bff
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458350
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-06-24 15:54:49 +00:00
Wojciech Malikowski
8233a5a8e1 event/subsystems/vmd: Added VMD subsystem
Added new VMD subsystem to enumerate
devices behind VMD when event framewrok
is used.

To enable VMD, user need to provide Enable
flag via config file.

Change-Id: I89bfe22b127c00d358dac7336ffb44b0c0f426ea
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458443
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-06-24 09:59:00 +00:00
paul luse
46523f33e0 log: passing user-defined log
Change-Id: I993e15a6e75029b0717960d5da31325e7f3522c1
Signed-off-by: zkhatami88 <z.khatami88@gmail.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456407
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-18 03:56:50 +00:00
Changpeng Liu
3ec061800f nvmf: add a persist through power loss configuration file when constructing NS
For reservation feature in NVMoF, we can't support the persist through
power loss feature, now we will add the configuration file parameter
with Namespace, after users set the configuration file parameter with
one NS, then the PTPL feature can be enabled.

Change-Id: Id72699093f7e68318b9529f7bacc5c9804f7f86b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455905
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-12 00:30:03 +00:00
Shuhei Matsumoto
1554a344c9 env: Add free_space parameter to spdk_ring_enqueue
DPDK rte_ring_enqueue_bulk() has free_space parameter to return
the amount of space in the ring after enqueue operation has finished.
This parameter can be used to wait when the ring is almost full and
wake up when there is enough space available in the ring.

Hence we add free_space to spdk_ring_enqueue() and spdk_ring_enqueue()
passes it to rte_ring_enqueue_bulk() simply.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9b9d6a5a097cf6dc4b97dfda7442f2c4b0aed4d3
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456734
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-05 05:23:58 +00:00
Ben Walker
e036215fe9 thread: Add a mechanism to exit a lightweight thread
Lightweight threads may now be exited by calling
spdk_thread_exit() within the thread. The framework
polling the thread can release the resources associated
with that lightweight thread by calling
spdk_thread_destroy().

Change-Id: I6586b9d22556b3874fb113ce5402c6b1f371786e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455319
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-22 04:23:17 +00:00
Changpeng Liu
ad8bd8e313 util: add a new file operation API
The new added API can load file content into a data buffer, which
can be used to read configuration file as well as JSON file, and
we can add WRITE API in future which can be used to implement the
persistent reservation feature.

Change-Id: I9aaca7571648e1ab6dbfdd7cfd6ca34083cbeec2
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453498
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-05-15 18:54:27 +00:00
Ben Walker
266dd568e6 nvmf: Remove use of events from nvmf application
This is all based on SPDK threads instead.

Change-Id: Idfd23d6541a548179be24b16540d62e5d7ea2a5c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451760
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-05-09 04:35:10 +00:00
Ben Walker
e13da83e4a nvmf: nvmf_tgt_host_trid stores a pg instead of a core
Change-Id: I53bb89f6999ab9bbc4bd8e960970454d60beebee
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452473
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-08 21:56:59 +00:00
Ben Walker
534240380b nvmf: Rename spdk_nvmf_get_next_core_rr to spdk_nvmf_get_next_pg
Make this return the next poll group instead of the next core.

Change-Id: Ie62dcbe0b3d869cc1a9b8f8b4ccce8f068ed4dfd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452472
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-08 21:56:59 +00:00
Ben Walker
97d35377c5 nvmf: Don't assume the first core is core 0 when scheduling poll groups
Change-Id: I883ffacca26be0d4fc0a3cfdac5a9c0391b7585e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453013
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-05-08 21:56:59 +00:00
Ben Walker
3555e24505 nvmf: Rename nvmf_tgt_get_qpair_core nvmf_tgt_get_pg
Begin shifting away from being core-centric to instead
be thread-centric.

Change-Id: I0664cdef6766c158f793dd25cc47f6bbd7d928ad
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452471
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-05-08 21:56:59 +00:00
Ben Walker
d34635f04c nvmf: Move nvmf_tgt_poll_group_add lower in file
This is only called from one spot, so move it near there.

Change-Id: I7e98ea9f95ba86e663566f6a1cbbc4f88d89a1d4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452470
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
2019-05-08 21:56:59 +00:00
Ben Walker
67234b6ad4 event: Attempt to respect cpumask when scheduling threads
Individual threads can have their own CPU mask. Attempt to
respect that in the scheduler.

Change-Id: I2bd08d4249bdae32a459ed8770b88090346be5dc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452258
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-08 21:56:59 +00:00
Ben Walker
835d21a2d0 thread: Allow thread schedule callback to fail
Change-Id: Id391c2c03804dda0ad354d98dfe0a75fb4d3d324
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453012
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-08 21:56:59 +00:00
wuzhouhui
ab3f35b226 lib/notify: rename spdk_notify_get_events to spdk_notify_foreach_event
And change type name of callback as well. The new name is more accurate.

Change-Id: I13b63f7d33f60ecea7fdf6e50f57aa6a391a4562
Signed-off-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453151
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-05-07 06:11:27 +00:00
wuzhouhui
87201f17d6 lib/notify: rename spdk_notify_get_types to spdk_notify_foreach_type
And change type name of callback as well. The new name is more accurate.

Change-Id: I3c9cef591faa077a5a034c6f31c44c6f7aefc1fa
Signed-off-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453150
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-05-07 06:11:27 +00:00
wuzhouhui
0acc20ab10 misc/rpc: rename some C functions of rpc methods
Traditionally, The C function name of rpc method "method_name" will be
"spdk_rpc_method_name", so make these function names consistent with
others. No behaviours changed.

Change-Id: Iac5396d4860bdbd78cba9031b4b6358161ec779b
Signed-off-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453197
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-07 05:30:16 +00:00
Seth Howell
cbf74b20b3 nvmf: add srq opts to get_nvmf_transports method.
Print these out for the RDMA transport.

Change-Id: I44ab01088fcab180540a93e024855322036241db
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452272
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-06 18:11:13 +00:00
Seth Howell
350e429a57 rdma: add a flag for disabling srq.
There are cases where srq can be a detriment. Add a flag to allow users
to disable srq even if they have a piece of hardware that supports it.

Change-Id: Ia3be8e8c8e8463964e6ff1c02b07afbf4c3cc8f7
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452271
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-06 18:11:13 +00:00
Darek Stojaczyk
a5599094da vhost: add completion callback to lib init
Prepare vhost lib init to be asynchronous. We'll need
it for setting up the upcoming poll groups.

Change-Id: I3c66b3f17f8635d4b705dd988393431193938971
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452205
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-05-02 17:06:34 +00:00
Darek Stojaczyk
f50d3d7759 reactor: pin spdk threads to their cores
We're about to drop legacy event messages from SPDK libs
and for that we'll replace various lcore numbers with
spdk_thread objects. For now SPDK libs can't spawn their
own threads, so they must use spdk_for_each_thread() and
spdk_get_thread() to retrieve different thread pointers.

The vhost library offers API to construct a vhost device
to be polled on specified cores, and in order to keep that
functionality we'll need to know which core each thread
is polling on. We would like to achieve that with
spdk_thread_get_cpumask(), but right now it always returns
all cores, so this patch changes it to return just
a single cpu on which the thread is actually pinned. It's
only a stop gap, eventually the vhost library will spawn
its own threads with custom cpumasks.

Change-Id: I15947727123c51b23f63727d52079770bfb2e07b
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452204
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-05-02 17:06:34 +00:00
yidong0635
45f0c800bb subsystem/nvmf: remove this redundant assert.
Here g_num_poll_groups is not less than 1 now, so this assert is
redundant.

Change-Id: I4fc539480e2b63c8302af57b18d2164b5161b094
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452367
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-02 15:12:46 +00:00
Shuhei Matsumoto
38527b0786 lib/thread: Fix wrong posix thread name by SPDK thread scheduler
Before enabling SPDK thread scheduler,
each POSIX thread name was reactor_% (% was the core number).

After enabling SPDK thread scheduler, the name of the master POSIX
thread is reactor_% (% is the max core number), and the name of the
slave posix threads are lcore-slave-% (% is the current core number).

SPDK threads are light-weight threads - sometimes also called
green threads or fibers, and so are independent from posix
threads.

But reactor is tied to the POSIX thread in the SPDK event library.

So SPDK thread doesn't rename the POSIX thread at its creation
but reactor renames the POSIX thread at start instead.

This change makes POSIX thread name compatible between before and
after enabling SPDK thread scheduler.

Change-Id: I26e8dabc73e163c9f74e18b3640cf54954603b1f
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451712
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-24 07:40:30 +00:00
Ben Walker
5d0b5e2ce9 thread: Add cpumask parameter to spdk_thread_create
Allow users to optionally specify an affinity mask when
creating a thread. This isn't currently used, but we want
the API to be in its final form for the next release.

Change-Id: I7bd05e921ece6d8d5f61775bd14286f6a58f267f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451683
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-23 20:22:55 +00:00
Gregory Shapiro
14032a984c NVMF: Add model number as parameter to construct_nvmf_subsystem (-d option).
Change-Id: Ia1a458a0ac1c5a17d2955a3f31c6dfe77538eb17
Signed-off-by: Gregory Shapiro <gregory.shapiro@kaminario.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/438562
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-23 16:51:16 +00:00
Pawel Wodkowski
2cccea55ed rpc/notifications: add notification support to RPC client and SPDK host.
Two new RPC calls get_notification_types and get_notifications added.

Change-Id: Ia5288d83cc5e9f18ef1622d3f15b9fe3bbf640ed
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436530
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-09 23:01:52 +00:00
Darek Stojaczyk
1c297d7e30 thread: fix crash on non-contiguous cpu range in cpumask
Limit the thread scheduler to put spdk_threads on
lcores < last_lcore instead of lcores < lcore_count,
which was probably the original intent.

When the cpumask was not a contiguous cpu range, the
thread scheduler failed to schedule any spdk_threads on
the last cores. There was one hardcoded thread created
for each reactor, but the scheduler could squash some
of those into a single reactor. This broke the legacy
lcore-based messages as those expect there to be at least
one spdk_thread per lcore. Any spdk_poller_register()
or spdk_get_io_channel() called from such a legacy
message would fail an assertion, as spdk_get_thread()
returned NULL.

Fixes #743

Change-Id: I81a3f76d9c4788596c697df6ff51b264b99ce10b
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450353
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-08 15:04:30 +00:00
Ben Walker
a0760b9554 nvmf: Use threads instead of events for shutdown handling
Change-Id: Ib22dcb95810f4ed16beb76769e407d48713d85ad
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447117
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-04 05:54:42 +00:00
Ben Walker
9603e344ae event: Use threads for shutdown handling instead of events
Change-Id: I841ebf29ddcb46038a07d5b0b7781aac938c5869
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447116
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-04 05:54:42 +00:00
Darek Stojaczyk
728af01741 event/nvmf: allow running without [Transport] in the legacy cfg file
While useful in NVMf target, this is really annoying
in the consolidated spdk target, where NVMe-oF doesn't
even have to be used. OCF tests currently use iscsi_tgt
just because spdk_tgt requires the additional [Transport]
section in the cfg file. Let's remove that requirement.

Change-Id: I418b47d62dcc06b9513f9f0496dc1e39b9d5a554
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450056
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-04 03:58:22 +00:00
Ben Walker
032920f250 thread: Implement a thread scheduler
Change-Id: Ie1cad80a071f9de066fe18093a4c4c8e726e5a77
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446998
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-02 23:24:30 +00:00
Jim Harris
11b38a585a app, log: clarify how to enable log flags
Let's point users to use --enable-debug now instead of
CONFIG_DEBUG=y.  Also to be completely pedantic, use
"configure" instead of "build" to make it more clear
this flag needs to be passed to the configure script,
not make.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449339
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-29 02:35:48 +00:00
Darek Stojaczyk
8b61834dd0 event: passing env_context from app
Change-Id: Id6b60b16c77ddd0818b6bdd412096b0285cb44b9
Signed-off-by: zkhatami88 <z.khatami88@gmail.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/443649
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-21 17:42:29 +00:00
Darek Stojaczyk
f373369a9c env: add spdk_env_fini()
The function now has to be called before application
exit. At the moment it only frees the dynamically
allocated DPDK command line option strings - something
that was previously done from an atexit() callback -
but there's more to free there.

Note: the function descriptions were partially copied
from equivalent DPDK functions.

Change-Id: I5f4a6607fdfadff9325917259f58fcbc2cedba1a
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447676
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-20 21:05:33 +00:00
Ben Walker
880b8b8af3 event: spdk_subsystem_config_json is no longer asynchronous
Nothing needed this to be asynchronous.

Change-Id: Ic67167d5c1214e832b77ab7fa44aa693026d868a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447115
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-19 15:54:34 +00:00
Ben Walker
eefe8806a2 event: Subsystem level write_config_json callback no longer asynchronous
Nothing actually needs this to be asynchronous. If something
comes up, we can make it asynchronous again.

Change-Id: Icde3af3f8f9efebe75b08471b4afcce3a70da541
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447114
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-03-19 15:54:34 +00:00
Ben Walker
2d0aa1ad8f event: Always process events on each reactor loop
Events are the mechanism by which threads are scheduled,
so events need to be processed even if there are no
threads.

Change-Id: I2e908e6a948709f2122b1c7385b6fd771827b9aa
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447111
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-19 15:54:34 +00:00
Ben Walker
deb8ee5c33 event: spdk_app_start now takes spdk_msg_fn
This callback type takes 1 argument instead of 2.

Change-Id: Ic3710fafb2828f08fc064f7658849b3d20521092
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446997
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-19 15:54:34 +00:00
Evgeniy Kochetov
ed0b611fc5 nvmf/rdma: Add shared receive queue support
This is a new feature for NVMEoF RDMA target, that is intended to save
resource allocation (by sharing them) and utilize the
locality (completions and memory) to get the best performance with
Shared Receive Queues (SRQs). We'll create a SRQ per core (poll
group), per device and associate each created QP/CQ with an
appropriate SRQ.

Our testing environment has 2 hosts.
Host 1:
  CPU: Intel(R) Xeon(R) CPU E5-2609 0 @ 2.40GHz dual socket (8 cores total)
  Network: ConnectX-5, ConnectX-5 VPI , 100GbE, single-port QSFP28, PCIe3.0 x16
  Disk: Intel Optane SSD 900P Series
  OS: Fedora 27 x86_64
Host 2:
  CPU: Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz dual-socket (24 cores total)
  Network: ConnectX-4 VPI , 100GbE, dual-port QSFP28
  Disk: Intel Optane SSD 900P Series
  OS : CentOS 7.5.1804 x86_64
Hosts are connected via Spectrum switch.
Host 1 is running SPDK NVMeoF target.
Host 2 is used as initiator running fio with SPDK plugin.

Configuration:
- SPDK NVMeoF target: cpu mask 0x0F (4 cores), max queue depth 128,
  max SRQ depth 1024, max QPs per controller 1024
- Single NVMf subsystem with single namespace backed by physical SSD disk
- fio with SPDK plugin: randread pattern, 1-256 jobs, block size 4k,
  IO depth 16, cpu_mask 0xFFF0, IO rate 10k, rate process “poisson”

Here is a full fio command line:
fio  --name=Job --stats=1 --group_reporting=1 --idle-prof=percpu \
--loops=1 --numjobs=1 --thread=1 --time_based=1 --runtime=30s \
--ramp_time=5s --bs=4k --size=4G --iodepth=16 --readwrite=randread \
--rwmixread=75 --randrepeat=1 --ioengine=spdk --direct=1 \
--gtod_reduce=0 --cpumask=0xFFF0 --rate_iops=10k \
--rate_process=poisson \
--filename='trtype=RDMA adrfam=IPv4 traddr=1.1.79.1 trsvcid=4420 ns=1'

SPDK allocates the following entities for every work request in
receive queue (shared or not): reqs (1024 bytes), recvs (96 bytes),
cmds (64 bytes), cpls (16 bytes), in_capsule_buffer. All except the
last one are fixed size. In capsule data size is configured to 4096.
Memory consumption calculation (target):
- Multiple SRQ: core_num * ib_devs_num * SRQ_depth * (1200 +
  in_capsule_data_size)
- Multiple RQ: queue_num * RQ_depth * (1200 + in_capsule_data_size)
We ignore admin queues in calculations for simplicity.

Cases:
1. Multiple SRQ with 1024 entries:
   - Mem = 4 * 1 * 1024 * (1200 + 4096) = 20.7 MiB
     (Constant number – does not depend on initiators number)
2. RQ with 128 entries for 64 initiators:
   - Mem = 64 * 128 * (1200 + 4096) = 41.4 MiB

Results:
FIO_JOBS   kIOPS     Bandwidth,MiB/s  AvgLatency,us  MaxResidentSize,kiB
       RQ       SRQ     RQ      SRQ    RQ       SRQ      RQ       SRQ
1      8.623    8.623   33.7    33.7   13.89    14.03    144376   155624
2      17.3     17.3    67.4    67.4   14.03    14.1     145776   155700
4      34.5     34.5    135     135    14.15    14.23    146540   156184
8      69.1     69.1    270     270    14.64    14.49    148116   156960
16     138      138     540     540    14.84    15.38    151216   158668
32     276      276     1079    1079   16.5     16.61    157560   161936
64     513      502     2005    1960   1673     1612     170408   168440
128    535      526     2092    2054   3329     3344     195796   181524
256    571      571     2232    2233   6854     6873     246484   207856

We can see the benefit in memory consumption.

Change-Id: I40c70f6ccbad7754918bcc6cb397e955b09d1033
Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/428458
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-03-15 19:19:17 +00:00
Ben Walker
50c48ee92d event: Eliminate extra event in spdk_subsystem_init
This isn't required anymore because spdk_subsystem_init
is now always called after an event has been executed, so it
always runs after the framework has initialized.

Change-Id: I05e1a4dd605f27247b6d43f5234173e07d9b9dd2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446996
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-08 03:21:45 +00:00
Ben Walker
4d6a89044f event: No longer require event in spdk_subsystem_fini
Just use a function pointer and a context.

Change-Id: I2d41ed2572d892f3328aadf7f22d8696816bf4d1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446995
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-08 03:21:45 +00:00
Ben Walker
f90c3be49e event: Don't use an event to initialize RPC
Now that the boot strap event exists, this is not
necessary.

Change-Id: I277179fbc15ebe140fd22be1b67847cf23c6153e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446994
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-08 03:21:45 +00:00
Ben Walker
f155c98084 event: spdk_subsystem_init no longer requires an event
It just takes a function pointer and a context instead.

Change-Id: Id8cdc968ddbc3776f60ad73e9aa09983ca03fa3f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446993
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-08 03:21:45 +00:00
Ben Walker
d92a1fb4ac event: spdk_app_json_config_load no longer requires an event
Take a callback and an argument instead.

Change-Id: I9edda1a9bd506e12f309e52e520e97c0d705d6a2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446992
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-03-06 08:26:04 +00:00
Ben Walker
46777dd8b9 event: Eliminate extra event when loading JSON config
Now that there is always one event to bootstrap,
we don't need an event here.

Change-Id: Ic87501461a608f5b15745a50b6e15f0f28aa55c2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446991
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-06 08:26:04 +00:00
Ben Walker
744857a79a event: Eliminate g_app_start_event
Change-Id: Ied9c6ebe5e15ee66d6d9695e55b04b33200dd33b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446990
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-03-06 08:26:04 +00:00