Commit 09fe539b authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

bdev: track IOs with accel sequence with an extra flag



We already have u.bdev.accel_sequence and internal.accel_sequence, but
both of them can be cleared in different cases.  The former is cleared
when a bdev doesn't support accel or by the module itself to notify bdev
layer that it executed the sequence.  The latter is cleared before
submitting a request to a module supporting accel, so that bdev layer
won't touch it again.

However, there are cases where it's necessary to know whether an IO was
associated with an accel sequence and a module has executed it (e.g. to
allow modules support accel without supporting memory domains), so an
extra flag is required.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I58ec789cce84b63151d02e28a0bb3d3bbf85f7bf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/18771


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
parent d1714d9c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -962,6 +962,9 @@ struct spdk_bdev_io {
		/** Retry state (resubmit, re-pull, re-push, etc.) */
		uint8_t retry_state;

		/** Indicates that the IO is associated with an accel sequence */
		bool has_accel_sequence;

		/** bdev allocated memory associated with this request */
		void *buf;

+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

SO_VER := 12
SO_VER := 13
SO_MINOR := 0

ifeq ($(CONFIG_VTUNE),y)
+5 −2
Original line number Diff line number Diff line
@@ -899,7 +899,7 @@ bdev_io_use_memory_domain(struct spdk_bdev_io *bdev_io)
static inline bool
bdev_io_use_accel_sequence(struct spdk_bdev_io *bdev_io)
{
	return bdev_io->internal.accel_sequence;
	return bdev_io->internal.has_accel_sequence;
}

static inline void
@@ -990,7 +990,7 @@ _are_iovs_aligned(struct iovec *iovs, int iovcnt, uint32_t alignment)
static inline bool
bdev_io_needs_sequence_exec(struct spdk_bdev_desc *desc, struct spdk_bdev_io *bdev_io)
{
	if (!bdev_io_use_accel_sequence(bdev_io)) {
	if (!bdev_io->internal.accel_sequence) {
		return false;
	}

@@ -3548,6 +3548,7 @@ bdev_io_init(struct spdk_bdev_io *bdev_io,
	bdev_io->internal.data_transfer_cpl = NULL;
	bdev_io->internal.split = bdev_io_should_split(bdev_io);
	bdev_io->internal.accel_sequence = NULL;
	bdev_io->internal.has_accel_sequence = false;
}

static bool
@@ -5229,6 +5230,7 @@ bdev_readv_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channel *c
	bdev_io->internal.memory_domain = domain;
	bdev_io->internal.memory_domain_ctx = domain_ctx;
	bdev_io->internal.accel_sequence = seq;
	bdev_io->internal.has_accel_sequence = seq != NULL;
	bdev_io->u.bdev.memory_domain = domain;
	bdev_io->u.bdev.memory_domain_ctx = domain_ctx;
	bdev_io->u.bdev.accel_sequence = seq;
@@ -5436,6 +5438,7 @@ bdev_writev_blocks_with_md(struct spdk_bdev_desc *desc, struct spdk_io_channel *
	bdev_io->internal.memory_domain = domain;
	bdev_io->internal.memory_domain_ctx = domain_ctx;
	bdev_io->internal.accel_sequence = seq;
	bdev_io->internal.has_accel_sequence = seq != NULL;
	bdev_io->u.bdev.memory_domain = domain;
	bdev_io->u.bdev.memory_domain_ctx = domain_ctx;
	bdev_io->u.bdev.accel_sequence = seq;
+11 −0
Original line number Diff line number Diff line
@@ -104,6 +104,17 @@ function confirm_abi_deps() {
# To be removed, comes from nvme_internal.h
[suppress_type]
	name = spdk_nvme_qpair
# The 4 types below are related to changes in __bdev_io_internal_fields
[suppress_type]
	name = spdk_ftl_dev
[suppress_type]
	name = ftl_io
[suppress_type]
        name = __bdev_io_internal_fields
        soname_regexp = libspdk_ftl\\.so\\.*
[suppress_type]
        name = spdk_bdev_io
        soname_regexp = libspdk_ftl\\.so\\.*
EOF

	for object in "$libdir"/libspdk_*.so; do