Message ID | 20201106170036.18713-14-logang@deltatee.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=5vU3=EM=kvack.org=owner-linux-mm@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8CA1614C0 for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 6 Nov 2020 17:01:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 458BA22202 for <patchwork-linux-mm@patchwork.kernel.org>; Fri, 6 Nov 2020 17:01:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=deltatee.com header.i=@deltatee.com header.b="LKLCRs5E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 458BA22202 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=deltatee.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 09CAA6B0075; Fri, 6 Nov 2020 12:01:04 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 04EA16B0078; Fri, 6 Nov 2020 12:01:04 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E7E306B007B; Fri, 6 Nov 2020 12:01:03 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0240.hostedemail.com [216.40.44.240]) by kanga.kvack.org (Postfix) with ESMTP id BA7F96B0075 for <linux-mm@kvack.org>; Fri, 6 Nov 2020 12:01:03 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 53C242478 for <linux-mm@kvack.org>; Fri, 6 Nov 2020 17:01:03 +0000 (UTC) X-FDA: 77454608406.22.verse04_200e928272d4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id ED78B18038E6B for <linux-mm@kvack.org>; Fri, 6 Nov 2020 17:01:02 +0000 (UTC) X-Spam-Summary: 1,0,0,9104d98786c2177f,d41d8cd98f00b204,gunthorp@deltatee.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:2705:3138:3139:3140:3141:3142:3352:3865:3867:3868:4321:4605:5007:6120:6261:6653:6742:10004:11026:11473:11658:11914:12043:12048:12296:12297:12438:12517:12519:12555:12895:13069:13311:13357:13894:14096:14181:14384:14721:21080:21451:21627:21990:30054,0,RBL:204.191.154.188:@deltatee.com:.lbl8.mailshell.net-64.100.201.201 62.2.55.100;04yfzzd6rhapu5dqms63df9gm93uhoch6tysraekgfprh9kf474uhinniqdnein.smsqj66zaxnd7hyi1szxj36beathfm7sy18yrzuo81jjgink4s7s8t8u5o35iw1.s-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:72,LUA_SUMMARY:none X-HE-Tag: verse04_200e928272d4 X-Filterd-Recvd-Size: 4704 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by imf31.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Fri, 6 Nov 2020 17:01:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/ib4hcAfbiHMdLX/8DBMNJM6Gg1f+72PJ0ND9MJ2JPY=; b=LKLCRs5E1fTNVSfyLyggO9F00J ebA/QlSU1neMqjpg6RXX69lynbZmYxAVQReH4MRpE300YyrdAKMEEs0R9dBNTt2+Sn9fa5ZYuR2qE BMJGKFEk2kv8lZODOz7/Dtmjj2ir+gpt5cQvYp7xvFZcw5Dg01QCyOzB1IZZCZoSDRM2c2UiBycyt lu6DdPugsSp10V+yx5M0RwBAleHSQT17iLdK3N3AvfCMkGd9ZVFZwgiGPAbpHTORNODrCOzamsd3j ftrZdcJQIcIIK7uAVQf127ZdItrwzvKQvj7WJHXN/+D/ivdDaNbuJLgvyxC5ssGGyLKrGSo+xNcA5 XYQETn/Q==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <gunthorp@deltatee.com>) id 1kb56d-0002PX-U2; Fri, 06 Nov 2020 10:00:57 -0700 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from <gunthorp@deltatee.com>) id 1kb56V-0004tQ-Od; Fri, 06 Nov 2020 10:00:47 -0700 From: Logan Gunthorpe <logang@deltatee.com> To: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org Cc: Stephen Bates <sbates@raithlin.com>, Christoph Hellwig <hch@lst.de>, Dan Williams <dan.j.williams@intel.com>, Jason Gunthorpe <jgg@ziepe.ca>, =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, Ira Weiny <iweiny@intel.com>, John Hubbard <jhubbard@nvidia.com>, Don Dutile <ddutile@redhat.com>, Matthew Wilcox <willy@infradead.org>, Daniel Vetter <daniel.vetter@ffwll.ch>, Logan Gunthorpe <logang@deltatee.com> Date: Fri, 6 Nov 2020 10:00:34 -0700 Message-Id: <20201106170036.18713-14-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201106170036.18713-1-logang@deltatee.com> References: <20201106170036.18713-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, sbates@raithlin.com, hch@lst.de, jgg@ziepe.ca, christian.koenig@amd.com, dan.j.williams@intel.com, iweiny@intel.com, jhubbard@nvidia.com, ddutile@redhat.com, willy@infradead.org, daniel.vetter@ffwll.ch, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_NO_TEXT autolearn=ham autolearn_force=no version=3.4.2 Subject: [RFC PATCH 13/15] block: Set FOLL_PCI_P2PDMA in bio_map_user_iov() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Userspace P2PDMA with O_DIRECT NVMe devices
|
expand
|
diff --git a/block/blk-map.c b/block/blk-map.c index 21630dccac62..cad8fcfe4f17 100644 --- a/block/blk-map.c +++ b/block/blk-map.c @@ -245,6 +245,7 @@ static int bio_map_user_iov(struct request *rq, struct iov_iter *iter, { unsigned int max_sectors = queue_max_hw_sectors(rq->q); struct bio *bio, *bounce_bio; + unsigned int flags = 0; int ret; int j; @@ -256,13 +257,17 @@ static int bio_map_user_iov(struct request *rq, struct iov_iter *iter, return -ENOMEM; bio->bi_opf |= req_op(rq); + if (blk_queue_pci_p2pdma(rq->q)) + flags |= FOLL_PCI_P2PDMA; + while (iov_iter_count(iter)) { struct page **pages; ssize_t bytes; size_t offs, added = 0; int npages; - bytes = iov_iter_get_pages_alloc(iter, &pages, LONG_MAX, &offs); + bytes = iov_iter_get_pages_alloc_flags(iter, &pages, LONG_MAX, + &offs, flags); if (unlikely(bytes <= 0)) { ret = bytes ? bytes : -EFAULT; goto out_unmap;
When a bio's queue supports PCI P2PDMA, set FOLL_PCI_P2PDMA for iov_iter_get_pages_flags(). This allows PCI P2PDMA pages to be passed from userspace and enables the NVMe passthru requests to use P2PDMA pages. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> --- block/blk-map.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)