Commit 13017493 authored by Dariusz Stojaczyk's avatar Dariusz Stojaczyk Committed by Jim Harris
Browse files

bdev: added spdk_bdev_io_get_thread()



This is required for virtio-initiator,
where multiple io_channels have to
share the same virtio queue. A single
poller will receive responses from
a virtio queue and send the completions
to the thread that submitted bdev_io.

Change-Id: I951c7655aaa17d41a680d437661afff27d2c3077
Signed-off-by: default avatarDariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382200


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
parent 0fbde3af
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -416,6 +416,13 @@ void spdk_bdev_io_complete_nvme_status(struct spdk_bdev_io *bdev_io, int sct, in
void spdk_bdev_io_complete_scsi_status(struct spdk_bdev_io *bdev_io, enum spdk_scsi_status sc,
				       enum spdk_scsi_sense sk, uint8_t asc, uint8_t ascq);

/**
 * Get a thread that given bdev_io was submitted on.
 *
 * \param bdev_io I/O
 * \return thread that submitted the I/O
 */
struct spdk_thread *spdk_bdev_io_get_thread(struct spdk_bdev_io *bdev_io);

void spdk_scsi_nvme_translate(const struct spdk_bdev_io *bdev_io,
			      int *sc, int *sk, int *asc, int *ascq);
+6 −0
Original line number Diff line number Diff line
@@ -1628,6 +1628,12 @@ spdk_bdev_io_get_nvme_status(const struct spdk_bdev_io *bdev_io, int *sct, int *
	}
}

struct spdk_thread *
spdk_bdev_io_get_thread(struct spdk_bdev_io *bdev_io)
{
	return spdk_io_channel_get_thread(bdev_io->ch->channel);
}

static void
_spdk_bdev_register(struct spdk_bdev *bdev)
{