Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7184259rwp; Tue, 18 Jul 2023 11:14:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlEk1H+acptsAK2Y8NxMSC3/DOLy62BF3dfLLD9hUY/XkD5l9EQnOmdezNRhfPYOVUpLqGh2 X-Received: by 2002:a17:90a:6d89:b0:25b:88bc:bb6b with SMTP id a9-20020a17090a6d8900b0025b88bcbb6bmr15148pjk.2.1689704091015; Tue, 18 Jul 2023 11:14:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689704091; cv=none; d=google.com; s=arc-20160816; b=lqlbIBlbgesWNQ5fWhg4lGOzxZcbyf0w/h3CJNKjq2OdfQbYKDsFztDVEftbY+Y7wa LJQIIyNtT4cBJIMTgXE3bUfnTlgqqPC+I6C/oZA8F1C9Kip24P2rz56mWmO02dJsRwtH Pe8zVf7xF6WTxwKCVNKirx2m9GRkpYU+TnjNq60dxHcxJdvQKYOQtXY8MfhNU1L26S6O Lthdoz1mppvMEGVYaGdaWdwH9oB6o7ZBQcfP0mPE6FVZ0RtjYfzDCHQyuh8pBgoyue1g efBmvhXqLyKS2OMNdGnU8u62CNKj2eIv+ib61j8CdxQp330VWJaOimGjuvo0N5BuSMlx t28w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nXz9xDxwT7BaavIhnCmafXwp3/aDUnwPYqui5jTbzSQ=; fh=9nk19OITxGWyxgb0pENVEDKPT9f7pbhkHqt9RJ8sA/U=; b=x/D4/ew149qoBWI8Jy5gWCNY0Z7ZM7JpnlQgdIbDalDGyIMKGXlryYOwxvFGEU/e3w zmeJiq2r9r4peLqSB8/Z375LJUZxWVXnBD3gWaDlj+P3vRV2gfcacVCJnAczxKbq2VWQ Li4HHQcCut+cjZpCYbcRj+xUuoH6dXukX1BdkiXqvOpEiHuavTCAMdbTiU0iv1e8oaPN LI2Z3EFJU2xcXImi7KueyPqj88CrWGhsKS/YjCZ+AoVC5gyLkRj0IbBPla3BQIRN5xDd ss0uzobU7BR9qSWNaWPfOaf4JYDh/PtKSdR5NzyuUNswKhXBaZ+RuQjcv2ZIut8f76Gn BjGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=groKThLK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id np6-20020a17090b4c4600b0025c0a65a763si2009995pjb.121.2023.07.18.11.14.37; Tue, 18 Jul 2023 11:14:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=groKThLK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232027AbjGRSGe (ORCPT + 99 others); Tue, 18 Jul 2023 14:06:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbjGRSGd (ORCPT ); Tue, 18 Jul 2023 14:06:33 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B05EC0 for ; Tue, 18 Jul 2023 11:06:32 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1b8b2886364so35973875ad.0 for ; Tue, 18 Jul 2023 11:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1689703591; x=1692295591; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nXz9xDxwT7BaavIhnCmafXwp3/aDUnwPYqui5jTbzSQ=; b=groKThLKhcGdvS7VGO7C4SDS0MFs8h/VRyqV+OQecO/1MgBAs/ZfpPKMHdEDFc18U6 lL6E01mKA8UE5kLtpd7OED7gt7ztbJ5zG6ZR10SH2TRXOQQY1VxzoLfjSQ8X+8hvr7zc 87zzsMTMDmeVha3PmXm/KENBZCBJR0whtZvmDjcbID28N6ghyDcrk5tXGBvdZgk2kE89 c/ehnZ5oymDKSDagYvboYUn0sxTqAeqXz24JaL1wf81rDQDv/hEv3XN80y+jSOV2M/0E 6T7xuWgJpH1NmtIjdE8p3/Mzy7HrBdkuTncvzIqpvybXisn6eFXd5MAeGA3KsBbF/NVQ x6YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689703591; x=1692295591; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nXz9xDxwT7BaavIhnCmafXwp3/aDUnwPYqui5jTbzSQ=; b=CHF+CXFEsgTICjca0iuW7iUgNkiAfXqlc3RxmUjuvd0EZY3tHPEMUQ2BN+vFvZ7vAJ 7EAJTg/KkL+AyxKM/voZUa1SW6ekPQfogwZN3Rmmwvo8PdLwPcRr9Ke9BDHpbtagh9S1 wyaqOZ5T379PxDM3u28bu6gDDv3aSTflGyj60KsGG74E2diJpLYTOh0Z3FTlG5C603Cx EG7ocHF3AhPv9jI3f57AXm6OSjl5RlrxPZnmIVWEPbaGihziRvaTuEUARh5VJhEMWA9k BleW+4I3dz7gjKuaQvO4w7jEymdKBEqCLYkgushptjwePZ4Zw/Iigmlo6HAc+djaX7wR ppVw== X-Gm-Message-State: ABy/qLawBg/gNH8bRzx+N0JeAmtmNhJdGseBfy5yZ8sBhRyh4qR2w0Xj 4fiajt4W46v9B9ubQjMAfbgfMw== X-Received: by 2002:a17:902:c406:b0:1b9:e9b2:1288 with SMTP id k6-20020a170902c40600b001b9e9b21288mr530425plk.38.1689703591309; Tue, 18 Jul 2023 11:06:31 -0700 (PDT) Received: from ziepe.ca ([206.223.160.26]) by smtp.gmail.com with ESMTPSA id z10-20020a1709028f8a00b001b89c313185sm2171634plo.205.2023.07.18.11.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 11:06:30 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1qLp5h-002aj7-9n; Tue, 18 Jul 2023 15:06:29 -0300 Date: Tue, 18 Jul 2023 15:06:29 -0300 From: Jason Gunthorpe To: Mina Almasry Cc: Andy Lutomirski , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, netdev@vger.kernel.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, Sumit Semwal , Christian =?utf-8?B?S8O2bmln?= , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jesper Dangaard Brouer , Ilias Apalodimas , Arnd Bergmann , David Ahern , Willem de Bruijn , Shuah Khan Subject: Re: [RFC PATCH 00/10] Device Memory TCP Message-ID: References: <20230710223304.1174642-1-almasrymina@google.com> <12393cd2-4b09-4956-fff0-93ef3929ee37@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 18, 2023 at 10:36:52AM -0700, Mina Almasry wrote: > That is specific to this proposal, and will likely be very different > in future ones. I thought the dma-buf pages approach was extensible > and the uapi belonged somewhere in dma-buf. Clearly not. The next > proposal, I think, will program the rxq via some net uapi and will > take the dma-buf as input. Probably some netlink api (not sure if > ethtool family or otherwise). I'm working out details of this > non-paged networking first. In practice you want the application to startup, get itself some 3/5 tuples and then request the kernel to setup the flow steering and provision the NIC queues. This is the right moment for the application to provide the backing for the rx queue memory via a DMABUF handle. Ideally this would all be accessible to non-priv applications as well, so I think you'd want some kind of system call that sets all this up and takes in a FD for the 3/5-tuple socket (to prove ownership over the steering) and the DMABUF FD. The queues and steering should exist only as long as the application is still running (whatever that means). Otherwise you have a big mess to clean up whenever anything crashes. netlink feels like a weird API choice for that, in particular it would be really wrong to somehow bind the lifecycle of a netlink object to a process. Further, if you are going to all the trouble of doing this, it seems to me you should make it work with any kind of memory, including CPU memory. Get a consistent approach to zero-copy TCP RX. So also allow a memfd or similar to be passed in as the backing storage. Jason