Re: [PATCH 06/18] scsi: Make scsi_ioctl_reset() pass the request queue pointer to blk_rq_init()

Hannes Reinecke
2017-05-22T08:46:13Z

On 05/22/2017 09:54 AM, hch@lst.de wrote:
> On Mon, May 22, 2017 at 08:06:46AM +0200, Hannes Reinecke wrote:
>> Problem is that quite some LLDDs require a hardware tag for sending
>> TMFs, and currently the re-use the tag from the passed in scmd for that.
>> So first we need to move those to a sane interface, and having them
>> requesting a new tag for TMFs.
>
> Some do indeed. But these seems to be the exception and not the rule.
>
Still need to be handled, though ...

>> Should be made easier with Christophs rework, but we still don't have
>> any defined way how TMFs should request their tag; should they use
>> private tags? Should they use 'normal' tags? Should the driver implement
>> their own tag pool, seeing that these commands will never ever making
>> use of the associated request?
>
> I think the right way to go is that every driver that needs tags for
> TMFs should use private tags internally without the core knowing
> about it.
>
That was my idea, too.

>> Hence I'm looking into implementing a REQ_RESET block request operation,
>> which then could be used to facilitate all of this (the request would be
>> allocated from the private tag pool if present).
>
> That seems to be overkill to me for the few drivers. And I suspect
> most of them would be better off now even using blk-mq private tags
> (which we'd have to implement for the legacy path first or just
> kill it off) but just not expose a tag per host to the scsi and block
> layers and set that aside.
>
IE not using blk-mq private tags for EH? Hmm.
But then we'd need a SCSI-internal mechanism to get one of them. I
really would want to avoid having each driver to implement it's own
mechanism on how to get a TMF tag; that sort of thing only leads to
copy-and-paste errors.
Ok; will be looking into it.

>> It would also neatly solve the scsi_ioctl_reset() problem, as we then
>> could just issue a REQ_RESET and would avoid having to call into the
>> eh_* function directly.
>
> I don't think calling the eh_* methods is a problem per see. It's just
> their stupid calling conventions..
>
I know. I've been working on a patchset to move at least eh_host_reset()
to take the scsi_host as argument. But even that requires some
preliminary patches to some LLDDs :-(

Right. Dusting off those patches, then.

Cheers,

Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.com +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)