Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3945120pxj; Mon, 21 Jun 2021 09:56:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRlduoH8hF92JaO8NZx/3pQ38WnuoPcbiWTzwlvpTZsl4bwSjIjHmvZ9YI8zptk/Gq87AK X-Received: by 2002:a17:906:a0d3:: with SMTP id bh19mr25984780ejb.205.1624294608846; Mon, 21 Jun 2021 09:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624294608; cv=none; d=google.com; s=arc-20160816; b=oHQBephOECFtL54LYTHSk8mjZXxdJpRONufgHqp5mDEpmyvwj241aDmIkgS7rrAOH8 dsIiSGhTFMv1Be/lOV1Ad+ODq2gKf8m9BK+g6B4hkySTOpgfRHt3/WSxjJ47cjil2Q8X BYcs66hITsVTn5HvsVx94yyGBYcgd1Hw+S9QGrCp+WoDtGvPwkEBsTEk64MikYPn9w+c m/b9ZRb0EH55n6N6od7Aej7AErlVGDzT350QRTInDsJDrPEEJhtDho93oLYrznNnvLGR xv+Z8Byj+D6ptmAe6Wql8SkdqKrZRILYMvEDKm5SLrRp5wf7m6c7TDcUWPbCfJa4OXuq ioTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yoCwDUxZJP3Ut8z/hr4sZH2+48UBBB2zck9Vy5dLtgU=; b=IYehlHsraDmPrTWRMrZFvZXilkHPhz1sDv7IXhbKiIBNkP4lGYLA6crF5i+P9FHXKq 5V27rwdo6jzK3jTrWhk2gutAlARagXxmkWCsbD+0QWQr6R7NsBA3jruc+yic59EjFg1Z ry3xjtO6DSP2tpYn5rE70oG0H9a1rN+Q1StIxUv/KKEbzGs6I9sdRs9ArDxIL5ucOQx3 bgNl/abaXaO5GcOt8uDelO6CxLqZjdK5bcJg+hsWH9m+XmfF80WfRRQI+3afGHuSDmb9 l5DJgZ9dHoaeWCjQLKSVwWrSODsk80yol2sVVnNlF5nREeuMNcG/G0Pj/T23DHa4nZ/O Lglg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pM+MoLSU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i14si12435189eje.489.2021.06.21.09.56.25; Mon, 21 Jun 2021 09:56:48 -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=@gmail.com header.s=20161025 header.b=pM+MoLSU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232779AbhFUQ5v (ORCPT + 99 others); Mon, 21 Jun 2021 12:57:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233499AbhFUQ4o (ORCPT ); Mon, 21 Jun 2021 12:56:44 -0400 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ABB5C09B05B; Mon, 21 Jun 2021 09:26:38 -0700 (PDT) Received: by mail-ot1-x329.google.com with SMTP id g19-20020a9d12930000b0290457fde18ad0so4417845otg.1; Mon, 21 Jun 2021 09:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yoCwDUxZJP3Ut8z/hr4sZH2+48UBBB2zck9Vy5dLtgU=; b=pM+MoLSU0LSJh98DQrRsTPmTh+95pmfRHHbTmKcyhP9ovDKRhZcvBC02S/55ftG/og ruYrldynFgVUzXcJ5cpWd8IKQzedGdpH4I+1WfQpqdIufPWiWf72S0LDFysmflufYM4y 4wEreRKEOPdT1VnnTfvE5bFAmShhQkzdbAuUs7Mj25c7MYRwZ3OzmCVuPeHzDrwJTziw rDSCsQLsvjXiYpI4vGyZmIa5HkJhW6dIjnKxwkKEFk6v9qnpGL7nodqGKszpOHNAzcK7 CHo/Eex5i6JrEqmb0tCi7M7hZujczlekBuIR9iw4PZd+ucMGW5rl9ynK99eEaKLIYyZD Yulg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yoCwDUxZJP3Ut8z/hr4sZH2+48UBBB2zck9Vy5dLtgU=; b=aZ3mam2bc6fZtI/oiZtfbZ08v2dsF0LIzdq/vTRGPbzu/RxfVvSwuiOsqpEPOCnWPu pgzEhKtbDGCX08hcrn/mfGKRvOfwhYZnzvcszOf9lWv+fjDAdLcw9PTx0+lyzvnCka6n 8JuEDGQ7AeNYU3EisxnJrjgtfBMfNdLpVICCiliLr/q7gYYzR+GbG3LpwZ92+LiVWVER bqbZGLsg5YIdtKWfdcvNZtmcunNCR1KGxtsZ/sOEOSwffUt0iV8szH8+l9FP9mW5iyPL TBFN579YUbQuzJuQCRKsx60XjaKkbcoEwXlWKsQyWqFhi+NLQhIEEx4aSjpkzlnxnhSD PDPQ== X-Gm-Message-State: AOAM533faXcsOwUwcsHz4H7u3JUbTbX/pEDDoZOC2sIqZdOOnY++cQQ5 4vEtU8CtFwDxeJ5wUvcKBosPTGG6z6jVO9r7aZ8= X-Received: by 2002:a9d:4581:: with SMTP id x1mr22307079ote.145.1624292797889; Mon, 21 Jun 2021 09:26:37 -0700 (PDT) MIME-Version: 1.0 References: <20210618123615.11456-1-ogabbay@kernel.org> <20210621141217.GE1096940@ziepe.ca> In-Reply-To: <20210621141217.GE1096940@ziepe.ca> From: Oded Gabbay Date: Mon, 21 Jun 2021 19:26:14 +0300 Message-ID: Subject: Re: [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF To: Jason Gunthorpe Cc: Greg KH , Daniel Vetter , Oded Gabbay , linux-rdma , "open list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , "airlied@gmail.com" , Linux Kernel Mailing List , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Gal Pressman , sleybo@amazon.com, dri-devel , Tomer Tayar , "moderated list:DMA BUFFER SHARING FRAMEWORK" , amd-gfx list , Alex Deucher , Leon Romanovsky , Christoph Hellwig Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 21, 2021 at 5:12 PM Jason Gunthorpe wrote: > > 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. This patch-set is only to enable the support for the exporter side. The "other side" is any generic RDMA networking device that will want to perform p2p communication over PCIe with our GAUDI accelerator. An example is indeed the mlnx5 card which has already integrated support for being an "importer". This is *not* used for communication with another GAUDI device. If I want to communicate with another GAUDI device, our userspace communications library will use our internal network links, without any need for dma-buf. Oded > > 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