diff mbox series

[net-next,v2,4/4] page pool: Remove init_callback parameter

Message ID 20240220210342.40267-5-toke@redhat.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Change BPF_TEST_RUN use the system page pool for live XDP frames | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next, async
netdev/apply fail Patch does not apply to net-next

Commit Message

Toke Høiland-Jørgensen Feb. 20, 2024, 9:03 p.m. UTC
The only user of the init_callback parameter to page pool was the
BPF_TEST_RUN code. Since that has now been moved to use a different
scheme, we can get rid of the init callback entirely.

Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
---
 include/net/page_pool/types.h | 4 ----
 net/core/page_pool.c          | 4 ----
 2 files changed, 8 deletions(-)

Comments

Ilias Apalodimas Feb. 29, 2024, 6:12 p.m. UTC | #1
On Tue, 20 Feb 2024 at 23:03, Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>
> The only user of the init_callback parameter to page pool was the
> BPF_TEST_RUN code. Since that has now been moved to use a different
> scheme, we can get rid of the init callback entirely.
>
> Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
> ---
>  include/net/page_pool/types.h | 4 ----
>  net/core/page_pool.c          | 4 ----
>  2 files changed, 8 deletions(-)
>
> diff --git a/include/net/page_pool/types.h b/include/net/page_pool/types.h
> index 3828396ae60c..2f5975ab2cd0 100644
> --- a/include/net/page_pool/types.h
> +++ b/include/net/page_pool/types.h
> @@ -69,9 +69,6 @@ struct page_pool_params {
>         );
>         struct_group_tagged(page_pool_params_slow, slow,
>                 struct net_device *netdev;
> -/* private: used by test code only */
> -               void (*init_callback)(struct page *page, void *arg);
> -               void *init_arg;
>         );
>  };
>
> @@ -129,7 +126,6 @@ struct page_pool {
>         struct page_pool_params_fast p;
>
>         int cpuid;
> -       bool has_init_callback;
>
>         long frag_users;
>         struct page *frag_page;
> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
> index 89c835fcf094..fd054b6f773a 100644
> --- a/net/core/page_pool.c
> +++ b/net/core/page_pool.c
> @@ -217,8 +217,6 @@ static int page_pool_init(struct page_pool *pool,
>                  */
>         }
>
> -       pool->has_init_callback = !!pool->slow.init_callback;
> -
>  #ifdef CONFIG_PAGE_POOL_STATS
>         pool->recycle_stats = alloc_percpu(struct page_pool_recycle_stats);
>         if (!pool->recycle_stats)
> @@ -428,8 +426,6 @@ static void page_pool_set_pp_info(struct page_pool *pool,
>          * the overhead is negligible.
>          */
>         page_pool_fragment_page(page, 1);
> -       if (pool->has_init_callback)
> -               pool->slow.init_callback(page, pool->slow.init_arg);
>  }
>
>  static void page_pool_clear_pp_info(struct page *page)
> --
> 2.43.0
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff mbox series

Patch

diff --git a/include/net/page_pool/types.h b/include/net/page_pool/types.h
index 3828396ae60c..2f5975ab2cd0 100644
--- a/include/net/page_pool/types.h
+++ b/include/net/page_pool/types.h
@@ -69,9 +69,6 @@  struct page_pool_params {
 	);
 	struct_group_tagged(page_pool_params_slow, slow,
 		struct net_device *netdev;
-/* private: used by test code only */
-		void (*init_callback)(struct page *page, void *arg);
-		void *init_arg;
 	);
 };
 
@@ -129,7 +126,6 @@  struct page_pool {
 	struct page_pool_params_fast p;
 
 	int cpuid;
-	bool has_init_callback;
 
 	long frag_users;
 	struct page *frag_page;
diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index 89c835fcf094..fd054b6f773a 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -217,8 +217,6 @@  static int page_pool_init(struct page_pool *pool,
 		 */
 	}
 
-	pool->has_init_callback = !!pool->slow.init_callback;
-
 #ifdef CONFIG_PAGE_POOL_STATS
 	pool->recycle_stats = alloc_percpu(struct page_pool_recycle_stats);
 	if (!pool->recycle_stats)
@@ -428,8 +426,6 @@  static void page_pool_set_pp_info(struct page_pool *pool,
 	 * the overhead is negligible.
 	 */
 	page_pool_fragment_page(page, 1);
-	if (pool->has_init_callback)
-		pool->slow.init_callback(page, pool->slow.init_arg);
 }
 
 static void page_pool_clear_pp_info(struct page *page)