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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 219E8C2B9F4 for ; Tue, 22 Jun 2021 15:40:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 05F9B6135D for ; Tue, 22 Jun 2021 15:40:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231680AbhFVPmy (ORCPT ); Tue, 22 Jun 2021 11:42:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232331AbhFVPmp (ORCPT ); Tue, 22 Jun 2021 11:42:45 -0400 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41657C0617AF for ; Tue, 22 Jun 2021 08:40:29 -0700 (PDT) Received: by mail-qt1-x82d.google.com with SMTP id d5so1624644qtd.5 for ; Tue, 22 Jun 2021 08:40:29 -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:content-transfer-encoding:in-reply-to; bh=NZpdOHQdlbhRQUdadvChaP2QioJ6XoeMWnvncTZxFBo=; b=bFrrHAW8qxNFpB4w6q6y0m3wG93Brg5eP/2CDB60bxAwrbV9T0MwsuqH9FqvvIRVEl azco9BZHD+pLNHUOUPd0/YqiC7g1TkaOLuSEdEPEQsK/HsRy3mej/q89Q1WOFE2N+Ro6 7RjC3KVHi7qrQ6NaRAxH4v7ueHDnYI6mNr/5488SwgmJEmoF0yDk72Gp1+3yt3X1dN77 SwYTmPDOKjoJcVDChtw4TAWYHg4XwJrbCQOByfoyvt7j1+S/eNeqEnvPfIhPHwupoX/C fllP05M4t8g69iCpBGPz31XolXRyxDJerhlIIoTtJYVOwqMlMtDxL7QTh8S+XznoKv7T C9Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=NZpdOHQdlbhRQUdadvChaP2QioJ6XoeMWnvncTZxFBo=; b=OEWROWq28zDm+arwNtRf1c3iSuJ3Mng4HVYe+mMog4mpKvryqPw74kRadtTGygah/B Dt/gVttELXNPNbwTeceg4jC5vLaSitfnpZ94An/RQ9EoBwfQNktEq9DjY1IhqSbYZ9W+ Ud2CxWPpdjZnW0GQvpQbAcZbx+e9BnE+dMgdfBVKsXNxgJfwN7rmqswcuwkBWHHWOYNH Zzk3TeYoBY5qbnFzNhUTrcGkeY84J0prYcxRzd5+L+4XIPiRI2C+i+Z1LuF35ljZYk3D EOcWuXc6dOa3gIyQ65UTl5OYysHjsZ87sJ0OQB+AdPUGhXaZASjo8ElWqo3S3+z8xcmo Ekrw== X-Gm-Message-State: AOAM531Q3REFCuGN4/7fjoXMuPInu5K1mvj8semCvbfrSWv1DfC6vNcQ zs1OMnkJQY0mfa8uuDrGzZiKSg== X-Google-Smtp-Source: ABdhPJyBSBJ8ZnJGYH0mWoGpKu8dUURIzu/dEy/gWK1x7lcbRKJ6NR08GtWZTYux23s4RPq5jOQChQ== X-Received: by 2002:ac8:4241:: with SMTP id r1mr4000088qtm.121.1624376428220; Tue, 22 Jun 2021 08:40:28 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-47-55-113-94.dhcp-dynamic.fibreop.ns.bellaliant.net. [47.55.113.94]) by smtp.gmail.com with ESMTPSA id y18sm1761588qtj.53.2021.06.22.08.40.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 08:40:27 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lviVn-00ADW0-73; Tue, 22 Jun 2021 12:40:27 -0300 Date: Tue, 22 Jun 2021 12:40:27 -0300 From: Jason Gunthorpe To: Christian =?utf-8?B?S8O2bmln?= Cc: Oded Gabbay , Christian =?utf-8?B?S8O2bmln?= , Gal Pressman , sleybo@amazon.com, linux-rdma , Oded Gabbay , Christoph Hellwig , Linux Kernel Mailing List , dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , Tomer Tayar , amd-gfx list , Greg KH , Alex Deucher , Leon Romanovsky , "open list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [Linaro-mm-sig] [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF Message-ID: <20210622154027.GS1096940@ziepe.ca> References: <20210621175511.GI1096940@ziepe.ca> <20210621232912.GK1096940@ziepe.ca> <20210622120142.GL1096940@ziepe.ca> <20210622152343.GO1096940@ziepe.ca> <3fabe8b7-7174-bf49-5ffe-26db30968a27@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3fabe8b7-7174-bf49-5ffe-26db30968a27@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Tue, Jun 22, 2021 at 05:29:01PM +0200, Christian König wrote: > Am 22.06.21 um 17:23 schrieb Jason Gunthorpe: > > On Tue, Jun 22, 2021 at 02:23:03PM +0200, Christian König wrote: > > > Am 22.06.21 um 14:01 schrieb Jason Gunthorpe: > > > > On Tue, Jun 22, 2021 at 11:42:27AM +0300, Oded Gabbay wrote: > > > > > On Tue, Jun 22, 2021 at 9:37 AM Christian König > > > > > wrote: > > > > > > Am 22.06.21 um 01:29 schrieb Jason Gunthorpe: > > > > > > > On Mon, Jun 21, 2021 at 10:24:16PM +0300, Oded Gabbay wrote: > > > > > > > > > > > > > > > Another thing I want to emphasize is that we are doing p2p only > > > > > > > > through the export/import of the FD. We do *not* allow the user to > > > > > > > > mmap the dma-buf as we do not support direct IO. So there is no access > > > > > > > > to these pages through the userspace. > > > > > > > Arguably mmaping the memory is a better choice, and is the direction > > > > > > > that Logan's series goes in. Here the use of DMABUF was specifically > > > > > > > designed to allow hitless revokation of the memory, which this isn't > > > > > > > even using. > > > > > > The major problem with this approach is that DMA-buf is also used for > > > > > > memory which isn't CPU accessible. > > > > That isn't an issue here because the memory is only intended to be > > > > used with P2P transfers so it must be CPU accessible. > > > No, especially P2P is often done on memory resources which are not even > > > remotely CPU accessible. > > That is a special AMD thing, P2P here is PCI P2P and all PCI memory is > > CPU accessible. > > No absolutely not. NVidia GPUs work exactly the same way. > > And you have tons of similar cases in embedded and SoC systems where > intermediate memory between devices isn't directly addressable with the CPU. None of that is PCI P2P. It is all some specialty direct transfer. You can't reasonably call dma_map_resource() on non CPU mapped memory for instance, what address would you pass? Do not confuse "I am doing transfers between two HW blocks" with PCI Peer to Peer DMA transfers - the latter is a very narrow subcase. > No, just using the dma_map_resource() interface. Ik, but yes that does "work". Logan's series is better. > > > > > I'll go and read Logan's patch-set to see if that will work for us in > > > > > the future. Please remember, as Daniel said, we don't have struct page > > > > > backing our device memory, so if that is a requirement to connect to > > > > > Logan's work, then I don't think we will want to do it at this point. > > > > It is trivial to get the struct page for a PCI BAR. > > > Yeah, but it doesn't make much sense. Why should we create a struct page for > > > something that isn't even memory in a lot of cases? > > Because the iommu and other places need this handle to setup their > > stuff. Nobody has yet been brave enough to try to change those flows > > to be able to use a physical CPU address. > > Well that is certainly not true. I'm just not sure if that works with all > IOMMU drivers thought. Huh? All the iommu interfaces except for the dma_map_resource() are struct page based. dma_map_resource() is slow ad limited in what it can do. Jason 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 56AF0C2B9F4 for ; Tue, 22 Jun 2021 15:40:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 0C62B61374 for ; Tue, 22 Jun 2021 15:40:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C62B61374 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 91DDE6E5B0; Tue, 22 Jun 2021 15:40:30 +0000 (UTC) Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by gabe.freedesktop.org (Postfix) with ESMTPS id 244FB6E5B0 for ; Tue, 22 Jun 2021 15:40:29 +0000 (UTC) Received: by mail-qt1-x835.google.com with SMTP id t9so16321564qtw.7 for ; Tue, 22 Jun 2021 08:40:29 -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:content-transfer-encoding:in-reply-to; bh=NZpdOHQdlbhRQUdadvChaP2QioJ6XoeMWnvncTZxFBo=; b=bFrrHAW8qxNFpB4w6q6y0m3wG93Brg5eP/2CDB60bxAwrbV9T0MwsuqH9FqvvIRVEl azco9BZHD+pLNHUOUPd0/YqiC7g1TkaOLuSEdEPEQsK/HsRy3mej/q89Q1WOFE2N+Ro6 7RjC3KVHi7qrQ6NaRAxH4v7ueHDnYI6mNr/5488SwgmJEmoF0yDk72Gp1+3yt3X1dN77 SwYTmPDOKjoJcVDChtw4TAWYHg4XwJrbCQOByfoyvt7j1+S/eNeqEnvPfIhPHwupoX/C fllP05M4t8g69iCpBGPz31XolXRyxDJerhlIIoTtJYVOwqMlMtDxL7QTh8S+XznoKv7T C9Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=NZpdOHQdlbhRQUdadvChaP2QioJ6XoeMWnvncTZxFBo=; b=jZaifJGjz7tNtInmzorITNwuMhZ4zSYjpsiFCMjVFvWUHXEgYvV8SVf0GFRjtMZsV8 vvcYw+9coQnFK9J+D4jARrYMbrS0T2YDhsm0GLYlCICGkhyAymh2SgFZ7ID7gKnKNNqv AxjVgkhXyiojb15bx79BZv0tJqX7He9sW12H7KmJUuKjEBCBGk8Ux8LEUOh3wXDw85Ci ZqzOkko9CEPQS834jDz8TjMBxnpV/4BEPZMCzihFbTMoPmEzfnixwJZgq3Er8XgUXzwo DgOlTY9MyKnIiNi15PT+tH4HHI/6HXS8IsPsPn183ZuX/O0KisYHLcvYD8iDLSAFQVZr d6uw== X-Gm-Message-State: AOAM533x4S4bD90BkVSc6cKswKCrAGG8slZEvjc0xYaw7hpLIO/DnAWD Jg1Y0yBB2WXdxSTpdvYo7u9Xig== X-Google-Smtp-Source: ABdhPJyBSBJ8ZnJGYH0mWoGpKu8dUURIzu/dEy/gWK1x7lcbRKJ6NR08GtWZTYux23s4RPq5jOQChQ== X-Received: by 2002:ac8:4241:: with SMTP id r1mr4000088qtm.121.1624376428220; Tue, 22 Jun 2021 08:40:28 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-47-55-113-94.dhcp-dynamic.fibreop.ns.bellaliant.net. [47.55.113.94]) by smtp.gmail.com with ESMTPSA id y18sm1761588qtj.53.2021.06.22.08.40.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 08:40:27 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lviVn-00ADW0-73; Tue, 22 Jun 2021 12:40:27 -0300 Date: Tue, 22 Jun 2021 12:40:27 -0300 From: Jason Gunthorpe To: Christian =?utf-8?B?S8O2bmln?= Subject: Re: [Linaro-mm-sig] [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF Message-ID: <20210622154027.GS1096940@ziepe.ca> References: <20210621175511.GI1096940@ziepe.ca> <20210621232912.GK1096940@ziepe.ca> <20210622120142.GL1096940@ziepe.ca> <20210622152343.GO1096940@ziepe.ca> <3fabe8b7-7174-bf49-5ffe-26db30968a27@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3fabe8b7-7174-bf49-5ffe-26db30968a27@amd.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rdma , Christian =?utf-8?B?S8O2bmln?= , sleybo@amazon.com, Gal Pressman , dri-devel , Christoph Hellwig , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , Tomer Tayar , amd-gfx list , Greg KH , Alex Deucher , Leon Romanovsky , Oded Gabbay , Linux Kernel Mailing List , "open list:DMA BUFFER SHARING FRAMEWORK" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Jun 22, 2021 at 05:29:01PM +0200, Christian König wrote: > Am 22.06.21 um 17:23 schrieb Jason Gunthorpe: > > On Tue, Jun 22, 2021 at 02:23:03PM +0200, Christian König wrote: > > > Am 22.06.21 um 14:01 schrieb Jason Gunthorpe: > > > > On Tue, Jun 22, 2021 at 11:42:27AM +0300, Oded Gabbay wrote: > > > > > On Tue, Jun 22, 2021 at 9:37 AM Christian König > > > > > wrote: > > > > > > Am 22.06.21 um 01:29 schrieb Jason Gunthorpe: > > > > > > > On Mon, Jun 21, 2021 at 10:24:16PM +0300, Oded Gabbay wrote: > > > > > > > > > > > > > > > Another thing I want to emphasize is that we are doing p2p only > > > > > > > > through the export/import of the FD. We do *not* allow the user to > > > > > > > > mmap the dma-buf as we do not support direct IO. So there is no access > > > > > > > > to these pages through the userspace. > > > > > > > Arguably mmaping the memory is a better choice, and is the direction > > > > > > > that Logan's series goes in. Here the use of DMABUF was specifically > > > > > > > designed to allow hitless revokation of the memory, which this isn't > > > > > > > even using. > > > > > > The major problem with this approach is that DMA-buf is also used for > > > > > > memory which isn't CPU accessible. > > > > That isn't an issue here because the memory is only intended to be > > > > used with P2P transfers so it must be CPU accessible. > > > No, especially P2P is often done on memory resources which are not even > > > remotely CPU accessible. > > That is a special AMD thing, P2P here is PCI P2P and all PCI memory is > > CPU accessible. > > No absolutely not. NVidia GPUs work exactly the same way. > > And you have tons of similar cases in embedded and SoC systems where > intermediate memory between devices isn't directly addressable with the CPU. None of that is PCI P2P. It is all some specialty direct transfer. You can't reasonably call dma_map_resource() on non CPU mapped memory for instance, what address would you pass? Do not confuse "I am doing transfers between two HW blocks" with PCI Peer to Peer DMA transfers - the latter is a very narrow subcase. > No, just using the dma_map_resource() interface. Ik, but yes that does "work". Logan's series is better. > > > > > I'll go and read Logan's patch-set to see if that will work for us in > > > > > the future. Please remember, as Daniel said, we don't have struct page > > > > > backing our device memory, so if that is a requirement to connect to > > > > > Logan's work, then I don't think we will want to do it at this point. > > > > It is trivial to get the struct page for a PCI BAR. > > > Yeah, but it doesn't make much sense. Why should we create a struct page for > > > something that isn't even memory in a lot of cases? > > Because the iommu and other places need this handle to setup their > > stuff. Nobody has yet been brave enough to try to change those flows > > to be able to use a physical CPU address. > > Well that is certainly not true. I'm just not sure if that works with all > IOMMU drivers thought. Huh? All the iommu interfaces except for the dma_map_resource() are struct page based. dma_map_resource() is slow ad limited in what it can do. Jason 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, URIBL_BLOCKED autolearn=no 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 62632C49EA2 for ; Tue, 22 Jun 2021 17:14:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 17C4C61166 for ; Tue, 22 Jun 2021 17:14:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 17C4C61166 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D80556E867; Tue, 22 Jun 2021 17:14:00 +0000 (UTC) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 359306E5B2 for ; Tue, 22 Jun 2021 15:40:29 +0000 (UTC) Received: by mail-qt1-x82b.google.com with SMTP id r20so16377363qtp.3 for ; Tue, 22 Jun 2021 08:40:28 -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:content-transfer-encoding:in-reply-to; bh=NZpdOHQdlbhRQUdadvChaP2QioJ6XoeMWnvncTZxFBo=; b=bFrrHAW8qxNFpB4w6q6y0m3wG93Brg5eP/2CDB60bxAwrbV9T0MwsuqH9FqvvIRVEl azco9BZHD+pLNHUOUPd0/YqiC7g1TkaOLuSEdEPEQsK/HsRy3mej/q89Q1WOFE2N+Ro6 7RjC3KVHi7qrQ6NaRAxH4v7ueHDnYI6mNr/5488SwgmJEmoF0yDk72Gp1+3yt3X1dN77 SwYTmPDOKjoJcVDChtw4TAWYHg4XwJrbCQOByfoyvt7j1+S/eNeqEnvPfIhPHwupoX/C fllP05M4t8g69iCpBGPz31XolXRyxDJerhlIIoTtJYVOwqMlMtDxL7QTh8S+XznoKv7T C9Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=NZpdOHQdlbhRQUdadvChaP2QioJ6XoeMWnvncTZxFBo=; b=QB+FgT+ZcFvGtAzhu8Vs9VCzWF2EU88JC/TNHHWeetT3gzrZBCDCEXMup8ZKJmgwll 1bB+eZjC9m8ns7BsXbep8RifbGijM+aiEL3IlYkdopoWzQ97NUN2JeW9D2OajwJIEt44 OutvPVn8Kj5gEO/O3r7rsqi1k6dno/WilCINWDCC/73Joto5+a/GebJMXElYDRqXvQPJ OisC2F8qkQS4vfaJWz+JZumCX6AdnITF7HMo8D/CmRM/AZ2riJlMNivJrC0hK9w1du74 g4tMcRAu+Z3vW4qwT+uFcGAa0zDHhXWf30VPAqp/PHjYBA28iEvKjNoI6saxtYAXKITN D1hw== X-Gm-Message-State: AOAM532tMU3NT5TC4/c2wmEfuFzlGB7KuOgDe5Y9F0JhPpH07PucM9CI 4GhDbhoHWPkisG0YGmls2fPblw== X-Google-Smtp-Source: ABdhPJyBSBJ8ZnJGYH0mWoGpKu8dUURIzu/dEy/gWK1x7lcbRKJ6NR08GtWZTYux23s4RPq5jOQChQ== X-Received: by 2002:ac8:4241:: with SMTP id r1mr4000088qtm.121.1624376428220; Tue, 22 Jun 2021 08:40:28 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-47-55-113-94.dhcp-dynamic.fibreop.ns.bellaliant.net. [47.55.113.94]) by smtp.gmail.com with ESMTPSA id y18sm1761588qtj.53.2021.06.22.08.40.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 08:40:27 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lviVn-00ADW0-73; Tue, 22 Jun 2021 12:40:27 -0300 Date: Tue, 22 Jun 2021 12:40:27 -0300 From: Jason Gunthorpe To: Christian =?utf-8?B?S8O2bmln?= Subject: Re: [Linaro-mm-sig] [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF Message-ID: <20210622154027.GS1096940@ziepe.ca> References: <20210621175511.GI1096940@ziepe.ca> <20210621232912.GK1096940@ziepe.ca> <20210622120142.GL1096940@ziepe.ca> <20210622152343.GO1096940@ziepe.ca> <3fabe8b7-7174-bf49-5ffe-26db30968a27@amd.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3fabe8b7-7174-bf49-5ffe-26db30968a27@amd.com> X-Mailman-Approved-At: Tue, 22 Jun 2021 17:13:59 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oded Gabbay , linux-rdma , Christian =?utf-8?B?S8O2bmln?= , sleybo@amazon.com, Gal Pressman , dri-devel , Christoph Hellwig , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , Tomer Tayar , amd-gfx list , Greg KH , Alex Deucher , Leon Romanovsky , Oded Gabbay , Linux Kernel Mailing List , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" T24gVHVlLCBKdW4gMjIsIDIwMjEgYXQgMDU6Mjk6MDFQTSArMDIwMCwgQ2hyaXN0aWFuIEvDtm5p ZyB3cm90ZToKPiBBbSAyMi4wNi4yMSB1bSAxNzoyMyBzY2hyaWViIEphc29uIEd1bnRob3JwZToK PiA+IE9uIFR1ZSwgSnVuIDIyLCAyMDIxIGF0IDAyOjIzOjAzUE0gKzAyMDAsIENocmlzdGlhbiBL w7ZuaWcgd3JvdGU6Cj4gPiA+IEFtIDIyLjA2LjIxIHVtIDE0OjAxIHNjaHJpZWIgSmFzb24gR3Vu dGhvcnBlOgo+ID4gPiA+IE9uIFR1ZSwgSnVuIDIyLCAyMDIxIGF0IDExOjQyOjI3QU0gKzAzMDAs IE9kZWQgR2FiYmF5IHdyb3RlOgo+ID4gPiA+ID4gT24gVHVlLCBKdW4gMjIsIDIwMjEgYXQgOToz NyBBTSBDaHJpc3RpYW4gS8O2bmlnCj4gPiA+ID4gPiA8Y2tvZW5pZy5sZWljaHR6dW1lcmtlbkBn bWFpbC5jb20+IHdyb3RlOgo+ID4gPiA+ID4gPiBBbSAyMi4wNi4yMSB1bSAwMToyOSBzY2hyaWVi IEphc29uIEd1bnRob3JwZToKPiA+ID4gPiA+ID4gPiBPbiBNb24sIEp1biAyMSwgMjAyMSBhdCAx MDoyNDoxNlBNICswMzAwLCBPZGVkIEdhYmJheSB3cm90ZToKPiA+ID4gPiA+ID4gPiAKPiA+ID4g PiA+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