From 57e6a387c21eb5db2154a0341a431a3e73480ed7 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Thu, 21 Apr 2022 14:55:41 +0200 Subject: [PATCH] lib/vhost: remove vhost_user fields from I/O processing logs Later in the series, the spdk_vhost_blk_task will not contain vhost_user specific fields. As such the generic part of processing I/O will not be able to refer to those. References to req_idx are replaced with pointer to the task, meanwhile bvsession reference when queueing I/O is removed. Note that vhost_user fields are accessible in the final callback for the I/O, and will be printed. See blk_request_finish(). Signed-off-by: Tomasz Zawadzki Change-Id: I100d60968146da778bd6bf4fbcf2a2694d3be6e6 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12335 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Ben Walker Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- lib/vhost/vhost_blk.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/vhost/vhost_blk.c b/lib/vhost/vhost_blk.c index f25afaf8a..a0bb457c0 100644 --- a/lib/vhost/vhost_blk.c +++ b/lib/vhost/vhost_blk.c @@ -462,7 +462,6 @@ blk_request_queue_io(struct spdk_vhost_dev *vdev, struct spdk_io_channel *ch, struct spdk_vhost_blk_task *task) { int rc; - struct spdk_vhost_blk_session *bvsession = task->bvsession; struct spdk_bdev *bdev = task->bdev_io->bdev; task->bdev_io_wait.bdev = bdev; @@ -473,7 +472,6 @@ blk_request_queue_io(struct spdk_vhost_dev *vdev, struct spdk_io_channel *ch, rc = spdk_bdev_queue_io_wait(bdev, ch, &task->bdev_io_wait); if (rc != 0) { - SPDK_ERRLOG("%s: failed to queue I/O, rc=%d\n", bvsession->vsession.name, rc); blk_request_finish(VIRTIO_BLK_S_IOERR, task); } } @@ -495,8 +493,8 @@ process_blk_request(struct spdk_vhost_dev *vdev, struct spdk_io_channel *ch, iov = &task->iovs[0]; if (spdk_unlikely(iov->iov_len != sizeof(req))) { SPDK_DEBUGLOG(vhost_blk, - "First descriptor size is %zu but expected %zu (req_idx = %"PRIu16").\n", - iov->iov_len, sizeof(req), task->req_idx); + "First descriptor size is %zu but expected %zu (task = %p).\n", + iov->iov_len, sizeof(req), task); blk_request_finish(VIRTIO_BLK_S_UNSUPP, task); return -1; } @@ -510,8 +508,8 @@ process_blk_request(struct spdk_vhost_dev *vdev, struct spdk_io_channel *ch, iov = &task->iovs[task->iovcnt - 1]; if (spdk_unlikely(iov->iov_len != 1)) { SPDK_DEBUGLOG(vhost_blk, - "Last descriptor size is %zu but expected %d (req_idx = %"PRIu16").\n", - iov->iov_len, 1, task->req_idx); + "Last descriptor size is %zu but expected %d (task = %p).\n", + iov->iov_len, 1, task); blk_request_finish(VIRTIO_BLK_S_UNSUPP, task); return -1; } @@ -531,8 +529,8 @@ process_blk_request(struct spdk_vhost_dev *vdev, struct spdk_io_channel *ch, case VIRTIO_BLK_T_IN: case VIRTIO_BLK_T_OUT: if (spdk_unlikely(payload_len == 0 || (payload_len & (512 - 1)) != 0)) { - SPDK_ERRLOG("%s - passed IO buffer is not multiple of 512b (req_idx = %"PRIu16").\n", - type ? "WRITE" : "READ", task->req_idx); + SPDK_ERRLOG("%s - passed IO buffer is not multiple of 512b (task = %p).\n", + type ? "WRITE" : "READ", task); blk_request_finish(VIRTIO_BLK_S_UNSUPP, task); return -1; }