From: Bobby Eshleman <bobbyeshleman@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Stanislav Fomichev <stfomichev@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuniyu@google.com>,
Willem de Bruijn <willemb@google.com>,
Neal Cardwell <ncardwell@google.com>,
David Ahern <dsahern@kernel.org>,
Mina Almasry <almasrymina@google.com>,
Arnd Bergmann <arnd@arndb.de>, Jonathan Corbet <corbet@lwn.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Shuah Khan <shuah@kernel.org>,
Donald Hunter <donald.hunter@gmail.com>,
Stanislav Fomichev <sdf@fomichev.me>,
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 <bobbyeshleman@meta.com>
Subject: Re: [PATCH net-next v10 4/5] net: devmem: document NETDEV_A_DMABUF_AUTORELEASE netlink attribute
Date: Mon, 26 Jan 2026 18:30:45 -0800 [thread overview]
Message-ID: <aXgjVb5PVqdPM10J@devvm11784.nha0.facebook.com> (raw)
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
next prev parent reply other threads:[~2026-01-27 2:30 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-16 5:02 [PATCH net-next v10 0/5] net: devmem: improve cpu cost of RX token management Bobby Eshleman
2026-01-16 5:02 ` [PATCH net-next v10 1/5] net: devmem: rename tx_vec to vec in dmabuf binding Bobby Eshleman
2026-01-16 5:02 ` [PATCH net-next v10 2/5] net: devmem: refactor sock_devmem_dontneed for autorelease split Bobby Eshleman
2026-01-16 5:02 ` [PATCH net-next v10 3/5] net: devmem: implement autorelease token management Bobby Eshleman
2026-01-21 1:00 ` Jakub Kicinski
2026-01-21 5:33 ` Bobby Eshleman
2026-01-22 4:15 ` Mina Almasry
2026-01-22 5:18 ` Bobby Eshleman
2026-01-16 5:02 ` [PATCH net-next v10 4/5] net: devmem: document NETDEV_A_DMABUF_AUTORELEASE netlink attribute Bobby Eshleman
2026-01-21 0:36 ` Jakub Kicinski
2026-01-21 5:44 ` Bobby Eshleman
2026-01-22 1:35 ` Jakub Kicinski
2026-01-22 2:37 ` Bobby Eshleman
2026-01-22 2:50 ` Jakub Kicinski
2026-01-22 3:25 ` Bobby Eshleman
2026-01-22 3:46 ` Jakub Kicinski
2026-01-22 4:07 ` Stanislav Fomichev
2026-01-27 1:26 ` Jakub Kicinski
2026-01-27 2:30 ` Bobby Eshleman [this message]
2026-01-27 2:44 ` Jakub Kicinski
2026-01-27 3:06 ` Bobby Eshleman
2026-01-27 3:43 ` Jakub Kicinski
2026-01-27 3:50 ` Bobby Eshleman
2026-01-16 5:02 ` [PATCH net-next v10 5/5] selftests: drv-net: devmem: add autorelease tests Bobby Eshleman
2026-01-21 1:07 ` [PATCH net-next v10 0/5] net: devmem: improve cpu cost of RX token management Jakub Kicinski
2026-01-21 5:29 ` Bobby Eshleman
2026-01-22 1:37 ` Jakub Kicinski
2026-01-22 4:21 ` Mina Almasry
2026-01-26 18:45 ` Bobby Eshleman
2026-01-27 1:31 ` Jakub Kicinski
2026-01-27 6:00 ` Stanislav Fomichev
2026-01-27 6:48 ` Bobby Eshleman
2026-01-30 11:13 ` Pavel Begunkov
2026-02-05 3:48 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aXgjVb5PVqdPM10J@devvm11784.nha0.facebook.com \
--to=bobbyeshleman@gmail.com \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=arnd@arndb.de \
--cc=asml.silence@gmail.com \
--cc=bobbyeshleman@meta.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=matttbe@kernel.org \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=skhawaja@google.com \
--cc=stfomichev@gmail.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox