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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1544FC433EF for ; Tue, 28 Sep 2021 18:48:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8A9EB60F9D for ; Tue, 28 Sep 2021 18:48:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8A9EB60F9D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 21A3D6B0071; Tue, 28 Sep 2021 14:48:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C9EA6B0072; Tue, 28 Sep 2021 14:48:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 091B26B0073; Tue, 28 Sep 2021 14:48:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0249.hostedemail.com [216.40.44.249]) by kanga.kvack.org (Postfix) with ESMTP id EA73D6B0071 for ; Tue, 28 Sep 2021 14:48:50 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A40898249980 for ; Tue, 28 Sep 2021 18:48:50 +0000 (UTC) X-FDA: 78637868820.02.A744282 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by imf12.hostedemail.com (Postfix) with ESMTP id 6A13710000AB for ; Tue, 28 Sep 2021 18:48:50 +0000 (UTC) Received: by mail-qt1-f173.google.com with SMTP id m26so9331152qtn.1 for ; Tue, 28 Sep 2021 11:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=V9OdhKHkz+bDWOgw519ym53HGQqRyLuvFdP/XrS7z5w=; b=U6Cle1ar5YMOX4vRLBQAyCUIzflL0rP5DDqpOBJE+YXNQaN+2OCi9d0Iy1j+ZqEb0q ldJaiLHkalWypayZHQx3L3YPO9DcOqCmj/7fnNa9sm7+IILMYJgnEeoBHOfV3+5sIA1G 7PoT13IhlGy54nJMnWjX2JC+DO7VxjDE7MqR0TIZG4kkDyH5MeFimp+WrD7+H8fZcSrr rjU6GjV1RHVgJefkq1bsjD7HjG42edUR2AMuNMVNVDWGsf2VmvclfT7eJ7t5/82dwAMV kHPwsALEwDASPTTgXVp7pyVtxMvNs1y+xdofJ6ktmPZVIieklzttcPQ7dqgixshVYpDP cjwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=V9OdhKHkz+bDWOgw519ym53HGQqRyLuvFdP/XrS7z5w=; b=Yy5WLWcka8mX7QMPyoZeFXAacl5O7QNIpkBC2LF9Ep5fieT60qdqK/PIf6ROyr0Nqy MDO1xhYypv+9HHMoAg0NaiOoIx/yH7MOn7ksYGxZeS0CtsYO8eiOyxKDlNvdJQS4gVjP T439bNDlpxReUV+BqOmmL0OqhL0ZJbpe2NYGO39s/8YQEOAtP2YlowMVlaEZC1NBioJJ p0XMeNQOkzSZeen9zUnH9+vRlH6rYmZpgH94ZcirPn+3CTWvUtBoSQbeMB4f1UL6XBxZ /CxOJ7S856sn7XJDHYOwom9D5NAB8tvhgxQRYkOFHcyLri2aTyqtMRRe4RAtGnxb8zbk DuWw== X-Gm-Message-State: AOAM5309fZe6xnC0Zz9ftpeF3sH/9OE8IL5Z3mbcy05ZmIzd2pDLNDQi RHSoiL/roNNzt7P+2g6BcZHqug== X-Google-Smtp-Source: ABdhPJxMh4uLV/Co2Bi0Uj4NMD1oETxTUQz1ehKuaeVQOMiXGKhC5tKssJhY1an+RZ/0cNTGVGgAwg== X-Received: by 2002:ac8:46c8:: with SMTP id h8mr7389965qto.341.1632854929767; Tue, 28 Sep 2021 11:48:49 -0700 (PDT) Received: from ziepe.ca ([206.223.160.26]) by smtp.gmail.com with ESMTPSA id b65sm15601470qkc.46.2021.09.28.11.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 11:48:49 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mVI9o-007FZ4-5q; Tue, 28 Sep 2021 15:48:48 -0300 Date: Tue, 28 Sep 2021 15:48:48 -0300 From: Jason Gunthorpe To: Logan Gunthorpe Cc: 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, Stephen Bates , Christoph Hellwig , Dan Williams , Christian =?utf-8?B?S8O2bmln?= , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Jakowski Andrzej , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin , Bjorn Helgaas , Ira Weiny , Robin Murphy , Martin Oliveira , Chaitanya Kulkarni Subject: Re: [PATCH v3 03/20] PCI/P2PDMA: make pci_p2pdma_map_type() non-static Message-ID: <20210928184848.GK3544071@ziepe.ca> References: <20210916234100.122368-1-logang@deltatee.com> <20210916234100.122368-4-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210916234100.122368-4-logang@deltatee.com> X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 6A13710000AB X-Stat-Signature: 7q4r5khtyar9boogjhu8hytcz31ithgc Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=ziepe.ca header.s=google header.b=U6Cle1ar; spf=pass (imf12.hostedemail.com: domain of jgg@ziepe.ca designates 209.85.160.173 as permitted sender) smtp.mailfrom=jgg@ziepe.ca; dmarc=none X-HE-Tag: 1632854930-193688 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: On Thu, Sep 16, 2021 at 05:40:43PM -0600, Logan Gunthorpe wrote: > +enum pci_p2pdma_map_type { > + /* > + * PCI_P2PDMA_MAP_UNKNOWN: Used internally for indicating the mapping > + * type hasn't been calculated yet. Functions that return this enum > + * never return this value. > + */ > + PCI_P2PDMA_MAP_UNKNOWN = 0, > + > + /* > + * PCI_P2PDMA_MAP_NOT_SUPPORTED: Indicates the transaction will > + * traverse the host bridge and the host bridge is not in the > + * whitelist. DMA Mapping routines should return an error when I gather we are supposed to type allowlist now > + * this is returned. > + */ > + PCI_P2PDMA_MAP_NOT_SUPPORTED, > + > + /* > + * PCI_P2PDMA_BUS_ADDR: Indicates that two devices can talk to > + * eachother directly through a PCI switch and the transaction will 'each other' > + * not traverse the host bridge. Such a mapping should program > + * the DMA engine with PCI bus addresses. > + */ > + PCI_P2PDMA_MAP_BUS_ADDR, > + > + /* > + * PCI_P2PDMA_MAP_THRU_HOST_BRIDGE: Indicates two devices can talk > + * to eachother, but the transaction traverses a host bridge on the 'each other' > + * whitelist. In this case, a normal mapping either with CPU physical > + * addresses (in the case of dma-direct) or IOVA addresses (in the > + * case of IOMMUs) should be used to program the DMA engine. > + */ > + PCI_P2PDMA_MAP_THRU_HOST_BRIDGE, > +}; Reviewed-by: Jason Gunthorpe Jason