Re: [RFC net-next 03/13] net: page_pool: factor out uninit
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Date: 2023-08-17 16:54:30
On Thu, 17 Aug 2023 at 19:25, Jakub Kicinski [off-list ref] wrote:
On Thu, 17 Aug 2023 10:40:09 +0300 Ilias Apalodimas wrote:quoted
quoted
+static void page_pool_uninit(struct page_pool *pool) +{ + ptr_ring_cleanup(&pool->ring, NULL); + + if (pool->p.flags & PP_FLAG_DMA_MAP) + put_device(pool->p.dev); + +#ifdef CONFIG_PAGE_POOL_STATS + free_percpu(pool->recycle_stats); +#endif +}I am not sure I am following the reasoning here. The only extra thing page_pool_free() does is disconnect the pool. So I assume no one will call page_pool_uninit() directly. Do you expect page_pool_free() to grow in the future, so factoring out the uninit makes the code easier to read?I'm calling it from the unwind patch of page_pool_create() in the next patch, because I'm adding another setup state after page_pool_init(). I can't put the free into _uninit() because on the unwind path of _create() that's an individual step.
Yea fair enough, I went through that patch a few minutes ago, so this one makes sense Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>