diff mbox

iSER initiator in 4.5 is unhappy..

Message ID 20160407221359.GA16686@infradead.org (mailing list archive)
State Superseded
Headers show

Commit Message

Christoph Hellwig April 7, 2016, 10:13 p.m. UTC
The patch below fixes the issue for me.  But for SRP I'm still seeing
lots of these failures even with the equivalent patch applied:

[ 426.027905] scsi host8: ib_srp: Failed to map data (-12)
[  426.053203] scsi host8: ib_srp: Failed to map data (-12)
[  426.053265] scsi host8: ib_srp: Failed to map data (-12)
[  426.053270] scsi host8: ib_srp: Failed to map data (-12)
[  426.053273] scsi host8: ib_srp: Failed to map data (-12)
[  426.053276] scsi host8: ib_srp: Failed to map data (-12)
[  426.053279] scsi host8: ib_srp: Failed to map data (-12)

It seems the actual reproducer is xfs_repair as run by xfstests.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Bart Van Assche April 8, 2016, 1:42 a.m. UTC | #1
On 04/07/16 15:14, Christoph Hellwig wrote:
> The patch below fixes the issue for me.  But for SRP I'm still seeing
> lots of these failures even with the equivalent patch applied:
>
> [ 426.027905] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053203] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053265] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053270] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053273] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053276] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053279] scsi host8: ib_srp: Failed to map data (-12)
>
> It seems the actual reproducer is xfs_repair as run by xfstests.

Hello Christoph,

Thanks for the report. I will try to reproduce this behavior and will 
see whether I can find the root cause.

Bart.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Max Gurtovoy April 10, 2016, 1:30 p.m. UTC | #2
On 4/8/2016 1:13 AM, Christoph Hellwig wrote:
> The patch below fixes the issue for me.  But for SRP I'm still seeing
> lots of these failures even with the equivalent patch applied:
>
> [ 426.027905] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053203] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053265] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053270] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053273] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053276] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053279] scsi host8: ib_srp: Failed to map data (-12)
>
> It seems the actual reproducer is xfs_repair as run by xfstests.
>
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
> index 60b169a..3ac4755 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -3205,6 +3205,7 @@ static ssize_t srp_create_target(struct device *dev,
>   	target_host->max_id      = 1;
>   	target_host->max_lun     = -1LL;
>   	target_host->max_cmd_len = sizeof ((struct srp_cmd *) (void *) 0L)->cdb;
> +	target_host->max_segment_size = PAGE_SIZE;
>
>   	target = host_to_target(target_host);

Hi Christoph,
did you add similar assignment in iser code or only used the scsi patches ?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig April 10, 2016, 2:52 p.m. UTC | #3
On Sun, Apr 10, 2016 at 04:30:11PM +0300, Max Gurtovoy wrote:
> Hi Christoph,
> did you add similar assignment in iser code or only used the scsi patches ?

Yes, to fix it I had to do the assignment in iser.  Not sure why
I didn't manage to send it out.  Let me prepare a proper patch series.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bart Van Assche April 12, 2016, 9:33 p.m. UTC | #4
On 04/07/2016 03:13 PM, Christoph Hellwig wrote:
> The patch below fixes the issue for me.  But for SRP I'm still seeing
> lots of these failures even with the equivalent patch applied:
>
> [ 426.027905] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053203] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053265] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053270] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053273] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053276] scsi host8: ib_srp: Failed to map data (-12)
> [  426.053279] scsi host8: ib_srp: Failed to map data (-12)
>
> It seems the actual reproducer is xfs_repair as run by xfstests.

Hello Christoph,

So far I have not yet been able to reproduce the ib_srp mapping failure 
with kernel v4.6-rc3. How was ib_srp configured in your test (cat 
/etc/modprobe.d/ib_srp.conf)?

Thanks,

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 60b169a..3ac4755 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -3205,6 +3205,7 @@  static ssize_t srp_create_target(struct device *dev,
 	target_host->max_id      = 1;
 	target_host->max_lun     = -1LL;
 	target_host->max_cmd_len = sizeof ((struct srp_cmd *) (void *) 0L)->cdb;
+	target_host->max_segment_size = PAGE_SIZE;
 
 	target = host_to_target(target_host);
 
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 8c6e318..ae331e0 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2120,7 +2120,8 @@  static void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q)
 	blk_queue_segment_boundary(q, shost->dma_boundary);
 	dma_set_seg_boundary(dev, shost->dma_boundary);
 
-	blk_queue_max_segment_size(q, dma_get_max_seg_size(dev));
+	blk_queue_max_segment_size(q,
+		min(shost->max_segment_size, dma_get_max_seg_size(dev)));
 
 	if (!shost->use_clustering)
 		q->limits.cluster = 0;
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index fcfa3d7..f11d3fe 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -621,6 +621,7 @@  struct Scsi_Host {
 	short unsigned int sg_tablesize;
 	short unsigned int sg_prot_tablesize;
 	unsigned int max_sectors;
+	unsigned int max_segment_size;
 	unsigned long dma_boundary;
 	/*
 	 * In scsi-mq mode, the number of hardware queues supported by the LLD.