From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>,
"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>
Cc: linux-scsi@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Bart Van Assche <bvanassche@acm.org>,
James Smart <james.smart@broadcom.com>
Subject: [PATCH 065/117] lpfc: Convert to the scsi_status union
Date: Mon, 19 Apr 2021 17:07:53 -0700 [thread overview]
Message-ID: <20210420000845.25873-66-bvanassche@acm.org> (raw)
In-Reply-To: <20210420000845.25873-1-bvanassche@acm.org>
An explanation of the purpose of this patch is available in the patch
"scsi: Introduce the scsi_status union".
Cc: James Smart <james.smart@broadcom.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/scsi/lpfc/lpfc_bsg.c | 114 +++++++++++++++++-----------------
drivers/scsi/lpfc/lpfc_scsi.c | 66 ++++++++++----------
2 files changed, 90 insertions(+), 90 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index c2776b88d493..965fa8a1c344 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -373,8 +373,8 @@ lpfc_bsg_send_mgmt_cmd_cmp(struct lpfc_hba *phba,
/* Complete the job if the job is still active */
if (job) {
- bsg_reply->result = rc;
- bsg_job_done(job, bsg_reply->result,
+ bsg_reply->status.combined = rc;
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
}
return;
@@ -545,7 +545,7 @@ lpfc_bsg_send_mgmt_cmd(struct bsg_job *job)
kfree(dd_data);
no_dd_data:
/* make error code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
job->dd_data = NULL;
return rc;
}
@@ -643,8 +643,8 @@ lpfc_bsg_rport_els_cmp(struct lpfc_hba *phba,
/* Complete the job if the job is still active */
if (job) {
- bsg_reply->result = rc;
- bsg_job_done(job, bsg_reply->result,
+ bsg_reply->status.combined = rc;
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
}
return;
@@ -782,7 +782,7 @@ lpfc_bsg_rport_els(struct bsg_job *job)
no_dd_data:
/* make error code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
job->dd_data = NULL;
return rc;
}
@@ -1113,11 +1113,11 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
bsg_reply = job->reply;
bsg_reply->reply_payload_rcv_len = size;
/* make error code available to userspace */
- bsg_reply->result = 0;
+ bsg_reply->status.combined = 0;
job->dd_data = NULL;
/* complete the job back to userspace */
spin_unlock_irqrestore(&phba->ct_ev_lock, flags);
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
spin_lock_irqsave(&phba->ct_ev_lock, flags);
}
@@ -1340,14 +1340,14 @@ lpfc_bsg_hba_get_event(struct bsg_job *job)
lpfc_bsg_event_unref(evt);
spin_unlock_irqrestore(&phba->ct_ev_lock, flags);
job->dd_data = NULL;
- bsg_reply->result = 0;
- bsg_job_done(job, bsg_reply->result,
+ bsg_reply->status.combined = 0;
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return 0;
job_error:
job->dd_data = NULL;
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
return rc;
}
@@ -1438,8 +1438,8 @@ lpfc_issue_ct_rsp_cmp(struct lpfc_hba *phba,
/* Complete the job if the job is still active */
if (job) {
- bsg_reply->result = rc;
- bsg_job_done(job, bsg_reply->result,
+ bsg_reply->status.combined = rc;
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
}
return;
@@ -1670,7 +1670,7 @@ lpfc_bsg_send_mgmt_rsp(struct bsg_job *job)
kfree(bmp);
send_mgmt_rsp_exit:
/* make error code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
job->dd_data = NULL;
return rc;
}
@@ -1878,10 +1878,10 @@ lpfc_sli3_bsg_diag_loopback_mode(struct lpfc_hba *phba, struct bsg_job *job)
job_error:
/* make error code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
/* complete the job back to userspace if no error */
if (rc == 0)
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return rc;
}
@@ -2243,10 +2243,10 @@ lpfc_sli4_bsg_diag_loopback_mode(struct lpfc_hba *phba, struct bsg_job *job)
job_done:
/* make error code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
/* complete the job back to userspace if no error */
if (rc == 0)
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return rc;
}
@@ -2358,10 +2358,10 @@ lpfc_sli4_bsg_diag_mode_end(struct bsg_job *job)
loopback_mode_end_exit:
/* make return code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
/* complete the job back to userspace if no error */
if (rc == 0)
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return rc;
}
@@ -2507,10 +2507,10 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_job *job)
/* make error code available to userspace */
if (rc1 && !rc)
rc = rc1;
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
/* complete the job back to userspace if no error */
if (rc == 0)
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return rc;
}
@@ -3369,11 +3369,11 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job)
loopback_test_exit:
kfree(dataout);
/* make error code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
job->dd_data = NULL;
/* complete the job back to userspace if no error */
if (rc == IOCB_SUCCESS)
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return rc;
}
@@ -3414,9 +3414,9 @@ lpfc_bsg_get_dfc_rev(struct bsg_job *job)
event_reply->info.a_Major = MANAGEMENT_MAJOR_REV;
event_reply->info.a_Minor = MANAGEMENT_MINOR_REV;
job_error:
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
if (rc == 0)
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return rc;
}
@@ -3481,8 +3481,8 @@ lpfc_bsg_issue_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq)
/* Complete the job if the job is still active */
if (job) {
- bsg_reply->result = 0;
- bsg_job_done(job, bsg_reply->result,
+ bsg_reply->status.combined = 0;
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
}
return;
@@ -3671,7 +3671,7 @@ lpfc_bsg_issue_mbox_ext_handle_job(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq)
pmb_buf, size);
/* result for successful */
- bsg_reply->result = 0;
+ bsg_reply->status.combined = 0;
lpfc_printf_log(phba, KERN_INFO, LOG_LIBDFC,
"2937 SLI_CONFIG ext-buffer mailbox command "
@@ -3732,7 +3732,7 @@ lpfc_bsg_issue_read_mbox_ext_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq)
/* if the job is still active, call job done */
if (job) {
bsg_reply = job->reply;
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
}
return;
@@ -3770,7 +3770,7 @@ lpfc_bsg_issue_write_mbox_ext_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq)
/* if the job is still active, call job done */
if (job) {
bsg_reply = job->reply;
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
}
@@ -4213,8 +4213,8 @@ lpfc_bsg_sli_cfg_write_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job,
/* wait for additional external buffers */
- bsg_reply->result = 0;
- bsg_job_done(job, bsg_reply->result,
+ bsg_reply->status.combined = 0;
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return SLI_CONFIG_HANDLED;
@@ -4441,8 +4441,8 @@ lpfc_bsg_read_ebuf_get(struct lpfc_hba *phba, struct bsg_job *job)
lpfc_bsg_mbox_ext_session_reset(phba);
}
- bsg_reply->result = 0;
- bsg_job_done(job, bsg_reply->result,
+ bsg_reply->status.combined = 0;
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return SLI_CONFIG_HANDLED;
@@ -4560,8 +4560,8 @@ lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct bsg_job *job,
}
/* wait for additional external buffers */
- bsg_reply->result = 0;
- bsg_job_done(job, bsg_reply->result,
+ bsg_reply->status.combined = 0;
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return SLI_CONFIG_HANDLED;
@@ -5030,16 +5030,16 @@ lpfc_bsg_mbox_cmd(struct bsg_job *job)
if (rc == 0) {
/* job done */
- bsg_reply->result = 0;
+ bsg_reply->status.combined = 0;
job->dd_data = NULL;
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
} else if (rc == 1)
/* job submitted, will complete later*/
rc = 0; /* return zero, no error */
else {
/* some error occurred */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
job->dd_data = NULL;
}
@@ -5142,8 +5142,8 @@ lpfc_bsg_menlo_cmd_cmp(struct lpfc_hba *phba,
/* Complete the job if active */
if (job) {
- bsg_reply->result = rc;
- bsg_job_done(job, bsg_reply->result,
+ bsg_reply->status.combined = rc;
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
}
@@ -5318,7 +5318,7 @@ lpfc_menlo_cmd(struct bsg_job *job)
kfree(dd_data);
no_dd_data:
/* make error code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
job->dd_data = NULL;
return rc;
}
@@ -5358,9 +5358,9 @@ lpfc_forced_link_speed(struct bsg_job *job)
? LPFC_FORCED_LINK_SPEED_SUPPORTED
: LPFC_FORCED_LINK_SPEED_NOT_SUPPORTED;
job_error:
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
if (rc == 0)
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return rc;
}
@@ -5434,11 +5434,11 @@ lpfc_bsg_get_ras_config(struct bsg_job *job)
ras_job_error:
/* make error code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
/* complete the job back to userspace */
if (!rc)
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return rc;
}
@@ -5520,11 +5520,11 @@ lpfc_bsg_set_ras_config(struct bsg_job *job)
}
ras_job_error:
/* make error code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
/* complete the job back to userspace */
if (!rc)
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return rc;
@@ -5582,11 +5582,11 @@ lpfc_bsg_get_ras_lwpd(struct bsg_job *job)
ras_job_error:
/* make error code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
/* complete the job back to userspace */
if (!rc)
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return rc;
@@ -5671,9 +5671,9 @@ lpfc_bsg_get_ras_fwlog(struct bsg_job *job)
vfree(fwlog_buff);
ras_job_error:
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
if (!rc)
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return rc;
@@ -5743,9 +5743,9 @@ lpfc_get_trunk_info(struct bsg_job *job)
event_reply->logical_speed =
phba->sli4_hba.link_state.logical_speed / 1000;
job_error:
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
if (!rc)
- bsg_job_done(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->status.combined,
bsg_reply->reply_payload_rcv_len);
return rc;
@@ -5817,7 +5817,7 @@ lpfc_bsg_hst_vendor(struct bsg_job *job)
rc = -EINVAL;
bsg_reply->reply_payload_rcv_len = 0;
/* make error code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
break;
}
@@ -5851,7 +5851,7 @@ lpfc_bsg_request(struct bsg_job *job)
rc = -EINVAL;
bsg_reply->reply_payload_rcv_len = 0;
/* make error code available to userspace */
- bsg_reply->result = rc;
+ bsg_reply->status.combined = rc;
break;
}
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 81455b53ef3e..cc356463956f 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -156,7 +156,7 @@ lpfc_update_stats(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd)
if (!vport->stat_data_enabled ||
vport->stat_data_blocked ||
- (cmd->result))
+ (cmd->status.combined))
return;
latency = jiffies_to_msecs((long)jiffies - (long)lpfc_cmd->start_time);
@@ -2871,7 +2871,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
if (err_type == BGS_GUARD_ERR_MASK) {
scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,
0x10, 0x1);
- cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
+ cmd->status.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 |
SAM_STAT_CHECK_CONDITION;
phba->bg_guard_err_cnt++;
lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG,
@@ -2882,7 +2882,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
} else if (err_type == BGS_REFTAG_ERR_MASK) {
scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,
0x10, 0x3);
- cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
+ cmd->status.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 |
SAM_STAT_CHECK_CONDITION;
phba->bg_reftag_err_cnt++;
@@ -2894,7 +2894,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
} else if (err_type == BGS_APPTAG_ERR_MASK) {
scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,
0x10, 0x2);
- cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
+ cmd->status.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 |
SAM_STAT_CHECK_CONDITION;
phba->bg_apptag_err_cnt++;
@@ -2956,7 +2956,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,
0x10, 0x1);
- cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
+ cmd->status.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 |
SAM_STAT_CHECK_CONDITION;
phba->bg_guard_err_cnt++;
lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG,
@@ -2972,7 +2972,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,
0x10, 0x3);
- cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
+ cmd->status.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 |
SAM_STAT_CHECK_CONDITION;
phba->bg_reftag_err_cnt++;
@@ -2989,7 +2989,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,
0x10, 0x2);
- cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
+ cmd->status.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 |
SAM_STAT_CHECK_CONDITION;
phba->bg_apptag_err_cnt++;
@@ -3074,7 +3074,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
uint64_t failing_sector = 0;
if (lpfc_bgs_get_invalid_prof(bgstat)) {
- cmd->result = DID_ERROR << 16;
+ cmd->status.combined = DID_ERROR << 16;
lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG,
"9072 BLKGRD: Invalid BG Profile in cmd "
"0x%x reftag 0x%x blk cnt 0x%x "
@@ -3086,7 +3086,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
}
if (lpfc_bgs_get_uninit_dif_block(bgstat)) {
- cmd->result = DID_ERROR << 16;
+ cmd->status.combined = DID_ERROR << 16;
lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG,
"9073 BLKGRD: Invalid BG PDIF Block in cmd "
"0x%x reftag 0x%x blk cnt 0x%x "
@@ -3102,7 +3102,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,
0x10, 0x1);
- cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
+ cmd->status.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 |
SAM_STAT_CHECK_CONDITION;
phba->bg_guard_err_cnt++;
lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG,
@@ -3118,7 +3118,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,
0x10, 0x3);
- cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
+ cmd->status.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 |
SAM_STAT_CHECK_CONDITION;
phba->bg_reftag_err_cnt++;
@@ -3135,7 +3135,7 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,
scsi_build_sense_buffer(1, cmd->sense_buffer, ILLEGAL_REQUEST,
0x10, 0x2);
- cmd->result = DRIVER_SENSE << 24 | DID_ABORT << 16 |
+ cmd->status.combined = DRIVER_SENSE << 24 | DID_ABORT << 16 |
SAM_STAT_CHECK_CONDITION;
phba->bg_apptag_err_cnt++;
@@ -3741,15 +3741,15 @@ lpfc_send_scsi_error_event(struct lpfc_hba *phba, struct lpfc_vport *vport,
return;
/* If there is queuefull or busy condition send a scsi event */
- if ((cmnd->result == SAM_STAT_TASK_SET_FULL) ||
- (cmnd->result == SAM_STAT_BUSY)) {
+ if ((cmnd->status.combined == SAM_STAT_TASK_SET_FULL) ||
+ (cmnd->status.combined == SAM_STAT_BUSY)) {
fast_path_evt = lpfc_alloc_fast_evt(phba);
if (!fast_path_evt)
return;
fast_path_evt->un.scsi_evt.event_type =
FC_REG_SCSI_EVENT;
fast_path_evt->un.scsi_evt.subcategory =
- (cmnd->result == SAM_STAT_TASK_SET_FULL) ?
+ (cmnd->status.combined == SAM_STAT_TASK_SET_FULL) ?
LPFC_EVENT_QFULL : LPFC_EVENT_DEVBSY;
fast_path_evt->un.scsi_evt.lun = cmnd->device->lun;
memcpy(&fast_path_evt->un.scsi_evt.wwpn,
@@ -4015,7 +4015,7 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd,
}
out:
- cmnd->result = host_status << 16 | scsi_status;
+ cmnd->status.combined = host_status << 16 | scsi_status;
lpfc_send_scsi_error_event(vport->phba, vport, lpfc_cmd, fcpi_parm);
}
@@ -4161,7 +4161,7 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
switch (lpfc_cmd->status) {
case IOSTAT_SUCCESS:
- cmd->result = DID_OK << 16;
+ cmd->status.combined = DID_OK << 16;
break;
case IOSTAT_FCP_RSP_ERROR:
lpfc_handle_fcp_err(vport, lpfc_cmd,
@@ -4170,7 +4170,7 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
break;
case IOSTAT_NPORT_BSY:
case IOSTAT_FABRIC_BSY:
- cmd->result = DID_TRANSPORT_DISRUPTED << 16;
+ cmd->status.combined = DID_TRANSPORT_DISRUPTED << 16;
fast_path_evt = lpfc_alloc_fast_evt(phba);
if (!fast_path_evt)
break;
@@ -4230,14 +4230,14 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
lpfc_cmd->result == IOERR_ELXSEC_KEY_UNWRAP_COMPARE_ERROR ||
lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_ERROR ||
lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_COMPARE_ERROR) {
- cmd->result = DID_NO_CONNECT << 16;
+ cmd->status.combined = DID_NO_CONNECT << 16;
break;
}
if (lpfc_cmd->result == IOERR_INVALID_RPI ||
lpfc_cmd->result == IOERR_NO_RESOURCES ||
lpfc_cmd->result == IOERR_ABORT_REQUESTED ||
lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) {
- cmd->result = DID_REQUEUE << 16;
+ cmd->status.combined = DID_REQUEUE << 16;
break;
}
if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED ||
@@ -4276,7 +4276,7 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
default:
if (lpfc_cmd->status >= IOSTAT_CNT)
lpfc_cmd->status = IOSTAT_DEFAULT;
- cmd->result = DID_ERROR << 16;
+ cmd->status.combined = DID_ERROR << 16;
lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_IOERR,
"9037 FCP Completion Error: xri %x "
"status x%x result x%x [x%x] "
@@ -4286,14 +4286,14 @@ lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
wcqe->parameter,
wcqe->total_data_placed);
}
- if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) {
+ if (cmd->status.combined || lpfc_cmd->fcp_rsp->rspSnsLen) {
u32 *lp = (u32 *)cmd->sense_buffer;
lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
"9039 Iodone <%d/%llu> cmd x%px, error "
"x%x SNS x%x x%x Data: x%x x%x\n",
cmd->device->id, cmd->device->lun, cmd,
- cmd->result, *lp, *(lp + 3), cmd->retries,
+ cmd->status.combined, *lp, *(lp + 3), cmd->retries,
scsi_get_resid(cmd));
}
@@ -4471,7 +4471,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
break;
case IOSTAT_NPORT_BSY:
case IOSTAT_FABRIC_BSY:
- cmd->result = DID_TRANSPORT_DISRUPTED << 16;
+ cmd->status.combined = DID_TRANSPORT_DISRUPTED << 16;
fast_path_evt = lpfc_alloc_fast_evt(phba);
if (!fast_path_evt)
break;
@@ -4503,14 +4503,14 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
lpfc_cmd->result == IOERR_ELXSEC_KEY_UNWRAP_COMPARE_ERROR ||
lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_ERROR ||
lpfc_cmd->result == IOERR_ELXSEC_CRYPTO_COMPARE_ERROR) {
- cmd->result = DID_NO_CONNECT << 16;
+ cmd->status.combined = DID_NO_CONNECT << 16;
break;
}
if (lpfc_cmd->result == IOERR_INVALID_RPI ||
lpfc_cmd->result == IOERR_NO_RESOURCES ||
lpfc_cmd->result == IOERR_ABORT_REQUESTED ||
lpfc_cmd->result == IOERR_SLER_CMD_RCV_FAILURE) {
- cmd->result = DID_REQUEUE << 16;
+ cmd->status.combined = DID_REQUEUE << 16;
break;
}
if ((lpfc_cmd->result == IOERR_RX_DMA_FAILED ||
@@ -4544,24 +4544,24 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
}
fallthrough;
default:
- cmd->result = DID_ERROR << 16;
+ cmd->status.combined = DID_ERROR << 16;
break;
}
if (!pnode || (pnode->nlp_state != NLP_STE_MAPPED_NODE))
- cmd->result = DID_TRANSPORT_DISRUPTED << 16 |
+ cmd->status.combined = DID_TRANSPORT_DISRUPTED << 16 |
SAM_STAT_BUSY;
} else
- cmd->result = DID_OK << 16;
+ cmd->status.combined = DID_OK << 16;
- if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) {
+ if (cmd->status.combined || lpfc_cmd->fcp_rsp->rspSnsLen) {
uint32_t *lp = (uint32_t *)cmd->sense_buffer;
lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
"0710 Iodone <%d/%llu> cmd x%px, error "
"x%x SNS x%x x%x Data: x%x x%x\n",
cmd->device->id, cmd->device->lun, cmd,
- cmd->result, *lp, *(lp + 3), cmd->retries,
+ cmd->status.combined, *lp, *(lp + 3), cmd->retries,
scsi_get_resid(cmd));
}
@@ -5179,7 +5179,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
err = fc_remote_port_chkready(rport);
if (err) {
- cmnd->result = err;
+ cmnd->status.combined = err;
goto out_fail_command;
}
ndlp = rdata->pnode;
@@ -5286,7 +5286,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
if (unlikely(err)) {
if (err == 2) {
- cmnd->result = DID_ERROR << 16;
+ cmnd->status.combined = DID_ERROR << 16;
goto out_fail_command_release_buf;
}
goto out_host_busy_free_buf;
next prev parent reply other threads:[~2021-04-20 0:10 UTC|newest]
Thread overview: 158+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-20 0:06 [PATCH 000/117] Make better use of static type checking Bart Van Assche
2021-04-20 0:06 ` [PATCH 001/117] libsas: Introduce more SAM status code aliases in enum exec_status Bart Van Assche
2021-04-20 0:06 ` [PATCH 002/117] Introduce enums for the SAM, message, host and driver status codes Bart Van Assche
2021-04-20 9:23 ` Steffen Maier
2021-04-20 14:59 ` Bart Van Assche
2021-04-20 0:06 ` [PATCH 003/117] Change the type of the second argument of scsi_host_complete_all_commands() Bart Van Assche
2021-04-20 0:06 ` [PATCH 004/117] libiscsi: Use the host_status enum Bart Van Assche
2021-05-06 16:51 ` Lee Duncan
2021-04-20 0:06 ` [PATCH 005/117] libsas: Use the host_status and sam_status enums Bart Van Assche
2021-04-20 0:06 ` [PATCH 006/117] target: Use enum sam_status instead of u8 Bart Van Assche
2021-04-20 0:06 ` [PATCH 007/117] lpfc: Reformat four comparisons Bart Van Assche
2021-04-21 20:22 ` James Smart
2021-04-20 0:06 ` [PATCH 008/117] fc: Add a compile-time structure size check Bart Van Assche
2021-04-20 0:06 ` [PATCH 009/117] iscsi: " Bart Van Assche
2021-05-06 16:52 ` Lee Duncan
2021-04-20 0:06 ` [PATCH 010/117] ufs: " Bart Van Assche
2021-05-06 23:56 ` Can Guo
2021-04-20 0:06 ` [PATCH 011/117] Introduce the scsi_status union Bart Van Assche
2021-05-06 17:04 ` Lee Duncan
2021-05-07 0:04 ` Can Guo
2021-04-20 0:07 ` [PATCH 012/117] block: Convert SCSI and bsg code to " Bart Van Assche
2021-04-20 0:07 ` [PATCH 013/117] core: Convert " Bart Van Assche
2021-04-20 0:07 ` [PATCH 014/117] ch: Pass union scsi_status to driver_byte() Bart Van Assche
2021-04-20 0:07 ` [PATCH 015/117] sd: Convert to the scsi_status union Bart Van Assche
2021-04-20 0:07 ` [PATCH 016/117] sr: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 017/117] st: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 018/117] sg: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 019/117] 3w*: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 020/117] 53c700: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 021/117] BusLogic: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 022/117] NCR5380: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 023/117] a100u2w: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 024/117] aacraid: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 025/117] acornscsi: Annotate fallthrough Bart Van Assche
2021-04-20 0:07 ` [PATCH 026/117] acornscsi: Convert to the scsi_status union Bart Van Assche
2021-04-20 0:07 ` [PATCH 027/117] advansys: " Bart Van Assche
2021-04-20 1:49 ` Matthew Wilcox
2021-04-20 2:27 ` Douglas Gilbert
2021-04-20 3:20 ` Bart Van Assche
2021-04-20 3:17 ` Bart Van Assche
2021-04-20 3:23 ` Matthew Wilcox
2021-04-20 15:01 ` Bart Van Assche
2021-04-20 0:07 ` [PATCH 028/117] aha*: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 029/117] aic*: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 030/117] arcmsr: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 031/117] ata: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 032/117] atp870u: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 033/117] be2iscsi: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 034/117] bfa: Use type int32_t to represent a signed integer Bart Van Assche
2021-04-20 0:07 ` [PATCH 035/117] bfa: Convert to the scsi_status union Bart Van Assche
2021-04-20 0:07 ` [PATCH 036/117] bnx2fc: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 037/117] cdrom: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 038/117] csiostor: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 039/117] cxlflash: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 040/117] dc395x: Use the set_{host,msg,status}_byte() functions Bart Van Assche
2021-04-20 0:07 ` [PATCH 041/117] dc395x: Convert to the scsi_status union Bart Van Assche
2021-04-20 0:07 ` [PATCH 042/117] dpt_i2o: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 043/117] esas2r: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 044/117] esp_scsi: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 045/117] fas216: Fix two source code comments Bart Van Assche
2021-04-20 0:07 ` [PATCH 046/117] fas216: Convert to the scsi_status union Bart Van Assche
2021-04-20 0:07 ` [PATCH 047/117] fc: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 048/117] fdomain: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 049/117] firewire: sbp2: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 050/117] fnic: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 051/117] hpsa: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 052/117] hptiop: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 053/117] ib_srp: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 054/117] ibmvfc: Fix the documentation of the return value of ibmvfc_host_chkready() Bart Van Assche
2021-04-20 0:07 ` [PATCH 055/117] ibmvfc: Convert to the scsi_status union Bart Van Assche
2021-04-20 0:07 ` [PATCH 056/117] ibmvscsi: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 057/117] ide: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 058/117] imm: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 059/117] initio: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 060/117] ipr: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 061/117] ips: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 062/117] iscsi: " Bart Van Assche
2021-05-06 18:54 ` Lee Duncan
2021-04-20 0:07 ` [PATCH 063/117] libfc: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 064/117] sas: " Bart Van Assche
2021-04-20 0:07 ` Bart Van Assche [this message]
2021-04-21 20:26 ` [PATCH 065/117] lpfc: " James Smart
2021-04-20 0:07 ` [PATCH 066/117] mac53c94: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 067/117] megaraid: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 068/117] mesh: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 069/117] message: fusion: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 070/117] mpt3sas: " Bart Van Assche
2021-04-20 0:07 ` [PATCH 071/117] mvumi: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 072/117] myrb: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 073/117] myrs: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 074/117] ncr53c8xx: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 075/117] nfsd: " Bart Van Assche
2021-04-20 14:36 ` Chuck Lever III
2021-04-20 16:44 ` Bart Van Assche
2021-04-21 14:22 ` Chuck Lever III
2021-04-21 16:12 ` Bart Van Assche
2021-04-21 16:27 ` Chuck Lever III
2021-04-20 0:08 ` [PATCH 076/117] nsp32: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 077/117] pcmcia: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 078/117] pktcdvd: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 079/117] pmcraid: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 080/117] ppa: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 081/117] ps3rom: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 082/117] qedf: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 083/117] qedi: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 084/117] qla1280: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 085/117] qla2xxx: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 086/117] qla4xxx: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 087/117] qlogicfas408: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 088/117] qlogicpti: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 089/117] s390/zfcp: " Bart Van Assche
2021-04-20 0:08 ` [PATCH 090/117] scsi_debug: " Bart Van Assche
2021-04-20 2:13 ` [PATCH 091/117] smartpqi: " Bart Van Assche
2021-04-20 2:13 ` [PATCH 092/117] snic: " Bart Van Assche
2021-04-20 2:13 ` [PATCH 093/117] staging: " Bart Van Assche
2021-04-20 7:47 ` Greg Kroah-Hartman
2021-04-20 15:02 ` Bart Van Assche
2021-04-20 15:06 ` Greg Kroah-Hartman
2021-04-20 2:13 ` [PATCH 094/117] stex: " Bart Van Assche
2021-04-20 2:13 ` [PATCH 095/117] storvsc: " Bart Van Assche
2021-04-20 19:39 ` Wei Liu
2021-04-20 2:13 ` [PATCH 096/117] sym53c8xx_2: " Bart Van Assche
2021-04-20 2:13 ` [PATCH 097/117] target: " Bart Van Assche
2021-04-20 2:13 ` [PATCH 098/117] ufs: Remove an unused structure member Bart Van Assche
2021-05-06 23:57 ` Can Guo
2021-04-20 2:13 ` [PATCH 099/117] ufs: Remove a local variable Bart Van Assche
2021-05-06 23:56 ` Can Guo
2021-04-20 2:13 ` [PATCH 100/117] ufs: Use enum sam_status where appropriate Bart Van Assche
2021-05-07 0:01 ` Can Guo
2021-05-07 0:01 ` Can Guo
2021-04-20 2:13 ` [PATCH 101/117] ufs: Remove an assignment from ufshcd_transfer_rsp_status() Bart Van Assche
2021-05-07 0:03 ` Can Guo
2021-04-20 2:13 ` [PATCH 102/117] ufs: Convert to the scsi_status union Bart Van Assche
2021-05-07 0:09 ` Can Guo
2021-05-07 3:35 ` Bart Van Assche
2021-05-07 4:48 ` Can Guo
2021-04-20 2:13 ` [PATCH 103/117] usb: " Bart Van Assche
2021-04-20 2:13 ` [PATCH 104/117] virtio-scsi: " Bart Van Assche
2021-04-20 2:13 ` [PATCH 105/117] vmw_pvscsi: " Bart Van Assche
2021-04-20 2:13 ` [PATCH 106/117] wd33c93: " Bart Van Assche
2021-04-20 2:13 ` [PATCH 107/117] wd719x: " Bart Van Assche
2021-04-20 2:13 ` [PATCH 108/117] xen-scsiback: Pass union status to the {status,msg,host,driver}_byte() macros Bart Van Assche
2021-04-20 2:13 ` [PATCH 109/117] xen-scsifront: Convert to the scsi_status union Bart Van Assche
2021-04-20 2:13 ` [PATCH 110/117] Finalize the switch from 'int' to 'union scsi_status' Bart Van Assche
2021-05-06 18:55 ` Lee Duncan
2021-05-07 0:24 ` Can Guo
2021-04-20 2:13 ` [PATCH 111/117] Use the scsi_status union more widely Bart Van Assche
2021-04-20 2:13 ` [PATCH 112/117] Change the return type of scsi_execute() into union scsi_status Bart Van Assche
2021-04-20 2:13 ` [PATCH 113/117] Change the return type of scsi_execute_req() " Bart Van Assche
2021-04-20 2:13 ` [PATCH 114/117] Change the return type of scsi_test_unit_ready() " Bart Van Assche
2021-04-20 2:14 ` [PATCH 115/117] Change the return types of scsi_mode_sense() and sd_do_mode_sense() Bart Van Assche
2021-04-20 2:14 ` [PATCH 116/117] Change the return type of scsi_mode_select() into union scsi_status Bart Van Assche
2021-04-20 2:14 ` [PATCH 117/117] Change the return type of ioctl_internal_command() " Bart Van Assche
2021-04-20 6:04 ` [PATCH 000/117] Make better use of static type checking Hannes Reinecke
2021-04-20 16:12 ` Bart Van Assche
2021-04-20 17:11 ` Hannes Reinecke
2021-04-20 21:10 ` Bart Van Assche
2021-04-20 17:19 ` Douglas Gilbert
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=20210420000845.25873-66-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=james.smart@broadcom.com \
--cc=jejb@linux.vnet.ibm.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