<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/netmap, branch stable/13</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>netmap: Fix error handling in nm_os_extmem_create()</title>
<updated>2025-12-15T16:00:56+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-10-17T12:55:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8ddb5aff83c275866e505afaea8ebdc87bad7f57'/>
<id>8ddb5aff83c275866e505afaea8ebdc87bad7f57</id>
<content type='text'>
We bump the object reference count prior to mapping it into the kernel
map, at which point the vm_map_entry owns the reference.  Then, if
vm_map_wire() fails, vm_map_remove() will release the reference, so we
should avoid decrementing it in the error path.

Reported by:	Ilja van Sprundel &lt;ivansprundel@ioactive.com&gt;
Reviewed by:	vmaffione
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D53066

(cherry picked from commit dfc1041c08ba32f24b8050b4d635a0bbbfd9b767)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We bump the object reference count prior to mapping it into the kernel
map, at which point the vm_map_entry owns the reference.  Then, if
vm_map_wire() fails, vm_map_remove() will release the reference, so we
should avoid decrementing it in the error path.

Reported by:	Ilja van Sprundel &lt;ivansprundel@ioactive.com&gt;
Reviewed by:	vmaffione
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D53066

(cherry picked from commit dfc1041c08ba32f24b8050b4d635a0bbbfd9b767)
</pre>
</div>
</content>
</entry>
<entry>
<title>net: Remove unneeded NULL check for the allocated ifnet</title>
<updated>2024-10-08T10:07:18+00:00</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2024-06-28T10:16:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f500e5c6c99bd4520daa4524113462e3cf68f032'/>
<id>f500e5c6c99bd4520daa4524113462e3cf68f032</id>
<content type='text'>
Change 4787572d0580 made if_alloc_domain() never fail, then also do the
wrappers if_alloc(), if_alloc_dev(), and if_gethandle().

No functional change intended.

Reviewed by:	kp, imp, glebius, stevek
MFC after:	2 weeks
Differential Revision:  https://reviews.freebsd.org/D45740

MFC note: This is only a partial MFC, as some drivers do not exist in
stable/13 branch. The if_epair(4) drifts too much from stable/14 so not
included in this MFC.

(cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc)
(cherry picked from commit 6b1f530935c5f84ec65dad87b7c20c6b7a72a6d3)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change 4787572d0580 made if_alloc_domain() never fail, then also do the
wrappers if_alloc(), if_alloc_dev(), and if_gethandle().

No functional change intended.

Reviewed by:	kp, imp, glebius, stevek
MFC after:	2 weeks
Differential Revision:  https://reviews.freebsd.org/D45740

MFC note: This is only a partial MFC, as some drivers do not exist in
stable/13 branch. The if_epair(4) drifts too much from stable/14 so not
included in this MFC.

(cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc)
(cherry picked from commit 6b1f530935c5f84ec65dad87b7c20c6b7a72a6d3)
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-23T17:43:25+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:27+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3bc80996974a61a4223eae4c1ccd47b6ee32a48a'/>
<id>3bc80996974a61a4223eae4c1ccd47b6ee32a48a</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/

Similar commit in current:
(cherry picked from commit 685dc743dc3b)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/

Similar commit in current:
(cherry picked from commit 685dc743dc3b)
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c comment pattern</title>
<updated>2023-08-23T17:43:22+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4fbf14e22d7b83de7080a8e491ba14a5785a0ff4'/>
<id>4fbf14e22d7b83de7080a8e491ba14a5785a0ff4</id>
<content type='text'>
Remove /^/[*/]\s*\$FreeBSD\$.*\n/

Similar commit in current:
(cherry picked from commit 71625ec9ad2a)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^/[*/]\s*\$FreeBSD\$.*\n/

Similar commit in current:
(cherry picked from commit 71625ec9ad2a)
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .h pattern</title>
<updated>2023-08-23T17:43:22+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4b40a16f0d188422227478889b38cc341d50f88f'/>
<id>4b40a16f0d188422227478889b38cc341d50f88f</id>
<content type='text'>
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/

Similar commit in current:
(cherry picked from commit 2ff63af9b88c)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/

Similar commit in current:
(cherry picked from commit 2ff63af9b88c)
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-23T17:43:20+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:02+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f8167e0404dab9ffeaca95853dd237ab7c587f82'/>
<id>f8167e0404dab9ffeaca95853dd237ab7c587f82</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/

Similar commit in current:
(cherry picked from commit 95ee2897e98f)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/

Similar commit in current:
(cherry picked from commit 95ee2897e98f)
</pre>
</div>
</content>
</entry>
<entry>
<title>spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD</title>
<updated>2023-07-25T15:13:49+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-05-10T15:40:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=caa41f641755c935b036e17440a3b49329c904ed'/>
<id>caa41f641755c935b036e17440a3b49329c904ed</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

(cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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

(cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
</pre>
</div>
</content>
</entry>
<entry>
<title>netmap: Handle packet batches in generic mode</title>
<updated>2023-04-12T14:18:48+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2023-04-05T20:52:41+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3d55de76e30d34a411630d986153ae803915e95f'/>
<id>3d55de76e30d34a411630d986153ae803915e95f</id>
<content type='text'>
ifnets are allowed to pass batches of multiple packets to if_input,
linked by the m_nextpkt pointer.  iflib_rxeof() sometimes does this, for
example.  Netmap's generic mode did not handle this and would only
deliver the first packet in the batch, leaking the rest.

PR:		270636
Reviewed by:	vmaffione
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39426

(cherry picked from commit 5f6d37787f1e6aaf9b18392e8cff65ed4e094f2c)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ifnets are allowed to pass batches of multiple packets to if_input,
linked by the m_nextpkt pointer.  iflib_rxeof() sometimes does this, for
example.  Netmap's generic mode did not handle this and would only
deliver the first packet in the batch, leaking the rest.

PR:		270636
Reviewed by:	vmaffione
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39426

(cherry picked from commit 5f6d37787f1e6aaf9b18392e8cff65ed4e094f2c)
</pre>
</div>
</content>
</entry>
<entry>
<title>netmap: fix copyin/copyout of nmreq options list</title>
<updated>2023-04-05T20:41:55+00:00</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2023-03-21T23:23:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b74063f03a834e9f22fb46f8e989a9df19823ff0'/>
<id>b74063f03a834e9f22fb46f8e989a9df19823ff0</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

(cherry picked from commit e2a431a0ffb6894220bdf5d8fc2ca2d0ca316e85)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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

(cherry picked from commit e2a431a0ffb6894220bdf5d8fc2ca2d0ca316e85)
</pre>
</div>
</content>
</entry>
<entry>
<title>netmap: get rid of save_if_input for emulated adapters</title>
<updated>2023-03-28T21:58:26+00:00</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2023-03-14T21:59:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1e01c7ed628161e1eb46dfb97b3a8c74dbb7e8db'/>
<id>1e01c7ed628161e1eb46dfb97b3a8c74dbb7e8db</id>
<content type='text'>
The save_if_input function pointer was meant to save the previous
value of ifp-&gt;if_input before replacing it with the emulated
adapter hook.
However, the same pointer value is already stored in the if_input
field of the netmap_adapter struct, to be used for host TX ring processing.

Reuse the netmap_adapter if_input field to simplify the code
and save some space.

MFC after:	14 days

(cherry picked from commit 6c9fe357435db6408ec6b01221b9ff9e7e9b0ff1)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The save_if_input function pointer was meant to save the previous
value of ifp-&gt;if_input before replacing it with the emulated
adapter hook.
However, the same pointer value is already stored in the if_input
field of the netmap_adapter struct, to be used for host TX ring processing.

Reuse the netmap_adapter if_input field to simplify the code
and save some space.

MFC after:	14 days

(cherry picked from commit 6c9fe357435db6408ec6b01221b9ff9e7e9b0ff1)
</pre>
</div>
</content>
</entry>
</feed>
