bdev/rbd: Always save the submit_td while submitting the request

The purpose is that we will remove the group reaping of
rbd_io later, so we need to know the original thread info of the
rbd_io.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I69f60261447fdac0b0885fdb213e92c246439047
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9585
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Ziye Yang 2021-09-23 18:15:37 +08:00 committed by Tomasz Zawadzki
parent 7fed70f1bd
commit 70e2e5d94b

View File

@ -396,9 +396,11 @@ static void
bdev_rbd_io_complete(struct spdk_bdev_io *bdev_io, enum spdk_bdev_io_status status)
{
struct bdev_rbd_io *rbd_io = (struct bdev_rbd_io *)bdev_io->driver_ctx;
struct spdk_thread *current_thread = spdk_get_thread();
rbd_io->status = status;
if (rbd_io->submit_td != NULL) {
assert(rbd_io->submit_td != NULL);
if (rbd_io->submit_td != current_thread) {
spdk_thread_send_msg(rbd_io->submit_td, _bdev_rbd_io_complete, rbd_io);
} else {
_bdev_rbd_io_complete(rbd_io);
@ -617,11 +619,10 @@ bdev_rbd_submit_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io
struct bdev_rbd_io *rbd_io = (struct bdev_rbd_io *)bdev_io->driver_ctx;
struct bdev_rbd *disk = (struct bdev_rbd *)bdev_io->bdev->ctxt;
rbd_io->submit_td = submit_td;
if (disk->main_td != submit_td) {
rbd_io->submit_td = submit_td;
spdk_thread_send_msg(disk->main_td, _bdev_rbd_submit_request, bdev_io);
} else {
rbd_io->submit_td = NULL;
_bdev_rbd_submit_request(bdev_io);
}
}