Re: [PATCHv7 00/31] scsi: enable reserved commands for LLDDs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/03/2021 16:08, Hannes Reinecke wrote:
On 3/12/21 12:53 AM, michael.christie@xxxxxxxxxx wrote:
On 2/22/21 7:23 AM, Hannes Reinecke wrote:
Hi all,

quite some drivers use internal commands for various purposes, most
commonly sending TMFs or querying the HBA status.
While these commands use the same submission mechanism than normal
I/O commands, they will not be counted as outstanding commands,
requiring those drivers to implement their own mechanism to figure
out outstanding commands.
The block layer already has the concept of 'reserved' tags for
precisely this purpose, namely non-I/O tags which live off a separate
tag pool. That guarantees that these commands can always be sent,
and won't be influenced by tag starvation from the I/O tag pool.
This patchset enables the use of reserved tags for the SCSI midlayer
by allocating a virtual LUN for the HBA itself which just serves
as a resource to allocate valid tags from.
This removes quite some hacks which were required for some
drivers (eg. fnic or snic), and allows the use of tagset
iterators within the drivers.


Hey Hannes,

I was trying to port some iscsi patches to this set. One question I had
is how to handle if my driver implements init_cmd_priv, and wants to use
the reserved cmds for a non scsi IO. My case I want to use them for cmds
like a iscsi nop/ping, device/target reset or login request.

There is no bit to way to tell if at init_cmd_priv time the cmd will be
for a reserved or non reserved cmd right? If not, I was wondering should
I do:

If I'm not mistaken, init_cmd_priv has no in-tree user today. Any plans to add one ... to see what it's about?

Thanks,
John


1. in libiscsi, allocate an array of size $reserved_cmds with non_scsi_cmds
structs. When I need to do a non scsi cmd do blk_mq_get_tag on the host's
tags to get a reserved tag then use that to lookup a struct in my array?

2. in libiscsi when I need to do a non scsi cmd do a scsi_get_internal_cmd.
At this time allocate the non_scsi_cmd struct parts.

You sure you will need to allocate additional stuff?
The request already comes with the request, scsi, and driver private
bits (ie the additional space from .cmd_size) allocated.

And yes, you can tell in init_cmd_priv() if the command is coming from
the private pool; I had a helper 'req_is_reserved' once, I thought it's
still there ...

Cheers,

Hannes





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux