Commit Graph

13 Commits

Author SHA1 Message Date
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
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
Tomasz Zawadzki
3359bf34d6 so_ver: increase all major versions
To allow SO_MINOR updates on LTS for the whole year it is supported,
the major version for all components needs to be increased.
This is to prevent scenario where two versions exists with matching
versions, but conflicting ABI.
Ex. Next SPDK release adds an API call increasing the minor version,
then LTS needs just a subset of those additions.

Increasing major so version after LTS, allows the future releases
to update versions as needed. Yet allowing LTS to increase minor
version separately.

Disabled test for increasing SO version without ABI change, as
that is goal of this patch. This check shall be removed with SPDK 23.05
release.
Looks like this was left over from prior LTS, to avoid that
make sure it is only skipped when running against v23.01.x as latest
release.

This patch:
- increases SO_VER by 1 for all components
- resets SO_MINOR to 0 for all components
- removes suppressions for ABI tests


Short reference to how the versions were changed:
MAX=$(git grep "SO_VER := " | cut -d" " -f 3 | sort -ubnr | head -1)
for((i=$MAX;i>0;i-=1)); do find . -name "Makefile" -exec \
	sed -i -e "s/SO_VER := $i\$/SO_VER := $(($i+1))/g" {} +;  done
find . -name "Makefile" -exec \
	sed -i -e "s/SO_MINOR := .*/SO_MINOR := 0/g" {} +

Change-Id: I3e5681802c0a5ac6d7d652a18896997cd07cc8bf
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16419
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-24 08:37:21 +00:00
Krishna Kanth Reddy
d093a9fb85 bdev_xnvme: Remove duplicate invocation of bdev_xnvme_destruct
Fix for the issue 2803.
Reporting an error when deleting xnvme bdev.

bdev_xnvme_destruct gets invoked from the fn_table->destruct prior to
the xnvme_bdev_unregister_cb while deleting the xnvme bdev.

Hence removed the duplicate invocation of bdev_xnvme_destruct in
the function xnvme_bdev_unregister_cb.

Additionally, fixed the hang issue when the bdev_xnvme_delete
gets called multiple times for a xnvme bdev.

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: Ie36a84987ace20d324b7a139ca67fd60bf46e25b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16144
Reviewed-by: Ye Chen <yex.chen@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>
Community-CI: Mellanox Build Bot
2023-01-09 12:43:49 +00:00
Simon A. F. Lund
b99b00e595 bdev_xnvme: add option to conserve cpu and set default to false
To achieve the highest possible IO-rates and lowest latency, then CPU
cycles must be spent processing IO. This commit introduces three
different techniques dependendent on the 'io_mechanism' used.

For 'libaio', xNVMe is instructued via 'opts.poll_io' to not wait for
completions, thus xnvme_queue_poke() returns immmediatly, the user can
then call xnvme_queue_poke() as frequently as desired. This requires
xNVMe v0.5.0. Earlier versions will ignore 'opts.poll_io' for 'libaio'.

For 'io_uring', xNVMe is instructed via 'opts.poll_io' to enable
IORING_SETUP_IOPOLL.

For 'io_uring_cmd', xNVMe is instructued via 'opts.poll_sq' to enable
IORING_SETUP_SQPOLL, this sets up a kernel-side thread reaping
completions from user-space on the ring. Note that 'io_uring_cmd'
requires liburing >= 2.2.

This commit enables the above by default. The above can be disabled by
setting 'conserve_cpu' to true on the bdev-setup.

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: Id54f1e59733ce9ae3b174ad4562904d868d4ef4f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14678
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>
2022-12-21 09:33:27 +00:00
paul luse
a6dbe3721e update Intel copyright notices
per Intel policy to include file commit date using git cmd
below.  The policy does not apply to non-Intel (C) notices.

git log --follow -C90% --format=%ad --date default <file> | tail -1

and then pull just the 4 digit year from the result.

Intel copyrights were not added to files where Intel either had
no contribution ot the contribution lacked substance (ie license
header updates, formatting changes, etc).  Contribution date used
"--follow -C95%" to get the most accurate date.

Note that several files in this patch didn't end the license/(c)
block with a blank comment line so these were added as the vast
majority of files do have this last blank line.  Simply there for
consistency.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Id5b7ce4f658fe87132f14139ead58d6e285c04d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15192
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>
Community-CI: Mellanox Build Bot
2022-11-10 08:28:53 +00:00
Krishna Kanth Reddy
78ff96bb73 bdev_xnvme: free bdev_xnvme structure after device is fully unregistered
Fix for the issue 2702.
spdk_bdev plugin crashes while handling xnvme devices.

xnvme_queue_term gets invoked after the bdev_xnvme_free executes and
frees the xnvme structures. xnvme_queue_term references the xnvme->dev
structure, after it is freed, resulting in a segmentation fault.

Implemented a bdev_xnvme_destruct_cb, that frees the xnvme structures
after the xnvme_queue_term invokes and the device is fully unregistered.

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I9338c84baf4b61ec2e0d324e67bfefcb96485156
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14680
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-09-28 06:47:35 +00:00
Simon A. F. Lund
cfe5d18823 bdev/xnvme: enable polling on io_uring_cmd
Fixes #2708 for io_uring_cmd.

This is a minimal approach to enabling polling for bdev_xnvme. Ideally,
more would be done, however, there are several blockers to remove when
doing so. Thus, this commit only enables polling on
io_mechanism=io_uring_cmd.

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: Ifa604b52bb2b924fab4b559fae06f26a3574db42
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14679
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-27 15:36:32 +00:00
Tomasz Zawadzki
69bcb185f3 bdev/xnvme: save xnvme bdevs from runtime
config_json callback is used to preserve all
bdevs that were created during application runtime.

xnvme bdev module was missing this callback.

While here, io_mechanism is now saved in the bdev_xnvme
structure for reference in the config_json.
Haven't seen an option to pull this from xnvme itself.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1a88ad2bb761f589d214fec8f0690c38572824d6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14116
Reviewed-by: Michal Berger <michal.berger@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-19 13:12:07 +00:00
yidong0635
fc3a8514c7 xnvme: Remove unused rc.
Here no need to define a variable only return.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I6babb8ef94a9b111d5522f1e782cbd095c7da83a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14207
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: wanghailiang <hailiangx.e.wang@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2022-08-29 11:40:08 +00:00
yidong0635
43c5293e16 xnvme: Fix memory leak for xnvme dev.
If we use dd or bdevperf to run the xnvme bdev.
the destruct function of xnvme misses to free
dev while destructing bdev_xnvme.

xnvme_dev_close does free dev, and we can put it
in bdev_xnvme_free.

Meanwhile fixing cleanup for delete_xnvme_bdev.

This rpc for delete_xnvme_bdev doesn't really cleanup
to remove the bdev from the list and  free the names.

Fixes issue: #2654

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I1c493cb8130b012d891ba8ee90cd0bfb127207d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14177
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-08-29 11:40:08 +00:00
Krishna Kanth Reddy
17948bcaa9 bdev : xNVMe BDEV module performance fix
This change fixes the lower performance issue of the
xNVMe BDEV for libaio and io_uring backends. There is no
drop in the performance for the io_uring passthrough backend.

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I21de1b49a534cfc642d1873ef623271063da6af8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14015
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-08-15 19:11:14 +00:00
Krishna Kanth Reddy
6f338d4bf3 bdev : xNVMe BDEV module implementation
This implementation of xNVMe BDEV module supports the char-device / ioctl-over-uring,
along with the "regular" io_uring, libaio, POSIX aio, emulated aio (via threadpools) etc.

Code changes done :
a. Addition of xNVMe submodule to SPDK
b. Modification of RPC scripts to Create / Delete xNVMe BDEVs
c. Implementation of xNVMe BDEV module

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: If814ca1c784124df429d283015a6570068b44f87
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11161
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-07-15 12:52:13 +00:00