Commit 6fdc0a53 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

bdev/ocssd: Call read() directly when buffer is already allocated



Call bdev_ocssd_read() directly when buffer is already allocated
to improve performance and support retry in the bdev module as done
for the standard NVMe bdev.

Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Icf18148e09b61df7effc84535bea60f49d1c15b3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5559


Community-CI: Broadcom CI
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
parent c885010f
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -810,9 +810,20 @@ _bdev_ocssd_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev

	switch (bdev_io->type) {
	case SPDK_BDEV_IO_TYPE_READ:
		if (bdev_io->u.bdev.iovs && bdev_io->u.bdev.iovs[0].iov_base) {
			return bdev_ocssd_read(ocssd_bdev,
					       nvme_ch,
					       ocdev_io,
					       bdev_io->u.bdev.iovs,
					       bdev_io->u.bdev.iovcnt,
					       bdev_io->u.bdev.md_buf,
					       bdev_io->u.bdev.num_blocks,
					       bdev_io->u.bdev.offset_blocks);
		} else {
			spdk_bdev_io_get_buf(bdev_io, bdev_ocssd_io_get_buf_cb,
					     bdev_io->u.bdev.num_blocks * bdev_io->bdev->blocklen);
			return 0;
		}

	case SPDK_BDEV_IO_TYPE_WRITE:
		return bdev_ocssd_write(ocssd_bdev,