diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-10-01 21:40:55 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-10-02 17:16:20 -0400 |
commit | 9f0abc1554cfedf2f2391f6ee54ae319441cd1b9 (patch) | |
tree | df8e72708ef8dceb983cf4b166193070cac256ad /drivers/vhost/tcm_vhost.h | |
parent | 944981c7e106af2aa004847e9177497856630980 (diff) |
tcm_vhost: Convert I/O path to use target_submit_cmd_map_sgls
This patch converts tcm_vhost to use target_submit_cmd_map_sgls() for
I/O submission and mapping of pre-allocated SGL memory from incoming
virtio-scsi SGL memory -> se_cmd descriptors.
This includes removing the original open-coded fabric uses of target
core callers to support transport_generic_map_mem_to_cmd() between
target_setup_cmd_from_cdb() and transport_handle_cdb_direct() logic.
It also includes adding a handful of new tcm_vhost_cmnd member +
assignments in vhost_scsi_allocate_cmd() used from cmwq process
context I/O submission within tcm_vhost_submission_work()
(v2: Use renamed target_submit_cmd_map_sgls)
Reported-by: Christoph Hellwig <hch@lst.de>
Cc: Christoph Hellwig <hch@lst.de>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/vhost/tcm_vhost.h')
-rw-r--r-- | drivers/vhost/tcm_vhost.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/vhost/tcm_vhost.h b/drivers/vhost/tcm_vhost.h index d9e93557d669..7e87c63ecbcd 100644 --- a/drivers/vhost/tcm_vhost.h +++ b/drivers/vhost/tcm_vhost.h | |||
@@ -5,6 +5,12 @@ | |||
5 | struct tcm_vhost_cmd { | 5 | struct tcm_vhost_cmd { |
6 | /* Descriptor from vhost_get_vq_desc() for virt_queue segment */ | 6 | /* Descriptor from vhost_get_vq_desc() for virt_queue segment */ |
7 | int tvc_vq_desc; | 7 | int tvc_vq_desc; |
8 | /* virtio-scsi initiator task attribute */ | ||
9 | int tvc_task_attr; | ||
10 | /* virtio-scsi initiator data direction */ | ||
11 | enum dma_data_direction tvc_data_direction; | ||
12 | /* Expected data transfer length from virtio-scsi header */ | ||
13 | u32 tvc_exp_data_len; | ||
8 | /* The Tag from include/linux/virtio_scsi.h:struct virtio_scsi_cmd_req */ | 14 | /* The Tag from include/linux/virtio_scsi.h:struct virtio_scsi_cmd_req */ |
9 | u64 tvc_tag; | 15 | u64 tvc_tag; |
10 | /* The number of scatterlists associated with this cmd */ | 16 | /* The number of scatterlists associated with this cmd */ |
@@ -17,6 +23,8 @@ struct tcm_vhost_cmd { | |||
17 | struct virtio_scsi_cmd_resp __user *tvc_resp; | 23 | struct virtio_scsi_cmd_resp __user *tvc_resp; |
18 | /* Pointer to vhost_scsi for our device */ | 24 | /* Pointer to vhost_scsi for our device */ |
19 | struct vhost_scsi *tvc_vhost; | 25 | struct vhost_scsi *tvc_vhost; |
26 | /* Pointer to vhost nexus memory */ | ||
27 | struct tcm_vhost_nexus *tvc_nexus; | ||
20 | /* The TCM I/O descriptor that is accessed via container_of() */ | 28 | /* The TCM I/O descriptor that is accessed via container_of() */ |
21 | struct se_cmd tvc_se_cmd; | 29 | struct se_cmd tvc_se_cmd; |
22 | /* work item used for cmwq dispatch to tcm_vhost_submission_work() */ | 30 | /* work item used for cmwq dispatch to tcm_vhost_submission_work() */ |