On Jul 24 Andy Grover wrote: > On 07/24/2012 01:56 PM, Chris Boot wrote: > >> 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. > > Now I understand why you were saying the tport GUID can be arbitrary. > > ISTR you talking about this when you were implementing sbp target, and I > didn't get it then but didn't ask further. Thanks for the explanation. > > Not sure if this is a bug or a feature, but it *is* different than other > target fabrics. :) The best way forward may be to just limit sbp fabric > to a singleton target (with some dummy name), which will have the single > tpg with the 1+ luns underneath, and accessible from all fw cards. Just a few remarks: a) Terminology nitpicks, IEEE 1394 part: A Linux PC or whatever physical device is a "module". A module contains 1...n "nodes". (Usually 1.) What others see on the bus are a priori these nodes. Self-configuration of the 1394 bus is about nodes. (So, let's forget about "modules" to simplify the picture.) A node contains 0...n units. A unit may contain 0...n subunits, but this latter term is not used in the SBP-2/ -3 unit architecture. (See below.) Among else, a node exposes control and status registers to the other nodes on the bus. These registers are defined by IEEE 1212, IEEE 1394, unit architecture specifications, or vendors. One of the registers is the "Configuration ROM" which describes the node and its units. For the latter purpose, the Configuration ROM contains "unit directories", one for each unit. b) Terminology nitpicks, SCSI part: A SCSI target contains 1...n "logical units". "Logical unit numbers" a.k.a. "LUNs" are data used as logical unit identifiers. There is indeed circa a 1:1 mapping of SCSI "target" to IEEE 1394 "unit" (in case of units which implement SBP-2 or SBP-3). It is not exactly 1:1 because in theory an SBP target may expose itself on multiple independent nodes on the same IEEE 1394 bus or on different IEEE 1394 buses. The SBP target devices which you can buy in shops today all implement 1 node. Most of them have 1 unit with 1 logical unit. There are some multi-drive devices which implement n units, each with 1 logical unit. Another existing but much rarer case is that such a device implements 1 unit with several logical units. (Maybe I should talk about target ports really, rather than targets. Feel free to pick nits in my nitpick.) c) How to pick an EUI-64, as upper part of the target port identifier of an SBP target: To ensure worldwide uniqueness, an organization goes to IEEE RAC and gets itself a worldwide unique organizational identifier, an OUI-24, to be used as upper part of EUI-64s. Then this organization goes forth and administers EUI-64s, ensuring that the lower part of the EUI-64s are unique within the space associated with its OUI-24. So, if you are a Linux user wanting to run an SBP target with Chris' new driver, either go get an OUI-24 from IEEE RAC if you haven't got one already --- or let the target use the EUI-64 which makes up the local node's unique ID. (If you have got several local nodes on the Linux PC, just pick one a source for the target's EUI-64.) Or make something up which isn't guaranteed to be worldwide unique but don't expose it to the world then. In SBP target devices which you can buy in shops, the target's EUI-64 is identical with the node's EUI-64. d) Adding units on Linux nodes: Yes, firewire-core is implemented such that a driver's (userspace or kernel driver's) request to add a logical unit directory to the Configuration ROM affects the Configuration ROMs of /all/ logical nodes at once. It is merely an implementation limitation which was chosen to keep things simple. The present drivers/firewire/ stack exists in the mainline today instead of former Linux's drivers/ieee1394/ stack because it provided a fresh start with a much slimmer code base, bringing design fixes as well as new features while coming in much less and more modern source code for better maintainability. So in short, not offering the ability to add a unit directory only to a single local node's Configuration ROM was merely a decision for the benefit of slimmer code. If anybody is interested in this missing feature, propose a patch. -- Stefan Richter -=====-===-- -=== ==--= http://arcgraph.de/sr/ -- 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