Apparently the SCST code with debugging and/or tracing enabled compiles fine as

an external module. When applying the SCST kernel patch to the mainstream 
kernel tree with debugging and/or tracing enabled however, the resulting code
triggers a compiler error. This is because the symbols DEBUG and TRACING
conflict with symbols with the same named defined in unrelated kernel headers.
The patch below resolves these conflicts by renaming the following preprocessor 
symbols:
- DEBUG into CONFIG_SCST_DEBUG.
- DEBUG_DIGEST_FAILURES into CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES.
- DEBUG_OOM into CONFIG_SCST_DEBUG_OOM.
- DEBUG_RETRY into CONFIG_SCST_DEBUG_RETRY.
- DEBUG_SN into CONFIG_SCST_DEBUG_SN.
- DEBUG_TM into CONFIG_SCST_DEBUG_TM.
- EXTRACHECKS into CONFIG_SCST_EXTRACHECKS.
- SCST_HIGHMEM into CONFIG_SCST_HIGHMEM.
- STRICT_SERIALIZING into CONFIG_SCST_STRICT_SERIALIZING.
- TM_DBG_GO_OFFLINE into CONFIG_SCST_TM_DBG_GO_OFFLINE. Mapped 0/1 values
  into macro undefined / macro defined.
- TRACING into CONFIG_SCST_TRACING.
- USE_EXPECTED_VALUES into CONFIG_SCST_USE_EXPECTED_VALUES.
- In qla_isp/linux/isp_scst.c, renamed DEBUG into DEBUG_ISP_SCST.
- In qla_isp/..., renamed SCSI_TARGET in SCST_SCSI_TARGET.
- In qla_isp/..., renamed SCSI_TARGET_DEV in SCST_SCSI_TARGET_DEV.
Additionally, all CONFIG_SCSI_TARGET* macro's are renamed into CONFIG_SCST* in
order to avoid confusion between the STGT CONFIG-symbols and the SCST CONFIG-
symbols.

The following additional options are now configurable through Kconfig:
- CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
- CONFIG_SCST_STRICT_SERIALIZING
- CONFIG_SCST_STRICT_SECURITY
- CONFIG_SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
- CONFIG_SCST_ABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING
- CONFIG_SCST_USE_EXPECTED_VALUES
- CONFIG_SCST_DEBUG_OOM
- CONFIG_SCST_DEBUG_RETRY
- CONFIG_SCST_DEBUG_SN
- CONFIG_SCST_DEBUG_TM
- CONFIG_SCST_TM_DBG_GO_OFFLINE

The patch below has been verified as follows:
- Verified that the following command does not print any new warning messages:
  make -s clean && make -C srpt -s clean && make -s scst iscsi-scst && make -C srpt -s
- Verified as follows that the internal SCST patches still apply cleanly:
  for p in *patch; do patch -p0 --dry-run -f -s <$p; done
- Checked that the patch generated by generate-kernel-patch still applies
  cleanly to the 2.6.25.7 kernel, and that the patched kernel tree still
  compiles, installs and boots fine, that the iscsi-scst, ib_srpt,
  scst_disk and scst_vdisk modules still load, and that iSCSI communication
  still works fine. All SCST kernel configuration options that could be
  enabled have been enabled during this test.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@453 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2008-07-10 10:49:06 +00:00
parent 103d3412f0
commit cc28ddcdf2
49 changed files with 546 additions and 430 deletions
+6 -6
View File
@@ -6,11 +6,11 @@ Index: iscsi-scst/kernel/Makefile
EXTRA_CFLAGS += -I$(src)/../include -I$(SCST_INC_DIR)
# -Wextra -Wno-unused-parameter
-EXTRA_CFLAGS += -DEXTRACHECKS
+#EXTRA_CFLAGS += -DEXTRACHECKS
#EXTRA_CFLAGS += -DTRACING
-EXTRA_CFLAGS += -DDEBUG -g
+#EXTRA_CFLAGS += -DDEBUG -g
-EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
+#EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
-EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
+#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
#EXTRA_CFLAGS += -DDEBUG_DIGEST_FAILURES
#EXTRA_CFLAGS += -DCONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
+7 -7
View File
@@ -6,12 +6,12 @@ Index: iscsi-scst/kernel/Makefile
EXTRA_CFLAGS += -I$(src)/../include -I$(SCST_INC_DIR)
# -Wextra -Wno-unused-parameter
-EXTRA_CFLAGS += -DEXTRACHECKS
-#EXTRA_CFLAGS += -DTRACING
-EXTRA_CFLAGS += -DDEBUG -g
+#EXTRA_CFLAGS += -DEXTRACHECKS
+EXTRA_CFLAGS += -DTRACING
+#EXTRA_CFLAGS += -DDEBUG -g
-EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
-#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
-EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
+#EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
+EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
+#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
#EXTRA_CFLAGS += -DDEBUG_DIGEST_FAILURES
#EXTRA_CFLAGS += -DCONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
+7 -6
View File
@@ -162,16 +162,17 @@ Compilation options
There are the following compilation options, that could be commented
in/out in the kernel's module Makefile:
- DEBUG - turns on some debugging code, including some logging. Makes
the driver considerably bigger and slower, producing large amount of
- CONFIG_SCST_DEBUG - turns on some debugging code, including some logging.
Makes the driver considerably bigger and slower, producing large amount of
log data.
- TRACING - turns on ability to log events. Makes the driver considerably
bigger and lead to some performance loss.
- CONFIG_SCST_TRACING - turns on ability to log events. Makes the driver
considerably bigger and leads to some performance loss.
- EXTRACHECKS - adds extra validity checks in the various places.
- CONFIG_SCST_EXTRACHECKS - adds extra validity checks in the various places.
- DEBUG_DIGEST_FAILURES - simulates digest failures in random places.
- CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES - simulates digest failures in
random places.
Creating version of put_page_callback patch for your kernel
-----------------------------------------------------------
+19 -2
View File
@@ -1,5 +1,22 @@
config SCST_ISCSI
tristate "SCST iSCSI Support"
depends on SCSI
---help---
iSCSI target support. The iSCSI protocol has been defined in RFC 3720.
help
iSCSI target support. The iSCSI protocol has been defined in
RFC 3720.
config SCST_ISCSI_DEBUG_DIGEST_FAILURES
bool "Simulate iSCSI digest failures"
depends on SCST_ISCSI
help
Simulates iSCSI digest failures in random places. Even when iSCSI
traffic is sent over a TCP connection, the 16-bit TCP checksum is too
weak for the requirements of a storage protocol. Furthermore, there
are also instances where the TCP checksum does not protect iSCSI
data, as when data is corrupted while being transferred on a PCI bus
or while in memory. The iSCSI protocol therefore defines a 32-bit CRC
digest on iSCSI packets in order to detect data corruption on an
end-to-end basis. CRCs can be used on iSCSI PDU headers and/or data.
Enabling this option allows to test digest failure recovery in the
iSCSI initiator that is talking to SCST. If unsure, disable this
option.
+4 -4
View File
@@ -23,11 +23,11 @@
EXTRA_CFLAGS += -I$(src)/../include -I$(SCST_INC_DIR)
# -Wextra -Wno-unused-parameter
EXTRA_CFLAGS += -DEXTRACHECKS
#EXTRA_CFLAGS += -DTRACING
EXTRA_CFLAGS += -DDEBUG -g
EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
#EXTRA_CFLAGS += -DDEBUG_DIGEST_FAILURES
#EXTRA_CFLAGS += -DCONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
obj-m += iscsi-scst.o
iscsi-scst-objs := iscsi.o nthread.o config.o digest.o \
+11 -11
View File
@@ -19,7 +19,7 @@
#define ISCSI_PROC_VERSION_NAME "version"
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
#define ISCSI_PROC_LOG_ENTRY_NAME "trace_level"
@@ -71,19 +71,19 @@ static int iscsi_version_info_show(struct seq_file *seq, void *v)
seq_printf(seq, "%s\n", ISCSI_VERSION_STRING);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
seq_printf(seq, "EXTRACHECKS\n");
#endif
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
seq_printf(seq, "TRACING\n");
#endif
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
seq_printf(seq, "DEBUG\n");
#endif
#ifdef DEBUG_DIGEST_FAILURES
#ifdef CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
seq_printf(seq, "DEBUG_DIGEST_FAILURES\n");
#endif
@@ -96,7 +96,7 @@ static struct scst_proc_data iscsi_version_proc_data = {
.show = iscsi_version_info_show,
};
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
static struct scst_proc_data iscsi_log_proc_data = {
SCST_DEF_RW_SEQ_OP(iscsi_proc_log_entry_write)
.show = iscsi_log_info_show,
@@ -122,7 +122,7 @@ static __init int iscsi_proc_log_entry_build(struct scst_tgt_template *templ)
goto out;
}
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
/* create the proc file entry for the device */
iscsi_log_proc_data.data = (void *)templ->name;
p = scst_create_proc_entry(root, ISCSI_PROC_LOG_ENTRY_NAME,
@@ -141,7 +141,7 @@ out:
TRACE_EXIT_RES(res);
return res;
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
out_remove_ver:
remove_proc_entry(ISCSI_PROC_VERSION_NAME, root);
goto out;
@@ -156,7 +156,7 @@ static void iscsi_proc_log_entry_clean(struct scst_tgt_template *templ)
root = scst_proc_get_tgt_root(templ);
if (root) {
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
remove_proc_entry(ISCSI_PROC_LOG_ENTRY_NAME, root);
#endif
remove_proc_entry(ISCSI_PROC_VERSION_NAME, root);
@@ -540,7 +540,7 @@ struct file_operations ctr_fops = {
.release = release,
};
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
void iscsi_dump_iov(struct msghdr *msg)
{
if (trace_flag & TRACE_D_IOV) {
@@ -604,4 +604,4 @@ void iscsi_dump_pdu(struct iscsi_pdu *pdu)
printk("Data: (%d)\n", pdu->datasize);
}
}
#endif /* DEBUG */
#endif /* CONFIG_SCST_DEBUG */
+2 -2
View File
@@ -447,7 +447,7 @@ int conn_del(struct iscsi_session *session, struct conn_info *info)
return 0;
}
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
void iscsi_extracheck_is_rd_thread(struct iscsi_conn *conn)
{
@@ -477,4 +477,4 @@ void iscsi_extracheck_is_wr_thread(struct iscsi_conn *conn)
}
}
#endif /* EXTRACHECKS */
#endif /* CONFIG_SCST_EXTRACHECKS */
+1 -1
View File
@@ -61,7 +61,7 @@ static u32 evaluate_crc32_from_sg(struct scatterlist *sg, int total,
{
u32 crc = ~0;
#ifdef DEBUG_DIGEST_FAILURES
#ifdef CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
if (((scst_random() % 100000) == 752)) {
PRINT_INFO("%s", "Simulating digest failure");
return 0;
+9 -9
View File
@@ -36,7 +36,7 @@ static int ctr_major;
static char ctr_name[] = "iscsi-scst-ctl";
static int iscsi_template_registered;
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
unsigned long iscsi_trace_flag = ISCSI_DEFAULT_LOG_FLAGS;
#endif
@@ -276,7 +276,7 @@ void cmnd_done(struct iscsi_cmnd *cmnd)
if (cmnd->own_sg) {
TRACE_DBG("%s", "own_sg");
scst_free(cmnd->sg, cmnd->sg_cnt);
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
cmnd->own_sg = 0;
cmnd->sg = NULL;
cmnd->sg_cnt = -1;
@@ -289,7 +289,7 @@ void cmnd_done(struct iscsi_cmnd *cmnd)
"new value %d)", cmnd, sess,
atomic_read(&sess->active_cmds)-1);
atomic_dec(&sess->active_cmds);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if (unlikely(atomic_read(&sess->active_cmds) < 0)) {
PRINT_CRIT_ERROR("active_cmds < 0 (%d)!!",
atomic_read(&sess->active_cmds));
@@ -392,7 +392,7 @@ void req_cmnd_release(struct iscsi_cmnd *req)
TRACE_DBG("%p", req);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
sBUG_ON(req->release_called);
req->release_called = 1;
#endif
@@ -420,7 +420,7 @@ void req_cmnd_release(struct iscsi_cmnd *req)
atomic_read(&sess->active_cmds)-1);
atomic_dec(&sess->active_cmds);
req->dec_active_cmnds = 0;
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if (unlikely(atomic_read(&sess->active_cmds) < 0)) {
PRINT_CRIT_ERROR("active_cmds < 0 (%d)!!",
atomic_read(&sess->active_cmds));
@@ -443,7 +443,7 @@ void rsp_cmnd_release(struct iscsi_cmnd *cmnd)
{
TRACE_DBG("%p", cmnd);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
sBUG_ON(cmnd->release_called);
cmnd->release_called = 1;
#endif
@@ -2507,7 +2507,7 @@ static void iscsi_try_local_processing(struct iscsi_conn *conn,
list_del(&conn->wr_list_entry);
/* go through */
case ISCSI_CONN_WR_STATE_IDLE:
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
conn->wr_task = current;
#endif
conn->wr_state = ISCSI_CONN_WR_STATE_PROCESSING;
@@ -2529,7 +2529,7 @@ static void iscsi_try_local_processing(struct iscsi_conn *conn,
}
spin_lock_bh(&iscsi_wr_lock);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
conn->wr_task = NULL;
#endif
if ((rc <= 0) || test_write_ready(conn)) {
@@ -2661,7 +2661,7 @@ static int iscsi_xmit_response(struct scst_cmd *scst_cmd)
}
iscsi_cmnd_init_write(rsp, ISCSI_INIT_WRITE_REMOVE_HASH);
}
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
else
sBUG();
#endif
+6 -6
View File
@@ -160,7 +160,7 @@ struct iscsi_conn {
struct list_head wr_list_entry;
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
struct task_struct *wr_task;
#endif
@@ -195,7 +195,7 @@ struct iscsi_conn {
struct list_head rd_list_entry;
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
struct task_struct *rd_task;
#endif
@@ -258,7 +258,7 @@ struct iscsi_cmnd {
unsigned int ddigest_checked:1;
unsigned int rejected:1;
unsigned int reject_reason:2;
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
unsigned int on_rx_digest_list:1;
unsigned int release_called:1;
#endif
@@ -498,7 +498,7 @@ static inline void cmd_add_on_rx_ddigest_list(struct iscsi_cmnd *req,
"of req %p", cmnd, req);
list_add_tail(&cmnd->rx_ddigest_cmd_list_entry,
&req->rx_ddigest_cmd_list);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
cmnd->on_rx_digest_list = 1;
#endif
}
@@ -507,7 +507,7 @@ static inline void cmd_del_from_rx_ddigest_list(struct iscsi_cmnd *cmnd)
{
TRACE_DBG("Deleting RX digest cmd %p from digest list", cmnd);
list_del(&cmnd->rx_ddigest_cmd_list_entry);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
cmnd->on_rx_digest_list = 0;
#endif
}
@@ -548,7 +548,7 @@ static inline void conn_put(struct iscsi_conn *conn)
atomic_dec(&conn->conn_ref_cnt);
}
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
extern void iscsi_extracheck_is_rd_thread(struct iscsi_conn *conn);
extern void iscsi_extracheck_is_wr_thread(struct iscsi_conn *conn);
#else
+5 -5
View File
@@ -32,7 +32,7 @@
#define TRACE_ALL_NO_DATA (TRACE_ALL & ~TRACE_D_IOV & ~TRACE_D_DUMP_PDU & ~TRACE_D_DATA)
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
#define ISCSI_DEFAULT_LOG_FLAGS (TRACE_FUNCTION | TRACE_LINE | TRACE_PID | \
TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_MGMT_MINOR | TRACE_MGMT_DEBUG | \
TRACE_MINOR | TRACE_SPECIAL | TRACE_CONN_OC)
@@ -41,7 +41,7 @@
TRACE_MINOR | TRACE_SPECIAL)
#endif
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
struct msghdr;
struct iscsi_pdu;
extern void iscsi_dump_iov(struct msghdr *msg);
@@ -51,12 +51,12 @@ extern void iscsi_dump_pdu(struct iscsi_pdu *pdu);
#define iscsi_dump_pdu(x) do {} while (0)
#endif
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
extern unsigned long iscsi_trace_flag;
#define trace_flag iscsi_trace_flag
#endif
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
#define TRACE_CONN_CLOSE(args...) TRACE(TRACE_CONN_OC, args)
#define TRACE_CONN_CLOSE_DBG(args...) TRACE(TRACE_CONN_OC_DBG, args)
@@ -64,7 +64,7 @@ extern unsigned long iscsi_trace_flag;
#define TRACE_WRITE(args...) TRACE(TRACE_D_WRITE, args)
#define TRACE_READ(args...) TRACE(TRACE_D_READ, args)
#else /* DEBUG */
#else /* CONFIG_SCST_DEBUG */
#define TRACE_CONN_CLOSE(format, args...) {}
#define TRACE_CONN_CLOSE_DBG(format, args...) {}
#define TRACE_NET_PAGE(format, args...) {}
+8 -8
View File
@@ -365,7 +365,7 @@ static void close_conn(struct iscsi_conn *conn)
TRACE_CONN_CLOSE_DBG("conn %p, conn_ref_cnt %d left, wr_state %d, "
"exp_cmd_sn %u", conn, atomic_read(&conn->conn_ref_cnt),
conn->wr_state, session->exp_cmd_sn);
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
{
#ifdef NET_PAGE_CALLBACKS_DEFINED
struct iscsi_cmnd *rsp;
@@ -467,7 +467,7 @@ static int close_conn_thr(void *arg)
TRACE_ENTRY();
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
conn->rd_task = current;
#endif
close_conn(conn);
@@ -782,7 +782,7 @@ static void scst_do_job_rd(void)
sBUG_ON(conn->rd_state == ISCSI_CONN_RD_STATE_PROCESSING);
conn->rd_data_ready = 0;
conn->rd_state = ISCSI_CONN_RD_STATE_PROCESSING;
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
conn->rd_task = current;
#endif
spin_unlock_bh(&iscsi_rd_lock);
@@ -794,7 +794,7 @@ static void scst_do_job_rd(void)
if (closed)
continue;
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
conn->rd_task = NULL;
#endif
if ((rc == 0) || conn->rd_data_ready) {
@@ -1165,7 +1165,7 @@ out_res:
/* else go through */
out_err:
#ifndef DEBUG
#ifndef CONFIG_SCST_DEBUG
if (!conn->closing)
#endif
{
@@ -1189,7 +1189,7 @@ static int exit_tx(struct iscsi_conn *conn, int res)
res = 0;
break;
default:
#ifndef DEBUG
#ifndef CONFIG_SCST_DEBUG
if (!conn->closing)
#endif
{
@@ -1379,7 +1379,7 @@ static void scst_do_job_wr(void)
conn->wr_state = ISCSI_CONN_WR_STATE_PROCESSING;
conn->wr_space_ready = 0;
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
conn->wr_task = current;
#endif
spin_unlock_bh(&iscsi_wr_lock);
@@ -1389,7 +1389,7 @@ static void scst_do_job_wr(void)
rc = process_write_queue(conn);
spin_lock_bh(&iscsi_wr_lock);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
conn->wr_task = NULL;
#endif
if ((rc == -EAGAIN) && !conn->wr_space_ready) {
+3 -3
View File
@@ -29,9 +29,9 @@ FUSION_INC_DIR := drivers/message/fusion
EXTRA_CFLAGS += -I$(SCST_INC_DIR) -I$(FUSION_INC_DIR) -Iinclude/scsi
EXTRA_CFLAGS += -DEXTRACHECKS
#EXTRA_CFLAGS += -DTRACING
EXTRA_CFLAGS += -DDEBUG
EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG
#EXTRA_CFLAGS += -DDEBUG_WORK_IN_THREAD
ifeq ($(KVER),)
+3 -3
View File
@@ -2,9 +2,9 @@ SCST_INC_DIR := include/scst
FUSION_INC_DIR := drivers/message/fusion
EXTRA_CFLAGS += -I$(SCST_INC_DIR) -I$(FUSION_INC_DIR) -Iinclude/scsi
EXTRA_CFLAGS += -DEXTRACHECKS
#EXTRA_CFLAGS += -DTRACING
EXTRA_CFLAGS += -DDEBUG
EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG
#EXTRA_CFLAGS += -DDEBUG_WORK_IN_THREAD
obj-$(CONFIG_FUSION_SCST) += mpt_scst.o
+25 -25
View File
@@ -44,14 +44,14 @@
#define MYNAM "mpt_scst"
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
static int trace_mpi = 0;
#define TRACE_MPI 0x80000000
#endif
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
static char *mpt_state_string[] = {
"0",
"new",
@@ -63,12 +63,12 @@ static char *mpt_state_string[] = {
};
#endif
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
#define SCST_DEFAULT_MPT_LOG_FLAGS (TRACE_FUNCTION | TRACE_PID | \
TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_MGMT_MINOR | \
TRACE_MGMT_DEBUG | TRACE_MINOR | TRACE_SPECIAL)
#else
# ifdef TRACING
# ifdef CONFIG_SCST_TRACING
#define SCST_DEFAULT_MPT_LOG_FLAGS (TRACE_FUNCTION | TRACE_PID | \
TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_MINOR | TRACE_SPECIAL)
# endif
@@ -126,11 +126,11 @@ static void stmapp_srr_process(MPT_STM_PRIV *priv, int rx_id, int r_ctl,
u32 offset, LinkServiceBufferPostReply_t *rep, int index);
static void stm_set_scsi_port_page1(MPT_STM_PRIV *priv, int sleep);
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
#define trace_flag mpt_trace_flag
unsigned long mpt_trace_flag = TRACE_FUNCTION | TRACE_OUT_OF_MEM | TRACE_SPECIAL;
#else
# ifdef TRACING
# ifdef CONFIG_SCST_TRACING
#define trace_flag mpt_trace_flag
unsigned long mpt_trace_flag = TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_SPECIAL;
# endif
@@ -475,7 +475,7 @@ _stm_target_command(MPT_STM_PRIV *priv, int reply_word,
CMD *cmd;
struct scst_cmd *scst_cmd;
struct mpt_sess *sess = mpt_cmd->sess;
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
MPT_ADAPTER *ioc = priv->ioc;
#endif
/*
@@ -1300,7 +1300,7 @@ mpt_send_tgt_data(MPT_STM_PRIV *priv, u32 reply_word,
cpu_to_le32(MPI_SGE_SET_FLAGS(MPI_SGE_FLAGS_LAST_ELEMENT |
MPI_SGE_FLAGS_END_OF_BUFFER |
MPI_SGE_FLAGS_END_OF_LIST));
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
if(trace_mpi)
{
u32 *p = (u32 *)req;
@@ -2793,7 +2793,7 @@ stm_link_service_reply(MPT_ADAPTER *ioc, LinkServiceBufferPostReply_t *rep)
}
}
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
if(trace_mpi)
{
u32 *p = (u32 *)rep;
@@ -2900,7 +2900,7 @@ stm_cmd_buf_post(MPT_STM_PRIV *priv, int index)
priv->io_state[index] |= IO_STATE_POSTED;
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
if(trace_mpi) {
u32 *p = (u32 *)req;
int i;
@@ -2958,7 +2958,7 @@ stm_cmd_buf_post_base(MPT_STM_PRIV *priv,
}
}
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
if(trace_mpi)
{
u32 *p = (u32 *)req;
@@ -2995,7 +2995,7 @@ stm_cmd_buf_post_list(MPT_STM_PRIV *priv,
priv->io_state[index] |= IO_STATE_POSTED;
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
if(trace_mpi)
{
u32 *p = (u32 *)req;
@@ -3046,7 +3046,7 @@ stm_link_serv_buf_post(MPT_STM_PRIV *priv, int index)
((u8 *)priv->hw->fc_link_serv_buf[index].fc_els - (u8 *)priv->hw);
stm_set_dma_addr(sge_simple->Address, dma_addr);
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
if(trace_mpi)
{
u32 *p = (u32 *)req;
@@ -3212,7 +3212,7 @@ stm_send_target_status(MPT_STM_PRIV *priv,
}
priv->io_state[index] |= IO_STATE_STATUS_SENT;
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
if(trace_mpi)
{
u32 *p = (u32 *)req;
@@ -3269,7 +3269,7 @@ stm_send_els(MPT_STM_PRIV *priv,
p_index = (int *)(sge_simple + 1);
*p_index = index;
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
if(trace_mpi)
{
u32 *p = (u32 *)req;
@@ -3406,7 +3406,7 @@ stm_target_mode_abort_all(MPT_STM_PRIV *priv)
static int
stm_target_mode_abort(MPT_STM_PRIV *priv)
{
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
MPT_ADAPTER *ioc = priv->ioc;
#endif
int i;
@@ -3794,7 +3794,7 @@ static int
stm_scsi_configuration(MPT_STM_PRIV *priv,
int sleep)
{
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
MPT_ADAPTER *ioc = priv->ioc;
#endif
SCSIPortPage0_t *ScsiPort0;
@@ -3875,7 +3875,7 @@ stm_scsi_configuration(MPT_STM_PRIV *priv,
static void
stm_set_scsi_port_page1(MPT_STM_PRIV *priv, int sleep)
{
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
MPT_ADAPTER *ioc = priv->ioc;
#endif
SCSIPortPage1_t *ScsiPort1;
@@ -4268,7 +4268,7 @@ stm_get_config_page(MPT_STM_PRIV *priv, int type, int number, int address,
return (-1);
}
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
if(trace_mpi)
{
u32 *p = (u32 *)priv->hw->config_buf;
@@ -4375,7 +4375,7 @@ stm_set_config_page(MPT_STM_PRIV *priv,
return (-1);
}
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
if(trace_mpi)
{
u32 *p = (u32 *)priv->hw->config_buf;
@@ -4837,7 +4837,7 @@ static void
stmapp_abts_process(MPT_STM_PRIV *priv,
int rx_id, LinkServiceBufferPostReply_t *rep, int index)
{
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
MPT_ADAPTER *ioc = priv->ioc;
#endif
volatile int *io_state;
@@ -4886,7 +4886,7 @@ static void
stmapp_srr_process(MPT_STM_PRIV *priv, int rx_id, int r_ctl, u32 offset,
LinkServiceBufferPostReply_t *rep, int index)
{
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
MPT_ADAPTER *ioc = priv->ioc;
#endif
FC_ELS *fc_els_buf;
@@ -5450,7 +5450,7 @@ stmapp_set_sense_info(MPT_STM_PRIV *priv,
TRACE_EXIT();
}
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
#define MPT_PROC_LOG_ENTRY_NAME "trace_level"
@@ -5491,7 +5491,7 @@ static struct scst_proc_data mpt_log_proc_data = {
static int mpt_proc_log_entry_build(struct scst_tgt_template *templ)
{
int res = 0;
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
struct proc_dir_entry *p, *root;
TRACE_ENTRY();
@@ -5520,7 +5520,7 @@ out:
static void mpt_proc_log_entry_clean(struct scst_tgt_template *templ)
{
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
struct proc_dir_entry *root;
TRACE_ENTRY();
+3 -3
View File
@@ -6,9 +6,9 @@ Index: qla2x00t/qla2x00-target/Makefile
INSTALL_DIR := /lib/modules/$(shell uname -r)/extra
-EXTRA_CFLAGS += -DEXTRACHECKS
+#EXTRA_CFLAGS += -DEXTRACHECKS
#EXTRA_CFLAGS += -DTRACING
-EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
+#EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
-EXTRA_CFLAGS += -DDEBUG_TGT -g
+#EXTRA_CFLAGS += -DDEBUG_TGT -g
#EXTRA_CFLAGS += -DDEBUG_WORK_IN_THREAD
+4 -4
View File
@@ -6,11 +6,11 @@ Index: qla2x00t/qla2x00-target/Makefile
INSTALL_DIR := /lib/modules/$(shell uname -r)/extra
-EXTRA_CFLAGS += -DEXTRACHECKS
-#EXTRA_CFLAGS += -DTRACING
-EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
-#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
-EXTRA_CFLAGS += -DDEBUG_TGT -g
+#EXTRA_CFLAGS += -DEXTRACHECKS
+EXTRA_CFLAGS += -DTRACING
+#EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
+EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
+#EXTRA_CFLAGS += -DDEBUG_TGT -g
#EXTRA_CFLAGS += -DDEBUG_WORK_IN_THREAD
+2 -2
View File
@@ -35,8 +35,8 @@ EXTRA_CFLAGS += -I$(SCST_INC_DIR) -DFC_TARGET_SUPPORT
INSTALL_DIR := /lib/modules/$(shell uname -r)/extra
EXTRA_CFLAGS += -DEXTRACHECKS
#EXTRA_CFLAGS += -DTRACING
EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
EXTRA_CFLAGS += -DDEBUG_TGT -g
#EXTRA_CFLAGS += -DDEBUG_WORK_IN_THREAD
+2 -2
View File
@@ -84,8 +84,8 @@ in/out in Makefile:
the driver considerably bigger and slower, producing large amount of
log data.
- TRACING - turns on ability to log events. Makes the driver considerably
bigger and lead to some performance loss.
- CONFIG_SCST_TRACING - turns on ability to log events. Makes the driver
considerably bigger and leads to some performance loss.
- DEBUG_WORK_IN_THREAD - makes SCST process incoming commands and
call the driver's callbacks in SCST thread context instead of tasklet
+6 -6
View File
@@ -47,12 +47,12 @@
#error "FC_TARGET_SUPPORT is NOT DEFINED"
#endif
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
#define Q2T_DEFAULT_LOG_FLAGS (TRACE_FUNCTION | TRACE_PID | \
TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_MGMT_MINOR | \
TRACE_MGMT_DEBUG | TRACE_MINOR | TRACE_SPECIAL)
#else
# ifdef TRACING
# ifdef CONFIG_SCST_TRACING
#define Q2T_DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_MINOR | \
TRACE_SPECIAL)
# endif
@@ -79,7 +79,7 @@ static void q2t_send_term_exchange(scsi_qla_host_t *ha, struct q2t_cmd *cmd,
* Global Variables
*/
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
#define trace_flag q2t_trace_flag
unsigned long q2t_trace_flag = Q2T_DEFAULT_LOG_FLAGS;
#endif
@@ -2135,7 +2135,7 @@ out:
return;
}
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
#define Q2T_PROC_LOG_ENTRY_NAME "trace_level"
@@ -2176,7 +2176,7 @@ static struct scst_proc_data q2t_log_proc_data = {
static int q2t_proc_log_entry_build(struct scst_tgt_template *templ)
{
int res = 0;
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
struct proc_dir_entry *p, *root;
TRACE_ENTRY();
@@ -2205,7 +2205,7 @@ out:
static void q2t_proc_log_entry_clean(struct scst_tgt_template *templ)
{
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
struct proc_dir_entry *root;
TRACE_ENTRY();
+1 -4
View File
@@ -26,11 +26,8 @@
#include <qla_def.h>
#include "qla2x_tgt_def.h"
/* Undefine the initiator driver's own DEBUG symbol */
#undef DEBUG
#ifdef DEBUG_TGT
#define DEBUG
#define CONFIG_SCST_DEBUG
#endif
#include <scst_debug.h>
+16 -16
View File
@@ -4,22 +4,22 @@ Index: scst/src/Makefile
+++ scst/src/Makefile (working copy)
@@ -115,7 +115,7 @@ EXTRA_CFLAGS += -I$(SCST_INC_DIR) -Wextr
#EXTRA_CFLAGS += -DSTRICT_SERIALIZING
#EXTRA_CFLAGS += -DCONFIG_SCST_STRICT_SERIALIZING
-EXTRA_CFLAGS += -DEXTRACHECKS
+#EXTRA_CFLAGS += -DEXTRACHECKS
-EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
+#EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DUSE_EXPECTED_VALUES
#EXTRA_CFLAGS += -DCONFIG_SCST_USE_EXPECTED_VALUES
#EXTRA_CFLAGS += -DALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
@@ -125,7 +125,7 @@ EXTRA_CFLAGS += -DEXTRACHECKS
@@ -124,7 +124,7 @@ EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DTRACING
#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
-EXTRA_CFLAGS += -DDEBUG -g
+#EXTRA_CFLAGS += -DDEBUG -g
#EXTRA_CFLAGS += -DDEBUG_TM -DTM_DBG_GO_OFFLINE=0
#EXTRA_CFLAGS += -DDEBUG_RETRY
#EXTRA_CFLAGS += -DDEBUG_OOM
-EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
+#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG_TM -UCONFIG_SCST_TM_DBG_GO_OFFLINE
#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG_RETRY
#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG_OOM
Index: scst/src/dev_handlers/Makefile
===================================================================
--- scst/src/dev_handlers/Makefile (revision 230)
@@ -28,12 +28,12 @@ Index: scst/src/dev_handlers/Makefile
EXTRA_CFLAGS += -I$(SUBDIRS) -I$(SCST_INC_DIR) -Wextra -Wno-unused-parameter
-EXTRA_CFLAGS += -DEXTRACHECKS
+#EXTRA_CFLAGS += -DEXTRACHECKS
-EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
+#EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DTRACING
-EXTRA_CFLAGS += -DDEBUG -g
+#EXTRA_CFLAGS += -DDEBUG -g
#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
-EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
+#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
clean:
rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend Modules.symvers \
+18 -18
View File
@@ -4,25 +4,25 @@ Index: scst/src/Makefile
+++ scst/src/Makefile (working copy)
@@ -115,7 +115,7 @@ EXTRA_CFLAGS += -I$(SCST_INC_DIR) -Wextr
#EXTRA_CFLAGS += -DSTRICT_SERIALIZING
#EXTRA_CFLAGS += -DCONFIG_SCST_STRICT_SERIALIZING
-EXTRA_CFLAGS += -DEXTRACHECKS
+#EXTRA_CFLAGS += -DEXTRACHECKS
-EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
+#EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DUSE_EXPECTED_VALUES
#EXTRA_CFLAGS += -DCONFIG_SCST_USE_EXPECTED_VALUES
#EXTRA_CFLAGS += -DALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
@@ -123,9 +123,9 @@ EXTRA_CFLAGS += -DEXTRACHECKS
@@ -122,9 +122,9 @@ EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -fno-inline
-#EXTRA_CFLAGS += -DTRACING
+EXTRA_CFLAGS += -DTRACING
-#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
+EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
-EXTRA_CFLAGS += -DDEBUG -g
+#EXTRA_CFLAGS += -DDEBUG -g
#EXTRA_CFLAGS += -DDEBUG_TM -DTM_DBG_GO_OFFLINE=0
#EXTRA_CFLAGS += -DDEBUG_RETRY
#EXTRA_CFLAGS += -DDEBUG_OOM
-EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
+#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG_TM -UCONFIG_SCST_TM_DBG_GO_OFFLINE
#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG_RETRY
#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG_OOM
Index: scst/src/dev_handlers/Makefile
===================================================================
--- scst/src/dev_handlers/Makefile (revision 230)
@@ -31,13 +31,13 @@ Index: scst/src/dev_handlers/Makefile
EXTRA_CFLAGS += -I$(SUBDIRS) -I$(SCST_INC_DIR) -Wextra -Wno-unused-parameter
-EXTRA_CFLAGS += -DEXTRACHECKS
+#EXTRA_CFLAGS += -DEXTRACHECKS
-EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
+#EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
-#EXTRA_CFLAGS += -DTRACING
-EXTRA_CFLAGS += -DDEBUG -g
+EXTRA_CFLAGS += -DTRACING
+#EXTRA_CFLAGS += -DDEBUG -g
-#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
-EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
+EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
+#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
clean:
rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend Modules.symvers \
+3 -3
View File
@@ -97,7 +97,7 @@ Summary of changes between versions 0.9.4 and 0.9.5
---------------------------------------------------
- Fixed many found task management related problems, especially in the
RESETs area. DEBUG_TM compilation option added (see README).
RESETs area. CONFIG_SCST_DEBUG_TM compilation option added (see README).
- Updated to work on kernels version 2.6.18+.
@@ -198,8 +198,8 @@ Summary of changes between versions 0.9.3-pre1 and 0.9.3-pre2
- UA generating after MODE SELECT and LOG SELECT implemented
- STRICT_SERIALIZING compile-time option added for those who need most
robust task management and willing to pay some performance cost for
- CONFIG_SCST_STRICT_SERIALIZING compile-time option added for those who need
the most robust task management and willing to pay some performance cost for
that (see README)
- IRQ spinlocks were replaced by BH ones, where appropriate.
+33 -31
View File
@@ -64,7 +64,7 @@ new functions scsi_do_req_fifo()/scsi_execute_async_fifo() to be added
in the kernel. Patch scst_exec_req_fifo.patch from "kernel" directory
does that. If it doesn't apply to your kernel, apply it manually, it
only adds one of those functions and nothing more. You may not patch the
kernel if you don't need pass-through support or STRICT_SERIALIZING is
kernel if you don't need pass-through support or CONFIG_SCST_STRICT_SERIALIZING is
defined during the compilation (see description below).
To compile SCST type 'make scst'. It will build SCST itself and its
@@ -184,24 +184,24 @@ Compilation options
There are the following compilation options, that could be commented
in/out in Makefile:
- DEBUG - if defined, turns on some debugging code, including some
logging. Makes the driver considerably bigger and slower, producing
large amount of log data.
- CONFIG_SCST_DEBUG - if defined, turns on some debugging code,
including some logging. Makes the driver considerably bigger and slower,
producing large amount of log data.
- TRACING - if defined, turns on ability to log events. Makes the
driver considerably bigger and lead to some performance loss.
- CONFIG_SCST_TRACING - if defined, turns on ability to log events. Makes the
driver considerably bigger and leads to some performance loss.
- EXTRACHECKS - if defined, adds extra validity checks in the various
places.
- CONFIG_SCST_EXTRACHECKS - if defined, adds extra validity checks in
the various places.
- USE_EXPECTED_VALUES - if not defined (default), initiator supplied
expected data transfer length and direction will be used only for
- CONFIG_SCST_USE_EXPECTED_VALUES - if not defined (default), initiator
supplied expected data transfer length and direction will be used only for
verification purposes to return error or warn in case if one of them
is invalid. Instead, locally decoded from SCSI command values will be
used. This is necessary for security reasons, because otherwise a
faulty initiator can crash target by supplying invalid value in one
of those parameters. This is especially important in case of
pass-through mode. If USE_EXPECTED_VALUES is defined, initiator
pass-through mode. If CONFIG_SCST_USE_EXPECTED_VALUES is defined, initiator
supplied expected data transfer length and direction will override
the locally decoded values. This might be necessary if internal SCST
commands translation table doesn't contain SCSI command, which is
@@ -212,16 +212,16 @@ in/out in Makefile:
scst-devel@lists.sourceforge.net. Note, that not all SCSI transports
support supplying expected values.
- DEBUG_TM - if defined, turns on task management functions debugging,
when on LUN 0 in the default access control group some of the
- CONFIG_SCST_DEBUG_TM - if defined, turns on task management functions
debugging, when on LUN 0 in the default access control group some of the
commands will be delayed for about 60 sec., so making the remote
initiator send TM functions, eg ABORT TASK and TARGET RESET. Also
define TM_DBG_GO_OFFLINE symbol in the Makefile to 1 if you want that
the device eventually become completely unresponsive, or to 0
otherwise to circle around ABORTs and RESETs code. Needs DEBUG turned
on.
define CONFIG_SCST_TM_DBG_GO_OFFLINE symbol in the Makefile if you
want that the device eventually become completely unresponsive, or
otherwise to circle around ABORTs and RESETs code. Needs CONFIG_SCST_DEBUG
turned on.
- STRICT_SERIALIZING - if defined, makes SCST send all commands to
- CONFIG_SCST_STRICT_SERIALIZING - if defined, makes SCST send all commands to
underlying SCSI device synchronously, one after one. This makes task
management more reliable, with cost of some performance penalty. This
is mostly actual for stateful SCSI devices like tapes, where the
@@ -233,8 +233,8 @@ in/out in Makefile:
need as much error recovery reliability as possible. As a side
effect, no kernel patching is necessary.
- ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ - if defined, it will be allowed
to submit pass-through commands to real SCSI devices via the SCSI
- CONFIG_SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ - if defined, it will be
allowed to submit pass-through commands to real SCSI devices via the SCSI
middle layer using scsi_execute_async() function from soft IRQ
context (tasklets). This used to be the default, but currently it
seems the SCSI middle layer starts expecting only thread context on
@@ -245,20 +245,20 @@ in/out in Makefile:
scsi_execute_async() function, you will get a warning message in the
kernel log.
- SCST_HIGHMEM - if defined on HIGHMEM systems with 2.6 kernels, it
- CONFIG_SCST_HIGHMEM - if defined on HIGHMEM systems with 2.6 kernels, it
allows SCST to use HIGHMEM. This is very experimental feature, which
is currently broken and unsupported, since it is unclear, if it
brings something valuable, except some performance hit. Note, that
SCST_HIGHMEM isn't required for HIGHMEM systems and SCST will work
CONFIG_SCST_HIGHMEM isn't required for HIGHMEM systems and SCST will work
fine on them with SCST_HIGHMEM off.
- SCST_STRICT_SECURITY - if defined, makes SCST zero allocated data
- CONFIG_SCST_STRICT_SECURITY - if defined, makes SCST zero allocated data
buffers. Undefining it (default) considerably improves performance
and eases CPU load, but could create a security hole (information
leakage), so enable it, if you have strict security requirements.
- ABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING - if defined, in case
when TASK MANAGEMENT function ABORT TASK is trying to abort a
- CONFIG_SCST_ABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING - if defined,
in case when TASK MANAGEMENT function ABORT TASK is trying to abort a
command, which has already finished, remote initiator, which sent the
ABORT TASK request, will receive TASK NOT EXIST (or ABORT FAILED)
response for the ABORT TASK request. This is more logical response,
@@ -649,18 +649,20 @@ II. In order to get the maximum performance you should:
1. For SCST:
- Disable in Makefile STRICT_SERIALIZING, EXTRACHECKS, TRACING, DEBUG*,
SCST_STRICT_SECURITY, SCST_HIGHMEM
- Disable in Makefile CONFIG_SCST_STRICT_SERIALIZING, CONFIG_SCST_EXTRACHECKS,
CONFIG_SCST_TRACING, DEBUG*, CONFIG_SCST_STRICT_SECURITY,
CONFIG_SCST_HIGHMEM
- For pass-through devices enable ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ.
- For pass-through devices enable
CONFIG_SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ.
2. For target drivers:
- Disable in Makefiles EXTRACHECKS, TRACING, DEBUG*
- Disable in Makefiles CONFIG_SCST_EXTRACHECKS, CONFIG_SCST_TRACING, DEBUG*
3. For device handlers, including VDISK:
- Disable in Makefile TRACING, DEBUG
- Disable in Makefile CONFIG_SCST_TRACING and CONFIG_SCST_DEBUG.
- If your initiator(s) use dedicated exported from the target virtual
SCSI devices and have more or equal amount of memory, than the
@@ -673,7 +675,7 @@ IMPORTANT: Some of the compilation options enabled by default, i.e. SCST
than for performance.
If you use SCST version taken directly from the SVN repository, you can
set the above options, except ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ, using
set the above options, except CONFIG_SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ, using
debug2perf Makefile target.
4. For other target and initiator software parts:
+1 -1
View File
@@ -30,7 +30,7 @@ To be done
- HIGHMEM cleanup. Looks like HIGHMEM usage doesn't worth the effort and
performance hit, at least until VDISK handler doesn't use the page
cache directly, so disable it for now, although the code looks ready.
To enable it, set SCST_HIGHMEM in 1 in scst_priv.h. HIGHMEM is not
To enable it, set CONFIG_SCST_HIGHMEM in 1 in scst_priv.h. HIGHMEM is not
supported on 2.4 and is not going to be.
- Small ToDo's spread all over the code.
+8 -8
View File
@@ -27,7 +27,7 @@
#include <linux/interrupt.h>
#include <linux/proc_fs.h>
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
#include <asm/kmap_types.h>
#endif
#include <scsi/scsi_cmnd.h>
@@ -365,7 +365,7 @@ typedef _Bool bool;
#define SCST_TGT_DEV_AFTER_RX_DATA_ATOMIC 9
#define SCST_TGT_DEV_AFTER_EXEC_ATOMIC 10
#ifdef DEBUG_TM
#ifdef CONFIG_SCST_DEBUG_TM
#define SCST_TGT_DEV_UNDER_TM_DBG 20
#endif
@@ -1045,13 +1045,13 @@ struct scst_cmd {
/*
* Set if the cmd was delayed by task management debugging code.
* Used only if DEBUG_TM is on.
* Used only if CONFIG_SCST_DEBUG_TM is on.
*/
unsigned int tm_dbg_delayed:1;
/*
* Set if the cmd must be ignored by task management debugging code.
* Used only if DEBUG_TM is on.
* Used only if CONFIG_SCST_DEBUG_TM is on.
*/
unsigned int tm_dbg_immut:1;
@@ -2006,7 +2006,7 @@ static inline void scst_sess_set_tgt_priv(struct scst_session *sess,
static inline int scst_cmd_atomic(struct scst_cmd *cmd)
{
int res = cmd->atomic;
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if (unlikely(in_atomic() && !res)) {
printk(KERN_ERR "ERROR: in_atomic() and non-atomic cmd\n");
dump_stack();
@@ -2393,7 +2393,7 @@ static inline int __scst_get_buf(struct scst_cmd *cmd, uint8_t **buf)
if ((i >= cmd->sg_cnt) || unlikely(sg == NULL))
goto out;
#ifdef SCST_HIGHMEM /* HIGHMEM isn't currently supported */
#ifdef CONFIG_SCST_HIGHMEM /* HIGHMEM isn't currently supported */
/*
* HIGHMEM pages not merged (clustered), so if it's
* not HIGHMEM page, kmap() is the same as page_address()
@@ -2432,7 +2432,7 @@ static inline int scst_get_buf_next(struct scst_cmd *cmd, uint8_t **buf)
static inline void scst_put_buf(struct scst_cmd *cmd, void *buf)
{
#ifdef SCST_HIGHMEM /* HIGHMEM isn't currently supported */
#ifdef CONFIG_SCST_HIGHMEM /* HIGHMEM isn't currently supported */
if (cmd->sg_cnt) {
if (scst_cmd_atomic(cmd)) {
enum km_type km;
@@ -2455,7 +2455,7 @@ static inline void scst_put_buf(struct scst_cmd *cmd, void *buf)
static inline int scst_get_buf_count(struct scst_cmd *cmd)
{
int res;
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
res = (cmd->bufflen >> PAGE_SHIFT) + 1;
#else
res = (cmd->sg_cnt == 0) ? 1 : cmd->sg_cnt;
+11 -27
View File
@@ -27,24 +27,8 @@
#include <linux/bug.h> /* for WARN_ON_ONCE */
#endif
#if !defined(EXTRACHECKS) && defined(CONFIG_SCSI_TARGET_EXTRACHECKS)
#define EXTRACHECKS
#endif
#if !defined(TRACING) && defined(CONFIG_SCSI_TARGET_TRACING)
#define TRACING
#endif
#if !defined(DEBUG) && defined(CONFIG_SCSI_TARGET_DEBUG)
#define DEBUG
#endif
#if !defined(INSIDE_KERNEL_TREE)
#ifdef DEBUG
#ifndef EXTRACHECKS
#define EXTRACHECKS
#endif
#ifdef CONFIG_SCST_DEBUG
#ifndef CONFIG_DEBUG_BUGVERBOSE
#define sBUG() do { \
@@ -86,7 +70,7 @@
})
#endif
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
#define EXTRACHECKS_BUG_ON(a) sBUG_ON(a)
#define EXTRACHECKS_WARN_ON(a) WARN_ON(a)
#define EXTRACHECKS_WARN_ON_ONCE(a) WARN_ON_ONCE(a)
@@ -96,7 +80,7 @@
#define EXTRACHECKS_WARN_ON_ONCE(a)
#endif
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
/*# define LOG_FLAG KERN_DEBUG*/
# define LOG_FLAG KERN_INFO
# define INFO_FLAG KERN_INFO
@@ -139,9 +123,9 @@
#define __LOG_PREFIX NULL
#endif
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
#ifndef DEBUG
#ifndef CONFIG_SCST_DEBUG
#define ___unlikely(a) (a)
#else
#define ___unlikely(a) unlikely(a)
@@ -183,15 +167,15 @@ do { \
} \
} while (0)
#else /* DEBUG || TRACING */
#else /* CONFIG_SCST_DEBUG || CONFIG_SCST_TRACING */
#define TRACE(trace, args...) {}
#define PRINT_BUFFER(message, buff, len) {}
#define PRINT_BUFF_FLAG(flag, message, buff, len) {}
#endif /* DEBUG || TRACING */
#endif /* CONFIG_SCST_DEBUG || CONFIG_SCST_TRACING */
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
#define __TRACE(trace, format, args...) \
do { \
@@ -333,7 +317,7 @@ do { \
} \
} while (0)
#else /* DEBUG */
#else /* CONFIG_SCST_DEBUG */
#define TRACE_MEM(format, args...) {}
#define TRACE_SG(format, args...) {}
@@ -400,9 +384,9 @@ do { \
#endif /* LOG_PREFIX */
#endif /* DEBUG */
#endif /* CONFIG_SCST_DEBUG */
#if defined(DEBUG) && defined(CONFIG_DEBUG_SLAB)
#if defined(CONFIG_SCST_DEBUG) && defined(CONFIG_DEBUG_SLAB)
#define SCST_SLAB_FLAGS (SLAB_RED_ZONE | SLAB_POISON)
#else
#define SCST_SLAB_FLAGS 0L
+168 -53
View File
@@ -1,96 +1,211 @@
menu "SCSI target middle level support"
config SCSI_TARGET
config SCST
tristate "SCSI target middle level support"
default SCSI
depends on SCSI && PROC_FS
---help---
help
SCSI TARGET is designed to provide unified, consistent interface
between SCSI target drivers and Linux kernel and simplify target
drivers development as much as possible.
config SCSI_TARGET_DISK
config SCST_DISK
tristate "SCSI target disk support"
default SCSI_TARGET
depends on SCSI && PROC_FS && SCSI_TARGET
---help---
default SCST
depends on SCSI && PROC_FS && SCST
help
SCSI TARGET handler for disk device.
config SCSI_TARGET_TAPE
config SCST_TAPE
tristate "SCSI target tape support"
default SCSI_TARGET
depends on SCSI && PROC_FS && SCSI_TARGET
---help---
default SCST
depends on SCSI && PROC_FS && SCST
help
SCSI TARGET handler for tape device.
config SCSI_TARGET_CDROM
config SCST_CDROM
tristate "SCSI target cdrom support"
default SCSI_TARGET
depends on SCSI && PROC_FS && SCSI_TARGET
---help---
default SCST
depends on SCSI && PROC_FS && SCST
help
SCSI TARGET handler for cdrom device.
config SCSI_TARGET_MODISK
config SCST_MODISK
tristate "SCSI target MO disk support"
default SCSI_TARGET
depends on SCSI && PROC_FS && SCSI_TARGET
---help---
default SCST
depends on SCSI && PROC_FS && SCST
help
SCSI TARGET handler for MO disk device.
config SCSI_TARGET_CHANGER
config SCST_CHANGER
tristate "SCSI target changer support"
default SCSI_TARGET
depends on SCSI && PROC_FS && SCSI_TARGET
---help---
default SCST
depends on SCSI && PROC_FS && SCST
help
SCSI TARGET handler for changer device.
config SCSI_TARGET_PROCESSOR
config SCST_PROCESSOR
tristate "SCSI target processor support"
default SCSI_TARGET
depends on SCSI && PROC_FS && SCSI_TARGET
---help---
default SCST
depends on SCSI && PROC_FS && SCST
help
SCSI TARGET handler for processor device.
config SCSI_TARGET_RAID
config SCST_RAID
tristate "SCSI target storage array controller (raid) support"
default SCSI_TARGET
depends on SCSI && PROC_FS && SCSI_TARGET
---help---
default SCST
depends on SCSI && PROC_FS && SCST
help
SCSI TARGET handler for raid storage array controller (raid) device.
config SCSI_TARGET_VDISK
config SCST_VDISK
tristate "SCSI target virtual disk and/or cdrom support"
default SCSI_TARGET
depends on SCSI && PROC_FS && SCSI_TARGET
---help---
default SCST
depends on SCSI && PROC_FS && SCST
help
SCSI TARGET handler for virtual disk and/or cdrom device.
config SCSI_TARGET_USER
config SCST_USER
tristate "SCSI user space virtual target devices support"
default SCSI_TARGET
depends on SCSI && PROC_FS && SCSI_TARGET && ! HIGHMEM
---help---
default SCST
depends on SCSI && PROC_FS && SCST && ! HIGHMEM
help
SCSI TARGET handler for virtual user space device.
source "drivers/scst/iscsi-scst/Kconfig"
config SCSI_TARGET_EXTRACHECKS
bool "Extra consistency checks"
---help---
Enable additional consistency checks in the SCSI middle level target
code. This may be helpful for SCST developers.
config SCST_STRICT_SERIALIZING
bool "Strict serialization"
help
Enable strict SCSI command serialization. When enabled, SCST sends
all SCSI commands to the underlying SCSI device synchronously, one
after one. This makes task management more reliable, at the cost of
a performance penalty. This is most useful for stateful SCSI devices
like tapes, where the result of the execution of a command
depends on the device settings configured by previous commands. Disk
and RAID devices are stateless in most cases. The current SCSI core
in Linux doesn't allow to abort all commands reliably if they have
been sent asynchronously to a stateful device.
Enable this option if you use stateful device(s) and need as much
error recovery reliability as possible. If unsure, leave this
option disabled.
config SCSI_TARGET_TRACING
config SCST_STRICT_SECURITY
bool "Strict security"
help
Makes SCST clear (zero-fill) allocated data buffers. Note: this has a
significant performance penalty. If unsure, leave this option
disabled.
config SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
bool "Allow pass-through commands to be sent from soft-IRQ context"
help
Allows SCST to submit SCSI pass-through commands to real SCSI devices
via the SCSI middle layer using scsi_execute_async() function from
soft-IRQ context (tasklets). This used to be the default, but
currently it seems the SCSI middle layer starts expecting only thread
context on the IO submit path, so it is disabled now by default.
Enabling it will decrease amount of context switches and improve
performance. It is more or less safe. In the worst case, if in your
configuration the SCSI middle layer really doesn't expect SIRQ
context in scsi_execute_async() function, you will get a warning
message in the kernel log. If unsure, leave this option disabled.
config SCST_ABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING
bool "Send back UNKNOWN TASK when an already finished task is aborted."
help
Controls which response is sent by SCST to the initiator in case
the initiator attempts to abort (ABORT TASK) an already finished
request. If this option is enabled, the response UNKNOWN TASK is
sent back to the initiator. However, some initiators, particularly
the VMware iSCSI initiator, interpret the UNKNOWN TASK response as
if the target got crazy and try to RESET it. Then sometimes the
initiator gets crazy itself. If unsure, leave this option disabled.
config SCST_USE_EXPECTED_VALUES
bool "Prefer initiator-supplied SCSI command attributes"
help
When SCST receives a SCSI command from an initiator, such a SCSI
command has both data transfer length and direction attributes.
There are two possible sources for these attributes: either the
values computed by SCST from its internal command translation table
or the values supplied by the initiator. The former are used by
default because of security reasons. Invalid initiator-supplied
attributes can crash the target, especially in pass-through mode.
Only consider enabling this option when SCST logs the following
message: "Unknown opcode XX for YY. Should you update
scst_scsi_op_table?" and when the initiator complains. Please
report any unrecognized commands to scst-devel@lists.sourceforge.net.
If unsure, leave this option disabled.
config SCST_EXTRACHECKS
bool "Extra consistency checks"
help
Enable additional consistency checks in the SCSI middle level target
code. This may be helpful for SCST developers. If unsure, leave this
option disabled.
config SCST_TRACING
bool "Tracing support"
---help---
Enable SCSI middle level tracing support. Tracing can be controlled
dynamically via /proc/scsi_tgt/trace_level. The traced information
is sent to the kernel log and may be very helpful when analyzing
the cause of a communication problem between initiator and target.
help
Enable SCSI middle level tracing support. Tracing can be controlled
dynamically via /proc/scsi_tgt/trace_level. The traced information
is sent to the kernel log and may be very helpful when analyzing
the cause of a communication problem between initiator and target.
If unsure, leave this option disabled.
config SCSI_TARGET_DEBUG
bool "Debug support"
---help---
SCSI TARGET debugging.
config SCST_DEBUG
bool "Debugging support."
help
Enables support for debugging SCST. This may be helpful for SCST
developers. If unsure, leave this option disabled.
config SCST_DEBUG_OOM
bool "Out-of-memory debugging support."
help
Let SCST's internal memory allocation function
(scst_alloc_sg_entries()) fail about once in every 10000 calls, at
least if the flag __GFP_NOFAIL has not been set. This allows SCST
developers to test the behavior of SCST in out-of-memory conditions.
This may be helpful for SCST developers. If unsure, leave this
option disabled.
config SCST_DEBUG_RETRY
bool "SCSI command retry debugging support."
help
Let SCST's internal SCSI command transfer function
(scst_rdy_to_xfer()) fail about once in every 100 calls. This allows
SCST developers to test the behavior of SCST when SCSI queues fill
up. This may be helpful for SCST developers. If unsure, leave this
option disabled.
config SCST_DEBUG_SN
bool "SCSI sequence number debugging support."
help
Allows to test SCSI command ordering via sequence numbers by
randomly changing the type of SCSI commands into
SCST_CMD_QUEUE_ORDERED, SCST_CMD_QUEUE_HEAD_OF_QUEUE or
SCST_CMD_QUEUE_SIMPLE for about one in 300 SCSI commands.
This may be helpful for SCST developers. If unsure, leave this
option disabled.
config SCST_DEBUG_TM
bool "Task management debugging support."
depends on SCST_DEBUG
help
Enables support for debugging of SCST's task management functions.
When enabled, some of the commands on LUN 0 in the default access
control group will be delayed for about 60 seconds. This will
cause the remote initiator send SCSI task management functions,
e.g. ABORT TASK and TARGET RESET. If unsure, leave this option
disabled.
config SCST_TM_DBG_GO_OFFLINE
bool "Let devices become completely unresponsive."
depends on SCST_DEBUG_TM
help
Enable this option if you want that the device eventually becomes
completely unresponsive. When disabled, the device will receive
ABORT and RESET commands. If unsure, leave this option disabled.
endmenu
+9 -9
View File
@@ -3,12 +3,12 @@ EXTRA_CFLAGS += -Iinclude/scst -Wextra -Wno-unused-parameter
obj-m := scst_cdrom.o scst_changer.o scst_disk.o scst_modisk.o scst_tape.o \
scst_vdisk.o scst_raid.o scst_processor.o scst_user.o
obj-$(CONFIG_SCSI_TARGET_DISK) += scst_disk.o
obj-$(CONFIG_SCSI_TARGET_TAPE) += scst_tape.o
obj-$(CONFIG_SCSI_TARGET_CDROM) += scst_cdrom.o
obj-$(CONFIG_SCSI_TARGET_MODISK) += scst_modisk.o
obj-$(CONFIG_SCSI_TARGET_CHANGER) += scst_changer.o
obj-$(CONFIG_SCSI_TARGET_RAID) += scst_raid.o
obj-$(CONFIG_SCSI_TARGET_PROCESSOR) += scst_processor.o
obj-$(CONFIG_SCSI_TARGET_VDISK) += scst_vdisk.o
obj-$(CONFIG_SCSI_TARGET_USER) += scst_user.o
obj-$(CONFIG_SCST_DISK) += scst_disk.o
obj-$(CONFIG_SCST_TAPE) += scst_tape.o
obj-$(CONFIG_SCST_CDROM) += scst_cdrom.o
obj-$(CONFIG_SCST_MODISK) += scst_modisk.o
obj-$(CONFIG_SCST_CHANGER) += scst_changer.o
obj-$(CONFIG_SCST_RAID) += scst_raid.o
obj-$(CONFIG_SCST_PROCESSOR) += scst_processor.o
obj-$(CONFIG_SCST_VDISK) += scst_vdisk.o
obj-$(CONFIG_SCST_USER) += scst_user.o
@@ -4,7 +4,7 @@
obj-$(CONFIG_SCSI_QLOGIC_FC) += qlogicfc.o
obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o
obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx/
+obj-$(CONFIG_SCSI_TARGET) += scsi_tgt/
+obj-$(CONFIG_SCST) += scsi_tgt/
obj-$(CONFIG_SCSI_LPFC) += lpfc/
obj-$(CONFIG_SCSI_PAS16) += pas16.o
obj-$(CONFIG_SCSI_SEAGATE) += seagate.o
@@ -5,7 +5,7 @@ diff -uprN ../orig/linux-2.6.24/drivers/Makefile linux-2.6.24/drivers/Makefile
obj-y += macintosh/
obj-$(CONFIG_IDE) += ide/
obj-$(CONFIG_SCSI) += scsi/
+obj-$(CONFIG_SCSI_TARGET) += scst/
+obj-$(CONFIG_SCST) += scst/
obj-$(CONFIG_ATA) += ata/
obj-$(CONFIG_FUSION) += message/
obj-$(CONFIG_FIREWIRE) += firewire/
@@ -5,7 +5,7 @@ diff -uprN ../orig/linux-2.6.24/drivers/Makefile linux-2.6.24/drivers/Makefile
obj-y += macintosh/
obj-$(CONFIG_IDE) += ide/
obj-$(CONFIG_SCSI) += scsi/
+obj-$(CONFIG_SCSI_TARGET) += scst/
+obj-$(CONFIG_SCST) += scst/
obj-$(CONFIG_ATA) += ata/
obj-$(CONFIG_FUSION) += message/
obj-$(CONFIG_FIREWIRE) += firewire/
@@ -4,7 +4,7 @@
obj-$(CONFIG_SCSI_QLOGIC_FC) += qlogicfc.o
obj-$(CONFIG_SCSI_QLOGIC_1280) += qla1280.o
obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx/
+obj-$(CONFIG_SCSI_TARGET) += scsi_tgt/
+obj-$(CONFIG_SCST) += scsi_tgt/
obj-$(CONFIG_SCSI_PAS16) += pas16.o
obj-$(CONFIG_SCSI_SEAGATE) += seagate.o
obj-$(CONFIG_SCSI_FD_8xx) += seagate.o
+1 -1
View File
@@ -7,5 +7,5 @@ scst-y += scst_proc.o
scst-y += scst_mem.o
scst-y += scst_debug.o
obj-$(CONFIG_SCSI_TARGET) += scst.o dev_handlers/ iscsi-scst/
obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/
+11 -11
View File
@@ -41,7 +41,7 @@ scst-y += scst_lib.o
scst-y += scst_proc.o
scst-y += scst_mem.o
scst-y += scst_debug.o
obj-$(CONFIG_SCSI_TARGET) += scst.o dev_handlers/
obj-$(CONFIG_SCST) += scst.o dev_handlers/
obj-$(BUILD_DEV) += $(DEV_HANDLERS_DIR)/
@@ -113,23 +113,23 @@ INSTALL_DIR_H := /usr/local/include/scst
EXTRA_CFLAGS += -I$(SCST_INC_DIR) -Wextra -Wno-unused-parameter
#EXTRA_CFLAGS += -DSTRICT_SERIALIZING
#EXTRA_CFLAGS += -DCONFIG_SCST_STRICT_SERIALIZING
EXTRA_CFLAGS += -DEXTRACHECKS
EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DUSE_EXPECTED_VALUES
#EXTRA_CFLAGS += -DCONFIG_SCST_USE_EXPECTED_VALUES
#EXTRA_CFLAGS += -DALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
#EXTRA_CFLAGS += -DABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING
#EXTRA_CFLAGS += -fno-inline
#EXTRA_CFLAGS += -DTRACING
#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
EXTRA_CFLAGS += -DDEBUG -g
#EXTRA_CFLAGS += -DDEBUG_TM -DTM_DBG_GO_OFFLINE=0
#EXTRA_CFLAGS += -DDEBUG_RETRY
#EXTRA_CFLAGS += -DDEBUG_OOM
#EXTRA_CFLAGS += -DDEBUG_SN
EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG_TM -UCONFIG_SCST_TM_DBG_GO_OFFLINE
#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG_RETRY
#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG_OOM
#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG_SN
#EXTRA_CFLAGS += -DMEASURE_LATENCY
@@ -142,7 +142,7 @@ EXTRA_CFLAGS += -DDEBUG -g
# If defined, allows SCST to use HIGHMEM. It's unclear, if it brings
# something valuable, except performance hit in some cases,
# so let it be off. Untested and unsupported.
#EXTRA_CFLAGS += -DSCST_HIGHMEM
#EXTRA_CFLAGS += -DCONFIG_SCST_HIGHMEM
clean:
rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend Modules.symvers \
+12 -12
View File
@@ -33,15 +33,15 @@ SCST_INC_DIR := $(SUBDIRS)/../include
obj-m := scst_cdrom.o scst_changer.o scst_disk.o scst_modisk.o scst_tape.o \
scst_vdisk.o scst_raid.o scst_processor.o scst_user.o
obj-$(CONFIG_SCSI_TARGET_DISK) += scst_disk.o
obj-$(CONFIG_SCSI_TARGET_TAPE) += scst_tape.o
obj-$(CONFIG_SCSI_TARGET_CDROM) += scst_cdrom.o
obj-$(CONFIG_SCSI_TARGET_MODISK) += scst_modisk.o
obj-$(CONFIG_SCSI_TARGET_CHANGER) += scst_changer.o
obj-$(CONFIG_SCSI_TARGET_RAID) += scst_raid.o
obj-$(CONFIG_SCSI_TARGET_PROCESSOR) += scst_processor.o
obj-$(CONFIG_SCSI_TARGET_VDISK) += scst_vdisk.o
obj-$(CONFIG_SCSI_TARGET_USER) += scst_user.o
obj-$(CONFIG_SCST_DISK) += scst_disk.o
obj-$(CONFIG_SCST_TAPE) += scst_tape.o
obj-$(CONFIG_SCST_CDROM) += scst_cdrom.o
obj-$(CONFIG_SCST_MODISK) += scst_modisk.o
obj-$(CONFIG_SCST_CHANGER) += scst_changer.o
obj-$(CONFIG_SCST_RAID) += scst_raid.o
obj-$(CONFIG_SCST_PROCESSOR) += scst_processor.o
obj-$(CONFIG_SCST_VDISK) += scst_vdisk.o
obj-$(CONFIG_SCST_USER) += scst_user.o
else
ifeq ($(KDIR),)
@@ -69,10 +69,10 @@ endif
EXTRA_CFLAGS += -I$(SUBDIRS) -I$(SCST_INC_DIR) -Wextra -Wno-unused-parameter
EXTRA_CFLAGS += -DEXTRACHECKS
EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DTRACING
EXTRA_CFLAGS += -DDEBUG -g
#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
clean:
rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend Modules.symvers \
+6 -6
View File
@@ -10,11 +10,11 @@
#define SCST_DEV_UA_RETRIES 5
#define SCST_PASSTHROUGH_RETRIES 0
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
#define DEV_HANDLER_LOG_ENTRY_NAME "trace_level"
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
#define SCST_DEFAULT_DEV_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_PID | \
TRACE_LINE | TRACE_FUNCTION | TRACE_MGMT | TRACE_MGMT_MINOR | \
TRACE_MINOR | TRACE_MGMT_DEBUG | TRACE_SPECIAL)
@@ -57,12 +57,12 @@ static ssize_t scst_dev_handler_proc_log_entry_write(struct file *file,
TRACE_EXIT_RES(res);
return res;
}
#endif /* defined(DEBUG) || defined(TRACING) */
#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
static int scst_dev_handler_build_std_proc(struct scst_dev_type *dev_type)
{
int res = 0;
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
struct proc_dir_entry *p, *root;
TRACE_ENTRY();
@@ -90,7 +90,7 @@ out:
static void scst_dev_handler_destroy_std_proc(struct scst_dev_type *dev_type)
{
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
struct proc_dir_entry *root;
TRACE_ENTRY();
@@ -103,7 +103,7 @@ static void scst_dev_handler_destroy_std_proc(struct scst_dev_type *dev_type)
#endif
}
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
static struct scst_proc_data dev_handler_log_proc_data = {
SCST_DEF_RW_SEQ_OP(scst_dev_handler_proc_log_entry_write)
.show = dev_handler_log_info_show,
+1 -1
View File
@@ -2784,7 +2784,7 @@ static int dev_user_process_cleanup(struct scst_user_dev *dev)
}
}
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
{
int i;
for (i = 0; i < (int)ARRAY_SIZE(dev->ucmd_hash); i++) {
+1 -1
View File
@@ -43,7 +43,7 @@
#include "scst.h"
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
#define TRACE_ORDER 0x80000000
+2 -2
View File
@@ -22,7 +22,7 @@
#include "scst.h"
#include "scst_debug.h"
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
#define TRACE_BUF_SIZE 512
@@ -128,4 +128,4 @@ void debug_print_buffer(const char *log_level, const void *data, int len)
}
EXPORT_SYMBOL(debug_print_buffer);
#endif /* DEBUG || TRACING */
#endif /* CONFIG_SCST_DEBUG || CONFIG_SCST_TRACING */
+20 -20
View File
@@ -28,7 +28,7 @@
#include <linux/unistd.h>
#include <linux/string.h>
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
#include <linux/highmem.h>
#endif
@@ -214,7 +214,7 @@ void scst_set_cmd_abnormal_done_state(struct scst_cmd *cmd)
{
TRACE_ENTRY();
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
switch (cmd->state) {
case SCST_CMD_STATE_PRE_XMIT_RESP:
case SCST_CMD_STATE_XMIT_RESP:
@@ -253,7 +253,7 @@ void scst_set_resp_data_len(struct scst_cmd *cmd, int resp_data_len)
l += cmd->sg[i].length;
if (l >= resp_data_len) {
int left = resp_data_len - (l - cmd->sg[i].length);
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
TRACE(TRACE_SG_OP|TRACE_MEMORY, "cmd %p (tag %llu), "
"resp_data_len %d, i %d, cmd->sg[i].length %d, "
"left %d",
@@ -323,7 +323,7 @@ void scst_free_device(struct scst_device *dev)
{
TRACE_ENTRY();
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if (!list_empty(&dev->dev_tgt_dev_list) ||
!list_empty(&dev->dev_acg_dev_list)) {
PRINT_CRIT_ERROR("%s: dev_tgt_dev_list or dev_acg_dev_list "
@@ -517,7 +517,7 @@ static struct scst_tgt_dev *scst_alloc_add_tgt_dev(struct scst_session *sess,
if (sess->tgt->tgtt->unchecked_isa_dma || ini_unchecked_isa_dma) {
scst_sgv_pool_use_dma(tgt_dev);
} else {
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
scst_sgv_pool_use_highmem(tgt_dev);
#endif
}
@@ -759,7 +759,7 @@ int scst_acg_add_dev(struct scst_acg *acg, struct scst_device *dev,
INIT_LIST_HEAD(&tmp_tgt_dev_list);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
list_for_each_entry(acg_dev, &acg->acg_dev_list, acg_dev_list_entry) {
if (acg_dev->dev == dev) {
PRINT_ERROR("Device is already in group %s",
@@ -1422,7 +1422,7 @@ void scst_free_cmd(struct scst_cmd *cmd)
cmd->dec_on_dev_needed);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
#if defined(EXTRACHECKS)
#if defined(CONFIG_SCST_EXTRACHECKS)
if (cmd->scsi_req) {
PRINT_ERROR("%s: %s", __func__, "Cmd with unfreed "
"scsi_req!");
@@ -1466,7 +1466,7 @@ void scst_free_cmd(struct scst_cmd *cmd)
}
if (likely(cmd->tgt_dev != NULL)) {
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if (unlikely(!cmd->sent_to_midlev)) {
PRINT_ERROR("Finishing not executed cmd %p (opcode "
"%d, target %s, lun %Ld, sn %ld, expected_sn %ld)",
@@ -3032,7 +3032,7 @@ int scst_inc_on_dev_cmd(struct scst_cmd *cmd)
cmd->dec_on_dev_needed = 1;
TRACE_DBG("New on_dev_count %d", atomic_read(&dev->on_dev_count));
#ifdef STRICT_SERIALIZING
#ifdef CONFIG_SCST_STRICT_SERIALIZING
spin_lock_bh(&dev->dev_lock);
if (unlikely(test_bit(SCST_CMD_ABORTED, &cmd->cmd_flags)))
goto out_unlock;
@@ -3103,7 +3103,7 @@ out_unlock:
/* Called under dev_lock */
void scst_unblock_cmds(struct scst_device *dev)
{
#ifdef STRICT_SERIALIZING
#ifdef CONFIG_SCST_STRICT_SERIALIZING
struct scst_cmd *cmd, *t;
unsigned long flags;
@@ -3140,7 +3140,7 @@ void scst_unblock_cmds(struct scst_device *dev)
break;
}
local_irq_restore(flags);
#else /* STRICT_SERIALIZING */
#else /* CONFIG_SCST_STRICT_SERIALIZING */
struct scst_cmd *cmd, *tcmd;
unsigned long flags;
@@ -3162,7 +3162,7 @@ void scst_unblock_cmds(struct scst_device *dev)
spin_unlock(&cmd->cmd_lists->cmd_list_lock);
}
local_irq_restore(flags);
#endif /* STRICT_SERIALIZING */
#endif /* CONFIG_SCST_STRICT_SERIALIZING */
TRACE_EXIT();
return;
@@ -3298,7 +3298,7 @@ void __init scst_scsi_op_list_init(void)
return;
}
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
/* Original taken from the XFS code */
unsigned long scst_random(void)
{
@@ -3329,7 +3329,7 @@ unsigned long scst_random(void)
EXPORT_SYMBOL(scst_random);
#endif
#ifdef DEBUG_TM
#ifdef CONFIG_SCST_DEBUG_TM
#define TM_DBG_STATE_ABORT 0
#define TM_DBG_STATE_RESET 1
@@ -3476,17 +3476,17 @@ static void tm_dbg_change_state(void)
break;
case TM_DBG_STATE_RESET:
case TM_DBG_STATE_OFFLINE:
if (TM_DBG_GO_OFFLINE) {
#ifdef CONFIG_SCST_TM_DBG_GO_OFFLINE
TRACE_MGMT_DBG("%s", "Changing "
"tm_dbg_state to OFFLINE");
tm_dbg_state =
TM_DBG_STATE_OFFLINE;
} else {
#else
TRACE_MGMT_DBG("%s", "Changing "
"tm_dbg_state to ABORT");
tm_dbg_state =
TM_DBG_STATE_ABORT;
}
#endif
break;
default:
sBUG();
@@ -3618,9 +3618,9 @@ int tm_dbg_is_release(void)
{
return tm_dbg_flags.tm_dbg_release;
}
#endif /* DEBUG_TM */
#endif /* CONFIG_SCST_DEBUG_TM */
#ifdef DEBUG_SN
#ifdef CONFIG_SCST_DEBUG_SN
void scst_check_debug_sn(struct scst_cmd *cmd)
{
static DEFINE_SPINLOCK(lock);
@@ -3661,4 +3661,4 @@ out_unlock:
spin_unlock_irqrestore(&lock, flags);
return;
}
#endif /* DEBUG_SN */
#endif /* CONFIG_SCST_DEBUG_SN */
+23 -23
View File
@@ -40,16 +40,16 @@
details."
#endif
#ifdef SCST_HIGHMEM
#error "SCST_HIGHMEM configuration isn't supported and broken, because there \
is no real point to support it, at least it definitely doesn't worth \
the effort. Better use no-HIGHMEM kernel with VMSPLIT option \
#ifdef CONFIG_SCST_HIGHMEM
#error "CONFIG_SCST_HIGHMEM configuration isn't supported and broken, because\
there is no real point to support it, at least it definitely isn't \
worth the effort. Better use no-HIGHMEM kernel with VMSPLIT option \
or in 64-bit configuration instead. See README file for details."
#endif
#if !defined(SCSI_EXEC_REQ_FIFO_DEFINED) && !defined(STRICT_SERIALIZING)
#if !defined(SCSI_EXEC_REQ_FIFO_DEFINED) && !defined(CONFIG_SCST_STRICT_SERIALIZING)
#warning "Patch scst_exec_req_fifo-<kernel-version>.patch was not applied on \
your kernel and STRICT_SERIALIZING isn't defined. Pass-through dev \
your kernel and CONFIG_SCST_STRICT_SERIALIZING isn't defined. Pass-through dev \
handlers will not be supported."
#endif
@@ -97,7 +97,7 @@ unsigned int scst_init_poll_cnt;
struct kmem_cache *scst_cmd_cachep;
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
unsigned long scst_trace_flag;
#endif
@@ -725,7 +725,7 @@ static int scst_dev_handler_check(struct scst_dev_type *dev_handler)
}
if (dev_handler->exec == NULL) {
#ifdef ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
#ifdef CONFIG_SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
dev_handler->exec_atomic = 1;
#else
dev_handler->exec_atomic = 0;
@@ -885,12 +885,12 @@ int __scst_register_dev_driver(struct scst_dev_type *dev_type,
if (res != 0)
goto out_error;
#if !defined(SCSI_EXEC_REQ_FIFO_DEFINED) && !defined(STRICT_SERIALIZING)
#if !defined(SCSI_EXEC_REQ_FIFO_DEFINED) && !defined(CONFIG_SCST_STRICT_SERIALIZING)
if (dev_type->exec == NULL) {
PRINT_ERROR("Pass-through dev handlers (handler \"%s\") not "
"supported. Consider applying on your kernel patch "
"scst_exec_req_fifo-<kernel-version>.patch or define "
"STRICT_SERIALIZING", dev_type->name);
"CONFIG_SCST_STRICT_SERIALIZING", dev_type->name);
res = -EINVAL;
goto out;
}
@@ -1523,61 +1523,61 @@ static void __init scst_print_config(void)
i = snprintf(buf, sizeof(buf), "Enabled features: ");
j = i;
#ifdef STRICT_SERIALIZING
#ifdef CONFIG_SCST_STRICT_SERIALIZING
i += snprintf(&buf[i], sizeof(buf) - i, "Strict serializing");
#endif
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
i += snprintf(&buf[i], sizeof(buf) - i, "%sEXTRACHECKS",
(j == i) ? "" : ", ");
#endif
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
i += snprintf(&buf[i], sizeof(buf) - i, "%sTRACING",
(j == i) ? "" : ", ");
#endif
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
i += snprintf(&buf[i], sizeof(buf) - i, "%sDEBUG",
(j == i) ? "" : ", ");
#endif
#ifdef DEBUG_TM
#ifdef CONFIG_SCST_DEBUG_TM
i += snprintf(&buf[i], sizeof(buf) - i, "%sDEBUG_TM",
(j == i) ? "" : ", ");
#endif
#ifdef DEBUG_RETRY
#ifdef CONFIG_SCST_DEBUG_RETRY
i += snprintf(&buf[i], sizeof(buf) - i, "%sDEBUG_RETRY",
(j == i) ? "" : ", ");
#endif
#ifdef DEBUG_OOM
#ifdef CONFIG_SCST_DEBUG_OOM
i += snprintf(&buf[i], sizeof(buf) - i, "%sDEBUG_OOM",
(j == i) ? "" : ", ");
#endif
#ifdef DEBUG_SN
#ifdef CONFIG_SCST_DEBUG_SN
i += snprintf(&buf[i], sizeof(buf) - i, "%sDEBUG_SN",
(j == i) ? "" : ", ");
#endif
#ifdef USE_EXPECTED_VALUES
#ifdef CONFIG_SCST_USE_EXPECTED_VALUES
i += snprintf(&buf[i], sizeof(buf) - i, "%sUSE_EXPECTED_VALUES",
(j == i) ? "" : ", ");
#endif
#ifdef ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
#ifdef CONFIG_SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
i += snprintf(&buf[i], sizeof(buf) - i, "%sALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ",
(j == i) ? "" : ", ");
#endif
#ifdef SCST_STRICT_SECURITY
#ifdef CONFIG_SCST_STRICT_SECURITY
i += snprintf(&buf[i], sizeof(buf) - i, "%sSCST_STRICT_SECURITY",
(j == i) ? "" : ", ");
#endif
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
i += snprintf(&buf[i], sizeof(buf) - i, "%sSCST_HIGHMEM",
(j == i) ? "" : ", ");
#endif
@@ -1626,7 +1626,7 @@ static int __init init_scst(void)
spin_lock_init(&scst_init_lock);
init_waitqueue_head(&scst_init_cmd_list_waitQ);
INIT_LIST_HEAD(&scst_init_cmd_list);
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
scst_trace_flag = SCST_DEFAULT_LOG_FLAGS;
#endif
atomic_set(&scst_cmd_count, 0);
+8 -8
View File
@@ -27,7 +27,7 @@
#include <linux/unistd.h>
#include <linux/string.h>
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
#include <linux/highmem.h>
#endif
@@ -61,7 +61,7 @@ void scst_sgv_pool_use_dma(struct scst_tgt_dev *tgt_dev)
tgt_dev->pool = &sgv_pools_mgr.default_set.dma;
}
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
void scst_sgv_pool_use_highmem(struct scst_tgt_dev *tgt_dev)
{
TRACE_MEM("%s", "Use HIGHMEM");
@@ -80,7 +80,7 @@ static int scst_check_clustering(struct scatterlist *sg, int cur, int hint)
int full_page_cur = (len_cur & (PAGE_SIZE - 1)) == 0;
unsigned long pfn, pfn_next, full_page;
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
if (page >= highmem_start_page) {
TRACE_MEM("%s", "HIGHMEM page allocated, no clustering")
goto out;
@@ -205,13 +205,13 @@ static int scst_alloc_sg_entries(struct scatterlist *sg, int pages,
#if 0
gfp_mask |= __GFP_COLD;
#endif
#ifdef SCST_STRICT_SECURITY
#ifdef CONFIG_SCST_STRICT_SECURITY
gfp_mask |= __GFP_ZERO;
#endif
for (pg = 0; pg < pages; pg++) {
void *rc;
#ifdef DEBUG_OOM
#ifdef CONFIG_SCST_DEBUG_OOM
if (((gfp_mask & __GFP_NOFAIL) != __GFP_NOFAIL) &&
((scst_random() % 10000) == 55))
rc = NULL;
@@ -1228,7 +1228,7 @@ int scst_sgv_pools_init(unsigned long mem_hwmark, unsigned long mem_lwmark)
if (res != 0)
goto out_free_norm;
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
res = sgv_pool_init(&pools->default_set.highmem, "sgv-high", 0);
if (res != 0)
goto out_free_dma;
@@ -1254,7 +1254,7 @@ out:
TRACE_EXIT_RES(res);
return res;
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
out_free_dma:
sgv_pool_deinit(&pools->default_set.dma);
#endif
@@ -1281,7 +1281,7 @@ void scst_sgv_pools_deinit(void)
cancel_delayed_work(&pools->mgr.apit_pool);
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
sgv_pool_deinit(&pools->default_set.highmem);
#endif
sgv_pool_deinit(&pools->default_set.dma);
+2 -2
View File
@@ -91,7 +91,7 @@ struct scst_sgv_pools_manager {
struct {
struct sgv_pool norm_clust, norm;
struct sgv_pool dma;
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
struct sgv_pool highmem;
#endif
} default_set;
@@ -148,6 +148,6 @@ extern int sgv_pool_procinfo_show(struct seq_file *seq, void *v);
void scst_sgv_pool_use_norm(struct scst_tgt_dev *tgt_dev);
void scst_sgv_pool_use_norm_clust(struct scst_tgt_dev *tgt_dev);
void scst_sgv_pool_use_dma(struct scst_tgt_dev *tgt_dev);
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
void scst_sgv_pool_use_highmem(struct scst_tgt_dev *tgt_dev);
#endif
+9 -9
View File
@@ -44,12 +44,12 @@
#define TRACE_SND_BOT 0x08000000 /** bottom being the edge toward the interupt */
#define TRACE_RCV_BOT 0x04000000
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
#define trace_flag scst_trace_flag
extern unsigned long scst_trace_flag;
#endif
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
/*#define SCST_DEFAULT_LOG_FLAGS (TRACE_ALL & ~TRACE_MEMORY & ~TRACE_BUFF \
& ~TRACE_FUNCTION)
#define SCST_DEFAULT_LOG_FLAGS (TRACE_ALL & ~TRACE_MEMORY & ~TRACE_BUFF & \
@@ -66,9 +66,9 @@ extern unsigned long scst_trace_flag;
#define TRACE_SEND_BOT(args...) __TRACE(TRACE_SND_BOT, args)
#define TRACE_RECV_BOT(args...) __TRACE(TRACE_RCV_BOT, args)
#else /* DEBUG */
#else /* CONFIG_SCST_DEBUG */
# ifdef TRACING
# ifdef CONFIG_SCST_TRACING
#define SCST_DEFAULT_LOG_FLAGS (TRACE_OUT_OF_MEM | TRACE_MINOR | TRACE_SPECIAL)
# else
#define SCST_DEFAULT_LOG_FLAGS 0
@@ -328,7 +328,7 @@ static inline void scst_do_req(struct scsi_request *sreq,
const void *cmnd, void *buffer, unsigned bufflen,
void (*done)(struct scsi_cmnd *), int timeout, int retries)
{
#ifdef STRICT_SERIALIZING
#ifdef CONFIG_SCST_STRICT_SERIALIZING
scsi_do_req(sreq, cmnd, buffer, bufflen, done, timeout, retries);
#elif !defined(SCSI_EXEC_REQ_FIFO_DEFINED)
sBUG();
@@ -342,7 +342,7 @@ static inline int scst_exec_req(struct scsi_device *sdev,
void *buffer, unsigned bufflen, int use_sg, int timeout, int retries,
void *privdata, void (*done)(void *, char *, int, int), gfp_t gfp)
{
#ifdef STRICT_SERIALIZING
#ifdef CONFIG_SCST_STRICT_SERIALIZING
return scsi_execute_async(sdev, cmd, cmd_len, data_direction, buffer,
bufflen, use_sg, timeout, retries, privdata, done, gfp);
#elif !defined(SCSI_EXEC_REQ_FIFO_DEFINED)
@@ -532,7 +532,7 @@ static inline void scst_check_restore_sg_buff(struct scst_cmd *cmd)
}
}
#ifdef DEBUG_TM
#ifdef CONFIG_SCST_DEBUG_TM
extern void tm_dbg_init_tgt_dev(struct scst_tgt_dev *tgt_dev,
struct scst_acg_dev *acg_dev);
extern void tm_dbg_deinit_tgt_dev(struct scst_tgt_dev *tgt_dev);
@@ -558,9 +558,9 @@ static inline int tm_dbg_is_release(void)
{
return 0;
}
#endif /* DEBUG_TM */
#endif /* CONFIG_SCST_DEBUG_TM */
#ifdef DEBUG_SN
#ifdef CONFIG_SCST_DEBUG_SN
void scst_check_debug_sn(struct scst_cmd *cmd);
#else
static inline void scst_check_debug_sn(struct scst_cmd *cmd) {}
+21 -21
View File
@@ -87,7 +87,7 @@ static struct scst_proc_data scst_dev_handler_proc_data;
static struct proc_dir_entry *scst_proc_scsi_tgt;
static struct proc_dir_entry *scst_proc_groups_root;
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
static struct scst_proc_data scst_log_proc_data;
static struct scst_proc_log scst_proc_trace_tbl[] =
@@ -136,7 +136,7 @@ static char *scst_proc_help_string =
" echo \"clear\" >/proc/scsi_tgt/groups/GROUP/names\n"
"\n"
" echo \"DEC|0xHEX|0OCT\" >/proc/scsi_tgt/threads\n"
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
"\n"
" echo \"all|none|default\" >/proc/scsi_tgt/[DEV_HANDLER_NAME/]trace_level\n"
" echo \"value DEC|0xHEX|0OCT\" >/proc/scsi_tgt/[DEV_HANDLER_NAME/]trace_level\n"
@@ -174,7 +174,7 @@ static DEFINE_MUTEX(scst_proc_mutex);
#if !defined(CONFIG_PPC) && (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22))
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
static int strcasecmp(const char *s1, const char *s2)
{
int c1, c2;
@@ -202,7 +202,7 @@ static int strncasecmp(const char *s1, const char *s2, size_t n)
#endif /* !CONFIG_PPC && (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)) */
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
static DEFINE_MUTEX(scst_log_mutex);
@@ -379,7 +379,7 @@ out:
return res;
}
#endif /* defined(DEBUG) || defined(TRACING) */
#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
#ifdef MEASURE_LATENCY
@@ -488,13 +488,13 @@ static struct scst_proc_data scst_lat_proc_data = {
static int __init scst_proc_init_module_log(void)
{
int res = 0;
#if defined(DEBUG) || defined(TRACING) || defined(MEASURE_LATENCY)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) || defined(MEASURE_LATENCY)
struct proc_dir_entry *generic;
#endif
TRACE_ENTRY();
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
generic = scst_create_proc_entry(scst_proc_scsi_tgt,
SCST_PROC_LOG_ENTRY_NAME,
&scst_log_proc_data);
@@ -526,7 +526,7 @@ static void scst_proc_cleanup_module_log(void)
{
TRACE_ENTRY();
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
remove_proc_entry(SCST_PROC_LOG_ENTRY_NAME, scst_proc_scsi_tgt);
#endif
@@ -1728,51 +1728,51 @@ static int scst_version_info_show(struct seq_file *seq, void *v)
seq_printf(seq, "%s\n", SCST_VERSION_STRING);
#ifdef STRICT_SERIALIZING
#ifdef CONFIG_SCST_STRICT_SERIALIZING
seq_printf(seq, "Strict serializing enabled\n");
#endif
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
seq_printf(seq, "EXTRACHECKS\n");
#endif
#ifdef TRACING
#ifdef CONFIG_SCST_TRACING
seq_printf(seq, "TRACING\n");
#endif
#ifdef DEBUG
#ifdef CONFIG_SCST_DEBUG
seq_printf(seq, "DEBUG\n");
#endif
#ifdef DEBUG_TM
#ifdef CONFIG_SCST_DEBUG_TM
seq_printf(seq, "DEBUG_TM\n");
#endif
#ifdef DEBUG_RETRY
#ifdef CONFIG_SCST_DEBUG_RETRY
seq_printf(seq, "DEBUG_RETRY\n");
#endif
#ifdef DEBUG_OOM
#ifdef CONFIG_SCST_DEBUG_OOM
seq_printf(seq, "DEBUG_OOM\n");
#endif
#ifdef DEBUG_SN
#ifdef CONFIG_SCST_DEBUG_SN
seq_printf(seq, "DEBUG_SN\n");
#endif
#ifdef USE_EXPECTED_VALUES
#ifdef CONFIG_SCST_USE_EXPECTED_VALUES
seq_printf(seq, "USE_EXPECTED_VALUES\n");
#endif
#ifdef ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
#ifdef CONFIG_SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
seq_printf(seq, "ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ\n");
#endif
#ifdef SCST_STRICT_SECURITY
#ifdef CONFIG_SCST_STRICT_SECURITY
seq_printf(seq, "SCST_STRICT_SECURITY\n");
#endif
#ifdef SCST_HIGHMEM
#ifdef CONFIG_SCST_HIGHMEM
seq_printf(seq, "SCST_HIGHMEM\n");
#endif
@@ -1943,7 +1943,7 @@ static struct scst_proc_data scst_groups_devices_proc_data = {
.show = scst_groups_devices_show,
};
#if defined(DEBUG) || defined(TRACING)
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
int scst_proc_read_tlb(const struct scst_proc_log *tbl, struct seq_file *seq,
unsigned long log_level, int *first)
+23 -23
View File
@@ -62,7 +62,7 @@ struct scst_cmd *scst_rx_cmd(struct scst_session *sess,
TRACE_ENTRY();
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if (unlikely(sess->shut_phase != SCST_SESS_SPH_READY)) {
PRINT_CRIT_ERROR("%s", "New cmd while shutting down the session");
sBUG();
@@ -203,7 +203,7 @@ void scst_cmd_init_done(struct scst_cmd *cmd, int pref_context)
PRINT_BUFF_FLAG(TRACE_SCSI|TRACE_RCV_BOT, "Recieving CDB",
cmd->cdb, cmd->cdb_len);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if (unlikely(in_irq()) && ((pref_context == SCST_CONTEXT_DIRECT) ||
(pref_context == SCST_CONTEXT_DIRECT_ATOMIC))) {
PRINT_ERROR("Wrong context %d in IRQ from target %s, use "
@@ -348,7 +348,7 @@ static int scst_pre_parse(struct scst_cmd *cmd)
"Should you update scst_scsi_op_table?",
cmd->cdb[0], dev->handler->name);
PRINT_BUFFER("Failed CDB", cmd->cdb, cmd->cdb_len);
#ifdef USE_EXPECTED_VALUES
#ifdef CONFIG_SCST_USE_EXPECTED_VALUES
if (scst_cmd_is_expected_set(cmd)) {
TRACE(TRACE_SCSI, "Using initiator supplied values: "
"direction %d, transfer_len %d",
@@ -494,7 +494,7 @@ static int scst_parse_cmd(struct scst_cmd *cmd)
goto out_error;
}
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if ((cmd->bufflen != 0) &&
((cmd->data_direction == SCST_DATA_NONE) ||
((cmd->sg == NULL) && (state > SCST_CMD_STATE_PREPARE_SPACE)))) {
@@ -509,8 +509,8 @@ static int scst_parse_cmd(struct scst_cmd *cmd)
#endif
if (scst_cmd_is_expected_set(cmd)) {
#ifdef USE_EXPECTED_VALUES
# ifdef EXTRACHECKS
#ifdef CONFIG_SCST_USE_EXPECTED_VALUES
# ifdef CONFIG_SCST_EXTRACHECKS
if ((cmd->data_direction != cmd->expected_data_direction) ||
(cmd->bufflen != cmd->expected_transfer_len)) {
PRINT_ERROR("Expected values don't match decoded ones: "
@@ -618,7 +618,7 @@ out_error:
/* dev_done() will be called as part of the regular cmd's finish */
scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_hardw_error));
#ifndef USE_EXPECTED_VALUES
#ifndef CONFIG_SCST_USE_EXPECTED_VALUES
out_dev_done:
#endif
cmd->state = SCST_CMD_STATE_PRE_DEV_DONE;
@@ -737,7 +737,7 @@ void scst_restart_cmd(struct scst_cmd *cmd, int status, int pref_context)
(long long unsigned int)scst_cmd_get_tag(cmd),
status);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if (in_irq() && ((pref_context == SCST_CONTEXT_DIRECT) ||
(pref_context == SCST_CONTEXT_DIRECT_ATOMIC))) {
PRINT_ERROR("Wrong context %d in IRQ from target %s, use "
@@ -866,7 +866,7 @@ static int scst_rdy_to_xfer(struct scst_cmd *cmd)
cmd->state = SCST_CMD_STATE_DATA_WAIT;
TRACE_DBG("Calling rdy_to_xfer(%p)", cmd);
#ifdef DEBUG_RETRY
#ifdef CONFIG_SCST_DEBUG_RETRY
if (((scst_random() % 100) == 75))
rc = SCST_TGT_RES_QUEUE_FULL;
else
@@ -979,7 +979,7 @@ void scst_rx_data(struct scst_cmd *cmd, int status, int pref_context)
(long long unsigned int)scst_cmd_get_tag(cmd),
status);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if (in_irq() && ((pref_context == SCST_CONTEXT_DIRECT) ||
(pref_context == SCST_CONTEXT_DIRECT_ATOMIC))) {
PRINT_ERROR("Wrong context %d in IRQ from target %s, use "
@@ -1094,7 +1094,7 @@ static void scst_do_cmd_done(struct scst_cmd *cmd, int result,
cmd->host_status = host_byte(result);
cmd->driver_status = driver_byte(result);
if (unlikely(resid != 0)) {
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if ((resid < 0) || (resid > cmd->resp_data_len)) {
PRINT_ERROR("Wrong resid %d (cmd->resp_data_len=%d, "
"op %x)", resid, cmd->resp_data_len,
@@ -1227,7 +1227,7 @@ static void scst_cmd_done_local(struct scst_cmd *cmd, int next_state)
if (next_state == SCST_CMD_STATE_DEFAULT)
next_state = SCST_CMD_STATE_PRE_DEV_DONE;
#if defined(DEBUG)
#if defined(CONFIG_SCST_DEBUG)
if (next_state == SCST_CMD_STATE_PRE_DEV_DONE) {
if (cmd->sg) {
int i;
@@ -1245,7 +1245,7 @@ static void scst_cmd_done_local(struct scst_cmd *cmd, int next_state)
cmd->state = next_state;
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if ((next_state != SCST_CMD_STATE_PRE_DEV_DONE) &&
(next_state != SCST_CMD_STATE_PRE_XMIT_RESP) &&
(next_state != SCST_CMD_STATE_FINISHED)) {
@@ -1761,7 +1761,7 @@ static int scst_do_send_to_midlev(struct scst_cmd *cmd)
if (unlikely(rc != 0))
goto out_done;
#ifndef ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
#ifndef CONFIG_SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
if (scst_cmd_atomic(cmd)) {
TRACE_DBG("Pass-through exec() can not be called in atomic "
"context, rescheduling to the thread (handler %s)",
@@ -2255,7 +2255,7 @@ static int scst_done_cmd_check(struct scst_cmd **pcmd, int *pres)
/* ToDo: all pages ?? */
buflen = scst_get_buf_first(cmd, &buffer);
if (buflen > SCST_INQ_BYTE3) {
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
if (buffer[SCST_INQ_BYTE3] & SCST_INQ_NORMACA_BIT) {
PRINT_INFO("NormACA set for device: "
"lun=%Ld, type 0x%02x. Clear it, "
@@ -2509,7 +2509,7 @@ static int scst_pre_xmit_response(struct scst_cmd *cmd)
TRACE_ENTRY();
#ifdef DEBUG_TM
#ifdef CONFIG_SCST_DEBUG_TM
if (cmd->tm_dbg_delayed && !test_bit(SCST_CMD_ABORTED, &cmd->cmd_flags)) {
if (scst_cmd_atomic(cmd)) {
TRACE_MGMT_DBG("%s", "DEBUG_TM delayed cmd needs a thread");
@@ -2613,7 +2613,7 @@ static int scst_xmit_response(struct scst_cmd *cmd)
TRACE_DBG("Calling xmit_response(%p)", cmd);
#if defined(DEBUG)
#if defined(CONFIG_SCST_DEBUG)
if (cmd->sg) {
int i;
struct scatterlist *sg = cmd->sg;
@@ -2627,7 +2627,7 @@ static int scst_xmit_response(struct scst_cmd *cmd)
}
#endif
#ifdef DEBUG_RETRY
#ifdef CONFIG_SCST_DEBUG_RETRY
if (((scst_random() % 100) == 77))
rc = SCST_TGT_RES_QUEUE_FULL;
else
@@ -3226,7 +3226,7 @@ void scst_process_active_cmd(struct scst_cmd *cmd, int context)
list_add(&cmd->cmd_list_entry,
&cmd->cmd_lists->active_cmd_list);
break;
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
/* not very valid commands */
case SCST_CMD_STATE_DEFAULT:
case SCST_CMD_STATE_NEED_THREAD_CTX:
@@ -3257,7 +3257,7 @@ static void scst_do_job_active(struct list_head *cmd_list,
{
TRACE_ENTRY();
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
{
int c = context & ~SCST_CONTEXT_PROCESSABLE;
sBUG_ON((c != SCST_CONTEXT_DIRECT_ATOMIC) &&
@@ -3332,7 +3332,7 @@ int scst_cmd_thread(void *arg)
}
spin_unlock_irq(&p_cmd_lists->cmd_list_lock);
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
/*
* If kthread_should_stop() is true, we are guaranteed to be either
* on the module unload, or there must be at least one other thread to
@@ -3595,7 +3595,7 @@ static int scst_call_dev_task_mgmt_fn(struct scst_mgmt_cmd *mcmd,
static inline int scst_is_strict_mgmt_fn(int mgmt_fn)
{
switch (mgmt_fn) {
#ifdef ABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING
#ifdef CONFIG_SCST_ABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING
case SCST_ABORT_TASK:
#endif
#if 0
@@ -4610,7 +4610,7 @@ static int scst_process_mgmt_cmd(struct scst_mgmt_cmd *mcmd)
scst_free_mgmt_cmd(mcmd);
goto out;
#ifdef EXTRACHECKS
#ifdef CONFIG_SCST_EXTRACHECKS
case SCST_MGMT_CMD_STATE_EXECUTING:
sBUG();
#endif
+1 -1
View File
@@ -1,7 +1,7 @@
SCST_INC_DIR := /usr/local/include/scst
EXTRA_CFLAGS += -I$(SCST_INC_DIR)
#EXTRA_CFLAGS += -DDEBUG -g
#EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g
#EXTRA_CFLAGS += -Wextra -Wno-unused-parameter
obj-m += ib_srpt.o