diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-06-26 05:31:42 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-07-07 00:59:35 -0400 |
commit | 3df8f68aaf7ebe3d136a22262b41b350b0a1858b (patch) | |
tree | dcd3d1a1013a060ff909b85986f93cbee509dbbf | |
parent | 4f45d320ba97ad2f1107a56e8b2af0dd7e764502 (diff) |
iser-target: Fix isert_put_reject payload buffer post
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.
Cc: Or Gerlitz <ogerlitz@mellanox.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.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 c48c9481025c..1b38eff7f340 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -1243,6 +1243,9 @@ isert_put_cmd(struct isert_cmd *isert_cmd) | |||
1243 | * associated cmd->se_cmd needs to be released. | 1243 | * associated cmd->se_cmd needs to be released. |
1244 | */ | 1244 | */ |
1245 | if (cmd->se_cmd.se_tfo != NULL) { | 1245 | if (cmd->se_cmd.se_tfo != NULL) { |
1246 | pr_debug("Calling transport_generic_free_cmd from" | ||
1247 | " isert_put_cmd for 0x%02x\n", | ||
1248 | cmd->iscsi_opcode); | ||
1246 | transport_generic_free_cmd(&cmd->se_cmd, 0); | 1249 | transport_generic_free_cmd(&cmd->se_cmd, 0); |
1247 | break; | 1250 | break; |
1248 | } | 1251 | } |
@@ -1339,8 +1342,8 @@ isert_do_control_comp(struct work_struct *work) | |||
1339 | atomic_dec(&isert_conn->post_send_buf_count); | 1342 | atomic_dec(&isert_conn->post_send_buf_count); |
1340 | 1343 | ||
1341 | cmd->i_state = ISTATE_SENT_STATUS; | 1344 | cmd->i_state = ISTATE_SENT_STATUS; |
1342 | complete(&cmd->reject_comp); | ||
1343 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev); | 1345 | isert_completion_put(&isert_cmd->tx_desc, isert_cmd, ib_dev); |
1346 | break; | ||
1344 | case ISTATE_SEND_LOGOUTRSP: | 1347 | case ISTATE_SEND_LOGOUTRSP: |
1345 | pr_debug("Calling iscsit_logout_post_handler >>>>>>>>>>>>>>\n"); | 1348 | pr_debug("Calling iscsit_logout_post_handler >>>>>>>>>>>>>>\n"); |
1346 | /* | 1349 | /* |
@@ -1366,7 +1369,8 @@ isert_response_completion(struct iser_tx_desc *tx_desc, | |||
1366 | struct iscsi_cmd *cmd = &isert_cmd->iscsi_cmd; | 1369 | struct iscsi_cmd *cmd = &isert_cmd->iscsi_cmd; |
1367 | 1370 | ||
1368 | if (cmd->i_state == ISTATE_SEND_TASKMGTRSP || | 1371 | if (cmd->i_state == ISTATE_SEND_TASKMGTRSP || |
1369 | cmd->i_state == ISTATE_SEND_LOGOUTRSP) { | 1372 | cmd->i_state == ISTATE_SEND_LOGOUTRSP || |
1373 | cmd->i_state == ISTATE_SEND_REJECT) { | ||
1370 | isert_unmap_tx_desc(tx_desc, ib_dev); | 1374 | isert_unmap_tx_desc(tx_desc, ib_dev); |
1371 | 1375 | ||
1372 | INIT_WORK(&isert_cmd->comp_work, isert_do_control_comp); | 1376 | INIT_WORK(&isert_cmd->comp_work, isert_do_control_comp); |
@@ -1658,11 +1662,25 @@ isert_put_reject(struct iscsi_cmd *cmd, struct iscsi_conn *conn) | |||
1658 | struct isert_cmd, iscsi_cmd); | 1662 | struct isert_cmd, iscsi_cmd); |
1659 | struct isert_conn *isert_conn = (struct isert_conn *)conn->context; | 1663 | struct isert_conn *isert_conn = (struct isert_conn *)conn->context; |
1660 | struct ib_send_wr *send_wr = &isert_cmd->tx_desc.send_wr; | 1664 | struct ib_send_wr *send_wr = &isert_cmd->tx_desc.send_wr; |
1665 | struct ib_device *ib_dev = isert_conn->conn_cm_id->device; | ||
1666 | struct ib_sge *tx_dsg = &isert_cmd->tx_desc.tx_sg[1]; | ||
1667 | struct iscsi_reject *hdr = | ||
1668 | (struct iscsi_reject *)&isert_cmd->tx_desc.iscsi_header; | ||
1661 | 1669 | ||
1662 | isert_create_send_desc(isert_conn, isert_cmd, &isert_cmd->tx_desc); | 1670 | isert_create_send_desc(isert_conn, isert_cmd, &isert_cmd->tx_desc); |
1663 | iscsit_build_reject(cmd, conn, (struct iscsi_reject *) | 1671 | iscsit_build_reject(cmd, conn, hdr); |
1664 | &isert_cmd->tx_desc.iscsi_header); | ||
1665 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); | 1672 | isert_init_tx_hdrs(isert_conn, &isert_cmd->tx_desc); |
1673 | |||
1674 | hton24(hdr->dlength, ISCSI_HDR_LEN); | ||
1675 | isert_cmd->sense_buf_dma = ib_dma_map_single(ib_dev, | ||
1676 | (void *)cmd->buf_ptr, ISCSI_HDR_LEN, | ||
1677 | DMA_TO_DEVICE); | ||
1678 | isert_cmd->sense_buf_len = ISCSI_HDR_LEN; | ||
1679 | tx_dsg->addr = isert_cmd->sense_buf_dma; | ||
1680 | tx_dsg->length = ISCSI_HDR_LEN; | ||
1681 | tx_dsg->lkey = isert_conn->conn_mr->lkey; | ||
1682 | isert_cmd->tx_desc.num_sge = 2; | ||
1683 | |||
1666 | isert_init_send_wr(isert_cmd, send_wr); | 1684 | isert_init_send_wr(isert_cmd, send_wr); |
1667 | 1685 | ||
1668 | pr_debug("Posting Reject IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); | 1686 | pr_debug("Posting Reject IB_WR_SEND >>>>>>>>>>>>>>>>>>>>>>\n"); |