Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp7489imm; Thu, 4 Oct 2018 14:30:31 -0700 (PDT) X-Google-Smtp-Source: ACcGV60mMSR9DHdqZ9V2MjaX/gLsC14ZxIuvR+1FP5V4ViZytGzhgTAghywAPfshiLdNV1fuWply X-Received: by 2002:a65:42c2:: with SMTP id l2-v6mr7124814pgp.139.1538688631606; Thu, 04 Oct 2018 14:30:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538688631; cv=none; d=google.com; s=arc-20160816; b=VBegKzTWYeLCug0HaUAg3qD9kjWegOLWscYFUtZJT8M/wBaZ6zeZg2viQB5woJFRdb UAEqylgUtKk+n5UjxxxufcKnk2wMOZclbvKkycHEtj1PYkQWmcSjFhNv5+/NVDODZDL6 mM0vTUi4zf6u7ybxzTG2mWhPAEoDk6Lj7dCTxjYhirrF89NWgQrgHyfPGfLD8UNeY0Bu w2LdTZtQgkLsoFuYpTcxOb5Z2rDv6r78lKrR+1hOfsK+WVIGRYSVIuPbD+MWdEv8Ryju A2oNv/cHzpTp38+9iv6I8rpOTtpyO2PHipYae5lB01z8y9z9pX915HyKjYOSmYao36hi I8eA== 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=Ets0TMpM9uGcqImsN9+JIWkMIaInpXehk0wFrQxhQiq7R63DLW0ZhnNCAw1e6sd4lm kLoMLpRyidm+Y6HSzFHIp/bZwCf6HNLNb8rPmIq841hS0r+O7NdfchS91m5GlxX0/4+9 rfrUMkr6flYyz8OB0CwhIALGmyPZ/eOyXOtgYVo93Xon/JqSkvgUvPM+JkhNnHzf/MSv 0Af/r/Be1XNVd/adtIWAepHx37AsE2+8OqhSTVrsyltgj+BIJG5Z1BaGdLfOMBPsWtj6 I6KYj/VJWydoHhW4+T/j86aocszzuWlRifxnU5/2HhEiloCHyKPf1y4e1QaWs2aRL253 Zwew== 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 g12-v6si7355960plm.142.2018.10.04.14.30.16; Thu, 04 Oct 2018 14:30:31 -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 S1728429AbeJEEYs (ORCPT + 99 others); Fri, 5 Oct 2018 00:24:48 -0400 Received: from ale.deltatee.com ([207.54.116.67]:52954 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbeJEEXP (ORCPT ); Fri, 5 Oct 2018 00:23:15 -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 1g8BA2-0002Yi-PL; Thu, 04 Oct 2018 15:28:02 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1g8B9y-0001es-7W; Thu, 04 Oct 2018 15:27:50 -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: Thu, 4 Oct 2018 15:27:41 -0600 Message-Id: <20181004212747.6301-8-logang@deltatee.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181004212747.6301-1-logang@deltatee.com> References: <20181004212747.6301-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 v9 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