summaryrefslogtreecommitdiff
path: root/net/Kconfig
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2023-10-09 10:41:51 -0400
committerDavid S. Miller <davem@davemloft.net>2023-10-11 10:39:01 +0100
commitb3098d32ed6e6f4c03a95f14426143f1b0af620f (patch)
tree7523dcb438a68a4e6569fc6ef2c0b81915ab3c86 /net/Kconfig
parent5247dbf16cee4e83eb89e4d3b87bd5e79c5d1655 (diff)
net: add skb_segment kunit test
Add unit testing for skb segment. This function is exercised by many different code paths, such as GSO_PARTIAL or GSO_BY_FRAGS, linear (with or without head_frag), frags or frag_list skbs, etc. It is infeasible to manually run tests that cover all code paths when making changes. The long and complex function also makes it hard to establish through analysis alone that a patch has no unintended side-effects. Add code coverage through kunit regression testing. Introduce kunit infrastructure for tests under net/core, and add this first test. This first skb_segment test exercises a simple case: a linear skb. Follow-on patches will parametrize the test and add more variants. Tested: Built and ran the test with make ARCH=um mrproper ./tools/testing/kunit/kunit.py run \ --kconfig_add CONFIG_NET=y \ --kconfig_add CONFIG_DEBUG_KERNEL=y \ --kconfig_add CONFIG_DEBUG_INFO=y \ --kconfig_add=CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y \ net_core_gso Signed-off-by: Willem de Bruijn <willemb@google.com> Reviewed-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/Kconfig')
-rw-r--r--net/Kconfig9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/Kconfig b/net/Kconfig
index e248236c29a7..3ec6bc98fa05 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -508,4 +508,13 @@ config NETDEV_ADDR_LIST_TEST
default KUNIT_ALL_TESTS
depends on KUNIT
+config NET_TEST
+ tristate "KUnit tests for networking" if !KUNIT_ALL_TESTS
+ depends on KUNIT
+ default KUNIT_ALL_TESTS
+ help
+ KUnit tests covering core networking infra, such as sk_buff.
+
+ If unsure, say N.
+
endif # if NET