Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'page_pool-bnxt_en-unlink-old-page-pool-in-queue-api-using-helper'

David Wei says:

====================
page_pool: bnxt_en: unlink old page pool in queue api using helper

56ef27e3 unexported page_pool_unlink_napi() and renamed it to
page_pool_disable_direct_recycling(). This is because there was no
in-tree user of page_pool_unlink_napi().

Since then Rx queue API and an implementation in bnxt got merged. In the
bnxt implementation, it broadly follows the following steps: allocate
new queue memory + page pool, stop old rx queue, swap, then destroy old
queue memory + page pool.

The existing NAPI instance is re-used so when the old page pool that is
no longer used but still linked to this shared NAPI instance is
destroyed, it will trigger warnings.

In my initial patches I unlinked a page pool from a NAPI instance
directly. Instead, export page_pool_disable_direct_recycling() and call
that instead to avoid having a driver touch a core struct.
====================

Link: https://patch.msgid.link/20240627030200.3647145-1-dw@davidwei.uk
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+4 -6
+1 -5
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 15081 15081 bnxt_free_one_rx_ring(bp, rxr); 15082 15082 bnxt_free_one_rx_agg_ring(bp, rxr); 15083 15083 15084 - /* At this point, this NAPI instance has another page pool associated 15085 - * with it. Disconnect here before freeing the old page pool to avoid 15086 - * warnings. 15087 - */ 15088 - rxr->page_pool->p.napi = NULL; 15089 15084 page_pool_destroy(rxr->page_pool); 15090 15085 rxr->page_pool = NULL; 15091 15086 ··· 15200 15205 bnxt_hwrm_rx_ring_free(bp, rxr, false); 15201 15206 bnxt_hwrm_rx_agg_ring_free(bp, rxr, false); 15202 15207 rxr->rx_next_cons = 0; 15208 + page_pool_disable_direct_recycling(rxr->page_pool); 15203 15209 15204 15210 memcpy(qmem, rxr, sizeof(*rxr)); 15205 15211 bnxt_init_rx_ring_struct(bp, qmem);
+1
include/net/page_pool/types.h
··· 229 229 struct xdp_mem_info; 230 230 231 231 #ifdef CONFIG_PAGE_POOL 232 + void page_pool_disable_direct_recycling(struct page_pool *pool); 232 233 void page_pool_destroy(struct page_pool *pool); 233 234 void page_pool_use_xdp_mem(struct page_pool *pool, void (*disconnect)(void *), 234 235 const struct xdp_mem_info *mem);
+2 -1
net/core/page_pool.c
··· 1014 1014 pool->xdp_mem_id = mem->id; 1015 1015 } 1016 1016 1017 - static void page_pool_disable_direct_recycling(struct page_pool *pool) 1017 + void page_pool_disable_direct_recycling(struct page_pool *pool) 1018 1018 { 1019 1019 /* Disable direct recycling based on pool->cpuid. 1020 1020 * Paired with READ_ONCE() in page_pool_napi_local(). ··· 1032 1032 1033 1033 WRITE_ONCE(pool->p.napi, NULL); 1034 1034 } 1035 + EXPORT_SYMBOL(page_pool_disable_direct_recycling); 1035 1036 1036 1037 void page_pool_destroy(struct page_pool *pool) 1037 1038 {