lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 17 Aug 2023 10:40:09 +0300
From: Ilias Apalodimas <ilias.apalodimas@...aro.org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, hawk@...nel.org, aleksander.lobakin@...el.com, 
	linyunsheng@...wei.com, almasrymina@...gle.com
Subject: Re: [RFC net-next 03/13] net: page_pool: factor out uninit

Hi Jakub,

[...]

>  }
>
> +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?

Thanks
/Ilias
> +
>  /**
>   * page_pool_create() - create a page pool.
>   * @params: parameters, see struct page_pool_params
> @@ -806,14 +818,7 @@ static void page_pool_free(struct page_pool *pool)
>         if (pool->disconnect)
>                 pool->disconnect(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
> +       page_pool_uninit(pool);
>         kfree(pool);
>  }
>
> --
> 2.41.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ