Commit c0974f89 authored by Nicholas Bellinger's avatar Nicholas Bellinger

target: Allow target_submit_tmr interrupt context + pass ABORT_TASK tag

This patch allows target_submit_tmr() to pass gfp_t for se_cmd->se_tmr_req
allocation, and also set up se_cmd->se_tmr_req->ref_task_tag for passed
tag with TMR_ABORT_TASK.

Also update tcm_fc(fcoe) parameter usgae and add ref_task_tag FIXME
for TMR_ABORT_TASK usage,

Cc: Andy Grover <agrover@redhat.com>
Cc: Kiran Patil <kiran.patil@intel.com>
Cc: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 9f0d05c2
...@@ -1713,6 +1713,8 @@ static void target_complete_tmr_failure(struct work_struct *work) ...@@ -1713,6 +1713,8 @@ static void target_complete_tmr_failure(struct work_struct *work)
* @unpacked_lun: unpacked LUN to reference for struct se_lun * @unpacked_lun: unpacked LUN to reference for struct se_lun
* @fabric_context: fabric context for TMR req * @fabric_context: fabric context for TMR req
* @tm_type: Type of TM request * @tm_type: Type of TM request
* @gfp: gfp type for caller
* @tag: referenced task tag for TMR_ABORT_TASK
* @flags: submit cmd flags * @flags: submit cmd flags
* *
* Callable from all contexts. * Callable from all contexts.
...@@ -1720,7 +1722,8 @@ static void target_complete_tmr_failure(struct work_struct *work) ...@@ -1720,7 +1722,8 @@ static void target_complete_tmr_failure(struct work_struct *work)
int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
unsigned char *sense, u32 unpacked_lun, unsigned char *sense, u32 unpacked_lun,
void *fabric_tmr_ptr, unsigned char tm_type, int flags) void *fabric_tmr_ptr, unsigned char tm_type,
gfp_t gfp, unsigned int tag, int flags)
{ {
struct se_portal_group *se_tpg; struct se_portal_group *se_tpg;
int ret; int ret;
...@@ -1734,10 +1737,13 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, ...@@ -1734,10 +1737,13 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
* FIXME: Currently expect caller to handle se_cmd->se_tmr_req * FIXME: Currently expect caller to handle se_cmd->se_tmr_req
* allocation failure. * allocation failure.
*/ */
ret = core_tmr_alloc_req(se_cmd, fabric_tmr_ptr, tm_type, GFP_KERNEL); ret = core_tmr_alloc_req(se_cmd, fabric_tmr_ptr, tm_type, gfp);
if (ret < 0) if (ret < 0)
return -ENOMEM; return -ENOMEM;
if (tm_type == TMR_ABORT_TASK)
se_cmd->se_tmr_req->ref_task_tag = tag;
/* See target_submit_cmd for commentary */ /* See target_submit_cmd for commentary */
target_get_sess_cmd(se_sess, se_cmd, (flags & TARGET_SCF_ACK_KREF)); target_get_sess_cmd(se_sess, se_cmd, (flags & TARGET_SCF_ACK_KREF));
......
...@@ -385,9 +385,10 @@ static void ft_send_tm(struct ft_cmd *cmd) ...@@ -385,9 +385,10 @@ static void ft_send_tm(struct ft_cmd *cmd)
return; return;
} }
/* FIXME: Add referenced task tag for ABORT_TASK */
rc = target_submit_tmr(&cmd->se_cmd, cmd->sess->se_sess, rc = target_submit_tmr(&cmd->se_cmd, cmd->sess->se_sess,
&cmd->ft_sense_buffer[0], scsilun_to_int(&fcp->fc_lun), &cmd->ft_sense_buffer[0], scsilun_to_int(&fcp->fc_lun),
cmd, tm_func, 0); cmd, tm_func, GFP_KERNEL, 0, 0);
if (rc < 0) if (rc < 0)
ft_send_resp_code_and_free(cmd, FCP_TMF_FAILED); ft_send_resp_code_and_free(cmd, FCP_TMF_FAILED);
} }
......
...@@ -118,7 +118,8 @@ void target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *, ...@@ -118,7 +118,8 @@ void target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *,
unsigned char *, u32, u32, int, int, int); unsigned char *, u32, u32, int, int, int);
int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
unsigned char *sense, u32 unpacked_lun, unsigned char *sense, u32 unpacked_lun,
void *fabric_tmr_ptr, unsigned char tm_type, int flags); void *fabric_tmr_ptr, unsigned char tm_type,
gfp_t, unsigned int, int);
int transport_handle_cdb_direct(struct se_cmd *); int transport_handle_cdb_direct(struct se_cmd *);
int transport_generic_handle_cdb_map(struct se_cmd *); int transport_generic_handle_cdb_map(struct se_cmd *);
int transport_generic_handle_data(struct se_cmd *); int transport_generic_handle_data(struct se_cmd *);
......
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