eth: tsnep: let page recycling happen with skbs
authorJakub Kicinski <kuba@kernel.org>
Thu, 20 Jul 2023 01:04:06 +0000 (18:04 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 22 Jul 2023 01:50:18 +0000 (18:50 -0700)
tsnep builds an skb with napi_build_skb() and then calls
page_pool_release_page() for the page in which that skb's
head sits. Use recycling instead, recycling of heads works
just fine.

Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>
Link: https://lore.kernel.org/r/20230720010409.1967072-2-kuba@kernel.org
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/engleder/tsnep_main.c

index 84751bb..079f9f6 100644 (file)
@@ -1333,7 +1333,7 @@ static void tsnep_rx_page(struct tsnep_rx *rx, struct napi_struct *napi,
 
        skb = tsnep_build_skb(rx, page, length);
        if (skb) {
-               page_pool_release_page(rx->page_pool, page);
+               skb_mark_for_recycle(skb);
 
                rx->packets++;
                rx->bytes += length;