The Linux SCSI Target Wiki
ConfigFS is a RAM-based virtual file system provided with the 2.6 Linux kernel.
ConfigFS appears similar to sysfs but they are in fact different and complementary. ConfigFS is for creating, managing and destroying kernel objects from user-space, and sysfs for viewing and manipulating objects from user-space which are created and destroyed by kernel space. It is typically mounted at
The LinuxIO uses configFS for all fabric module configuration. Objects are associated with symbolic links, both within and across modules.
The following LIO components support configFS-based configuration:
- LinuxIO: Target/configFS
- Fibre Channel: qla2xxx/configfs
- FCoE: fc/configfs
- IEEE 1394
- iSCSI: iscsi/configfs
- IBM vSCSI ibmvsci/configfs
- SRP: srpt/configfs
- tcm_loop: loopback/configfs
- USB Gadget
- vHost: vhost/configfs
LIO v4.0 and higher contains logic in
target_core_fabric_configfs.c to the layout of config_groups (e.g., configFS directories), and allows fabric modules to optionally enable an extended set of TPG config_groups and add fabric dependent attributes.
The basic layout of a newly created fabric module configFS skeleton looks like (see the mapping into targetcli):
# tree /sys/kernel/config/target/nab5000/ /sys/kernel/config/target/nab5000/ |-- discovery_auth |-- iqn.foo | `-- tpgt_1 | |-- acls | |-- attrib | |-- lun | | `-- lun_0 | | |-- alua_tg_pt_gp | | |-- alua_tg_pt_offline | | |-- alua_tg_pt_status | | |-- alua_tg_pt_write_md | | `-- nab5000_port -> ../../../../../../target/core/iblock_0/lvm_test0 | |-- np | `-- param `-- version
By default, a fabric module is provided with the following groups.
This is the top level fabric module group created via an initial mkdir(2), which may also involve loading the module automatically.
- For iSCSI, this is the iSCSI iqn.* name.
- For SAS, this is the NAA WWPN defined as naa.*
- For Fibre Channel (FC) and FCoE, this is the WorldWidePortName (WWPN), defined by
tcm_lpfcas 20:00:XX:XX:XX:XX:XX:XX, where XX:XX:XX:XX:XX:XX is the MAC address of the FC/FCoE port.
tfc_tpg_cit is created via mkdir(2) and defines a fabric independent target portal group TPG tag.
tfc_tpg_cit will create the ACLs, attrib, LUN, np and param groups by default for all fabric modules. It may contain fabric module dependent attributes (such as
/enable for iSCSI).
tfc_tpg_nacl_cit is created empty by default by
tfc_tpg_cit. A subsequent mkdir(2) creates a fabric dependent
$INITIATOR_WWN. This follows the same naming conventions as
$FABRIC_WWN. Also below the
tfc_tpg_nacl_cit, the MappedLUN layout is fabric independent along with the same default
acls/$INITIATOR_WWN/[attrib,auth,param] groups as iSCSI, but appear as empty by default and may contain fabric dependent attributes. For all intenstive purposes will be the same (aside from the different
$INITIATOR_WWN) as in existing RTSlib code.
tfc_tpg_attrib_cit is created empty by default by
tfc_tpg_cit, and may optionally contain fabric dependent attributes.
tfc_tpg_lun_cit is created empty by default by
tfc_tpg_cit. A subsequent mkdir(2) for
lun_$id creates the
alua_tg_pt_* attributes, and a symlink to an
$HBA/$DEV backend creates a fabric module port. The fabric module is currently not allowed to create fabric dependent attributes here. For all intenstive purposes will be the same as in existing rtslib code.
tfc_tpg_np_cit is created empty by default by
tfc_tpg_cit, and may optionally contain IPv4 or IPv6 addresses. It is only intended for iSCSI specific usage, and may contain fabric dependent attributes. Currently modules aside from iSCSI not using this logic will return an
-ENOSYS here during mkdir(2) $IP_ADDRESS.
tfc_tpg_param_cit is created empty by default by
tfc_tpg_cit, and may optionally contain fabric dependent parameter attributes.
So the main fabric depends parts are currently:
- Special case of
$FABRIC_WWN/tpgt_$TPGT/np/group for iSCSI
- Fabric dependent attributes in
Beyond these cases, everything defined by
target_core_fabric_configfs.c in the
/sys/kernel/config/target/$FABRIC_MOD layout is generic to all fabrics.
- ↑ Joel Becker (3/31/2005). "configfs - userspace-driven kernel object configuration". mjmwired.net.
- ↑ Jonathan Corbet (8/24/2005). "ConfigFS - An Introduction". lwn.net.