To work with SCST a target driver must register its template in SCST by
calling
-On initialization, qla2x00tgt registers its SCST template tgt2x_template
-in the SCST core. Then during template registration SCST core calls
-detect() callback which is function q2t_target_detect().
+On initialization, qla2x00tgt registers its callbacks in qla2xxx by
+calling q2t_target_driver_reg(), which calls
+qla2xxx_tgt_register_driver(). Qla2xxx_tgt_register_driver() stores the
+registered callbacks in variable qla_target.
-In this function qla2x00tgt registers its callbacks in qla2xxx by
-calling qla2xxx_tgt_register_driver(). Qla2xxx_tgt_register_driver()
-stores pointer to the being registered callbacks in variable qla_target.
-
-Then q2t_target_detect() calls qla2xxx_add_targets(), which calls for
-each known local FC port (HBA instance) qla_target.tgt_host_action()
-callback with ADD_TARGET action. Then q2t_host_action() calls
-q2t_add_target() which registers SCST target for this FC port.
+Qla2x00tgt then registers its SCST template tgt2x_template in the SCST
+core and calls qla2xxx_add_targets(). The latter calls, for each known
+local FC port (HBA instance), qla_target.tgt_host_action() with the
+ADD_TARGET action. Then q2t_host_action() calls q2t_add_target(), which
+registers the SCST target for this FC port.
If later a new FC port is hot added, qla2x00_probe_one() will also call
for all new local ports qla_target.tgt_host_action() with ADD_TARGET
@@ -1956,38 +1919,36 @@ are 3 types of builds:
-Logging levels management is done using "trace_level" file located in the
-driver's proc interface subdirectory. Each SCST driver has it, except in
-the perf build mode. For instance, for SCST core it's located in
-/proc/scsi_tgt/. For qla2x00t it's located in /proc/scsi_tgt/qla2x00tgt/.
+Logging levels are managed through "trace_level" sysfs attributes when
+tracing or debugging is compiled in. The SCST core attribute is
+
-SCST logging can produce huge amount of logging, which default kernel
-configuration can't cope with, so it needs some extra adjustments.
-
-For that you should change in lib/Kconfig.debug or init/Kconfig
-depending from your kernel version LOG_BUF_SHIFT from "12 21" to "12 25".
-
-Then you should in your .config set CONFIG_LOG_BUF_SHIFT to 25.
+SCST logging can produce a huge amount of output, so size the printk ring
+buffer using facilities supported by the exact target kernel. Current
+kernels document CONFIG_LOG_BUF_SHIFT and the log_buf_len boot parameter
+in Documentation/admin-guide/kernel-parameters.rst. Do not modify a
+kernel Kconfig limit solely to force a historical buffer size.
Also, Linux kernel has a lot of helpful debug facilities, like lockdep,
which allows to catch various deadlocks, or memory allocation debugging.
It is recommended to enable them during SCST debugging.
-The following options are recommended to be enabled (available depending
-from your kernel version): CONFIG_SLUB_DEBUG, CONFIG_PRINTK_TIME,
-CONFIG_MAGIC_SYSRQ, CONFIG_DEBUG_FS, CONFIG_DEBUG_KERNEL,
-CONFIG_DEBUG_SHIRQ, CONFIG_DETECT_SOFTLOCKUP, CONFIG_DETECT_HUNG_TASK,
-CONFIG_SLUB_DEBUG_ON, CONFIG_SLUB_STATS, CONFIG_DEBUG_PREEMPT,
-CONFIG_DEBUG_RT_MUTEXES, CONFIG_DEBUG_PI_LIST, CONFIG_DEBUG_SPINLOCK,
-CONFIG_DEBUG_MUTEXES, CONFIG_DEBUG_LOCK_ALLOC, CONFIG_PROVE_LOCKING,
-CONFIG_LOCKDEP, CONFIG_LOCK_STAT, CONFIG_DEBUG_SPINLOCK_SLEEP,
-CONFIG_STACKTRACE, CONFIG_DEBUG_BUGVERBOSE, CONFIG_DEBUG_VM,
-CONFIG_DEBUG_VIRTUAL, CONFIG_DEBUG_WRITECOUNT, CONFIG_DEBUG_MEMORY_INIT,
-CONFIG_DEBUG_LIST, CONFIG_DEBUG_SG, CONFIG_DEBUG_NOTIFIERS,
-CONFIG_FRAME_POINTER, CONFIG_FAULT_INJECTION, CONFIG_FAILSLAB,
-CONFIG_FAIL_PAGE_ALLOC, CONFIG_FAIL_MAKE_REQUEST,
-CONFIG_FAIL_IO_TIMEOUT, CONFIG_FAULT_INJECTION_DEBUG_FS,
-CONFIG_FAULT_INJECTION_STACKTRACE_FILTER.
+Select the lock, memory, watchdog, stack-trace and fault-injection
+facilities relevant to the problem from the target kernel's own Kconfig.
+Option names and dependencies differ across kernels supported by SCST;
+consult that kernel's Kconfig help and documentation instead of copying a
+fixed symbol list.
-It is recommended that you system logger daemon on the target configured:
-
-