From: Stefan Hajnoczi <stefanha@gmail.com>
To: Hannes Reinecke <hare@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
ronnie sahlberg <ronniesahlberg@gmail.com>,
Felipe Franciosi <felipe@nutanix.com>, Peter Lieven <pl@kamp.de>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] libiscsi task cancellation
Date: Thu, 8 Feb 2018 15:12:15 +0000 [thread overview]
Message-ID: <CAJSP0QW6FsR9O17wjwJku-4c8n=4mddapvOoTYKk5kG9NRqtmg@mail.gmail.com> (raw)
In-Reply-To: <6073fac9-f16c-27a5-b62e-3cfa893fa2ff@suse.de>
On Thu, Feb 8, 2018 at 2:58 PM, Hannes Reinecke <hare@suse.de> wrote:
> On 02/08/2018 03:14 PM, Paolo Bonzini wrote:
>> On 08/02/2018 15:08, Stefan Hajnoczi wrote:
>>> Now on to libiscsi:
>>>
>>> The iscsi_task_mgmt_async() API documentation says:
>>>
>>> * abort_task will also cancel the scsi task. The callback for the
>>> scsi task will be invoked with
>>> * SCSI_STATUS_CANCELLED
>>>
>>> I see that the ABORT TASK TMF response invokes the user's
>>> iscsi_task_mgmt_async() callback but not the command callback. I'm
>>> not sure how the command callback is invoked with
>>> SCSI_STATUS_CANCELLED unless libiscsi is relying on the target to send
>>> that response.
>>>
>>> Is libiscsi honoring its iscsi_task_mgmt_async() contract?
>>
>> No, and QEMU is assuming the "wrong" behavior:
>>
>> static void
>> iscsi_abort_task_cb(struct iscsi_context *iscsi, int status, void *command_data,
>> void *private_data)
>> {
>> IscsiAIOCB *acb = private_data;
>>
>> acb->status = -ECANCELED;
>> iscsi_schedule_bh(acb);
>> }
>>
> The definition of ABORT TASK TMF in SAM is pretty much useless.
> To quote:
>
> A response of FUNCTION COMPLETE shall indicate that the task was aborted
> or was not in the task set.
>
> IE we have no idea if we ever managed to abort the task; if the task had
> been in-flight by the time we've send the TMF we'll be getting a
> FUNCTION COMPLETE, too.
>
> So most FC HBA firmware implement the abort task with just a blacklist;
> the TMF will be returned immediately and the command response will be
> dropped if and when is arrives.
Great, thanks for confirming.
Stefan
next prev parent reply other threads:[~2018-02-08 15:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-08 14:08 [Qemu-devel] libiscsi task cancellation Stefan Hajnoczi
2018-02-08 14:14 ` Paolo Bonzini
2018-02-08 14:58 ` Hannes Reinecke
2018-02-08 15:12 ` Stefan Hajnoczi [this message]
2018-02-08 15:33 ` Felipe Franciosi
2018-02-08 15:08 ` Stefan Hajnoczi
2018-02-08 15:13 ` Stefan Hajnoczi
2018-02-14 16:12 ` Felipe Franciosi
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='CAJSP0QW6FsR9O17wjwJku-4c8n=4mddapvOoTYKk5kG9NRqtmg@mail.gmail.com' \
--to=stefanha@gmail.com \
--cc=felipe@nutanix.com \
--cc=hare@suse.de \
--cc=pbonzini@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-devel@nongnu.org \
--cc=ronniesahlberg@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).