Re: Bidirectional data transfers from SCSI layer

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

 



On 08/18/2009 01:35 PM, Madhavi Manchala wrote:
> On Tue, Aug 18, 2009 at 3:30 PM, Boaz Harrosh<bharrosh@xxxxxxxxxxx> wrote:
> 
> Dear Boaz,
> 
> Thanks a lot.
> 
>>> Do I need to modify the SCSI driver files to handle  the
>>> bi-directional comamnds or Is this already supported?
>>>
>>
>> Yes only very few drivers support bidi commands.
>> i.e. iscsi is the only one that supports them in general.
> 
> Currently, I am registering my driver to the SCSI layer. Now I
> understand, I need to register my driver to iscsi to get
> bi-directional commands. If this is the case, how can I register my
> driver to iscsi driver to get bi-directional commands, and will I get
> the same functionality from iscsi as I am currently getting from scsi.
> 

No!. You miss understood. iscsi is just a scsi LLD (Low Level Driver)
just as usb/storage/scsiglue.c is an LLD. You only register with scsi.

scsi-ml has full support for bidi. Only the LLDs do not. except two
LLDs: iscsi and scsi_debug.

>> (Tell me if you need example code for bsg use in user-mode).
> 
> Could you please send me the link to the user mode bsg initiator code
> which issues the bi-directional commands?
> 

Start here:
http://git.open-osd.org/gitweb.cgi?p=open-osd.git;a=blob;f=lib/bsgdev.c;h=f55a87879784f05950e7a2d88798605183cc660a;hb=ec34ca8bdef55a47c3b1f82b1021609570ccb283
and generally inspect this folder:
http://git.open-osd.org/gitweb.cgi?p=open-osd.git;a=tree;f=lib;h=5739f66f529c010755ab4bb05db4496d0ea4b229;hb=ec34ca8bdef55a47c3b1f82b1021609570ccb283

Above files are used to issue scsi-osd commands from user-mode, which can all be bidi.

>>> I found only one struct scsi_data_buffer pointer in scsi_cmnd
>>> structure. So, how do SCSI layer sends IN and OUT buffer pointers and
>>> their lengths to my class driver?
>>>
>>
>> Again:
>>        if (scsi_bidi_cmnd(cmnd)) {
>>                in_sdb = scsi_in(cmnd);
>>                out_sdb = scsi_out(cmnd);
>>        }
>> It works, look at the code.
> 
> Before using the above snippet in my class driver, do I need to fill
> in_req and out_req in SCSI layer or Is it already filled? If I use the
> iscsi driver, then there is no need to do any modifications to the
> in_req and out_req.
> 

Again: upper layers have full support. You only need the top most initiator
and a supporting LLD.

[ Initiator => block-layer => scsi-ml => LLD
  - initiators: bsg and osd support bidi. All other do not.
  - block-layer && scsi-ml fully support bidi.
  - LLDs: only iscsi currently supports bidi.
]

> Thanks and Regards,
> Madhavi M.

Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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