From: Loktionov, Aleksandr <[email protected]> Date: Wed, 16 Apr 2025 08:54:39 +0200
> > >> -----Original Message----- >> From: Intel-wired-lan <[email protected]> On Behalf Of >> Alexander Lobakin >> Sent: Tuesday, April 15, 2025 7:28 PM >> To: [email protected] >> Cc: Lobakin, Aleksander <[email protected]>; Kubiak, Michal >> <[email protected]>; Fijalkowski, Maciej >> <[email protected]>; Nguyen, Anthony L >> <[email protected]>; Kitszel, Przemyslaw >> <[email protected]>; Andrew Lunn <[email protected]>; >> David S. Miller <[email protected]>; Dumazet, Eric >> <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni >> <[email protected]>; Alexei Starovoitov <[email protected]>; Daniel >> Borkmann <[email protected]>; Jesper Dangaard Brouer >> <[email protected]>; John Fastabend <[email protected]>; Simon >> Horman <[email protected]>; [email protected]; [email protected]; >> [email protected]; Mina Almasry <[email protected]> >> Subject: [Intel-wired-lan] [PATCH iwl-next 01/16] libeth: convert to netmem [...] >> + memcpy(dst, src, LARGEST_ALIGN(copy)); > Can you avoid 'unstable' API __netmem_to_page() usage? For example: > > - dst = page_address(hdr->page) + hdr->offset + hdr->page->pp->p.offset; > - src = page_address(buf->page) + buf->offset + buf->page->pp->p.offset; > - memcpy(dst, src, LARGEST_ALIGN(copy)); > + dst = netmem_address(hdr->netmem) + hdr->offset; > + src = netmem_address(buf->netmem) + buf->offset; > + memcpy(dst, src, LARGEST_ALIGN(copy)); Those underscored versions were introduced by me to avoid redundant overhead when it's known the buffer is backed by a page -- for cases like this one, so your propo makes no sense to me. > >> buf->offset += copy; >> >> return copy; Thanks, Olek
