]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: fec: access ->pp through netmem_desc instead of page
authorByungchul Park <byungchul@sk.com>
Mon, 21 Jul 2025 02:18:29 +0000 (11:18 +0900)
committerJakub Kicinski <kuba@kernel.org>
Thu, 24 Jul 2025 00:46:55 +0000 (17:46 -0700)
To eliminate the use of struct page in page pool, the page pool users
should use netmem descriptor and APIs instead.

Make fec access ->pp through netmem_desc instead of page.

Signed-off-by: Byungchul Park <byungchul@sk.com>
Link: https://patch.msgid.link/20250721021835.63939-7-byungchul@sk.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/fec_main.c

index b481ee8ee4789d4c4428029ce90f2aeb38c64962..1383918f8a3fc619f1c73522a69ff56ef134abcf 100644 (file)
@@ -1045,7 +1045,9 @@ static void fec_enet_bd_init(struct net_device *dev)
                                struct page *page = txq->tx_buf[i].buf_p;
 
                                if (page)
-                                       page_pool_put_page(page->pp, page, 0, false);
+                                       page_pool_put_page(pp_page_to_nmdesc(page)->pp,
+                                                          page, 0,
+                                                          false);
                        }
 
                        txq->tx_buf[i].buf_p = NULL;
@@ -1586,7 +1588,8 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id, int budget)
                        xdp_return_frame_rx_napi(xdpf);
                } else { /* recycle pages of XDP_TX frames */
                        /* The dma_sync_size = 0 as XDP_TX has already synced DMA for_device */
-                       page_pool_put_page(page->pp, page, 0, true);
+                       page_pool_put_page(pp_page_to_nmdesc(page)->pp, page,
+                                          0, true);
                }
 
                txq->tx_buf[index].buf_p = NULL;
@@ -3348,7 +3351,8 @@ static void fec_enet_free_buffers(struct net_device *ndev)
                        } else {
                                struct page *page = txq->tx_buf[i].buf_p;
 
-                               page_pool_put_page(page->pp, page, 0, false);
+                               page_pool_put_page(pp_page_to_nmdesc(page)->pp,
+                                                  page, 0, false);
                        }
 
                        txq->tx_buf[i].buf_p = NULL;