diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2015-04-14 07:26:44 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-05-31 01:42:31 -0400 |
commit | 649ee05499d1257a3af0e10d961a1c52d9ef95b7 (patch) | |
tree | 2c4ce7d541140925f8ebaaf76a30e0cbdb574dd2 | |
parent | 2650d71e244fb3637b5f58a0080682a8bf9c7091 (diff) |
target: Move task tag into struct se_cmd + support 64-bit tags
Simplify target core and target drivers by storing the task tag
a.k.a. command identifier inside struct se_cmd.
For several transports (e.g. SRP) tags are 64 bits wide.
Hence add support for 64-bit tags.
(Fix core_tmr_abort_task conversion spec warnings - nab)
(Fix up usb-gadget to use 16-bit tags - HCH + bart)
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Andy Grover <agrover@redhat.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: <qla2xxx-upstream@qlogic.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
22 files changed, 76 insertions, 182 deletions
diff --git a/Documentation/target/tcm_mod_builder.py b/Documentation/target/tcm_mod_builder.py index 0dbd70cccde1..71e1f5863310 100755 --- a/Documentation/target/tcm_mod_builder.py +++ b/Documentation/target/tcm_mod_builder.py | |||
@@ -310,7 +310,6 @@ def tcm_mod_build_configfs(proto_ident, fabric_mod_dir_var, fabric_mod_name): | |||
310 | buf += " .write_pending = " + fabric_mod_name + "_write_pending,\n" | 310 | buf += " .write_pending = " + fabric_mod_name + "_write_pending,\n" |
311 | buf += " .write_pending_status = " + fabric_mod_name + "_write_pending_status,\n" | 311 | buf += " .write_pending_status = " + fabric_mod_name + "_write_pending_status,\n" |
312 | buf += " .set_default_node_attributes = " + fabric_mod_name + "_set_default_node_attrs,\n" | 312 | buf += " .set_default_node_attributes = " + fabric_mod_name + "_set_default_node_attrs,\n" |
313 | buf += " .get_task_tag = " + fabric_mod_name + "_get_task_tag,\n" | ||
314 | buf += " .get_cmd_state = " + fabric_mod_name + "_get_cmd_state,\n" | 313 | buf += " .get_cmd_state = " + fabric_mod_name + "_get_cmd_state,\n" |
315 | buf += " .queue_data_in = " + fabric_mod_name + "_queue_data_in,\n" | 314 | buf += " .queue_data_in = " + fabric_mod_name + "_queue_data_in,\n" |
316 | buf += " .queue_status = " + fabric_mod_name + "_queue_status,\n" | 315 | buf += " .queue_status = " + fabric_mod_name + "_queue_status,\n" |
@@ -525,13 +524,6 @@ def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name): | |||
525 | buf += "}\n\n" | 524 | buf += "}\n\n" |
526 | bufi += "void " + fabric_mod_name + "_set_default_node_attrs(struct se_node_acl *);\n" | 525 | bufi += "void " + fabric_mod_name + "_set_default_node_attrs(struct se_node_acl *);\n" |
527 | 526 | ||
528 | if re.search('get_task_tag\)\(', fo): | ||
529 | buf += "u32 " + fabric_mod_name + "_get_task_tag(struct se_cmd *se_cmd)\n" | ||
530 | buf += "{\n" | ||
531 | buf += " return 0;\n" | ||
532 | buf += "}\n\n" | ||
533 | bufi += "u32 " + fabric_mod_name + "_get_task_tag(struct se_cmd *);\n" | ||
534 | |||
535 | if re.search('get_cmd_state\)\(', fo): | 527 | if re.search('get_cmd_state\)\(', fo): |
536 | buf += "int " + fabric_mod_name + "_get_cmd_state(struct se_cmd *se_cmd)\n" | 528 | buf += "int " + fabric_mod_name + "_get_cmd_state(struct se_cmd *se_cmd)\n" |
537 | buf += "{\n" | 529 | buf += "{\n" |
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 98e00360f97e..56df5cd918c5 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c | |||
@@ -1339,7 +1339,7 @@ static int srpt_abort_cmd(struct srpt_send_ioctx *ioctx) | |||
1339 | } | 1339 | } |
1340 | 1340 | ||
1341 | pr_debug("Aborting cmd with state %d and tag %lld\n", state, | 1341 | pr_debug("Aborting cmd with state %d and tag %lld\n", state, |
1342 | ioctx->tag); | 1342 | ioctx->cmd.tag); |
1343 | 1343 | ||
1344 | switch (state) { | 1344 | switch (state) { |
1345 | case SRPT_STATE_NEW: | 1345 | case SRPT_STATE_NEW: |
@@ -1701,7 +1701,7 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch, | |||
1701 | 1701 | ||
1702 | srp_cmd = recv_ioctx->ioctx.buf; | 1702 | srp_cmd = recv_ioctx->ioctx.buf; |
1703 | cmd = &send_ioctx->cmd; | 1703 | cmd = &send_ioctx->cmd; |
1704 | send_ioctx->tag = srp_cmd->tag; | 1704 | cmd->tag = srp_cmd->tag; |
1705 | 1705 | ||
1706 | switch (srp_cmd->task_attr) { | 1706 | switch (srp_cmd->task_attr) { |
1707 | case SRP_CMD_SIMPLE_Q: | 1707 | case SRP_CMD_SIMPLE_Q: |
@@ -1772,7 +1772,7 @@ static int srpt_rx_mgmt_fn_tag(struct srpt_send_ioctx *ioctx, u64 tag) | |||
1772 | for (i = 0; i < ch->rq_size; ++i) { | 1772 | for (i = 0; i < ch->rq_size; ++i) { |
1773 | target = ch->ioctx_ring[i]; | 1773 | target = ch->ioctx_ring[i]; |
1774 | if (target->cmd.se_lun == ioctx->cmd.se_lun && | 1774 | if (target->cmd.se_lun == ioctx->cmd.se_lun && |
1775 | target->tag == tag && | 1775 | target->cmd.tag == tag && |
1776 | srpt_get_cmd_state(target) != SRPT_STATE_DONE) { | 1776 | srpt_get_cmd_state(target) != SRPT_STATE_DONE) { |
1777 | ret = 0; | 1777 | ret = 0; |
1778 | /* now let the target core abort &target->cmd; */ | 1778 | /* now let the target core abort &target->cmd; */ |
@@ -1831,7 +1831,7 @@ static void srpt_handle_tsk_mgmt(struct srpt_rdma_ch *ch, | |||
1831 | srp_tsk->task_tag, srp_tsk->tag, ch->cm_id, ch->sess); | 1831 | srp_tsk->task_tag, srp_tsk->tag, ch->cm_id, ch->sess); |
1832 | 1832 | ||
1833 | srpt_set_cmd_state(send_ioctx, SRPT_STATE_MGMT); | 1833 | srpt_set_cmd_state(send_ioctx, SRPT_STATE_MGMT); |
1834 | send_ioctx->tag = srp_tsk->tag; | 1834 | send_ioctx->cmd.tag = srp_tsk->tag; |
1835 | tcm_tmr = srp_tmr_to_tcm(srp_tsk->tsk_mgmt_func); | 1835 | tcm_tmr = srp_tmr_to_tcm(srp_tsk->tsk_mgmt_func); |
1836 | if (tcm_tmr < 0) { | 1836 | if (tcm_tmr < 0) { |
1837 | send_ioctx->cmd.se_tmr_req->response = | 1837 | send_ioctx->cmd.se_tmr_req->response = |
@@ -2979,7 +2979,7 @@ static int srpt_write_pending(struct se_cmd *se_cmd) | |||
2979 | case CH_DRAINING: | 2979 | case CH_DRAINING: |
2980 | case CH_RELEASING: | 2980 | case CH_RELEASING: |
2981 | pr_debug("cmd with tag %lld: channel disconnecting\n", | 2981 | pr_debug("cmd with tag %lld: channel disconnecting\n", |
2982 | ioctx->tag); | 2982 | ioctx->cmd.tag); |
2983 | srpt_set_cmd_state(ioctx, SRPT_STATE_DATA_IN); | 2983 | srpt_set_cmd_state(ioctx, SRPT_STATE_DATA_IN); |
2984 | ret = -EINVAL; | 2984 | ret = -EINVAL; |
2985 | goto out; | 2985 | goto out; |
@@ -3054,24 +3054,24 @@ static void srpt_queue_response(struct se_cmd *cmd) | |||
3054 | ret = srpt_xfer_data(ch, ioctx); | 3054 | ret = srpt_xfer_data(ch, ioctx); |
3055 | if (ret) { | 3055 | if (ret) { |
3056 | pr_err("xfer_data failed for tag %llu\n", | 3056 | pr_err("xfer_data failed for tag %llu\n", |
3057 | ioctx->tag); | 3057 | ioctx->cmd.tag); |
3058 | return; | 3058 | return; |
3059 | } | 3059 | } |
3060 | } | 3060 | } |
3061 | 3061 | ||
3062 | if (state != SRPT_STATE_MGMT) | 3062 | if (state != SRPT_STATE_MGMT) |
3063 | resp_len = srpt_build_cmd_rsp(ch, ioctx, ioctx->tag, | 3063 | resp_len = srpt_build_cmd_rsp(ch, ioctx, ioctx->cmd.tag, |
3064 | cmd->scsi_status); | 3064 | cmd->scsi_status); |
3065 | else { | 3065 | else { |
3066 | srp_tm_status | 3066 | srp_tm_status |
3067 | = tcm_to_srp_tsk_mgmt_status(cmd->se_tmr_req->response); | 3067 | = tcm_to_srp_tsk_mgmt_status(cmd->se_tmr_req->response); |
3068 | resp_len = srpt_build_tskmgmt_rsp(ch, ioctx, srp_tm_status, | 3068 | resp_len = srpt_build_tskmgmt_rsp(ch, ioctx, srp_tm_status, |
3069 | ioctx->tag); | 3069 | ioctx->cmd.tag); |
3070 | } | 3070 | } |
3071 | ret = srpt_post_send(ch, ioctx, resp_len); | 3071 | ret = srpt_post_send(ch, ioctx, resp_len); |
3072 | if (ret) { | 3072 | if (ret) { |
3073 | pr_err("sending cmd response failed for tag %llu\n", | 3073 | pr_err("sending cmd response failed for tag %llu\n", |
3074 | ioctx->tag); | 3074 | ioctx->cmd.tag); |
3075 | srpt_unmap_sg_to_ib_sge(ch, ioctx); | 3075 | srpt_unmap_sg_to_ib_sge(ch, ioctx); |
3076 | srpt_set_cmd_state(ioctx, SRPT_STATE_DONE); | 3076 | srpt_set_cmd_state(ioctx, SRPT_STATE_DONE); |
3077 | target_put_sess_cmd(&ioctx->cmd); | 3077 | target_put_sess_cmd(&ioctx->cmd); |
@@ -3479,14 +3479,6 @@ static void srpt_set_default_node_attrs(struct se_node_acl *nacl) | |||
3479 | { | 3479 | { |
3480 | } | 3480 | } |
3481 | 3481 | ||
3482 | static u32 srpt_get_task_tag(struct se_cmd *se_cmd) | ||
3483 | { | ||
3484 | struct srpt_send_ioctx *ioctx; | ||
3485 | |||
3486 | ioctx = container_of(se_cmd, struct srpt_send_ioctx, cmd); | ||
3487 | return ioctx->tag; | ||
3488 | } | ||
3489 | |||
3490 | /* Note: only used from inside debug printk's by the TCM core. */ | 3482 | /* Note: only used from inside debug printk's by the TCM core. */ |
3491 | static int srpt_get_tcm_cmd_state(struct se_cmd *se_cmd) | 3483 | static int srpt_get_tcm_cmd_state(struct se_cmd *se_cmd) |
3492 | { | 3484 | { |
@@ -3838,7 +3830,6 @@ static const struct target_core_fabric_ops srpt_template = { | |||
3838 | .write_pending = srpt_write_pending, | 3830 | .write_pending = srpt_write_pending, |
3839 | .write_pending_status = srpt_write_pending_status, | 3831 | .write_pending_status = srpt_write_pending_status, |
3840 | .set_default_node_attributes = srpt_set_default_node_attrs, | 3832 | .set_default_node_attributes = srpt_set_default_node_attrs, |
3841 | .get_task_tag = srpt_get_task_tag, | ||
3842 | .get_cmd_state = srpt_get_tcm_cmd_state, | 3833 | .get_cmd_state = srpt_get_tcm_cmd_state, |
3843 | .queue_data_in = srpt_queue_data_in, | 3834 | .queue_data_in = srpt_queue_data_in, |
3844 | .queue_status = srpt_queue_status, | 3835 | .queue_status = srpt_queue_status, |
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h index 33b2c88b73ba..6fec740742bd 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.h +++ b/drivers/infiniband/ulp/srpt/ib_srpt.h | |||
@@ -238,7 +238,6 @@ struct srpt_send_ioctx { | |||
238 | bool rdma_aborted; | 238 | bool rdma_aborted; |
239 | struct se_cmd cmd; | 239 | struct se_cmd cmd; |
240 | struct completion tx_done; | 240 | struct completion tx_done; |
241 | u64 tag; | ||
242 | int sg_cnt; | 241 | int sg_cnt; |
243 | int mapped_sg_count; | 242 | int mapped_sg_count; |
244 | u16 n_rdma_ius; | 243 | u16 n_rdma_ius; |
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index fe8a8d157e22..e7515069e1ce 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
@@ -1191,7 +1191,7 @@ static int __qlt_24xx_handle_abts(struct scsi_qla_host *vha, | |||
1191 | list_for_each_entry(se_cmd, &se_sess->sess_cmd_list, se_cmd_list) { | 1191 | list_for_each_entry(se_cmd, &se_sess->sess_cmd_list, se_cmd_list) { |
1192 | struct qla_tgt_cmd *cmd = | 1192 | struct qla_tgt_cmd *cmd = |
1193 | container_of(se_cmd, struct qla_tgt_cmd, se_cmd); | 1193 | container_of(se_cmd, struct qla_tgt_cmd, se_cmd); |
1194 | if (cmd->tag == abts->exchange_addr_to_abort) { | 1194 | if (se_cmd->tag == abts->exchange_addr_to_abort) { |
1195 | lun = cmd->unpacked_lun; | 1195 | lun = cmd->unpacked_lun; |
1196 | found_lun = true; | 1196 | found_lun = true; |
1197 | break; | 1197 | break; |
@@ -1728,9 +1728,8 @@ static int qlt_pre_xmit_response(struct qla_tgt_cmd *cmd, | |||
1728 | 1728 | ||
1729 | if (unlikely(cmd->aborted)) { | 1729 | if (unlikely(cmd->aborted)) { |
1730 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf014, | 1730 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf014, |
1731 | "qla_target(%d): terminating exchange " | 1731 | "qla_target(%d): terminating exchange for aborted cmd=%p (se_cmd=%p, tag=%lld)", |
1732 | "for aborted cmd=%p (se_cmd=%p, tag=%d)", vha->vp_idx, cmd, | 1732 | vha->vp_idx, cmd, se_cmd, se_cmd->tag); |
1733 | se_cmd, cmd->tag); | ||
1734 | 1733 | ||
1735 | cmd->state = QLA_TGT_STATE_ABORTED; | 1734 | cmd->state = QLA_TGT_STATE_ABORTED; |
1736 | cmd->cmd_flags |= BIT_6; | 1735 | cmd->cmd_flags |= BIT_6; |
@@ -1765,18 +1764,17 @@ static int qlt_pre_xmit_response(struct qla_tgt_cmd *cmd, | |||
1765 | if (se_cmd->se_cmd_flags & SCF_UNDERFLOW_BIT) { | 1764 | if (se_cmd->se_cmd_flags & SCF_UNDERFLOW_BIT) { |
1766 | prm->residual = se_cmd->residual_count; | 1765 | prm->residual = se_cmd->residual_count; |
1767 | ql_dbg(ql_dbg_io + ql_dbg_verbose, vha, 0x305c, | 1766 | ql_dbg(ql_dbg_io + ql_dbg_verbose, vha, 0x305c, |
1768 | "Residual underflow: %d (tag %d, " | 1767 | "Residual underflow: %d (tag %lld, op %x, bufflen %d, rq_result %x)\n", |
1769 | "op %x, bufflen %d, rq_result %x)\n", prm->residual, | 1768 | prm->residual, se_cmd->tag, |
1770 | cmd->tag, se_cmd->t_task_cdb ? se_cmd->t_task_cdb[0] : 0, | 1769 | se_cmd->t_task_cdb ? se_cmd->t_task_cdb[0] : 0, |
1771 | cmd->bufflen, prm->rq_result); | 1770 | cmd->bufflen, prm->rq_result); |
1772 | prm->rq_result |= SS_RESIDUAL_UNDER; | 1771 | prm->rq_result |= SS_RESIDUAL_UNDER; |
1773 | } else if (se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) { | 1772 | } else if (se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) { |
1774 | prm->residual = se_cmd->residual_count; | 1773 | prm->residual = se_cmd->residual_count; |
1775 | ql_dbg(ql_dbg_io, vha, 0x305d, | 1774 | ql_dbg(ql_dbg_io, vha, 0x305d, |
1776 | "Residual overflow: %d (tag %d, " | 1775 | "Residual overflow: %d (tag %lld, op %x, bufflen %d, rq_result %x)\n", |
1777 | "op %x, bufflen %d, rq_result %x)\n", prm->residual, | 1776 | prm->residual, se_cmd->tag, se_cmd->t_task_cdb ? |
1778 | cmd->tag, se_cmd->t_task_cdb ? se_cmd->t_task_cdb[0] : 0, | 1777 | se_cmd->t_task_cdb[0] : 0, cmd->bufflen, prm->rq_result); |
1779 | cmd->bufflen, prm->rq_result); | ||
1780 | prm->rq_result |= SS_RESIDUAL_OVER; | 1778 | prm->rq_result |= SS_RESIDUAL_OVER; |
1781 | } | 1779 | } |
1782 | 1780 | ||
@@ -1849,7 +1847,7 @@ static void qlt_check_srr_debug(struct qla_tgt_cmd *cmd, int *xmit_type) | |||
1849 | == 50) { | 1847 | == 50) { |
1850 | *xmit_type &= ~QLA_TGT_XMIT_STATUS; | 1848 | *xmit_type &= ~QLA_TGT_XMIT_STATUS; |
1851 | ql_dbg(ql_dbg_tgt_mgt, cmd->vha, 0xf015, | 1849 | ql_dbg(ql_dbg_tgt_mgt, cmd->vha, 0xf015, |
1852 | "Dropping cmd %p (tag %d) status", cmd, cmd->tag); | 1850 | "Dropping cmd %p (tag %d) status", cmd, se_cmd->tag); |
1853 | } | 1851 | } |
1854 | #endif | 1852 | #endif |
1855 | /* | 1853 | /* |
@@ -1873,7 +1871,7 @@ static void qlt_check_srr_debug(struct qla_tgt_cmd *cmd, int *xmit_type) | |||
1873 | ql_dbg(ql_dbg_tgt_mgt, cmd->vha, 0xf016, | 1871 | ql_dbg(ql_dbg_tgt_mgt, cmd->vha, 0xf016, |
1874 | "Cutting cmd %p (tag %d) buffer" | 1872 | "Cutting cmd %p (tag %d) buffer" |
1875 | " tail to len %d, sg_cnt %d (cmd->bufflen %d," | 1873 | " tail to len %d, sg_cnt %d (cmd->bufflen %d," |
1876 | " cmd->sg_cnt %d)", cmd, cmd->tag, tot_len, leave, | 1874 | " cmd->sg_cnt %d)", cmd, se_cmd->tag, tot_len, leave, |
1877 | cmd->bufflen, cmd->sg_cnt); | 1875 | cmd->bufflen, cmd->sg_cnt); |
1878 | 1876 | ||
1879 | cmd->bufflen = tot_len; | 1877 | cmd->bufflen = tot_len; |
@@ -1885,13 +1883,13 @@ static void qlt_check_srr_debug(struct qla_tgt_cmd *cmd, int *xmit_type) | |||
1885 | 1883 | ||
1886 | ql_dbg(ql_dbg_tgt_mgt, cmd->vha, 0xf017, | 1884 | ql_dbg(ql_dbg_tgt_mgt, cmd->vha, 0xf017, |
1887 | "Cutting cmd %p (tag %d) buffer head " | 1885 | "Cutting cmd %p (tag %d) buffer head " |
1888 | "to offset %d (cmd->bufflen %d)", cmd, cmd->tag, offset, | 1886 | "to offset %d (cmd->bufflen %d)", cmd, se_cmd->tag, offset, |
1889 | cmd->bufflen); | 1887 | cmd->bufflen); |
1890 | if (offset == 0) | 1888 | if (offset == 0) |
1891 | *xmit_type &= ~QLA_TGT_XMIT_DATA; | 1889 | *xmit_type &= ~QLA_TGT_XMIT_DATA; |
1892 | else if (qlt_set_data_offset(cmd, offset)) { | 1890 | else if (qlt_set_data_offset(cmd, offset)) { |
1893 | ql_dbg(ql_dbg_tgt_mgt, cmd->vha, 0xf018, | 1891 | ql_dbg(ql_dbg_tgt_mgt, cmd->vha, 0xf018, |
1894 | "qlt_set_data_offset() failed (tag %d)", cmd->tag); | 1892 | "qlt_set_data_offset() failed (tag %d)", se_cmd->tag); |
1895 | } | 1893 | } |
1896 | } | 1894 | } |
1897 | } | 1895 | } |
@@ -3194,7 +3192,7 @@ skip_term: | |||
3194 | return; | 3192 | return; |
3195 | } else if (cmd->state == QLA_TGT_STATE_ABORTED) { | 3193 | } else if (cmd->state == QLA_TGT_STATE_ABORTED) { |
3196 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf01e, | 3194 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf01e, |
3197 | "Aborted command %p (tag %d) finished\n", cmd, cmd->tag); | 3195 | "Aborted command %p (tag %lld) finished\n", cmd, se_cmd->tag); |
3198 | } else { | 3196 | } else { |
3199 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf05c, | 3197 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf05c, |
3200 | "qla_target(%d): A command in state (%d) should " | 3198 | "qla_target(%d): A command in state (%d) should " |
@@ -3266,7 +3264,7 @@ static void __qlt_do_work(struct qla_tgt_cmd *cmd) | |||
3266 | goto out_term; | 3264 | goto out_term; |
3267 | 3265 | ||
3268 | cdb = &atio->u.isp24.fcp_cmnd.cdb[0]; | 3266 | cdb = &atio->u.isp24.fcp_cmnd.cdb[0]; |
3269 | cmd->tag = atio->u.isp24.exchange_addr; | 3267 | cmd->se_cmd.tag = atio->u.isp24.exchange_addr; |
3270 | cmd->unpacked_lun = scsilun_to_int( | 3268 | cmd->unpacked_lun = scsilun_to_int( |
3271 | (struct scsi_lun *)&atio->u.isp24.fcp_cmnd.lun); | 3269 | (struct scsi_lun *)&atio->u.isp24.fcp_cmnd.lun); |
3272 | 3270 | ||
@@ -3891,9 +3889,8 @@ static void qlt_handle_srr(struct scsi_qla_host *vha, | |||
3891 | resp = 1; | 3889 | resp = 1; |
3892 | } else { | 3890 | } else { |
3893 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf064, | 3891 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf064, |
3894 | "qla_target(%d): SRR for in data for cmd " | 3892 | "qla_target(%d): SRR for in data for cmd without them (tag %lld, SCSI status %d), reject", |
3895 | "without them (tag %d, SCSI status %d), " | 3893 | vha->vp_idx, se_cmd->tag, |
3896 | "reject", vha->vp_idx, cmd->tag, | ||
3897 | cmd->se_cmd.scsi_status); | 3894 | cmd->se_cmd.scsi_status); |
3898 | goto out_reject; | 3895 | goto out_reject; |
3899 | } | 3896 | } |
@@ -3927,10 +3924,8 @@ static void qlt_handle_srr(struct scsi_qla_host *vha, | |||
3927 | } | 3924 | } |
3928 | } else { | 3925 | } else { |
3929 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf066, | 3926 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf066, |
3930 | "qla_target(%d): SRR for out data for cmd " | 3927 | "qla_target(%d): SRR for out data for cmd without them (tag %lld, SCSI status %d), reject", |
3931 | "without them (tag %d, SCSI status %d), " | 3928 | vha->vp_idx, se_cmd->tag, cmd->se_cmd.scsi_status); |
3932 | "reject", vha->vp_idx, cmd->tag, | ||
3933 | cmd->se_cmd.scsi_status); | ||
3934 | goto out_reject; | 3929 | goto out_reject; |
3935 | } | 3930 | } |
3936 | break; | 3931 | break; |
@@ -4051,10 +4046,9 @@ restart: | |||
4051 | cmd->sg = se_cmd->t_data_sg; | 4046 | cmd->sg = se_cmd->t_data_sg; |
4052 | 4047 | ||
4053 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf02c, | 4048 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf02c, |
4054 | "SRR cmd %p (se_cmd %p, tag %d, op %x), " | 4049 | "SRR cmd %p (se_cmd %p, tag %lld, op %x), sg_cnt=%d, offset=%d", |
4055 | "sg_cnt=%d, offset=%d", cmd, &cmd->se_cmd, cmd->tag, | 4050 | cmd, &cmd->se_cmd, se_cmd->tag, se_cmd->t_task_cdb ? |
4056 | se_cmd->t_task_cdb ? se_cmd->t_task_cdb[0] : 0, | 4051 | se_cmd->t_task_cdb[0] : 0, cmd->sg_cnt, cmd->offset); |
4057 | cmd->sg_cnt, cmd->offset); | ||
4058 | 4052 | ||
4059 | qlt_handle_srr(vha, sctio, imm); | 4053 | qlt_handle_srr(vha, sctio, imm); |
4060 | 4054 | ||
diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h index 332086776dfe..985d76dd706b 100644 --- a/drivers/scsi/qla2xxx/qla_target.h +++ b/drivers/scsi/qla2xxx/qla_target.h | |||
@@ -924,7 +924,6 @@ struct qla_tgt_cmd { | |||
924 | int sg_cnt; /* SG segments count */ | 924 | int sg_cnt; /* SG segments count */ |
925 | int bufflen; /* cmd buffer length */ | 925 | int bufflen; /* cmd buffer length */ |
926 | int offset; | 926 | int offset; |
927 | uint32_t tag; | ||
928 | uint32_t unpacked_lun; | 927 | uint32_t unpacked_lun; |
929 | enum dma_data_direction dma_data_direction; | 928 | enum dma_data_direction dma_data_direction; |
930 | uint32_t reset_count; | 929 | uint32_t reset_count; |
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index bd0f9eb67901..8e331220adda 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c | |||
@@ -421,19 +421,6 @@ static void tcm_qla2xxx_set_default_node_attrs(struct se_node_acl *nacl) | |||
421 | return; | 421 | return; |
422 | } | 422 | } |
423 | 423 | ||
424 | static u32 tcm_qla2xxx_get_task_tag(struct se_cmd *se_cmd) | ||
425 | { | ||
426 | struct qla_tgt_cmd *cmd; | ||
427 | |||
428 | /* check for task mgmt cmd */ | ||
429 | if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) | ||
430 | return 0xffffffff; | ||
431 | |||
432 | cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd); | ||
433 | |||
434 | return cmd->tag; | ||
435 | } | ||
436 | |||
437 | static int tcm_qla2xxx_get_cmd_state(struct se_cmd *se_cmd) | 424 | static int tcm_qla2xxx_get_cmd_state(struct se_cmd *se_cmd) |
438 | { | 425 | { |
439 | return 0; | 426 | return 0; |
@@ -1865,7 +1852,6 @@ static const struct target_core_fabric_ops tcm_qla2xxx_ops = { | |||
1865 | .write_pending = tcm_qla2xxx_write_pending, | 1852 | .write_pending = tcm_qla2xxx_write_pending, |
1866 | .write_pending_status = tcm_qla2xxx_write_pending_status, | 1853 | .write_pending_status = tcm_qla2xxx_write_pending_status, |
1867 | .set_default_node_attributes = tcm_qla2xxx_set_default_node_attrs, | 1854 | .set_default_node_attributes = tcm_qla2xxx_set_default_node_attrs, |
1868 | .get_task_tag = tcm_qla2xxx_get_task_tag, | ||
1869 | .get_cmd_state = tcm_qla2xxx_get_cmd_state, | 1855 | .get_cmd_state = tcm_qla2xxx_get_cmd_state, |
1870 | .queue_data_in = tcm_qla2xxx_queue_data_in, | 1856 | .queue_data_in = tcm_qla2xxx_queue_data_in, |
1871 | .queue_status = tcm_qla2xxx_queue_status, | 1857 | .queue_status = tcm_qla2xxx_queue_status, |
@@ -1910,7 +1896,6 @@ static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { | |||
1910 | .write_pending = tcm_qla2xxx_write_pending, | 1896 | .write_pending = tcm_qla2xxx_write_pending, |
1911 | .write_pending_status = tcm_qla2xxx_write_pending_status, | 1897 | .write_pending_status = tcm_qla2xxx_write_pending_status, |
1912 | .set_default_node_attributes = tcm_qla2xxx_set_default_node_attrs, | 1898 | .set_default_node_attributes = tcm_qla2xxx_set_default_node_attrs, |
1913 | .get_task_tag = tcm_qla2xxx_get_task_tag, | ||
1914 | .get_cmd_state = tcm_qla2xxx_get_cmd_state, | 1899 | .get_cmd_state = tcm_qla2xxx_get_cmd_state, |
1915 | .queue_data_in = tcm_qla2xxx_queue_data_in, | 1900 | .queue_data_in = tcm_qla2xxx_queue_data_in, |
1916 | .queue_status = tcm_qla2xxx_queue_status, | 1901 | .queue_status = tcm_qla2xxx_queue_status, |
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 866c167c0986..3c4431f71158 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
@@ -1008,6 +1008,8 @@ int iscsit_setup_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
1008 | if (cmd->sense_reason) | 1008 | if (cmd->sense_reason) |
1009 | goto attach_cmd; | 1009 | goto attach_cmd; |
1010 | 1010 | ||
1011 | /* only used for printks or comparing with ->ref_task_tag */ | ||
1012 | cmd->se_cmd.tag = (__force u32)cmd->init_task_tag; | ||
1011 | cmd->sense_reason = target_setup_cmd_from_cdb(&cmd->se_cmd, hdr->cdb); | 1013 | cmd->sense_reason = target_setup_cmd_from_cdb(&cmd->se_cmd, hdr->cdb); |
1012 | if (cmd->sense_reason) { | 1014 | if (cmd->sense_reason) { |
1013 | if (cmd->sense_reason == TCM_OUT_OF_RESOURCES) { | 1015 | if (cmd->sense_reason == TCM_OUT_OF_RESOURCES) { |
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index bd8af8764f4b..aa4fc4d8e176 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c | |||
@@ -1692,14 +1692,6 @@ static char *iscsi_get_fabric_name(void) | |||
1692 | return "iSCSI"; | 1692 | return "iSCSI"; |
1693 | } | 1693 | } |
1694 | 1694 | ||
1695 | static u32 iscsi_get_task_tag(struct se_cmd *se_cmd) | ||
1696 | { | ||
1697 | struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd); | ||
1698 | |||
1699 | /* only used for printks or comparism with ->ref_task_tag */ | ||
1700 | return (__force u32)cmd->init_task_tag; | ||
1701 | } | ||
1702 | |||
1703 | static int iscsi_get_cmd_state(struct se_cmd *se_cmd) | 1695 | static int iscsi_get_cmd_state(struct se_cmd *se_cmd) |
1704 | { | 1696 | { |
1705 | struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd); | 1697 | struct iscsi_cmd *cmd = container_of(se_cmd, struct iscsi_cmd, se_cmd); |
@@ -1938,7 +1930,6 @@ const struct target_core_fabric_ops iscsi_ops = { | |||
1938 | .write_pending = lio_write_pending, | 1930 | .write_pending = lio_write_pending, |
1939 | .write_pending_status = lio_write_pending_status, | 1931 | .write_pending_status = lio_write_pending_status, |
1940 | .set_default_node_attributes = lio_set_default_node_attributes, | 1932 | .set_default_node_attributes = lio_set_default_node_attributes, |
1941 | .get_task_tag = iscsi_get_task_tag, | ||
1942 | .get_cmd_state = iscsi_get_cmd_state, | 1933 | .get_cmd_state = iscsi_get_cmd_state, |
1943 | .queue_data_in = lio_queue_data_in, | 1934 | .queue_data_in = lio_queue_data_in, |
1944 | .queue_status = lio_queue_status, | 1935 | .queue_status = lio_queue_status, |
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index b788406977f6..07d3b52c88eb 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c | |||
@@ -165,6 +165,7 @@ static void tcm_loop_submission_work(struct work_struct *work) | |||
165 | transfer_length = scsi_bufflen(sc); | 165 | transfer_length = scsi_bufflen(sc); |
166 | } | 166 | } |
167 | 167 | ||
168 | se_cmd->tag = tl_cmd->sc_cmd_tag; | ||
168 | rc = target_submit_cmd_map_sgls(se_cmd, tl_nexus->se_sess, sc->cmnd, | 169 | rc = target_submit_cmd_map_sgls(se_cmd, tl_nexus->se_sess, sc->cmnd, |
169 | &tl_cmd->tl_sense_buf[0], tl_cmd->sc->device->lun, | 170 | &tl_cmd->tl_sense_buf[0], tl_cmd->sc->device->lun, |
170 | transfer_length, TCM_SIMPLE_TAG, | 171 | transfer_length, TCM_SIMPLE_TAG, |
@@ -597,14 +598,6 @@ static void tcm_loop_set_default_node_attributes(struct se_node_acl *se_acl) | |||
597 | return; | 598 | return; |
598 | } | 599 | } |
599 | 600 | ||
600 | static u32 tcm_loop_get_task_tag(struct se_cmd *se_cmd) | ||
601 | { | ||
602 | struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, | ||
603 | struct tcm_loop_cmd, tl_se_cmd); | ||
604 | |||
605 | return tl_cmd->sc_cmd_tag; | ||
606 | } | ||
607 | |||
608 | static int tcm_loop_get_cmd_state(struct se_cmd *se_cmd) | 601 | static int tcm_loop_get_cmd_state(struct se_cmd *se_cmd) |
609 | { | 602 | { |
610 | struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, | 603 | struct tcm_loop_cmd *tl_cmd = container_of(se_cmd, |
@@ -1259,7 +1252,6 @@ static const struct target_core_fabric_ops loop_ops = { | |||
1259 | .write_pending = tcm_loop_write_pending, | 1252 | .write_pending = tcm_loop_write_pending, |
1260 | .write_pending_status = tcm_loop_write_pending_status, | 1253 | .write_pending_status = tcm_loop_write_pending_status, |
1261 | .set_default_node_attributes = tcm_loop_set_default_node_attributes, | 1254 | .set_default_node_attributes = tcm_loop_set_default_node_attributes, |
1262 | .get_task_tag = tcm_loop_get_task_tag, | ||
1263 | .get_cmd_state = tcm_loop_get_cmd_state, | 1255 | .get_cmd_state = tcm_loop_get_cmd_state, |
1264 | .queue_data_in = tcm_loop_queue_data_in, | 1256 | .queue_data_in = tcm_loop_queue_data_in, |
1265 | .queue_status = tcm_loop_queue_status, | 1257 | .queue_status = tcm_loop_queue_status, |
diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index 89f172dc8678..2916a4023e71 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c | |||
@@ -1234,6 +1234,8 @@ static void sbp_handle_command(struct sbp_target_request *req) | |||
1234 | pr_debug("sbp_handle_command ORB:0x%llx unpacked_lun:%d data_len:%d data_dir:%d\n", | 1234 | pr_debug("sbp_handle_command ORB:0x%llx unpacked_lun:%d data_len:%d data_dir:%d\n", |
1235 | req->orb_pointer, unpacked_lun, data_length, data_dir); | 1235 | req->orb_pointer, unpacked_lun, data_length, data_dir); |
1236 | 1236 | ||
1237 | /* only used for printk until we do TMRs */ | ||
1238 | req->se_cmd.tag = req->orb_pointer; | ||
1237 | if (target_submit_cmd(&req->se_cmd, sess->se_sess, req->cmd_buf, | 1239 | if (target_submit_cmd(&req->se_cmd, sess->se_sess, req->cmd_buf, |
1238 | req->sense_buf, unpacked_lun, data_length, | 1240 | req->sense_buf, unpacked_lun, data_length, |
1239 | TCM_SIMPLE_TAG, data_dir, 0)) | 1241 | TCM_SIMPLE_TAG, data_dir, 0)) |
@@ -1768,15 +1770,6 @@ static void sbp_set_default_node_attrs(struct se_node_acl *nacl) | |||
1768 | return; | 1770 | return; |
1769 | } | 1771 | } |
1770 | 1772 | ||
1771 | static u32 sbp_get_task_tag(struct se_cmd *se_cmd) | ||
1772 | { | ||
1773 | struct sbp_target_request *req = container_of(se_cmd, | ||
1774 | struct sbp_target_request, se_cmd); | ||
1775 | |||
1776 | /* only used for printk until we do TMRs */ | ||
1777 | return (u32)req->orb_pointer; | ||
1778 | } | ||
1779 | |||
1780 | static int sbp_get_cmd_state(struct se_cmd *se_cmd) | 1773 | static int sbp_get_cmd_state(struct se_cmd *se_cmd) |
1781 | { | 1774 | { |
1782 | return 0; | 1775 | return 0; |
@@ -2377,7 +2370,6 @@ static const struct target_core_fabric_ops sbp_ops = { | |||
2377 | .write_pending = sbp_write_pending, | 2370 | .write_pending = sbp_write_pending, |
2378 | .write_pending_status = sbp_write_pending_status, | 2371 | .write_pending_status = sbp_write_pending_status, |
2379 | .set_default_node_attributes = sbp_set_default_node_attrs, | 2372 | .set_default_node_attributes = sbp_set_default_node_attrs, |
2380 | .get_task_tag = sbp_get_task_tag, | ||
2381 | .get_cmd_state = sbp_get_cmd_state, | 2373 | .get_cmd_state = sbp_get_cmd_state, |
2382 | .queue_data_in = sbp_queue_data_in, | 2374 | .queue_data_in = sbp_queue_data_in, |
2383 | .queue_status = sbp_queue_status, | 2375 | .queue_status = sbp_queue_status, |
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 5e2649fc6919..fc598c084523 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c | |||
@@ -374,10 +374,6 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo) | |||
374 | pr_err("Missing tfo->set_default_node_attributes()\n"); | 374 | pr_err("Missing tfo->set_default_node_attributes()\n"); |
375 | return -EINVAL; | 375 | return -EINVAL; |
376 | } | 376 | } |
377 | if (!tfo->get_task_tag) { | ||
378 | pr_err("Missing tfo->get_task_tag()\n"); | ||
379 | return -EINVAL; | ||
380 | } | ||
381 | if (!tfo->get_cmd_state) { | 377 | if (!tfo->get_cmd_state) { |
382 | pr_err("Missing tfo->get_cmd_state()\n"); | 378 | pr_err("Missing tfo->get_cmd_state()\n"); |
383 | return -EINVAL; | 379 | return -EINVAL; |
diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c index b2e169fba3c6..393aca8bb3eb 100644 --- a/drivers/target/target_core_tmr.c +++ b/drivers/target/target_core_tmr.c | |||
@@ -117,7 +117,7 @@ void core_tmr_abort_task( | |||
117 | { | 117 | { |
118 | struct se_cmd *se_cmd; | 118 | struct se_cmd *se_cmd; |
119 | unsigned long flags; | 119 | unsigned long flags; |
120 | int ref_tag; | 120 | u64 ref_tag; |
121 | 121 | ||
122 | spin_lock_irqsave(&se_sess->sess_cmd_lock, flags); | 122 | spin_lock_irqsave(&se_sess->sess_cmd_lock, flags); |
123 | list_for_each_entry(se_cmd, &se_sess->sess_cmd_list, se_cmd_list) { | 123 | list_for_each_entry(se_cmd, &se_sess->sess_cmd_list, se_cmd_list) { |
@@ -129,16 +129,17 @@ void core_tmr_abort_task( | |||
129 | if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) | 129 | if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) |
130 | continue; | 130 | continue; |
131 | 131 | ||
132 | ref_tag = se_cmd->se_tfo->get_task_tag(se_cmd); | 132 | ref_tag = se_cmd->tag; |
133 | if (tmr->ref_task_tag != ref_tag) | 133 | if (tmr->ref_task_tag != ref_tag) |
134 | continue; | 134 | continue; |
135 | 135 | ||
136 | printk("ABORT_TASK: Found referenced %s task_tag: %u\n", | 136 | printk("ABORT_TASK: Found referenced %s task_tag: %llu\n", |
137 | se_cmd->se_tfo->get_fabric_name(), ref_tag); | 137 | se_cmd->se_tfo->get_fabric_name(), ref_tag); |
138 | 138 | ||
139 | spin_lock(&se_cmd->t_state_lock); | 139 | spin_lock(&se_cmd->t_state_lock); |
140 | if (se_cmd->transport_state & CMD_T_COMPLETE) { | 140 | if (se_cmd->transport_state & CMD_T_COMPLETE) { |
141 | printk("ABORT_TASK: ref_tag: %u already complete, skipping\n", ref_tag); | 141 | printk("ABORT_TASK: ref_tag: %llu already complete," |
142 | " skipping\n", ref_tag); | ||
142 | spin_unlock(&se_cmd->t_state_lock); | 143 | spin_unlock(&se_cmd->t_state_lock); |
143 | spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); | 144 | spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); |
144 | goto out; | 145 | goto out; |
@@ -157,14 +158,14 @@ void core_tmr_abort_task( | |||
157 | transport_cmd_finish_abort(se_cmd, true); | 158 | transport_cmd_finish_abort(se_cmd, true); |
158 | 159 | ||
159 | printk("ABORT_TASK: Sending TMR_FUNCTION_COMPLETE for" | 160 | printk("ABORT_TASK: Sending TMR_FUNCTION_COMPLETE for" |
160 | " ref_tag: %d\n", ref_tag); | 161 | " ref_tag: %llu\n", ref_tag); |
161 | tmr->response = TMR_FUNCTION_COMPLETE; | 162 | tmr->response = TMR_FUNCTION_COMPLETE; |
162 | return; | 163 | return; |
163 | } | 164 | } |
164 | spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); | 165 | spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); |
165 | 166 | ||
166 | out: | 167 | out: |
167 | printk("ABORT_TASK: Sending TMR_TASK_DOES_NOT_EXIST for ref_tag: %d\n", | 168 | printk("ABORT_TASK: Sending TMR_TASK_DOES_NOT_EXIST for ref_tag: %lld\n", |
168 | tmr->ref_task_tag); | 169 | tmr->ref_task_tag); |
169 | tmr->response = TMR_TASK_DOES_NOT_EXIST; | 170 | tmr->response = TMR_TASK_DOES_NOT_EXIST; |
170 | } | 171 | } |
@@ -289,16 +290,16 @@ static void core_tmr_drain_state_list( | |||
289 | list_del(&cmd->state_list); | 290 | list_del(&cmd->state_list); |
290 | 291 | ||
291 | pr_debug("LUN_RESET: %s cmd: %p" | 292 | pr_debug("LUN_RESET: %s cmd: %p" |
292 | " ITT/CmdSN: 0x%08x/0x%08x, i_state: %d, t_state: %d" | 293 | " ITT/CmdSN: 0x%08llx/0x%08x, i_state: %d, t_state: %d" |
293 | "cdb: 0x%02x\n", | 294 | "cdb: 0x%02x\n", |
294 | (preempt_and_abort_list) ? "Preempt" : "", cmd, | 295 | (preempt_and_abort_list) ? "Preempt" : "", cmd, |
295 | cmd->se_tfo->get_task_tag(cmd), 0, | 296 | cmd->tag, 0, |
296 | cmd->se_tfo->get_cmd_state(cmd), cmd->t_state, | 297 | cmd->se_tfo->get_cmd_state(cmd), cmd->t_state, |
297 | cmd->t_task_cdb[0]); | 298 | cmd->t_task_cdb[0]); |
298 | pr_debug("LUN_RESET: ITT[0x%08x] - pr_res_key: 0x%016Lx" | 299 | pr_debug("LUN_RESET: ITT[0x%08llx] - pr_res_key: 0x%016Lx" |
299 | " -- CMD_T_ACTIVE: %d" | 300 | " -- CMD_T_ACTIVE: %d" |
300 | " CMD_T_STOP: %d CMD_T_SENT: %d\n", | 301 | " CMD_T_STOP: %d CMD_T_SENT: %d\n", |
301 | cmd->se_tfo->get_task_tag(cmd), cmd->pr_res_key, | 302 | cmd->tag, cmd->pr_res_key, |
302 | (cmd->transport_state & CMD_T_ACTIVE) != 0, | 303 | (cmd->transport_state & CMD_T_ACTIVE) != 0, |
303 | (cmd->transport_state & CMD_T_STOP) != 0, | 304 | (cmd->transport_state & CMD_T_STOP) != 0, |
304 | (cmd->transport_state & CMD_T_SENT) != 0); | 305 | (cmd->transport_state & CMD_T_SENT) != 0); |
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 85b021e749e6..0d8662bb470e 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -600,9 +600,8 @@ static int transport_cmd_check_stop(struct se_cmd *cmd, bool remove_from_lists, | |||
600 | * this command for frontend exceptions. | 600 | * this command for frontend exceptions. |
601 | */ | 601 | */ |
602 | if (cmd->transport_state & CMD_T_STOP) { | 602 | if (cmd->transport_state & CMD_T_STOP) { |
603 | pr_debug("%s:%d CMD_T_STOP for ITT: 0x%08x\n", | 603 | pr_debug("%s:%d CMD_T_STOP for ITT: 0x%08llx\n", |
604 | __func__, __LINE__, | 604 | __func__, __LINE__, cmd->tag); |
605 | cmd->se_tfo->get_task_tag(cmd)); | ||
606 | 605 | ||
607 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | 606 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); |
608 | 607 | ||
@@ -1155,6 +1154,8 @@ target_cmd_size_check(struct se_cmd *cmd, unsigned int size) | |||
1155 | /* | 1154 | /* |
1156 | * Used by fabric modules containing a local struct se_cmd within their | 1155 | * Used by fabric modules containing a local struct se_cmd within their |
1157 | * fabric dependent per I/O descriptor. | 1156 | * fabric dependent per I/O descriptor. |
1157 | * | ||
1158 | * Preserves the value of @cmd->tag. | ||
1158 | */ | 1159 | */ |
1159 | void transport_init_se_cmd( | 1160 | void transport_init_se_cmd( |
1160 | struct se_cmd *cmd, | 1161 | struct se_cmd *cmd, |
@@ -1380,6 +1381,8 @@ transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *sgl, | |||
1380 | * @sgl_prot: struct scatterlist memory protection information | 1381 | * @sgl_prot: struct scatterlist memory protection information |
1381 | * @sgl_prot_count: scatterlist count for protection information | 1382 | * @sgl_prot_count: scatterlist count for protection information |
1382 | * | 1383 | * |
1384 | * Task tags are supported if the caller has set @se_cmd->tag. | ||
1385 | * | ||
1383 | * Returns non zero to signal active I/O shutdown failure. All other | 1386 | * Returns non zero to signal active I/O shutdown failure. All other |
1384 | * setup exceptions will be returned as a SCSI CHECK_CONDITION response, | 1387 | * setup exceptions will be returned as a SCSI CHECK_CONDITION response, |
1385 | * but still return zero here. | 1388 | * but still return zero here. |
@@ -1512,6 +1515,8 @@ EXPORT_SYMBOL(target_submit_cmd_map_sgls); | |||
1512 | * @data_dir: DMA data direction | 1515 | * @data_dir: DMA data direction |
1513 | * @flags: flags for command submission from target_sc_flags_tables | 1516 | * @flags: flags for command submission from target_sc_flags_tables |
1514 | * | 1517 | * |
1518 | * Task tags are supported if the caller has set @se_cmd->tag. | ||
1519 | * | ||
1515 | * Returns non zero to signal active I/O shutdown failure. All other | 1520 | * Returns non zero to signal active I/O shutdown failure. All other |
1516 | * setup exceptions will be returned as a SCSI CHECK_CONDITION response, | 1521 | * setup exceptions will be returned as a SCSI CHECK_CONDITION response, |
1517 | * but still return zero here. | 1522 | * but still return zero here. |
@@ -1639,9 +1644,8 @@ void transport_generic_request_failure(struct se_cmd *cmd, | |||
1639 | { | 1644 | { |
1640 | int ret = 0; | 1645 | int ret = 0; |
1641 | 1646 | ||
1642 | pr_debug("-----[ Storage Engine Exception for cmd: %p ITT: 0x%08x" | 1647 | pr_debug("-----[ Storage Engine Exception for cmd: %p ITT: 0x%08llx" |
1643 | " CDB: 0x%02x\n", cmd, cmd->se_tfo->get_task_tag(cmd), | 1648 | " CDB: 0x%02x\n", cmd, cmd->tag, cmd->t_task_cdb[0]); |
1644 | cmd->t_task_cdb[0]); | ||
1645 | pr_debug("-----[ i_state: %d t_state: %d sense_reason: %d\n", | 1649 | pr_debug("-----[ i_state: %d t_state: %d sense_reason: %d\n", |
1646 | cmd->se_tfo->get_cmd_state(cmd), | 1650 | cmd->se_tfo->get_cmd_state(cmd), |
1647 | cmd->t_state, sense_reason); | 1651 | cmd->t_state, sense_reason); |
@@ -1849,9 +1853,8 @@ void target_execute_cmd(struct se_cmd *cmd) | |||
1849 | */ | 1853 | */ |
1850 | spin_lock_irq(&cmd->t_state_lock); | 1854 | spin_lock_irq(&cmd->t_state_lock); |
1851 | if (cmd->transport_state & CMD_T_STOP) { | 1855 | if (cmd->transport_state & CMD_T_STOP) { |
1852 | pr_debug("%s:%d CMD_T_STOP for ITT: 0x%08x\n", | 1856 | pr_debug("%s:%d CMD_T_STOP for ITT: 0x%08llx\n", |
1853 | __func__, __LINE__, | 1857 | __func__, __LINE__, cmd->tag); |
1854 | cmd->se_tfo->get_task_tag(cmd)); | ||
1855 | 1858 | ||
1856 | spin_unlock_irq(&cmd->t_state_lock); | 1859 | spin_unlock_irq(&cmd->t_state_lock); |
1857 | complete_all(&cmd->t_transport_stop_comp); | 1860 | complete_all(&cmd->t_transport_stop_comp); |
@@ -2658,10 +2661,8 @@ bool transport_wait_for_tasks(struct se_cmd *cmd) | |||
2658 | 2661 | ||
2659 | cmd->transport_state |= CMD_T_STOP; | 2662 | cmd->transport_state |= CMD_T_STOP; |
2660 | 2663 | ||
2661 | pr_debug("wait_for_tasks: Stopping %p ITT: 0x%08x" | 2664 | pr_debug("wait_for_tasks: Stopping %p ITT: 0x%08llx i_state: %d, t_state: %d, CMD_T_STOP\n", |
2662 | " i_state: %d, t_state: %d, CMD_T_STOP\n", | 2665 | cmd, cmd->tag, cmd->se_tfo->get_cmd_state(cmd), cmd->t_state); |
2663 | cmd, cmd->se_tfo->get_task_tag(cmd), | ||
2664 | cmd->se_tfo->get_cmd_state(cmd), cmd->t_state); | ||
2665 | 2666 | ||
2666 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | 2667 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); |
2667 | 2668 | ||
@@ -2670,9 +2671,8 @@ bool transport_wait_for_tasks(struct se_cmd *cmd) | |||
2670 | spin_lock_irqsave(&cmd->t_state_lock, flags); | 2671 | spin_lock_irqsave(&cmd->t_state_lock, flags); |
2671 | cmd->transport_state &= ~(CMD_T_ACTIVE | CMD_T_STOP); | 2672 | cmd->transport_state &= ~(CMD_T_ACTIVE | CMD_T_STOP); |
2672 | 2673 | ||
2673 | pr_debug("wait_for_tasks: Stopped wait_for_completion(" | 2674 | pr_debug("wait_for_tasks: Stopped wait_for_completion(&cmd->t_transport_stop_comp) for ITT: 0x%08llx\n", |
2674 | "&cmd->t_transport_stop_comp) for ITT: 0x%08x\n", | 2675 | cmd->tag); |
2675 | cmd->se_tfo->get_task_tag(cmd)); | ||
2676 | 2676 | ||
2677 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | 2677 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); |
2678 | 2678 | ||
@@ -2974,8 +2974,8 @@ int transport_check_aborted_status(struct se_cmd *cmd, int send_status) | |||
2974 | if (!send_status || !(cmd->se_cmd_flags & SCF_SEND_DELAYED_TAS)) | 2974 | if (!send_status || !(cmd->se_cmd_flags & SCF_SEND_DELAYED_TAS)) |
2975 | return 1; | 2975 | return 1; |
2976 | 2976 | ||
2977 | pr_debug("Sending delayed SAM_STAT_TASK_ABORTED status for CDB: 0x%02x ITT: 0x%08x\n", | 2977 | pr_debug("Sending delayed SAM_STAT_TASK_ABORTED status for CDB: 0x%02x ITT: 0x%08llx\n", |
2978 | cmd->t_task_cdb[0], cmd->se_tfo->get_task_tag(cmd)); | 2978 | cmd->t_task_cdb[0], cmd->tag); |
2979 | 2979 | ||
2980 | cmd->se_cmd_flags &= ~SCF_SEND_DELAYED_TAS; | 2980 | cmd->se_cmd_flags &= ~SCF_SEND_DELAYED_TAS; |
2981 | cmd->scsi_status = SAM_STAT_TASK_ABORTED; | 2981 | cmd->scsi_status = SAM_STAT_TASK_ABORTED; |
@@ -3014,9 +3014,8 @@ void transport_send_task_abort(struct se_cmd *cmd) | |||
3014 | 3014 | ||
3015 | transport_lun_remove_cmd(cmd); | 3015 | transport_lun_remove_cmd(cmd); |
3016 | 3016 | ||
3017 | pr_debug("Setting SAM_STAT_TASK_ABORTED status for CDB: 0x%02x," | 3017 | pr_debug("Setting SAM_STAT_TASK_ABORTED status for CDB: 0x%02x, ITT: 0x%08llx\n", |
3018 | " ITT: 0x%08x\n", cmd->t_task_cdb[0], | 3018 | cmd->t_task_cdb[0], cmd->tag); |
3019 | cmd->se_tfo->get_task_tag(cmd)); | ||
3020 | 3019 | ||
3021 | trace_target_cmd_complete(cmd); | 3020 | trace_target_cmd_complete(cmd); |
3022 | cmd->se_tfo->queue_status(cmd); | 3021 | cmd->se_tfo->queue_status(cmd); |
diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 8fd680ac941b..5545619d3045 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c | |||
@@ -359,11 +359,6 @@ static char *xcopy_pt_get_fabric_name(void) | |||
359 | return "xcopy-pt"; | 359 | return "xcopy-pt"; |
360 | } | 360 | } |
361 | 361 | ||
362 | static u32 xcopy_pt_get_tag(struct se_cmd *se_cmd) | ||
363 | { | ||
364 | return 0; | ||
365 | } | ||
366 | |||
367 | static int xcopy_pt_get_cmd_state(struct se_cmd *se_cmd) | 362 | static int xcopy_pt_get_cmd_state(struct se_cmd *se_cmd) |
368 | { | 363 | { |
369 | return 0; | 364 | return 0; |
@@ -424,7 +419,6 @@ static int xcopy_pt_queue_status(struct se_cmd *se_cmd) | |||
424 | 419 | ||
425 | static const struct target_core_fabric_ops xcopy_pt_tfo = { | 420 | static const struct target_core_fabric_ops xcopy_pt_tfo = { |
426 | .get_fabric_name = xcopy_pt_get_fabric_name, | 421 | .get_fabric_name = xcopy_pt_get_fabric_name, |
427 | .get_task_tag = xcopy_pt_get_tag, | ||
428 | .get_cmd_state = xcopy_pt_get_cmd_state, | 422 | .get_cmd_state = xcopy_pt_get_cmd_state, |
429 | .release_cmd = xcopy_pt_release_cmd, | 423 | .release_cmd = xcopy_pt_release_cmd, |
430 | .check_stop_free = xcopy_pt_check_stop_free, | 424 | .check_stop_free = xcopy_pt_check_stop_free, |
@@ -575,6 +569,7 @@ static int target_xcopy_setup_pt_cmd( | |||
575 | xpt_cmd->xcopy_op = xop; | 569 | xpt_cmd->xcopy_op = xop; |
576 | target_xcopy_setup_pt_port(xpt_cmd, xop, remote_port); | 570 | target_xcopy_setup_pt_port(xpt_cmd, xop, remote_port); |
577 | 571 | ||
572 | cmd->tag = 0; | ||
578 | sense_rc = target_setup_cmd_from_cdb(cmd, cdb); | 573 | sense_rc = target_setup_cmd_from_cdb(cmd, cdb); |
579 | if (sense_rc) { | 574 | if (sense_rc) { |
580 | ret = -EINVAL; | 575 | ret = -EINVAL; |
diff --git a/drivers/target/tcm_fc/tcm_fc.h b/drivers/target/tcm_fc/tcm_fc.h index 4ceaeb9a4b93..39909dadef3e 100644 --- a/drivers/target/tcm_fc/tcm_fc.h +++ b/drivers/target/tcm_fc/tcm_fc.h | |||
@@ -157,7 +157,6 @@ int ft_queue_status(struct se_cmd *); | |||
157 | int ft_queue_data_in(struct se_cmd *); | 157 | int ft_queue_data_in(struct se_cmd *); |
158 | int ft_write_pending(struct se_cmd *); | 158 | int ft_write_pending(struct se_cmd *); |
159 | int ft_write_pending_status(struct se_cmd *); | 159 | int ft_write_pending_status(struct se_cmd *); |
160 | u32 ft_get_task_tag(struct se_cmd *); | ||
161 | int ft_get_cmd_state(struct se_cmd *); | 160 | int ft_get_cmd_state(struct se_cmd *); |
162 | void ft_queue_tm_resp(struct se_cmd *); | 161 | void ft_queue_tm_resp(struct se_cmd *); |
163 | void ft_aborted_task(struct se_cmd *); | 162 | void ft_aborted_task(struct se_cmd *); |
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c index edcafa4490c0..a8fe6ed5262f 100644 --- a/drivers/target/tcm_fc/tfc_cmd.c +++ b/drivers/target/tcm_fc/tfc_cmd.c | |||
@@ -247,15 +247,6 @@ int ft_write_pending(struct se_cmd *se_cmd) | |||
247 | return 0; | 247 | return 0; |
248 | } | 248 | } |
249 | 249 | ||
250 | u32 ft_get_task_tag(struct se_cmd *se_cmd) | ||
251 | { | ||
252 | struct ft_cmd *cmd = container_of(se_cmd, struct ft_cmd, se_cmd); | ||
253 | |||
254 | if (cmd->aborted) | ||
255 | return ~0; | ||
256 | return fc_seq_exch(cmd->seq)->rxid; | ||
257 | } | ||
258 | |||
259 | int ft_get_cmd_state(struct se_cmd *se_cmd) | 250 | int ft_get_cmd_state(struct se_cmd *se_cmd) |
260 | { | 251 | { |
261 | return 0; | 252 | return 0; |
@@ -568,6 +559,7 @@ static void ft_send_work(struct work_struct *work) | |||
568 | } | 559 | } |
569 | 560 | ||
570 | fc_seq_exch(cmd->seq)->lp->tt.seq_set_resp(cmd->seq, ft_recv_seq, cmd); | 561 | fc_seq_exch(cmd->seq)->lp->tt.seq_set_resp(cmd->seq, ft_recv_seq, cmd); |
562 | cmd->se_cmd.tag = fc_seq_exch(cmd->seq)->rxid; | ||
571 | /* | 563 | /* |
572 | * Use a single se_cmd->cmd_kref as we expect to release se_cmd | 564 | * Use a single se_cmd->cmd_kref as we expect to release se_cmd |
573 | * directly from ft_check_stop_free callback in response path. | 565 | * directly from ft_check_stop_free callback in response path. |
diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c index 6ad7404b7dd1..f0821967f0a1 100644 --- a/drivers/target/tcm_fc/tfc_conf.c +++ b/drivers/target/tcm_fc/tfc_conf.c | |||
@@ -468,7 +468,6 @@ static const struct target_core_fabric_ops ft_fabric_ops = { | |||
468 | .write_pending = ft_write_pending, | 468 | .write_pending = ft_write_pending, |
469 | .write_pending_status = ft_write_pending_status, | 469 | .write_pending_status = ft_write_pending_status, |
470 | .set_default_node_attributes = ft_set_default_node_attr, | 470 | .set_default_node_attributes = ft_set_default_node_attr, |
471 | .get_task_tag = ft_get_task_tag, | ||
472 | .get_cmd_state = ft_get_cmd_state, | 471 | .get_cmd_state = ft_get_cmd_state, |
473 | .queue_data_in = ft_queue_data_in, | 472 | .queue_data_in = ft_queue_data_in, |
474 | .queue_status = ft_queue_status, | 473 | .queue_status = ft_queue_status, |
diff --git a/drivers/usb/gadget/legacy/tcm_usb_gadget.c b/drivers/usb/gadget/legacy/tcm_usb_gadget.c index 77cdbb56e1d5..a000d89dc78a 100644 --- a/drivers/usb/gadget/legacy/tcm_usb_gadget.c +++ b/drivers/usb/gadget/legacy/tcm_usb_gadget.c | |||
@@ -1112,6 +1112,7 @@ static int usbg_submit_command(struct f_uas *fu, | |||
1112 | memcpy(cmd->cmd_buf, cmd_iu->cdb, cmd_len); | 1112 | memcpy(cmd->cmd_buf, cmd_iu->cdb, cmd_len); |
1113 | 1113 | ||
1114 | cmd->tag = be16_to_cpup(&cmd_iu->tag); | 1114 | cmd->tag = be16_to_cpup(&cmd_iu->tag); |
1115 | cmd->se_cmd.tag = cmd->tag; | ||
1115 | if (fu->flags & USBG_USE_STREAMS) { | 1116 | if (fu->flags & USBG_USE_STREAMS) { |
1116 | if (cmd->tag > UASP_SS_EP_COMP_NUM_STREAMS) | 1117 | if (cmd->tag > UASP_SS_EP_COMP_NUM_STREAMS) |
1117 | goto err; | 1118 | goto err; |
@@ -1245,6 +1246,7 @@ static int bot_submit_command(struct f_uas *fu, | |||
1245 | cmd->unpacked_lun = cbw->Lun; | 1246 | cmd->unpacked_lun = cbw->Lun; |
1246 | cmd->is_read = cbw->Flags & US_BULK_FLAG_IN ? 1 : 0; | 1247 | cmd->is_read = cbw->Flags & US_BULK_FLAG_IN ? 1 : 0; |
1247 | cmd->data_len = le32_to_cpu(cbw->DataTransferLength); | 1248 | cmd->data_len = le32_to_cpu(cbw->DataTransferLength); |
1249 | cmd->se_cmd.tag = le32_to_cpu(cmd->bot_tag); | ||
1248 | 1250 | ||
1249 | INIT_WORK(&cmd->work, bot_cmd_work); | 1251 | INIT_WORK(&cmd->work, bot_cmd_work); |
1250 | ret = queue_work(tpg->workqueue, &cmd->work); | 1252 | ret = queue_work(tpg->workqueue, &cmd->work); |
@@ -1340,18 +1342,6 @@ static void usbg_set_default_node_attrs(struct se_node_acl *nacl) | |||
1340 | return; | 1342 | return; |
1341 | } | 1343 | } |
1342 | 1344 | ||
1343 | static u32 usbg_get_task_tag(struct se_cmd *se_cmd) | ||
1344 | { | ||
1345 | struct usbg_cmd *cmd = container_of(se_cmd, struct usbg_cmd, | ||
1346 | se_cmd); | ||
1347 | struct f_uas *fu = cmd->fu; | ||
1348 | |||
1349 | if (fu->flags & USBG_IS_BOT) | ||
1350 | return le32_to_cpu(cmd->bot_tag); | ||
1351 | else | ||
1352 | return cmd->tag; | ||
1353 | } | ||
1354 | |||
1355 | static int usbg_get_cmd_state(struct se_cmd *se_cmd) | 1345 | static int usbg_get_cmd_state(struct se_cmd *se_cmd) |
1356 | { | 1346 | { |
1357 | return 0; | 1347 | return 0; |
@@ -1739,7 +1729,6 @@ static const struct target_core_fabric_ops usbg_ops = { | |||
1739 | .write_pending = usbg_send_write_request, | 1729 | .write_pending = usbg_send_write_request, |
1740 | .write_pending_status = usbg_write_pending_status, | 1730 | .write_pending_status = usbg_write_pending_status, |
1741 | .set_default_node_attributes = usbg_set_default_node_attrs, | 1731 | .set_default_node_attributes = usbg_set_default_node_attrs, |
1742 | .get_task_tag = usbg_get_task_tag, | ||
1743 | .get_cmd_state = usbg_get_cmd_state, | 1732 | .get_cmd_state = usbg_get_cmd_state, |
1744 | .queue_data_in = usbg_send_read_response, | 1733 | .queue_data_in = usbg_send_read_response, |
1745 | .queue_status = usbg_send_status_response, | 1734 | .queue_status = usbg_send_status_response, |
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index db9f4b474214..4a003948b07f 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c | |||
@@ -369,11 +369,6 @@ static void vhost_scsi_set_default_node_attrs(struct se_node_acl *nacl) | |||
369 | return; | 369 | return; |
370 | } | 370 | } |
371 | 371 | ||
372 | static u32 vhost_scsi_get_task_tag(struct se_cmd *se_cmd) | ||
373 | { | ||
374 | return 0; | ||
375 | } | ||
376 | |||
377 | static int vhost_scsi_get_cmd_state(struct se_cmd *se_cmd) | 372 | static int vhost_scsi_get_cmd_state(struct se_cmd *se_cmd) |
378 | { | 373 | { |
379 | return 0; | 374 | return 0; |
@@ -818,6 +813,7 @@ static void vhost_scsi_submission_work(struct work_struct *work) | |||
818 | } | 813 | } |
819 | tv_nexus = cmd->tvc_nexus; | 814 | tv_nexus = cmd->tvc_nexus; |
820 | 815 | ||
816 | se_cmd->tag = 0; | ||
821 | rc = target_submit_cmd_map_sgls(se_cmd, tv_nexus->tvn_se_sess, | 817 | rc = target_submit_cmd_map_sgls(se_cmd, tv_nexus->tvn_se_sess, |
822 | cmd->tvc_cdb, &cmd->tvc_sense_buf[0], | 818 | cmd->tvc_cdb, &cmd->tvc_sense_buf[0], |
823 | cmd->tvc_lun, cmd->tvc_exp_data_len, | 819 | cmd->tvc_lun, cmd->tvc_exp_data_len, |
@@ -2148,7 +2144,6 @@ static struct target_core_fabric_ops vhost_scsi_ops = { | |||
2148 | .write_pending = vhost_scsi_write_pending, | 2144 | .write_pending = vhost_scsi_write_pending, |
2149 | .write_pending_status = vhost_scsi_write_pending_status, | 2145 | .write_pending_status = vhost_scsi_write_pending_status, |
2150 | .set_default_node_attributes = vhost_scsi_set_default_node_attrs, | 2146 | .set_default_node_attributes = vhost_scsi_set_default_node_attrs, |
2151 | .get_task_tag = vhost_scsi_get_task_tag, | ||
2152 | .get_cmd_state = vhost_scsi_get_cmd_state, | 2147 | .get_cmd_state = vhost_scsi_get_cmd_state, |
2153 | .queue_data_in = vhost_scsi_queue_data_in, | 2148 | .queue_data_in = vhost_scsi_queue_data_in, |
2154 | .queue_status = vhost_scsi_queue_status, | 2149 | .queue_status = vhost_scsi_queue_status, |
diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index 10c71a5616fa..ea929baf7ad0 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c | |||
@@ -400,6 +400,7 @@ static void scsiback_cmd_exec(struct vscsibk_pend *pending_req) | |||
400 | memset(se_cmd, 0, sizeof(*se_cmd)); | 400 | memset(se_cmd, 0, sizeof(*se_cmd)); |
401 | 401 | ||
402 | scsiback_get(pending_req->info); | 402 | scsiback_get(pending_req->info); |
403 | se_cmd->tag = pending_req->rqid; | ||
403 | rc = target_submit_cmd_map_sgls(se_cmd, sess, pending_req->cmnd, | 404 | rc = target_submit_cmd_map_sgls(se_cmd, sess, pending_req->cmnd, |
404 | pending_req->sense_buffer, pending_req->v2p->lun, | 405 | pending_req->sense_buffer, pending_req->v2p->lun, |
405 | pending_req->data_len, 0, | 406 | pending_req->data_len, 0, |
@@ -1394,14 +1395,6 @@ static void scsiback_set_default_node_attrs(struct se_node_acl *nacl) | |||
1394 | { | 1395 | { |
1395 | } | 1396 | } |
1396 | 1397 | ||
1397 | static u32 scsiback_get_task_tag(struct se_cmd *se_cmd) | ||
1398 | { | ||
1399 | struct vscsibk_pend *pending_req = container_of(se_cmd, | ||
1400 | struct vscsibk_pend, se_cmd); | ||
1401 | |||
1402 | return pending_req->rqid; | ||
1403 | } | ||
1404 | |||
1405 | static int scsiback_get_cmd_state(struct se_cmd *se_cmd) | 1398 | static int scsiback_get_cmd_state(struct se_cmd *se_cmd) |
1406 | { | 1399 | { |
1407 | return 0; | 1400 | return 0; |
@@ -1833,7 +1826,6 @@ static const struct target_core_fabric_ops scsiback_ops = { | |||
1833 | .write_pending = scsiback_write_pending, | 1826 | .write_pending = scsiback_write_pending, |
1834 | .write_pending_status = scsiback_write_pending_status, | 1827 | .write_pending_status = scsiback_write_pending_status, |
1835 | .set_default_node_attributes = scsiback_set_default_node_attrs, | 1828 | .set_default_node_attributes = scsiback_set_default_node_attrs, |
1836 | .get_task_tag = scsiback_get_task_tag, | ||
1837 | .get_cmd_state = scsiback_get_cmd_state, | 1829 | .get_cmd_state = scsiback_get_cmd_state, |
1838 | .queue_data_in = scsiback_queue_data_in, | 1830 | .queue_data_in = scsiback_queue_data_in, |
1839 | .queue_status = scsiback_queue_status, | 1831 | .queue_status = scsiback_queue_status, |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index c462fb0a47f4..042a73464966 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -420,7 +420,7 @@ struct se_tmr_req { | |||
420 | u8 response; | 420 | u8 response; |
421 | int call_transport; | 421 | int call_transport; |
422 | /* Reference to ITT that Task Mgmt should be performed */ | 422 | /* Reference to ITT that Task Mgmt should be performed */ |
423 | u32 ref_task_tag; | 423 | u64 ref_task_tag; |
424 | void *fabric_tmr_ptr; | 424 | void *fabric_tmr_ptr; |
425 | struct se_cmd *task_cmd; | 425 | struct se_cmd *task_cmd; |
426 | struct se_device *tmr_dev; | 426 | struct se_device *tmr_dev; |
@@ -473,6 +473,7 @@ struct se_cmd { | |||
473 | u8 scsi_asc; | 473 | u8 scsi_asc; |
474 | u8 scsi_ascq; | 474 | u8 scsi_ascq; |
475 | u16 scsi_sense_length; | 475 | u16 scsi_sense_length; |
476 | u64 tag; /* SAM command identifier aka task tag */ | ||
476 | /* Delay for ALUA Active/NonOptimized state access in milliseconds */ | 477 | /* Delay for ALUA Active/NonOptimized state access in milliseconds */ |
477 | int alua_nonop_delay; | 478 | int alua_nonop_delay; |
478 | /* See include/linux/dma-mapping.h */ | 479 | /* See include/linux/dma-mapping.h */ |
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index a420f434c6c5..f64d493f888b 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h | |||
@@ -53,7 +53,6 @@ struct target_core_fabric_ops { | |||
53 | int (*write_pending)(struct se_cmd *); | 53 | int (*write_pending)(struct se_cmd *); |
54 | int (*write_pending_status)(struct se_cmd *); | 54 | int (*write_pending_status)(struct se_cmd *); |
55 | void (*set_default_node_attributes)(struct se_node_acl *); | 55 | void (*set_default_node_attributes)(struct se_node_acl *); |
56 | u32 (*get_task_tag)(struct se_cmd *); | ||
57 | int (*get_cmd_state)(struct se_cmd *); | 56 | int (*get_cmd_state)(struct se_cmd *); |
58 | int (*queue_data_in)(struct se_cmd *); | 57 | int (*queue_data_in)(struct se_cmd *); |
59 | int (*queue_status)(struct se_cmd *); | 58 | int (*queue_status)(struct se_cmd *); |