From: David Howells <dhowells@redhat.com>
To: Mina Almasry <almasrymina@google.com>
Cc: dhowells@redhat.com, willy@infradead.org, hch@infradead.org,
Jakub Kicinski <kuba@kernel.org>,
Eric Dumazet <edumazet@google.com>,
netdev@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: Device mem changes vs pinning/zerocopy changes
Date: Wed, 04 Jun 2025 16:59:23 +0100 [thread overview]
Message-ID: <1099957.1749052763@warthog.procyon.org.uk> (raw)
In-Reply-To: <1098853.1749051265@warthog.procyon.org.uk>
(Apologies, I accidentally sent the incomplete email)
> I think you need to modify the existing sk_buff. I think adding
> a new struct and migrating the entire net stack to use that is a bit
> too ambitious. But up to you. Just my 2 cents here.
It may come down to that, and if it does, we'll need to handle frags
differently. Basically, for zerocopy, the following will all apply or come to
apply sometime in the future:
(1) We're going to be getting arrays of {physaddr,len} from the higher
layers. I think Christoph's idea is that this makes DMA mapping easier.
We will need to retain this.
(2) There will be no page refcount. We will obtain a pin (user zc) or there
will be a destructor (kernel zc). If the latter, it may have to be
shared amongst multiple skbuffs.
(3) We can't assume that a frag refers to a single page - or that there's
even a necessarily a page struct. And if there is a page struct, the
metadata isn't going to be stored in it. The page struct will contain a
typed pointer to some other struct (e.g. folio).
(4) We can't assume anything about the memory type of the frag (could be
slab, for instance).
Obviously, if we copy the data into netmem buffers, we have full control of
that memory type.
David
next prev parent reply other threads:[~2025-06-04 15:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-30 15:14 Device mem changes vs pinning/zerocopy changes David Howells
2025-05-30 15:50 ` Stanislav Fomichev
2025-06-04 14:56 ` David Howells
2025-06-05 18:59 ` Mina Almasry
2025-05-30 16:22 ` Mina Almasry
2025-06-04 15:34 ` David Howells
2025-06-04 15:59 ` David Howells [this message]
2025-06-05 19:30 ` Mina Almasry
2025-06-05 19:27 ` Mina Almasry
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=1099957.1749052763@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=almasrymina@google.com \
--cc=edumazet@google.com \
--cc=hch@infradead.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=netdev@vger.kernel.org \
--cc=willy@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).