<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/netmap/netmap_freebsd.c, 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 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>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: 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>
<entry>
<title>netmap: Remove obsolete compatibility defines</title>
<updated>2023-03-16T14:25:33+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2023-03-09T23:16:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=565e917b4432ac64ddf52353cbf1a35a5aafa302'/>
<id>565e917b4432ac64ddf52353cbf1a35a5aafa302</id>
<content type='text'>
No functional change intended.

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

(cherry picked from commit 626d1e4a82e25d274cdadfebfd81a28e968efb5b)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No functional change intended.

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

(cherry picked from commit 626d1e4a82e25d274cdadfebfd81a28e968efb5b)
</pre>
</div>
</content>
</entry>
<entry>
<title>netmap: several typo fixes</title>
<updated>2022-12-31T14:46:29+00:00</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2021-04-02T07:01:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=03c82ccba0837cb17688ff6bddd2d0ae1cbf34d6'/>
<id>03c82ccba0837cb17688ff6bddd2d0ae1cbf34d6</id>
<content type='text'>
No functional changes intended.

(cherry picked from commit 45c67e8f6b56b9744f01142747fadf291fe3fad2)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No functional changes intended.

(cherry picked from commit 45c67e8f6b56b9744f01142747fadf291fe3fad2)
</pre>
</div>
</content>
</entry>
<entry>
<title>netmap: drop compatibility FreeBSD code</title>
<updated>2022-12-31T12:06:22+00:00</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2022-12-24T14:31:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=bdf79b3562169ffec05613b1ad43129182b02029'/>
<id>bdf79b3562169ffec05613b1ad43129182b02029</id>
<content type='text'>
Netmap users on FreeBSD are not supposed to import code from the
github netmap repository anymore. They should use the code that
is available in the src repo. We can therefore drop the compatibility
code.

MFC after:	7 days

(cherry picked from commit 3da494d3246e30a19d2107c8bb8a293ffd5a9da6)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Netmap users on FreeBSD are not supposed to import code from the
github netmap repository anymore. They should use the code that
is available in the src repo. We can therefore drop the compatibility
code.

MFC after:	7 days

(cherry picked from commit 3da494d3246e30a19d2107c8bb8a293ffd5a9da6)
</pre>
</div>
</content>
</entry>
<entry>
<title>netmap: fix issues in nm_os_extmem_create()</title>
<updated>2021-03-23T21:17:23+00:00</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2021-03-20T17:15:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3e4127f8f2933029034ac618a0013f434cb4a420'/>
<id>3e4127f8f2933029034ac618a0013f434cb4a420</id>
<content type='text'>
- Call vm_object_reference() before vm_map_lookup_done().
- Use vm_mmap_to_errno() to convert vm_map_* return values to errno.
- Fix memory leak of e-&gt;obj.

Reported by:	markj
Reviewed by:	markj
MFC after:	1 week

(cherry picked from commit ee7ffaa2e6e08b63efb4673610875d40964d5058)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Call vm_object_reference() before vm_map_lookup_done().
- Use vm_mmap_to_errno() to convert vm_map_* return values to errno.
- Fix memory leak of e-&gt;obj.

Reported by:	markj
Reviewed by:	markj
MFC after:	1 week

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