From: Boaz Harrosh <bharrosh@panasas.com>
To: Elias Oltmanns <eo@nebensachen.de>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] SCSI support for REQ_TYPE_LINUX_BLOCK requests
Date: Wed, 26 Mar 2008 17:15:39 +0200 [thread overview]
Message-ID: <47EA689B.4080109@panasas.com> (raw)
In-Reply-To: <87r6dxy37a.fsf@denkblock.local>
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)
If you want a request with no BIO's and any arbitrary data this can
be just a varlen command. In the presence of varlen commands block
or scsi layers will not assume anything about the passed CDB and will
just channel it all the way to the LLD.
But if you also need mapped buffers you allocate a BIO with right
direction (or bidi) and the mid-layers will also take care of that in
the regular way.
BLOCK_PC commands with-or-without data, are always completed at once.
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.
1. Make the Initiator smarter to only send these commands to good devices
In a manner of a special flag or a registration process.
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.
Boaz
next prev parent reply other threads:[~2008-03-26 15:16 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 [this message]
2008-03-28 11:43 ` Elias Oltmanns
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=47EA689B.4080109@panasas.com \
--to=bharrosh@panasas.com \
--cc=eo@nebensachen.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.