Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4727760pxv; Tue, 6 Jul 2021 07:48:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP9QeGqjo0nwJRUilP5MERiHpBbf9DZKH8J5oChYFdLFy0fgOAAAKY5jvNu78KqBPf9Ud9 X-Received: by 2002:a17:907:2d29:: with SMTP id gs41mr18787110ejc.404.1625582917132; Tue, 06 Jul 2021 07:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625582917; cv=none; d=google.com; s=arc-20160816; b=eak+NpQMmFtt8hzKHSQlXXg+j3w/CyW/Z8WoA3cCQq8ixacSQjJ82R+YWXbtJsP5ci Jh66SITqftTaVbT0mSl2JXa0GH/PWapFSODHbyf4QiBc9YuiraD8C5sTYqLwoea+xYbR Cv+RsApW5K3epDY5R/Tep0EHdJjTlfkkUiiXdVdP4Yiw3aV7ZzfsrwlEn1pn1vHLBUxS SMLSQikB9S86/7fAS0qC3j8K3Wx4f2oIkai0qbKDI0vhRPlGhvoRy/0hKg7mlEIuYb/k ubHWE6ZZ+7U1Z4GJ4DVVRq1RAs/sTNX+Tjk7IM2GTQ2Sk0cQk5m+2QNk2eg6Rr3l10e3 +vJA== 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=oa36JT6ZXXdeNbOW7MRMPItJC85KRkSUT3t0lipsRGE=; b=et2AVUJ8wGtSa7dh/g8bUAryB7yl9azRIGSXAQie6AULMA122dUVLx3N6XvcuVLHWY NN+zZUSce4p0h2/EUP6RwWOGVTaTBUIs3Gw1rgl1O3RYB2E57SavnwT55F4Qcg8g5wPV yI7GdLrU2kEPSSYLzOChOKsFECBBIdnaWJHLjBrNrAKmVM6sQEcC6sp05tjk+2u9bA2d 6hfHqubH3cgLD+xl88iG9aAZX5snUc88HEhwlq4DIV2kr0cEJXFjqf20cUgtrhOLNm40 x/IWJm6UFMRyAcDMGUKxDJcmTzPdqp/ODQfnfREolmP5SHeaNgLW4P/kn18XRVdCpHse YNEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=I3PSWk0q; 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 bo20si15240827edb.17.2021.07.06.07.48.10; Tue, 06 Jul 2021 07:48:37 -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=I3PSWk0q; 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 S232058AbhGFOtw (ORCPT + 99 others); Tue, 6 Jul 2021 10:49:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231877AbhGFOtv (ORCPT ); Tue, 6 Jul 2021 10:49:51 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11428C0613A9 for ; Tue, 6 Jul 2021 07:47:13 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id r132so6654183yba.5 for ; Tue, 06 Jul 2021 07:47:13 -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=oa36JT6ZXXdeNbOW7MRMPItJC85KRkSUT3t0lipsRGE=; b=I3PSWk0qdtLFBmphAZxkzdBLbBanHnSZ0lDy0Hh/Ww45NThwfPWgOKeOhk0qySlDno N76byVhIjKXABiEeqkETac6DodkM4w9tLHdTxMThwhYfWv577ISzp1xMGs578F8PpfZ1 q9Lvgwe7Uqz9k9WBl4dQSoOJQ0Uhiw8dS3XsY= 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=oa36JT6ZXXdeNbOW7MRMPItJC85KRkSUT3t0lipsRGE=; b=nChzcLdvs0f51vfVCykQ/7VHvwbyI5CWh3YYHYWFXnN3+UCLh3Dk70gbGH2sLLA+rQ QB437WSX2VO5mEsHVCp3Kf/kBY3bxEpzIgUOx/DpLo7GNTWs4J2KmVgYYJg1SEpJFys7 qOeplwOvmGeWagTv+xyeOTu71mLB7XBSsbQ/NHkUiDtNvQdy4ZNSeMFBNXmimzsi4lm5 VgWZw3jlMaFAeTZ/opEmpnE1wQYZ/dMfI1n2pJ77MhZ4FGD5Cw4HdggsErhve7zbIr41 8R3ZS0KOOrcIBgdm9DRB+k/FkeA2kOGVERZhWq3DxDyHXgcerajiobubB2pMVGld1h/q 1k8w== X-Gm-Message-State: AOAM531gfFZ+HIp5qOuJJOpok4xmDhkBrAoSwZKIfs3CsepCavDKraUt vdmoRwFm/EIA/khryPMwvzyC+vK36AaUjoCsoF1TAqwGg4E= X-Received: by 2002:a05:6830:2366:: with SMTP id r6mr15034001oth.188.1625580576688; Tue, 06 Jul 2021 07:09:36 -0700 (PDT) MIME-Version: 1.0 References: <20210705130314.11519-1-ogabbay@kernel.org> <20210706134430.GL4604@ziepe.ca> In-Reply-To: <20210706134430.GL4604@ziepe.ca> From: Daniel Vetter Date: Tue, 6 Jul 2021 16:09:25 +0200 Message-ID: Subject: Re: [PATCH v4 0/2] Add p2p via dmabuf to habanalabs To: Jason Gunthorpe Cc: Oded Gabbay , Oded Gabbay , "Linux-Kernel@Vger. Kernel. Org" , Greg Kroah-Hartman , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Gal Pressman , sleybo@amazon.com, Maling list - DRI developers , linux-rdma , Linux Media Mailing List , Doug Ledford , Dave Airlie , Alex Deucher , Leon Romanovsky , Christoph Hellwig , amd-gfx list , "moderated list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 6, 2021 at 3:44 PM Jason Gunthorpe wrote: > > On Tue, Jul 06, 2021 at 02:07:16PM +0200, Daniel Vetter wrote: > > > On the "rdma-core" idea, afaik rdma NIC do not have fully programmable > > cores in their hw, for which you'd need some kind of compiler to make > > use of the hardware and the interfaces the kernel provides? So not > > really compareable, but also my understanding is that rdma-core does > > actually allow you to reasonable use&drive all the hw features and > > kernel interfaces fully. > > The whole HPC stack has speciality compilers of course. OpenMP, PGAS, > etc. These compilers map onto library primitives that eventually boil > down into rdma-core calls. Even the HW devices have various > programmability that are being targetted with compilers now. People > are making NIC devices with ARM cores/etc - P4 is emerging for some > packet processing tasks. Well it depends which compilers we're talking about here, and what kind of features. Higher level compilers that break down some fancy language like OpenMP into what that actually should do on a given hardware like gpu, or rdma-connected cluster, or whatever, we really don't care about. You don't need that to drive the hardware. Usually that stuff works by breaking some of the code down into cpu compiler IR (most of this is built on top of LLVM IR nowadays), interspersed with library calls to the runtime. Now the thing I care about here is if things doen't get compiled down to cpu code, but to some other IR (SPIR-V is starting to win, but very often ist still a hacked up version of LLVM IR), which then in a hw-specific backend gets compiled down to instructions that run on the hw. I had no idea that rdma NICs can do that, but it sounds like? I guess maybe some openmpi operations could be done directly on the rdma chip, but I'm not sure why you'd want a backend compiler here. Anyway, for anything that works like a gpu accelerator, like 3d accel, or parallel compute accel (aka gpgpu) or spatial compute accel (aka NN/AI) or maybe even fpga accel most of the magic to use the hardware is in this backend compiler, which translates from an IR into whatever your accelerator consumes. That's the part we really care about for modern accelerators because without that defacto the hardware is useless. Generally these chips have full-blown, if special purpose ISA, with register files, spilling, branches, loops and other control flow (sometimes only execution masks on simpler hw). > rdma-core can drive all the kernel interfaces with at least an ioctl > wrapper, and it has a test suite that tries to cover this. It does not > exercise the full HW capability, programmability, etc of every single > device. > > I actually don't entirely know what everyone has built on top of > rdma-core, or how I'd try to map it the DRI ideas you are trying to > explain. > > Should we ban all Intel RDMA drivers because they are shipping > proprietary Intel HPC compilers and proprietary Intel MPI which drives > their RDMA HW? Or is that OK because there are open analogs for some > of that stuff? And yes, the open versions are inferior in various > metrics. > > Pragmatically what I want to see is enough RDMA common/open user space > to understand the uAPI and thus more about how the kernel driver > works. Forcing everyone into rdma-core has already prevented a number > of uAPI mistakes in drivers that would have been bad - so at least > this level really is valuable. > > > So we actually want less on dri-devel, because for compute/accel chips > > we're currently happy with a vendor userspace. It just needs to be > > functional and complete, and open in its entirety. > > In a sense yes: DRI doesn't insist on a single code base to act as the > kernel interface, but that is actually the thing that has brought the > most value to RDMA, IMHO. So in practice we're not that different in DRI wrt userspace - if there is an established cross-vendor project in the given area, we do expect the userspace side to be merged there. And nowadays most of the feature work is done that way, it's just that we don't have a single project like rdma-core for this. We do still allow per-driver submit interfaces because hw is just not standardized enough there, the standards are at a higher level. Which is why it just doesn't make sense to talk about a kernel driver as something that's useful stand-alone at all. > We've certainly had some interesting successes because of this. The > first submission for AWS's EFA driver proposed to skip the rdma-core > step, which was rejected. However since EFA has been in that ecosystem > it has benefited greatly, I think. > > However, in another sense no: RDMA hasn't been blocking, say Intel, > just because they have built proprietary stuff on top of our open > stack. Oh we allow this too. We only block the initial submission if the proprietary stuff is the only thing out there. > Honestly, I think GPU is approaching this backwards. Wayland should > have been designed to prevent proprietary userspace stacks. That's not possible without some serious cans of worms though. Wayland is a protocol, and you can't forbid people from implementing it. Otherwise all the compatible open implementations of closed protocols wouldn't be possible either. Now the implementation is a different thing, and there a few compositors have succumbed to market pressure and enabled the nvidia stack, as a mostly separate piece from supporting the open stack. And that's largely because nvidia managed to completely kill the open source r/e effort through firmware licensing and crypto-key based verified loading, so unless you install the proprietary stack you actually can't make use of the hardware at all - well display works without the firmware, but 3d/compute just doesn't. So you just can't use nvidia hw without accepting their proprietary driver licenses and all that entails for the latest hardware. So I'm not clear what you're suggesting here we should do different. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch