summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_cdb.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-03-26 21:53:17 (GMT)
committerNicholas Bellinger <nab@linux-iscsi.org>2012-04-15 00:40:31 (GMT)
commitbebe2fdc17835f9330de2a15c8ca393f92acd250 (patch)
tree1517e9dc463055400cce84c183bffa5f69c974e7 /drivers/target/target_core_cdb.c
parent83799efbfffff62678306ce5e98f4d6d0e069e23 (diff)
downloadlinux-fsl-qoriq-bebe2fdc17835f9330de2a15c8ca393f92acd250.tar.xz
target: stop splitting commands into multiple tasks
From hch: The high-performance backends (iblock and rd) support tasks of unlimited size. With that there is no reason to keep a complex infrastructure for splitting up commands in place. Stop doing so and only submit a single task per data direction. Once this is in place we can slowly remove fields from the task that duplicate things in the command, or move other fields into the command. From nab: The benefit to IBLOCK performance by removing the additional fast-path allocation overhead + SGL mapping to se_task->task_sg[] is now greater than transparently supporting an received CDB I/O length that exceeds what is allowed by backend pSCSI LLD hardware max_sectors, that was originally supported for all backend export cases. This change may effect some users of pSCSI users on legacy hardware, but I think most folks are now using TYPE_DISK struct scsi_device export with IBLOCK. The only other place where this may can issues that cannot be resolved with IBLOCK TYPE_DISK is using TYPE_ROM, TYPE_TAPE or other pSCSI non TYPE_DISK export with an SCSI LLDs using a smaller max_sectors. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_cdb.c')
-rw-r--r--drivers/target/target_core_cdb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c
index 30a6770..f6f6059 100644
--- a/drivers/target/target_core_cdb.c
+++ b/drivers/target/target_core_cdb.c
@@ -432,6 +432,7 @@ static int
target_emulate_evpd_b0(struct se_cmd *cmd, unsigned char *buf)
{
struct se_device *dev = cmd->se_dev;
+ u32 max_sectors;
int have_tp = 0;
/*
@@ -456,7 +457,9 @@ target_emulate_evpd_b0(struct se_cmd *cmd, unsigned char *buf)
/*
* Set MAXIMUM TRANSFER LENGTH
*/
- put_unaligned_be32(dev->se_sub_dev->se_dev_attrib.fabric_max_sectors, &buf[8]);
+ max_sectors = min(dev->se_sub_dev->se_dev_attrib.fabric_max_sectors,
+ dev->se_sub_dev->se_dev_attrib.max_sectors);
+ put_unaligned_be32(max_sectors, &buf[8]);
/*
* Set OPTIMAL TRANSFER LENGTH