Commit Graph

6816 Commits

Author SHA1 Message Date
Maciej Szwed
fe5a044c93 thread: Add poller run times counter
This will be used by upcoming spdk_top application.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I9ffcc3f2e36b8044bbc394938fc7a1dca1dc6892

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1211
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-13 08:54:17 +00:00
Shuhei Matsumoto
7f6eeaac7d lib/ftl: Fix hung up for bdev_ftl_create with wrong block size of zone bdev
If we specify zone bdev whose block size is not 4096 for bdev_ftl_create
RPC, SPDK application will hung up because spdk_io_device_unregister()
is called for unregistered IO device. Fix this error.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2ec36dc062edb7867aab892073db3af258808114
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1194
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2020-03-13 08:53:58 +00:00
Jacek Kalwas
62e0342eac nvme: minor alignment in ctrlr construct for pcie and rdma
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I35db32e867f91269608c72dbb9290a7ed2e3f31d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1234
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-12 09:04:26 +00:00
Jacek Kalwas
67befd4756 nvmf: remove min number of admin queue entries from spec file
It was probably miss-interpretation of description from discovery log
page which refers to min admin max sq size.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I575bf7fd6beb904b3a38a07616b76a34f8365643
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1222
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-12 09:04:18 +00:00
Jacek Kalwas
daa8f941e4 nvme: extend ctrlr opts with admin queue size
Align rdma and tcp to respect opts. Reduce default number of entries
for admin queue so it becomes memory optimization.

Linux driver by default creates admin queue with 32 depth, there is no
good reason to enlarge that queue by default within SPDK NVMe driver.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I97ceea8f350c52313021a63190fb0980f604c48e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1110
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-03-12 09:04:18 +00:00
Shuhei Matsumoto
ea863bb0b3 lib/event: Count number of threads per reactor
Add thread_count to struct spdk_reactor to count number of threads
per reactor. This number will be used in the next patch to know
if all threads are idle or not for each reactor to support CPU
power saving.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4f7cc5a6b78d85e9f8d0b539c60058c13e282759
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1169
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2020-03-12 09:04:02 +00:00
Shuhei Matsumoto
fbb77a56c8 lib/event: Factor out the main polling loop from _spdk_reactor_run()
It was too difficult for us to add unit test for _spdk_reactor_run()
because the main polling loop in _spdk_reactor_run() was infinite
if g_reactor_state is SPDK_REACTOR_STATE_RUNNING.

Factor out the main polling loop and rusage update in _spdk_reactor_run()
into a helper function reactor_run().

This improves the code readability as well.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia26db14f44026fefd696443227c16d2be4166832
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1186
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2020-03-12 09:04:02 +00:00
Shuhei Matsumoto
68161ffc00 lib/event: Put period for getrusage() into struct spdk_reactor
This is a preparation to the next patch which factors out the main
polling loop of _spdk_reactor_run() into a helper function reactor_run().

One of the subsequent patches will support CPU power saving by
adding sleep into reactor_run(). We should not insert sleep between
the main polling loop and getrusage() because now is got before
entering the main polling loop.

To put getrusage() into reactor_run(), we need to maintain last_rusage
in struct spdk_reactor and maintain g_rusage_period as a global
variable. This patch does these changes.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I61bf50de6a170ac73c8fe17e85077b90171dd9c0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1185
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2020-03-12 09:04:02 +00:00
Changpeng Liu
555e186a93 nvme/opal: using opal_start_generic_session() directly
It's more straight forward to call opal_start_generic_session() directly in
different scenarios.  It will help us to use stack variable "prev_data" to
store temporary key during the session, which is more safe.

Change-Id: I70b9190ed3606cd5e26c23319aca82d4a38596cc
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1191
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>
2020-03-11 11:36:08 +00:00
Changpeng Liu
f55717c34e nvme/opal: remove the flush operation before each OPAL method
It's not an error to send a security receive command before each
real OPAL related commands, but we don't need to do it.

Change-Id: I7628988df6ac097264db2137440f63db9e6e3660
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1127
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>
2020-03-11 11:36:08 +00:00
Changpeng Liu
e5bb2b6232 nvme/opal: remove unnecessary Method Status Error codes
Althrough the spec defines the Method Status Error Code, but here the return
value is just from function uses the normal errno, such as ERANGE, so just
remove them.

Change-Id: I43be95f62a4e465090462743b91246b1d63e2acd
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1125
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>
2020-03-11 11:36:08 +00:00
Changpeng Liu
fbfb3aca28 nvme/opal: don't use ComPacket header to check level 0 discovery response
According to the TCG Storage Core Architecture V2.0, the level 0 discovery
response should use level 0 discovery header and feature descriptors to
retrieve the response data buffer.  ComPacket header should be used in upper
layer.

Change-Id: I61e3e206801994b276608f9afbda800eccb2cffa
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1124
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>
2020-03-11 11:36:08 +00:00
Changpeng Liu
c61b70c3d5 nvme/opal: rename spdk_opal_init_dev() and spdk_opal_close() with construct/destruct suffix
Since the OPAL here is just for NVMe device, so we don't need to use dev_handler as common
handler, just rename it to spdk_nvme_ctrlr.  And we don't exit the initialization if
OPAL construnction had a failure.  Also move the timeout initialization to construct().

Change-Id: I11f0aea961eaa3da0c6253eb03d0227f7e7e5f11
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1101
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>
2020-03-11 11:36:08 +00:00
Changpeng Liu
01ddd1120a nvme/opal: refactor level 0 discovery data structures
No actual logic change except re-define some data structures.

Change-Id: Id0a483071591beee675cbc3ef368ac1fb723cfe0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1099
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>
2020-03-11 11:36:08 +00:00
Changpeng Liu
80ec5489ae opal_spec: optimize level 0 discovery data structure definition
Also uses ComPacket header to check the received data, no actual
function changes.

Change-Id: I905fc6b8bb4656d48d43ff4ff8d1f705b9b595b9
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1074
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>
2020-03-11 11:36:08 +00:00
Ziye Yang
9ba4bb22fe lib/nvme_tcp: get the max_sges from the nvme ctrlr.
Add the error print if there is still remaining_size in
order to provide more meaningful debug info.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I7b15c9c9a630ea7ecb2d3191b73c9c99f7febf31
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1189
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-11 02:25:12 +00:00
Shuhei Matsumoto
5feebd8528 lib/thread: Assert if spdk_thread_send_msg fails in API
Add assert to prevent degradation from these improvement for
thread management.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1e32fbda3b861c9f49d023c905bdce7411cb46d3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/838
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-10 09:13:02 +00:00
Darek Stojaczyk
8e05b15c11 thread: remove io_channel.h public header
It's been unoficially deprecated since SPDK 18.07,
let's remove it now.

Change-Id: I2471097cac6da3dd011959b903dd270b95cd480e
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1104
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: Changpeng Liu <changpeng.liu@intel.com>
2020-03-10 09:12:53 +00:00
Wojciech Malikowski
a6b53af161 lib/ftl: Check if IO channel is fully initialized
Since part of FTL IO channel initialization is done
asynchronously we need to check if IO channel is fully
initialized before write.

Change-Id: I0dff6a057024ffeb16b57ca5d7484f148b6fee82
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1177
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-10 09:12:38 +00:00
Ben Walker
49e70693c6 nvme: Move prp map code from vhost to nvme driver
This will be re-used in the muser transport of nvmf.

Change-Id: If00e6ea79ffdc0c3bda0402f39c5f9f4f411788b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/425
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-03-10 09:12:29 +00:00
Ben Walker
40529e5d11 nvmf: Add a transport notification when listeners are associated with
subsystems

This is optional and most transports will not implement it.

Change-Id: I51e0f1289b0e61a8bdb9a719e0a2aae51ecb451c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/629
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
2020-03-10 09:12:29 +00:00
Ben Walker
6fc8c8c2fc nvmf: Make spdk_nvmf_subsystem_add_listener asynchronous
In the next patch a new transport call will be added to notify
transports of subsystem->listener associations. The operations the
transports may need to perform there are likely asynchronous, so make
this top level call asynchronous here in preparation.

Change-Id: I7674f56dc3ec0d127ce1026f980d436b4269cb56
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/628
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-10 09:12:29 +00:00
Shuhei Matsumoto
34f53ab7cc lib/vhost: Simplify vhost_dev_foreach_session()
By sending message to the thread with which controller is associated,
we can simplify vhost_dev_foreach_session(). We can iterate
sessions list and we do not have to differentiate if session is
started or not.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I59767a5788c190545a81976e75871609da703f45
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1147
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-03-10 09:12:12 +00:00
Shuhei Matsumoto
baf3e12c09 lib/vhost: Replace poll group per session by thread per controller
Currently each controller is associated with one of the poll groups.
For each controller, all sessions are associated with the poll
groups with which the corresponding controller is associated.

Vhost poll group does not have any polling loop but its usage was
very complex.

Association of controller with poll group is done based on the
specified cpumask, and poll group is created per CPU core.

This is as same as association of thread with CPU core.

So in this patch, replace poll group per session by thread per
controller.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifa1e136caae11959f7b097b06a22910bc2169b30
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1146
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-03-10 09:12:12 +00:00
Shuhei Matsumoto
d07e392f08 lib/vhost: Simplfy error paths in vhost_dev_register()
The next patch will create a SPDK thread in vhost_dev_register()
and exit the SPDK thread in vhost_dev_unregister().

As a preparation, simplify error paths in vhost_dev_register()
by changing some gotos to return, moving free after the out label,
and moving insertion after succeeding vhost_register_unix_socket().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id1a2a50b4ba5732f91598a326a08de5c652fd136
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1145
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: Ben Walker <benjamin.walker@intel.com>
2020-03-10 09:12:12 +00:00
paul luse
f1d292a367 module/accel_engine: remove some annoying prints
This way if nothing prints it's just using software.  If CDMA
is being used it will print that. Will do the same for DSA
once added.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I44c49cf3a495d5e8440e80fa42fbb6f1338c5aac
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1183
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-09 09:47:26 +00:00
Shuhei Matsumoto
eb9d8f3419 lib/thread: Add spdk_io_device_get_name as a SPDK internal API
This is a preparation to support thread_get_io_channels RPC
in the next patch. The next patch will refer only name of struct
io_device, and so adding a helper function is better than making
struct io_device public.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9bc9dd78f71aa1e32847dc4c67eb79dae9cfbf9d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/886
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-06 10:29:56 +00:00
Shuhei Matsumoto
0b0f0c5415 rpc: Add thread_get_pollers RPC
Add an new JSON RPC thread_get_pollers to retrieve pollers of all
the threads. By adding a helper function spdk_poller_state_str(),
output poller state as string to improve readability. Most of the
code of thread_get_stats and thread_get_pollers are common and so
unify these two RPCs as possible as we can.

Sample output of thread_get_stats RPC in doc/jsonrpc.md was wrong
because thread_get_stats doesn't output ticks. Fix this together.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I003ffe569d3c0651ae65c5858eff8287f7e9031d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/604
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-06 10:29:56 +00:00
Ben Walker
c40f35b764 nvmf: Make spdk_nvmf_tgt_listen synchronous again
This was recently made asynchronous to support virtualized transports.
However, we're moving to add a new call to associated a listener with a
subsystem to transports and the operation that needed to be asynchronous
will actually be performed there. For simplicity, make this synchronous
again.

Change-Id: Ie98136a19c58f0f9bba0d140476de3bbb38e12d7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/881
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-06 10:29:45 +00:00
Seth Howell
f146bbe42d lib/nvme: move common connect code into transport shim
This gets rid of some duplicate lines of code.

Change-Id: I24d4864921f6030672f3640b33f88f37a9e8175a
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1136
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-06 10:29:21 +00:00
Tomasz Zawadzki
2731f52607 lib/blob: add md page parameter to _spdk_bs_load_replay_md_parse_page()
Further part of the series will hold array of md pages
in the ctx. Callers of _spdk_bs_load_replay_md_parse_page()
will make select which page to parse.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3fb70660672ba74bdb338eb1233409103903b215
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/983
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>
2020-03-06 10:28:43 +00:00
Tomasz Zawadzki
2a51c755db lib/blob: use common pointer to md page in load replay path
This is refactoring change for future patches.
struct spdk_bs_load_ctx will contain array of pages
instead of single one. Having to change just single
line for selection of page will make it easier to
read next patches in series.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If3dc1e7da7e61c7b4866307d859e55131a32d38b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/982
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>
2020-03-06 10:28:43 +00:00
Maciej Szczepaniak
8b27fbba38 lib/ftl: Make each ftl_l2p_set persistent when using pmem device for l2p
Signed-off-by: Maciej Szczepaniak <maciej.szczepaniak@intel.com>
Change-Id: Ic176988664dc74d5c1d321914d7665516ba6704d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/911
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-06 10:28:21 +00:00
Maciej Szczepaniak
01ea524068 lib/ftl: Create l2p on l2p_path file if set in config
New spdk_ftl_conf parameter l2p_path, l2p_path defines
location of existing pmem file or device to use as l2p table.

ftl_dev_l2p_alloc now has two flows:
1. If l2p_path is set perform pmem_map_file (PMDK) of l2p_size on it
2. Else malloc l2p table as usual

l2p_get/set will use atomic_load/store on both of those storage
locations as PMDK pmem_memcpy family of functions is not thread safe.

Signed-off-by: Maciej Szczepaniak <maciej.szczepaniak@intel.com>
Change-Id: I91806feb7aa0ef8057792bc120b09a39c63c8640
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/649
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-06 10:28:21 +00:00
Richael Zhuang
a9c79c3337 env_dpdk: Fix error when using vfio with noiommu
When using vfio with enable_unsafe_noiommu_mode=Y, force iova-mode
as "pa" here for DPDK guesses it's "va", which cause the following
error: "EAL:   Expecting 'PA' IOVA mode but current mode is 'VA',
not initializing".

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: I7c343498c5d6976a7c75d75438d6f9c35f1b6160
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1071
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-06 10:28:07 +00:00
WANGHAILIANG
bdbe33e663 lib/iscsi: Add a assert for conn->sock
In some cases, conn->sock will be lost, while conn pointer will still be.
A runtime error will apperars: null pointer of type 'struct spdk_sock'.
This only happens when ./configure with asan.
So I add a sssert to display this error explicitly when it occurs.

Change-Id: I7d012ac1a29a7fb0bce4815e0622582f23222a25
Signed-off-by: WANGHAILIANG <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1102
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: Ben Walker <benjamin.walker@intel.com>
2020-03-06 10:28:02 +00:00
Changpeng Liu
0841adda40 blobfs: move global cache initialization and free into a function
Also rename __initialize_cache()/__free_cache() to the new name
to reflect the logic.

Change-Id: I69bec4a10b2f21a7c40475fc2a99919bc526c556
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/976
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>
2020-03-06 10:27:45 +00:00
Changpeng Liu
1914de0920 blobfs: start a poller to do cache buffer reclaim regularly
Currently we will free the cache buffers in the file R/W
data path, however we can start a thread to do the cache
buffer reclaim regulary, so that we don't need to free
the cache buffer in the Rocksdb thread context.  By
doing this, we can also remove the global cache buffer
lock in following patches.

Change-Id: Icb0fbc49baecd1e9d86a5fcfe400758dfc3c53a2
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/941
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>
2020-03-06 10:27:45 +00:00
Shuhei Matsumoto
c688f5e93e lib/vhost: Replace global cpuset by local one in vhost_get_poll_group()
Replace g_tmp_cpuset by tmp_cpuset local in vhost_get_poll_group()
without any side effect.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibb01d2c77d6d82d7cc81df722e7848b357d4e9e7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/840
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>
2020-03-05 13:35:54 +00:00
Vitaliy Mysak
d4653a31e0 env_dpdk: dont treat NULL as error in spdk_map_bar_rte()
We use `spdk_map_bar_rte()` to read mapped addresses
from PCI BARs.
This function is currently checking for NULL in each pair.
But in PCI memory, some registers can be left unused,
in which case they are set to 0.
As a result, we may read some NULL pointers from BARs,
which is OK.
To check if given address is indeed invalid, we should first
check if it is used.
So it is best to delegate such checks to the
user of this function.
In fact, users already do the NULL check where it is needed
(ex: virtio_pci.c:390, nvme_pcie.c:589)
so this patch just removes them from `spdk_map_bar_rte()`.

This solves github issue #1206

Change-Id: I88021ceca1b9e9d503b224f790819999cd16da01
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1129
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-05 13:31:50 +00:00
yidong0635
9d93c08234 rdma: Fix Segmentation fault when not sufficient memory for RDMA queue.
Fix Segmentation fault on the target side.
Issue:
rdma.c:2752:spdk_nvmf_rdma_listen: *NOTICE*: *** NVMe/RDMA Target Listening on 192.168.35.11 port 4420 ***
rdma.c: 789:nvmf_rdma_resources_create: *ERROR*: Unable to allocate sufficient memory for RDMA queue.
rdma.c:3385:spdk_nvmf_rdma_poll_group_create: *ERROR*: Unable to allocate resources for shared receive queue.
Segmentation fault (core dumped)

GDB:
Program terminated with signal 11, Segmentation fault.
736             if (resources->cmds_mr) {
(gdb) bt
736             if (resources->cmds_mr) {
(gdb) bt
0  nvmf_rdma_resources_destroy (resources=0x0) at rdma.c:736
1  0x0000000000497516 in spdk_nvmf_rdma_poll_group_destroy (group=group@entry=0x2fe1300) at rdma.c:3489
2  0x00000000004978bb in spdk_nvmf_rdma_poll_group_create (transport=0x2fe11d0) at rdma.c:3371
3  0x000000000048df70 in spdk_nvmf_transport_poll_group_create (transport=0x2fe11d0) at transport.c:267
4  0x000000000048a450 in spdk_nvmf_poll_group_add_transport (group=0x2f49af0, transport=<optimized out>) at nvmf.c:941
5  0x000000000048a6cb in spdk_nvmf_tgt_create_poll_group (io_device=0x2fce600, ctx_buf=0x2f49af0) at nvmf.c:122
6  0x00000000004a0492 in spdk_get_io_channel (io_device=0x2fce600) at thread.c:1324
7  0x000000000048a0e9 in spdk_nvmf_poll_group_create (tgt=<optimized out>) at nvmf.c:723
8  0x000000000047f230 in nvmf_tgt_create_poll_group (ctx=<optimized out>) at nvmf_tgt.c:356
9  0x000000000049f92b in spdk_on_thread (ctx=0x2f81b20) at thread.c:1065
10 0x000000000049f17d in _spdk_msg_queue_run_batch (max_msgs=<optimized out>, thread=0x1e67e90) at thread.c:554
11 spdk_thread_poll (thread=thread@entry=0x1e67e90, max_msgs=max_msgs@entry=0, now=now@entry=947267017376702) at thread.c:623
12 0x000000000049af86 in _spdk_reactor_run (arg=0x1e678c0) at reactor.c:342
13 0x000000000049b3a9 in spdk_reactors_start () at reactor.c:448
14 0x0000000000499a00 in spdk_app_start (opts=opts@entry=0x7ffc2a5e0ce0, start_fn=start_fn@entry=0x40aa80 <nvmf_tgt_started>,
						arg1=arg1@entry=0x0) at app.c:690
15 0x0000000000408237 in main (argc=5, argv=0x7ffc2a5e0e98) at nvmf_main.c:75

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: Id9bf081964d0cf3575757e80fc7582b80776d554
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1073
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-05 13:31:28 +00:00
Shuhei Matsumoto
39efe1512f lib/nvmf: Remove workaround for astyle format check about break-after-return-type
To avoid the strange formatting, typedef has been used. But this
comment is hard to get the meaning. So stop breaking after return
type for this case.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia03d6ec50610c395007fe172018b890733dce599
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1052
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-03-04 10:04:26 +00:00
Shuhei Matsumoto
4f4d0ab6c1 lib/iscsi: Remove workaround for astyle format check about break-after-return-type
To avoid the strange formatting, typedef has been used. But this
comment is hard to get the meaning. So stop breaking after return
type for this case.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I317604de67aab9f201d691e0f886bd673f451f3f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1051
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-03-04 10:04:26 +00:00
Shuhei Matsumoto
6383602952 lib/scsi: Remove workaround for astyle format check about break-after-return-type
To avoid the starnge formatting, typedef has been used. But this comment
is hard to get the meaning. So stop breaking after return type for this case.

The strange formating is

struct spdk_scsi_dev *
       spdk_scsi_dev_construct(const char *name, const char *bdev_name_list[],
                        int *lun_id_list, int num_luns, uint8_t protocol_id,
                        void (*hotremove_cb)(const struct spdk_scsi_lun *, void *),
                        void *hotremove_ctx)

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I20c30b225b3b96fa9207b4a89e3210c8a97fb1d8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1050
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-03-04 10:04:26 +00:00
Shuhei Matsumoto
b992bb4e46 lib/thread: Add API spdk_poller_register_named() to set arbitrary name
Add an new API spdk_poller_register_named() to set arbitrary name
to the created poller. If NULL, the name is set to the pointer of
the poller function.

To set the name to the string of the poller function name conveniently,
add an new macro SPDK_POLLER_REGISTER() together in this patch.

All debug or error logs are changed to output poller name from pointer.

The added name will be used in the new RPC thread_get_pollers.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3be558dd795252f797e3e81fa2db2e8b128cf004
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/506
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-04 10:03:30 +00:00
Shuhei Matsumoto
cf669d0217 lib/thread: Move struct spdk_poller public in SPDK internal
thread_get_pollers RPC which will be added in the upcoming patches
will need to access internal of all pollers.

Following the last patch, expose struct spdk_poller internally among
SPDK libraries.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6844fc70165b4f127c49680ce592ac7b8c326cac
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/594
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-04 10:03:30 +00:00
Shuhei Matsumoto
500f26e2fe lib/thread: Move struct spdk_thread public in SPDK internal
thread_get_pollers RPC which will be added in the upcoming patches
will need to access all pollers each thread has.

To avoid adding JSON related code into lib/thread/thread.c, expose
struct spdk_thread internally among SPDK libraries and RPC code will
access it.

The next patch will expose struct spdk_poller internally among
SPDK library for the same purpose.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8da039db3021966ca1e28f6f086bb4c2a8eeb84a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/973
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-04 10:03:30 +00:00
Jin Yu
a8bdd24bc2 vhost: split desc_to_iovs function
Use the payload to construct iovs so that split desc
or packed desc can both work.

Change-Id: Ib2c60b6eb53d0d615594e97b3d3ae1a365908b6c
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1000
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-03-02 10:38:17 +00:00
GangCao
af561c1a4a Bdev/QoS: add a specific bdev_start_qos function
Change-Id: I93f930faf88703e22e156f4fe0c22e162f030894
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1030
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-02 10:35:01 +00:00
Konrad Sztyber
336505abbf lib/ftl: use per-io_channel write buffers
Replaced single global write buffer with the per-io_channel write
buffers.  This means that the "rwb" module and all of its references
were removed and replaced with the recently added interfaces.

Change-Id: Idc899d3a4d63a8a2bede1ac26549ed06e9a2e784
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/909
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: Wojciech Malikowski <wojciech.malikowski@intel.com>
2020-03-02 10:27:06 +00:00