From: Elias Oltmanns <eo@nebensachen.de>
To: Boaz Harrosh <bharrosh@panasas.com>, Jens Axboe <jens.axboe@oracle.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] SCSI support for REQ_TYPE_LINUX_BLOCK requests
Date: Fri, 28 Mar 2008 12:43:02 +0100 [thread overview]
Message-ID: <87y783ula1.fsf@denkblock.local> (raw)
In-Reply-To: 47EA689B.4080109@panasas.com
Boaz Harrosh <bharrosh@panasas.com> wrote:
> On Wed, Mar 26 2008 at 16:23 +0200, Elias Oltmanns <eo@nebensachen.de> wrote:
>> Elias Oltmanns <eo@nebensachen.de> wrote:
>>> Hi all,
>>>
>>> this patch adds support for REQ_TYPE_LINUX_BLOCK requests to the scsi
>>> midlayer. Low level drivers have the option to register their own
>>> handlers for these special requests if necessary.
>>>
>> [...]
>>> +static void scsi_finish_lb_req(struct request *req)
>>> +{
>>> + struct request_queue *q = req->q;
>>> + struct scsi_device *sdev = q->queuedata;
>>> + unsigned long flags;
>>> +
>>> + spin_lock_irqsave(q->queue_lock, flags);
>>> + end_that_request_last(req, 1);
>>
>> That's obsolete, of course. Sorry for missing that. See the correct
>> patch for 2.6.25-rc7 below.
>>
>> Regards,
>>
>> Elias
>>
>>
>
> It looks to me like you can accomplish any of that (and more) with
> regular BLOCK_PC commands plus the varlen facility I have sent:
> (http://www.spinics.net/lists/linux-scsi/msg25202.html)
Thanks for the hint, the varlen facility certainly is a nice
enhancement. However, I wonder whether this really is a replacement for
REQ_TYPE_LINUX_BLOCK requests. This is a linux specific type of requests
intended to be used as generic block layer messages. In my patch set,
for instance, a REQ_TYPE_LINUX_BLOCK request is enqueued to notify LLDs
that the queue has just been frozen / thawed. The block layer doesn't
really care (or know, for that matter) whether the device is an SCSI,
IDE, or an loop device. Thus, only the LLD itself can decide what kind
of commands (if any) have to be executed in response to the generic
block layer message.
Of course, the same can be achieved by means of the varlen facility if
we could, for instance, reserve a certain range of codes in the service
action of a variable length CDB for this kind of requests. Is that what
you had in mind?
[...]
> BLOCK_PC commands with-or-without data, are always completed at once.
??? At once, as opposed to what? For all I know, they are enqueued for
asynchronous completion.
>
> The LLD in question will only need to filter for those special commands
> at the .queuecommand entry and act accordingly.
>
> The only problem you might have is with a dumb initiator that might issue
> commands to devices that do not know what to do with the new none-standard
> commands. There is 3 things you can do.
This will be a common situation and we are not just talking about scsi
devices either.
> 1. Make the Initiator smarter to only send these commands to good
> devices In a manner of a special flag or a registration process.
We wanted to avoid just that.
> 2. use commands that are bigger than 16 so .max_cmd_len of legacy
> drivers will not allow these commands through.
> 3. Do nothing and let the setup process only setup the compatible
> devices to be issued the new commands.
>
> The bsg driver can already be used to issue such commands from user space.
> Tell me if you need example code to easily issue such commands from kernel.
If you still think that all of the above can (and should) be
accomplished using BLOCK_PC commands and the varlen facility, I'd be
interested in some example code.
Regards,
Elias
next prev parent reply other threads:[~2008-03-28 14:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-24 17:56 [PATCH] SCSI support for REQ_TYPE_LINUX_BLOCK requests Elias Oltmanns
2008-03-26 14:23 ` Elias Oltmanns
2008-03-26 15:15 ` Boaz Harrosh
2008-03-28 11:43 ` Elias Oltmanns [this message]
2008-03-30 15:39 ` Boaz Harrosh
2008-04-10 22:47 ` Elias Oltmanns
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=87y783ula1.fsf@denkblock.local \
--to=eo@nebensachen.de \
--cc=bharrosh@panasas.com \
--cc=jens.axboe@oracle.com \
--cc=linux-scsi@vger.kernel.org \
/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).