From: Jakub Kicinski Date: Mon, 29 Apr 2024 14:44:21 +0000 (-0700) Subject: net: page_pool: support error injection X-Git-Tag: v6.10-rc1~153^2~115^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12b6c3a0380a220edb03691689167be13faa4f45;p=thirdparty%2Flinux.git net: page_pool: support error injection Because of caching / recycling using the general page allocation failures to induce errors in page pool allocation is very hard. Add direct error injection support to page_pool_alloc_pages(). Reviewed-by: Willem de Bruijn Link: https://lore.kernel.org/r/20240429144426.743476-2-kuba@kernel.org Signed-off-by: Jakub Kicinski --- diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 273c24429bced..8bcc7014a61a0 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -5,6 +5,7 @@ * Copyright (C) 2016 Red Hat, Inc. */ +#include #include #include #include @@ -550,6 +551,7 @@ struct page *page_pool_alloc_pages(struct page_pool *pool, gfp_t gfp) return page; } EXPORT_SYMBOL(page_pool_alloc_pages); +ALLOW_ERROR_INJECTION(page_pool_alloc_pages, NULL); /* Calculate distance between two u32 values, valid if distance is below 2^(31) * https://en.wikipedia.org/wiki/Serial_number_arithmetic#General_Solution