Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp1190612oof; Tue, 25 Sep 2018 09:24:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV603/qdbCBeYCE7HV8sycY7qQiFFPFMawsZJCCF8DCwsPL3EWS3VWjsVA9eWQRy6lq+sN7Ma X-Received: by 2002:a62:9cd7:: with SMTP id u84-v6mr1993097pfk.90.1537892642686; Tue, 25 Sep 2018 09:24:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537892642; cv=none; d=google.com; s=arc-20160816; b=pUItj2/XhqtVfNv1V7hU/smBAuIomleBBWcTZiBKLsjSkQY9vLvGCjwUK+NzrzE06o L3bbGVRgedXAZraia0SEFV26dsSdCs6fw40XoydvCHNBXvm0CFe+J1HhksS7mmSfuImU hESdus9RFdMV7E+Dpo9RorKNvZZI47YLQO12bJLRa94Sk3g2cIvJ3ath09NjeejxstPz y5YqDi/J3p3C063bJR7rWCMAqufcIwFXW9CwTxypEIQwcXSWZNP92FZ6PxGjLJTJSjTu comZOyNvb+MwkciNOclJxd0FwCNN9ZKMbmNCIHXqerMfP5dLS7Bxjtpb14QaQcQ/tJP4 4Vsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:cc:to:from; bh=S3jjv9n57iL3xVVTaNwrCDzlpuE3HXpqb9dX2KDeOG8=; b=rnXovrbHZrUgd1lZJA5cUK6Yc8FUjGQL48Ch9LtLABLwlFIO+8NgcXOXr1xowdSqnT HM0yhfUUV6gP5zJuHPhtJKnonbTik3ZdY9aVGiIinkQAS2eUmt7jOLgt+6A3XgzOWlsk SFU5bOZArEh/9Lcy1mf25e/OVN2JspHDLUW86Yaik5GzBx9wF3nskX1c93TaEbQpuNxo wkZtr7c+xfR78dzCGjeEYJlGrFEgNsa90V8Z0N/tFmAwQf9wSlsPrwJf1xD9CtmcKtSD 7iCTYFgmBOCyxS+VyaE456XbTXrJXpyEpQFSgMFA/KJ/kdD1H1mMu2H6lDVIeGWdz7ne ONLQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21-v6si2765035pgo.666.2018.09.25.09.23.47; Tue, 25 Sep 2018 09:24:02 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729974AbeIYWbc (ORCPT + 99 others); Tue, 25 Sep 2018 18:31:32 -0400 Received: from ale.deltatee.com ([207.54.116.67]:42790 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729253AbeIYWbM (ORCPT ); Tue, 25 Sep 2018 18:31:12 -0400 Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1g4q6p-0002fL-OJ; Tue, 25 Sep 2018 10:22:57 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1g4q6c-00019T-To; Tue, 25 Sep 2018 10:22:34 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-nvdimm@lists.01.org, linux-block@vger.kernel.org Cc: Stephen Bates , Christoph Hellwig , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Benjamin Herrenschmidt , Alex Williamson , =?UTF-8?q?Christian=20K=C3=B6nig?= , Jens Axboe , Logan Gunthorpe Date: Tue, 25 Sep 2018 10:22:25 -0600 Message-Id: <20180925162231.4354-8-logang@deltatee.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180925162231.4354-1-logang@deltatee.com> References: <20180925162231.4354-1-logang@deltatee.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-nvme@lists.infradead.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-rdma@vger.kernel.org, linux-block@vger.kernel.org, sbates@raithlin.com, hch@lst.de, sagi@grimberg.me, bhelgaas@google.com, jgg@mellanox.com, maxg@mellanox.com, keith.busch@intel.com, dan.j.williams@intel.com, benh@kernel.crashing.org, jglisse@redhat.com, alex.williamson@redhat.com, christian.koenig@amd.com, axboe@kernel.dk, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) 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.1 Subject: [PATCH v7 07/13] block: Add PCI P2P flag for request queue and check support for requests X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org QUEUE_FLAG_PCI_P2P is introduced meaning a driver's request queue supports targeting P2P memory. This will be used by P2P providers and orchestrators (in subsequent patches) to ensure block devices can support P2P memory before submitting P2P backed pages to submit_bio(). Signed-off-by: Logan Gunthorpe --- include/linux/blkdev.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 6980014357d4..87fb1963b721 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -699,6 +699,7 @@ struct request_queue { #define QUEUE_FLAG_SCSI_PASSTHROUGH 27 /* queue supports SCSI commands */ #define QUEUE_FLAG_QUIESCED 28 /* queue has been quiesced */ #define QUEUE_FLAG_PREEMPT_ONLY 29 /* only process REQ_PREEMPT requests */ +#define QUEUE_FLAG_PCI_P2PDMA 30 /* device supports pci p2p requests */ #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ (1 << QUEUE_FLAG_SAME_COMP) | \ @@ -731,6 +732,8 @@ bool blk_queue_flag_test_and_clear(unsigned int flag, struct request_queue *q); #define blk_queue_dax(q) test_bit(QUEUE_FLAG_DAX, &(q)->queue_flags) #define blk_queue_scsi_passthrough(q) \ test_bit(QUEUE_FLAG_SCSI_PASSTHROUGH, &(q)->queue_flags) +#define blk_queue_pci_p2pdma(q) \ + test_bit(QUEUE_FLAG_PCI_P2PDMA, &(q)->queue_flags) #define blk_noretry_request(rq) \ ((rq)->cmd_flags & (REQ_FAILFAST_DEV|REQ_FAILFAST_TRANSPORT| \ -- 2.19.0