Commit Graph

12082 Commits

Author SHA1 Message Date
Tomasz Zawadzki
b47e2267cf lib/conf: make INI deprecation less verbose
spdk_conf_allocate() was not the best place to put
INI deprecation warning.

Depending on the application, config could be allocated
without passing config file.
This resulted in app framework applications to print
this error on startup even without config file.

Much better place is spdk_conf_read() which requires
a file to be passed. Then and only then, deprecation
warning is printed with this patch.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2051 (master)

(cherry picked from commit 6395370be1)
Change-Id: I75979655880f9273dfe5ce65262f08934df596cc
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2068
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-30 13:17:21 +00:00
Seth Howell
c0bf57f87d spdk_top: Add asserts and checks for NULL pointers.
There are several memory allocations and funtion calls
that could theoretically return NULL in spdk_top. In
practice, these things are not likely to happen, but it
is necessary to add asserts and checks for them just in
case and to silence several KW warnings.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2027 (master)

(cherry picked from commit be62a4c359)
Change-Id: I5f2f1a9050e47d22b725727bff156a128f1525c9
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2067
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-30 13:17:21 +00:00
Changpeng Liu
597a7d08b5 bdev/nvme: use g_nvme_bdev_ctrlrs as the poll group io device
IO device "bdev_nvme_poll_groups" is not unregistered in the finish
module, so we need to unregister this io device, since the "nvme_if"
is staic variable in bdev_nvme.c, it's can't be accessed in common.c
so we use "g_nvme_bdev_ctrlrs" instead.

Change-Id: Id4675f5acc8f386609903497da5ca84bf8af3a15
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2035
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-27 05:41:45 +00:00
Seth Howell
5d0718528d nvme: implement epoll in the tcp transport.
Change-Id: I6672361baca4969f23259c19b73ed9dbe2f436bd
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/885
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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>
2020-04-24 19:38:00 +00:00
Seth Howell
2d18104489 module/bdev_nvme: Add basic poll group implementation.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I4b4682f84449af7c2a6fa1aaf29d190d241ce823
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/634
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-24 16:36:03 +00:00
Seth Howell
58509369ec lib/nvme: add naive poll group implementation to pcie.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ib67b41dc9c6ea2dd1fa23a0a0eb7683c212b9df8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/632
Community-CI: Mellanox Build Bot
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-24 16:36:03 +00:00
Seth Howell
1b818a28b5 lib/nvme: add naive poll_group implementation for rdma.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I55bae6dddc887a95c3e37195fac821de5aa1ed89
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/631
Community-CI: Mellanox Build Bot
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-24 16:36:03 +00:00
Seth Howell
fe5e1db68e nvme/tcp: add naive implementation of poll_group api
This implementation simply loops over qpairs calling process_completions.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ia1f59c13444703e00c6b769d378874f48b9ef03e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/627
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-24 16:36:03 +00:00
Seth Howell
a8f18b0da8 lib/nvme: set in_completion_context in poll group.
This needs to be done for all qpairs in the poll group.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ic3a84713a3f9941f90613152328d06ac8c1f586b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1954
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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>
2020-04-24 16:36:03 +00:00
Ziye Yang
94345a0a1a nvme: Add the priority field in struct spdk_nvme_transport_id
Purpose: To set the priority of the NVMe-oF connection especially
for TCP connection.

For example, the previous example can be:

trtype:TCP adrfam:IPv4 traddr:10.67.110.181 trsvcid:4420

With the change, it could be:

trtype:TCP adrfam:IPv4 traddr:10.67.110.181 trsvcid:4420 priority:2

The priority is optional. We try to change
spdk_nvme_transport_id but not in spdk_nvme_ctrlr_opts since
the opts in spdk_nvme_ctrlr_opts will reflect in every nvme ctrlr,
this is short of flexibility.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Signed-off-by: Sudheer Mogilappagari <sudheer.mogilappagari@intel.com>
Change-Id: I1ba364c714a95f2dbeab2b3fcc832b0222b48a15
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1875
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-24 15:53:34 +00:00
Ziye Yang
b9a7313e2e sock: Add spdk sock opts related three functions.
Purpose: This is used to make users can specify
some options on the socket, e.g., the different priority for the socket.

While creating sockets, the priority needs to be set before connect()
and listen system calls, so better to add one parameter in spdk_sock_opts
which can contain options (e.g., priority) in spdk_sock_listen_ext and
spdk_sock_connect_ext functions.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Signed-off-by: Sudheer Mogilappagari <sudheer.mogilappagari@intel.com>
Change-Id: I406238e9da7abd69f937b7072535a19124ed0169
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1874
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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>
2020-04-24 15:53:34 +00:00
Tomasz Zawadzki
b75e7bd261 ut/idxd: do not run idxd_ut when not compiled
idxd support is disabled by default right now due to being
experimental. Running unittest.sh would cause failure in such case.

With this patch idxd_ut only runs when it was compiled in.
Verifying if the UT was executed is done in post_processing.py,
by verifying every 'run_test' was executed.
Meaning that CI makes sure it is executed.

resolves #1369

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Iafbc84839aa9dc62ead8821da8b860e1741e3624
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2012
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-24 15:52:29 +00:00
Tomasz Zawadzki
b3348624e7 blob: add pages_per_cluster_shift
Operation of locating right lba from cluster map
is done on I/O path. Instead of division and multiplication,
perform bit shift operation.

Bit shift is only used when pages per cluster is power of 2.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ic3ed7ec0a82867a8a4bc6391785b9d40c800aacb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1724
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-24 15:45:21 +00:00
Tomasz Zawadzki
b31b4229a7 lvol: remove lvol_task structure
Last and only usage of struct lvol_task was removed in
previous patch.

Since it is no longer used, remove the structure itself.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3612106de2ab3a9197245de078c73c53beeff443
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1971
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-24 15:45:21 +00:00
Tomasz Zawadzki
4e4c293b9a lvol: do not use task->status
There is no point in setting this value on submission
and changing it on callback.
Since it is based on blob bserrno.

lvol_task is removed in next patch.

This change was motivated by lvol_op_comp() accessing
the task->status pointer on hot path for I/O.
There is no need to do so, so just pass status.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I17461fcf355f771f4de4e6d5ec1900d5042bd3d5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1804
Community-CI: Mellanox Build Bot
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>
2020-04-24 15:45:21 +00:00
Tomasz Zawadzki
3a574c3c13 ut/lvol: add callbacks and asserts for blob_io_* functions
The UT stubs weren't calling the assigned callbacks
and some weren't assering the passed values.

This will come in handy in next patch.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I86eec58a28e40a93ff06b7e7c715c17d25e28818
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1970
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-24 15:45:21 +00:00
Changpeng Liu
55fe098f9d vhost/nvme: fix the compliation issue with internal vhost library
For the NVMe interface virtualization, we are developing the
MUSER as the replacement for vhost_nvme target, before the
MUSER solution be merged to SPDK, here we still maintain
vhost_nvme for the coming 20.04 release.

Change-Id: Ife117474330bf9e3fab1071dae2beb0f6897dff8
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1936
Community-CI: Mellanox Build Bot
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-24 07:08:17 +00:00
Seth Howell
d09be67d3f lib/iscsi: fix possible memory leak.
If we fail to allocate all of the params, we should free
the ones we did.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I0f0be6320b27211e3713d9b79b5a0b0ed103e7d2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2007
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
2020-04-24 07:07:43 +00:00
Seth Howell
e5c4b63382 nvme/examples: fix potential memory leak in reconnect.c
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ib410cde580dc903f7185d001dbd434e6db64c57d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1987
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-24 07:07:43 +00:00
Seth Howell
4dc4d5cd3c reactor: add an assert for thread context.
Fixes kw warning #13674

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I65b8aac045849a8245c6b3e14d853043afdf43a3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1986
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-24 07:07:43 +00:00
Seth Howell
2a6a491250 bdev/nvme: add an assert for nvme_bdev_ctrlr when populating namespaces.
This is always going to be true because of the
context we are in when calling this function, but
add an assert just to be safe.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ifbd075865a191529eb9e656c360f182dba8a85bc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1985
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-24 07:07:43 +00:00
Seth Howell
2e69975fab lib/event: add asserts that reactors aren't NULL.
In practice, the reactor pointers will never be NULL
in these cases, but some static analysis tools don't
realize that.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I0657959e5572df2741398b179907f2bbf0b02b3b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1984
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>
Community-CI: Mellanox Build Bot
2020-04-24 07:07:43 +00:00
Seth Howell
fe089ae0cb lib/vhost: add an assert that lun is not NULL
spdk_scsi_dev_get_lun will never return null when we
ask for lun 0, but some static analysis tools complain.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I09aa8e03c28f1a3448f68d6f4d9aa6e7003c4c1b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1983
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>
Community-CI: Mellanox Build Bot
2020-04-24 07:07:43 +00:00
Seth Howell
bed1458044 lib/nvme: fix references to values in response_get_string
We were referencing the response before checking if it was NULL.

fix kw warning #10387

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I333d13a8f16874a35d7de8e6659125f3bee83c13
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1980
Community-CI: Mellanox Build Bot
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-24 07:07:43 +00:00
Shuhei Matsumoto
e99aa89108 lib/scsi: add map file
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I019ad7147e4e9bc223d1a772e9284d18d5591ace
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1897
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-24 07:06:52 +00:00
Shuhei Matsumoto
17ae1f40c5 lib/iscsi: add a map file
g_spdk_iscsi_opts is encapsulated and not directly accessed by outside
of iSCSI library. So do not add it to the map file of iSCSI library
and remove it from the map file of the shared build

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib9202891813208329ec6b3b0e076e4f608a38ef9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1895
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-24 07:06:52 +00:00
Maciej Szwed
e0830eaab6 spdk_top: Fix thread idle and busy times sorting
Fixes github issue #1367

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I639f94af0a61784cc1f3fe5bf9bbe7506bd39df6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1999
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2020-04-23 20:31:21 +00:00
Tomasz Zawadzki
251a551aa3 lib/nvme: assign NULL to external_io_msgs ring after free
Multiple nmvme_io_msg producers on the ctrlr share the same ring.
After freeing it, it should be set to NULL. In order to prevent
either nvme_io_msg_ctrlr_detach() or spdk_nvme_io_msg_process()
from interacting on freed memory.

Above happened when resolving issues in later patches.
After their respective fixes, there is no scenario that
solely reproduces this failure so no tests were added in this
patch.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I72b695d995b63bd002cc03e60cd4bdc82cfbe8ae
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1917
Community-CI: Mellanox Build Bot
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>
2020-04-23 20:29:46 +00:00
Tomasz Zawadzki
f955c75ef4 lib/nvme: free io buffer for nvme_io_msg
This buffer was not released after failure to enqueue.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If84317c67626a3193851c90be056b8550a5fccee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1916
Community-CI: Mellanox Build Bot
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>
2020-04-23 20:29:46 +00:00
Tomasz Zawadzki
7fbdeacc9e nvme: do not allow the same nvme_io_msg_producer to register twice
Previous to this change it was possible to register
same nvme_io_msg_producer twice. This kind of functionality does
not make sense in current scope of it, as each message to/from
io_msg_producer does not have identifier other than this pointer.

In case of nvme_cuse this allowed creation of multiple /dev/spdk/nvme*
devices and caused an infinite loop when detaching an nvme controller.

This patch disallows that and adds test for nvme_cuse.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5f56548d1bce878417323c12909d6970416d2020
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1938
Community-CI: Mellanox Build Bot
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-04-23 20:29:46 +00:00
Tomasz Zawadzki
5772521a84 test/cuse: refer to "/dev/spdk/nvme" as base for cuse devices
Instead of refering to single controller, allow to point
and check different ones.

Next patch in series will verify lack of existance
of "/dev/spdk/nvme1".

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9656ac06e86c8946b45b2ffc93119d31a1ccc5ca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1979
Community-CI: Mellanox Build Bot
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>
2020-04-23 20:29:46 +00:00
Tomasz Zawadzki
ef6ffb39d6 lib/cuse: provide proper error codes up to RPC
This patch adjusts several return codes to provide
more than just -1.

Along with fix to json rpc error print,
where negative error code was passed to spdk_strerror().
Resulting in unkown error being reported.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I254f6d716d0ce587f88cc658163ba049378f3b2f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1915
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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>
2020-04-23 20:29:46 +00:00
Ben Walker
5340d17823 nvme: Make spdk_nvme_cuse_register thread safe
There is no indication right now that this function couldn't be called
by multiple threads on different controllers. However, internally it is
using two globals that can become corrupted if the user were to do this.
Put a lock around them so it is safe.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I59361f510eb1659c2346f1fd33c375add1dc9c81
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1903
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-23 20:29:46 +00:00
Tomasz Zawadzki
e396d97db0 nvme/cuse: get functions for cuse ctrlr/ns names to accept a buffer
This was changed to better facilitate thread safety.
In next patch a lock will be held when going over the
cuse devices list.

Now user is expected to pass a buffer of a sufficient size
that will be filled with ctrlr or ns cuse device name.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3202ef285e427111e3595389619463fda58dbef6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1978
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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>
2020-04-23 20:29:46 +00:00
Tomasz Zawadzki
d9a11fd5b1 cuse: fix nvme_cuse unregister segfault
Unregistering nvme_cuse when the device did not exist
resulted in SEGFAULT within nvme_io_msg_ctrlr_unregister().

To prevent that, when no nvme_cuse is registered for the
ctrlr do not unregister nvme_io_msg_producer.

RPC and spdk_nvme_cuse_unregister() now return an error.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id77cebe23ff91023a24cfe091f5f62a76a9175fd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1921
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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-04-23 20:29:46 +00:00
Tomasz Zawadzki
15a5018067 cuse: refactor retrieving cuse_device to separate function
This patch adds nvme_cuse_get_cuse_ctrlr_device() and
nvme_cuse_get_cuse_ns_device that returns
struct cuse_device of a given nvme controller or namespace.

Similar iteration was used in two places so they were
replaced accordingly.
Next patch will add third.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I25ada843a59c632fe330263a65456d25c5ccf4cc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1918
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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-04-23 20:29:46 +00:00
paul luse
d8db56228f doc: add IDXD docs and changelog entry
The IOAT docs are pretty limited so what's here just mirrors those.
More documentation on the library as well as the module will be
provided as an ongoing activity.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I28b13733f034fe117a4ea21983ce0418a427dd51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1925
Community-CI: Mellanox Build Bot
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>
2020-04-23 15:48:32 +00:00
paul luse
58bd4948f0 lib/idxd: add unit test for idxd_wq_config()
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I5d505f0642ec3c1297b2772d4ab5c65f51ddfc3a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1823
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-23 15:48:32 +00:00
paul luse
c9391bff85 lib/idxd: add unit test for idxd_group_config()
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I90db6b1a3b37fb76548451a2be284de8d96a44f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1822
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-23 15:48:32 +00:00
paul luse
e333c67bc0 lib/idxd: add unit test for idxd_reset_dev()
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I8a3c50c7ff5cbee1069088a3a06b83f06eb9a85f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1819
Community-CI: Mellanox Build Bot
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: Ben Walker <benjamin.walker@intel.com>
2020-04-23 15:48:32 +00:00
paul luse
3075d23318 lib/idxd: add unit test for idxd_wait_cmd()
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ida3185431b526092a0450f2452df665ea0d19abb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1818
Community-CI: Mellanox Build Bot
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>
2020-04-23 15:48:32 +00:00
paul luse
8e496c5155 lib/idxd: add unit test for spdk_idxd_set_config()
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I8d38491ad7f97310568ec1172df9a9358cfd2a6c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1783
Community-CI: Mellanox Build Bot
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>
2020-04-23 15:48:32 +00:00
paul luse
f603c27276 lib/idxd: add unit test framework and first unit test
More tests will follow in later patches.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I6c45b94cc17219acfae863c774fc7dbc33625c85
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1782
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
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>
2020-04-23 15:48:32 +00:00
paul luse
42eb233e48 scripts/rpc: addd RPC support to enable idxd
The new RPC also includes and option for which
idxd config is to be used. Config options will be
explained in detail in a later patch.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I1322bab4d6ca9cc45ec3a56d7267dc7dc09dbea3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1726
Community-CI: Mellanox Build Bot
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>
2020-04-23 15:48:32 +00:00
paul luse
5b03dd938c module/idxd: accel framework plug-in for idxd
Docs, RPC, unit tests, etc., will follow.  Notes:

* The current implementation will only work with VFIO.

* The current implementation supports only the existing accel
framework API. The API will be expanded for DSA exclusive features
in a subsequent patch.

* SW is required to manage flow control, to not over-run the work queues.
This is provided in the accel plug-in module. The upper layers use public
API to manage this.

* As we need to support any number of channels (we can't limit ourselves
to the number of work queues) we need to dynamically size/resize our
per channel descriptor rings based on the number of current channels. This
is done from upper layers via public API into the lib.

* As channels are created, the total number of work queue slots is divided
across the channels evenly.  Same thing when they are destroyed, remaining
channels will see the ring sizes increase. This is done from upper layers
via public API into the lib.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ifaa39935107206a2d990cec992854675e5502057
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1722
Community-CI: Mellanox Build Bot
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>
2020-04-23 15:48:32 +00:00
paul luse
e58e9fbda8 lib/idxd: add low level idxd library
Module, etc., will follow. Notes:

* IDXD is an Intel silicon feature available in future Intel CPUs.
Initial development is being done on a simulator. Once HW is
available and the code fully tested the experimental label will be
lifted. Spec can be found here: https://software.intel.com/en-us/download/intel-data-streaming-accelerator-preliminary-architecture-specification

* The current implementation will only work with VFIO.

* DSA has a number of engines that can be grouped based on application
need such as type of memory being served or QoS. Engines are processing
units and are assigned to groups. Work queues are on device structures
that act as front-end groups for queueing descriptors. Full details on
what is configurable & how will come in later doc patches.

* There is a finite number of work queue slots that are divided amongst
the number of desired work queues in some fashion (ie evenly).

* SW (outside of the idxd lib) is required to manage flow control, to not
over-run the work queues.This is provided in the accel plug-in module.
The upper layers use public API to manage this.

* Work queue submissions are done with a 64 byte atomic instruction

* The design here creates a set of descriptor rings per channel that match
the size of the work queues. Then, an spdk_bit_array is used to make sure
we don't overrun a queue.  If there are not slots available, the operation
is put on a linked list to be retried later from the poller.

* As we need to support any number of channels (we can't limit ourselves
to the number of work queues) we need to dynamically size/resize our
per channel descriptor rings based on the number of current channels. This
is done from upper layers via public API into the lib.

* As channels are created, the total number of work queue slots is divided
across the channels evenly. Same thing when they are destroyed, remaining
channels with see the ring sizes increase. This is done from upper layers
via public API into the lib.

* The sim has 64 total work queue entries (WQE) that get dolled out to the
work queues (WQ) evenly.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I899bbeda3cef3db05bea4197b8757e89dddb579d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1809
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-23 15:48:32 +00:00
Shuhei Matsumoto
b0b0b8db2b lib/iscsi: Fix the bug of "lib/iscsi: Fix conn->state not go back to EXITING by using spdk_thread_send_msg"
This patch fixes the bug in

  commit d421876f98.

We had passed not xconn but conn caressly by mistake to
_iscsi_conn_drop().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifc2313923bc0e94b967e4ba2eca4255ddcc4611b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1988
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-23 13:48:41 +00:00
Michal Berger
0b9b70d0f1 test/lvol: [jq] replace -S with sort()
It seems like -S will sort only keys within given objects, but if
actual objects are in different order, the sorting results may still
differ.

To avoid this, replace -S with jq's sort() which takes entire array,
and all its objects, as an input to be sorted. This should result in
the same output regardless of the initial position of given objects.

Change-Id: I4eca9474f1cea73040ae4a13692a1074fa1c4fc3
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1973
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-23 07:28:37 +00:00
Tomasz Zawadzki
693ca39917 vhost: inline vhost_vring_desc_is_wr()
This is executed on hot path for I/O. Inline it.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6ded0dd3c15e81954350a9eb372156e9d38f87e4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1725
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
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>
2020-04-23 07:28:24 +00:00
Liang Yan
6a29c6a906 bdev/rbd: add ceph rbd resize function.
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Change-Id: Id7f24f1f5e0789ee6d4c07ae7f59cc2d98983e98
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1766
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-23 07:28:10 +00:00