summaryrefslogtreecommitdiff
path: root/sys/tests
AgeCommit message (Collapse)Author
2025-10-13tcp: improve testing of HPTSNick Banks
Improve the HPTS API to allow testing and add several tests. Reviewed by: tuexen Sponsored by: Netflix, Inc.
2025-10-13tcp: Initial ktest for HPTSNick Banks
Reviewed by: rrs, tuexen Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D52979
2025-06-17epoch_test: Assign different priorities using offset 1Olivier Certner
Replace the hardcoded 4 (old RQ_PPQ) by 1 (new RQ_PPQ), as all priority levels are now treated differently. MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation
2025-06-11machine/stdarg.h -> sys/stdarg.hBrooks Davis
Switch to using sys/stdarg.h for va_list type and va_* builtins. Make an attempt to insert the include in a sensible place. Where style(9) was followed this is easy, where it was ignored, aim for the first block of sys/*.h headers and don't get too fussy or try to fix other style bugs. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
2025-02-05netlink: refactor KPI for generic Netlink modulesGleb Smirnoff
Now that the family and group are completely private to netlink_generic.c, provide a simple and robust KPI, that would require very simple guarantees from both KPI and the module: * Strings are used only for family and group registration, that return ID: uint16_t genl_register_family(const char *name, ... uint32_t genl_register_group(uint16_t family, const char *name, ... * Once created families and groups are guaranteed to not disappear and be addressable by their ID. * All subsequent calls, including deregistration shall use ID. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D48845
2024-12-03netlink: use nitems() and roundup(2) from param.hGleb Smirnoff
While here style nested includes (kernel ones go first). Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D47557
2024-09-03tests: Stop checking for failures from malloc(M_WAITOK)Zhenlei Huang
MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852
2024-01-24callout: retire callout_async_drain()Gleb Smirnoff
This function was used only in TCP before 446ccdd08e2a. It was born in pain in 2016 to plug different complex panics in TCP timers. It wasn't warmly accepted in phabricator by all of the reviewers and my recollection of overall agreement was that "if you need this KPI, then you'd better fix your code to not need it". However, the function served its duty well all the way to FreeBSD 14. But now that TCP doesn't need it anymore, let's retire it to reduce complexity of callout code and also to avoid its further use. Reviewed by: jhb, markj, kib, rrs Differential Revision: https://reviews.freebsd.org/D43546
2023-11-26sys: Automated cleanup of cdefs and other formattingWarner Losh
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
2023-10-13netlink: move NETLINK define to opt_global.hKristof Provost
Move the NETLINK define into opt_global.h so we can rely on it being set correctly, without having to remember to include opt_netlink.h. This ensures that the NETLINK define is correctly set. If not we may end up with unloadable modules, due to missing symbols (such as nlmsg_get_group_writer). PR: 274306 Reviewed by: imp, markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D42179
2023-08-16sys: Remove $FreeBSD$: one-line sh patternWarner Losh
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-06-13ktest: make ktest work with Netlink loaded as a module.Alexander V. Chernikov
MFC after: 2 weeks
2023-05-12spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
2023-04-17tests: make ktest build on ppc.Alexander V. Chernikov
MFC after: 2 weeks
2023-04-14Testing: add framework for the kernel unit tests.Alexander V. Chernikov
This changes intends to reduce the bar to the kernel unit-testing by introducing a new kernel-testing framework ("ktest") based on Netlink, loadable test modules and python test suite integration. This framework provides the following features: * Integration to the FreeBSD test suite * Automatic test discovery * Automatic test module loading * Minimal boiler-plate code in both kernel and userland * Passing any metadata to the test * Convenient environment pre-setup using python testing framework * Streaming messages from the kernel to the userland * Running tests in the dedicated taskqueues * Skipping or parametrizing tests Differential Revision: https://reviews.freebsd.org/D39385 MFC after: 2 weeks
2021-08-16routing: add IPv6 fib validation procedure.Alexander V. Chernikov
Allow consistency validation of the inet6 fib based on rib data. Validation can be kicked off by loading test_lookup module and running sysctl net.route.test.run_inet6_scan=1 MFC after: 1 week
2021-08-15routing: Use process fib instead of fib 0 when conducting tests.Alexander V. Chernikov
* Allow to do validation/performance tests by using process fib instead of default fib 0. * Print all validation errors instead of just the first one. MFC after: 1 week
2021-06-17tests: Revise FIB lookups per second benchmarking routinesMarko Zec
Fix a bug in the LPM SEQ benchmark (missing break inside a switch block) by restructuring the test loop, while introducing additional two synthetic test options: ANN: scan only the address space announced in current RIB REP: repeat lookups over several keys in a sliding window scheme The total of eight combinations of test options are now available through dedicated sysctl hooks. Differential Revision: <https://reviews.freebsd.org/D30311> Reviewed by: melifaro MFC after: 3 days
2021-05-05Revise FIB lookups per second benchmarking routines.Marko Zec
Add a LPS benchmark variant which introduces artificial dependencies between successive lookups. While here, instead of writing the results from the lookups to a huge array, add them to an accumulator, in a more lightweight attempt at preventing the CPU's OOO machinery from discarding the lookup results if they would be completely unused. net.route.test.run_lps_rnd measures LPS throughput with independent uniformly random keys net.route.test.run_lps_seq measures LPS throughput with uniformly random keys with artificial interdependencies Reviewed by: melifaro MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D30096
2021-03-30Add IPv4 fib lookup performance tests with uniform keys.Alexander V. Chernikov
Submitted by: zec MFC after: 1 week
2021-01-17Enable running fib tests inside vnet jail.Alexander V. Chernikov
2021-01-09Add fib lookup testing module.Alexander V. Chernikov
This module intended to measure performance of routing lookups. Uses a list of IP addresses specified by sysctl one-by-one. Performance testing is triggered by changing sysctl OID with a number of lookups to execute. Lookups are done by the chunks of 10K routes, entering/exiting epoch on chunk granularity to amortise cost. Example: make -C sys/modules/test/fib_lookup unload load for i in `cat ~/ip4.txt`; do sysctl net.route.test.add_inet_addr=$i; done for i in `cat ~/ip6.txt`; do sysctl net.route.test.add_inet6_addr=$i; done sysctl net.route.test.run_inet=10000000 dmesg | tail Dec 13 23:24:05 current kernel: 10000000 packets in 417240173 nanoseconds, 23967011 pps Dec 13 23:24:06 current kernel: run: 10000000 packets vnet 0xfffff80003073f00 Dec 13 23:24:07 current kernel: 10000000 packets in 423086254 nanoseconds, 23635842 pps Differential Revision: https://reviews.freebsd.org/D27604
2020-09-02Add small tool to invoke kernel test framework tests.Hans Petter Selasky
MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=365236
2020-09-02Fix build of epoch_test module.Hans Petter Selasky
While at it add missing epoch_free() call. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=365235
2020-02-26Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
2019-02-04Regularize the Netflix copyrightWarner Losh
Use recent best practices for Copyright form at the top of the license: 1. Remove all the All Rights Reserved clauses on our stuff. Where we piggybacked others, use a separate line to make things clear. 2. Use "Netflix, Inc." everywhere. 3. Use a single line for the copyright for grep friendliness. 4. Use date ranges in all places for our stuff. Approved by: Netflix Legal (who gave me the form), adrian@ (pmc files) Notes: svn path=/head/; revision=343755
2018-07-15epoch_test: fix compileMatt Macy
- update to new interface Reported by: manu Notes: svn path=/head/; revision=336300
2018-05-18epoch(9): Make epochs non-preemptible by defaultMatt Macy
There are risks associated with waiting on a preemptible epoch section. Change the name to make them not be the default and document the issue under CAVEATS. Reported by: markj Notes: svn path=/head/; revision=333802
2018-05-18epoch: add non-preemptible "critical" variantMatt Macy
adds: - epoch_enter_critical() - can be called inside a different epoch, starts a section that will acquire any MTX_DEF mutexes or do anything that might sleep. - epoch_exit_critical() - corresponding exit call - epoch_wait_critical() - wait variant that is guaranteed that any threads in a section are running. - epoch_global_critical - an epoch_wait_critical safe epoch instance Requested by: markj Approved by: sbruno Notes: svn path=/head/; revision=333775
2018-05-11Test priority handling in epoch test.Matt Macy
- Double the number of test threads to mp_ncpu*2 - Give each thread a different scheduling priority Notes: svn path=/head/; revision=333479
2018-05-10Add simple preempt safe epoch APIMatt Macy
Read locking is over used in the kernel to guarantee liveness. This API makes it easy to provide livenes guarantees without atomics. Includes epoch_test kernel module to stress test the API. Documentation will follow initial use case. Test case and improvements to preemption handling in response to discussion with mjg@ Reviewed by: imp@, shurd@ Approved by: sbruno@ Notes: svn path=/head/; revision=333466
2017-05-09style(9): sort headersEnji Cooper
MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318010
2017-05-09style(9): sort headers and remove duplicatesEnji Cooper
MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=318006
2015-11-12Style 9 changes.Randall Stewart
MFC after: 1 Month Notes: svn path=/head/; revision=290714
2015-11-12Fix UP build.Konstantin Belousov
Notes: svn path=/head/; revision=290707
2015-11-11Remove redundant declaration for sysctl kern.Bryan Drewery
This is trying to fix the GCC build. MFC after: 1 month X-MFC-With: r290663 Notes: svn path=/head/; revision=290676
2015-11-11Use a proper prototype.Bryan Drewery
This was a failure in the GCC build. MFC after: 1 month X-MFC-With: r290663 Notes: svn path=/head/; revision=290675
2015-11-10Add a kernel test framework. The callout_test is a demonstration and will onlyRandall Stewart
work with the upcoming async-drain functionality. Tests can be added to the tests directory and then the framework can be used to launch those tests. MFC after: 1 month Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D1755 Notes: svn path=/head/; revision=290663