Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2266510imm; Thu, 27 Sep 2018 09:57:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV62SwZqGxlm1FYa0fNMSD9R3lqto5fRlX1ckVQ8N3psaRzLt38XiDTbeeKpMQV5Y3ZZplc5I X-Received: by 2002:a62:cf04:: with SMTP id b4-v6mr12498299pfg.224.1538067449892; Thu, 27 Sep 2018 09:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538067449; cv=none; d=google.com; s=arc-20160816; b=pIKOVK1Fdgj+tdV9983buIy3jzo9NC0+taWgLkJORawZET+szyjH3TRdxMwcRloZHw nXT8jvmvd7EIGpKnnqyz9F5bkrNYkSKrKZhbYaf6m6UEV4Fp2jwG9Cyz57onM5wZa2a2 Q1LSy5oYCDCB2dsjn7EI0YiDmqdYuzk3UAmjCbD+hIYJ6I9N1bwyGxyXdoOc5PpDXhpC 7lsGzVatA1kowSIkmP57QA7h66rsEs5bRRtKBD48y3RIRz3rVWkDUKVS7S2EDUN7QnWW WfiN40kSfVI89jMgtEkwEMfj8G8HuR9izE58yteKhB6zRsKE+YerNtl8anftGaeyIc4t Bl5w== 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=Tpy+qMN5i7i0l3ssy+BliK+sdogCWd7CI9ajTQZXNuHbu+Vaa+urwJ0e28ZNw0ddDu sgLGRb8H1BQj+wOlR3W5BM0n6u04TiibkioD8MRoza4aQM9guBOLff0BggPsUi4uVGX+ viz1yhF9chOyxvysqoTC2n3VZyKUMcndzMrUE6CXYABCNSijxcMoIOl+XIwrZyDR0WQT dGCuoiPvgnRgPYJnjr8hrLg3F9JoST8uLF6RHmvq+/BHTu1div1OPUpxRf5XCObfEna1 MI8UTUhd0K8tG71jdh/MNHaEmTU1BKGX6cqb+qCGpPb/8pJuhqthouYhOOMJX66kvvq9 wz4Q== 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 z16-v6si2310338pgi.252.2018.09.27.09.57.03; Thu, 27 Sep 2018 09:57:29 -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 S1728459AbeI0XNm (ORCPT + 99 others); Thu, 27 Sep 2018 19:13:42 -0400 Received: from ale.deltatee.com ([207.54.116.67]:58400 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728377AbeI0XNm (ORCPT ); Thu, 27 Sep 2018 19:13:42 -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 1g5ZYZ-0003f7-Ms; Thu, 27 Sep 2018 10:54:30 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1g5ZYU-0001OZ-6q; Thu, 27 Sep 2018 10:54:22 -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, 27 Sep 2018 10:54:14 -0600 Message-Id: <20180927165420.5290-8-logang@deltatee.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927165420.5290-1-logang@deltatee.com> References: <20180927165420.5290-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 v8 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