Re: finding guids of local fw devices

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

 



On 24/07/2012 19:43, Andy Grover wrote:
> On 07/24/2012 10:51 AM, Chris Boot wrote:
>> On 24/07/2012 18:23, Andy Grover wrote:
>>> So, a "1394:device" is equivalent to a "lio:target", and a 1394:target
>>> is equivalent to a lio:lun, I believe.
>> No: a "1394:target" is more like a TPG, it can have several LUNs.
>> Really, you have a 1394:device that can contain several
>> 1394:unit_directory, each of which could be an SBP target or something
>> else (an audio device for example). The 1394:unit_directory for an SBP
>> target can export one or more LUNs.
> AHH, ok. I am more enlightened.
>
> But it all starts with the 1394:device, right? If I have two 1394 cards
> A and B in a system, they should each be created in LIO as two different
> lio:targets using /sys/bus/firewire/devices/fwX/guid (since lio:target
> <-> 1394:device) and only those where ./is_local == 1 (in kernel 3.6+)
>
> Next I'd create a tpg (tpg1) for A, and this would create a
> 1394:unit_directory of type "sbp target" on A.
>
> Then I'd map storageobjects to tpg1, and this would add the LUNs to the
> 1394:unit_directory.
>
> I plug in to a port on card A, I see the LUNs.
> I plug in to a port on card B, I get nothing.
>
> Yes?

I wish that were the case, but no. The FireWire stack in Linux has no
way to only expose a unit on one fw_card - you get your unit on all the
config directories (all fw_cards) when you register it. The way I wrote
the SBP target, when you create a tport, the GUID that is the name of
the tport turns into the GUID in the SBP target's unit structure, and
has no connection with any specific fw_device.

Each tport can then only contain one TPG, which actually maps more
closely to the SBP unit directory. My thoughts were that if in future
Linux gains the ability to only expose a unit on a specific fw_card,
then I could make use of the iSCSI-style network portals to select which
card(s) the unit is available through.

So really if you create 2 targets (each with one tpg), then you will see
_both_ targets over _both_ of your fw_cards regardless of the GUID you
use to name them. The GUIDs will be embedded in the SBP targets' unit
directories so a clever initiator will be able to tell that of the 4
units it sees there are 2 identical pairs.

HTH,
Chris

-- 
Chris Boot
bootc@xxxxxxxxx

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


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux