<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/tests/sys/netmap, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2025-09-05T18:42:22Z</updated>
<entry>
<title>tests/sys/netmap: use require.kmods property instead of ad-hoc checks</title>
<updated>2025-09-05T18:42:22Z</updated>
<author>
<name>Siva Mahadevan</name>
<email>me@svmhdvn.name</email>
</author>
<published>2025-07-21T13:25:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=559b0f6b82867b60a2d5cb1b2744114603cb17a7'/>
<id>urn:sha1:559b0f6b82867b60a2d5cb1b2744114603cb17a7</id>
<content type='text'>
Signed-off-by: Siva Mahadevan &lt;me@svmhdvn.name&gt;
Sponsored by: The FreeBSD Foundation
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1780
</content>
</entry>
<entry>
<title>netmap: Disable a buggy and unsafe test (sync_kloop_conflict)</title>
<updated>2025-03-06T18:22:25Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2025-03-06T18:22:25Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ecb3a7d43dd67809037f9066e7716a05c41d8d63'/>
<id>urn:sha1:ecb3a7d43dd67809037f9066e7716a05c41d8d63</id>
<content type='text'>
This test starts two threads to verify that two concurrent threads
cannot enter the kernel loop on the same netmap context.  The test
even has a comment about a potential race condition where the first
thread enters the loop and is stopped before the second thread tries
to enter the loop.  It claims it is fixed by the use of a semaphore.
Unfortunately, the semaphore doesn't close the race.

In the CI setup for CHERI, we run the testsuite once a week against
various architectures using single CPU QEMU instances.  Across
multiple recent runs of the plain "aarch64" test the job ran for an
entire day before QEMU was killed by a timeout.  The last messages
logged were from this test:

734.881045 [1182] generic_netmap_attach     Emulated adapter for tap3312 created (prev was NULL)
734.882340 [ 321] generic_netmap_register   Emulated adapter for tap3312 activated
734.882675 [2224] netmap_csb_validate       csb_init for kring tap3312 RX0: head 0, cur 0, hwcur 0, hwtail 0
734.883042 [2224] netmap_csb_validate       csb_init for kring tap3312 TX0: head 0, cur 0, hwcur 0, hwtail 1023
734.915397 [ 820] netmap_sync_kloop         kloop busy_wait 1, direct_tx 0, direct_rx 0, na_could_sleep 0
736.901945 [ 820] netmap_sync_kloop         kloop busy_wait 1, direct_tx 0, direct_rx 0, na_could_sleep 0

From the timestamps, the synchronous kloop was entered twice 2 seconds
apart.  This corresponds to the 2 second timeout on the semaphore in
the test.  What appears to have happened is that th1 started and
entered the kernel where it spun in an endless busy loop.  This
starves th2 so it _never_ runs.  Once the semaphore times out, th1 is
preempted to run the main thread which invokes the ioctl to stop the
busy loop.  th1 then exits the loop and returns to userland to exit.
Only after this point does th2 actually run and execute the ioctl to
enter the kernel.  Since th1 has already exited, th2 doesn't error and
enters its own happy spin loop.  The main thread hangs forever in
pthread_join, and the process is unkillable (the busy loop in the
kernel doesn't check for any pending signals so kill -9 is ignored and
ineffective).

I don't see a way to fix this test, so I've just disabled it.  There
is no good way to ensurce concurrency on a single CPU system when one
thread wants to sit in a spin loop.  Someone should fix the netmap
kloop to respond to kill -9 in which case kyua could perhaps at least
timeout the individual test process and kill it.

Reviewed by:	vmaffione
Obtained from:	CheriBSD
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D49220
</content>
</entry>
<entry>
<title>Remove residual blank line at start of Makefile</title>
<updated>2024-07-15T22:43:39Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2024-07-15T04:46:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e9ac41698b2f322d55ccf9da50a3596edb2c1800'/>
<id>urn:sha1:e9ac41698b2f322d55ccf9da50a3596edb2c1800</id>
<content type='text'>
This is a residual of the $FreeBSD$ removal.

MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
</content>
</entry>
<entry>
<title>netmap: fix unit tests</title>
<updated>2023-12-29T07:46:46Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2023-12-29T07:46:46Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ee5804da116f2107451c8b4376b69b3a64a630e8'/>
<id>urn:sha1:ee5804da116f2107451c8b4376b69b3a64a630e8</id>
<content type='text'>
After ad874544d9f018bf8eef4053b5ca7b856c4674cb, interface name
validation has been removed, resulting in two unit tests failures.
Drop the failing tests since they no longer apply.

Reported by:	markj
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line sh pattern</title>
<updated>2023-08-16T17:55:03Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:55:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf'/>
<id>urn:sha1:d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf</id>
<content type='text'>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-16T17:54:16Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b3e7694832e81d7a904a10f525f8797b753bf0d3'/>
<id>urn:sha1:b3e7694832e81d7a904a10f525f8797b753bf0d3</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</content>
</entry>
<entry>
<title>spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD</title>
<updated>2023-05-12T16:44:03Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-05-10T15:40:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4d846d260e2b9a3d4d0a701462568268cbfe7a5b'/>
<id>urn:sha1:4d846d260e2b9a3d4d0a701462568268cbfe7a5b</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>netmap: fix copyin/copyout of nmreq options list</title>
<updated>2023-03-21T23:23:18Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2023-03-21T23:23:18Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e2a431a0ffb6894220bdf5d8fc2ca2d0ca316e85'/>
<id>urn:sha1:e2a431a0ffb6894220bdf5d8fc2ca2d0ca316e85</id>
<content type='text'>
The previous code unsuccesfully attempted to report a precise error for
each option in the user list. Moreover, commit 253b2ec199b broke some
ctrl-api-test (see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260547).

With this patch we bail out as soon as an unrecoverable error is detected and
we properly check for copy boundaries. EOPNOTSUPP no longer immediately
returns an error, so that any other option in the list may be examined
by the caller code and a precise report of the (un)supported options can
be returned to the user.

With this patch, all ctrl-api-test unit tests pass again.

PR:			260547
Submitted by:		giuseppe.lettieri@unipi.it
Reviewed by:		vmaffione
MFC after:		14 days
</content>
</entry>
<entry>
<title>netmap tests: Reset ctx-&gt;nmctx to NULL in nmreq_parsing.</title>
<updated>2022-12-05T00:29:25Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2022-12-05T00:29:25Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f4db390553ba9db752865f5a42c36b062fdb03f2'/>
<id>urn:sha1:f4db390553ba9db752865f5a42c36b062fdb03f2</id>
<content type='text'>
This avoids leaking a pointer to the on-stack test_nmctx which
triggers a -Wdangling-pointer warning from GCC.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37536
</content>
</entry>
<entry>
<title>netmap: update unit tests with libnetmap tests</title>
<updated>2021-04-02T14:39:30Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2021-04-02T14:39:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=36d6e65722ea515bf2d122d6e69096a5ff620a92'/>
<id>urn:sha1:36d6e65722ea515bf2d122d6e69096a5ff620a92</id>
<content type='text'>
</content>
</entry>
</feed>
