diff options
41 files changed, 1315 insertions, 2304 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index daf21b899999..5f6b7f63cdef 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c | |||
| @@ -1099,9 +1099,8 @@ static int srpt_map_sg_to_ib_sge(struct srpt_rdma_ch *ch, | |||
| 1099 | dir = cmd->data_direction; | 1099 | dir = cmd->data_direction; |
| 1100 | BUG_ON(dir == DMA_NONE); | 1100 | BUG_ON(dir == DMA_NONE); |
| 1101 | 1101 | ||
| 1102 | transport_do_task_sg_chain(cmd); | 1102 | ioctx->sg = sg = sg_orig = cmd->t_data_sg; |
| 1103 | ioctx->sg = sg = sg_orig = cmd->t_tasks_sg_chained; | 1103 | ioctx->sg_cnt = sg_cnt = cmd->t_data_nents; |
| 1104 | ioctx->sg_cnt = sg_cnt = cmd->t_tasks_sg_chained_no; | ||
| 1105 | 1104 | ||
| 1106 | count = ib_dma_map_sg(ch->sport->sdev->device, sg, sg_cnt, | 1105 | count = ib_dma_map_sg(ch->sport->sdev->device, sg, sg_cnt, |
| 1107 | opposite_dma_dir(dir)); | 1106 | opposite_dma_dir(dir)); |
| @@ -1769,7 +1768,7 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch, | |||
| 1769 | kref_put(&send_ioctx->kref, srpt_put_send_ioctx_kref); | 1768 | kref_put(&send_ioctx->kref, srpt_put_send_ioctx_kref); |
| 1770 | goto send_sense; | 1769 | goto send_sense; |
| 1771 | } | 1770 | } |
| 1772 | ret = transport_generic_allocate_tasks(cmd, srp_cmd->cdb); | 1771 | ret = target_setup_cmd_from_cdb(cmd, srp_cmd->cdb); |
| 1773 | if (ret < 0) { | 1772 | if (ret < 0) { |
| 1774 | kref_put(&send_ioctx->kref, srpt_put_send_ioctx_kref); | 1773 | kref_put(&send_ioctx->kref, srpt_put_send_ioctx_kref); |
| 1775 | if (cmd->se_cmd_flags & SCF_SCSI_RESERVATION_CONFLICT) { | 1774 | if (cmd->se_cmd_flags & SCF_SCSI_RESERVATION_CONFLICT) { |
| @@ -4004,9 +4003,6 @@ static int __init srpt_init_module(void) | |||
| 4004 | 4003 | ||
| 4005 | srpt_target->tf_ops = srpt_template; | 4004 | srpt_target->tf_ops = srpt_template; |
| 4006 | 4005 | ||
| 4007 | /* Enable SG chaining */ | ||
| 4008 | srpt_target->tf_ops.task_sg_chaining = true; | ||
| 4009 | |||
| 4010 | /* | 4006 | /* |
| 4011 | * Set up default attribute lists. | 4007 | * Set up default attribute lists. |
| 4012 | */ | 4008 | */ |
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 8b1d5e62ed40..d57d10cb2e47 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
| @@ -27,8 +27,10 @@ | |||
| 27 | #include <asm/unaligned.h> | 27 | #include <asm/unaligned.h> |
| 28 | #include <scsi/scsi_device.h> | 28 | #include <scsi/scsi_device.h> |
| 29 | #include <scsi/iscsi_proto.h> | 29 | #include <scsi/iscsi_proto.h> |
| 30 | #include <scsi/scsi_tcq.h> | ||
| 30 | #include <target/target_core_base.h> | 31 | #include <target/target_core_base.h> |
| 31 | #include <target/target_core_fabric.h> | 32 | #include <target/target_core_fabric.h> |
| 33 | #include <target/target_core_configfs.h> | ||
| 32 | 34 | ||
| 33 | #include "iscsi_target_core.h" | 35 | #include "iscsi_target_core.h" |
| 34 | #include "iscsi_target_parameters.h" | 36 | #include "iscsi_target_parameters.h" |
| @@ -593,7 +595,7 @@ static void __exit iscsi_target_cleanup_module(void) | |||
| 593 | kfree(iscsit_global); | 595 | kfree(iscsit_global); |
| 594 | } | 596 | } |
| 595 | 597 | ||
| 596 | int iscsit_add_reject( | 598 | static int iscsit_add_reject( |
| 597 | u8 reason, | 599 | u8 reason, |
| 598 | int fail_conn, | 600 | int fail_conn, |
| 599 | unsigned char *buf, | 601 | unsigned char *buf, |
| @@ -622,7 +624,7 @@ int iscsit_add_reject( | |||
| 622 | } | 624 | } |
| 623 | 625 | ||
| 624 | spin_lock_bh(&conn->cmd_lock); | 626 | spin_lock_bh(&conn->cmd_lock); |
| 625 | list_add_tail(&cmd->i_list, &conn->conn_cmd_list); | 627 | list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); |
| 626 | spin_unlock_bh(&conn->cmd_lock); | 628 | spin_unlock_bh(&conn->cmd_lock); |
| 627 | 629 | ||
| 628 | cmd->i_state = ISTATE_SEND_REJECT; | 630 | cmd->i_state = ISTATE_SEND_REJECT; |
| @@ -669,7 +671,7 @@ int iscsit_add_reject_from_cmd( | |||
| 669 | 671 | ||
| 670 | if (add_to_conn) { | 672 | if (add_to_conn) { |
| 671 | spin_lock_bh(&conn->cmd_lock); | 673 | spin_lock_bh(&conn->cmd_lock); |
| 672 | list_add_tail(&cmd->i_list, &conn->conn_cmd_list); | 674 | list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); |
| 673 | spin_unlock_bh(&conn->cmd_lock); | 675 | spin_unlock_bh(&conn->cmd_lock); |
| 674 | } | 676 | } |
| 675 | 677 | ||
| @@ -685,9 +687,7 @@ int iscsit_add_reject_from_cmd( | |||
| 685 | 687 | ||
| 686 | /* | 688 | /* |
| 687 | * Map some portion of the allocated scatterlist to an iovec, suitable for | 689 | * Map some portion of the allocated scatterlist to an iovec, suitable for |
| 688 | * kernel sockets to copy data in/out. This handles both pages and slab-allocated | 690 | * kernel sockets to copy data in/out. |
| 689 | * buffers, since we have been tricky and mapped t_mem_sg to the buffer in | ||
| 690 | * either case (see iscsit_alloc_buffs) | ||
| 691 | */ | 691 | */ |
| 692 | static int iscsit_map_iovec( | 692 | static int iscsit_map_iovec( |
| 693 | struct iscsi_cmd *cmd, | 693 | struct iscsi_cmd *cmd, |
| @@ -700,10 +700,9 @@ static int iscsit_map_iovec( | |||
| 700 | unsigned int page_off; | 700 | unsigned int page_off; |
| 701 | 701 | ||
| 702 | /* | 702 | /* |
| 703 | * We have a private mapping of the allocated pages in t_mem_sg. | 703 | * We know each entry in t_data_sg contains a page. |
| 704 | * At this point, we also know each contains a page. | ||
| 705 | */ | 704 | */ |
| 706 | sg = &cmd->t_mem_sg[data_offset / PAGE_SIZE]; | 705 | sg = &cmd->se_cmd.t_data_sg[data_offset / PAGE_SIZE]; |
| 707 | page_off = (data_offset % PAGE_SIZE); | 706 | page_off = (data_offset % PAGE_SIZE); |
| 708 | 707 | ||
| 709 | cmd->first_data_sg = sg; | 708 | cmd->first_data_sg = sg; |
| @@ -744,7 +743,7 @@ static void iscsit_ack_from_expstatsn(struct iscsi_conn *conn, u32 exp_statsn) | |||
| 744 | conn->exp_statsn = exp_statsn; | 743 | conn->exp_statsn = exp_statsn; |
| 745 | 744 | ||
| 746 | spin_lock_bh(&conn->cmd_lock); | 745 | spin_lock_bh(&conn->cmd_lock); |
| 747 | list_for_each_entry(cmd, &conn->conn_cmd_list, i_list) { | 746 | list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) { |
