From patchwork Thu Apr 7 22:13:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 8777751 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ED52C9F36E for ; Thu, 7 Apr 2016 22:14:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2368D201CD for ; Thu, 7 Apr 2016 22:14:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41337201BC for ; Thu, 7 Apr 2016 22:14:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754166AbcDGWOK (ORCPT ); Thu, 7 Apr 2016 18:14:10 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:36186 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752385AbcDGWOK (ORCPT ); Thu, 7 Apr 2016 18:14:10 -0400 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1aoIBb-0006Kh-8q; Thu, 07 Apr 2016 22:13:59 +0000 Date: Thu, 7 Apr 2016 15:13:59 -0700 From: Christoph Hellwig To: Sagi Grimberg Cc: Max Gurtovoy , bart.vanassche@sandisk.com, linux-rdma@vger.kernel.org Subject: Re: iSER initiator in 4.5 is unhappy.. Message-ID: <20160407221359.GA16686@infradead.org> References: <5702A46F.5070109@grimberg.me> <5702A6AC.9020008@grimberg.me> <20160404225831.GA6725@infradead.org> <57037D8E.4030506@grimberg.me> <20160405094339.GA1622@infradead.org> <570548AB.4090802@grimberg.me> <20160406231658.GB11588@infradead.org> <570608C9.1070805@grimberg.me> <570623B9.8040108@mellanox.com> <570679B6.10409@grimberg.me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <570679B6.10409@grimberg.me> User-Agent: Mutt/1.5.24 (2015-08-30) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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.