Commit 141fb10e authored by Richael Zhuang's avatar Richael Zhuang Committed by Tomasz Zawadzki
Browse files

bdev/nvme: directly call bdev_nvme_io_complete for FLUSH IO



Directly call bdev_nvme_io_complete() for FLUSH case.

This is a preparation for io_outstanding update in nvme_io_path. For
IO sent to a namespace, io_outstanding gets increment/decrement. For
IO sent to a controller, io_outstanding is not updated. For FLUSH
case, it's not sent to a namespace nor a controller. Directly call
bdev_nvme_io_complete() here to make it easier to understand why
io_outstanding not gets updated for FLUSH.

Change-Id: Idcf4b37a0816a327256fe87004705fb65df1b06c
Signed-off-by: default avatarRichael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15517


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
parent 85478ecc
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -1384,14 +1384,6 @@ bdev_nvme_destruct(void *ctx)
	return 0;
}

static int
bdev_nvme_flush(struct nvme_bdev_io *bio, uint64_t offset, uint64_t nbytes)
{
	bdev_nvme_io_complete(bio, 0);

	return 0;
}

static int
bdev_nvme_create_qpair(struct nvme_qpair *nvme_qpair)
{
@@ -2160,9 +2152,7 @@ bdev_nvme_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_i
		bdev_nvme_reset_io(nbdev_ch, nbdev_io);
		break;
	case SPDK_BDEV_IO_TYPE_FLUSH:
		rc = bdev_nvme_flush(nbdev_io,
				     bdev_io->u.bdev.offset_blocks,
				     bdev_io->u.bdev.num_blocks);
		bdev_nvme_io_complete(nbdev_io, 0);
		break;
	case SPDK_BDEV_IO_TYPE_ZONE_APPEND:
		rc = bdev_nvme_zone_appendv(nbdev_io,