<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/netmap/netmap_freebsd.c, branch releng/14.3</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.3</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.3'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2024-12-03T01:03:42Z</updated>
<entry>
<title>kern: Make fileops and filterops tables const where possible</title>
<updated>2024-12-03T01:03:42Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2024-11-25T22:39:31Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=48155c983c4ba7158e738bd1d4b3144751bd1d86'/>
<id>urn:sha1:48155c983c4ba7158e738bd1d4b3144751bd1d86</id>
<content type='text'>
No functional change intended.

MFC after:	1 week

(cherry picked from commit ef9ffb8594eee294334ced627755bf5b46b48f9f)
</content>
</entry>
<entry>
<title>net: Remove unneeded NULL check for the allocated ifnet</title>
<updated>2024-07-12T12:03:37Z</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2024-06-28T10:16:29Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6b1f530935c5f84ec65dad87b7c20c6b7a72a6d3'/>
<id>urn:sha1:6b1f530935c5f84ec65dad87b7c20c6b7a72a6d3</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

(cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc)
</content>
</entry>
<entry>
<title>netmap: Use device_set_descf()</title>
<updated>2024-06-27T15:27:41Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2024-06-05T14:17:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e416932e18a0c4c8b485689a79224d2f0c98fbb2'/>
<id>urn:sha1:e416932e18a0c4c8b485689a79224d2f0c98fbb2</id>
<content type='text'>
No functional change intended.

MFC after:	1 week

(cherry picked from commit 44d36c9731c172977ad8a95a09c0d6fbddcc9b2f)
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c comment pattern</title>
<updated>2023-08-16T17:54:24Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=71625ec9ad2a9bc8c09784fbd23b759830e0ee5f'/>
<id>urn:sha1:71625ec9ad2a9bc8c09784fbd23b759830e0ee5f</id>
<content type='text'>
Remove /^/[*/]\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: Handle packet batches in generic mode</title>
<updated>2023-04-05T21:07:48Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2023-04-05T20:52:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5f6d37787f1e6aaf9b18392e8cff65ed4e094f2c'/>
<id>urn:sha1:5f6d37787f1e6aaf9b18392e8cff65ed4e094f2c</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
</content>
</entry>
<entry>
<title>netmap: Fix queue stalls with generic interfaces</title>
<updated>2023-04-05T16:12:30Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2023-04-05T16:12:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ce12afaa6fff46c9027eb6b2bd515a4e46ecefc9'/>
<id>urn:sha1:ce12afaa6fff46c9027eb6b2bd515a4e46ecefc9</id>
<content type='text'>
In emulated mode, the FreeBSD netmap port attempts to perform zero-copy
transmission.  This works as follows: the kernel ring is populated with
mbuf headers to which netmap buffers are attached.  When transmitting,
the mbuf refcount is initialized to 2, and when the counter value has
been decremented to 1 netmap infers that the driver has freed the mbuf
and thus transmission is complete.

This scheme does not generalize to the situation where netmap is
attaching to a software interface which may transmit packets among
multiple "queues", as is the case with bridge or lagg interfaces.  In
that case, we would be relying on backing hardware drivers to free
transmitted mbufs promptly, but this isn't guaranteed; a driver may
reasonably defer freeing a small number of transmitted buffers
indefinitely.  If such a buffer ends up at the tail of a netmap transmit
ring, further transmits can end up blocked indefinitely.

Fix the problem by removing the zero-copy scheme (which is also not
implemented in the Linux port of netmap).  Instead, the kernel ring is
populated with regular mbuf clusters into which netmap buffers are
copied by nm_os_generic_xmit_frame().  The refcounting scheme is
preserved, and this lets us avoid allocating a fresh cluster per
transmitted packet in the common case.  If the transmit ring is full, a
callout is used to free the "stuck" mbuf, avoiding the queue deadlock
described above.

Furthermore, when recycling mbuf clusters, be sure to fully reinitialize
the mbuf header instead of simply re-setting M_PKTHDR.  Some software
interfaces, like if_vlan, may set fields in the header which should be
reset before the mbuf is reused.

Reviewed by:	vmaffione
MFC after:	1 month
Sponsored by:	Zenarmor
Sponsored by:	OPNsense
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D38065
</content>
</entry>
<entry>
<title>netmap: get rid of save_if_input for emulated adapters</title>
<updated>2023-03-14T22:04:23Z</updated>
<author>
<name>Vincenzo Maffione</name>
<email>vmaffione@FreeBSD.org</email>
</author>
<published>2023-03-14T21:59:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6c9fe357435db6408ec6b01221b9ff9e7e9b0ff1'/>
<id>urn:sha1:6c9fe357435db6408ec6b01221b9ff9e7e9b0ff1</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
</content>
</entry>
<entry>
<title>netmap: Remove obsolete compatibility defines</title>
<updated>2023-03-09T23:16:53Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2023-03-09T23:16:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=626d1e4a82e25d274cdadfebfd81a28e968efb5b'/>
<id>urn:sha1:626d1e4a82e25d274cdadfebfd81a28e968efb5b</id>
<content type='text'>
No functional change intended.

Reviewed by:	vmaffione
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39001
</content>
</entry>
<entry>
<title>Mechanically convert netmap(4) to IfAPI</title>
<updated>2023-02-14T15:21:19Z</updated>
<author>
<name>Justin Hibbits</name>
<email>jhibbits@FreeBSD.org</email>
</author>
<published>2023-01-12T18:38:37Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e330262f34fc179ce920c16bb28ba8a1c4a73aff'/>
<id>urn:sha1:e330262f34fc179ce920c16bb28ba8a1c4a73aff</id>
<content type='text'>
Reviewed by:	vmaffione, zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37814
</content>
</entry>
</feed>
