Commit Graph

19279 Commits

Author SHA1 Message Date
Konrad Sztyber
b12419a231 tcp: don't abort requests waiting for R2T ACK
It is possible for requests waiting for R2T ACK to receive H2C PDU
before receiving the ACK.  Therefore, the following sequence:

1. Host sends a write request to the target.
2. Target sends R2T PDU to the host and sets request's state to
   AWAITING_R2T_ACK.
3. Host sends H2C PDU to the target, but it doesn't reach the target
   yet.
3. Host sends an abort command to abort that request.  Request's state
   is changed to READY_TO_COMPLETE.
4. Target receives the H2C PDU, sees that request's state is
   READY_TO_COMPLETE, which is unexpected, and terminates the
   connection.

will cause the target to terminate the connection, which is obviously
incorrect.

So, to avoid that, we can treat AWAITING_R2T_ACK state in the same way
as TRANSFERRING_HOST_TO_CONTROLLER and register a poller waiting for the
state to be changed.

Fixes #2789.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Idddc627050000b74663dba397dc14d10aa0e284f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16641
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-02-13 13:50:15 +00:00
Krzysztof Karas
c824f88347 autobuild: patch DPDK with "ipsec_mb: expect EENOTSUP in ipsec_mb_create()"
Apply this patch, when building SPDK with external DPDK (versions 22.11.0+).

Change-Id: I0a09dbe6b4ee9519d51a0b4cb881844b96d94779
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16702
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>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
2023-02-10 13:27:51 +00:00
Richael Zhuang
d8c8e3f4ee bdev_nvme: update outdated log for reset_io
It has been implemented in commit 56e2d632ce to reset all nvme_ctrlrs
of a bdev controller sequentially. Update the log.

Change-Id: Id87bf99d7e269c8ad0d6b2576e2329455601ec55
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16653
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-02-09 11:32:12 +00:00
Yifan Bian
f21a34ac26 perf: add io check for aio device
If no aio device exist, then we can use 'exit(1)' to exit. Also,
update the same error check with 'exit(1)' for io_uring path.

Fix issue with 2893

Signed-off-by: Yifan Bian <yifan.bian@intel.com>
Change-Id: Iade74fba4588b109ce77af76ac998bb05b842ef3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16652
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-02-09 11:31:58 +00:00
Changpeng Liu
56f238488e lib/virtio_vfio_user: use VIRTIO_PCI_VRING_ALIGN aligned vring address
We don't need to allocate 2MiB aligned memory address for
vrings, this will waste memory and may invoke dynamic
memory allocation in DPDK sometimes.

Fix issue #2846.

Change-Id: I6410d417f92623b44c375359d5e2b5ec8ed815c0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16651
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-02-09 11:31:39 +00:00
Michal Berger
9694127db6 pkgdep/git: Remove igb_uio patch from dpdk-kmods
This change is already present in the upstream, no need to patch it
ourselves anymore.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I12c9eb59ee202a7e240542876a51977ef2f2d4ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16716
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-02-09 11:21:11 +00:00
Mike Gerdts
3e7394af6a bdev: remove bdev_register_examine_thread deprecation
Starting in SPDK 23.01, calling spdk_bdev_register() and
spdk_bdev_examine() from a thread other than the app thread was
deprecated. This commit removes the deprecation and as such calling
these functions from a thread other than the app thread is an error.

As a side effect of this commit, all bdev module examine_config() and
examine_disk() callbacks will be called on the app thread.

Change-Id: Idaae06608101e2a513d9312ac5544ffe94effe4a
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15826
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
f246b2d5c8 blob_bdev: use bdev module claims v2
With the introduction bdev module claims v2, existing consumers should
transition off of v1 claims. This transitions blob bdevs from v1
exclusive writer claims to v2 read write once claims.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I1884585a540fa17ee341430e03de3c4f5d35322b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16168
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
e52b6c0d40 test/blob: add unit test for bs_dev claims
Add a unit test to ensure spdk_bs_bdev_claim() takes an exclusive write
claim and it is released when the destroy callback is called.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ia5185545b148a8a83315c688a9c99a16b199063a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16230
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
c74b8b609b test/blob: create unit test for blob_bdev
This creates a minimal test for module/blob/bdev/blob_bdev.c.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I04698863f3228a27f73a90d50f0d5fbde30c0870
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16229
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
486651f790 test/vhost: close bdev before claim for lvs
The original implementation of bdev claims allows a module to establish
an exclusive writer claim on a bdev that has other descriptors open for
writing. This is arguably a bug. With claims v2, this bug does not
exist. The conversion of spdk_bs_bdev_claim() to claims v2 exposes this
bug in the vhost_negative test.

This patch removes an extraneous vhost_scsi_controller_add_target RPC
call that left Malloc0 open read-write while bdev_lvol_create_lvstore
tries to create an lvstore on Malloc0.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I963e210e1bc033d8720e240760004ed8aef7fda3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16169
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
86bbcdb8f6 bdev: call examine_disk() for all claim holders
If multiple claims exist on a bdev, examine_disk() is called for each of
them.

Change-Id: I0a6dc3e4bd1da20bbcbddf97a16e04c62c82354c
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15290
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
47bb651cd5 bdev: refactor bdev_examine before claims v2
This commit has no functional change. It refactors an if statement into
a case statement in preparation for supporting claims v2.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I1862428c91a7066ad9079878d4c1b690a5ef631c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15289
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
a7eb6187e5 bdev: implement claims v2
This implements the v2 claims API. Compared to the original v1 claims,
v2 claims:

- Support read-write-once, read-write-many, and read-only-many claims.
- Are claimed with spdk_bdev_module_claim_desc().
- Are associated with a bdev descriptor that is passed to
  spdk_bdev_module_claim_bdev_desc().
- Are released upon close of the bdev descriptor used to obain the
  claim.
- Cannot be taken when a descriptor other than the one passed to
  spdk_bdev_module_claim_bdev_desc() has write access.

Later commits in this series are needed to fully integrate them with the
bdev subsystem.

Change-Id: I39a356f5893aa45ac346623ec9ce0ec659b38975
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15288
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
0d8235f388 bdev: generic already claimed error message
As new claim types are introduced, printing error messages about who
holds a claim will get more complicated. This refactors the error
message code into a function to prevent code duplication.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Icdc5332214f3974e75baf11ba5ea02172c4275e1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15287
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-02-09 11:20:34 +00:00
Liu Xiaodong
120eb84454 ublk: update func ublk_try_close_dev
Merge function _ublk_try_close_dev() directly into
function ublk_try_close_dev.

Change-Id: Ib4df28f1d69f56d72e3eeaeb2220eb15f5c37440
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16417
Reviewed-by: <yifan.bian@intel.com>
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>
2023-02-08 15:26:00 +00:00
Liu Xiaodong
0f2f145963 ublk: rename g_ublk_bdevs to g_ublk_devs
bdev is not proper to describe ublk devices

Change-Id: Ic6784b3062b770dce1c77dc409ba1ee3704bdef2
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16418
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>
2023-02-08 15:26:00 +00:00
Jim Harris
3052809a3d ublk: add comment clarifying use of SQPOLL for ctrl ring
We need to use SQPOLL on the ctrl ring for now, due to
a bug in kernels <= 6.1.  This ring is used very
infrequently, so the workaround has no real effect
on performance.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia5e65a6edb7b1b6c4c945ebda8941f98c2bcdb07
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16620
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2023-02-07 08:18:54 +00:00
Jim Harris
addc545773 util: get SPDK_HAVE_* values for crc32.c
crc32.c uses SPDK_HAVE_ARM_CRC to use __crc32
intrinsics when available, but it isn't including
anything that would actually define SPDK_HAVE_ARM_CRC.

Only crc32c.c tried to define this previously, that
all got moved to crc_internal.h now, so we can just
include that here.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic5c2e6908508e32d2f3784304c5b58d3acd4c965
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16688
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>
2023-02-06 08:34:08 +00:00
Jim Harris
500ce16976 util add crc_internal.h
The preprocessor code will be needed in another
crc-related .c file in an upcoming patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icc5e6f0d81f76093dfc973a9c1fe56271baf1ed8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16687
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>
2023-02-06 08:34:08 +00:00
Alexey Marchuk
677907db73 test/blockdev: Increase qdepth of bdev_verify_big_io test
Due to a problem described in github #2886, we
were not able to run verify payload with big IO
and big queue depth. This problem was fixed with
iobuf utilities, so now we can increase queue
depth in this test.

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: I7b8935d17411c260ba416608444106684c17a0cb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16602
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>
2023-02-03 08:54:34 +00:00
Alexey Marchuk
cc8347dc2d bdev/crypto: Use iobuf large_bufsize to set opt IO boundary
We used hardcoded value set by bdev module, however
this value might be changed, so get a real value
from iobug config

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: Id15b602f699f3dd63aeff11fb063bb62c384663d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16601
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-02-03 08:54:34 +00:00
Alexey Marchuk
a54fc9f4a2 bdev/crypto: Free aux buf when crypto op fails
Fixes issue #2886

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: I19e2ba3763822bc9092fba584d35a6802c520ab7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16600
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-02-03 08:54:34 +00:00
Michal Berger
0fa77938a7 autobuild: Refactor doxygen version check
Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I053dedc537d4f58db42cbad9480c38ef520d1d9b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16028
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: Kamil Godzwon <kamilx.godzwon@intel.com>
2023-02-02 09:05:56 +00:00
Michal Berger
5aaa207a05 tests: Run make clean only when SPDK was configured
Otherwise the cmd fails due to the lack of config.mk. This forces
autopackage.sh, test_make.sh, etc. to be executed in the environment
where SPDK was already built which shouldn't be really a hard
requirement as they always re-build the SPDK for their own purposes.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ie3971acbf354734ed9c5c72d49bb93fc2ccc45f8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15743
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: Kamil Godzwon <kamilx.godzwon@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
2023-02-02 09:05:56 +00:00
Michal Berger
302f315939 autotest: Run env.sh as part of the functional tests
These mainly depend on DPDK, hence they don't really fit together
with the standard unittests as such.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ibe55f8c5c5988c61ea94a1db688270662d3b81e7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15727
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: Kamil Godzwon <kamilx.godzwon@intel.com>
2023-02-02 09:05:56 +00:00
Michal Berger
58ac71a4df autobuild: Create wrappers around top test suites
Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ia2791e357a7156adfa323c00f54b5ff356f0edf5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15726
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: Kamil Godzwon <kamilx.godzwon@intel.com>
2023-02-02 09:05:56 +00:00
Michal Berger
1d563b2d2a autobuild: Drop errexit
It's set from within autotest_common.sh.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I4bf743da1c12895de2c48a6262f66ff81228e32f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15725
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
2023-02-02 09:05:56 +00:00
Michal Berger
88f8a6ca22 autobuild: Move .conf check to autobuild_common
Also, keep it in global scope as $spdk_conf rather than passing it
as a positional argument to whatever routine that may depend on it.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I68532d5848e0bd7ee8519ef3e308b24ab6a38876
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15724
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
2023-02-02 09:05:56 +00:00
Michal Berger
2bd4ba6e70 autobuild: Split test suite into corresponding SPDK_TEST_AUTOBUILD opts
New option is introduced as well, 'ext', which tells autobuild to
run only external code tests - these deserve to have their own option
as they require proper env to be in place (access to hw, hugepages,
etc.)

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I2d74d1ee9b4b3d4dd83150b235eceff76fafd1ff
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15723
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-02-02 09:05:56 +00:00
Shuhei Matsumoto
3c5fdc0610 bdev/xnvme: Use bdev_unregister_by_name() to delete a xnvme bdev
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I4551dee96f3241f6004fc3b8ad0381082551db8e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16587
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-31 21:40:09 +00:00
Shuhei Matsumoto
916fb46915 bdev/daos: Use bdev_unregister_by_name() to delete a daos bdev
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I8e73d0d8e6cfa76f253f5cd49b3bf37d42d44b6f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16557
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-31 21:40:09 +00:00
Shuhei Matsumoto
2bb2afd085 external_bdev_passthru: Use bdev_unregister_by_name() to delete a passthru bdev
spdk_bdev_unregister_by_name() is safer than spdk_bdev_get_by_name() +
spdk_bdev_unregister(). It is ensured that the specified callback is
executed after unwinding stack for spdk_bdev_unregister_by_name().

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I5cc1e88a7e389ab173ef1195bd817d2aac6a70d1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16556
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-01-31 21:40:09 +00:00
Shuhei Matsumoto
a6b0b5b072 bdev: Use error_response() rather than bool_response(false) for JSON RPC
For JSON RPC, boolean response with false value may not be regarded as error.
Previously many cases were replaced to use
spdk_jsonrpc_send_error_response() explicitly. Replace one of the remaining
cases in this patch.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I1b4ffe015c2b2e28d411faf7763c2baca81f66f5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16623
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-31 21:40:09 +00:00
Shuhei Matsumoto
0bac3197b8 iscsi: Use error_response() rather than bool_response(false) for JSON RPC
For JSON RPC, boolean response with false value may not be regarded as error.
Previously many cases were replaced to use
spdk_jsonrpc_send_error_response() explicitly. Replace one of the remaining
cases in this patch.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ibfcb8c53662238b7ba8f08ecd1678953af8dc202
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16622
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-31 21:40:09 +00:00
Shuhei Matsumoto
841cd8b939 module/blobfs: Use error_response() rather than bool_response(false) for JSON RPCs
For JSON RPC, boolean response with false value may not be regarded as error.
Previously many cases were replaced to use
spdk_jsonrpc_send_error_response() explicitly. Replace one of the
remaining cases in this patch.

rpc_blobfs_detect() uses boolean response for not only true but also
false, but it had a memory leak bug. Fix it together in this patch.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Iaff21115282f638038345daa986b5c743ba9a3ed
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16621
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-31 21:40:09 +00:00
Shuhei Matsumoto
c77bc554d2 module/bdev: Use error_response() rather than bool_response(false) for JSON RPCs
For JSON RPC, boolean response with false value may not be regarded as error.
Previously many cases were replaced to use
spdk_jsonrpc_send_error_response() explicitly. However, this pattern did
not become established and new bdev modules used
spdk_jsonrpc_send_bool_response() with false.

Once again, replace remaining cases in this patch.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ie8858bc8ff7c36bc3a829977044a91d459db76f2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16555
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-31 21:40:09 +00:00
Shuhei Matsumoto
5feab0ddcf bdev/nvme: Remove spdk_bdev_first/next() calls from apply_firmware RPC
The NVMe bdev module has been refined since the bdev_nvme_apply_firmware
RPC was added. It is enough to open any one NVMe bdev even if one NVMe
controller has multiple namespaces. Hence, let's remove
spdk_bdev_first/next() calls from rpc_bdev_nvme_apply_firmware() rather
than replacing these by spdk_for_each_bdev(). Additionally, not only
spdk_bdev_close() but also spdk_put_io_channel() and
spdk_jsonrpc_send_*_response() should be done on the original thread.
Hence, redirect to the original thread always when a NVMe command is
returned, and rename firm_ctx->thread by firm_ctx->orig_thread for
clarification. orig_thread will be better than comment.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I90b1986584b3926980fd265e4fded194eb5a2d00
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16541
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-31 21:40:09 +00:00
Shuhei Matsumoto
ee1f124801 bdev: Use event_notify abstraction for media management notification
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ib775ab6bcbf3af61806f389e88944a4d827b6e82
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16578
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-01-31 15:28:37 +00:00
Shuhei Matsumoto
3522d43a95 bdev: Unify _resize_notify() and _remove_notify()
The next patch will improve media mgmt notifications but it will be
almost same as _resize_notify() and _remove_notify().

On the other hand, there are a few differences between _resize_notify()
and _remove_notify(). _remove_notify() will be better.

To avoid duplication, unify _resize_notify() and _remove_notify() by
adding abstraction event_notify() and _event_notify().

Add unit tests for the complex race conditions.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ibe2478479c61459c0da0db8d28c7273f05275e0f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16577
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-01-31 15:28:37 +00:00
GangCao
b5497ac213 lib/accel: correct the optional parameter of RPC commands
The relatd RPC commands are:
1. accel_crypto_keys_get (parameter is optional)
2. accel_crypto_key_destory (parameter is required)

Change-Id: I580c6e32bddf8242d0c26be988e2c151f47f2548
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16627
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-01-31 10:53:33 +00:00
Michal Berger
575a302d75 autotest: Attempt to cleanup SPDK processes prior running tests
There are some occasions where some phy nodes in the CI pool are
not properly cleaned up due to various reasons - hard crashes,
sudden network disconnects, etc. Whenever this happens, subsequent
job on the affected node usually fails due to overall instability
caused by lingering processes that should have been already killed.
Example of such failure is https://github.com/spdk/spdk/issues/2749.

This attempts to mitage potential impact of these issues under
per-patch testing.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I6e5c834ab77813e7484fa7f65c9d39967a305329
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16364
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-31 10:51:21 +00:00
Michal Berger
929ac2180b test/common: Add xtrace_disable_per_cmd()
This function is an alternative to xtrace_disable() which works
within a smaller scope, i.e., per cmd. Useful to quickly hide
verbose output without disabling entire tracing.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I284eafaf0e74764f329a7a6897a7d7fa85176de7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16363
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-31 10:51:21 +00:00
Michal Berger
15e31017dd autotest: Refactor reap_spdk_processes()
This is done in order to speed up entire lookup and be more robust
with matching target processes. This implementation also tries to
detect processes executed outside of the local repo workspace - this
is most relevant for the CI where lingering processes may come from
different jenkins workspaces (i.e. executed by different jobs).

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Id4f62302701f064ad00906497379e16ff8c04993
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16356
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-31 10:51:21 +00:00
Jacek Kalwas
37b5d87b19 env: expose function to get main core
Main core can be different than first core (default behavior) as it
can be specified by application argument. It can be useful to
determine if given thread is matching main core.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I25292a91ad677806eaf19ad68acdda0f28da6cfb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16596
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-01-31 10:31:04 +00:00
Shuhei Matsumoto
1974117a29 bdev/nvme: apply_firmware RPC embeds request structure into context
It is enough to embed an instance of rpc_apply_firmware structure into
firmware_update_info structure.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I41a480a0b8cd56f4b537512d5f83c5cbd5eee718
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16540
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-01-31 10:30:52 +00:00
Shuhei Matsumoto
f6f9cc59c6 bdev/nvme: apply_firmware() calls jsonrpc_send_error_response() directly
Previously, bdev_nvme_apply_firmware() used a temporary character array
to reduce the calls of spdk_jsonrpc_send_error_response().

Change these to call spdk_jsonrpc_send_error_response() directly.

This will simplify the next patch to replace spdk_bdev_first/next() by
spdk_for_each_bdev()ss.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I87ffc9416232dcaba30202ebbe0cb4b185a9563d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16539
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-01-31 10:30:52 +00:00
Shuhei Matsumoto
f5885db9ed bdev_fio_plugin: Replace spdk_bdev_first/next_leaf() by spdk_for_each_bdev_leaf()
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Icf7bd4348de200d33c242fa63f4facb9592abcaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16538
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-01-31 10:30:52 +00:00
Shuhei Matsumoto
5647948681 bdevperf: Replace spdk_bdev_first/next_leaf() by spdk_for_each_bdev_leaf()
Replace all spdk_bdev_first/next_leaf() calls by spdk_for_each_bdev_leaf().

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I61e8302346a70b0dc219fff29b06158b542dd87f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16537
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-01-31 10:30:52 +00:00
Shuhei Matsumoto
9ef9d4bd23 bdevperf: Factor out creating multithread job config into helper function
The next patch will replace spdk_bdev_first/next_leaf() calls by
spdk_for_each_bdev(). As a preparation, factor out creating multithread
job config for a bdev into a helper function.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ib4df53af8b1bba5b012e93ff9d00c4089cca774e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16536
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-01-31 10:30:52 +00:00