Commit 65589e86 authored by Byungchul Park's avatar Byungchul Park Committed by Jakub Kicinski
Browse files

net: fec: access ->pp through netmem_desc instead of page



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: default avatarByungchul Park <byungchul@sk.com>
Link: https://patch.msgid.link/20250721021835.63939-7-byungchul@sk.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 87dda483
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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;