Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Laurence Oberman <loberman@redhat.com>
To: linux-scsi@vger.kernel.org
Cc: James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, loberman@redhat.com
Subject: [PATCH v2 1/2] scsi: tcm_qla2xxx: Remove FC-specific SCSI command jammer
Date: Wed,  6 May 2026 10:09:33 -0400	[thread overview]
Message-ID: <20260506140934.1005361-2-loberman@redhat.com> (raw)
In-Reply-To: <20260506140934.1005361-1-loberman@redhat.com>

The jam_host tpg_attrib and CONFIG_TCM_QLA2XXX_DEBUG Kconfig option
introduced in commit 54a5e73f4d6e ("tcm_qla2xxx Add SCSI command
jammer/discard capability") are superseded by the transport-agnostic
initiator-side scsi_jammer module introduced in patch 2/2.

The original implementation had several limitations that motivated this
replacement:

  - Required LIO configured in target mode with a QLogic qla2xxx HBA,
    making it unavailable for iSCSI, FCoE, SAS, and any other transport.
  - Operated on the target side, meaning a separate target host was
    needed to test initiator error recovery.
  - tcm_qla2xxx target mode has effectively been retired and is no
    longer a viable dependency for a general-purpose test tool.
  - Only supported command discard (drop); no stall or flap modes.

The replacement in patch 2/2 operates on the initiator side at the
queuecommand level of the SCSI mid-layer, requires no target-side
configuration, and works identically across all transports that present
a Scsi_Host.

Note: Documentation/scsi/tcm_qla2xxx.txt was already removed from the
tree prior to this patch and does not require deletion here.

Remove CONFIG_TCM_QLA2XXX_DEBUG from Kconfig, the jam_host field from
struct tcm_qla2xxx_tpg_attrib, and all associated #ifdef blocks from
tcm_qla2xxx.c.

Signed-off-by: Laurence Oberman <loberman@redhat.com>
---
 drivers/scsi/qla2xxx/Kconfig       |  9 ---------
 drivers/scsi/qla2xxx/tcm_qla2xxx.c | 23 -----------------------
 drivers/scsi/qla2xxx/tcm_qla2xxx.h |  1 -
 3 files changed, 33 deletions(-)

diff --git a/drivers/scsi/qla2xxx/Kconfig b/drivers/scsi/qla2xxx/Kconfig
index 6946d7155bc2..e26b14463c4d 100644
--- a/drivers/scsi/qla2xxx/Kconfig
+++ b/drivers/scsi/qla2xxx/Kconfig
@@ -37,12 +37,3 @@ config TCM_QLA2XXX
 	  Say Y here to enable the TCM_QLA2XXX fabric module for QLogic 24xx+
 	  series target mode HBAs.
 
-if TCM_QLA2XXX
-config TCM_QLA2XXX_DEBUG
-	bool "TCM_QLA2XXX fabric module DEBUG mode for QLogic 24xx+ series target mode HBAs"
-	default n
-	help
-	  Say Y here to enable the TCM_QLA2XXX fabric module DEBUG for
-	  QLogic 24xx+ series target mode HBAs.
-	  This will include code to enable the SCSI command jammer.
-endif
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index 28df9025def0..1c6d658d9c7c 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -450,13 +450,6 @@ static int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd,
 	struct se_cmd *se_cmd = &cmd->se_cmd;
 	struct se_session *se_sess;
 	struct fc_port *sess;
-#ifdef CONFIG_TCM_QLA2XXX_DEBUG
-	struct se_portal_group *se_tpg;
-	struct tcm_qla2xxx_tpg *tpg;
-#endif
-	int rc, target_flags = TARGET_SCF_ACK_KREF;
-	unsigned long flags;
-
 	if (bidi)
 		target_flags |= TARGET_SCF_BIDI_OP;
 
@@ -475,15 +468,6 @@ static int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd,
 		return -EINVAL;
 	}
 
-#ifdef CONFIG_TCM_QLA2XXX_DEBUG
-	se_tpg = se_sess->se_tpg;
-	tpg = container_of(se_tpg, struct tcm_qla2xxx_tpg, se_tpg);
-	if (unlikely(tpg->tpg_attrib.jam_host)) {
-		/* return, and dont run target_submit_cmd,discarding command */
-		return 0;
-	}
-#endif
-	cmd->qpair->tgt_counters.qla_core_sbt_cmd++;
 
 	spin_lock_irqsave(&sess->sess_cmd_lock, flags);
 	list_add_tail(&cmd->sess_cmd_list, &sess->sess_cmd_list);
@@ -903,9 +887,6 @@ DEF_QLA_TPG_ATTRIB(cache_dynamic_acls);
 DEF_QLA_TPG_ATTRIB(demo_mode_write_protect);
 DEF_QLA_TPG_ATTRIB(prod_mode_write_protect);
 DEF_QLA_TPG_ATTRIB(demo_mode_login_only);
-#ifdef CONFIG_TCM_QLA2XXX_DEBUG
-DEF_QLA_TPG_ATTRIB(jam_host);
-#endif
 
 static struct configfs_attribute *tcm_qla2xxx_tpg_attrib_attrs[] = {
 	&tcm_qla2xxx_tpg_attrib_attr_generate_node_acls,
@@ -913,9 +894,6 @@ static struct configfs_attribute *tcm_qla2xxx_tpg_attrib_attrs[] = {
 	&tcm_qla2xxx_tpg_attrib_attr_demo_mode_write_protect,
 	&tcm_qla2xxx_tpg_attrib_attr_prod_mode_write_protect,
 	&tcm_qla2xxx_tpg_attrib_attr_demo_mode_login_only,
-#ifdef CONFIG_TCM_QLA2XXX_DEBUG
-	&tcm_qla2xxx_tpg_attrib_attr_jam_host,
-#endif
 	NULL,
 };
 
@@ -1030,7 +1008,6 @@ static struct se_portal_group *tcm_qla2xxx_make_tpg(struct se_wwn *wwn,
 	tpg->tpg_attrib.demo_mode_write_protect = 1;
 	tpg->tpg_attrib.cache_dynamic_acls = 1;
 	tpg->tpg_attrib.demo_mode_login_only = 1;
-	tpg->tpg_attrib.jam_host = 0;
 
 	ret = core_tpg_register(wwn, &tpg->se_tpg, SCSI_PROTOCOL_FCP);
 	if (ret < 0) {
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.h b/drivers/scsi/qla2xxx/tcm_qla2xxx.h
index 147cf6c90366..0f1650f83124 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.h
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.h
@@ -34,7 +34,6 @@ struct tcm_qla2xxx_tpg_attrib {
 	int prod_mode_write_protect;
 	int demo_mode_login_only;
 	int fabric_prot_type;
-	int jam_host;
 };
 
 struct tcm_qla2xxx_tpg {
-- 
2.54.0


  reply	other threads:[~2026-05-06 14:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 14:09 [PATCH v2 0/2] scsi: Replace FC-specific jammer with transport-agnostic fault injector Laurence Oberman
2026-05-06 14:09 ` Laurence Oberman [this message]
2026-05-06 14:09 ` [PATCH v2 2/2] scsi: Add transport-agnostic initiator-side " Laurence Oberman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260506140934.1005361-2-loberman@redhat.com \
    --to=loberman@redhat.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox