vhost-blk: fix interrupt names

Interrupts were all being registered with the name "fn". Directly pass in the
name instead to fix this.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I38e59d784298a61ca2130090ede500101389685c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9346
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Rui Chang <rui.chang@arm.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
John Levon 2021-08-31 15:25:54 +01:00 committed by Tomasz Zawadzki
parent 90a7a92456
commit fa20c0bb83

View File

@ -1037,7 +1037,7 @@ vhost_blk_session_unregister_interrupts(struct spdk_vhost_blk_session *bvsession
static int
vhost_blk_session_register_interrupts(struct spdk_vhost_blk_session *bvsession,
spdk_interrupt_fn fn)
spdk_interrupt_fn fn, const char *name)
{
struct spdk_vhost_session *vsession = &bvsession->vsession;
struct spdk_vhost_virtqueue *vq = NULL;
@ -1049,7 +1049,7 @@ vhost_blk_session_register_interrupts(struct spdk_vhost_blk_session *bvsession,
SPDK_DEBUGLOG(vhost_blk, "Register vq[%d]'s kickfd is %d\n",
i, vq->vring.kickfd);
vq->intr = SPDK_INTERRUPT_REGISTER(vq->vring.kickfd, fn, vq);
vq->intr = spdk_interrupt_register(vq->vring.kickfd, fn, vq, name);
if (vq->intr == NULL) {
SPDK_ERRLOG("Fail to register req notifier handler.\n");
goto err;
@ -1140,7 +1140,8 @@ vhost_session_bdev_remove_cb(struct spdk_vhost_dev *vdev,
spdk_poller_unregister(&bvsession->requestq_poller);
if (vsession->virtqueue[0].intr) {
vhost_blk_session_unregister_interrupts(bvsession);
rc = vhost_blk_session_register_interrupts(bvsession, no_bdev_vdev_vq_worker);
rc = vhost_blk_session_register_interrupts(bvsession, no_bdev_vdev_vq_worker,
"no_bdev_vdev_vq_worker");
if (rc) {
SPDK_ERRLOG("%s: Interrupt register failed\n", vsession->name);
return rc;
@ -1296,8 +1297,16 @@ vhost_blk_start_cb(struct spdk_vhost_dev *vdev,
}
if (spdk_interrupt_mode_is_enabled()) {
rc = vhost_blk_session_register_interrupts(bvsession,
bvdev->bdev ? vdev_vq_worker : no_bdev_vdev_vq_worker);
if (bvdev->bdev) {
rc = vhost_blk_session_register_interrupts(bvsession,
vdev_vq_worker,
"vdev_vq_worker");
} else {
rc = vhost_blk_session_register_interrupts(bvsession,
no_bdev_vdev_vq_worker,
"no_bdev_vdev_vq_worker");
}
if (rc) {
SPDK_ERRLOG("%s: Interrupt register failed\n", vsession->name);
goto out;