mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Pavel Begunkov <asml.silence@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>,
	Byungchul Park <byungchul@sk.com>, <netdev@vger.kernel.org>,
	<kuba@kernel.org>, <linux-kernel@vger.kernel.org>,
	<kernel_team@skhynix.com>, <harry.yoo@oracle.com>,
	<david@redhat.com>, <toke@redhat.com>, <almasrymina@google.com>,
	<anthony.l.nguyen@intel.com>, <przemyslaw.kitszel@intel.com>,
	<andrew+netdev@lunn.ch>, <davem@davemloft.net>,
	<edumazet@google.com>, <pabeni@redhat.com>,
	<intel-wired-lan@lists.osuosl.org>
Subject: Re: [Intel-wired-lan] [PATCH net-next] ice: access @pp through netmem_desc instead of page
Date: Thu, 8 Jan 2026 16:59:06 +0100	[thread overview]
Message-ID: <c65ca5b7-4121-41c4-a5cc-3df2644339a7@intel.com> (raw)
In-Reply-To: <37b642bd-9f26-477e-9fca-1e3c931c0efb@gmail.com>

From: Pavel Begunkov <asml.silence@gmail.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

  reply	other threads:[~2026-01-08 16:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16  4:07 Byungchul Park
2025-12-16  4:20 ` Matthew Wilcox
2025-12-17 13:11   ` Pavel Begunkov
2026-01-08 15:59     ` Alexander Lobakin [this message]
2025-12-17 11:46 ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-12-17 13:15   ` Pavel Begunkov
2025-12-17 14:34     ` Loktionov, Aleksandr
2025-12-18  0:40       ` Byungchul Park

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=c65ca5b7-4121-41c4-a5cc-3df2644339a7@intel.com \
    --to=aleksander.lobakin@intel.com \
    --cc=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=asml.silence@gmail.com \
    --cc=byungchul@sk.com \
    --cc=davem@davemloft.net \
    --cc=david@redhat.com \
    --cc=edumazet@google.com \
    --cc=harry.yoo@oracle.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kernel_team@skhynix.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=toke@redhat.com \
    --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

all inboxes | Powered by JetHome®