Commit f775bd14 authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen

scsi: qla2xxx: Convert 32-bit LUN usage to 64-bit

Acked-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: default avatarQuinn Tran <quinn.tran@cavium.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Reviewed-by: default avatarBart Van Assche <Bart.VanAssche@sandisk.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ba175891
...@@ -1799,7 +1799,7 @@ static int abort_cmd_for_tag(struct scsi_qla_host *vha, uint32_t tag) ...@@ -1799,7 +1799,7 @@ static int abort_cmd_for_tag(struct scsi_qla_host *vha, uint32_t tag)
* for the same lun) * for the same lun)
*/ */
static void abort_cmds_for_lun(struct scsi_qla_host *vha, static void abort_cmds_for_lun(struct scsi_qla_host *vha,
uint32_t lun, uint8_t *s_id) u64 lun, uint8_t *s_id)
{ {
struct qla_tgt_sess_op *op; struct qla_tgt_sess_op *op;
struct qla_tgt_cmd *cmd; struct qla_tgt_cmd *cmd;
...@@ -1810,7 +1810,7 @@ static void abort_cmds_for_lun(struct scsi_qla_host *vha, ...@@ -1810,7 +1810,7 @@ static void abort_cmds_for_lun(struct scsi_qla_host *vha,
spin_lock_irqsave(&vha->cmd_list_lock, flags); spin_lock_irqsave(&vha->cmd_list_lock, flags);
list_for_each_entry(op, &vha->qla_sess_op_cmd_list, cmd_list) { list_for_each_entry(op, &vha->qla_sess_op_cmd_list, cmd_list) {
uint32_t op_key; uint32_t op_key;
uint32_t op_lun; u64 op_lun;
op_key = sid_to_key(op->atio.u.isp24.fcp_hdr.s_id); op_key = sid_to_key(op->atio.u.isp24.fcp_hdr.s_id);
op_lun = scsilun_to_int( op_lun = scsilun_to_int(
...@@ -1832,7 +1832,7 @@ static void abort_cmds_for_lun(struct scsi_qla_host *vha, ...@@ -1832,7 +1832,7 @@ static void abort_cmds_for_lun(struct scsi_qla_host *vha,
list_for_each_entry(cmd, &vha->qla_cmd_list, cmd_list) { list_for_each_entry(cmd, &vha->qla_cmd_list, cmd_list) {
uint32_t cmd_key; uint32_t cmd_key;
uint32_t cmd_lun; u64 cmd_lun;
cmd_key = sid_to_key(cmd->atio.u.isp24.fcp_hdr.s_id); cmd_key = sid_to_key(cmd->atio.u.isp24.fcp_hdr.s_id);
cmd_lun = scsilun_to_int( cmd_lun = scsilun_to_int(
...@@ -1850,18 +1850,15 @@ static int __qlt_24xx_handle_abts(struct scsi_qla_host *vha, ...@@ -1850,18 +1850,15 @@ static int __qlt_24xx_handle_abts(struct scsi_qla_host *vha,
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
struct se_session *se_sess = sess->se_sess; struct se_session *se_sess = sess->se_sess;
struct qla_tgt_mgmt_cmd *mcmd; struct qla_tgt_mgmt_cmd *mcmd;
struct qla_tgt_cmd *cmd;
struct se_cmd *se_cmd; struct se_cmd *se_cmd;
u32 lun = 0;
int rc; int rc;
bool found_lun = false; bool found_lun = false;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&se_sess->sess_cmd_lock, flags); spin_lock_irqsave(&se_sess->sess_cmd_lock, flags);
list_for_each_entry(se_cmd, &se_sess->sess_cmd_list, se_cmd_list) { list_for_each_entry(se_cmd, &se_sess->sess_cmd_list, se_cmd_list) {
struct qla_tgt_cmd *cmd =
container_of(se_cmd, struct qla_tgt_cmd, se_cmd);
if (se_cmd->tag == abts->exchange_addr_to_abort) { if (se_cmd->tag == abts->exchange_addr_to_abort) {
lun = cmd->unpacked_lun;
found_lun = true; found_lun = true;
break; break;
} }
...@@ -1895,12 +1892,13 @@ static int __qlt_24xx_handle_abts(struct scsi_qla_host *vha, ...@@ -1895,12 +1892,13 @@ static int __qlt_24xx_handle_abts(struct scsi_qla_host *vha,
} }
memset(mcmd, 0, sizeof(*mcmd)); memset(mcmd, 0, sizeof(*mcmd));
cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd);
mcmd->sess = sess; mcmd->sess = sess;
memcpy(&mcmd->orig_iocb.abts, abts, sizeof(mcmd->orig_iocb.abts)); memcpy(&mcmd->orig_iocb.abts, abts, sizeof(mcmd->orig_iocb.abts));
mcmd->reset_count = vha->hw->chip_reset; mcmd->reset_count = vha->hw->chip_reset;
mcmd->tmr_func = QLA_TGT_ABTS; mcmd->tmr_func = QLA_TGT_ABTS;
rc = ha->tgt.tgt_ops->handle_tmr(mcmd, lun, mcmd->tmr_func, rc = ha->tgt.tgt_ops->handle_tmr(mcmd, cmd->unpacked_lun, mcmd->tmr_func,
abts->exchange_addr_to_abort); abts->exchange_addr_to_abort);
if (rc != 0) { if (rc != 0) {
ql_dbg(ql_dbg_tgt_mgt, vha, 0xf052, ql_dbg(ql_dbg_tgt_mgt, vha, 0xf052,
...@@ -4334,13 +4332,12 @@ static int qlt_handle_task_mgmt(struct scsi_qla_host *vha, void *iocb) ...@@ -4334,13 +4332,12 @@ static int qlt_handle_task_mgmt(struct scsi_qla_host *vha, void *iocb)
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
struct qla_tgt *tgt; struct qla_tgt *tgt;
struct fc_port *sess; struct fc_port *sess;
uint32_t lun, unpacked_lun; u64 unpacked_lun;
int fn; int fn;
unsigned long flags; unsigned long flags;
tgt = vha->vha_tgt.qla_tgt; tgt = vha->vha_tgt.qla_tgt;
lun = a->u.isp24.fcp_cmnd.lun;
fn = a->u.isp24.fcp_cmnd.task_mgmt_flags; fn = a->u.isp24.fcp_cmnd.task_mgmt_flags;
spin_lock_irqsave(&ha->tgt.sess_lock, flags); spin_lock_irqsave(&ha->tgt.sess_lock, flags);
...@@ -4348,7 +4345,8 @@ static int qlt_handle_task_mgmt(struct scsi_qla_host *vha, void *iocb) ...@@ -4348,7 +4345,8 @@ static int qlt_handle_task_mgmt(struct scsi_qla_host *vha, void *iocb)
a->u.isp24.fcp_hdr.s_id); a->u.isp24.fcp_hdr.s_id);
spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
unpacked_lun = scsilun_to_int((struct scsi_lun *)&lun); unpacked_lun =
scsilun_to_int((struct scsi_lun *)&a->u.isp24.fcp_cmnd.lun);
if (!sess) { if (!sess) {
ql_dbg(ql_dbg_tgt_mgt, vha, 0xf024, ql_dbg(ql_dbg_tgt_mgt, vha, 0xf024,
...@@ -4371,7 +4369,7 @@ static int __qlt_abort_task(struct scsi_qla_host *vha, ...@@ -4371,7 +4369,7 @@ static int __qlt_abort_task(struct scsi_qla_host *vha,
struct atio_from_isp *a = (struct atio_from_isp *)iocb; struct atio_from_isp *a = (struct atio_from_isp *)iocb;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
struct qla_tgt_mgmt_cmd *mcmd; struct qla_tgt_mgmt_cmd *mcmd;
uint32_t lun, unpacked_lun; u64 unpacked_lun;
int rc; int rc;
mcmd = mempool_alloc(qla_tgt_mgmt_cmd_mempool, GFP_ATOMIC); mcmd = mempool_alloc(qla_tgt_mgmt_cmd_mempool, GFP_ATOMIC);
...@@ -4387,8 +4385,8 @@ static int __qlt_abort_task(struct scsi_qla_host *vha, ...@@ -4387,8 +4385,8 @@ static int __qlt_abort_task(struct scsi_qla_host *vha,
memcpy(&mcmd->orig_iocb.imm_ntfy, iocb, memcpy(&mcmd->orig_iocb.imm_ntfy, iocb,
sizeof(mcmd->orig_iocb.imm_ntfy)); sizeof(mcmd->orig_iocb.imm_ntfy));
lun = a->u.isp24.fcp_cmnd.lun; unpacked_lun =
unpacked_lun = scsilun_to_int((struct scsi_lun *)&lun); scsilun_to_int((struct scsi_lun *)&a->u.isp24.fcp_cmnd.lun);
mcmd->reset_count = vha->hw->chip_reset; mcmd->reset_count = vha->hw->chip_reset;
mcmd->tmr_func = QLA_TGT_2G_ABORT_TASK; mcmd->tmr_func = QLA_TGT_2G_ABORT_TASK;
...@@ -5877,7 +5875,7 @@ static void qlt_tmr_work(struct qla_tgt *tgt, ...@@ -5877,7 +5875,7 @@ static void qlt_tmr_work(struct qla_tgt *tgt,
unsigned long flags; unsigned long flags;
uint8_t *s_id = NULL; /* to hide compiler warnings */ uint8_t *s_id = NULL; /* to hide compiler warnings */
int rc; int rc;
uint32_t lun, unpacked_lun; u64 unpacked_lun;
int fn; int fn;
void *iocb; void *iocb;
...@@ -5913,9 +5911,9 @@ static void qlt_tmr_work(struct qla_tgt *tgt, ...@@ -5913,9 +5911,9 @@ static void qlt_tmr_work(struct qla_tgt *tgt,
} }
iocb = a; iocb = a;
lun = a->u.isp24.fcp_cmnd.lun;
fn = a->u.isp24.fcp_cmnd.task_mgmt_flags; fn = a->u.isp24.fcp_cmnd.task_mgmt_flags;
unpacked_lun = scsilun_to_int((struct scsi_lun *)&lun); unpacked_lun =
scsilun_to_int((struct scsi_lun *)&a->u.isp24.fcp_cmnd.lun);
rc = qlt_issue_task_mgmt(sess, unpacked_lun, fn, iocb, 0); rc = qlt_issue_task_mgmt(sess, unpacked_lun, fn, iocb, 0);
ha->tgt.tgt_ops->put_sess(sess); ha->tgt.tgt_ops->put_sess(sess);
......
...@@ -675,7 +675,7 @@ struct qla_tgt_func_tmpl { ...@@ -675,7 +675,7 @@ struct qla_tgt_func_tmpl {
int (*handle_cmd)(struct scsi_qla_host *, struct qla_tgt_cmd *, int (*handle_cmd)(struct scsi_qla_host *, struct qla_tgt_cmd *,
unsigned char *, uint32_t, int, int, int); unsigned char *, uint32_t, int, int, int);
void (*handle_data)(struct qla_tgt_cmd *); void (*handle_data)(struct qla_tgt_cmd *);
int (*handle_tmr)(struct qla_tgt_mgmt_cmd *, uint32_t, uint16_t, int (*handle_tmr)(struct qla_tgt_mgmt_cmd *, u64, uint16_t,
uint32_t); uint32_t);
void (*free_cmd)(struct qla_tgt_cmd *); void (*free_cmd)(struct qla_tgt_cmd *);
void (*free_mcmd)(struct qla_tgt_mgmt_cmd *); void (*free_mcmd)(struct qla_tgt_mgmt_cmd *);
...@@ -884,7 +884,7 @@ struct qla_tgt_cmd { ...@@ -884,7 +884,7 @@ struct qla_tgt_cmd {
int sg_cnt; /* SG segments count */ int sg_cnt; /* SG segments count */
int bufflen; /* cmd buffer length */ int bufflen; /* cmd buffer length */
int offset; int offset;
uint32_t unpacked_lun; u64 unpacked_lun;
enum dma_data_direction dma_data_direction; enum dma_data_direction dma_data_direction;
uint32_t reset_count; uint32_t reset_count;
......
...@@ -595,7 +595,7 @@ static int tcm_qla2xxx_dif_tags(struct qla_tgt_cmd *cmd, ...@@ -595,7 +595,7 @@ static int tcm_qla2xxx_dif_tags(struct qla_tgt_cmd *cmd,
/* /*
* Called from qla_target.c:qlt_issue_task_mgmt() * Called from qla_target.c:qlt_issue_task_mgmt()
*/ */
static int tcm_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, uint32_t lun, static int tcm_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, u64 lun,
uint16_t tmr_func, uint32_t tag) uint16_t tmr_func, uint32_t tag)
{ {
struct fc_port *sess = mcmd->sess; struct fc_port *sess = mcmd->sess;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment