diff options
author | Jakub Kicinski <kuba@kernel.org> | 2024-04-30 08:15:33 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-04-30 08:15:34 -0700 |
commit | b45176703647e5302314c740a51e7d1054a7bd3c (patch) | |
tree | cc187ebd5dcbf93d1db54c23788b8ef2c62ccaa6 /net | |
parent | f581bcf02f0e0b42516bfeb3e34860919b9e78d2 (diff) | |
parent | 9da271f825e42156058a2eb09360bc993853bbba (diff) |
Merge branch 'selftests-net-page_poll-allocation-error-injection'
Jakub Kicinski says:
====================
selftests: net: page_poll allocation error injection
Add a test for exercising driver memory allocation failure paths.
page pool is a bit tricky to inject errors into at the page allocator
level because of the bulk alloc and recycling, so add explicit error
injection support "in front" of the caches.
Add a test to exercise that using only the standard APIs.
This is the first useful test for the new tests with an endpoint.
There's no point testing netdevsim here, so this is also the first
HW-only test in Python.
I'm not super happy with the traffic generation using iperf3,
my initial approach was to use mausezahn. But it turned out to be
5x slower in terms of PPS. Hopefully this is good enough for now.
v1: https://lore.kernel.org/all/20240426232400.624864-1-kuba@kernel.org/
====================
Link: https://lore.kernel.org/r/20240429144426.743476-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/page_pool.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 273c24429bce..8bcc7014a61a 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -5,6 +5,7 @@ * Copyright (C) 2016 Red Hat, Inc. */ +#include <linux/error-injection.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/slab.h> @@ -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 |