Commit Graph

17142 Commits

Author SHA1 Message Date
Jim Harris
713333fdc9 test/nvmf: add some delays in discovery.sh
The test script does sequences like the following:

1) Add a host to an existing subsystem on target A
2) Check application B to see if it has received a
   discovery AEN and attached to that subsystem

But we have to account for some delay between 1 and 2.
Application B has to receive the discovery AEN, get
the discovery log page, parse the new log page entry
and then connect to the NVM subsystem.

Fixes issue #2420.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I160ed117ccd92bfb848f0075494a0d516b341191
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11934
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-14 08:44:21 +00:00
Jim Harris
9d0bd899ed nvmf: fix trid comparison for discovery subsystem entries
When generating a discovery log page, we will add entries
for the discovery subsystem for all listeners except the
one associated with the controller that generated the
log page command.  We do this comparison using
spdk_nvme_transport_id_compare().

But this function compares the subnqn of the trid, and
the subnqn is not set in either of the trids that we
are comparing.

The listener's trid always has an empty subnqn, but
the source trid has an uninitialized subnqn when
we do the comparison.  This means that sometimes the
subnqn may be empty (which always happens in debug
builds) but sometimes may contain garbage.  This
means that sometimes an entry would be added to the
log, even for the trid of the discovery controller
that generated the command (meaning the discovery
controller would end up referring to itself which
is not allowed).

There is an even more subtle issue with this.  If the
host reads just the log page header, the nvmf target
generates the entire log page, and just returns the
header contents.  Let's say in this case, the source
trid has an empty subnqn, so we don't generate an entry
for it, and report numrec = X and genctr = Y.  Then
the host reads the X log page entries.  But now the
source trid is garbage, so a discovery log page entry
is returned, replacing one of the "real" log page
entries.  And since genctr didn't change, the host
thinks the data is all valid, meaning there's a log
page entry for an NVM subsystem that ends up getting
dropped.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I96cfc566ddaf17153aec089bf3d9b3480bec3e4b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11933
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-14 08:44:21 +00:00
Jim Harris
002b25cc5a bdev_nvme: use INFOLOG for discovery messages
This is not in the fast path, so using INFOLOG
instead of DEBUGLOG allows these messages to be
enabled in release builds.

While here, set this flag in the discovery.sh
test script so that we get better information if
there are test failures.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1c0d087b5c0cb40118691f4a1bc16adc2fdaad9c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11932
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-14 08:44:21 +00:00
Shuhei Matsumoto
999f0362ab nvme_tcp: Remove qpair from group->needs_poll when removing it from poll_group
spdk_sock_close() may not complete synchronously.

Then the following scenario is possible.

ctrlr_disconnected_qpair() calls spdk_sock_close(). Then any request may
complete and call _pdu_write_done(). qpair is still associated with a
poll_group and is inserted into the group->needs_poll list.
After ctrlr_disconnected_qpair() completes, disconnected_qpair_cb() is
called. disconnected_qpair_cb() calls spdk_nvme_ctrlr_free_io_qpair().
spdk_nvme_ctrlr_free_io_qpair() calls spdk_nvme_poll_group_remove().

spdk_nvme_poll_group() removes qpair only from the
group->disconnected_qpairs list.

Even after qpair->poll_group is nullified, qpair is still in the
group->needs_poll list.

Then spdk_nvme_poll_group_process_completions() polls all qpairs in
the group->needs_poll list and hits the assert.

Fixes the issue #2390

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I6ede8bd3b7b1a57a34ac61436159975ab6253fbe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11882
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-03-14 08:44:03 +00:00
Karol Latecki
22e8fc83ed autobuild.sh: do not use sudo to run make in external code test
Running the whole test_make.sh script with sudo causes "make"
calls in script to also be run with sudo. This may result in
"root" ownership of some of the output files, which in turn
may affect subsequent autobuild.sh stages.

Fixes #2426

Change-Id: I42cdc65153869076ad477d22d97e49d3ca4a9470
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11885
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-14 08:43:50 +00:00
Richael Zhuang
3ee923eff1 uring: fix heap-use-after-free bug in sock_flush_client
If the req's cb_fn will close the socket, there is heap-use-after-free
error if continuing to access sock.

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: I88c6adb9d25e52d94b08f53e8ccac611c4d29fff
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11855
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.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: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-11 08:04:59 +00:00
Konrad Sztyber
6c3fdade83 vmd: reset root port config before enumeration
The root ports might have been configured by some other driver (e.g.
Linux kernel) prior to loading the SPDK one, so we need to clear it.  We
need to before the scanning process, as it's depth-first, so when
scanning the initial root ports, the latter ones might still be using
stale configuration.  This can lead to two bridges having the same
secondary/subordinate bus configuration, meaning that their config space
would map to the same memory area, which, of course, isn't correct.

This has manifested in issue #2413, where two root ports were configured
to use the same secondary bus.  This caused an endpoint device to be
enumerated twice on two different root ports, with the first instance
being broken once the second port was configured by the SPDK driver.

Fixes #2413

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I5ce0931a84c1d23ccadb93fe39e8155ff1281474
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11863
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tom Nabarro <tom.nabarro@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-10 16:45:18 +00:00
Konrad Sztyber
038f5b2e1b vmd: pass pci_header instead of vmd_pci_device
This will allow to use these functions without having to instantiate an
instance of vmd_pci_device.  The following patch will use this to
perform some initial clean up before the scanning process.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Icff92a4a429b259bec13eb6b0c1581aadbaae24d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11862
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tom Nabarro <tom.nabarro@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-10 16:45:18 +00:00
John Levon
c4f7ddd2c7 lib/nvme: report shadow doorbell update stats
Currently shadow doorbell updates are not counted; add statistics for
those, and rename the other statistic for clarity.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I211a77902e38265c99b15862034c6d022dc582a0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11844
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2022-03-10 09:49:25 +00:00
John Levon
9e239b1c1e lib/nvme: remove needless check
nvme_pcie_qpair_update_mmio_required() is only called for QPs with
shadow doorbells enabled, so we don't need an additional branch here.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Idf65f92deb0c6f93019892ef5a02bc28ba4c0f8c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11843
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2022-03-10 09:49:25 +00:00
John Levon
8071e0f1dc lib/nvme: drop unused argument
nvme_pcie_qpair_update_mmio_required() qpair argument is unused.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I0bd6897eb8e6a06f211cc599ab6045409bb43641
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11842
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2022-03-10 09:49:25 +00:00
Krzysztof Karas
fcf5ae7e4e scheduler: prepare scheduler code for dynamic changes
Change dynamic scheduler parameters from #define to
global variables.

Change-Id: I5bbbf40ac66971bcc24fc8bf0ac5d13efdc7412f
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11447
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-09 13:33:21 +00:00
Aviv Ben-David
c883771123 env/memory: fix unregistration of memory after memory registration issue
The current error handling of `spdk_mem_map_notify_walk` has off by 2
issue. This issue can split one memory region to multiple smaller
regions when calling the callback to unregister the memory region.
Also, in case of failure, the 1 GB maps of the map failed to be freed.

RDMA doesn't support this behavior and support calling the callback only
once for each previously registered memory region.

Signed-off-by: Aviv Ben-David <aviv.bendavid@vastdata.com>
Change-Id: I65b667f2e84533f234a2e330b20e9ad9eef32854
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11219
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>
2022-03-09 09:06:30 +00:00
John Levon
ba4ffda671 lib/nvme: correct typo in transport stats
"doorbell" not "doobell"

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I9261559576e72a09b63fbc984ae0ec2a2572eb2c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11841
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-03-09 08:03:42 +00:00
Rui Chang
cd9fca0d20 test/unit: fix valgrind error for test_nvme_free_request
In test_nvme_free_request, there is valgrind error:
Conditional jump or move depends on uninitialised value(s)

Signed-off-by: Rui Chang <rui.chang@arm.com>
Change-Id: I80f741cac9316d86b060419e3b6fb651fa018aa4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11826
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2022-03-09 08:03:23 +00:00
Michal Berger
5d4ccc8325 test/scheduler: Don't fail if cgroups don't exist in move_cgroup_procs()
This shows a similar problem the a9614bf6e was facing. Some cgroups,
especially under v2 + systemd, may have a very small scope, including
very limited number of processes (see comment in init_cpuset_cgroup()).
If they terminate, their cgroups are removed as well.

Change-Id: I0bfc69440f1e7841a7605bc34647f1092cc033aa
Signed-off-by: Michal Berger <michallinuxstuff@gmail.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11815
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.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>
2022-03-09 08:02:55 +00:00
Michal Berger
eb8655b2fe setup.sh: Make sure driver is known upon reset
In case collect_driver() returns immediately due to missing modalias
attr, an empty $driver will be passed to check_for_driver() causing
grep inside to fail. Further false-positive then leads to call to
linux_bind_driver() as it's not able to locate proper paths for
given driver.

To avoid this, make sure collect_driver() always attempts to fallback
to a driver setup.sh supports for a target device.

Signed-off-by: Michal Berger <michallinuxstuff@gmail.com>
Change-Id: Id5631a731910f60b63c6afb3a412575bb69d784a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11747
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-03-09 08:02:41 +00:00
Alexey Marchuk
9fab738e6e bdev: Use iovec to save original md buffer in IO request
That is a preparation for adding memory domains
pull/push functionality which works with iovec
structure instead of pointers

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I3d0db3e7b302b45b4e3bae3452bc5ffa3e62db8e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11687
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-09 08:02:19 +00:00
Tomasz Zawadzki
ffdb454114 lib/vhost: move virtio related functions to rte_vhost
At this time only rte_vhost_user makes use of the virtio related
functionality. Which is used by vhost_scsi and will be used by
vhost_user_blk virtio transport.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ia159e14ce5f9a74185da9898713deeff76d14f1a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11100
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2022-03-09 08:01:51 +00:00
Liu Xiaodong
03b75034ae doc/container: display spdk-docker-suite in doc
Link spdk-docker-suite to get SPDK users realized that
there is already a good docker usage example.

Change-Id: Ia154061d894b77ba544d83aaffbb94c998f54bde
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11851
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-03-09 08:01:38 +00:00
Liu Xiaodong
a4c5411bdf doc/container: put containerizing SPDK to front
Recently, received questions around containerizing SPDK app
or app built on top of SPDK. Containerizing SPDK is more
useful for general SPDK users.
So move it to front in order to avoid SPDK users get confused
or stuck on the Kata one.

Change-Id: I3dc510d0a7bafa63be4559810990d28c5f9d7de5
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11850
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-03-09 08:01:38 +00:00
Pawel Piatek
087b6cb6eb post_process: add summary to completion table
Signed-off-by: Pawel Piatek <pawelx.piatek@intel.com>
Change-Id: I8aaae248840151607675ca61441d0a091c16a25c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11801
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2022-03-09 08:01:25 +00:00
Pawel Piatek
29eb8b7e7c post_process: simplify highest value function
This logic is just what "any" does.

Signed-off-by: Pawel Piatek <pawelx.piatek@intel.com>
Change-Id: Id6384e7e284dfabb73f9ecfbc10c40643c3c5177
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11490
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2022-03-09 08:01:25 +00:00
Shuhei Matsumoto
d8a105742f nvmf/rdma: Fix overflow of RB tree comparison when qp_num is very big
If 0 - UINT32_MAX or UINT32_MAX - 0 is substituted into a int variable,
we cannot get any expected result.

Fix the bug and add unit test case to verify the fix.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Iad2ea681ad8ad234e70c7310b58785a999612156
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11837
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2022-03-09 08:00:58 +00:00
Shuhei Matsumoto
00a7998254 bdev/nvme: Move per controller settings into a option structure
The following patches will enable us to specify I/O error resiliency
options per nvme_ctrlr as global options. To do it easier, move
per controller options about I/O error resiliency into struct nvme_ctrlr_opts.

prchk_flags is not exactly for resiliency but move it into struct
nvme_ctrlr_opts too.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I85fd1738bb6e293cd804b086ade82274485f213d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11829
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2022-03-09 08:00:45 +00:00
Shuhei Matsumoto
df32eb112b bdev/nvme: Add helper functions to decode T10 DIF parameters
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: If218cbc8ee0a5354e5c4e58eaae111660eb9c099
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11828
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2022-03-09 08:00:45 +00:00
Shuhei Matsumoto
d40292d05a bdev/nvme: Add prefix "drv_" to instance or pointer of spdk_nvme_ctrlr_opts
The following patches will add options per struct nvme_ctrlr in the
NVMe bdev module. bdev_opts will be used for it.

Additionally, fabrics_connect_timeout_us is set directly to
spdk_nvme_ctrlr_opts. So remove it from the RPC request structure.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I981cda5e69375edc43a8581cd3b43497c38a3d56
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11827
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2022-03-09 08:00:45 +00:00
Shuhei Matsumoto
1a00f5c094 bdev/nvme: Fix overflow of RB tree comparison when the NSID is very big
If 0 - UINT32_MAX or UINT32_MAX - 0 is substituted into a int variable,
we cannot get any expected result.

Fix the bug and add unit test case to verify the fix.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ib045273238753e16755328805b38569909c8b83a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11836
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2022-03-09 08:00:45 +00:00
Alexis Lescouet
b9a667914f test/common: Remove the call to sudo in unit test script when not needed
Signed-off-by: Alexis Lescouet <alexis.lescouet@nutanix.com>
Change-Id: I457ddee7c110088578b7f1b0a5caf78882e301c5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11636
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-09 08:00:28 +00:00
Alexis Lescouet
a71cd5214b event: Add a user option to change the size of spdk_msg_mempool
The spdk_msg_mempool structure has a fixed size, which is not flexible
enough. The size of the memory allocation can now be changed in the
options given to the spdk_app_start function.

Signed-off-by: Alexis Lescouet <alexis.lescouet@nutanix.com>
Change-Id: I1d6524ab8cf23f69f553aedb0f5b0cdc9dde374b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11635
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-03-09 08:00:28 +00:00
Yuriy Umanets
c58d5161e9 bdev/crypto: Fixed g_session_mp init error handling
In vbdev_crypto_init_crypto_drivers() when g_session_mp init failed it
was possible to jump to cleanup label but return 0 instead of -ENOMEM.

Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: I128968699b0d2dbb2f769ac5fd7bd53ab409562b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11659
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2022-03-08 15:07:46 +00:00
Yuriy Umanets
bfb676e93d bdev/crypto: Fixed bdev_io double completion
_crypto_operation_complete(bdev_io) should not be called in
_crypto_operation() because it is done by caller function
on read or write.

Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: Ie03412c72f41abf661b069d4b00eaf74f40261d6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11629
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-08 15:07:46 +00:00
Yuriy Umanets
3d0bae35c4 bdev/crypto: Error handling fixes in vbdev_crypto_claim()
- Fixed missed spdk_bdev_module_release_bdev() during error handling.
- Fill the keys with zeros before releasing memory.
- Fixed issue with g_number_of_claimed_volumes that can become negative
  because of invalid error handling.

Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: I4171f4326d87b1d8f886416bf53b0f2043ccbfe7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11628
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2022-03-08 15:07:46 +00:00
Konrad Sztyber
f6dbaa0686 pkgdep: add python3-devel dependency
The following patch will need it to expand the %{python3_sitelib} macros
when building the RPMs.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2782b228066fa0524d675c8d964217a7c9d11e36
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11656
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2022-03-08 07:54:23 +00:00
Krzysztof Karas
d0e483cdfd scheduler: enable runtime scheduler changing
Enable runtime scheduler changing in SPDK.

Currently we do not allow to switch between different
schedulers after "framework_start_init" rpc is called.
This is cumbersome, because user has to reinitialize
SPDK each time they want to make changes.

Change-Id: I97d723c6ba966d25e8e57ed023fc1d0826e1b402
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11404
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-08 07:54:05 +00:00
Jim Harris
43d17a844c bdev/nvme: handle detach first in discovery_poller
This will be helpful in later patches, when we handle
detach not just at discovery service stop, but also
when a discovery controller is disconnected.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie62d62f73b328c6e058f6480c61fbdf91e854e2a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11767
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-08 07:52:49 +00:00
Jim Harris
a96c1bfdbd bdev/nvme: change order of add/remove for discovery
If the path to a subsystem changes from one discovery
log to the next, we should add the new paths first,
and only then remove paths.  This ensures we don't
remove the last path to a subsystem, causing associated
bdevs to get unregisterd and reregistered.

This requires adding a new log_page member to
discovery_ctx, since we now need to walk the log
page to find removed paths after all the new paths
are attached.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I99fc2e40e6f7e2e26d558ebe7bc5208fe474c0ea
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11766
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-08 07:52:49 +00:00
Jim Harris
e65549fc34 test/nvmf/discovery: add get_notification_count
This will be helpful to ensure we do not unregister
and then reregister a bdev during a discovery
failover event.  We will want to make sure that if
a path gets replaced, that we register the new path
before removing the old one, if the old one is
removed from the discovery log.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9a65f7b8e462ed262e615f2680742db309640e79
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11748
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-08 07:52:49 +00:00
Shuhei Matsumoto
52f7aeb703 nvmf/rdma: Speed up qpair lookup by using RB tree
To speed up qpair lookup, an idea to use the DPDK hash library was
proposed. But we have some concerns for the idea, we may see performance
regression for small configuration, lib/nvmf is depending on the DPDK
feature, and so on.

On the other hand, RB tree is simple to use and is not likely to have
negative side effect.

To use RB tree easily, cache QP num into struct spdk_nvmf_rdma_qpair.

Change-Id: Id4ea4e75692f86335b3e984c3fc128e187f22c72
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11798
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-03-08 07:52:38 +00:00
Shuhei Matsumoto
7613e3fefb nvmf/rdma: Add qpair to poll group after initialization succeeds
nvmf_rdma_poll_group_add() added a rqpair to the poll_group->qpairs list
before its initialization.

If we change the poll_group->qpairs list from linked list to RB tree,
the qpair can be added to the poll_group_qpairs list only after its
initialization completes because QP number is necessary.

As a preparation, change nvmf_rdma_poll_group_add() to add a rqpair to
the poll_group->qpairs list after its initialization succeeds.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I42525f68c5efbd445f96da8f4f63d31f06f739e3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11800
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-08 07:52:38 +00:00
paul luse
89ee5a13bf module/bdev/compress: print a reasonable message on create error
Specifically when a compress bdev already exists on the supplied
base.  Before this you'd get a bunch of nasty messages providing
really no clue as to what was wrong.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I8cce8902909659fba0e9613891c7ef8ebe4b06d0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11806
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-08 07:50:49 +00:00
John Levon
84257185a4 nvmf/vfio-user: correct vfu_run_ctx() handling
When vfu_run_ctx() returns EBUSY, due to an ongoing quiesce, we did no
work, so should return SPDK_POLLER_IDLE.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I5953ab652f0adf22df81c94c4bece507833cece4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11810
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-08 03:33:42 +00:00
Changpeng Liu
a576bccca9 nvmf/vfio-user: remove vfio-user CSTS.CFS
We will use nvmf library CSTS.CFS instead so that the client can
get this error status.

Change-Id: I42c248a7333d1f9c940bb29135c887a61c906bd4
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11676
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-08 02:35:05 +00:00
Changpeng Liu
a19e5b4dae nvmf: add internal set Controller Fatal Status API
Change-Id: I6a11962311433e2e1d98ec6b58a1734876857df9
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11675
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-08 02:35:05 +00:00
Changpeng Liu
2049e54926 nvmf/vfio-user: rename controller migration data structures
No logic code changes, we will define a nvmf controller migration
data structure in public header file, this is a preparation patch.

Change-Id: I0a98581b320ac9b12b7e4bf838222c5075168e64
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11493
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-08 02:35:05 +00:00
paul luse
8951c15759 accel/idxd: add and respect flag to support writes to PMEM
Plumbing for flags was added in prior pathces.  This patch
introduces and respects the relevant flags for use with PMEM
aka durable memory through the accel_fw, IDXD, IOAT and SW
modules.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I792f31459e061d220965feced60e0c236d819a68
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9455
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-04 21:56:54 +00:00
paul luse
12c40f05e2 accel: plumb accel flags through operations that need them
This patch is just plumbing the flags param. Use of it for PMEM
will come in upcoming patches.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I620df072aaad3f8062a0312bbea3da1bc3f911b9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9281
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-04 21:56:54 +00:00
paul luse
0d5ce8c2cf idxd: introduce new IDXD flag for cache control
A new public flag, SPDK_IDXD_FLAG_NONTEMPORAL, is introduced
that hints to DSA that it should bypass CPU cache. An example
use case of this would be where the target is PMEM. This flag
is not set by the low level library (so default is that CPU
cache is the target).

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I99fc62d6bfd6ec97985a86fc1ae5454a21679684
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11482
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-04 21:56:54 +00:00
paul luse
37ae5a2fb9 idxd: Set cache control flag in 3 places where it was missing
Was simply missed earlier.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I74aed97d4858d9b364bd7043a221efeaf260f730
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11481
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-04 21:56:54 +00:00
paul luse
7d63e716eb idxd: Add flags parameter to all low level API for prep/submission
Previously required flags were hardcoded in the low level library.
By having the user pass them in there is more flexbility and control.
This was driven by the need to add a new flag for pmem durability,
coming in a future patch in this series.

There is no change in functionality with this patch, just movement
of where flags are set and by whom and the plumbing of 'flags'..

Also note that some flags in scenarios that we know are required are
still set by the library.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I194278f9e3cec0886628585cf84bcc2eae635e0a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9449
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-04 21:56:54 +00:00