[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c65ca5b7-4121-41c4-a5cc-3df2644339a7@intel.com>
Date: Thu, 8 Jan 2026 16:59:06 +0100
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Pavel Begunkov <asml.silence@...il.com>
CC: Matthew Wilcox <willy@...radead.org>, Byungchul Park <byungchul@...com>,
<netdev@...r.kernel.org>, <kuba@...nel.org>, <linux-kernel@...r.kernel.org>,
<kernel_team@...ynix.com>, <harry.yoo@...cle.com>, <david@...hat.com>,
<toke@...hat.com>, <almasrymina@...gle.com>, <anthony.l.nguyen@...el.com>,
<przemyslaw.kitszel@...el.com>, <andrew+netdev@...n.ch>,
<davem@...emloft.net>, <edumazet@...gle.com>, <pabeni@...hat.com>,
<intel-wired-lan@...ts.osuosl.org>
Subject: Re: [Intel-wired-lan] [PATCH net-next] ice: access @pp through
netmem_desc instead of page
From: Pavel Begunkov <asml.silence@...il.com>
Date: Wed, 17 Dec 2025 13:11:28 +0000
> On 12/16/25 04:20, Matthew Wilcox wrote:
>> On Tue, Dec 16, 2025 at 01:07:23PM +0900, Byungchul Park wrote:
>>> +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
>>> @@ -1251,7 +1251,7 @@ static int ice_lbtest_receive_frames(struct
>>> ice_rx_ring *rx_ring)
>>> rx_buf = &rx_ring->rx_fqes[i];
>>> page = __netmem_to_page(rx_buf->netmem);
>>> received_buf = page_address(page) + rx_buf->offset +
>>> - page->pp->p.offset;
>>> + pp_page_to_nmdesc(page)->pp->p.offset;
>>
>> Shouldn't we rather use:
>>
>> nmdesc = __netmem_to_nmdesc(rx_buf->netmem);
>> received_buf = nmdesc_address(nmdesc) + rx_buf->offset +
>> nmdesc->pp->p_offset;
>>
>> (also. i think we're missing a nmdesc_address() function in our API).
>
> It wouldn't make sense as net_iov backed nmdescs don't have/expose
> host addresses (only dma addresses). nmdesc_address() would still
> need to rely on the caller knowing that it's a page. An explicit
> cast with *netmem_to_page() should be better.
Sorry for the late reply. Holidays... Happy New Year everyone.
I agree with Pavel. This loopback test always operates with
kernel/page-backed memory. I believe it's fully valid to explicitly cast
to a page in such cases and work with it. This is also more clear to the
readers after all (IIRC I suggested this piece of code when Michał was
working on the ice conversion).
Thanks,
Olek
Powered by blists - more mailing lists