All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikos Dragazis <ndragazis@outlook.com.gr>
To: "spdk@lists.01.org" <spdk@lists.01.org>
Cc: Vangelis Koukis <vkoukis@arrikto.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [SPDK] virtio-vhost-user with virtio-scsi: end-to-end setup
Date: Sat, 6 Oct 2018 18:55:25 +0000	[thread overview]
Message-ID: <AM6PR07MB3864836F2F1AD09963BAA05998E40@AM6PR07MB3864.eurprd07.prod.outlook.com> (raw)
In-Reply-To: <F6F2A6264E145F47A18AB6DF8E87425D7034C019@IRSMSX102.ger.corp.intel.com>

Hi Pawel,

Thank you for your quick reply. I appreciate your help.

I’m sorry for the late response. I am glad to tell you that I have a
working demo at last. I have managed to solve my problem.

You were right about the IO channels. Function
spdk_scsi_dev_allocate_io_channels() fails to allocate the IO channel
for the virtio-scsi bdev target and function spdk_vhost_scsi_start()
fails to verify its return value. My actual segfault was due to a race
on the unique virtio-scsi bdev request queue between the creation and
the destruction of the IO channel in the vhost device backend. This led
to the IO channel pointer lun->io_channel being NULL after the
vhost-user negotiation, and the bdev layer segfaulted when accessing it
in response to an IO request.

After discovering this, and spending quite some time debugging it, I
searched the bug tracker and the commit history in case I had missed
something. It seems this was a recently discovered bug, which has
fortunately already been solved:

https://github.com/spdk/spdk/commit/9ddf6438310cc97b346d805a5969af7507e84fde#diff-d361b53e911663e8c6c5890fb046a79b

I had overlooked pulling from the official repo for a while, so I missed
the patch. It works just fine after pulling the newest changes.

So, I’ll make sure to work on the latest commits next time :)

Thanks again,
Nikos


On 21/09/2018 10:31 πμ, Wodkowski, PawelX wrote:
> Hi Nikos,
>
> About SPKD backtrace you got. There is something wrong with IO channel allocation.
> SPKD vhost-scsi  should check the result of spdk_scsi_dev_allocate_io_channels() in
> spdk_vhost_scsi_dev_add_tgt(). But this result is not checked :(
> You can add some check or assert there.
>
> Paweł


WARNING: multiple messages have this Message-ID (diff)
From: Nikos Dragazis <ndragazis at outlook.com.gr>
To: spdk@lists.01.org
Subject: Re: [SPDK] virtio-vhost-user with virtio-scsi: end-to-end setup
Date: Sat, 06 Oct 2018 18:55:25 +0000	[thread overview]
Message-ID: <AM6PR07MB3864836F2F1AD09963BAA05998E40@AM6PR07MB3864.eurprd07.prod.outlook.com> (raw)
In-Reply-To: F6F2A6264E145F47A18AB6DF8E87425D7034C019@IRSMSX102.ger.corp.intel.com

[-- Attachment #1: Type: text/plain, Size: 1742 bytes --]

Hi Pawel,

Thank you for your quick reply. I appreciate your help.

I’m sorry for the late response. I am glad to tell you that I have a
working demo at last. I have managed to solve my problem.

You were right about the IO channels. Function
spdk_scsi_dev_allocate_io_channels() fails to allocate the IO channel
for the virtio-scsi bdev target and function spdk_vhost_scsi_start()
fails to verify its return value. My actual segfault was due to a race
on the unique virtio-scsi bdev request queue between the creation and
the destruction of the IO channel in the vhost device backend. This led
to the IO channel pointer lun->io_channel being NULL after the
vhost-user negotiation, and the bdev layer segfaulted when accessing it
in response to an IO request.

After discovering this, and spending quite some time debugging it, I
searched the bug tracker and the commit history in case I had missed
something. It seems this was a recently discovered bug, which has
fortunately already been solved:

https://github.com/spdk/spdk/commit/9ddf6438310cc97b346d805a5969af7507e84fde#diff-d361b53e911663e8c6c5890fb046a79b

I had overlooked pulling from the official repo for a while, so I missed
the patch. It works just fine after pulling the newest changes.

So, I’ll make sure to work on the latest commits next time :)

Thanks again,
Nikos


On 21/09/2018 10:31 πμ, Wodkowski, PawelX wrote:
> Hi Nikos,
>
> About SPKD backtrace you got. There is something wrong with IO channel allocation.
> SPKD vhost-scsi  should check the result of spdk_scsi_dev_allocate_io_channels() in
> spdk_vhost_scsi_dev_add_tgt(). But this result is not checked :(
> You can add some check or assert there.
>
> Paweł


  reply	other threads:[~2018-10-06 18:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 22:06 [SPDK] virtio-vhost-user with virtio-scsi: end-to-end setup Nikos Dragazis
2018-09-21  7:31 ` Wodkowski, PawelX
2018-10-06 18:55   ` Nikos Dragazis [this message]
2018-10-06 18:55     ` Nikos Dragazis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM6PR07MB3864836F2F1AD09963BAA05998E40@AM6PR07MB3864.eurprd07.prod.outlook.com \
    --to=ndragazis@outlook.com.gr \
    --cc=qemu-devel@nongnu.org \
    --cc=spdk@lists.01.org \
    --cc=stefanha@redhat.com \
    --cc=vkoukis@arrikto.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.