From: James Smart <James.Smart@Emulex.Com>
To: Joe Eykholt <jeykholt@cisco.com>
Cc: G S <gogman69-linuxscsi@yahoo.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: Fibre Channel pass-through for sending arbitrary FC and SCSI commands
Date: Thu, 1 Oct 2009 10:18:49 -0400 [thread overview]
Message-ID: <4AC4BA49.6020705@emulex.com> (raw)
In-Reply-To: <4AC44DC5.4060106@cisco.com>
Joe Eykholt wrote:
> G S wrote:
>
>> Howdy,
>>
>> The Linux "sg" (SCSI pass-through) can be used to send arbitrary SCSI
>> commands to SCSI target devices.
>>
>> But "sg" doesn't give me access to the transport layer details, such
>> as constructing my own FCP_CMND and receiving FCP_RSP IU's.
>>
>> Is there FC pass-thru in Linux (2.6) SCSI stack, that allows me to
>> construct my own transport frames and payloads?
>>
>
> There's /dev/bsg* that gives lets you send ELS and CT frames, but not
> just any FC frames. You need to configure it under the "Block layer"
> kconfig menu. And perhaps not all HBAs support it. See source
> block/bsg.c for details.
>
>
Although, to date, transport-specific command formats have largely been
confined to the LLDs, I don't know why we couldn't extend the bsg
commands to include something that requests an FCP command execution.
You may still have to wait for individual drivers to support such a
thing (just like the els/ct), but technically, there's no issue.
The downside to this is - any side-band command has the opportunity to
change the scsi state of the device, and do so outside of the knowledge
of the class driver. So any such use is "at your own risk". Consider
scenarios: a) your fcp command clears a CA condition that the class
driver needs to be aware of; or b) app is busy reading tape device,
sideband FCP-based rewind command comes in, repositions tape, app is
unaware of rewind, things get all confused. Even worse if FC-cmd is a
write as tape writes dictate tape records and filemarks, etc.
>> If not, is there vendor (eg. QLogic and Emulex) provided IOCTL module
>> that allows application to interface directly to the HBA driver for
>> doing FC pass-through?
>>
>
> I don't know that.
>
> Joe
>
>
Vendor-provided ioctls are an evil that are not allowed upstream, and
thus typically not allowed in distros either. However, as distro
products must be supportable, when the kernel doesn't have the necessary
infrastructure, the rules get relaxed, although with great debate
first. Vendors can provide out-of-kernel drivers, but this is very
costly for the vendor - there's dislike from the community, there's
lack-of-support from distros, and a yet another driver stream that must
be supported. Thus, the best option if you desire this feature, is to
add the bsg request type indicated above.
-- james s
prev parent reply other threads:[~2009-10-01 14:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-01 5:25 Fibre Channel pass-through for sending arbitrary FC and SCSI commands G S
2009-10-01 6:35 ` Joe Eykholt
2009-10-01 14:18 ` James Smart [this message]
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=4AC4BA49.6020705@emulex.com \
--to=james.smart@emulex.com \
--cc=gogman69-linuxscsi@yahoo.com \
--cc=jeykholt@cisco.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 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.