diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-03-07 01:18:24 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-04-25 04:05:27 -0400 |
commit | 3e1c81a95f0d776cea68a36cfc78a0ce8f6d3a77 (patch) | |
tree | 99ceb306765cc6231c32b65c0a9766ab781caf76 /drivers/target/iscsi/iscsi_target_erl1.c | |
parent | cdb726651c357c19c02b17ee3c99a224b03022b6 (diff) |
iscsi-target: Refactor RX PDU logic + export request PDU handling
This patch refactors existing traditional iscsi RX side PDU handling
to use iscsit_transport, and exports the necessary logic for external
transport modules.
This includes:
- Refactor iscsit_handle_scsi_cmd() into PDU setup / processing
- Add updated iscsit_handle_scsi_cmd() for tradtional iscsi code
- Add iscsit_set_unsoliticed_dataout() wrapper
- Refactor iscsit_handle_data_out() into PDU check / processing
- Add updated iscsit_handle_data_out() for tradtional iscsi code
- Add iscsit_handle_nop_out() + iscsit_handle_task_mgt_cmd() to
accept pre-allocated struct iscsi_cmd
- Add iscsit_build_r2ts_for_cmd() caller for iscsi_target_transport
to handle ISTATE_SEND_R2T for TX immediate queue
- Refactor main traditional iscsi iscsi_target_rx_thread() PDU switch
into iscsi_target_rx_opcode() using iscsit_allocate_cmd()
- Turn iscsi_target_rx_thread() process context into NOP for
ib_isert side work-queue.
v5 changes:
- Make iscsit_handle_scsi_cmd() static (Fengguang)
- Fix iscsit_handle_scsi_cmd() exception se_cmd leak (nab)
v3 changes:
- Add extra target_put_sess_cmd call in iscsit_add_reject_from_cmd
after completion
v2 changes:
- Disable iscsit_ack_from_expstatsn() usage for RDMAExtentions=Yes
- Disable iscsit_allocate_datain_req() usage for RDMAExtentions=Yes
- Add target_get_sess_cmd() reference counting to
iscsit_setup_scsi_cmd()
- Add TFO->lio_check_stop_free() fabric API caller
- Add export of iscsit_stop_dataout_timer() symbol
- Add iscsit_build_r2ts_for_cmd() for iscsit_transport->iscsit_get_dataout()
- Convert existing usage of iscsit_build_r2ts_for_cmd() to
->iscsit_get_dataout()
- Drop RDMAExtentions=Yes specific check in iscsit_build_r2ts_for_cmd()
- Fix RDMAExtentions -> RDMAExtensions typo (andy)
- Pass correct dump_payload value into iscsit_get_immediate_data()
for iscsit_handle_scsi_cmd()
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_erl1.c')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_erl1.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl1.c index 0b52a2371305..7816af6cdd12 100644 --- a/drivers/target/iscsi/iscsi_target_erl1.c +++ b/drivers/target/iscsi/iscsi_target_erl1.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <scsi/iscsi_proto.h> | 22 | #include <scsi/iscsi_proto.h> |
23 | #include <target/target_core_base.h> | 23 | #include <target/target_core_base.h> |
24 | #include <target/target_core_fabric.h> | 24 | #include <target/target_core_fabric.h> |
25 | #include <target/iscsi/iscsi_transport.h> | ||
25 | 26 | ||
26 | #include "iscsi_target_core.h" | 27 | #include "iscsi_target_core.h" |
27 | #include "iscsi_target_seq_pdu_list.h" | 28 | #include "iscsi_target_seq_pdu_list.h" |
@@ -53,6 +54,9 @@ int iscsit_dump_data_payload( | |||
53 | u32 length, padding, offset = 0, size; | 54 | u32 length, padding, offset = 0, size; |
54 | struct kvec iov; | 55 | struct kvec iov; |
55 | 56 | ||
57 | if (conn->sess->sess_ops->RDMAExtensions) | ||
58 | return 0; | ||
59 | |||
56 | length = (buf_len > OFFLOAD_BUF_SIZE) ? OFFLOAD_BUF_SIZE : buf_len; | 60 | length = (buf_len > OFFLOAD_BUF_SIZE) ? OFFLOAD_BUF_SIZE : buf_len; |
57 | 61 | ||
58 | buf = kzalloc(length, GFP_ATOMIC); | 62 | buf = kzalloc(length, GFP_ATOMIC); |
@@ -919,6 +923,7 @@ int iscsit_execute_ooo_cmdsns(struct iscsi_session *sess) | |||
919 | int iscsit_execute_cmd(struct iscsi_cmd *cmd, int ooo) | 923 | int iscsit_execute_cmd(struct iscsi_cmd *cmd, int ooo) |
920 | { | 924 | { |
921 | struct se_cmd *se_cmd = &cmd->se_cmd; | 925 | struct se_cmd *se_cmd = &cmd->se_cmd; |
926 | struct iscsi_conn *conn = cmd->conn; | ||
922 | int lr = 0; | 927 | int lr = 0; |
923 | 928 | ||
924 | spin_lock_bh(&cmd->istate_lock); | 929 | spin_lock_bh(&cmd->istate_lock); |
@@ -981,7 +986,7 @@ int iscsit_execute_cmd(struct iscsi_cmd *cmd, int ooo) | |||
981 | return 0; | 986 | return 0; |
982 | 987 | ||
983 | iscsit_set_dataout_sequence_values(cmd); | 988 | iscsit_set_dataout_sequence_values(cmd); |
984 | iscsit_build_r2ts_for_cmd(cmd, cmd->conn, false); | 989 | conn->conn_transport->iscsit_get_dataout(conn, cmd, false); |
985 | } | 990 | } |
986 | return 0; | 991 | return 0; |
987 | } | 992 | } |
@@ -999,10 +1004,7 @@ int iscsit_execute_cmd(struct iscsi_cmd *cmd, int ooo) | |||
999 | if (transport_check_aborted_status(se_cmd, 1) != 0) | 1004 | if (transport_check_aborted_status(se_cmd, 1) != 0) |
1000 | return 0; | 1005 | return 0; |
1001 | 1006 | ||
1002 | iscsit_set_dataout_sequence_values(cmd); | 1007 | iscsit_set_unsoliticed_dataout(cmd); |
1003 | spin_lock_bh(&cmd->dataout_timeout_lock); | ||
1004 | iscsit_start_dataout_timer(cmd, cmd->conn); | ||
1005 | spin_unlock_bh(&cmd->dataout_timeout_lock); | ||
1006 | } | 1008 | } |
1007 | return transport_handle_cdb_direct(&cmd->se_cmd); | 1009 | return transport_handle_cdb_direct(&cmd->se_cmd); |
1008 | 1010 | ||
@@ -1290,3 +1292,4 @@ void iscsit_stop_dataout_timer(struct iscsi_cmd *cmd) | |||
1290 | cmd->init_task_tag); | 1292 | cmd->init_task_tag); |
1291 | spin_unlock_bh(&cmd->dataout_timeout_lock); | 1293 | spin_unlock_bh(&cmd->dataout_timeout_lock); |
1292 | } | 1294 | } |
1295 | EXPORT_SYMBOL(iscsit_stop_dataout_timer); | ||