Skip to contentSkip to conversation

Move SCST sysfs documentation to Documentation/ABI

PATCH Superseded Bart Van Assche 3 participants 8 messages Dec 22, 2010 – Dec 24, 2010

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Move SCST sysfs documentation to Documentation/ABI

Since documentation of sysfs attributes must reside in Documentation/ABI, this series of three patches moves the documentation of the SCST sysfs attributes to that location. Please review.

#1 lore raw

PATCH 1/3 scst: Move target sysfs documentation to Documentation/ABI

Move the documentation about SCSI target drivers and devices from Documentation/scst/SysfsRules and Documentation/scst/README.scst to Documentation/ABI/stable.

Cc Greg Kroah-Hartman <[email protected]>
Cc Vladislav Bolkhovitin <[email protected]>
Cc Richard Sharpe <[email protected]>
---
 Documentation/ABI/stable/sysfs-devices-scst_target |  213 ++++++++++++++++++++
 .../stable/sysfs-devices-scst_target-scst_local    |   21 ++
 Documentation/ABI/stable/sysfs-driver-scst_target  |   65 ++++++
 .../ABI/stable/sysfs-driver-scst_target-scst_local |   12 +
 Documentation/scst/README.scst                     |   98 ---------
 Documentation/scst/SysfsRules                      |   63 ------
 6 files changed, 311 insertions(+), 161 deletions(-)
 create mode 100644 Documentation/ABI/stable/sysfs-devices-scst_target
 create mode 100644 Documentation/ABI/stable/sysfs-devices-scst_target-scst_local
 create mode 100644 Documentation/ABI/stable/sysfs-driver-scst_target
 create mode 100644 Documentation/ABI/stable/sysfs-driver-scst_target-scst_local
Documentation/ABI/stable/sysfs-devices-scst_target new file +213 -0
new file mode 100644
index 0000000..7e920f9
@@ -0,0 +1,213 @@
+What:           /sys/bus/scst_target/devices/*/addr_method
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		LUN addressing method used by this target when e.g. responding
+		to a REPORT_LUNS command. One of the values FLAT, PERIPHERAL
+		or LUN. See also SAM-3, section 4.9, Logical Unit Numbers.
+		Read-write.
+
+What:           /sys/bus/scst_target/devices/*/cpu_mask
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Target-specific CPU mask. Read-only.
+
+What:           /sys/bus/scst_target/devices/*/force_close
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		If this file exists, allows to forcibly close all sessions
+		associated with a target. Optional / write-only.
+
+What:           /sys/bus/scst_target/devices/*/enabled
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Allows to enable or disable a target by setting this attribute
+		to 1 or 0 respectively. No new connections are accepted for a
+		target that is in the disabled state. Defaults to disabled
+		(0). This allows to configure a target before any connections
+		are accepted. Enabling a target is only allowed if its relative
+		target port identifier is unique. Read-write.
+
+What:           /sys/bus/scst_target/devices/*/hw_target
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Allows to distinguish hardware and virtual targets. The value
+		1 means that there is a one-to-one correspondence between this
+		target and a hardware entity, and the value 0 means that there
+		is no such one-to-one correspondence. Only exists when the
+		target driver supports both hardware and virtual targets.
+		Read-only.
+
+What:           /sys/bus/scst_target/devices/*/ini_groups/<acg>/addr_method
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		LUN addressing method for this ACG (access control group).
+		Read-write.
+
+What:           /sys/bus/scst_target/devices/*/ini_groups/<acg>/cpu_mask
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		CPU mask associated with this ACG. Read-only.
+
+What:           /sys/bus/scst_target/devices/*/ini_groups/<acg>/initiators/<ini>
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Name of an initiator associated with this ACG. Read-only.
+
+What:           /sys/bus/scst_target/devices/*/ini_groups/<acg>/initiators/luns/parameters
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Names of the parameters supported when adding a LUN to an ACG,
+		one per line. Read-only.
+
+What:           /sys/bus/scst_target/devices/*/ini_groups/<acg>/initiators/luns/<number>
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Soft link to the SCST device associated with this LUN.
+
+What:           /sys/bus/scst_target/devices/*/io_grouping_type
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Defines whether and how to share I/O contexts. I/O context
+		sharing may improve I/O performance significantly when using
+		the CFQ I/O scheduler and multithreaded I/O processing.
+		The allowed values for this parameter are:
+		* "auto"               Use one I/O context per initiator.
+		* "this_group_only"    Use the same I/O context for all sessions
+		  		       associated with this target.
+		* "never"              Never share I/O contexts.
+		* <I/O context number> Share an I/O context over all targets
+		                       that have this I/O context number. Must
+				       be a number above zero.
+		Read-write.
+
+What:           /sys/bus/scst_target/devices/*/luns/parameters
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Names of the parameters supported when adding a LUN to a target,
+		one per line. Read-only.
+
+What:           /sys/bus/scst_target/devices/*/luns/<number>/device
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Soft link to the exported SCST device. Read-only.
+
+What:           /sys/bus/scst_target/devices/*/luns/<number>/read_only
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Whether this LUN is read-only (1) or read-write (0). Read-only.
+
+What:           /sys/bus/scst_target/devices/*/sessions/<session>/active_commands
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Number of SCSI commands being executed for the device
+		associated with this session. Read-only.
+
+What:           /sys/bus/scst_target/devices/*/sessions/<session>/commands
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Number of SCSI commands being executed for this session.
+		Read-only.
+
+What:           /sys/bus/scst_target/devices/*/sessions/<session>/force_close
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Attribute that allows to forcibly close a session. Optional,
+		write-only.
+
+What:           /sys/bus/scst_target/devices/*/sessions/<session>/initiator_name
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Session name. For most target drivers this is a name that
+		identifies the initiator. Read-only.
+
+What:           /sys/bus/scst_target/devices/*/sessions/<session>/latency
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		If CONFIG_SCST_MEASURE_LATENCY has been enabled, latency
+		statistics for this session. Read-only.
+
+What:           /sys/bus/scst_target/devices/*/sessions/<session>/lun<number>/active_commands
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Number of active commands. Read-only.
+
+What:           /sys/bus/scst_target/devices/*/sessions/<session>/lun<number>/latency
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Latency statistics. Read-only.
+
+What:           /sys/bus/scst_target/devices/*/sessions/<session>/luns/parameters
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Names of the parameters that may be specified when adding a
+		LUN, one per line. Read-only.
+
+What:           /sys/bus/scst_target/devices/*/sessions/<session>/luns/<number>/device
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Soft link to the SCST device that is exported via this LUN. An
+		example:
+		$ readlink /sys/bus/scst_target/devices/scst_local_tgt/sessions/scst_local_host/luns/0/device
+		../../../disk01
+
+What:           /sys/bus/scst_target/devices/*/sessions/<session>/luns/<number>/read_only
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Whether a LUN has been exported read-only (1) or read-write (0).
+		Read-only.
+
+What:           /sys/bus/scst_target/devices/*/rel_tgt_id
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		SCSI Relative Target Port Identifier, which is used by e.g.
+		persistent reservation commands. Read-write.
Documentation/ABI/stable/sysfs-devices-scst_target-scst_local new file +21 -0
new file mode 100644
index 0000000..c659c60
@@ -0,0 +1,21 @@
+What:           /sys/bus/scst_target/devices/scst_local/phys_transport_version
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		SCSI physical transport version. Read-write.
+
+What:           /sys/bus/scst_target/devices/scst_local/scsi_transport_version
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		SCSI transport version. Read-write.
+
+What:           /sys/bus/scst_target/devices/scst_local/sessions/transport_id
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		SCSI transport ID in binary format. Necessary e.g. for
+		implementing persistent reservation support. Read-write.
Documentation/ABI/stable/sysfs-driver-scst_target new file +65 -0

65 lines not on this page · raw message

Documentation/ABI/stable/sysfs-driver-scst_target-scst_local new file +12 -0
new file mode 100644
index 0000000..9c85701
@@ -0,0 +1,12 @@
+What:           /sys/bus/scst_target/drivers/scst_local/stats
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Statistics about processing of SCSI commands received via the
+		Linux SCSI initiator: the number of SCSI commands that have
+		been aborted, the number of SCSI device resets and the number
+		of SCSI target resets. Read-only. An example:
+
+		# cat /sys/bus/scst_target/drivers/scst_local/stats
+		Aborts: 0, Device Resets: 0, Target Resets: 0
Documentation/scst/README.scst +0 -98

104 lines not on this page · raw message

Documentation/scst/SysfsRules +0 -63

69 lines not on this page · raw message

Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/3 scst: Move SCST device documentation to Documentation/ABI

In reply to Bart Van Assche

Move the documentation about the sysfs attributes of the SCST virtual device to Documentation/ABI/stable.

Cc Greg Kroah-Hartman <[email protected]>
Cc Vladislav Bolkhovitin <[email protected]>
---
 Documentation/ABI/stable/sysfs-devices-scst |  150 +++++++++++++++++++++++++++
 Documentation/scst/README.scst              |   71 -------------
 2 files changed, 150 insertions(+), 71 deletions(-)
 create mode 100644 Documentation/ABI/stable/sysfs-devices-scst
Documentation/ABI/stable/sysfs-devices-scst new file +150 -0
new file mode 100644
index 0000000..80bc258
@@ -0,0 +1,150 @@
+What:           /sys/devices/scst/mgmt
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Interface through which SCST management commands can be issued.
+		The documentation of the syntax of these commands can be
+		obtained by reading this file:
+
+		# cat mgmt
+		in device/<dev> <dev_cmd>
+		in device_driver/<devt> <devt_cmd>
+		in target_driver/<tgtt> <tgtt_cmd>
+		in target_driver/<tgtt>/<target>/luns <tgt_cmd>
+		in target_driver/<tgtt>/<target>/luns <luns_cmd>
+		in target_driver/<tgtt>/<target>/ini_groups <acg_mgmt_cmd>
+		in target_driver/<tgtt>/<target>/ini_groups/<acg> <acg_cmd>
+		in target_driver/<tgtt>/<target>/ini_groups/<acg>/luns <luns_cmd>
+		in target_driver/<tgtt>/<target>/ini_groups/<acg>/initiators <acg_ini_cmd>
+
+		dev_cmd syntax:
+
+		set_filename <filename>
+		set_threads_num <n>
+		set_thread_pool_type <thread_pool_type>
+
+		devt_cmd syntax:
+
+		add_device device_name [parameters]
+		del_device device_name
+		add_attribute <attribute> <value>
+		del_attribute <attribute> <value>
+		add_device_attribute device_name <attribute> <value>
+		del_device_attribute device_name <attribute> <value>
+
+		devt_cmd syntax for pass-through device types:
+
+		add_device H:C:I:L
+		del_device H:C:I:L
+
+		tgtt_cmd syntax:
+
+		add_target target_name [parameters]
+		del_target target_name
+		add_attribute <attribute> <value>
+		del_attribute <attribute> <value>
+		add_target_attribute target_name <attribute> <value>"
+		del_target_attribute target_name <attribute> <value>"
+
+		where parameters is one or more <name>=<value> pairs separated by ';'
+
+		tgt_cmd syntax:
+
+		enable
+		disable
+		set_cpu_mask <mask>
+
+		luns_cmd syntax:
+
+		add|del H:C:I:L lun [parameters]
+		add VNAME lun [parameters]
+		del lun
+		replace H:C:I:L lun [parameters]
+		replace VNAME lun [parameters]
+		clear
+
+		where parameters is either 'read_only' or empty.
+
+		acg_mgmt_cmd syntax:
+
+		create <group_name>
+		del <group_name>
+
+		acg_cmd syntax:
+		set_cpu_mask <mask>
+
+		acg_ini_cmd syntax:
+
+		add <initiator_name>
+		del <initiator_name>
+		move <initiator_name> <dest_group_name>
+		clear
+
+What:           /sys/devices/scst/setup_id
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		SCST setup ID. Allows to identify otherwise identical SCST
+		setups on different systems. Makes the IDs and SNs of
+		otherwise identical SCST devices unique. As an example,	the
+		vdisk device handler uses this to generate the T10 vendor
+		specific identifier and SN of vdisk devices. Read-write.
+
+What:           /sys/devices/scst/sgv/global_stats
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Global SGV (scatter/gather vector) cache statistics. Read-only.
+		An example:
+
+		$ cat sgv/global_stats
+		Inactive/active pages                      0/0
+		Hi/lo watermarks [pages]                   62208/0
+		Hi watermark releases/failures             0/0
+		Other allocs                               0
+
+What:           /sys/devices/scst/sgv/sgv/stats
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Statistics for the regular SGV cache. Read-only.
+
+What:           /sys/devices/scst/sgv/sgv-clust/stats
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Statistics for the clustering SGV cache. Read-only.
+
+What:           /sys/devices/scst/sgv/sgv-dma/stats
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Statistics for the DMA SGV cache. Read-only.
+
+What:           /sys/devices/scst/threads
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Number of global I/O threads. Global I/O threads are used by
+		asynchronous device handlers, e.g. the vdisk blockio handler.
+		Read-write.
+
+What:           /sys/devices/scst/version
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		SCST version (first line) and compile-time configuration
+		(subsequent lines). Read-only. An example:
+
+		$ cat /sys/devices/scst/version
+		2.0.0
+		TRACING
+		DEBUG
Documentation/scst/README.scst +0 -71

83 lines not on this page · raw message

Signature · 1 line
1.7.1
#3 lore raw

Re: [PATCH 2/3] [SCSI] scst: Move SCST device documentation to Documentation/ABI

Quoted 18 lines · Bart Van Assche

Move the documentation about the sysfs attributes of the SCST virtual device to Documentation/ABI/stable.

Cc Greg Kroah-Hartman <[email protected]>
Cc Vladislav Bolkhovitin <[email protected]>
---
 Documentation/ABI/stable/sysfs-devices-scst |  150 +++++++++++++++++++++++++++
 Documentation/scst/README.scst              |   71 -------------
 2 files changed, 150 insertions(+), 71 deletions(-)
 create mode 100644 Documentation/ABI/stable/sysfs-devices-scst
Documentation/ABI/stable/sysfs-devices-scst new file +0 -0
new file mode 100644
index 0000000..80bc258

Documentation/ABI/stable/sysfs-devices-scst line 1

Quoted 1 line
Documentation/ABI/stable/sysfs-devices-scst new file +1 -0
@@ -0,0 +1,150 @@
+What:           /sys/devices/scst/mgmt

How did you get a file into this directory? Are you sure that's acceptable? Same for the other files you added here.

Documentation/ABI/stable/sysfs-devices-scst line 3

Quoted 2 lines
Documentation/ABI/stable/sysfs-devices-scst new file +2 -0
+Date:           December 2010
+KernelVersion:  2.6.38

Really? That's pretty presumptious, isn't it?

Documentation/ABI/stable/sysfs-devices-scst line 4

Quoted 1 line
Documentation/ABI/stable/sysfs-devices-scst new file +1 -0
+Contact:        [email protected]

Why not the "owner" of this code, not the scsi mailing list.

Documentation/ABI/stable/sysfs-devices-scst line 6

Quoted 2 lines
Documentation/ABI/stable/sysfs-devices-scst new file +2 -0
+Description:
+		Interface through which SCST management commands can be issued.

You mix tabs and spaces above and in all of your other files. Please make them only tabs.

Documentation/ABI/stable/sysfs-devices-scst line 19

Quoted 13 lines
Documentation/ABI/stable/sysfs-devices-scst new file +13 -0
+		The documentation of the syntax of these commands can be
+		obtained by reading this file:
+
+		# cat mgmt
+		in device/<dev> <dev_cmd>
+		in device_driver/<devt> <devt_cmd>
+		in target_driver/<tgtt> <tgtt_cmd>
+		in target_driver/<tgtt>/<target>/luns <tgt_cmd>
+		in target_driver/<tgtt>/<target>/luns <luns_cmd>
+		in target_driver/<tgtt>/<target>/ini_groups <acg_mgmt_cmd>
+		in target_driver/<tgtt>/<target>/ini_groups/<acg> <acg_cmd>
+		in target_driver/<tgtt>/<target>/ini_groups/<acg>/luns <luns_cmd>
+		in target_driver/<tgtt>/<target>/ini_groups/<acg>/initiators <acg_ini_cmd>

What? sysfs is one value per file, why would the mgmt file return more than one line? That's not acceptable, sorry.

Quoted 53 lines
Documentation/ABI/stable/sysfs-devices-scst new file +53 -0
+
+		dev_cmd syntax:
+
+		set_filename <filename>
+		set_threads_num <n>
+		set_thread_pool_type <thread_pool_type>
+
+		devt_cmd syntax:
+
+		add_device device_name [parameters]
+		del_device device_name
+		add_attribute <attribute> <value>
+		del_attribute <attribute> <value>
+		add_device_attribute device_name <attribute> <value>
+		del_device_attribute device_name <attribute> <value>
+
+		devt_cmd syntax for pass-through device types:
+
+		add_device H:C:I:L
+		del_device H:C:I:L
+
+		tgtt_cmd syntax:
+
+		add_target target_name [parameters]
+		del_target target_name
+		add_attribute <attribute> <value>
+		del_attribute <attribute> <value>
+		add_target_attribute target_name <attribute> <value>"
+		del_target_attribute target_name <attribute> <value>"
+
+		where parameters is one or more <name>=<value> pairs separated by ';'
+
+		tgt_cmd syntax:
+
+		enable
+		disable
+		set_cpu_mask <mask>
+
+		luns_cmd syntax:
+
+		add|del H:C:I:L lun [parameters]
+		add VNAME lun [parameters]
+		del lun
+		replace H:C:I:L lun [parameters]
+		replace VNAME lun [parameters]
+		clear
+
+		where parameters is either 'read_only' or empty.
+
+		acg_mgmt_cmd syntax:
+
+		create <group_name>
+		del <group_name>

Documentation/ABI/stable/sysfs-devices-scst line 82

Quoted 10 lines
Documentation/ABI/stable/sysfs-devices-scst new file +10 -0
+
+		acg_cmd syntax:
+		set_cpu_mask <mask>
+
+		acg_ini_cmd syntax:
+
+		add <initiator_name>
+		del <initiator_name>
+		move <initiator_name> <dest_group_name>
+		clear

That's quite complex, are you sure it's correct, and actually describes it in a manner that anyone else can use?

Again, one value per file.

thanks,

greg k-h

#4 lore raw

Re: [PATCH 2/3] [SCSI] scst: Move SCST device documentation to Documentation/ABI

(resending as plain text)

Quoted 14 lines · Greg KH
Quoted 12 lines · Bart Van Assche

Move the documentation about the sysfs attributes of the SCST virtual device to Documentation/ABI/stable.

Cc Greg Kroah-Hartman <[email protected]>
Cc Vladislav Bolkhovitin <[email protected]>

---
 Documentation/ABI/stable/sysfs-devices-scst |  150 +++++++++++++++++++++++++++ Documentation/scst/README.scst              |   71 -------------

 2 files changed, 150 insertions(+), 71 deletions(-)

 create mode 100644 Documentation/ABI/stable/sysfs-devices-scst

Quoted 10 lines

Documentation/ABI/stable/sysfs-devices-scst line 1

Quoted 7 lines
Documentation/ABI/stable/sysfs-devices-scst new file +1 -0
new file mode 100644
index 0000000..80bc258
@@ -0,0 +1,150 @@
+What:           /sys/devices/scst/mgmt

How did you get a file into this directory?  Are you sure that's acceptable?  Same for the other files you added here.

Hello Greg,

All that was needed to create the entry /sys/devices/scst/mgmt was to call device_register() for the device with the name "scst" and device_create_file() for the attribute called "mgmt". We are not aware of any documentation that disallows creating files there. So whether or not creating a file there is acceptable is something we can't know if the kernel maintainers do not speak up.

Quoted 7 lines

Documentation/ABI/stable/sysfs-devices-scst line 3

Quoted 2 lines
Documentation/ABI/stable/sysfs-devices-scst new file +2 -0
+Date:           December 2010
+KernelVersion:  2.6.38

Really?  That's pretty presumptious, isn't it?

Documentation/ABI/stable/sysfs-devices-scst line 4

Quoted 1 line
Documentation/ABI/stable/sysfs-devices-scst new file +1 -0
+Contact:        [email protected]
Quoted 7 lines

Why not the "owner" of this code, not the scsi mailing list.

Documentation/ABI/stable/sysfs-devices-scst line 6

Quoted 2 lines
Documentation/ABI/stable/sysfs-devices-scst new file +2 -0
+Description:
+             Interface through which SCST management commands can be issued.

You mix tabs and spaces above and in all of your other files.  Please make them only tabs.

Will address the above comments.

Quoted 14 lines

Documentation/ABI/stable/sysfs-devices-scst line 19

Quoted 13 lines
Documentation/ABI/stable/sysfs-devices-scst new file +13 -0
+             The documentation of the syntax of these commands can be
+             obtained by reading this file:
+
+             # cat mgmt
+             in device/<dev> <dev_cmd>
+             in device_driver/<devt> <devt_cmd>
+             in target_driver/<tgtt> <tgtt_cmd>
+             in target_driver/<tgtt>/<target>/luns <tgt_cmd>
+             in target_driver/<tgtt>/<target>/luns <luns_cmd>
+             in target_driver/<tgtt>/<target>/ini_groups <acg_mgmt_cmd>
+             in target_driver/<tgtt>/<target>/ini_groups/<acg> <acg_cmd>
+             in target_driver/<tgtt>/<target>/ini_groups/<acg>/luns <luns_cmd>
+             in target_driver/<tgtt>/<target>/ini_groups/<acg>/initiators <acg_ini_cmd>
Quoted 2 lines

What?  sysfs is one value per file, why would the mgmt file return more than one line?  That's not acceptable, sorry.

As far as I understood the sysfs philosophy, the intention of the one value per file rule is to avoid that software reading data from sysfs files has to parse what it reads. The above data is documentation only and is not intended to be parsed by software. So that file could be left empty, but that would not be very helpful for users who configure SCST by issuing shell commands instead of using the scstadmin tool. I'm not sure though how to proceed here.

Quoted 58 lines
Quoted 58 lines
Documentation/ABI/stable/sysfs-devices-scst new file +58 -0
+
+             dev_cmd syntax:
+
+             set_filename <filename>
+             set_threads_num <n>
+             set_thread_pool_type <thread_pool_type>
+
+             devt_cmd syntax:
+
+             add_device device_name [parameters]
+             del_device device_name
+             add_attribute <attribute> <value>
+             del_attribute <attribute> <value>
+             add_device_attribute device_name <attribute> <value>
+             del_device_attribute device_name <attribute> <value>
+
+             devt_cmd syntax for pass-through device types:
+
+             add_device H:C:I:L
+             del_device H:C:I:L
+
+             tgtt_cmd syntax:
+
+             add_target target_name [parameters]
+             del_target target_name
+             add_attribute <attribute> <value>
+             del_attribute <attribute> <value>
+             add_target_attribute target_name <attribute> <value>"
+             del_target_attribute target_name <attribute> <value>"
+
+             where parameters is one or more <name>=<value> pairs separated by ';'
+
+             tgt_cmd syntax:
+
+             enable
+             disable
+             set_cpu_mask <mask>
+
+             luns_cmd syntax:
+
+             add|del H:C:I:L lun [parameters]
+             add VNAME lun [parameters]
+             del lun
+             replace H:C:I:L lun [parameters]
+             replace VNAME lun [parameters]
+             clear
+
+             where parameters is either 'read_only' or empty.
+
+             acg_mgmt_cmd syntax:
+
+             create <group_name>
+             del <group_name>
+
+             acg_cmd syntax:
+             set_cpu_mask <mask>
+
+             acg_ini_cmd syntax:
Quoted 8 lines

Documentation/ABI/stable/sysfs-devices-scst line 82

Quoted 5 lines
Documentation/ABI/stable/sysfs-devices-scst new file +5 -0
+
+             add <initiator_name>
+             del <initiator_name>
+             move <initiator_name> <dest_group_name>
+             clear

That's quite complex, are you sure it's correct, and actually describes it in a manner that anyone else can use?

More detailed documentation of these commands is present in Documentation/scst/README.scst. Should that documentation be moved to Documentation/ABI/stable/sysfs-devices-scst too ?

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

PATCH 3/3 scst: Move SCST devices documentation to Documentation/ABI

In reply to Bart Van Assche

Move the documentation about the sysfs attributes of the SCST pass-through and virtual devices to Documentation/ABI/stable.

Cc Greg Kroah-Hartman <[email protected]>
Cc Vladislav Bolkhovitin <[email protected]>
---
 .../ABI/stable/sysfs-devices-scst_tgt_dev          |  153 ++++++++++++++++++++
 Documentation/ABI/stable/sysfs-driver-scst_tgt_dev |   29 ++++
 2 files changed, 182 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ABI/stable/sysfs-devices-scst_tgt_dev
 create mode 100644 Documentation/ABI/stable/sysfs-driver-scst_tgt_dev
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +153 -0
new file mode 100644
index 0000000..ab09c21
@@ -0,0 +1,153 @@
+What:           /sys/bus/scst_tgt_dev/device/*/blocksize
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Block size used by the virtual device. Must be a power of two
+		and equal to or above 512. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/exported/export<nr>
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Zero or more soft links to the LUNs through which this device
+		has been exported. An example:
+
+		$ readlink /sys/bus/scst_tgt_dev/devices/disk01/exported/export0
+		../../scst_local_tgt/luns/0
+
+What:           /sys/bus/scst_tgt_dev/device/*/filename
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		For virtual devices, the absolute path of the associated file
+		or device. Read-only. An example:
+
+		# cat /sys/devices/disk01/filename
+		/dev/sdc
+		[key]
+
+What:           /sys/bus/scst_tgt_dev/device/*/nv_cache
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Whether or not the device has a non-volatile cache. SCST uses
+		this information to decide whether or not it is safe to
+		acknowledge writes early to the initiator. Setting this
+		attribute to 1 for a device that neither has a non-volatile
+		cache nor an UPS will decrease I/O latency but may result in
+		data loss in case of a power failure. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/o_direct
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		The value 1 means that all caching has been disabled for
+		a virtual device (direct I/O) and the value 0 means that caching
+		is enabled. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/read_only
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		For virtual devices, whether or not to deny write commands.
+		Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/removable
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		For virtual devices, whether or not the underlying storage
+		medium is removable. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/resync_size
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		For virtual devices, writing to this attribute will update the
+		internally cached device size. Write-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/scsi_device
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		For SCSI devices, the device identification. Read-only. An
+		example:
+
+		$ cat /sys/bus/scst_tgt_dev/devices/1:0:0:0/scsi_device
+		1:0:0:0
+
+What:           /sys/bus/scst_tgt_dev/device/*/size_mb
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		For virtual devices, the internally cached size in MB of the
+		underlying storage device. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/t10_dev_id
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		SCSI device ID associated with the virtual device. This is the
+		ID reported e.g. via the Device Identification page (0x83) of
+		the INQUIRY command. Read-write.
+
+What:           /sys/bus/scst_tgt_dev/device/*/thin_provisioned
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Whether or not the virtual device supports thin provisioning,
+		or in other words, that remote initiators can mark storage as
+		unallocated. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/threads_num
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Number of threads in the thread pool that is used for
+		processing SCSI commands for this device. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/threads_pool_type
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Whether to use a distinct thread pool per initiator
+		("per_initiator") or one thread pool for all initiators
+		accessing this device ("shared"). Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/type
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		SCSI type of this device. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/usn
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Unique serial number as reported e.g. by the SCSI INQUIRY
+		response. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/write_through
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Whether or not write-back caching has been disabled for a
+		virtual device. The value 0 stands for write-back mode and the
+		value 1 stands for write-through mode. Read-only.
Documentation/ABI/stable/sysfs-driver-scst_tgt_dev new file +29 -0
new file mode 100644
index 0000000..33a9221
@@ -0,0 +1,29 @@
+What:           /sys/bus/scst_tgt_dev/drivers/*/add_device_parameters
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Names of the parameters supported when adding a device. Each
+		parameter name appears on a separate line. Read-only.
+		An example:
+
+		$ cat /sys/bus/scst_tgt_dev/drivers/vdisk_fileio/add_device_parameters
+		filename
+		blocksize
+		write_through
+		nv_cache
+		o_direct
+		read_only
+		removable
+		thin_provisioned
+
+What:           /sys/bus/scst_tgt_dev/drivers/*/type
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		SCSI type of the devices managed by this driver. Read-only.
+		An example:
+
+		$ cat /sys/bus/scst_tgt_dev/drivers/vcdrom/type
+		5 - CD-ROM device
Signature · 1 line
1.7.1
#6 lore raw

Re: [PATCH 3/3] [SCSI] scst: Move SCST devices documentation to Documentation/ABI

Quoted 14 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +13 -0
+
+What:           /sys/bus/scst_tgt_dev/device/*/exported/export<nr>
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Zero or more soft links to the LUNs through which this device
+		has been exported. An example:
+
+		$ readlink /sys/bus/scst_tgt_dev/devices/disk01/exported/export0
+		../../scst_local_tgt/luns/0
+
+What:           /sys/bus/scst_tgt_dev/device/*/filename

Documentation/ABI/stable/sysfs-devices-scst_tgt_dev line 30

Quoted 10 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +10 -0
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		For virtual devices, the absolute path of the associated file
+		or device. Read-only. An example:
+
+		# cat /sys/devices/disk01/filename
+		/dev/sdc
+		[key]

Key?

Quoted 19 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +19 -0
+
+What:           /sys/bus/scst_tgt_dev/device/*/nv_cache
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Whether or not the device has a non-volatile cache. SCST uses
+		this information to decide whether or not it is safe to
+		acknowledge writes early to the initiator. Setting this
+		attribute to 1 for a device that neither has a non-volatile
+		cache nor an UPS will decrease I/O latency but may result in
+		data loss in case of a power failure. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/o_direct
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		The value 1 means that all caching has been disabled for

Documentation/ABI/stable/sysfs-devices-scst_tgt_dev line 59

Quoted 10 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +10 -0
+		a virtual device (direct I/O) and the value 0 means that caching
+		is enabled. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/read_only
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		For virtual devices, whether or not to deny write commands.
+		Read-only.

So earlier on (in o_direct) you mentioned the proper values (0 or 1). Would it make sense to have that here too?

Documentation/ABI/stable/sysfs-devices-scst_tgt_dev line 67

Quoted 8 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +8 -0
+
+What:           /sys/bus/scst_tgt_dev/device/*/removable
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		For virtual devices, whether or not the underlying storage
+		medium is removable. Read-only.

Ditto.

Documentation/ABI/stable/sysfs-devices-scst_tgt_dev line 75

Quoted 8 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +8 -0
+
+What:           /sys/bus/scst_tgt_dev/device/*/resync_size
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		For virtual devices, writing to this attribute will update the
+		internally cached device size. Write-only.

Is this in kB or bytes or pages?

Quoted 27 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +27 -0
+
+What:           /sys/bus/scst_tgt_dev/device/*/scsi_device
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		For SCSI devices, the device identification. Read-only. An
+		example:
+
+		$ cat /sys/bus/scst_tgt_dev/devices/1:0:0:0/scsi_device
+		1:0:0:0
+
+What:           /sys/bus/scst_tgt_dev/device/*/size_mb
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		For virtual devices, the internally cached size in MB of the
+		underlying storage device. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/t10_dev_id
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		SCSI device ID associated with the virtual device. This is the
+		ID reported e.g. via the Device Identification page (0x83) of

Documentation/ABI/stable/sysfs-devices-scst_tgt_dev line 112

Quoted 10 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +10 -0
+		the INQUIRY command. Read-write.
+
+What:           /sys/bus/scst_tgt_dev/device/*/thin_provisioned
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Whether or not the virtual device supports thin provisioning,
+		or in other words, that remote initiators can mark storage as
+		unallocated. Read-only.

Wouldn't you want to be able to toggle that? Say if the device does support thin provisioning but you want to disable it?

Quoted 5 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +5 -0
+
+What:           /sys/bus/scst_tgt_dev/device/*/threads_num
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]

Documentation/ABI/stable/sysfs-devices-scst_tgt_dev line 127

Quoted 10 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +10 -0
+Description:
+		Number of threads in the thread pool that is used for
+		processing SCSI commands for this device. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/threads_pool_type
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Whether to use a distinct thread pool per initiator

Whether would imply you can change the allocation. It sounds however you are just told what it is. Perhaps "What type of thread pool pool is used per initiator."?

Quoted 61 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +26 -0
+		("per_initiator") or one thread pool for all initiators
+		accessing this device ("shared"). Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/type
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		SCSI type of this device. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/usn
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Unique serial number as reported e.g. by the SCSI INQUIRY
+		response. Read-only.
+
+What:           /sys/bus/scst_tgt_dev/device/*/write_through
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Whether or not write-back caching has been disabled for a
+		virtual device. The value 0 stands for write-back mode and the
+		value 1 stands for write-through mode. Read-only.
(quoted diff) +0 -0

b/Documentation/ABI/stable/sysfs-driver-scst_tgt_dev new file mode 100644 index 0000000..33a9221

Documentation/ABI/stable/sysfs-driver-scst_tgt_dev new file +29 -0
@@ -0,0 +1,29 @@
+What:           /sys/bus/scst_tgt_dev/drivers/*/add_device_parameters
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		Names of the parameters supported when adding a device. Each
+		parameter name appears on a separate line. Read-only.
+		An example:
+
+		$ cat /sys/bus/scst_tgt_dev/drivers/vdisk_fileio/add_device_parameters
+		filename
+		blocksize
+		write_through
+		nv_cache
+		o_direct
+		read_only
+		removable
+		thin_provisioned
+
+What:           /sys/bus/scst_tgt_dev/drivers/*/type
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+		SCSI type of the devices managed by this driver. Read-only.
+		An example:
+
+		$ cat /sys/bus/scst_tgt_dev/drivers/vcdrom/type
+		5 - CD-ROM device
#7 lore raw

Re: [PATCH 3/3] [SCSI] scst: Move SCST devices documentation to Documentation/ABI

Quoted 27 lines · Konrad Rzeszutek Wilk
Quoted 14 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +13 -0
+
+What:           /sys/bus/scst_tgt_dev/device/*/exported/export<nr>
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+             Zero or more soft links to the LUNs through which this device
+             has been exported. An example:
+
+             $ readlink /sys/bus/scst_tgt_dev/devices/disk01/exported/export0
+             ../../scst_local_tgt/luns/0
+
+What:           /sys/bus/scst_tgt_dev/device/*/filename

Documentation/ABI/stable/sysfs-devices-scst_tgt_dev line 30

Quoted 10 lines
Documentation/ABI/stable/sysfs-devices-scst_tgt_dev new file +10 -0
+Date:           December 2010
+KernelVersion:  2.6.38
+Contact:        [email protected]
+Description:
+             For virtual devices, the absolute path of the associated file
+             or device. Read-only. An example:
+
+             # cat /sys/devices/disk01/filename
+             /dev/sdc
+             [key]

Key?

Quoted 1 line

[ ... ]

Hello Konrad,

Thanks for the feedback. I'll do by best to clarify the documentation according to your remarks.

Regarding the "[key]" indicator on the second line: that is an indicator that is either present or absent. That indicator is only used by a user-space tool (scstadmin) to find out which sysfs attributes differ from their default value. That indicator makes it possible to minimize the amount of information to be saved when making the SCST state persistent.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html