diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-06-14 19:07:47 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-06-25 01:35:51 -0400 |
commit | 778de368964c5b7e8100cde9f549992d521e9c89 (patch) | |
tree | 5925e16a0fa2e29925f3ee44a0f00fc11d2afb4d /drivers/infiniband/ulp | |
parent | 08234e3adc7a299c9213bcfa0b5e97c359129670 (diff) |
iscsi/isert-target: Refactor ISCSI_OP_NOOP RX handling
This patch refactors ISCSI_OP_NOOP handling within iscsi-target in
order to handle iscsi_nopout payloads in a transport specific manner.
This includes splitting existing iscsit_handle_nop_out() into
iscsit_setup_nop_out() and iscsit_process_nop_out() calls, and
makes iscsit_handle_nop_out() be only used internally by traditional
iscsi socket calls.
Next update iser-target code to use new callers and add FIXME for
the handling iscsi_nopout payloads. Also fix reject response handling
in iscsit_setup_nop_out() to use proper iscsit_add_reject_from_cmd().
v2: Fix uninitialized iscsit_handle_nop_out() payload_length usage (Fengguang)
v3: Remove left-over dead code in iscsit_setup_nop_out() (DanC)
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 41712f096515..c48c9481025c 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -1001,6 +1001,25 @@ isert_handle_iscsi_dataout(struct isert_conn *isert_conn, | |||
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | static int | 1003 | static int |
1004 | isert_handle_nop_out(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd, | ||
1005 | struct iser_rx_desc *rx_desc, unsigned char *buf) | ||
1006 | { | ||
1007 | struct iscsi_cmd *cmd = &isert_cmd->iscsi_cmd; | ||
1008 | struct iscsi_conn *conn = isert_conn->conn; | ||
1009 | struct iscsi_nopout *hdr = (struct iscsi_nopout *)buf; | ||
1010 | int rc; | ||
1011 | |||
1012 | rc = iscsit_setup_nop_out(conn, cmd, hdr); | ||
1013 | if (rc < 0) | ||
1014 | return rc; | ||
1015 | /* | ||
1016 | * FIXME: Add support for NOPOUT payload using unsolicited RDMA payload | ||
1017 | */ | ||
1018 | |||
1019 | return iscsit_process_nop_out(conn, cmd, hdr); | ||
1020 | } | ||
1021 | |||
1022 | static int | ||
1004 | isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc, | 1023 | isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc, |
1005 | uint32_t read_stag, uint64_t read_va, | 1024 | uint32_t read_stag, uint64_t read_va, |
1006 | uint32_t write_stag, uint64_t write_va) | 1025 | uint32_t write_stag, uint64_t write_va) |
@@ -1032,7 +1051,9 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc, | |||
1032 | if (!cmd) | 1051 | if (!cmd) |
1033 | break; | 1052 | break; |
1034 | 1053 | ||
1035 | ret = iscsit_handle_nop_out(conn, cmd, (unsigned char *)hdr); | 1054 | isert_cmd = container_of(cmd, struct isert_cmd, iscsi_cmd); |
1055 | ret = isert_handle_nop_out(isert_conn, isert_cmd, | ||
1056 | rx_desc, (unsigned char *)hdr); | ||
1036 | break; | 1057 | break; |
1037 | case ISCSI_OP_SCSI_DATA_OUT: | 1058 | case ISCSI_OP_SCSI_DATA_OUT: |
1038 | ret = isert_handle_iscsi_dataout(isert_conn, rx_desc, | 1059 | ret = isert_handle_iscsi_dataout(isert_conn, rx_desc, |