|
@@ -442,6 +442,10 @@ 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 qla_tgt_sess *sess;
|
|
|
+#ifdef CONFIG_TCM_QLA2XXX_DEBUG
|
|
|
+ struct se_portal_group *se_tpg;
|
|
|
+ struct tcm_qla2xxx_tpg *tpg;
|
|
|
+#endif
|
|
|
int flags = TARGET_SCF_ACK_KREF;
|
|
|
|
|
|
if (bidi)
|
|
@@ -462,6 +466,15 @@ 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->vha->tgt_counters.qla_core_sbt_cmd++;
|
|
|
return target_submit_cmd(se_cmd, se_sess, cdb, &cmd->sense_buffer[0],
|
|
|
cmd->unpacked_lun, data_length, fcp_task_attr,
|
|
@@ -812,6 +825,9 @@ 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,
|
|
@@ -819,6 +835,9 @@ 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,
|
|
|
};
|
|
|
|
|
@@ -991,6 +1010,7 @@ static struct se_portal_group *tcm_qla2xxx_make_tpg(
|
|
|
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) {
|