Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp5164145pxb; Tue, 28 Sep 2021 11:54:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymz8gKP7BrfMmEqw9Mzrj5dEsdZu70XQqkiTHyrAS5SXnKl+Mlha2MHIOa3HAcsSpiDJjQ X-Received: by 2002:a17:906:3148:: with SMTP id e8mr8433189eje.240.1632855240239; Tue, 28 Sep 2021 11:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632855240; cv=none; d=google.com; s=arc-20160816; b=fWGk6AmrDFV08NVGM28iLaPnngXkcj8P7HBIDW76V4Tjvktz2ldty1PAOHPj6Tmemc 9LPrgyZ9dzlO6d1BwDYD+e/djA67sIyWC2s0/sHv2QT/sVcMBtfVdFV2P2tzkcAnvX5T uo69DB4guWP44CCAV5vtOXG0m6eEmIQvY6pu6xSGI/Kx+vGvwR2vYXeyDWF32dK8TAgh YhW/fYCAS5x3UdpMV5BwvX6RfLrjfJcbGOzg7IMeTFdXIEIkhNKXy2yX6nMoSLo9XJUc kokqxdowQ7XgxxpN8piMPFD3GM7z4aoUUT1hIUssVPyjzE4FWkDb7w98jLs89wHoOy3Y t2AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=V9OdhKHkz+bDWOgw519ym53HGQqRyLuvFdP/XrS7z5w=; b=CuAZDw849jG6bhaDjK/BuU8aLnjADgLOxK+xoN2zVtFX+1d1hQqS2WFZGckWaQ0QVd DULYNWs3uYxVjKHe2EXRDgYTkZois3GErg7DmH4agl0xU6I1ZZRJlh1JMXneXszdpAbl FX3d66iF+t1mKkuax4KE8oVVyk3nSEcvEZ+b1sQTiyxuCuQY2Dn67/n6MhjH1wOKAmbT 1KLDkwBcwIgzWfTl4KhZXiLDNSlWnWKhbYOB2NzJYyyO69iVcxFy9fkPOadqolUOGwPO GRBWNsCWh27bj3CbRrEx+m3qJkp3p4nWOUQRuJ90Sszd2fysRTOeLLn8jwW4W/bOdI+I Qv5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=U6Cle1ar; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b16si1339805edj.164.2021.09.28.11.53.36; Tue, 28 Sep 2021 11:54:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=U6Cle1ar; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242313AbhI1Sub (ORCPT + 99 others); Tue, 28 Sep 2021 14:50:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242311AbhI1Sua (ORCPT ); Tue, 28 Sep 2021 14:50:30 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 908EFC061745 for ; Tue, 28 Sep 2021 11:48:50 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id f15so7983785qtv.9 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=HLkCg7IFAwYm3DK2ypS8AcALT72lcy0q5Ht6WQpDeKQEPb2oQg6/x6nmOFmcozJ4K6 0BCsLAzvkEkF4NTi5BDjWbcAwgREjDJU6F77gS6IFNAZ41ohDVLFifRZuKv3D9YuvDyr TJIXtJdw9B6qZ2c3uxKNK2r2R3l/6n47Uj0kaFf8WX8muErav1YPZgMFhG0a4XXYyB7W BQPBA1FCNYhfqgllLETvySlmBtwL5+IKblCMiF83s+DVIeVfjAL0lrp2ctozAoWMNGiF 5+0ESFnVgttNTXm0sYEhQlsxEnL6ueE10//AN+3hfyIRp6wwxwELzdfwJNjgPHgEbs4U xAHA== X-Gm-Message-State: AOAM532hUUSk8RBreHuUZNb0AhA8XNnemAOqROhPfeHxlza43dkAaZ8a ufbMj5eO8ie3Il1Cq5L3PpgYwQ== 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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