From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35D26C433E0 for ; Thu, 11 Mar 2021 23:33:25 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE63D64F93 for ; Thu, 11 Mar 2021 23:33:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE63D64F93 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=deltatee.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1pLba5PB91PsKm5EnRi+xl/KACCuoVRBRCja7BL7Taw=; b=bV1KRygHw16XNf uX9q1HwWWdFNDOoB/1BUM1s2T7PkLVGVo/CjE2cNDYpxqn2VF34XLlYlYtm21r+Y7GIcfWDk1Uab1 v3wLdAsBCZq5o5/zWkaEfCa9BMZmuII4U1aMUNaUiWApjhvjeJS88ozAA5WVz0dMJlgfsVqODJtrF UjPLHVNOLw9SObGIeT708gnOT62X745J9UUicTx32OUNXDB/eBxANrlV4MBJnBv1xkvSxJClR5Rzh XZV0H7TNaANRbHW3NJbc3GpztcHIy/1ov7vHues0IR48XkVt7IpZTfrx5KnKE/Ny3oSJMdZ61Bth8 fEifcfI5dH4wZn4hyXBw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKUni-00AEuC-BV; Thu, 11 Mar 2021 23:33:06 +0000 Received: from ale.deltatee.com ([204.191.154.188]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKUmh-00AEdQ-PW for linux-nvme@lists.infradead.org; Thu, 11 Mar 2021 23:32:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=uc5bXdFjfzszbviuSRD0/nYF6yd83ZtY9+zFkxPv3to=; b=csakyDP9QELnHiJJt/bc3YHT5J MoHtqOwNirvsD4AKK/wAoHQc1OcPqyxDLj6E6XbXXUlFNW8j0LFHY9i4+0dHbeSg2ntbrL+pi1i1j eZgg3PZ5kKt2v2KRZww13squhr+psIVilPV8ssOeCYlImV6asqMxmsdVVlevyQ2g4RTUO3Gs5m962 z2F1pS21nxt6uZzoVlb+9gSM1CZY/0Xh44C+NtzUIfHZPsMv/U0L/phcr8dTwoMmZ7ngxqPQCkfhn I5tPDsWoFxgDPV9tg1liF/lEyAEWDpXgxSWtEnSpoGLd0s/0dx4NQ/GOD4GT+AT6+UVa8Dq2T5t5L 11sJaiZw==; 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 ) id 1lKUmf-0003ev-OY; Thu, 11 Mar 2021 16:32:02 -0700 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from ) id 1lKUmX-00024k-0x; Thu, 11 Mar 2021 16:31:53 -0700 From: Logan Gunthorpe 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 , Christoph Hellwig , Dan Williams , Jason Gunthorpe , =?UTF-8?q?Christian=20K=C3=B6nig?= , Ira Weiny , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Jakowski Andrzej , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin , Logan Gunthorpe Date: Thu, 11 Mar 2021 16:31:39 -0700 Message-Id: <20210311233142.7900-10-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210311233142.7900-1-logang@deltatee.com> References: <20210311233142.7900-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, jhubbard@nvidia.com, ddutile@redhat.com, willy@infradead.org, daniel.vetter@ffwll.ch, jason@jlekstrand.net, dave.hansen@linux.intel.com, dan.j.williams@intel.com, iweiny@intel.com, andrzej.jakowski@intel.com, dave.b.minturn@intel.com, jianxin.xiong@intel.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [RFC PATCH v2 09/11] block: Add BLK_STS_P2PDMA 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210311_233206_352465_E3915BDE X-CRM114-Status: GOOD ( 13.55 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org Create a specific error code for when P2PDMA pages are passed to a block devices that cannot map them (due to no IOMMU support or ACS protections). This makes request errors in these cases more informative of as to what caused the error. Signed-off-by: Logan Gunthorpe --- block/blk-core.c | 2 ++ include/linux/blk_types.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/block/blk-core.c b/block/blk-core.c index fc60ff208497..2cc75b56ac43 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -192,6 +192,8 @@ static const struct { [BLK_STS_ZONE_OPEN_RESOURCE] = { -ETOOMANYREFS, "open zones exceeded" }, [BLK_STS_ZONE_ACTIVE_RESOURCE] = { -EOVERFLOW, "active zones exceeded" }, + [BLK_STS_P2PDMA] = { -EREMOTEIO, "P2PDMA to invalid device" }, + /* everything else not covered above: */ [BLK_STS_IOERR] = { -EIO, "I/O" }, }; diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index db026b6ec15a..728a0898cb34 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -142,6 +142,13 @@ typedef u8 __bitwise blk_status_t; */ #define BLK_STS_ZONE_ACTIVE_RESOURCE ((__force blk_status_t)16) +/* + * BLK_STS_P2PDMA is returned from the driver if P2PDMA memory fails to be + * mapped to the target device. This is a permanent error and the request + * should not be retried. + */ +#define BLK_STS_P2PDMA ((__force blk_status_t)17) + /** * blk_path_error - returns true if error may be path related * @error: status the request was completed with -- 2.20.1 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme