linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: John Garry <john.garry@huawei.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	Bart van Assche <bvanassche@acm.org>,
	Don Brace <don.brace@microchip.com>,
	linux-scsi@vger.kernel.org, chenxiang <chenxiang66@hisilicon.com>
Subject: Re: [PATCH 03/21] scsi: add scsi_{get,put}_internal_cmd() helper
Date: Mon, 7 Dec 2020 16:52:07 +0100	[thread overview]
Message-ID: <0633db5c-0616-e42d-2eda-db43d739294a@suse.de> (raw)
In-Reply-To: <2debadf2-a120-e73f-7fd6-14a3eb89e320@huawei.com>

On 12/7/20 11:15 AM, John Garry wrote:
> On 16/11/2020 09:03, Hannes Reinecke wrote:
>> On 11/16/20 9:56 AM, John Garry wrote:
>>> On 03/07/2020 14:01, Hannes Reinecke wrote:
>>>> Add helper functions to allow LLDDs to allocate and free
>>>> internal commands.
>>>
>>> Hi Hannes,
>>>
>>> Is there any way to ensure that the request allocated is associated 
>>> with some determined HW queue here?
>>>
>>> The reason for this requirement is that sometimes the LLDD must 
>>> submit some internal IO (for which we allocate an "internal command") 
>>> on a specific HW queue. An example of this is internal abort IO 
>>> commands, which should be submitted on the same queue as the IO which 
>>> we are attempting to abort was submitted.
>>>
>>> So, for sure, the LLDD does not have to honor the hwq associated with 
>>> the request and submit on the desired queue, but then we lose the 
>>> blk-mq CPU hotplug protection. And maybe other problems.
>>>
>>> One way to achieve this is to run scsi_get_internal_cmd() on a CPU 
>>> associated with the desired HW queue, but that's a bit hacky. Not 
>>> sure of another way.
>>>
>> Hmm. You are correct for the 'abort' command; that typically needs to 
>> be submitted to a specific hwq.
>>
>> Let me think about it...
>>
> 
> 
> Hannes,
> 
> Earlier you mentioned " some drivers not only the command needs a tag, 
> but the sgls also, thereby completely messing up our mq tags logic.
> So to map those we'd need to allocate _several_ tags for one command ..."
> 
> Which drivers are these? Can you provide a pointer? Is this the blocker?
> 
Not actually a blocker, more something which I had been thinking about.
Point is, that the current blk-mq design assumes that each command 
requires a tag, and each tag maps to a single entity placed on the 
hardware submission queue.
While this is okay for some drivers, it's not a straightforward match 
for other drivers:
- FC uses 'Exchange IDs' to map commands; however, the lifetime for 
these XIDs is slightly different from the command lifetime.
In case of an error the XID must not be re-used (on the same queue) 
until error recovery has taken place. Which means we cannot use the 
block-layer tags for XIDs but have to implement an internal facility for 
that (cf drivers/scsi/libfc/fc_exch.c to get some idea about that).
- Some drivers like smartpqi or mpt3sas require the command _and the 
sgls_ to be placed on the submission queue, and every entity requires an 
unique tag. So again, we cannot leverage the block-layer tags to control 
the submission queue but have to implement a driver-specific thing.

But I'll be rebasing my patches.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

  reply	other threads:[~2020-12-07 15:52 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 13:01 [PATCHv6 00/21] scsi: enable reserved commands for LLDDs Hannes Reinecke
2020-07-03 13:01 ` [PATCH 01/21] scsi: drop gdth driver Hannes Reinecke
2020-07-03 13:01 ` [PATCH 02/21] block: add flag for internal commands Hannes Reinecke
2020-07-08  9:27   ` John Garry
2020-07-09 20:02     ` Jens Axboe
2020-07-17 10:32       ` John Garry
2020-07-03 13:01 ` [PATCH 03/21] scsi: add scsi_{get,put}_internal_cmd() helper Hannes Reinecke
2020-07-07 13:54   ` John Garry
2020-11-16  8:56   ` John Garry
2020-11-16  9:03     ` Hannes Reinecke
2020-11-18 12:28       ` John Garry
2020-12-07 10:15       ` John Garry
2020-12-07 15:52         ` Hannes Reinecke [this message]
2020-07-03 13:01 ` [PATCH 04/21] fnic: use internal commands Hannes Reinecke
2020-07-03 13:01 ` [PATCH 05/21] fnic: use scsi_host_busy_iter() to traverse commands Hannes Reinecke
2020-07-03 13:01 ` [PATCH 06/21] fnic: check for started requests in fnic_wq_copy_cleanup_handler() Hannes Reinecke
2020-07-03 13:01 ` [PATCH 07/21] scsi: use real inquiry data when initialising devices Hannes Reinecke
2020-07-03 13:01 ` [PATCH 08/21] scsi: Use dummy inquiry data for the host device Hannes Reinecke
2020-07-03 13:01 ` [PATCH 09/21] scsi: revamp host device handling Hannes Reinecke
2020-07-03 13:01 ` [PATCH 10/21] snic: use reserved commands Hannes Reinecke
2020-07-08 11:08   ` John Garry
2020-07-08 11:18     ` Hannes Reinecke
2020-07-03 13:01 ` [PATCH 11/21] snic: use tagset iter for traversing commands Hannes Reinecke
2020-07-03 13:01 ` [PATCH 12/21] snic: check for started requests in snic_hba_reset_cmpl_handler() Hannes Reinecke
2020-07-03 13:01 ` [PATCH 13/21] scsi: implement reserved command handling Hannes Reinecke
2020-07-08  9:39   ` John Garry
2020-07-03 13:01 ` [PATCH 14/21] hpsa: move hpsa_hba_inquiry after scsi_add_host() Hannes Reinecke
2020-07-03 13:01 ` [PATCH 15/21] hpsa: use reserved commands Hannes Reinecke
2020-07-03 13:01 ` [PATCH 16/21] hpsa: use scsi_host_busy_iter() to traverse outstanding commands Hannes Reinecke
2020-07-03 13:01 ` [PATCH 17/21] hpsa: drop refcount field from CommandList Hannes Reinecke
2020-07-03 13:01 ` [PATCH 18/21] aacraid: move scsi_add_host() Hannes Reinecke
2020-07-03 13:01 ` [PATCH 19/21] aacraid: store target id in host_scribble Hannes Reinecke
2020-07-03 13:01 ` [PATCH 20/21] aacraid: use scsi_get_internal_cmd() Hannes Reinecke
2020-07-03 13:01 ` [PATCH 21/21] aacraid: use scsi_host_busy_iter() to traverse outstanding commands Hannes Reinecke
2020-10-27 15:27 ` [PATCHv6 00/21] scsi: enable reserved commands for LLDDs John Garry
2020-10-27 15:53   ` Hannes Reinecke
2020-10-27 16:59     ` John Garry
2020-10-27 17:07       ` Hannes Reinecke

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=0633db5c-0616-e42d-2eda-db43d739294a@suse.de \
    --to=hare@suse.de \
    --cc=bvanassche@acm.org \
    --cc=chenxiang66@hisilicon.com \
    --cc=don.brace@microchip.com \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=john.garry@huawei.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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).