diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-06-26 05:31:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-04 04:50:32 -0400 |
commit | fff98879381243f59b6e9f630d55312aa34a89c9 (patch) | |
tree | d78231240ab41b15a4cd6778efca8697f246967b | |
parent | 78077c226f0ab20fcd0a85a8f0de42b96973382b (diff) |
iser-target: Fix isert_put_reject payload buffer post
commit 3df8f68aaf7ebe3d136a22262b41b350b0a1858b upstream.
This patch adds the missing isert_put_reject() logic to post
a outgoing payload buffer to hold the 48 bytes of original PDU
header request payload for the rejected cmd.
It also fixes ISTATE_SEND_REJECT handling in isert_response_completion()
-> isert_do_control_comp() code, and drops incorrect iscsi_cmd_t->reject_comp
usage.
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 41712f096515..6559febd255e 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -1222,6 +1222,9 @@ isert_put_cmd(struct isert_cmd *isert_cmd) | |||
1222 | * associated cmd->se_cmd needs to be released. | 1222 | * associated cmd->se_cmd needs to be released. |
1223 | */ | 1223 | */ |
1224 | if (cmd->se_cmd.se_tfo != NULL) { | 1224 | if (cmd->se_cmd.se_tfo != NULL) { |
1225 | pr_debug("Calling transport_generic_free_cmd from" | ||
1226 | " isert_put_cmd for 0x%02x\n", | ||
1227 | cmd->iscsi_opcode); | ||
1225 | transport_generic_free_cmd(&cmd->se_cmd, 0); | 1228 | transport_generic_free_cmd(&cmd->se_cmd, 0); |
1226 | break; | 1229 | break; |
1227 | } | 1230 | } |
@@ -1318,8 +1321,8 @@ isert_do_control_comp(struct work_struct *work) | |||
1318 | atomic_dec(&isert_conn->post_send_buf_count); | 1321 | atomic_dec(&isert_conn->post_send_buf_count); |
1319 | 1322 | ||
1320 | cmd->i_state = ISTATE_SENT_STATUS; | 1323 | cmd->i_state = ISTATE_SENT_STATUS; |
1321 | complete(&cmd->reject_comp); | ||
1322 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev); | 1324 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev); |
1325 | break; | ||
1323 | case ISTATE_SEND_LOGOUTRSP: | 1326 | case ISTATE_SEND_LOGOUTRSP: |
1324 | pr_debug("Calling iscsit_logout_post_handler >>>>>>>>>>>>>>\n"); | 1327 | pr_debug("Calling iscsit_logout_post_handler >>>>>>>>>>>>>>\n"); |
1325 | /* | 1328 | /* |
@@ -1345,7 +1348,8 @@ isert_response_completion(struct iser_tx_desc *tx_desc, | |||
1345 | struct iscsi_cmd *cmd = &isert_cmd->iscsi_cmd; | 1348 | struct iscsi_cmd *cmd = &isert_cmd->iscsi_cmd; |
1346 | 1349 | ||
1347 | if (cmd->i_state == ISTATE_SEND_TASKMGTRSP || | 1350 | if (cmd->i_state == ISTATE_SEND_TASKMGTRSP || |
1348 | cmd->i_state == ISTATE_SEND_LOGOUTRSP) { | 1351 | cmd->i_state == ISTATE_SEND_LOGOUTRSP || |
1352 | cmd->i_state == ISTATE_SEND_REJECT) { | ||
1349 | isert_unmap_tx_desc(tx_desc, ib_dev); | 1353 | isert_unmap_tx_desc(tx_desc, ib_dev); |
1350 | 1354 | ||
1351 | INIT_WORK(&isert_cmd->comp_work, isert_do_control_comp); | 1355 | INIT_WORK(&isert_cmd->comp_work, isert_do_control_comp); |
@@ -1637,11 +1641,25 @@ isert_put_reject(struct iscsi_cmd *cmd, struct iscsi_conn *conn) | |||
1637 | struct isert_cmd, iscsi_cmd); | 1641 | struct isert_cmd, iscsi_cmd); |
1638 | struct isert_conn *isert_conn = (struct isert_conn *)conn->context; | 1642 | struct isert_conn *isert_conn = (struct isert_conn *)conn->context; |
1639 | struct ib_send_wr *send_wr = &isert_cmd->tx_desc.send_wr; | 1643 | struct ib_send_wr *send_wr = &isert_cmd->tx_desc.send_wr; |
1644 | struct ib_device *ib_dev = isert_conn->conn_cm_id->device; | ||
1645 | struct ib_sge *tx_dsg = &isert_cmd->tx_desc.tx_sg[1]; | ||
1646 | struct iscsi_reject *hdr = | ||
1647 | (struct iscsi_reject *)&isert_cmd->tx_desc.iscsi_header; | ||
1640 | 1648 | ||
1641 | isert_create_send_desc(isert_conn, isert_cmd, &isert_cmd->tx_desc); | 1649 | isert_create_send_desc(isert_conn, isert_cmd, &isert_cmd->tx_desc); |
1642 | iscsit_build_reject(cmd, conn, (struct iscsi_reject *) | 1650 | iscsit_build_reject(cmd, conn, hdr); |
1643 | &isert_cmd->tx_desc.iscsi_header); | ||
1644 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); | 1651 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); |
1652 | |||
1653 | hton24(hdr->dlength, ISCSI_HDR_LEN); | ||
1654 | isert_cmd->sense_buf_dma = ib_dma_map_single(ib_dev, | ||
1655 | (void *)cmd->buf_ptr, ISCSI_HDR_LEN, | ||
1656 | DMA_TO_DEVICE); | ||
1657 | isert_cmd->sense_buf_len = ISCSI_HDR_LEN; | ||
1658 | tx_dsg->addr = isert_cmd->sense_buf_dma; | ||
1659 | tx_dsg->length = ISCSI_HDR_LEN; | ||
1660 | tx_dsg->lkey = isert_conn->conn_mr->lkey; | ||
1661 | isert_cmd->tx_desc.num_sge = 2; | ||
1662 | |||
1645 | isert_init_send_wr(isert_cmd, send_wr); | 1663 | isert_init_send_wr(isert_cmd, send_wr); |
1646 | 1664 | ||
1647 | pr_debug("Posting Reject IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 1665 | pr_debug("Posting Reject IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); |