# Re: \[PATCH net-next v10 02/12\] netmem: use netmem\_desc instead of page to access -\>pp in \_\_netmem\_get\_pp()

- From: Pavel Begunkov \<asml.silence@gmail.com\>
- Date: 2025-07-17 09:22:04 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/07/3138323
- Thread: https://ratatoskr.run/netdev/2025/07/3133500/t.md

```text
On 7/17/25 10:17, Pavel Begunkov wrote:
> On 7/16/25 20:41, Mina Almasry wrote:
> ...>> I will kill __netmem_get_pp() as you and I prefer.  However,
>>> __netmem_get_pp() users e.i. libeth_xdp_return_va() and
>>> libeth_xdp_tx_fill_buf() should be altered.  I will modify the code like:
>>>
>>> as is: __netmem_get_pp(netmem)
>>> to be: __netmem_nmdesc(netmem)->pp
>>>
>>> Is it okay with you?
>>>
>>
>> When Pavel and I were saying 'remove __netmem_get_pp', I think we
>> meant to remove the entire concept of unsafe netmem -> page
>> conversions. I think we both don't like them. From this perspective,
>> __netmem_nmdesc(netmem)->pp is just as bad as __netmem_get_pp(netmem).
>
> Yes. It'd great to have all of them gone. IMHO it's much better
> to let the caller do the casting so at least it's explicit and
> assumptions are not hidden. E.g. instead of
>
> pp = __netmem_nmdesc(netmem)->pp;
>
> It'd be
>
> struct page *page = __netmem_to_page(netmem);
>
> page_to_nmdesc(page)->pp;
> // or page_get_pp(page), or whatever the helper is
>
> That might be easier as well.

FWIW, no need to respin a v12 for that

-- 
Pavel Begunkov

```
