scst: Normalize transport indentation and line wrapping

Normalize transport indentation, operator spacing, pointer placement,
continuation alignment and long declarations, calls and expressions.
Keep changes at existing argument/operator boundaries and retain
literal contents, operand evaluation order and preprocessor branches.
Keep conditional directives at column zero; align their continued
operands independently.

Checkpatch reports SPACING, CODE_INDENT, POINTER_LOCATION. One example:

  No space is necessary after a cast

Checkpatch reports SPACING, PARENTHESIS_ALIGNMENT, LINE_SPACING. One
example:

  spaces preferred around that '|' (ctx:VxV)

Checkpatch reports OPEN_ENDED_LINE:

  Lines should not end with a '('

Checkpatch reports LONG_LINE:

  line length of 128 exceeds 100 columns
This commit is contained in:
Gleb Chesnokov
2026-10-21 22:12:26 +03:00
parent b038bc9398
commit 3b38539b3f
10 changed files with 121 additions and 143 deletions
+1 -1
View File
@@ -41,7 +41,7 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) || \
(defined(RHEL_RELEASE_CODE) && \
RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(9, 2))
RHEL_RELEASE_CODE - 0 >= RHEL_RELEASE_VERSION(9, 2))
/*
* Backport mm_segment_t to save compatibility with older kernel versions.
*
+8 -7
View File
@@ -1088,7 +1088,8 @@ static int iscsi_set_prelim_r2t_len_to_receive(struct iscsi_cmnd *req)
if (req_hdr->flags & ISCSI_CMD_FINAL) {
if (req_hdr->flags & ISCSI_CMD_WRITE)
iscsi_set_not_received_data_len(req,
be32_to_cpu(req_hdr->data_length) - req->pdu.datasize);
be32_to_cpu(req_hdr->data_length) -
req->pdu.datasize);
goto out;
}
@@ -1216,7 +1217,7 @@ static int create_reject_rsp(struct iscsi_cmnd *req, int reason, bool get_data)
* RFC 3720.
*/
set_scst_preliminary_status_rsp(req, get_data,
SCST_LOAD_SENSE(scst_sense_invalid_message));
SCST_LOAD_SENSE(scst_sense_invalid_message));
}
}
@@ -1953,7 +1954,7 @@ int cmnd_rx_continue(struct iscsi_cmnd *req)
PRINT_ERROR("Unexpected unsolicited data (ITT %x CDB %x)",
req->pdu.bhs.itt, req_hdr->scb[0]);
set_scst_preliminary_status_rsp(req, true,
SCST_LOAD_SENSE(iscsi_sense_unexpected_unsolicited_data));
SCST_LOAD_SENSE(iscsi_sense_unexpected_unsolicited_data));
}
}
@@ -2011,7 +2012,7 @@ static int scsi_cmnd_start(struct iscsi_cmnd *req)
if (unlikely(sz < 0)) {
PRINT_ERROR("BIDI data transfer, but initiator not supplied Bidirectional Read Expected Data Transfer Length AHS");
set_scst_preliminary_status_rsp(req, true,
SCST_LOAD_SENSE(scst_sense_parameter_value_invalid));
SCST_LOAD_SENSE(scst_sense_parameter_value_invalid));
} else {
dir = SCST_DATA_BIDI;
scst_cmd_set_expected(scst_cmd, dir, sz);
@@ -2151,7 +2152,7 @@ static int data_out_start(struct iscsi_cmnd *cmnd)
PRINT_ERROR("Data size (%d) > R2T length to receive (%d)",
cmnd->pdu.datasize, orig_req->r2t_len_to_receive);
set_scst_preliminary_status_rsp(orig_req, false,
SCST_LOAD_SENSE(iscsi_sense_incorrect_amount_of_data));
SCST_LOAD_SENSE(iscsi_sense_incorrect_amount_of_data));
goto go;
}
@@ -4179,8 +4180,8 @@ static int __init iscsi_init(void)
sg_init_table(&dummy_sg[0], ARRAY_SIZE(dummy_sg));
sg_set_page(&dummy_sg[0], dummy_page, PAGE_SIZE, 0);
iscsi_cmnd_abort_mempool = mempool_create_kmalloc_pool(2500,
sizeof(struct iscsi_cmnd_abort_params));
iscsi_cmnd_abort_mempool =
mempool_create_kmalloc_pool(2500, sizeof(struct iscsi_cmnd_abort_params));
if (!iscsi_cmnd_abort_mempool) {
err = -ENOMEM;
goto out_free_dummy;
+1 -1
View File
@@ -997,7 +997,7 @@ int __init isert_init_login_devs(unsigned int ndevs)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 4))
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 4))
isert_class = class_create(THIS_MODULE, "isert_scst");
#else
isert_class = class_create("isert_scst");
+3 -2
View File
@@ -140,7 +140,8 @@ static void trace_conn_close(struct iscsi_conn *conn)
list_for_each_entry(cmnd, &conn->cmd_list, cmd_list_entry) {
TRACE_CONN_CLOSE_DBG("cmd %p, scst_cmd %p, scst_state %x, scst_cmd state %d, r2t_len_to_receive %d, ref_cnt %d, sn %u, parent_req %p, pending %d",
cmnd, cmnd->scst_cmd, cmnd->scst_state,
!cmnd->parent_req && cmnd->scst_cmd ? cmnd->scst_cmd->state : -1,
!cmnd->parent_req && cmnd->scst_cmd ?
cmnd->scst_cmd->state : -1,
cmnd->r2t_len_to_receive, atomic_read(&cmnd->ref_cnt),
cmnd->pdu.bhs.sn, cmnd->parent_req, cmnd->pending);
}
@@ -625,7 +626,7 @@ static int iscsi_rx_check_ddigest(struct iscsi_conn *conn)
false);
} else {
set_scst_preliminary_status_rsp(orig_req, false,
SCST_LOAD_SENSE(iscsi_sense_crc_error));
SCST_LOAD_SENSE(iscsi_sense_crc_error));
/*
* Let's prelim complete cmnd too to
* handle the DATA OUT case
+5 -3
View File
@@ -146,7 +146,8 @@ static void sess_params_check(struct iscsi_kern_params_info *info)
}
/* target_mutex supposed to be locked */
static void sess_params_set(struct iscsi_sess_params *params, const struct iscsi_kern_params_info *info)
static void sess_params_set(struct iscsi_sess_params *params,
const struct iscsi_kern_params_info *info)
{
const s32 *iparams = info->session_params;
@@ -176,7 +177,8 @@ static void sess_params_set(struct iscsi_sess_params *params, const struct iscsi
SET_PARAM(params, info, iparams, initiator_recv_data_length);
}
static void sess_params_get(const struct iscsi_sess_params *params, struct iscsi_kern_params_info *info)
static void sess_params_get(const struct iscsi_sess_params *params,
struct iscsi_kern_params_info *info)
{
s32 *iparams = info->session_params;
@@ -274,7 +276,7 @@ static int iscsi_tgt_params_set(struct iscsi_session *session, struct iscsi_kern
TRACE_DBG("Schedule Nop-In work for conn %p",
conn);
schedule_delayed_work(&conn->nop_in_delayed_work,
conn->nop_in_interval + ISCSI_ADD_SCHED_TIME);
conn->nop_in_interval + ISCSI_ADD_SCHED_TIME);
}
spin_unlock_bh(&conn->conn_thr_pool->rd_lock);
}
+2 -2
View File
@@ -87,7 +87,7 @@ size_t qlt_add_vtarget(u64 port_name, u64 node_name, u64 parent_host)
return -EINVAL;
}
npiv_vha = (struct scsi_qla_host *) vport->dd_data;
npiv_vha = (struct scsi_qla_host *)vport->dd_data;
scsi_host_get(npiv_vha->host);
return 0;
@@ -118,7 +118,7 @@ size_t qlt_del_vtarget(u64 port_name)
vport->port_name == port_name) {
match = 1;
dev_info(&vha->hw->pdev->dev,
"%s: port_name %llx\n",
"%s: port_name %llx\n",
__func__, port_name);
break;
}
+91 -116
View File
@@ -63,7 +63,6 @@
#define SQA_MAX_HW_PENDING_TIME 60 /* in seconds */
#ifdef CONFIG_SCST_DEBUG
#define SQA_DEFAULT_LOG_FLAGS (TRACE_FUNCTION | TRACE_LINE | TRACE_PID | \
TRACE_OUT_OF_MEM | TRACE_MGMT | TRACE_MGMT_DEBUG | \
@@ -183,7 +182,6 @@ static enum scst_exec_context scst_work_context = SCST_CONTEXT_THREAD;
static enum scst_exec_context scst_work_context = SCST_CONTEXT_TASKLET;
#endif
static struct cmd_state_name {
u8 state;
char *str;
@@ -345,8 +343,7 @@ static inline void qla_tgt_set_cmd_prot_op(struct qla_tgt_cmd *cmd,
{
struct scst_cmd *scst_cmd = cmd->scst_cmd;
int dir = scst_cmd_get_data_direction(scst_cmd);
int action = scst_get_dif_action(
scst_get_tgt_dif_actions(scst_cmd->cmd_dif_actions));
int action = scst_get_dif_action(scst_get_tgt_dif_actions(scst_cmd->cmd_dif_actions));
if (action == SCST_DIF_ACTION_NONE) {
cmd->se_cmd.prot_op = TARGET_PROT_NORMAL;
@@ -386,7 +383,6 @@ static inline void qla_tgt_set_cmd_prot_op(struct qla_tgt_cmd *cmd,
}
break;
case SCST_DIF_ACTION_INSERT:
switch (dir) {
case SCST_DATA_READ:
@@ -411,7 +407,6 @@ static inline void qla_tgt_set_cmd_prot_op(struct qla_tgt_cmd *cmd,
}
break;
case SCST_DIF_ACTION_PASS_CHECK:
switch (dir) {
case SCST_DATA_READ:
@@ -436,7 +431,6 @@ static inline void qla_tgt_set_cmd_prot_op(struct qla_tgt_cmd *cmd,
}
break;
case SCST_DIF_ACTION_PASS: // nocheck
switch (dir) {
case SCST_DATA_READ:
@@ -455,7 +449,6 @@ static inline void qla_tgt_set_cmd_prot_op(struct qla_tgt_cmd *cmd,
}
break;
default:
cmd->se_cmd.prot_op = TARGET_PROT_NORMAL;
EXTRACHECKS_BUG_ON(action);
@@ -527,7 +520,6 @@ static void sqa_qla2xxx_put_cmd_ref(struct qla_tgt_cmd *cmd)
static DEFINE_MUTEX(sqa_mutex);
/* Stub function for unimplemented functionality. */
static inline int scst_cmd_get_ppl_offset(const struct scst_cmd *scst_cmd)
{
@@ -535,7 +527,7 @@ static inline int scst_cmd_get_ppl_offset(const struct scst_cmd *scst_cmd)
}
static int sqa_qla2xxx_handle_cmd(scsi_qla_host_t *vha,
struct qla_tgt_cmd *cmd, unsigned char *cdb,
struct qla_tgt_cmd *cmd, unsigned char *cdb,
u32 data_length, int task_codes,
int data_dir, int bidi)
{
@@ -548,14 +540,13 @@ static int sqa_qla2xxx_handle_cmd(scsi_qla_host_t *vha,
TRACE_ENTRY();
TRACE_DBG("sqatgt(%ld/%d): Handling command: length=%d, fcp_task_attr=%d, direction=%d, bidirectional=%d lun=%llx cdb=%x tag=%d cmd %p ulpcmd %p\n",
vha->host_no, vha->vp_idx, data_length, task_codes,
vha->host_no, vha->vp_idx, data_length, task_codes,
data_dir, bidi, cmd->unpacked_lun,
cdb[0],
atio->u.isp24.exchange_addr, cmd, cmd->scst_cmd);
cmd->scst_cmd = scst_rx_cmd(scst_sess,
(u8 *)&atio->u.isp24.fcp_cmnd.lun,
(u8 *)&atio->u.isp24.fcp_cmnd.lun,
sizeof(atio->u.isp24.fcp_cmnd.lun),
cdb,
cmd->cdb_len,
@@ -563,7 +554,7 @@ static int sqa_qla2xxx_handle_cmd(scsi_qla_host_t *vha,
if (!cmd->scst_cmd) {
PRINT_ERROR("sqatgt(%ld/%d): scst_rx_cmd function failed.",
vha->host_no, vha->vp_idx);
vha->host_no, vha->vp_idx);
res = -EFAULT;
goto out;
}
@@ -589,26 +580,26 @@ static int sqa_qla2xxx_handle_cmd(scsi_qla_host_t *vha,
break;
case ATIO_HEAD_OF_QUEUE:
scst_cmd_set_queue_type(cmd->scst_cmd,
SCST_CMD_QUEUE_HEAD_OF_QUEUE);
SCST_CMD_QUEUE_HEAD_OF_QUEUE);
break;
case ATIO_ORDERED_QUEUE:
scst_cmd_set_queue_type(cmd->scst_cmd,
SCST_CMD_QUEUE_ORDERED);
SCST_CMD_QUEUE_ORDERED);
break;
case ATIO_ACA_QUEUE:
scst_cmd_set_queue_type(cmd->scst_cmd,
SCST_CMD_QUEUE_ACA);
SCST_CMD_QUEUE_ACA);
break;
case ATIO_UNTAGGED:
scst_cmd_set_queue_type(cmd->scst_cmd,
SCST_CMD_QUEUE_UNTAGGED);
SCST_CMD_QUEUE_UNTAGGED);
break;
default:
PRINT_ERROR("sqatgt(%ld/%d): unknown task code %x, use ORDERED instead.",
vha->host_no, vha->vp_idx,
atio->u.isp24.fcp_cmnd.task_attr);
scst_cmd_set_queue_type(cmd->scst_cmd,
SCST_CMD_QUEUE_ORDERED);
SCST_CMD_QUEUE_ORDERED);
break;
}
@@ -633,7 +624,7 @@ static void sqa_qla2xxx_handle_data(struct qla_tgt_cmd *cmd)
if (unlikely(cmd->aborted)) {
scst_set_cmd_error(scst_cmd,
SCST_LOAD_SENSE(scst_sense_internal_failure));
SCST_LOAD_SENSE(scst_sense_internal_failure));
rx_status = SCST_RX_STATUS_ERROR_SENSE_SET;
} else if (likely(cmd->write_data_transferred)) {
rx_status = SCST_RX_STATUS_SUCCESS;
@@ -643,26 +634,26 @@ static void sqa_qla2xxx_handle_data(struct qla_tgt_cmd *cmd)
case DIF_ERR_GRD:
scst_dif_acc_guard_check_failed_tgt(scst_cmd);
scst_set_cmd_error(scst_cmd,
SCST_LOAD_SENSE(scst_logical_block_guard_check_failed));
SCST_LOAD_SENSE(scst_logical_block_guard_check_failed));
break;
case DIF_ERR_REF:
scst_dif_acc_ref_check_failed_tgt(scst_cmd);
scst_set_cmd_error(scst_cmd,
SCST_LOAD_SENSE(scst_logical_block_ref_tag_check_failed));
SCST_LOAD_SENSE(scst_logical_block_ref_tag_check_failed));
break;
case DIF_ERR_APP:
scst_dif_acc_app_check_failed_tgt(scst_cmd);
scst_set_cmd_error(scst_cmd,
SCST_LOAD_SENSE(scst_logical_block_app_tag_check_failed));
SCST_LOAD_SENSE(scst_logical_block_app_tag_check_failed));
break;
case DIF_ERR_NONE:
default:
if (cmd->srr_failed)
scst_set_cmd_error(scst_cmd,
SCST_LOAD_SENSE(sense_initiator_detected_error));
SCST_LOAD_SENSE(sense_initiator_detected_error));
else
scst_set_cmd_error(scst_cmd,
SCST_LOAD_SENSE(scst_sense_aborted_command));
SCST_LOAD_SENSE(scst_sense_aborted_command));
break;
}
}
@@ -715,14 +706,14 @@ static int sqa_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, u64 lun,
case QLA_TGT_LUN_RESET: //TMR_LUN_RESET:
TRACE(TRACE_MGMT, "sqatgt(%ld/%d) LUN_RESET received.",
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
rc = scst_rx_mgmt_fn_lun(scst_sess, SCST_LUN_RESET,
&sl, lun_size, SCST_ATOMIC, mcmd);
break;
case QLA_TGT_CLEAR_TS: //TMR_CLEAR_TASK_SET:
TRACE(TRACE_MGMT, "sqatgt(%ld/%d) CLEAR_TS received.",
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
rc = scst_rx_mgmt_fn_lun(scst_sess, SCST_CLEAR_TASK_SET,
&sl, lun_size, SCST_ATOMIC, mcmd);
break;
@@ -730,23 +721,23 @@ static int sqa_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, u64 lun,
case QLA_TGT_2G_ABORT_TASK:// TMR_ABORT_TASK:
case QLA_TGT_ABTS:
TRACE(TRACE_MGMT, "sqatgt(%ld/%d): TMR_ABORT_TASK received.",
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
rc = scst_rx_mgmt_fn_tag(scst_sess, SCST_ABORT_TASK, tag,
SCST_ATOMIC, mcmd);
break;
case QLA_TGT_ABORT_TS:// TMR_ABORT_TASK_SET:
TRACE(TRACE_MGMT, "sqatgt(%ld/%d) ABORT_TS received.",
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
rc = scst_rx_mgmt_fn_lun(scst_sess, SCST_ABORT_TASK_SET,
&sl, lun_size, SCST_ATOMIC, mcmd);
break;
case QLA_TGT_ABORT_ALL: // TMR_TARGET_COLD_RESET:
TRACE(TRACE_MGMT, "sqatgt(%ld/%d): ABORT_ALL_TASKS received.",
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
rc = scst_rx_mgmt_fn_lun(scst_sess, SCST_ABORT_ALL_TASKS,
&sl, lun_size, SCST_ATOMIC, mcmd);
&sl, lun_size, SCST_ATOMIC, mcmd);
break;
case QLA_TGT_ABORT_ALL_SESS: //TMR_TARGET_ABORT_ALL:
@@ -754,21 +745,21 @@ static int sqa_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, u64 lun,
"sqatgt(%ld/%d): ABORT_ALL_TASKS_SESS received.",
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
rc = scst_rx_mgmt_fn_lun(scst_sess, SCST_ABORT_ALL_TASKS_SESS,
&sl, lun_size, SCST_ATOMIC, mcmd);
&sl, lun_size, SCST_ATOMIC, mcmd);
break;
case QLA_TGT_NEXUS_LOSS_SESS: //TMR_NEXUS_LOSS_SESSION:
TRACE(TRACE_MGMT, "sqatgt(%ld/%d): NEXUS_LOSS_SESS received.",
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
rc = scst_rx_mgmt_fn_lun(scst_sess, SCST_NEXUS_LOSS_SESS,
&sl, lun_size, SCST_ATOMIC, mcmd);
&sl, lun_size, SCST_ATOMIC, mcmd);
break;
case QLA_TGT_NEXUS_LOSS: //TMR_NEXUS_LOSS:
TRACE(TRACE_MGMT, "sqatgt(%ld/%d): NEXUS_LOSS received.",
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
sess->tgt->vha->host_no, sess->tgt->vha->vp_idx);
rc = scst_rx_mgmt_fn_lun(scst_sess, SCST_NEXUS_LOSS,
&sl, lun_size, SCST_ATOMIC, mcmd);
&sl, lun_size, SCST_ATOMIC, mcmd);
break;
default:
@@ -826,7 +817,6 @@ static void sqa_qla2xxx_free_cmd(struct qla_tgt_cmd *cmd)
TRACE_EXIT();
}
static void sqa_qla2xxx_free_mcmd(struct qla_tgt_mgmt_cmd *mcmd)
{
TRACE_ENTRY();
@@ -852,7 +842,7 @@ static void sqa_qla2xxx_free_session(struct fc_port *fcport)
TRACE_ENTRY();
TRACE_MGMT_DBG("sqatgt(%ld/%d): Deleting session %8phC fcid=%3phC\n",
vha->host_no, vha->vp_idx, fcport->port_name, &fcport->d_id);
vha->host_no, vha->vp_idx, fcport->port_name, &fcport->d_id);
fcport->unreg_done = &c;
/*
@@ -875,7 +865,7 @@ static void sqa_qla2xxx_free_session(struct fc_port *fcport)
wait_for_completion(&c);
TRACE_MGMT_DBG("sqatgt(%ld/%d): Unregister completed %8phC done\n",
vha->host_no, vha->vp_idx, fcport->port_name);
vha->host_no, vha->vp_idx, fcport->port_name);
kfree(se_sess);
@@ -883,14 +873,14 @@ static void sqa_qla2xxx_free_session(struct fc_port *fcport)
}
static void sqa_qla2xxx_update_sess(struct fc_port *sess, port_id_t s_id,
u16 loop_id, bool conf_compl_supported)
u16 loop_id, bool conf_compl_supported)
{
TRACE_ENTRY();
TRACE_EXIT();
}
static int sqa_qla2xxx_check_initiator_node_acl(scsi_qla_host_t *vha,
unsigned char *fc_wwpn, struct fc_port *fcport)
unsigned char *fc_wwpn, struct fc_port *fcport)
{
int res = -ENOMEM;
char *ini_name;
@@ -918,7 +908,7 @@ static int sqa_qla2xxx_check_initiator_node_acl(scsi_qla_host_t *vha,
res = -ESRCH;
scst_sess = scst_register_session(sqa_tgt->scst_tgt, 0,
ini_name, fcport, NULL, NULL);
ini_name, fcport, NULL, NULL);
if (!scst_sess) {
PRINT_ERROR("sqatgt(%ld/%d): SCST session registration failed, all commands will be refused: pwwn=%s",
vha->host_no, vha->vp_idx, ini_name);
@@ -1020,14 +1010,12 @@ static int sqa_close_session(struct scst_session *scst_sess)
return 0;
}
static void sqa_qla2xxx_shutdown_sess(struct fc_port *sess)
{
TRACE_ENTRY();
TRACE_EXIT();
}
/*
* sysfs functions from here forward.
*/
@@ -1104,7 +1092,7 @@ static ssize_t sqa_node_name_show(struct kobject *kobj,
ha = tgt->ha;
if (qla_tgt_mode_enabled(tgt->vha) || qla_dual_mode_enabled(tgt->vha) ||
!ha->tgt.node_name_set)
!ha->tgt.node_name_set)
node_name = tgt->vha->node_name;
else
node_name = ha->tgt.tgt_node_name;
@@ -1173,7 +1161,7 @@ abort:
* target with subsequent restart.
*/
if (qla_tgt_mode_enabled(tgt->vha) ||
qla_dual_mode_enabled(tgt->vha)) {
qla_dual_mode_enabled(tgt->vha)) {
qlt_stop_phase1(tgt);
qlt_stop_phase2(tgt);
qlt_enable_vha(tgt->vha);
@@ -1266,12 +1254,12 @@ static ssize_t sqa_store_expl_conf_enabled(struct kobject *kobj,
case '0':
QLA_DIS_CONF(ha);
PRINT_INFO("sqatgt(%ld/%d) explicit conformations disabled",
vha->host_no, vha->vp_idx);
vha->host_no, vha->vp_idx);
break;
case '1':
QLA_ENA_CONF(ha)
PRINT_INFO("sqatgt(%ld/%d) explicit conformations enabled",
vha->host_no, vha->vp_idx);
vha->host_no, vha->vp_idx);
break;
default:
PRINT_ERROR("sqatgt(%ld/%d): Requested action not understood: %s",
@@ -1357,7 +1345,7 @@ static int sqa_parse_wwn(const char *ns, u64 *nm)
else
return -EINVAL;
if (i % 2) {
wwn[i/2] = j & 0xff;
wwn[i / 2] = j & 0xff;
j = 0;
if (i < 15 && (':' != *ns++))
return -EINVAL;
@@ -1455,7 +1443,7 @@ static int sqa_init_scst_tgt(struct scsi_qla_host *vha)
#if QLA_ENABLE_PI
if (IS_T10_PI_CAPABLE(vha->hw)) {
scst_tgt_set_supported_dif_block_sizes(scst_tgt,
qla_tgt_supported_dif_block_size);
qla_tgt_supported_dif_block_size);
scst_tgt_set_dif_supported(scst_tgt, true);
scst_tgt_set_hw_dif_type1_supported(scst_tgt, true);
scst_tgt_set_hw_dif_type3_supported(scst_tgt, true);
@@ -1491,7 +1479,7 @@ static int sqa_init_scst_tgt(struct scsi_qla_host *vha)
list_add_tail(&sqa_tgt->list, &sqa_tgt_glist);
TRACE(TRACE_MGMT, "sqatgt(%ld/%d): Registering target pwwn=%s scst_tgt %p sqa_tgt %p",
vha->host_no, vha->vp_idx, pwwn, scst_tgt, sqa_tgt);
vha->host_no, vha->vp_idx, pwwn, scst_tgt, sqa_tgt);
done:
kfree(pwwn);
return res;
@@ -1507,7 +1495,6 @@ static void sqa_get_target_list(void)
mutex_unlock(&sqa_mutex);
}
static void sqa_qla2xxx_add_target(struct scsi_qla_host *vha)
{
if (!vha) {
@@ -1535,7 +1522,7 @@ static void sqa_qla2xxx_remove_target(struct scsi_qla_host *vha)
TRACE_ENTRY();
TRACE(TRACE_MGMT, "Unregistering target for host %ld(%p)",
vha->host_no, vha);
vha->host_no, vha);
scst_unregister_target(sqa_tgt->scst_tgt);
TRACE_EXIT();
}
@@ -1547,9 +1534,9 @@ static void sqa_qla2xxx_drop_lport(struct qla_tgt *tgt)
TRACE_ENTRY();
if (vha->vha_tgt.qla_tgt->tgt_stop &&
!vha->vha_tgt.qla_tgt->tgt_stopped) {
!vha->vha_tgt.qla_tgt->tgt_stopped) {
PRINT_INFO("sqatgt(%ld/%d): calling qlt_stop_phase2.\n",
vha->host_no, vha->vp_idx);
vha->host_no, vha->vp_idx);
qlt_stop_phase2(vha->vha_tgt.qla_tgt);
}
@@ -1585,11 +1572,10 @@ static int sqa_target_release(struct scst_tgt *scst_tgt)
TRACE_ENTRY();
if (vha->vha_tgt.target_lport_ptr) {
if (!vha->vha_tgt.qla_tgt->tgt_stop &&
!vha->vha_tgt.qla_tgt->tgt_stopped) {
!vha->vha_tgt.qla_tgt->tgt_stopped) {
PRINT_INFO("sqatgt(%ld:%d: calling qlt_stop_phase1.\n",
vha->host_no, vha->vp_idx);
vha->host_no, vha->vp_idx);
qlt_stop_phase1(vha->vha_tgt.qla_tgt);
}
@@ -1615,7 +1601,7 @@ static int sqa_target_release(struct scst_tgt *scst_tgt)
mutex_unlock(&sqa_mutex);
TRACE(TRACE_MGMT, "sqatgt(%ld/%d): Target release finished sqa_tgt %p",
vha->host_no, vha->vp_idx, sqa_tgt);
vha->host_no, vha->vp_idx, sqa_tgt);
sqa_free_tgt(sqa_tgt);
@@ -1633,10 +1619,9 @@ static int sqa_xmit_response(struct scst_cmd *scst_cmd)
cmd = scst_cmd_get_tgt_priv(scst_cmd);
if (scst_cmd_aborted_on_xmit(scst_cmd)) {
TRACE_MGMT_DBG(
"sqatgt(%ld/%d): tag %lld: skipping send response for aborted cmd",
cmd->vha->host_no, cmd->vha->vp_idx,
scst_cmd_get_tag(scst_cmd));
TRACE_MGMT_DBG("sqatgt(%ld/%d): tag %lld: skipping send response for aborted cmd",
cmd->vha->host_no, cmd->vha->vp_idx,
scst_cmd_get_tag(scst_cmd));
qlt_abort_cmd(cmd);
scst_set_delivery_status(scst_cmd, SCST_CMD_DELIVERY_ABORTED);
scst_tgt_cmd_done(scst_cmd, SCST_CONTEXT_DIRECT);
@@ -1700,7 +1685,7 @@ static int sqa_xmit_response(struct scst_cmd *scst_cmd)
cmd->se_cmd.prot_type, cmd->se_cmd.prot_op);
if (cmd->se_cmd.prot_op == TARGET_PROT_DIN_INSERT &&
(!cmd->prot_sg_cnt || !cmd->prot_sg)) {
(!cmd->prot_sg_cnt || !cmd->prot_sg)) {
PRINT_ERROR("qla2x00t(%ld): %s: DIN Insert w/out DIF buf[%p:%d]",
cmd->vha->host_no, __func__, cmd->prot_sg,
cmd->prot_sg_cnt);
@@ -1713,7 +1698,7 @@ static int sqa_xmit_response(struct scst_cmd *scst_cmd)
*/
if (scst_get_resid(scst_cmd, &residual, NULL)) {
TRACE_DBG("sqatgt(%ld/%d): Have residual, count=%d",
cmd->vha->host_no, cmd->vha->vp_idx, residual);
cmd->vha->host_no, cmd->vha->vp_idx, residual);
if (residual > 0)
cmd->se_cmd.se_cmd_flags |= SCF_UNDERFLOW_BIT;
if (residual < 0) {
@@ -1723,7 +1708,6 @@ static int sqa_xmit_response(struct scst_cmd *scst_cmd)
cmd->se_cmd.residual_count = residual;
}
TRACE_DBG("sqatgt(%ld/%d): is_send_status=%x, bufflen=%d, sg_cnt=%d, flipped dma_direction=%d resid=%d",
cmd->vha->host_no, cmd->vha->vp_idx, is_send_status,
cmd->bufflen, cmd->sg_cnt, cmd->dma_data_direction,
@@ -1821,7 +1805,6 @@ static int sqa_rdy_to_xfer(struct scst_cmd *scst_cmd)
return res;
}
static void sqa_on_free_cmd(struct scst_cmd *scst_cmd)
{
struct qla_tgt_cmd *cmd = scst_cmd_get_tgt_priv(scst_cmd);
@@ -1829,7 +1812,7 @@ static void sqa_on_free_cmd(struct scst_cmd *scst_cmd)
TRACE_ENTRY();
TRACE(TRACE_SCSI, "sqatgt(%ld/%d): Freeing command %p: tag=%lld",
cmd->vha->host_no, cmd->vha->vp_idx, scst_cmd,
cmd->vha->host_no, cmd->vha->vp_idx, scst_cmd,
scst_cmd_get_tag(scst_cmd));
cmd->trc_flags |= TRC_CMD_FREE;
@@ -1889,8 +1872,7 @@ static void sqa_task_mgmt_fn_done(struct scst_mgmt_cmd *scst_mcmd)
vha->host_no, vha->vp_idx, scst_mcmd,
scst_mcmd->status, scst_mcmd->state);
mcmd->fc_tm_rsp = sqa_convert_to_fc_tm_status(
scst_mgmt_cmd_get_status(scst_mcmd));
mcmd->fc_tm_rsp = sqa_convert_to_fc_tm_status(scst_mgmt_cmd_get_status(scst_mcmd));
qlt_xmit_tm_rsp(mcmd);
out:
@@ -1920,7 +1902,7 @@ static int sqa_get_initiator_port_transport_id(struct scst_tgt *tgt,
}
TRACE_DBG("sqatgt(%ld/%d): Creating transport id: target session=%p, initiator=%8phC, fcid=%3phC, loop=0x%04x",
sess->vha->host_no, sess->vha->vp_idx, sess,
sess->vha->host_no, sess->vha->vp_idx, sess,
sess->port_name, &sess->d_id.b, sess->loop_id);
tr_id_size = 24;
@@ -1994,22 +1976,20 @@ static void sqa_on_hw_pending_cmd_timeout(struct scst_cmd *scst_cmd)
spin_lock_irqsave(qpair->qp_lock_ptr, flags);
TRACE_MGMT_DBG(
"sqatgt(%ld/%d): tag %lld: HW pending for too long (state %s) %s; %s",
vha->host_no, vha->vp_idx, scst_cmd_get_tag(scst_cmd),
cmdstate_to_str((u8)cmd->state),
cmd->cmd_sent_to_fw ? "sent to fw" : "not sent to fw",
cmd->aborted ? "aborted" : "not aborted");
TRACE_MGMT_DBG("sqatgt(%ld/%d): tag %lld: HW pending for too long (state %s) %s; %s",
vha->host_no, vha->vp_idx, scst_cmd_get_tag(scst_cmd),
cmdstate_to_str((u8)cmd->state),
cmd->cmd_sent_to_fw ? "sent to fw" : "not sent to fw",
cmd->aborted ? "aborted" : "not aborted");
switch (cmd->state) {
case QLA_TGT_STATE_NEW:
case QLA_TGT_STATE_DATA_IN:
case QLA_TGT_STATE_DONE:
PRINT_ERROR(
"sqatgt(%ld/%d): tag %lld: A command in state (%s) should not be HW pending. %s",
vha->host_no, vha->vp_idx, scst_cmd_get_tag(scst_cmd),
cmdstate_to_str((u8)cmd->state),
cmd->aborted ? "aborted" : "not aborted");
PRINT_ERROR("sqatgt(%ld/%d): tag %lld: A command in state (%s) should not be HW pending. %s",
vha->host_no, vha->vp_idx, scst_cmd_get_tag(scst_cmd),
cmdstate_to_str((u8)cmd->state),
cmd->aborted ? "aborted" : "not aborted");
goto out_unlock;
case QLA_TGT_STATE_NEED_DATA:
@@ -2021,18 +2001,16 @@ static void sqa_on_hw_pending_cmd_timeout(struct scst_cmd *scst_cmd)
if (srr) {
/* Handle race with SRR processing. */
if (srr->imm_ntfy_recvd && srr->ctio_recvd) {
TRACE_MGMT_DBG(
"sqatgt(%ld/%d): tag %lld: cmd should be scheduled for SRR processing",
vha->host_no, vha->vp_idx,
scst_cmd_get_tag(scst_cmd));
TRACE_MGMT_DBG("sqatgt(%ld/%d): tag %lld: cmd should be scheduled for SRR processing",
vha->host_no, vha->vp_idx,
scst_cmd_get_tag(scst_cmd));
goto out_unlock;
}
TRACE_MGMT_DBG(
"sqatgt(%ld/%d): tag %lld: timeout waiting for %s SRR",
vha->host_no, vha->vp_idx,
scst_cmd_get_tag(scst_cmd),
(!srr->imm_ntfy_recvd) ? "IMM" : "CTIO");
TRACE_MGMT_DBG("sqatgt(%ld/%d): tag %lld: timeout waiting for %s SRR",
vha->host_no, vha->vp_idx,
scst_cmd_get_tag(scst_cmd),
(!srr->imm_ntfy_recvd) ? "IMM" : "CTIO");
if (srr->ctio_recvd) {
/*
@@ -2051,10 +2029,9 @@ static void sqa_on_hw_pending_cmd_timeout(struct scst_cmd *scst_cmd)
} else {
/* Handle race with normal CTIO completion. */
if (!cmd->cmd_sent_to_fw) {
TRACE_MGMT_DBG(
"sqatgt(%ld/%d): tag %lld: cmd not sent to fw; assuming just completed",
vha->host_no, vha->vp_idx,
scst_cmd_get_tag(scst_cmd));
TRACE_MGMT_DBG("sqatgt(%ld/%d): tag %lld: cmd not sent to fw; assuming just completed",
vha->host_no, vha->vp_idx,
scst_cmd_get_tag(scst_cmd));
goto out_unlock;
}
}
@@ -2065,7 +2042,7 @@ static void sqa_on_hw_pending_cmd_timeout(struct scst_cmd *scst_cmd)
/* Reset the ISP if there was a timeout after sending a term exchange. */
if (!advance_cmd &&
cmd->sent_term_exchg &&
cmd->sent_term_exchg &&
time_is_before_jiffies(cmd->jiffies_at_term_exchg +
SQA_MAX_HW_PENDING_TIME * HZ / 2)) {
if (!test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags)) {
@@ -2088,22 +2065,20 @@ static void sqa_on_hw_pending_cmd_timeout(struct scst_cmd *scst_cmd)
if (advance_cmd) {
switch (cmd->state) {
case QLA_TGT_STATE_NEED_DATA:
TRACE_MGMT_DBG(
"sqatgt(%ld/%d): tag %lld: force rx_data",
vha->host_no, vha->vp_idx,
scst_cmd_get_tag(scst_cmd));
TRACE_MGMT_DBG("sqatgt(%ld/%d): tag %lld: force rx_data",
vha->host_no, vha->vp_idx,
scst_cmd_get_tag(scst_cmd));
cmd->state = QLA_TGT_STATE_DATA_IN;
scst_set_cmd_error(scst_cmd,
SCST_LOAD_SENSE(scst_sense_internal_failure));
SCST_LOAD_SENSE(scst_sense_internal_failure));
scst_rx_data(scst_cmd, SCST_RX_STATUS_ERROR_SENSE_SET,
SCST_CONTEXT_THREAD);
SCST_CONTEXT_THREAD);
break;
case QLA_TGT_STATE_PROCESSED:
TRACE_MGMT_DBG(
"sqatgt(%ld/%d): tag %lld: force finishing cmd",
vha->host_no, vha->vp_idx,
scst_cmd_get_tag(scst_cmd));
TRACE_MGMT_DBG("sqatgt(%ld/%d): tag %lld: force finishing cmd",
vha->host_no, vha->vp_idx,
scst_cmd_get_tag(scst_cmd));
scst_set_delivery_status(scst_cmd, SCST_CMD_DELIVERY_FAILED);
scst_tgt_cmd_done(scst_cmd, SCST_CONTEXT_THREAD);
break;
@@ -2205,7 +2180,7 @@ static struct qla_tgt_func_tmpl sqa_qla2xxx_template = {
};
static int sqa_lport_callback(struct scsi_qla_host *vha,
void *target_lport_ptr, u64 npiv_wwpn, u64 npiv_wwnn)
void *target_lport_ptr, u64 npiv_wwpn, u64 npiv_wwnn)
{
struct qla_hw_data *ha = vha->hw;
@@ -2231,13 +2206,13 @@ static int sqa_enable_tgt(struct scst_tgt *scst_tgt, bool enable)
tgt = sqa_tgt->qla_tgt;
vha = tgt->vha;
if (enable && (qla_tgt_mode_enabled(tgt->vha) ||
qla_dual_mode_enabled(tgt->vha))) {
qla_dual_mode_enabled(tgt->vha))) {
PRINT_INFO("sqatgt(%ld/%d): Target already enabled.",
vha->host_no, vha->vp_idx);
return -EINVAL;
}
if (!enable && (!qla_tgt_mode_enabled(vha) &&
!qla_dual_mode_enabled(vha))) {
!qla_dual_mode_enabled(vha))) {
PRINT_INFO("sqatgt(%ld/%d): Target already disabled.",
vha->host_no, vha->vp_idx);
return -EINVAL;
@@ -2252,7 +2227,7 @@ static int sqa_enable_tgt(struct scst_tgt *scst_tgt, bool enable)
if (enable) {
qlt_lport_register(sqa_tgt, wwn_to_u64(vha->port_name),
0, 0, sqa_lport_callback);
0, 0, sqa_lport_callback);
qlt_enable_vha(vha);
} else {
int rc = qlt_stop_phase1(tgt);
@@ -2293,7 +2268,7 @@ static ssize_t sqa_add_vtarget(const char *target_name, char *params)
res = sqa_parse_wwn(target_name, &port_name);
if (res) {
PRINT_ERROR("sqatgt: Syntax error at target name %s",
target_name);
target_name);
goto out;
}
@@ -2305,7 +2280,7 @@ static ssize_t sqa_add_vtarget(const char *target_name, char *params)
p = scst_get_next_lexem(&param);
if (*p == '\0') {
PRINT_ERROR("sqatgt: Syntax error at %s (target %s)",
param, target_name);
param, target_name);
res = -EINVAL;
goto out;
}
@@ -2349,14 +2324,14 @@ static ssize_t sqa_add_vtarget(const char *target_name, char *params)
}
PRINT_ERROR("sqatgt: Unknown parameter %s (target %s)", p,
target_name);
target_name);
res = -EINVAL;
goto out;
}
if (!pnode_name) {
PRINT_ERROR("sqatgt: Missing parameter node_name (target %s)",
target_name);
target_name);
res = -EINVAL;
goto out;
}
@@ -2385,7 +2360,7 @@ static ssize_t sqa_del_vtarget(const char *target_name)
res = sqa_parse_wwn(target_name, &port_name);
if (res) {
PRINT_ERROR("sqatgt: Syntax error at target name %s",
target_name);
target_name);
goto out;
}
@@ -2437,7 +2412,7 @@ static void __exit sqa_exit(void)
* taken place.
*/
PRINT_INFO("sqatgt: Stopping NPIV host%ld.\n",
vha->host_no);
vha->host_no);
qlt_stop_phase1(sqa_tgt->qla_tgt);
qlt_del_vtarget(wwn_to_u64(vha->port_name));
@@ -2448,7 +2423,7 @@ static void __exit sqa_exit(void)
vha = sqa_tgt->qla_tgt->vha;
if (!vha->vp_idx) {
PRINT_INFO("sqatgt: Stopping host%ld.\n",
vha->host_no);
vha->host_no);
qlt_stop_phase1(sqa_tgt->qla_tgt);
scst_unregister_target(sqa_tgt->scst_tgt);
@@ -7,12 +7,12 @@
struct scst_tgt;
struct qla_tgt;
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && \
!(defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 7)
!(defined(RHEL_MAJOR) && RHEL_MAJOR - 0 >= 7)
#define QLT_USE_PERCPU_IDA 0
#define QLT_USE_SBITMAP 0
#include <linux/bitmap.h>
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && \
!(defined(RHEL_MAJOR) && RHEL_MAJOR -0 >= 8)
!(defined(RHEL_MAJOR) && RHEL_MAJOR - 0 >= 8)
#define QLT_USE_PERCPU_IDA 1
#define QLT_USE_SBITMAP 0
/* See also commit 798ab48eecdf ("idr: Percpu ida") # v3.12 */
+8 -8
View File
@@ -50,7 +50,7 @@ static inline u32 blk_mq_unique_tag(struct request *rq)
#if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G)
#warning HIGHMEM kernel configurations are not supported by this module, \
because nowadays it is not worth the effort. Consider changing \
VMSPLIT option or use a 64-bit configuration instead. See SCST core \
VMSPLIT option or use a 64 - bit configuration instead. See SCST core \
README file for details.
#endif
#endif
@@ -915,7 +915,7 @@ static enum scsi_qc_status scst_local_queuecommand(struct Scsi_Host *host, struc
if (scsi_bidi_cmnd(scmd)) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 3))
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(8, 3))
dir = SCST_DATA_BIDI;
scst_cmd_set_expected(scst_cmd, dir, scsi_bufflen(scmd));
scst_cmd_set_expected_out_transfer_len(scst_cmd, scsi_in(scmd)->length);
@@ -1038,7 +1038,7 @@ out:
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 6))
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 6))
static int scst_local_slave_alloc(struct scsi_device *sdev)
{
struct request_queue *q = sdev->request_queue;
@@ -1065,7 +1065,7 @@ static int scst_local_slave_alloc(struct scsi_device *sdev)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1))
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(10, 1))
static int scst_local_slave_configure(struct scsi_device *sdev)
#else
static int scst_local_sdev_configure(struct scsi_device *sdev, struct queue_limits *lim)
@@ -1385,14 +1385,14 @@ static const struct scsi_host_template scst_lcl_ini_driver_template = {
.change_queue_depth = scst_local_change_queue_depth,
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 6))
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 6))
.slave_alloc = scst_local_slave_alloc,
#else
.dma_alignment = (4096 - 1),
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(10, 1))
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(10, 1))
.slave_configure = scst_local_slave_configure,
#else
.sdev_configure = scst_local_sdev_configure,
@@ -1478,7 +1478,7 @@ out:
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2))
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 2))
#define DRIVER_REMOVE_RET int
#else
#define DRIVER_REMOVE_RET void
@@ -1506,7 +1506,7 @@ static DRIVER_REMOVE_RET scst_local_driver_remove(struct device *dev)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 8))
RHEL_RELEASE_CODE - 0 < RHEL_RELEASE_VERSION(9, 8))
static int scst_local_bus_match(struct device *dev, struct device_driver *drv)
#else
static int scst_local_bus_match(struct device *dev, const struct device_driver *drv)
-1
View File
@@ -111,7 +111,6 @@ struct srp_login_req_rdma_v2 {
u8 reserved[6];
};
#define srp_login_req srp_login_req_v2
#define srp_login_req_rdma srp_login_req_rdma_v2
#endif