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.

--
Pavel Begunkov

Reply via email to