Commit Graph

11172 Commits

Author SHA1 Message Date
Shuhei Matsumoto
3d1bbb273b ut/nvme_pcie: Fix a few assert conditions which had used not == but =
A compiler got warning for these mistakes.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie9772910b6a3cc9d6e45cfae1c19048179d16189
(cherry picked from commit 7641283387)
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5527
Tested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-12-17 15:41:22 +00:00
Alexey Marchuk
43a94514af make/dpdk: Correct compiler type detection
This commit fixes compiler type detection to suppress
warnings specific for gcc 10

Change-Id: I66264451792ff84a53001badc7c2f8a452d732af
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
(cherry picked from commit 1415e38411)
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5525
Tested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <dongx.yi@intel.com>
2020-12-17 15:41:22 +00:00
Alexey Marchuk
f71ccc5691 make/dpdk: Suppress GCC 10 warnings
Suppres the following warnings which causes compilation errors:
1. gcc 10 complains on operations with zero size arrays in rte_cryptodev.c
Suppress this warning by adding -Wno-stringop-overflow compilation flag
2. gcc 10 disables fcommon by default and complains on multiple definition of
aesni_mb_logtype_driver symbol which is defined in header file and presented in sevral
translation units. Add -fcommon compilation flag.

Fixes issue #1493

Change-Id: I9241bf1fd78e86df6a6eb46b4ff787b2f7027b7d
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
(cherry-picked from commit 970c6d099e)
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5526
Tested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-12-17 15:41:22 +00:00
Seth Howell
74c9fd40fd sock: keep track of removed sockets during call to poll
We have been intermittently hitting the assert where
we check sock->cb_fn != NULL in spdk_sock_group_impl_poll_count.

The only way we could be hitting this specific error is if we
wereremoving a socket from a sock group within after receiving
an event for it.

Specifically, we are seeing this error on the NVMe-oF TCP target
which relies on posix sockets using epoll.

The man page for epoll states the following:

 If you use an event cache or store all the file descriptors
 returned from epoll_wait(2), then make sure to provide
 a  way  to  mark its closure dynamically (i.e., caused by
 a previous event's processing).  Suppose you receive 100 events
 from epoll_wait(2), and in event #47 a condition causes event
 #13 to be closed.  If you remove  the  structure  and close(2)
 the file descriptor for event #13, then your event cache might
 still say there are events waiting for that file descriptor
 causing confusion.

 One solution for this is to call, during the processing
 of  event  47,  epoll_ctl(EPOLL_CTL_DEL)  to  delete  file
 descriptor  13 and close(2), then mark its associated data
 structure as removed and link it to a cleanup list.  If
 you find another event for file descriptor 13 in your batch
 processing, you will discover the file descriptor  had
 been previously removed and there will be no confusion.

Since we do store all of the file descriptors returned from
epoll_wait, we need to implement the tracking mentioned above.

fixes issue #1294

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ib592ce19e3f0b691e3a825d02ebb42d7338e3ceb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1589
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: Aleksey Marchuk <alexeymar@mellanox.com>
(cherry picked from commit e71e81b631)
2020-07-05 14:53:47 +09:00
Tomasz Zawadzki
e46860f591 version: 20.01.3 pre
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I698c84ce3fff46612a67a1418551039e7f433a9d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2699
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-06-01 18:04:29 +00:00
Tomasz Zawadzki
b2808069e3 SPDK 20.01.2
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id838a19f76bd5e7f6c771a3a4f673e85e4a1f92b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2698
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-06-01 17:50:18 +00:00
Darek Stojaczyk
9b83caf89f dpdkbuild: add support for DPDK 20.05
EAL got a new dependency in 20.05: rte_telemetry.

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>

(cherry picked from commit 3b99a376d5595f4d6a458e8221bfd0b6b6f07b83)
Change-Id: I43df7afe9a84e88f034a7f87fc6a299f0bbd8bac
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2705
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-06-01 17:50:18 +00:00
Tomasz Zawadzki
fb56c3214e CHANGELOG: updated with changes backported to 20.01.x
- bdev_rbd_resize was added to incorrect section
- added info on spdk_mem_reserve

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I32f9b0ddf4d87243e3eab2b47fd35debc135d4e9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2697
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-06-01 17:50:18 +00:00
Jim Harris
f8d26843fc nvme: create netlink socket during nvme_driver_init
This helps ensure thread safety on creation of the
netlink socket, when probe is called from multiple
threads at once.  It is also a lot more clean - we just
create it once, rather than checking every time probe
is called to see if it has to be created.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2681 (master)

(cherry picked from commit 89e47f6014)
Change-Id: I528cedc3ff44de6ea8ecaf6d2389226502ba408e
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2696
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-06-01 17:50:18 +00:00
Jim Harris
239eae6000 nvme: add mutex to nvme_driver_init
This will allow spdk_nvme_probe and variants to be
called from multiple threads in parallel.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2680 (master)

(cherry picked from commit 18f79f2449)
Change-Id: I534db605c9e192b943afe973981b7b503d8b7e34
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2695
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-06-01 17:50:18 +00:00
Tomasz Zawadzki
8bfa974cc2 dpdk: update submodule to include fix for vhost from CVE-2020-10722 to 10726
Updated submodule from branch containing DPDK 19.11 to DPDK 19.11.2

That includes fixes for DPDK vulnerabilities:
- CVE-2020-10722
- CVE-2020-10723
- CVE-2020-10724
- CVE-2020-10725
- CVE-2020-10726
Along with other fixes done between those DPDK maintenance releases.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I33e14eba54568a2313bb0020bad9be3fdfc6836b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2564
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-06-01 08:55:55 +00:00
zkhatami88
ed016fdbfb nvme/rdma: Using hooks in reg mr
Signed-off-by: zkhatami88 <z.khatami88@gmail.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1905 (master)

(cherry picked from commit fe3fab26bf)
Change-Id: I9493fe82b5b758c0092d20ef18b79d652fefed85
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2610
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-06-01 08:55:55 +00:00
zkhatami88
ce4da6c39a nvme/rdma: When RDMA hooks exist, prefer spdk_zmalloc for internal
allocations

Signed-off-by: zkhatami88 <z.khatami88@gmail.com>
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1593 (master)

(cherry picked from commit 58a8fe2eee)
Change-Id: I7f810ee78fecca7eb8a4387f6d63e1a952966e57
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2609
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-05-29 09:08:44 +00:00
Seth Howell
ae161cdec6 nvme/rdma: make sure we free resources in error path.
Not sure how we missed this.

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

(cherry picked from commit 2248e52150)
Change-Id: If920cb3a7708c33032e1da28c564d4c28ddafdf4
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2608
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-29 09:08:44 +00:00
Tomasz Zawadzki
7f9ea53d35 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>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1917 (master)

(cherry picked from commit 251a551aa3)
Change-Id: I72b695d995b63bd002cc03e60cd4bdc82cfbe8ae
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2162
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-29 09:07:55 +00:00
Tomasz Zawadzki
6fe32e3e17 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>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1916 (master)

(cherry picked from commit f955c75ef4)
Change-Id: If84317c67626a3193851c90be056b8550a5fccee
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2161
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-29 09:07:55 +00:00
Tomasz Zawadzki
b8446bb66d 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>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1938 (master)

(cherry picked from commit 7fbdeacc9e)
Change-Id: I5f56548d1bce878417323c12909d6970416d2020
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2160
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-29 09:07:55 +00:00
Tomasz Zawadzki
3f5f09db46 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>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1915 (master)

(cherry picked from commit ef6ffb39d6)
Change-Id: I254f6d716d0ce587f88cc658163ba049378f3b2f
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2159
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-29 09:07:55 +00:00
Ben Walker
4faf9fc37b 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>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1903 (master)

(cherry picked from commit 5340d17823)
Change-Id: I59361f510eb1659c2346f1fd33c375add1dc9c81
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2158
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-29 09:07:55 +00:00
Tomasz Zawadzki
cbb1d099ff 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>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1921 (master)

For backporting to 20.01.x, API breaking changes were removed.
Only part that could cause the segfault remained.

(cherry picked from commit d9a11fd5b1)
Change-Id: Id77cebe23ff91023a24cfe091f5f62a76a9175fd
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2156
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-29 09:07:55 +00:00
Tomasz Zawadzki
d42b332ae6 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>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1918 (master)

(cherry picked from commit 15a5018067)
Change-Id: I25ada843a59c632fe330263a65456d25c5ccf4cc
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2155
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-29 09:07:55 +00:00
Alexey Marchuk
930d91f479 nvme: Abort queued reqs when destroying qpair
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1791 (master)

(cherry picked from commit 4279766935)
Change-Id: Idef1b88cf47cf9f82b1f4499ef836dfa741c0c7f
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2606
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-05-29 08:29:33 +00:00
Alexey Marchuk
0acac18cfa nvme/rdma: Clean pointer to nvme_request
That is done to make sure that scenario described in github
issue #1292 won't happen

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1771 (master)

(cherry picked from commit f11989385e)
Change-Id: Ie2ad001da701e25ef984ae57da850fb84d51b734
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2641
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-05-29 08:29:33 +00:00
Alexey Marchuk
2381516ecc nvme/rdma: Wait for completions of both RDMA RECV and SEND
In some situations we may get a completion of RDMA_RECV before
completion of RDMA_SEND and this can lead to a bug described in #1292
To avoid such situations we must complete nvme_request only when
we received both RMDA_RECV and RDMA_SEND completions.
Add a new field to spdk_nvme_rdma_req to store response idx -
it is used to complete nvme request when RDMA_RECV was completed
before RDMA_SEND
Repost RDMA_RECV when both RDMA_SEND and RDMA_RECV are completed
Side changes: change type of spdk_nvme_rdma_req::id to uint16_t,
repack struct nvme_rdma_qpair

Fixes #1292

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1770 (master)

(cherry picked from commit 581e1bb576)
Change-Id: Ie51fbbba425acf37c306c5af031479bc9de08955
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2640
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-05-29 08:29:33 +00:00
Tomasz Zawadzki
90501268d6 lib/blob: merge EP of a clone when deleting a snapshot
In general it is not possible to delete snapshot when
there are clones on top of it.
There is special case when there is just a single clone
on top that snapshot.

In such case the clone is 'merged' with snapshot.
Unallocated clusters in clone, are filled with the ones
in snapshot (if allocated there).

Similar behavior should have occurred for extent pages.

This patch adds the implementation for moving EP from
snapshot to clone along with UT.

The UT exposes the issue by allowing delete_blob
to proceed beyond just unrecoverable snapshot blob.

Fixes #1291

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

Removed changes in UT since it requires couple multiple UT refactoring
changes before it.

(cherry picked from commit 0f5157377f)
Change-Id: Ib2824c5737021f8e8d9b533a4cd245c12e6fe9fa
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2599
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-29 08:27:18 +00:00
Liang Yan
ae0db495fb bdev/rbd: increase the segment in flush opeartion
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2490 (master)

(cherry picked from commit f2ede6b486)
Change-Id: Ibde0f924c1b78c9a8f0f440e944c7eb81631ed1b
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2597
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Liang Yan <liang.z.yan@intel.com>
2020-05-29 08:27:09 +00:00
Michael Haeuptle
9bcc0ea8e8 ENV_DPDK/VFIO: Increase PCI tear down timeout
When removing large number of devices (>8) in parallel,
the 20ms timeout is not long enough.

As part of spdk_detach_cb, DPDK calls into the VFIO driver
which may get delayed due to multiple hot removes being
processed by pciehp driver (pciehp IRQ thread function
is handling the actual removal of a device in paralle but
all of the IRQ thread function compete for a global mutex
increasing processing time and race conditions).

Signed-off-by: Michael Haeuptle <michael.haeuptle@hpe.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1588 (master)

(cherry picked from commit 55df83ceb6)
Change-Id: I470fbbee92dac9677082c873781efe41e2941cd5
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2598
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
2020-05-29 08:27:00 +00:00
Ben Walker
fab97f2aac Revert "env: Use rte_malloc in spdk_mem_register code path when possible"
This reverts commit 6d6052ac96.

This approach is no longer necessary given the patch immediately
preceeding this one.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2512 (master)

(cherry picked from commit 76aed8e4ff)
Change-Id: I5aab14346fa5a14dbf33c94ffcf88b045cdb4999
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2601
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-29 08:26:42 +00:00
Ben Walker
d635d6d297 env: Add spdk_mem_reserve
The spdk_mem_reserve() function reserves a memory region in SPDK's
memory maps. This pre-allocates all of the required data structures
to hold memory address translations for that region without actually
populating the region.

After a region is reserved, calls to spdk_mem_register() for
addresses in that range will not require any internal memory
allocations. This is useful when overlaying a custom memory allocator
on top of SPDK's hugepage memory, such as tcmalloc.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2511 (master)

This backport requires increasing SO_MINOR version, since it adds
new API. Version 2.1 does not conflict with any other, since on master
the API was increased from 2 to 3 SO_VER see:
(229ef16b) lib/env_dpdk: add map file and rev so major version.

(cherry picked from commit cf450c0d7c)
Change-Id: Ia4e8a770e8b5c956814aa90e9119013356dfab46
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2600
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-05-29 08:26:42 +00:00
Tomasz Zawadzki
e8d8cef0fd make: allow individual SO version for each library
Based on patch:
(19392783)make: rev SO versions individually for libraries.

It allows each library to update its own version separate
from the SO_SUFFIX_ALL==2.0.

This will allow increasing SO_MINOR version when needed.

Change-Id: Ic381a848e5f0e5af4b7f68725eb45138e00ca65b
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2593
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-05-29 08:26:42 +00:00
Tomasz Zawadzki
062da7a08a nvme/pcie: reduce physically contiguous memory for CQ/SQ
Following patch made sure that CQ/SQ are allocated in
physically contiguous manner:
(64db67) nvme/pcie: make sure sq and cq are physically contiguous

Using MAX_IO_QUEUE_ENTRIES is enough to make sure that either
queue does not span multiple hugepages.

Yet the patch made sure that whole page is occupied only
by the queue. Which unnecessarily increases memory consumption
up to two hugepages per each qpair.

This patch changes it so that each queue alignment is limited
up to its size.

Changes in hugepages consumed when allocating io_qpair in hello_world
application:
io_queue_size		Without patch	With patch
256			8MiB		0MiB
1024			12MiB		4MiB
4096			24MiB		16MiB
Note: 0MiB means no new hugepages were required and qpair fits into
previously allocated hugepages (see all steps before io_qpair
allocation in hello_world).

Intersting result of this patch is that since we required alignment
up to the hugepage size this resulted in reserving even two 2MiB
hugepages to account for DPDK internal malloc trailing element.
See alloc_sz in try_expand_heap_primary() within malloc_heap.c

This patch not only reduces overall memory reserved for the
queues, but decreases increase in heap consumption on DPDK side.

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

(cherry picked from commit d3cf561199)
Change-Id: I75bf86e93674b4822d8204df3fb99458dec61e9c
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2510
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-05-28 08:55:44 +00:00
GangCao
a7f7b1955e bdev/rbd: add ceph rbd resize function
This is to backport below change to SPDK v20.01.2 LTS release.
6a29c6a906

Change-Id: I9b7ed97f2a376af71578ccb5556231832863b255
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2262
Tested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-05-27 13:36:19 +00:00
GangCao
d4d3e76aed vhost: Fix the issue of virtual machine device parameter max_segments always equal to 1
Solve the problem that the /sys/block/vd../max_segments is always 1 in the virtual
machine,and avoid the problem of low sequential read and write performance caused
by this limitation in the general block device layer of some lower kernels.

Backport this fix (9c6d4649eb)
to the SPDK LTS 20.01.2 release.

Change-Id: I30f6201bbfbb7885379b1b0ae19b64a1673e487f
Signed-off-by: suhua <suhua1@kingsoft.com>
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2261
Tested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
2020-05-25 15:42:26 +00:00
Tomasz Zawadzki
09377fc41f version: 20.01.2 pre
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If458a3c6571f9a9beaf6ba5202d0fd29e623dc1f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1376
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-03-20 19:03:49 +00:00
Tomasz Zawadzki
b90630a465 SPDK 20.01.1
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I519f07a157f361141d3c2d9f4cf49af646af0901
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1375
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-03-20 19:03:49 +00:00
yidong0635
1ffa3c3f08 lib/nvme: Fix scanbuild issue about uninitialized value.
Issue:
nvme.c:766:2: warning: 4th function call argument is an uninitialized value
        snprintf(trid->trstring, SPDK_NVMF_TRSTRING_MAX_LEN, "%s", trstring);

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1314 (master)

(cherry picked from commit 4a1ec34d3b)
Change-Id: I4b0ae106ef8e4e72e80ec96d10010fddf8173144
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1371
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-03-20 19:03:49 +00:00
Shuhei Matsumoto
136c0771ad lib/iscsi: Return when connection state is already exited at login completion
iSCSI target got segmentation fault if connection is being exited
between spdk_iscsi_conn_write_pdu() and its callback
iscsi_conn_login_pdu_success_complete() are executed.

This was caused by recent asynchronous socket write feature.

Fixes issue #1278.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1275 (master)

(cherry picked from commit 628dc9c162)
Change-Id: Idffd90cd6ee8e6cb4298fe3f1363d8d5c5a3c49d
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1355
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>
2020-03-19 08:09:53 +00:00
paul luse
7976cae3b4 module/crypto: increase the number of queue pairs for AESNI_MB
Default was 8 which meant max of 8 bdevs.  Bump it up to 64.

Fixes issue #1232

Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1063 (master)

(cherry picked from commit 302f7aa6e4)
Change-Id: I966e90de5c27910df0e4da0d1062d9d1665f8de6
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1306
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: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-19 08:09:53 +00:00
Jim Harris
01a942dc6b bdev/nvme: do not destruct ctrlr if reset is in progress
The adminq poller could get a failure if the ctrlr has
already been hot removed, which starts a reset.

But while the for_each_channel is running for the reset,
the hotplug poller could run and start the destruct
process.  If the ctrlr is deleted before the for_each_channel
completes, we will try to call spdk_nvme_ctrlr_reset() on
a deleted controller.

While here, also add a check to skip the reset if the
controller is already in the process of being removed.

Fixes #1273.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1253 (master)

(cherry picked from commit ba7b55de87)
Change-Id: I20286814d904b8d5a9c5209bbb53663683a4e6b0
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1305
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-03-19 08:09:53 +00:00
Jim Harris
b030befb1d bdev/nvme: use mutex to protect 'resetting' member
This isn't in the performance path, so using the mutex
here makes it a bit more consistent with other ctrlr
members such as 'destruct'.

This prepares for a future patch which will defer
ctrlr destruction on removal if a reset is in progress.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1252 (master)

(cherry picked from commit 2571cbd807)
Change-Id: Ica019cd90dc3b46ef6a13dd311054dbdc95855aa
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1304
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-03-19 08:09:53 +00:00
Jim Harris
77a53c2c00 dpdk: move submodule to commit 3fcb1dd
This adds recent commit:
  contigmem: cleanup properly when load fails

Fixes issue #1262.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1217 (master)

(cherry picked from commit 328a221299)
Change-Id: I4d873af280803c3cc6c146439a0bbc7af4c7296c
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1303
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-03-19 08:09:53 +00:00
Vitaliy Mysak
cfc2cd611c 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

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1129 (master)

(cherry picked from commit d4653a31e0)
Change-Id: I88021ceca1b9e9d503b224f790819999cd16da01
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1302
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-19 08:09:53 +00:00
yidong0635
4e4bb7f822 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>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1073 (master)

(cherry picked from commit 9d93c08234)
Change-Id: Id9bf081964d0cf3575757e80fc7582b80776d554
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1301
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-03-19 08:09:53 +00:00
Seth Howell
a763a7263a mk: bump the shared object major version to 2.
This is to indicate the ABI breakage in the bdev library. A function's
argument list was changed which breaks both backwards and forwards
compatibility.

Going forward, all backwards compatibility breaking changes should be
marked with a rev of the SO major version for that library. All forwards
compatibility breaking changes should be marked with a rev of the SO
minor version.

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

(cherry picked from commit c5911f0224)
Change-Id: I35e45c102c5c6de3c684919a10e5116f8f2c375f
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1300
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
2020-03-19 08:09:53 +00:00
Changpeng Liu
52c7d46a3c nvme: set transport string before the probe based on transport type
Users may only set the transport type, but for the actual probe
process, the trstring field is mandatory, so set the trstring
based on transport type at first.  Also remove unnecessary
spdk_nvme_trid_populate_transport() call from each transport
module.

Fix #1228.

Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1001 (master)

(cherry picked from commit 8d6f48fbf8)
Change-Id: I2378065945cf725df4b1997293a737c101969e69
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1299
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-03-19 08:09:53 +00:00
Alexey Marchuk
776d45b0e3 nvme: Fix potential use of non-initialized variable
trstring variable in spdk_nvme_trid_populate_transport is not
initialized, that can lead to snprintf() writes some garbage to
trid->trstring if the user passes SPDK_NVME_TRANSPORT_CUSTOM trtype
Add return statement and assert to CUSTOM/default switch

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/483469 (master)
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>

(cherry picked from commit 3424def90a)
Change-Id: I6c6c37f9aa74d61b346f7be27fb890c7a34e9229
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1318
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-03-19 08:09:53 +00:00
Changpeng Liu
83edd2f716 nvme: detach the controller in STUB and flush the admin active requests at last
In the autotest, when calling kill_stub() function, there is error log
like this: "Device 0000:83:00.0 is still attached at shutdown!", so it's
better to detach the controller when exit the stub process.

But after call spdk_nvme_detach() in the stub process, there is another issue:
1. NVMe stub running as the primary process, and it will send 4 AERs.
2. Using NVMe reset tool as the secondary process.

When doing NVMe reset from the secondary process, it will abort all the
outstanding requests, so for the 4 AERs from the primary process, the 4
requests will be added to the active_proc->active_reqs list.

When calling spdk_nvme_detach() to detach a controller, there is a
assertion in the nvme_ctrlr_free_processes() at last to check the
active requests list of this active process data structure.

We can add a check before destructing the controller to poll the
completion queue, so that the active requests list can be flushed.

Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/977 (master)

(cherry picked from commit bad2c8e86c)
Change-Id: I0c473e935333a28d16f4c9fb443341fc47c5c24f
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1298
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-03-19 08:09:53 +00:00
Jacek Kalwas
374d2a2f64 nvme: fix command specific status code
Given enum was not aligned with spec. This status can be reported when
size equals 0.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/928 (master)

(cherry picked from commit a7a0d02d8b)
Change-Id: If51f6b051c13880c1fd4e6bb0a02f134b28b5a88
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1297
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
2020-03-19 08:09:53 +00:00
Alexey Marchuk
1a4dec353a nvmf/rpc: Destroy subsystem if spdk_rpc_nvmf_create_subsystem fails
Destroy subystem if spdk_nvmf_subsystem_set_sn or spdk_nvmf_subsystem_set_mn
failed. Check status in spdk_rpc_nvmf_subsystem_started callback, destroy
subsystem and report an error on error.

Fixes #1192

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/832 (master)

(cherry picked from commit c29247e1fe)
Change-Id: Id6bdfe4705b5f4677118f94e04652c2457a3fdcc
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1296
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-03-19 08:09:53 +00:00
Alexey Marchuk
c55906a30d rdma: Correct handling of RDMA_CM_EVENT_DEVICE_REMOVAL
This event can occur for either qpair or listening device. The
current implementation assumes that every event refers to a qpair
which is wrong. Fix: check if the event refers to a device and
disconnect all qpairs associated with the device and stop all
listeners.

Update spdk_nvmf_process_cm_event - break iteration if
rdma_get_cm_event returns a nonzero value to reduce the
indentation depth

Fixes #1184

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/574 (master)

(cherry picked from commit 804b066929)
Change-Id: I8c4244d030109ab33223057513674af69dcf2be2
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1295
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-03-19 08:09:53 +00:00