From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f193.google.com (mail-yw1-f193.google.com [209.85.128.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44AD11E47C5 for ; Tue, 27 Jan 2026 02:30:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769481049; cv=none; b=bpMMDinmhEV7zQ6kciz2dNN4cuCsJot9P69Z5t2gCtrRqHlIKSdG+WVQldrms7T8WhwOrMbvhspPST9Ux5LPbNQvDe8yY58rkGmYnp5dMuGyYXs8rnan8vWsEJPQCSPHmYHqPPjS405TIGlD+/ANHoYhXPyY+uyP+ttNkcBFzyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769481049; c=relaxed/simple; bh=KHQTMcbGWv838jeHXPgV8dxHgD873Pl7gf8BNEh3ljU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LIQRaSauelbl5pJxrIIhoxuthGshJvNEkRZQOHj7DvT2iOpIksXBeSDKBcPVh7ygRBKlToS0khRfVoVpTbqcB4uhQoheR2tYmJUtBaYi4CaR//ZOb+g5X0c36F+fpuJ+IPE016svsptX9TZdiVk/NUO7WrPhFwt1KNmS5BTqLGA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hdhCV6el; arc=none smtp.client-ip=209.85.128.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hdhCV6el" Received: by mail-yw1-f193.google.com with SMTP id 00721157ae682-78fc174ada4so41827337b3.2 for ; Mon, 26 Jan 2026 18:30:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769481047; x=1770085847; darn=vger.kernel.org; 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=7D31caj3N1Jxdsl7gn2LUCTtkhdOIGiiafmFtbNg3P8=; b=hdhCV6elPH6QMYqIGvqzcjebzTt+heU9y99STI21AaP6zDHSTnVZ+hopEFI+L3g/rc djUjeUZxPSf6vKPl+iYSXWARYc/t1yPx5qCQDoNi6ev8L3OyQrBM6IP+Ua//WqWfIv1K UXoUidhJHbHm2vY4CMHdgx4HOcCUtdhbGCNN6aXdTm2CaMUzYi132Xodjtyld5HG6+J/ DA+uLybXVsTqpAMkif9tTVH8yJbkPk0XpaWloHbvmMPohXFpk5gmeRAC8ThWZZXm12kp tVUBhBzySxggtJxIjc72tNQjbJUtjtnu1cXmmlQRL8z0ZgjOlxWPTvOanGxpIAqTNPAa 13mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769481047; x=1770085847; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7D31caj3N1Jxdsl7gn2LUCTtkhdOIGiiafmFtbNg3P8=; b=g8tPUSr0CP8h9ySDN/qv+SJKRqwHMw7gM9WNRbc7jJ5YNPgHkD/kQahH57NHZ3eqKt V6dZIyQoBtVMgGAroHNhvCSsINqrBJ6Wkh/l0XN/j9YvRE7woAnctkG7yF3y4z6BXAmg B9D6QbgfQflq19TIns91/9d6m8yq38did1N2bT9BWEckqVBXimpunHsHIB7lELz3zcEj mVWDr2IQncivLyIpJrUxv3Wp7rfZ+6FVLL1MK2MXTLyEtn1Tps2+1PY8Y9q3k6sWeyaT 1oG6m/g1QF7mN9ev2DcPkRZ1tyIyigD0qVs98ksAsOmwIm60Lu5O+7s4rVjlMD0b4137 SlRw== X-Forwarded-Encrypted: i=1; AJvYcCUbjR7S+3uk91ZKijLK0erACejeTJZ+thJ3PKs/xcYeKvKDh3JQsVZ7Ji6pqx7fL5E2mXxYb/q3Eq0=@vger.kernel.org X-Gm-Message-State: AOJu0YxbkFkXPxKuPkz0rVLcfd0PAfc2Ein2GY4Pogd0DLUZRyXCFplv iq5aH2+VC3K4MRqWN4Y7IOrs/x8poOhdUE/oZatGJCLSjiiCLXEAPLVt X-Gm-Gg: AZuq6aJMTYXSw9+4TlB8AWZD2K6fd4TYzJXa5Cd8YaNq3K4HfdUTmQLF/WbktOcw89L TXOxKkHGEyHd5BbBpLQzUWrYeO6rch5tpNd49ZIJ7BDUiCvFS4a+MOhiT/kN2hyeFnhgTOvPlOR wf0aGa0/T1GwM1D0YYoyFjmIYUnyx/yO8I0kibEvpuDTSiCrUBo0SFXlUCu/ruyn5ikpl7hCIMW J3BVgYZnT7SfaZNjna5E7pI2au1PxGPqqL9MUt+1fe7fooH3kWKRLqwRdFkQ6QnUYvAYHNLpDBJ sAfuNGZS0ixOMwzu/a3yTihNaHe1oJxvE9xYYnnMXeZ4L5RkobvkFja+qBUxMtlLr7mT43hUgBq 7SpZB+/wxgwY3XeaEziAAFKCasPUHq1r0m+jWdtUANoFDnx8LIuErZUVTLBFQeu7GB6zPQAES/9 MtMhlDDAUeu+tWNMrZ1236hnQwz8F3iAT2McE= X-Received: by 2002:a05:690c:6813:b0:786:a0fb:fa8e with SMTP id 00721157ae682-7947ab157c5mr1045097b3.15.1769481047156; Mon, 26 Jan 2026 18:30:47 -0800 (PST) Received: from devvm11784.nha0.facebook.com ([2a03:2880:25ff:44::]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7943b2bb70dsm55711407b3.45.2026.01.26.18.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jan 2026 18:30:46 -0800 (PST) Date: Mon, 26 Jan 2026 18:30:45 -0800 From: Bobby Eshleman To: Jakub Kicinski Cc: Stanislav Fomichev , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Kuniyuki Iwashima , Willem de Bruijn , Neal Cardwell , David Ahern , Mina Almasry , Arnd Bergmann , Jonathan Corbet , Andrew Lunn , Shuah Khan , Donald Hunter , Stanislav Fomichev , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, asml.silence@gmail.com, matttbe@kernel.org, skhawaja@google.com, Bobby Eshleman Subject: Re: [PATCH net-next v10 4/5] net: devmem: document NETDEV_A_DMABUF_AUTORELEASE netlink attribute Message-ID: References: <20260115-scratch-bobbyeshleman-devmem-tcp-token-upstream-v10-4-686d0af71978@meta.com> <20260120163650.5a962648@kernel.org> <20260121173512.748e2155@kernel.org> <20260121185021.446b00e8@kernel.org> <20260121194615.33dc0812@kernel.org> <20260126172646.2e5af2d4@kernel.org> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260126172646.2e5af2d4@kernel.org> On Mon, Jan 26, 2026 at 05:26:46PM -0800, Jakub Kicinski wrote: > On Wed, 21 Jan 2026 20:07:11 -0800 Stanislav Fomichev wrote: > > On 01/21, Jakub Kicinski wrote: > > > On Wed, 21 Jan 2026 19:25:27 -0800 Bobby Eshleman wrote: > > > > Good point. The only real use case for autorelease=on is for backwards > > > > compatibility... so I thought maybe DEVMEM_A_DMABUF_COMPAT_TOKEN > > > > or DEVMEM_A_DMABUF_COMPAT_DONTNEED would be clearer? > > > > > > Hm. Maybe let's return to naming once we have consensus on the uAPI. > > > > > > Does everyone think that pushing this via TCP socket opts still makes > > > sense, even tho in practice the TCP socket is just how we find the > > > binding? > > > > I'm not a fan of the existing cmsg scheme, but we already have userspace > > using it, so getting more performance out of it seems like an easy win? > > I don't like: > - the fact that we have to add the binding to a socket (extra field) > - single socket can only serve single binding, there's no technical > reason for this really, AFAICT, just the fact that we have a single > pointer in the sock struct The core reason is that sockets lose the ability to map a given token to a given binding by no longer storing the niov ptr. One proposal I had was to encode some number of bits in the token that can be used to lookup the binding in an array, I could reboot that approach. With 32 bits, we can represent: dmabuf max size = 512 GB, max dmabuf count = 8 dmabuf max size = 256 GB, max dmabuf count = 16 dmabuf max size = 128 GB, max dmabuf count = 32 etc... Then, if the dmabuf count encoding space is exhausted, the socket would have to wait until the user returns all of the tokens from one of the dmabufs and frees the ID (or err out is another option). This wouldn't change adding a field to the socket, we'd have to add one or two more for allocating the dmabuf ID and fetching the dmabuf with it. But it does fix the single binding thing. > - the 7 levels of indentation in tcp_recvmsg_dmabuf() For sure, it is getting hairy. > > I understand your argument, but as is this series feels closer to a PoC > than an easy win (the easy part should imply minor changes and no > detrimental effect on code quality IMHO). Sure, let's try to find a way to minimize the changes. Best, Bobby