Re: [PATCH net-next v7 1/7] netmem: introduce struct netmem_desc mirroring struct page

From
Pavel Begunkov <asml.silence@gmail.com>
Date
2025-07-15 10:22:22
Also in
bpf, linux-mm, linux-rdma, lkml
Reply to
Jakub Kicinski, 2025-07-15
On 7/15/25 02:47, Jakub Kicinski wrote:
On Mon, 14 Jul 2025 22:58:31 +0900 Harry Yoo wrote:
quoted
quoted
quoted
Could you please share your thoughts on why it's hard to judge them and
what's missing from the series, such as in the comments, changelog, or
the cover letter?
My main concern (as shared on earlier revisions) is the type hierarchy
Quick overview. struct netmem_desc is a common denominator b/w pp pages
and net_iov, and contains fields used by the pp generic path, e.g.
refcount, dma_addr. Before, pp was using type casting hacks to keep
code generic with some overhead on bit masking, now it'll be able to
look up netmem_desc from a netmem and use it directly.

That's pretty much what I was suggesting niov / page aliasing to be
1+ years ago, but unfortunately that didn't happen. It definitely
removes some type casting hackiness.
exposed to the drivers.
v10 adds a bunch of "pp_page_to_nmdesc(page)->pp" in the drivers,
Not sure I have a strong opinion, but it can be turned into a helper.

Converting things back and forth or blindly
downcasting to netmem and upcasting back to the CPU-readable type is
no good.
-- 
Pavel Begunkov
Thread (24 messages) 24 messages, 5 authors, last reply 2025-07-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help