Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4015062pxj; Mon, 21 Jun 2021 11:29:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/vnWJwBfX5e/8MH1d5Nk0MOrkt2iQFZqSVsLnoi2tq7PhlyHTcXlFLr/G1sMPmxAf0W0U X-Received: by 2002:a92:7a07:: with SMTP id v7mr9088286ilc.224.1624300147215; Mon, 21 Jun 2021 11:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624300147; cv=none; d=google.com; s=arc-20160816; b=bRG3WOedVvBAu0lcbsdtN3iEmSobcqC9othxNHrF866X3ExpTDHM5UD8Mcw/Q6xVrX fAIWGn7eRaVc677tfcp0iB0bSx3lImEBlfX5F8s2jrs2Zr+iNxA38pGJKOZrO0wiAub4 MTUkuRWTYbvSvKfZGboDWPGW89p1kjMmCqGIn8T9IsTNOLs2pC59mczvHkmfJ/HptXuD P7Wr2ixSZXK8mhrHQzS9dEd/9YHpS9BhnBAmnvQHGGzpE0eWKCBe4pIEGoWPNkjEL1tf y4gFH2WaVqg6x6KoZXy2Mm72Ue4FqyJIwLEzsVW95HQKXwNS4Au7/bpN9AC3smY4JS/r LvEA== 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=O9i28EclvSZx+uiFhNgb+3CTRZV2qMxp0Q3wXipsI8Q=; b=WntyGEFyeZdCC2tqhhE8dsVzZ2eDDprTT2i6FF31yEFdx9z6JFmhQxZzU+kdhvDaeb VFOS35BlPII9Tao6MbSSbHGHbXtzYYwZfynNdtiSato9QhzSl1/kHgyU1+h0vWFCVTxf fDPCTHoE1ECeTvvCACzba90ewjg+B/kSf7aEnBCACPpidWINUDKsbv6yACbxsgFwqRwN TkDjm5uJYEHhGOETjKBkqAumBGH/YJpPlVNQ1vhN0VMnYd9HhmQrpVp+NY57hd6K5zyi 7O7N9xP49OEDf7xG0vDQ2pmcv5Ma4oddzOxSBOlf0aP8HZj8LulGx+NdUwlyDbYa+v3g xM9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=K0UUo78v; 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 n17si21195310iod.6.2021.06.21.11.28.53; Mon, 21 Jun 2021 11:29:07 -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=@ffwll.ch header.s=google header.b=K0UUo78v; 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 S231725AbhFUSaB (ORCPT + 99 others); Mon, 21 Jun 2021 14:30:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231740AbhFUS37 (ORCPT ); Mon, 21 Jun 2021 14:29:59 -0400 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 891F7C061574 for ; Mon, 21 Jun 2021 11:27:45 -0700 (PDT) Received: by mail-oi1-x236.google.com with SMTP id m137so20917132oig.6 for ; Mon, 21 Jun 2021 11:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O9i28EclvSZx+uiFhNgb+3CTRZV2qMxp0Q3wXipsI8Q=; b=K0UUo78vVrHTzSDrMgj0jT+MLT+AozMScbVhmJ6rhysrPfzfwQKb0T9CTxpGrXfVIc t5jj9sX3IfqrbDRI8CthGXRxYKpUQX+02UsBeDhQ6gGIxzzzrj03gPnZr1/CyOuvjIls QcmPSnajwhf1oF905MYpKHACKSXHp6adH5P4U= 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=O9i28EclvSZx+uiFhNgb+3CTRZV2qMxp0Q3wXipsI8Q=; b=cxkwj+Ix16rPgPB0XbghgchJ1A65OKvsxzoKzWLeQZwKk2QdICDnegPVJYNDixnqqt 96SJaVaEHf8Pw+47HNAqDKtjeg28mWGJG0gVUe7YYOY7wn9CAZgJKn57b2Mbxg1X2GXz cdXrwxqyym3gZNz0OlOfJB2P9kBk7ZLy91Dbkea2H4B5qxo6jxla5f+oM66KVSsesFCN Yhz0Kxej30U8GnhckeGfqNgOmzy4UhMJvbwt710SYER61vla48GL+4Kqj1+8OPWJvies kQ8rHeSryDxF+k4zD25Wp2VfV41whCSyi9xP/0xPNyyRTdlHsAdtLXDz5BEDRasg2WxA FWdQ== X-Gm-Message-State: AOAM5331GzED7n5i7jX4o9PIB49oA4nxI/Jka6QJPUFADZ/qFv9yj5I/ qJfTVwfIXuCyesaEugCBA3S7+RdE7ZxbJvbr2jra6A== X-Received: by 2002:a54:4889:: with SMTP id r9mr11213515oic.101.1624300063935; Mon, 21 Jun 2021 11:27:43 -0700 (PDT) MIME-Version: 1.0 References: <20210618123615.11456-1-ogabbay@kernel.org> <20210621141217.GE1096940@ziepe.ca> <20210621175511.GI1096940@ziepe.ca> In-Reply-To: <20210621175511.GI1096940@ziepe.ca> From: Daniel Vetter Date: Mon, 21 Jun 2021 20:27:32 +0200 Message-ID: Subject: Re: [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF To: Jason Gunthorpe Cc: Oded Gabbay , Greg KH , 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 7:55 PM Jason Gunthorpe wrote: > On Mon, Jun 21, 2021 at 07:26:14PM +0300, Oded Gabbay wrote: > > 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". > > It raises the question of how you are testing this if you aren't using > it with the only intree driver: mlx5. For p2p dma-buf there's also amdgpu as a possible in-tree candiate driver, that's why I added amdgpu folks. Otoh I'm not aware of AI+GPU combos being much in use, at least with upstream gpu drivers (nvidia blob is a different story ofc, but I don't care what they do in their own world). -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch