Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1552271ybi; Wed, 19 Jun 2019 23:18:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2xwUqM2OVOQBg4SKIJVw/qZi2+avSXbuSvprwuRwuPe8b20Zce4/ND6neOe5Lz9HzSHMX X-Received: by 2002:a17:90a:9903:: with SMTP id b3mr1358023pjp.80.1561011484339; Wed, 19 Jun 2019 23:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561011484; cv=none; d=google.com; s=arc-20160816; b=Ykbn+qV0WLxL82056r1gfxvXGep0n75bAcZg+pjCvfMesP3i6IhIW46hUgQwmXZuuI fl9keUc8kcZjLHlr0s6NKtQlmLtGdWTA7X90Q/vUDU/ibkCVvmLlXj1DLTvksdFof8V/ PBYPyZEnxFF+ah899vt/TjbIIJWCp/RXFDT2QYTr1l6SCBpVcv4gQmeMmq+1cUTvp1rK BoHSvMn0Cc0Me3GABRDJhcRkcSvB3H8Qt/J+9fHlLG7gba904RGQQR98S4etVPqAhkek ALWy7gPVqTXR3Rc64fvmGLlsHVx8hHGDdDZcz4k0oOSQDkSgPwJjeC2HCJXPwOXLo6Qe QvJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date :thread-index:mime-version:in-reply-to:references:from :dkim-signature; bh=mtli3rBvWIToeUr29Uw+Ypdz0JV5neJvf4CS556KrxE=; b=q7/MXTlesjDW2shO1K2fDDhEVfPi9OOeJ1frIQteMtgvaL0wvJpsYuonCleUDrSui1 EYDMyuzITh+X0jd45klkgtndr6qRiLOv9AeJ7iNNX6TsI6NzKZoGUEoga4ZEzzZkd3cI yaofG434lEIiqgUy7Y8uDsiRFVCy1M8zycmu2oQhhoVxfqCEA8d2IWpuBtZbBI50WKeL gOOkWJi1nxNlUHpVtaiczBSddowGfTaEZIRg3+vul7AruQ7RVFgmPAOBDNHOf0Bk4T7j gRRgNVHm0M19Tbb9FT0ccWDp8ZTvskH5RCOlCQiJGOshwbWdL1Fp8QKHGLIibwsB7VqR g1tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=Nulylrgy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31si17694655plf.195.2019.06.19.23.17.48; Wed, 19 Jun 2019 23:18:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=Nulylrgy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730522AbfFTGRe (ORCPT + 99 others); Thu, 20 Jun 2019 02:17:34 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:35369 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbfFTGRe (ORCPT ); Thu, 20 Jun 2019 02:17:34 -0400 Received: by mail-io1-f68.google.com with SMTP id m24so186052ioo.2 for ; Wed, 19 Jun 2019 23:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to:cc; bh=mtli3rBvWIToeUr29Uw+Ypdz0JV5neJvf4CS556KrxE=; b=NulylrgyQaHJls93qgYUS6gchWZBQuVNjK0XX5s+yZYBluAT7ANsFeWjDQbYSpguGL JRVnkaHsN6ksyUxAWDaFFaEsicKKE+JA/f0mEyTlNK/ayBZkIgmtuhpZ8eBcqmNdir0i XgHJ3FCYTbtg3iKw6k3//5WGRQPWmgeoEtCbE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc; bh=mtli3rBvWIToeUr29Uw+Ypdz0JV5neJvf4CS556KrxE=; b=hEfnfjGnAuiZC66W7GDI2nd4CGn5MfK6edk6ydhA1auuhwzM9ZlNJCS0c4wLIeKXyd 3CHgEraojuUvMRBPSeqc9Wb/AOmYN34H5UpXYXaJA2HMFp9F+S7Q5fn66pbDSUvv+KFO +JKJyLTcINa5PxUfxk6JG6o6UdL6rl5qDDuFLr0gtU9FyqFu/1Vhu+Ea4OqrDfNedAH8 MkHG/q5hhPmHoqPjTTdaadFE/MkRvItc9oCpvj4T4aMnhsLG5wW0cgU2C++dzND0L3u1 lSOVt0Mr4a9wzxzlAK/mNNHncisRzyzwTdwx+Nj7hHf+InzW0hdF2+gT0CxCEar1KE0J ifJg== X-Gm-Message-State: APjAAAViVyTm59V5LGDoLVqAu9Yi08Q+/YmecBtSYOJ++FxsYaNKF83Q dX/qHaLuaIwXSqrl8S3fQgIgJrk4Av73UIm/SamfDQ== X-Received: by 2002:a5d:9b1a:: with SMTP id y26mr13527500ion.238.1561011453186; Wed, 19 Jun 2019 23:17:33 -0700 (PDT) From: Kashyap Desai References: <20190617122000.22181-1-hch@lst.de> <20190617122000.22181-2-hch@lst.de> In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQJRkq8kgUxIwCwNEXeP0B3fyGmx3wFs9i1PAgoiQ2Wlj4BA8A== Date: Thu, 20 Jun 2019 11:47:29 +0530 Message-ID: <6dd62da3ba56142d4a67bc207aa55a59@mail.gmail.com> Subject: RE: [PATCH 1/8] scsi: add a host / host template field for the virt boundary To: Ming Lei , Christoph Hellwig Cc: "Martin K . Petersen" , Sagi Grimberg , Max Gurtovoy , Bart Van Assche , linux-rdma , Linux SCSI List , "PDL,MEGARAIDLINUX" , PDL-MPT-FUSIONLINUX , linux-hyperv@vger.kernel.org, Linux Kernel Mailing List , Kashyap Desai Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: megaraidlinux.pdl@broadcom.com > [mailto:megaraidlinux.pdl@broadcom.com] On Behalf Of Ming Lei > Sent: Tuesday, June 18, 2019 6:05 AM > To: Christoph Hellwig > Cc: Martin K . Petersen ; Sagi Grimberg > ; Max Gurtovoy ; Bart Van > Assche ; linux-rdma ; > Linux SCSI List ; > megaraidlinux.pdl@broadcom.com; MPT-FusionLinux.pdl@broadcom.com; > linux-hyperv@vger.kernel.org; Linux Kernel Mailing List kernel@vger.kernel.org> > Subject: Re: [PATCH 1/8] scsi: add a host / host template field for the > virt > boundary > > On Mon, Jun 17, 2019 at 8:21 PM Christoph Hellwig wrote: > > > > This allows drivers setting it up easily instead of branching out to > > block layer calls in slave_alloc, and ensures the upgraded > > max_segment_size setting gets picked up by the DMA layer. > > > > Signed-off-by: Christoph Hellwig > > --- > > drivers/scsi/hosts.c | 3 +++ > > drivers/scsi/scsi_lib.c | 3 ++- > > include/scsi/scsi_host.h | 3 +++ > > 3 files changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index > > ff0d8c6a8d0c..55522b7162d3 100644 > > --- a/drivers/scsi/hosts.c > > +++ b/drivers/scsi/hosts.c > > @@ -462,6 +462,9 @@ struct Scsi_Host *scsi_host_alloc(struct > scsi_host_template *sht, int privsize) > > else > > shost->dma_boundary = 0xffffffff; > > > > + if (sht->virt_boundary_mask) > > + shost->virt_boundary_mask = sht->virt_boundary_mask; > > + > > device_initialize(&shost->shost_gendev); > > dev_set_name(&shost->shost_gendev, "host%d", shost->host_no); > > shost->shost_gendev.bus = &scsi_bus_type; diff --git > > a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index > > 65d0a10c76ad..d333bb6b1c59 100644 > > --- a/drivers/scsi/scsi_lib.c > > +++ b/drivers/scsi/scsi_lib.c > > @@ -1775,7 +1775,8 @@ void __scsi_init_queue(struct Scsi_Host *shost, > struct request_queue *q) > > dma_set_seg_boundary(dev, shost->dma_boundary); > > > > blk_queue_max_segment_size(q, shost->max_segment_size); > > - dma_set_max_seg_size(dev, shost->max_segment_size); > > + blk_queue_virt_boundary(q, shost->virt_boundary_mask); > > + dma_set_max_seg_size(dev, queue_max_segment_size(q)); > > The patch looks fine, also suggest to make sure that max_segment_size is > block-size aligned, and un-aligned max segment size has caused trouble on > mmc. I validated changes on latest and few older series controllers. Post changes, I noticed max_segment_size is updated. find /sys/ -name max_segment_size |grep sdb |xargs grep -r . /sys/devices/pci0000:3a/0000:3a:00.0/0000:3b:00.0/0000:3c:04.0/0000:40:00.0/0000:41:00.0/0000:42:00.0/host0/target0:2:12/0:2:12:0/block/sdb/queue/max_segment_size:4294967295 I verify that single SGE having 1MB transfer length is working fine. Acked-by: Kashyap Desai < kashyap.desai@broadcom.com> > > Thanks, > Ming Lei >