Re: [PATCH net-next v3 5/5] net: Document memory provider driver support

From
Jakub Kicinski <kuba@kernel.org>
Date
2024-12-14 01:55:28
Also in
linux-doc, lkml
Reply to
Mina Almasry, 2024-12-13
On Fri, 13 Dec 2024 09:50:15 -0800 Mina Almasry wrote:
quoted
No? It should all just work. The page may get split / fragmented by
the driver or page_pool_alloc_netmem() which you're adding in this
series. A fragmented net_iov will have an elevated refcount in exactly
the same way as if the driver was stashing one ref to release later.  
Ah, I had not considered that the driver may recycle the page by
holding onto a pp ref count, rather than a page refcount. The former
should indeed just work, although I don't have a driver that does
this, so test coverage may be a bit lacking.

But you mentioned you like the rule above. Do you want this removed
from the docs entirely? Or clarified to something like "driver's can't
perform their own recycling by holding onto page refs, but can hold
onto page_pool refs"?
We can call it out, makes sense. I'm not sure how to clearly name 
the page ref vs page_pool ref. But yes, driver must not attempt to
hold onto struct page for recycling, as there is no struct page.

I'd add to that that recycling using page pool refs is also discouraged
as the circulation time for buffers is much longer than when data is
copied out during recvmsg().
Thread (15 messages) 15 messages, 3 authors, last reply 2024-12-14
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