Commit Graph

15038 Commits

Author SHA1 Message Date
Jim Harris
ba6f6c5eb0 nvmf: wait for qpair disconnect cbs when removing subsys
nvmf_poll_group_remove_subsystem_msg() disconnects all
qpairs associated with controllers in the specified
subsystem.  If it finds any controllers that need to
be disconnected, it sends a message to the running
thread to execute the same function again later.

But when it runs again later, the qpair may no longer
be in the poll group, but there could still be
outstanding messages being sent between threads.  For
example, _nvmf_qpair_destroy() needs to send a message
to the ctrlr->thread to clear the qpair mask bit.

All of this could result in the nvmf target starting
to destroy poll groups prematurely.  Destroy poll
groups results in the nvmf spdk_threads exiting. If
there are still messages being processed from
the STOP_SUBSYSTEMS target state, we can get
use-after-free errors since processing of those
messages could access freed memory associated with
the exited thread.

Fixes issue #1850.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1e63b9addb2956495a69b5108a41e029f6f9a85d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7275
Community-CI: Broadcom CI
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: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-04-14 15:35:08 +00:00
yupeng
530646f60c nvme: add NVMe Host Behavior Support
Host Behavior Support is defined in 5.21.1.22 of the NVME spec. This
patch adds the related data structures.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: I99b2c1e55e23cadcd967b7adf5f8e75a2d799519
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7338
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>
2021-04-14 07:26:20 +00:00
Jim Harris
df902b1d2e include: remove util.h include from queue_extras.h
This include isn't needed in queue_extras.h itself.
There were a few places that were implicitly
depending on this include, so fix those to include
util.h explicitly.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia962ae5a4403ee8ae15f3106d0d5e7d7412a4535
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7172
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-04-14 07:25:21 +00:00
Alexey Marchuk
558be98fd3 nvme/pcie: Add statistics per poll group
Check if qpair has a poll group during the connect process,
use poll group's statistics or allocate own structure per
qpair. That is done due to not all applications use poll
groups and we want to avoid "if (qpair->group)"
conditions in data path.

Admin qpair always allocates its own statistics
structure but the statistics are not reported
since this qpair is not attached to a poll group.

Statistics are reported by spdk_nvme_perf tool
if --transport-stats and in bdev_nvme_transport_statistics
RPC method.

Change-Id: I58765be161491fe394968ea65ea22db1478b219a
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6304
Community-CI: Broadcom CI
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>
2021-04-13 21:30:52 +00:00
Alexey Marchuk
5c33437b99 bdev_nvme: Add RPC to dump transport statistics
The new RPC bdev_nvme_get_transport_statistics is added.

Change-Id: Ic13d096717c041fd3e0b77eaebca6ae09239698b
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6303
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: Jim Harris <james.r.harris@intel.com>
2021-04-13 21:30:52 +00:00
Alexey Marchuk
331f9755cf perf: Add option to print transport statistics
Statistics are dumped in the end of perf tool work,
enabled using long option --transport-stats

Change-Id: Ice3755ba82ebcdacfa72ceb9b3d5a1caee911811
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6302
Community-CI: Broadcom CI
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: <dongx.yi@intel.com>
2021-04-13 21:30:52 +00:00
Alexey Marchuk
6dd6a3cc37 perf: use getopt_long
I was trying to find a free character to add
statistics reporting and didn't fine a suitable
one. Since perf provides a lot of short options,
let's change it to also use long options.

Change-Id: I2a7fd5619e996a40b2d432017992d5f888abb656
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6301
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
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>
Reviewed-by: <dongx.yi@intel.com>
2021-04-13 21:30:52 +00:00
Alexey Marchuk
e966937625 nvme: Add functions to get/free poll group statistics
These are interface functions that can be used by
an application e.g. spdk_nvme_perf or bdev_nvme
library. The next patches will add usage of these
functions.

Change-Id: I33b88e0e713c2ea5967f9241885e3257c5070577
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6300
Community-CI: Broadcom CI
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-04-13 21:30:52 +00:00
Alexey Marchuk
3fcda8e779 nvme: Add transport intrafce to get/free stats
The new 2 API function allow to get and free stats
per poll group. New function to get transport name
have been added to report not only transport type but
also the name.
For now only RDMA transport reports statistics,
other transports will be added later.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I2824cb474fde5fa859cf8196dabac2c48c05709c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6299
Community-CI: Broadcom CI
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-04-13 21:30:52 +00:00
Alexey Marchuk
50569293ef nvme/rdma: Add poller statistics
New statistics include number of poller calls,
number of idle polls and total number of completions.
These statistics allow to estimate % of idle polls
and the number of completions per poll.

Since nvme_rdma_cq_process_completions function
returns number of completed NVMF requests and each
NVMF request consumes 2 RDMA completions (send+recv),
this function was extended to return the number of
RDMA completions.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ifdc1e2e467f645adb5d66d39ff2a379e161fbd77
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6298
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>
2021-04-13 08:41:39 +00:00
Alexey Marchuk
527f406b6b nvme/rdma: Use RDMA statistics
These statistics allow to estimate WRs batching
efficiency. The number of send WRs equals the total
number of submitted NVME commands.

Change-Id: I96c9836cd6b9070cf5f62e43b4d2738506866e94
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6297
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-04-13 08:41:39 +00:00
Liu Xiaodong
4e8032ab04 thread: ack msg_fd directly in intr_msg_proc
Although currently acking msg_fd inside function
msg_queue_run_batch() will also ack critical_msg's
notification, it is easier to understand the code
if moving acking msg_fd code into
thread_interrupt_msg_process().

Change-Id: I98267c5c28358334a2c1133e3dbc125788de77ab
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7265
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: Changpeng Liu <changpeng.liu@intel.com>
2021-04-13 08:41:08 +00:00
Liu Xiaodong
53429c7f44 thread: distinguish intr enabled and set
As a start of combining interrupt ability into poller,
it aims to get spdk_thread & spdk_poller runnable between
poll mode and interrupt mode with dynamic switching.

spdk_interrupt_mode_is_enabled() indicate whether interrupt
mode is enabled and dynamic switching is permitted. So
spdk_interrupt_mode_is_enabled==true leads to set up
interrupt mode related resources;
in_interrupt flag indicates whether one spdk_thread now
is running in intr mode.
It is possible that spdk_interrupt_mode_is_enabled==true
but in_interrupt==false. this means spdk_thread & spdk_poller
switched to poll mode from interrupt mode due to heavy
workload coming.

To align with spdk_reactor, use "in_interrupt" to
indicate whether one spdk_thread now runs in intr.

Change-Id: I2cd806bf4dec9969f3df88fac7f6b0c0b716d907
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6540
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: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
2021-04-13 08:41:08 +00:00
Liu Xiaodong
8c4c8c3967 thread: extract send_msg_notification func
Change-Id: Ib83c53b138614ba9889969c1f98e1a5bdf7fee42
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7153
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-04-13 08:41:08 +00:00
Liu Xiaodong
fbd6c30b8b intr: call intr_enable before thread lib init
Restrict spdk_interrupt_mode_enable must be called
once prior to initializing the threading library.

Change-Id: I833ff63fae19882e82154195d03dd7ce56ffb1de
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6707
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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-04-13 08:41:08 +00:00
Karol Latecki
26d7e3d4bb scripts/nvmf_perf: use common method name for calling subprocesses
Use common method name and parameters for calling
subprocesses for local (Target) and remote systems
(Initiators) instead of using "check_output" (from
subprocess module) and "exec_command" (from paramiko)
separately.
Having these functions wrapped by a single common
method will allow to create common methods in Server
class more eaisly, instead of creating two copies in
Target and Initiator classes.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I1c10f6a88f3d7300c227e969ad6fd901763ac52c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6261
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
2021-04-13 08:40:32 +00:00
Karol Latecki
f9dd94b515 scripts/nvmf_perf: add adq_enable option to configuration file
Parse the config file for "adq_enable" flag and enable
the option in SPDK Target and SPDK Initiator configuration.
At this point the flag has no effect on the generated
traffic, as the system and priority queues are not
configured properly. These settings will be added
gradually in following patches.

Change-Id: I5d7bc892f3aa7bbe691b7e0983294b56fcf994f5
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6260
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-04-13 08:40:32 +00:00
Karol Latecki
ddb4d24b1d scripts/nvmf_perf: get detailed info about NICs in servers
Get detailed info about NICs installed in servers. This
is using lshw utility to make things easier and not
implement the whole logic for parsing /sys objects and
pci.ids listing in system.

Change-Id: I97871fdc9feaae1c2485574a7b488b88ac3afc4f
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6259
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
2021-04-13 08:40:32 +00:00
Karol Latecki
9fec8853fb scripts/nvmf_perf: re-work managing test options
The number of options for test execution grew high,
and we still need to add more. This results in a lot
of parameters to pass around in constructors, which
is hard to read and causes pylint to complain.

Instead of passing each option individually as a
separate parameter, pass them as dictionaries just
like they're defined in .json config file. This
makes managing the default values a bit harder, but
is more readable.

Change-Id: I5d88a2b7fe51d2df93edd9130678a937d34facdd
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6207
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-04-13 08:40:32 +00:00
Shuhei Matsumoto
3685228e72 lib/iscsi: Factor out submitting write subtask for Data-OUT PDU
This will be helpful to simplify the upcoming change.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1f170fe48d2ec1b5ea05da6a8aa3589060c5c32d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6438
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>
2021-04-13 08:38:51 +00:00
Shuhei Matsumoto
b3a3e78a86 lib/iscsi: Track current offset of large write I/O to submit subtasks using current_data_offset
Use current_data_offset of task to track the current offset of
large write I/O by following the last patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iec3a371c6050fe11478b6f158259d8f4013f5238
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6424
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>
2021-04-13 08:38:51 +00:00
Changpeng Liu
ff5c19b136 nvmf: call transport abort callback when it's not empty
Custom transport may not provide the `qpair_abort_request`
callback function, so here for transport API we will just
call it when it's not empty.  We will add the callback
support with vfio-user in another patch.

Fix #1883.

Change-Id: Icd82a26bde4ed90068bc85ee04cce9642cb6135d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7291
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-04-13 08:37:57 +00:00
Maciej Wawryk
1fc0c2d8b9 test: move spdk_test_image.qcow2 to spdk_dependencies dir
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I8d75f5fa22e79c93d1f8929b6df048b440d9fb8a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6940
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-04-13 05:13:50 +00:00
Maciej Wawryk
1794286d30 test/common: Update fedora version in readme
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I27261ed2c1f2a18c06b331c226ca08617ad57077
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6939
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: Karol Latecki <karol.latecki@intel.com>
2021-04-13 05:13:50 +00:00
Maciej Wawryk
67dd38285f test: removal deprecated sys_sgsw user location
Replace old '/home/sys_sgsw' location by new created
'/home/sys_sgci/spdk_dependencies'
Also update readme with current user name.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ifcea15f704183c7ae0044ee02bd28b6bd891b262
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6927
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: Karol Latecki <karol.latecki@intel.com>
2021-04-13 05:13:50 +00:00
Mao Jiang
dad0a60778 test/nvme_ctrlr_cmd: cases for adding requests abort
Change-Id: Ie0c0b4a183922bc190ebfb0dcb513cd6fb7c467d
Signed-off-by: Mao Jiang <maox.jiang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7003
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
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>
2021-04-12 22:43:24 +00:00
ChengqiangMeng
f673969dbb unittest/nvme_rdma: increase code coverage for nvme_rdma.c
nvme_rdma_validate_cm_event
nvme_rdma_register_reqs
and nvme_rdma_unregister_reqs code comprehensive coverage.

Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: Ia002b750319c2cb7583e2d4cd4dc30e85c694eec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6956
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-04-12 22:40:33 +00:00
Evgeniy Kochetov
47a6653fdd ut/nvme: Fix uninitialized controller structure
Fixes #1882

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I5668f2a5d272f5260f4aaf22f5a08469ea903315
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7309
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-04-12 20:59:51 +00:00
Changpeng Liu
912b2116da nvmf/vfio-user: fix the race condition when creating new connection
We used the controller ready field to indicate ADMIN queue connection,
but the accept poller and ADMIN poll group may run in different
threads, this may lead vfu_attach_ctx() be called several times, so
change the 'ready' to true when a new socket connection is created.

Fix issue #1854.

Change-Id: Iab6ffd6dffb3fff5cf893e79774bc28fe0b2830c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7073
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>
2021-04-12 19:33:24 +00:00
Changpeng Liu
8c4ac1f2ff nvmf/vfio-user: use a better input parameter for vfio_user_map_prps
This will make the code easier to understand.

Change-Id: I7112d3fd5f0d6dce9b66d44375b68ce7d1e8951d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7072
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>
2021-04-12 19:33:24 +00:00
Changpeng Liu
e7f3142ca2 nvmf/vfio-user: eliminate unmap_q function
unmap_q is only be called in unmap_qp, so remove this function to make the
code more clear to read.

Change-Id: I627c7a1efdcb85476cb618fced8b0bfc2d8f1f62
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6886
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-04-12 19:33:24 +00:00
Changpeng Liu
43b63c68b9 nvmf/vfio-user: destroy controller when remote client is dead
When killing QEMU or remote client is terminated normally,
we can release current controller related data structure,
users may restart QEMU to connect the same socket file
again, for the new connection, vfio-user will create
a new controller data structure for it.

Here we add a lock in the endpoint data structure to protect
number of connected queue pairs variable, because controller
data structure is like a session, while endpoint is related
with the socket file, so it's safe here.  Moreover, we can
use this lock to protect live migration related data
structures in future.

Change-Id: Ie7060041a253604e7a2242813ec284eae46fe4e8
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6862
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-04-12 19:33:24 +00:00
Jim Harris
3a3eb25ebb examples/nvme/identify: remove -v from usage text
This option may have been valid at one point, but is
not any longer.  So remove it from the usage text.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I83747968085a77fb52d735026294bf5f82517ffc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7276
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-04-12 19:15:55 +00:00
Shuhei Matsumoto
67a03bc73a ut/bdev_nvme: spdk_nvme_detach() stub calls ut_detach_ctrlr() if ctrlr is attached by ut_attach_ctrlr()
bdev_nvme_delete() calls spdk_nvme_detach() in the end. However,
previously spdk_nvme_detach() stub did nothing and ut_detach_ctrlr()
was called separately if ctrlr wass attached by ut_detach_ctrlr().

This was to differentiate the two cases, ctrlr is statically assigned
or dynamically attached by ut_detach_ctrlr().

This might be a little confusing. Hence by adding a flag, attached,
to ctrlr, merge ut_detach_ctrlr() into spdk_nvme_detach(), and remove
ut_detach_ctrlr() calls.

Besides, change one SPDK_CU_ASSERT_FATAL to return NULL because the
other cases do that and the callers for ut_attach_ctrlr() already have
SPDK_CU_ASSERT_FATAL.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2a73f57c6031819d3ae441a6874127ff5d53fc04
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7311
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-04-12 09:51:03 +00:00
Shuhei Matsumoto
d9e3ffea48 ut/bdev_nvme: Use bdev_nvme_find_io_path() in unit tests
This will make the following change simpler and testing
bdev_nvme_find_io_path() will be good.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iac82bdba88e4abfa41c2ce04f10ce41a6b7dbd71
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7106
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2021-04-12 09:51:03 +00:00
Shuhei Matsumoto
e5cb3d3fba bdev/nvme: Factor out getting admin path into a helper function
Factor out the operation to get ctrlr pointer to submit an admin
command into a helper function bdev_nvme_find_admin_path().

This will make the following changes transparent.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idabfa5874ad95414f24d414702205b0cdbc98ddb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7105
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-04-12 09:51:03 +00:00
Shuhei Matsumoto
42ae4267b6 bdev/nvme: Merge completing reset_io into _bdev_nvme_reset_complete()
reset_io is stored into nvme_bdev_ctrlr->reset_bio now. Hence we can
merge completing reset_io into _bdev_nvme_reset_complete() easily.
i
As a few minor changes, to reduce the size of the following patches,
clear reset_bio before calling spdk_bdev_io_complete(), and call
spdk_bdev_io_complete() after completing ctrlr reset.

The following patches will retry pending reset_ios if reset is internal,
abort reset_ios if reset is external and fails, or succeed reset_ios
if reset is external and succeeds.

This clean-up will be helpful for such enhancement.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5e0b4e04b19f4f4f3b21b2db4dc6a2b948b29c67
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7241
Community-CI: Broadcom CI
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-04-12 09:51:03 +00:00
Shuhei Matsumoto
888def105f bdev/nvme: Further clean-up of bdev_nvme_reset()
nvme_bdev_ctrlr->reset_bio is accessed only by the thread which called
spdk_for_each_channel() and the callback to spdk_for_each_channel()
is called after unwinding stack via message.

Hence bdev_nvme_reset() can call _bdev_nvme_reset() rather than
_bdev_nvme_reset_start() and store bio into nvme_bdev_ctrlr->reset_bio
after _bdev_nvme_reset() returns zero.

Then inline _bdev_nvme_reset_start() into _bdev_nvme_reset() because
_bdev_nvme_reset_start() has only a single caller now.

The following patches will introduce subsystem and bdev_nvme_reset()
will reset all controllers of a subsystem sequentially. These further
clean-ups will be helpful for such enhancement.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I25abaa5be511c967ce20c92e4caa7dfeb3e09dd1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7240
Community-CI: Broadcom CI
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-04-12 09:51:03 +00:00
Shuhei Matsumoto
6d573781b5 lib/iscsi: Rename current_datain_offset of task by current_data_offset
The following patches will aggregate multiple Data-OUT PDUs into a
single write subtask and we will not be able to use reqh->buffer_offset
to track the current offset of large write I/O to submit write subtasks.

On the other hand, each iscsi_task or iscsi_subtask is only read or write

Hence rename current_datain_offset of iscsi_task by current_data_offset
in this patch.

The next patch will use it to track the current offset of large write I/O

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I922582c5b9474a3c512f81d0f0425158a38a9a8d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6423
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: Changpeng Liu <changpeng.liu@intel.com>
2021-04-12 09:49:31 +00:00
Shuhei Matsumoto
00508c8ef1 lib/iscsi: Add data_len to mobj and use mobj to create write subtask
The following patches will aggregate multiple Data-OUT PDUs into a
single SCSI write up to 64KB. Any variable to accumulate data length
is necessary.

Hence add data_len to mobj and accumulate read data length into
mobj->data_len, and then refer mobj instead of pdu->data and
pdu->data_segment_len to submit write subtask.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6354534769e67c0fd995bbc3c2b4a80d21a23915
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6422
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-04-12 09:49:31 +00:00
Shuhei Matsumoto
7a783b5b38 iscsi: Factor out getting data buffer from mempool into helper function
Wrap an operation to get a data buffer from mempool into a helper
function iscsi_datapool_get() and wrap an operation to put a data
buffer to mempool into a helper function iscsi_data_pool_put().

Use inline for both functions.

Besides, as a minor fix, remove duplicated file inclusion between
iscsi.c and iscsi.h.
7

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia3005dffaa93a6bca16f19bb467fb5b64ae1aad2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6366
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: sunshihao <sunshihao@huawei.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-04-12 09:49:31 +00:00
Shuhei Matsumoto
3de09f8ece lib/iscsi: Support data split case for CRC32C computation
Add crc32c to struct spdk_iscsi_pdu and initialize it by SPDK_CRC32C_INITIAL,
and then use it as the initial value of _iscsi_pdu_calc_data_digest().
Separate finalization of crc32c into _iscsi_pdu_finalize_data_digest().

Move the definition of related macro constants from iscsi.c to iscsi.h.

iscsi_pdu_calc_data_digest() is used for read too. So setting
pdu->valid_data_bytes before calling iscsi_pdu_calc_data_digest()
for read.

Data split will be supported only if DIF is disabled, and hence
DIF case is not changed.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9d24f605fd0d452782e17695b613cd2f63d2e42f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6421
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: Changpeng Liu <changpeng.liu@intel.com>
2021-04-12 09:49:31 +00:00
Shuhei Matsumoto
acdeb53f4b lib/iscsi: Increase buffer size to 64KB at most when more Data-OUT PDUs follow
The following patches will want to aggregate multiple Data-OUT PDUs
into the same data buffer, but it will be 64KB at most.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I72eabbeae0b027c2fbff2a5837d180b06b0a1b49
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6418
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-04-12 09:49:31 +00:00
Shuhei Matsumoto
2ef97692bc lib/iscsi: Create subtask after reading data segment for Data-OUT PDU
The following patches will change the handler for Data-OUT PDU to
submit subtask only when 64KB data is read or F bit is set.

Previously, we had created a subtask when processing header and
before reading data segment.  Creating a subtask beforehand is not
convenient for the following changes.

Hence create a subtask after reading data segment.

If LUN is removed while processing the Data-OUT PDU, the corresponding
primary task will be terminated by iscsi_clear_all_transfer_task(),
and any subtask completion is not sent to initiator. Hence we can
reject the received Data-OUT PDU safely.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifb6d6988676080b458b31d12fef065f3c1de0cb6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6415
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: Changpeng Liu <changpeng.liu@intel.com>
2021-04-12 09:49:31 +00:00
Jin Yu
59237d22b8 lib: add a hotplug lib for device
The hotplug lib can be used for pcie devices
such as nvme, virtio_blk and virtio scsi.

For the sigbus handler, there is only one in a
process and it should handle all the devices.

And align nvme to the hotplug lib

Add the ADD uevent support for allowing the
device hotplug.

Change-Id: I82cd3b4af38ca24cee8b041a215a85c4a69e60f7
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5653
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2021-04-12 09:48:21 +00:00
ChengqiangMeng
1c3bc9d64d rdma/common.c: Fix possible memory leaks
Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: I134f3ca3dfb0c747b0ca8544068961a53470106f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7262
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: <qun.wan@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2021-04-12 09:44:41 +00:00
yidong0635
35dfd3eafb memory: Fix memory leak of g_vtophys_map allocated failed.
if g_phys_ref_map allocated successfully and g_vtophys_map
allocated failed. It reports memory leaks. so add
spdk_mem_map_free(&g_phys_ref_map).

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I06149c98f158d1c679e5045e279beccbdea10e55
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7249
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Chengqiang Meng <chengqiangx.meng@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
2021-04-12 09:44:13 +00:00
Michal Berger
f40b0b1629 pgkdep/git: Upgrade ice driver to 1.4.11
The old 1.2.1 version doesn't compile against latest 5.11.x kernels
(e.g. due to recent changes in include/net/xdp.h) so upgrade to the
latest compatible release.

Also, move the url to sourceforge since ice is released more often
there under e1000 project.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I08b7beae922addeb877fe321679151b02bd253db
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7011
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
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
2021-04-12 09:43:31 +00:00
Michal Berger
0f8bff29f8 pkgpdep/git: Patch QAT to adjust for changes in recent kernels 5.11.x
Most notably, crypto/sha.h was split into two separate header files,
crypto/sha1.h and crypto/sha2.h.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I43ae61034f743bf4aae7f2f29919eec92d851f01
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7010
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
2021-04-12 09:43:31 +00:00
Michal Berger
c09b139e61 test/nvmf: Use rxe_cfg to get rxe-enabled net devices
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Iafc067f880525f25363db1adf9a94a9fc9215455
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6994
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-04-12 09:41:20 +00:00