Skip to content

Commit 5fea429

Browse files
steffen-maierJames Bottomley
authored andcommitted
[SCSI] zfcp: block queue limits with data router
Commit 86a9668 "[SCSI] zfcp: support for hardware data router" reduced the initial block queue limits in the scsi_host_template to the absolute minimum and adjusted them later on. However, the adjustment was too late for the BSG devices of Scsi_Host and fc_host. Therefore, ioctl(..., SG_IO, ...) with request or response size > 4kB to a BSG device of an fc_host or a Scsi_Host fails with EINVAL. As a result, users of such ioctl such as HBA_SendCTPassThru() in libzfcphbaapi return with error HBA_STATUS_ERROR. Initialize the block queue limits in zfcp_scsi_host_template to the greatest common denominator (GCD). While we cannot exploit the slightly enlarged maximum request size with data router, this should be neglectible. Doing so also avoids running into trouble after live guest relocation (LGR) / migration from a data router FCP device to an FCP device that does not support data router. In that case, zfcp would figure out the new limits on adapter recovery, but the fc_host and Scsi_Host (plus in fact all sdevs) still exist with the old and now too large queue limits. It should also OK, not to use half the size as in the DIX case, because fc_host and Scsi_Host do not transport FCP requests including SCSI commands using protection data. Signed-off-by: Steffen Maier <[email protected]> Reviewed-by: Martin Peschke <[email protected]> Cc: <[email protected]> #3.2+ Signed-off-by: James Bottomley <[email protected]>
1 parent f76ccaa commit 5fea429

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/s390/scsi/zfcp_scsi.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Interface to Linux SCSI midlayer.
55
*
6-
* Copyright IBM Corp. 2002, 2010
6+
* Copyright IBM Corp. 2002, 2013
77
*/
88

99
#define KMSG_COMPONENT "zfcp"
@@ -311,8 +311,12 @@ static struct scsi_host_template zfcp_scsi_host_template = {
311311
.proc_name = "zfcp",
312312
.can_queue = 4096,
313313
.this_id = -1,
314-
.sg_tablesize = 1, /* adjusted later */
315-
.max_sectors = 8, /* adjusted later */
314+
.sg_tablesize = (((QDIO_MAX_ELEMENTS_PER_BUFFER - 1)
315+
* ZFCP_QDIO_MAX_SBALS_PER_REQ) - 2),
316+
/* GCD, adjusted later */
317+
.max_sectors = (((QDIO_MAX_ELEMENTS_PER_BUFFER - 1)
318+
* ZFCP_QDIO_MAX_SBALS_PER_REQ) - 2) * 8,
319+
/* GCD, adjusted later */
316320
.dma_boundary = ZFCP_QDIO_SBALE_LEN - 1,
317321
.cmd_per_lun = 1,
318322
.use_clustering = 1,

0 commit comments

Comments
 (0)