From patchwork Wed Jan 19 04:27:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Dillow X-Patchwork-Id: 488091 X-Patchwork-Delegate: dave@thedillows.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0J50ubN026308 for ; Wed, 19 Jan 2011 05:00:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750712Ab1ASFA5 (ORCPT ); Wed, 19 Jan 2011 00:00:57 -0500 Received: from emroute2.ornl.gov ([160.91.86.17]:54596 "EHLO emroute2.ornl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762Ab1ASFA4 (ORCPT ); Wed, 19 Jan 2011 00:00:56 -0500 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 19 Jan 2011 05:00:59 +0000 (UTC) X-Greylist: delayed 2011 seconds by postgrey-1.27 at vger.kernel.org; Wed, 19 Jan 2011 00:00:56 EST Received: from emroute2.ornl.gov ([127.0.0.1]) by emroute2.ornl.gov (PMDF V6.5-x5 #31823) with ESMTP id <0LF9001CW5PRYN@emroute2.ornl.gov> for linux-rdma@vger.kernel.org; Tue, 18 Jan 2011 23:27:28 -0500 (EST) Received: from CONVERSION-DAEMON.emroute2.ornl.gov by emroute2.ornl.gov (PMDF V6.5-x5 #31823) id <0LF9005015PREJ@emroute2.ornl.gov> for linux-rdma@vger.kernel.org; Tue, 18 Jan 2011 23:27:27 -0500 (EST) Received: from lap75545.ornl.gov (lap75545.ornl.gov [160.91.210.54]) by emroute2.ornl.gov (PMDF V6.5-x5 #31823) with ESMTPS id <0LF900KTX5PR0C@emroute2.ornl.gov> for linux-rdma@vger.kernel.org; Tue, 18 Jan 2011 23:27:27 -0500 (EST) Received: from lap75545.ornl.gov (localhost.localdomain [127.0.0.1]) by lap75545.ornl.gov (8.14.4/8.14.3) with ESMTP id p0J4RRRu026232 for ; Tue, 18 Jan 2011 23:27:27 -0500 Received: (from dad@localhost) by lap75545.ornl.gov (8.14.4/8.14.4/Submit) id p0J4RRMZ026229 for linux-rdma@vger.kernel.org; Tue, 18 Jan 2011 23:27:27 -0500 Date: Tue, 18 Jan 2011 23:27:22 -0500 From: David Dillow Subject: [RFC 8/8] IB/srp and direct IO: patches for testing large indirect tables In-reply-to: <1295411242-26148-1-git-send-email-dillowda@ornl.gov> To: linux-rdma@vger.kernel.org Message-id: <1295411242-26148-9-git-send-email-dillowda@ornl.gov> X-Mailer: git-send-email 1.7.3.4 References: <1295411242-26148-1-git-send-email-dillowda@ornl.gov> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 1da8b25..b9daf2f 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -41,6 +41,10 @@ #include +/* XXX This has to be included before scsi.h to pickup ARCH_HAS_SG_CHAIN + * There is a patch for this floating on LKML and linus-scsi now + */ +#include #include #include #include @@ -1845,7 +1849,12 @@ static struct scsi_host_template srp_template = { .this_id = -1, .cmd_per_lun = SRP_CMD_SQ_SIZE, .use_clustering = ENABLE_CLUSTERING, - .shost_attrs = srp_host_attrs + .shost_attrs = srp_host_attrs, + + /* XXX Force a new SG entry for every page crossing to simulate + * maxmimum fragmentation. + */ + .dma_boundary = (4096 - 1), }; static int srp_add_target(struct srp_host *host, struct srp_target_port *target) diff --git a/fs/direct-io.c b/fs/direct-io.c index 85882f6..9eb0553 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -583,6 +583,7 @@ static int dio_new_bio(struct dio *dio, sector_t start_sector) goto out; sector = start_sector << (dio->blkbits - 9); nr_pages = min(dio->pages_in_io, bio_get_nr_vecs(dio->map_bh.b_bdev)); + nr_pages = min(nr_pages, BIO_MAX_PAGES); BUG_ON(nr_pages <= 0); ret = dio_bio_alloc(dio, dio->map_bh.b_bdev, sector, nr_pages); dio->boundary = 0;