From: Hannes Reinecke <hare@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>,
Stefan Hajnoczi <stefanha@gmail.com>,
ronnie sahlberg <ronniesahlberg@gmail.com>
Cc: 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:58:21 +0100 [thread overview]
Message-ID: <6073fac9-f16c-27a5-b62e-3cfa893fa2ff@suse.de> (raw)
In-Reply-To: <a7d46cd7-aba7-ebae-e1a0-4d321586705f@redhat.com>
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.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
next prev parent reply other threads:[~2018-02-08 14:58 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 [this message]
2018-02-08 15:12 ` Stefan Hajnoczi
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=6073fac9-f16c-27a5-b62e-3cfa893fa2ff@suse.de \
--to=hare@suse.de \
--cc=felipe@nutanix.com \
--cc=pbonzini@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-devel@nongnu.org \
--cc=ronniesahlberg@gmail.com \
--cc=stefanha@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).