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 CC8C4C48BC2 for ; Mon, 21 Jun 2021 14:12:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3DFF61261 for ; Mon, 21 Jun 2021 14:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230304AbhFUOOs (ORCPT ); Mon, 21 Jun 2021 10:14:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbhFUOOi (ORCPT ); Mon, 21 Jun 2021 10:14:38 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF699C06175F for ; Mon, 21 Jun 2021 07:12:19 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id g12so13484639qtb.2 for ; Mon, 21 Jun 2021 07:12:19 -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=8oJQZs0I5J7jBEQyNRVEZxX4UpsM7b71jbLdhb7hAG8=; b=FvMNMxA3fW7M2xLUZMwKYbvWPDaZY4pFbcNZf8cAZEsq+AvHkkjdBFOY2pviHteDwO C4Wu0SMltMsKCjOubP50lFxgNeNMSaZYEKEX7+OBgiaxrMgCwsV2iK7lgX8/+KZlk4J4 aF5ixG7g2CBXbZTlvfOQubAF3wyQTRyw74T4Hf0/YCR0yoYa7w3a6op9w4hFlDeDVvyE l/inPVDU6NWf0eU0BOoi/ztftjOhg9DHQyzvWKPkZf5nnfR7X6d4ilITeIR/5CPUHzeR Y5yxMVmbjISlSpxOsRA2pU1pIKL7Nm9mg1e4mEqnBLS+F4tdRuCspUjlf0CxKRwGVOjA H0Bg== 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:in-reply-to; bh=8oJQZs0I5J7jBEQyNRVEZxX4UpsM7b71jbLdhb7hAG8=; b=IoUNI4c3aOh0+itbDpj5prpDsLU9fOTJQUXmMZJcE8kmCvtJ/e4Y7z7m62Ot9zaMKr PfcxNJ0PzUyGQtgK4wHL8Bonbk7ZN5cX7M/MrsfNAn23swbxwMziHPt4j4JJPr/21Kzf eGn7b2A8KCau7J+KFF7cMvEjiHwMIRNr3ie7hXBbaBfgPmMAuuoFsCsJYnEcH4EE2pJl /U2FNBOMQflcp3g6RRMdK+tiNm0o+/K50jbAEIZYPU1j6ClYCDHbKsTKyvYvK4qh+EGR UiILfiFeepwpkh8CK5C/Acw2B/mjn1IgWNlmLRnDvxOF0oyBz/G+aQVe2yUYESeyS3nG AxSg== X-Gm-Message-State: AOAM533sw10MJK16LGl2Aqg/LXK/C5XxNjOAOYutKfCJKVTeVYof4qL9 QQljPIuLyN2fZmHsELO0l/x411zolWUp0A== X-Google-Smtp-Source: ABdhPJxB8jGNP0gwOLDPKvz+lnw80kFEjkxZj8vO8hWTPyGaIbP4EFePcOB/Ss3vtT0IcT6gYom4xg== X-Received: by 2002:ac8:5508:: with SMTP id j8mr10071894qtq.134.1624284738855; Mon, 21 Jun 2021 07:12:18 -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 r22sm10570497qtm.82.2021.06.21.07.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 07:12:18 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lvKev-009WcM-8s; Mon, 21 Jun 2021 11:12:17 -0300 Date: Mon, 21 Jun 2021 11:12:17 -0300 From: Jason Gunthorpe To: Greg KH Cc: Daniel Vetter , Oded Gabbay , linux-rdma , "open list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , "airlied@gmail.com" , Linux Kernel Mailing List , Sumit Semwal , Christian =?utf-8?B?S8O2bmln?= , Gal Pressman , sleybo@amazon.com, dri-devel , Tomer Tayar , "moderated list:DMA BUFFER SHARING FRAMEWORK" , amd-gfx list , Alex Deucher , Leon Romanovsky , Christoph Hellwig Subject: Re: [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF Message-ID: <20210621141217.GE1096940@ziepe.ca> References: <20210618123615.11456-1-ogabbay@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Mon, Jun 21, 2021 at 03:02:10PM +0200, Greg KH wrote: > On Mon, Jun 21, 2021 at 02:28:48PM +0200, Daniel Vetter wrote: > > Also I'm wondering which is the other driver that we share buffers > > with. The gaudi stuff doesn't have real struct pages as backing > > storage, it only fills out the dma_addr_t. That tends to blow up with > > other drivers, and the only place where this is guaranteed to work is > > if you have a dynamic importer which sets the allow_peer2peer flag. > > Adding maintainers from other subsystems who might want to chime in > > here. So even aside of the big question as-is this is broken. > > From what I can tell this driver is sending the buffers to other > instances of the same hardware, A dmabuf is consumed by something else in the kernel calling dma_buf_map_attachment() on the FD. What is the other side of this? I don't see any dma_buf_map_attachment() calls in drivers/misc, or added in this patch set. AFAIK the only viable in-tree other side is in mlx5 (look in umem_dmabuf.c) Though as we already talked habana has their own networking (out of tree, presumably) so I suspect this is really to support some out of tree stuff?? 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 26F94C4743C for ; Mon, 21 Jun 2021 14:12:22 +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 B1D3B6120D for ; Mon, 21 Jun 2021 14:12:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1D3B6120D 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 12F6C6E170; Mon, 21 Jun 2021 14:12:21 +0000 (UTC) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by gabe.freedesktop.org (Postfix) with ESMTPS id D2CB06E170 for ; Mon, 21 Jun 2021 14:12:19 +0000 (UTC) Received: by mail-qt1-x832.google.com with SMTP id l2so10712761qtq.10 for ; Mon, 21 Jun 2021 07:12:19 -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=8oJQZs0I5J7jBEQyNRVEZxX4UpsM7b71jbLdhb7hAG8=; b=FvMNMxA3fW7M2xLUZMwKYbvWPDaZY4pFbcNZf8cAZEsq+AvHkkjdBFOY2pviHteDwO C4Wu0SMltMsKCjOubP50lFxgNeNMSaZYEKEX7+OBgiaxrMgCwsV2iK7lgX8/+KZlk4J4 aF5ixG7g2CBXbZTlvfOQubAF3wyQTRyw74T4Hf0/YCR0yoYa7w3a6op9w4hFlDeDVvyE l/inPVDU6NWf0eU0BOoi/ztftjOhg9DHQyzvWKPkZf5nnfR7X6d4ilITeIR/5CPUHzeR Y5yxMVmbjISlSpxOsRA2pU1pIKL7Nm9mg1e4mEqnBLS+F4tdRuCspUjlf0CxKRwGVOjA H0Bg== 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:in-reply-to; bh=8oJQZs0I5J7jBEQyNRVEZxX4UpsM7b71jbLdhb7hAG8=; b=qnQhzBdspRvKT2oGiVnUG1hJnLHhPqKvA/v8Zo6t3QUC+QhFjtuWqdwBjScDKYNdLy 2API71n8rMAbPl2a7AaEMUY4gr/Zwl9KwjiAtxD8ySZrhnJRYD98E2FAVc9j3LUpfv8H QnhrRe6j5haAIiCj0z+oeYx5uuf6DQHmKhXtlllUZSoSFKlX/yXTpSbt2fiAiqFHU5aL Uqx6eTqJWd4SzjMnejxTuhCt6tlt86Iczzp+BnagPcKT4T6bgcXuaGHXyWNIviSaUgk/ fUKLjzIEXGmIgZppaFwW/atggBKT0rQc+ayCPWWOiyBbwVM73mc70CbemQd8UusHXEZY 71bA== X-Gm-Message-State: AOAM533l0JReElYo2tr7EhxVU6d04NYdU3/fGjKfdW0vUZQTNpTmFRRD O64kqlpkbGzCEwP9acCIFgAaYg== X-Google-Smtp-Source: ABdhPJxB8jGNP0gwOLDPKvz+lnw80kFEjkxZj8vO8hWTPyGaIbP4EFePcOB/Ss3vtT0IcT6gYom4xg== X-Received: by 2002:ac8:5508:: with SMTP id j8mr10071894qtq.134.1624284738855; Mon, 21 Jun 2021 07:12:18 -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 r22sm10570497qtm.82.2021.06.21.07.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 07:12:18 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lvKev-009WcM-8s; Mon, 21 Jun 2021 11:12:17 -0300 Date: Mon, 21 Jun 2021 11:12:17 -0300 From: Jason Gunthorpe To: Greg KH Subject: Re: [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF Message-ID: <20210621141217.GE1096940@ziepe.ca> References: <20210618123615.11456-1-ogabbay@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: Gal Pressman , sleybo@amazon.com, linux-rdma , Daniel Vetter , Oded Gabbay , Christoph Hellwig , Linux Kernel Mailing List , dri-devel , Christian =?utf-8?B?S8O2bmln?= , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , Tomer Tayar , amd-gfx list , Alex Deucher , Leon Romanovsky , "open list:DMA BUFFER SHARING FRAMEWORK" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Jun 21, 2021 at 03:02:10PM +0200, Greg KH wrote: > On Mon, Jun 21, 2021 at 02:28:48PM +0200, Daniel Vetter wrote: > > Also I'm wondering which is the other driver that we share buffers > > with. The gaudi stuff doesn't have real struct pages as backing > > storage, it only fills out the dma_addr_t. That tends to blow up with > > other drivers, and the only place where this is guaranteed to work is > > if you have a dynamic importer which sets the allow_peer2peer flag. > > Adding maintainers from other subsystems who might want to chime in > > here. So even aside of the big question as-is this is broken. > > From what I can tell this driver is sending the buffers to other > instances of the same hardware, A dmabuf is consumed by something else in the kernel calling dma_buf_map_attachment() on the FD. What is the other side of this? I don't see any dma_buf_map_attachment() calls in drivers/misc, or added in this patch set. AFAIK the only viable in-tree other side is in mlx5 (look in umem_dmabuf.c) Though as we already talked habana has their own networking (out of tree, presumably) so I suspect this is really to support some out of tree stuff?? 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 2ED26C4743C for ; Mon, 21 Jun 2021 14:16:53 +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 EDD246124B for ; Mon, 21 Jun 2021 14:16:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EDD246124B 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 A91696E175; Mon, 21 Jun 2021 14:16:52 +0000 (UTC) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by gabe.freedesktop.org (Postfix) with ESMTPS id D32CF6E174 for ; Mon, 21 Jun 2021 14:12:19 +0000 (UTC) Received: by mail-qt1-x832.google.com with SMTP id x21so4304642qtq.9 for ; Mon, 21 Jun 2021 07:12:19 -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=8oJQZs0I5J7jBEQyNRVEZxX4UpsM7b71jbLdhb7hAG8=; b=FvMNMxA3fW7M2xLUZMwKYbvWPDaZY4pFbcNZf8cAZEsq+AvHkkjdBFOY2pviHteDwO C4Wu0SMltMsKCjOubP50lFxgNeNMSaZYEKEX7+OBgiaxrMgCwsV2iK7lgX8/+KZlk4J4 aF5ixG7g2CBXbZTlvfOQubAF3wyQTRyw74T4Hf0/YCR0yoYa7w3a6op9w4hFlDeDVvyE l/inPVDU6NWf0eU0BOoi/ztftjOhg9DHQyzvWKPkZf5nnfR7X6d4ilITeIR/5CPUHzeR Y5yxMVmbjISlSpxOsRA2pU1pIKL7Nm9mg1e4mEqnBLS+F4tdRuCspUjlf0CxKRwGVOjA H0Bg== 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:in-reply-to; bh=8oJQZs0I5J7jBEQyNRVEZxX4UpsM7b71jbLdhb7hAG8=; b=RftGiGHDrucOV9mPtznokRvQPdzscKDcbHu05KC5jWYb07DUXAiHAc2g9Vxo+mVANW 8pRSlYlGeAQsf5FYuJpvj9alL5j5MURTkKVMke9qROpU0Bw7dNy5QG25S4cJFCizIIdc qNixQ+oJmxlmuWKJGsyabYR0Yqrn304SfOEUXXWjHcEbRDDVJBXZ2ZAK9125CkLgJztU FumY+jL4Z7s/VJZ22gxtzkXtMj+OGotPrhtFaTdhWrLX24NfoTmzyKPeqLxJCOLH9ZUN PuPqMcluGfj4PllVdYIqmp7/odgP1Ov0WzDyM/QmFTHMljHksvGY34VFTPoZbDWmaSkS W12g== X-Gm-Message-State: AOAM530n2FL1LAYB6HyAzqV8LTW15WDZ3tI7zqwJyowUcXlRdeXGtgZk 8lMS4oKsGpzA0z8jLRiAeH7h6Q== X-Google-Smtp-Source: ABdhPJxB8jGNP0gwOLDPKvz+lnw80kFEjkxZj8vO8hWTPyGaIbP4EFePcOB/Ss3vtT0IcT6gYom4xg== X-Received: by 2002:ac8:5508:: with SMTP id j8mr10071894qtq.134.1624284738855; Mon, 21 Jun 2021 07:12:18 -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 r22sm10570497qtm.82.2021.06.21.07.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 07:12:18 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lvKev-009WcM-8s; Mon, 21 Jun 2021 11:12:17 -0300 Date: Mon, 21 Jun 2021 11:12:17 -0300 From: Jason Gunthorpe To: Greg KH Subject: Re: [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF Message-ID: <20210621141217.GE1096940@ziepe.ca> References: <20210618123615.11456-1-ogabbay@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Mon, 21 Jun 2021 14:16:51 +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: Gal Pressman , sleybo@amazon.com, linux-rdma , Daniel Vetter , Oded Gabbay , Christoph Hellwig , Linux Kernel Mailing List , dri-devel , Christian =?utf-8?B?S8O2bmln?= , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , Tomer Tayar , amd-gfx list , Alex Deucher , "airlied@gmail.com" , Sumit Semwal , Leon Romanovsky , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Mon, Jun 21, 2021 at 03:02:10PM +0200, Greg KH wrote: > On Mon, Jun 21, 2021 at 02:28:48PM +0200, Daniel Vetter wrote: > > Also I'm wondering which is the other driver that we share buffers > > with. The gaudi stuff doesn't have real struct pages as backing > > storage, it only fills out the dma_addr_t. That tends to blow up with > > other drivers, and the only place where this is guaranteed to work is > > if you have a dynamic importer which sets the allow_peer2peer flag. > > Adding maintainers from other subsystems who might want to chime in > > here. So even aside of the big question as-is this is broken. > > From what I can tell this driver is sending the buffers to other > instances of the same hardware, A dmabuf is consumed by something else in the kernel calling dma_buf_map_attachment() on the FD. What is the other side of this? I don't see any dma_buf_map_attachment() calls in drivers/misc, or added in this patch set. AFAIK the only viable in-tree other side is in mlx5 (look in umem_dmabuf.c) Though as we already talked habana has their own networking (out of tree, presumably) so I suspect this is really to support some out of tree stuff?? Jason _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx