routing: Make ip[6]_tryforward() FIB-aware for local traffic
`ip_tryforward()` and `ip6_tryforward()` checks whether the destination
address is local or not without considering if it belongs to the current FIB.
If the destination is local but not in our FIB, forward it instead
of returning it to ip_input().
PR: 292319
Reviewed by: zlei
MFC after: 1 week
MFC to: stable/15
Differential Revision: https://reviews.freebsd.org/D56353
loopback: Account for packet drops
Make loopback packet drops more obvious by reporting them
in interface stats visable via netstat -ni
Since loopback uses netisr, packets can be dropped if the
netisr queue overflows. These drops are visible via
netisr -Q, but its not an obvious place to look.
Differential Revision: https://reviews.freebsd.org/D56356
Reviewed by: glebius, tuexen
Sponsored by: Netflix
lro: move pkt rejection checks to leafs to avoid queueing non-LRO'able pkts
When lro mbuf queuing is enabled, we should not queue easily
reject-able packets. Queuing them does a bit of extra work (sorting,
timestamps) and can potentially delay urgent packets such as LACP
PDUs. This change moves simple rejection tests from lro_rx_common()
into lro_rx and (more importantly) into tcp_lro_queue_mbuf().
Note this change only moves the easy checks on forwarding and packet
metadata, where the rejection criteria is already hot in cache. It
does not move parsing and looking inside the packet to verify the
ether protocol, ip protocol, etc. This could be done, but we risk
essentially doubling the cache misses per-packet by doing so.
Differential Revision: https://reviews.freebsd.org/D56337
Reviewed by: rrs, tuexen
Sponsored by: Netflix
ifconfig: add CMIS support for 400GbE optics
Add support for CMIS based optics, typically used by 400GbE
and faster ethernet optics. The CMIS standard requires paged
support for i2c ioctls.
This has been tested on an Nvidia ConnectX-7 and Broadcom
Thor2 400GbE NIC, and I have verified that optics vendor information,
light levels, and temperatures match the information provided by
various vendor tools.
Differential Revision: https://reviews.freebsd.org/D56265
Reviewed by: kbowling, sumit.saxena_broadcom.com
Sponsored by: Netflix
qcom_gcc: Only build on arm64 for kernels with FDT
This fixes the build of the LINT-ACPI kernel.
Fixes: 4e3fdced7f78 ("qcom_gcc: migrate the MSM8916 support to qcom_gcc")
in_pcb: Fix RIPCB_HASH in kernels without INET or INET6
Only use hashes for protocols that are enabled in the kernel
configuration.
Fixes: ece716c5d347 ("raw ip: move hash table manipulation to inpcb layer")
tcp_close: Use in6_pcbdisconnect for INET6 sockets
This also fixes the LINT-NOINET builds.
Fixes: 40dbb06fa73c ("inpcb: retire INP_DROPPED and in_pcbdrop()")
CTL: add ATF tests for REPORT SUPPORTED OPCODES
This includes a regression test for CVE-2024-42416
MFC after: 2 weeks
Sponsored by: ConnectWise
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D46613
acpi_apm: Don't recurse on ACPI_LOCK in apmreadfilt
The lock is already held by the caller since it is used as the knlist
lock.
PR: 293901
Reported by: Jiaming Zhang <r772577952 at gmail.com>
Fixes: cc2715cf1f86 ("acpi_apm: Narrow scope of ACPI_LOCK")
freebsd-base.7: Add an example for unregistering
MFC after: 3 days
Reviewed by: ivy, emaste
Discussed with: bapt, des, emaste, ivy, phk, pi
Differential Revision: https://reviews.freebsd.org/D55458
freebsd-base.7: Break examples into subsections
Break the examples into subsections, so that we can have multi-step
examples.
MFC after: 3 days (to 15 only)
Discussed with: ivy
Differential Revision: https://reviews.freebsd.org/D55526
Bourne shell -> POSIX shell
The FreeBSD shell is a POSIX compatible shell. It evolved over several
decades from the Almquist shell, which was preceeded a decade before
that by the Bourne shell. Most readers today have never seen a Bourne
shell. If someone wants to learn to use our shell, they need to look for
tutorials on the POSIX shell. Align descriptions through out the tree
with this reality, consistent with it's manual and common parlance.
We made a similar change to the doc tree in b4d6eb01540fe.
MFC after: 3 days
Reviewed by: carlavilla
Differential Revision: https://reviews.freebsd.org/D56382
libthr.3: describe SIGTHR
Explain how SIGTHR is used and that it should be not touched by user
code. Note about SIGLIBRT.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D56384
libthr.3: describe what we mean by C runtime environment.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D56384
netstat: Add -F support for -g
This change adds the ability to examine the contents of multicast
routing tables for other FIBs without the need for executing
`netstat` with `setfib(1)`.
MFC after: 3 days
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D56205
Reviewed by: glebius, markj, zlei
(cherry picked from commit cff675e83cdb6c9027e94df9d010439e42e27dee)
sound examples: Add mmap example
This example opens separate OSS capture and playback channels in mmap
mode, places them into a sync group, and starts them together so both
ring buffers advance on the same device timeline. It then monitors the
capture mmap pointer with SNDCTL_DSP_GETIPTR, converts that pointer into
monotonic absolute progress using the reported block count, and copies
newly recorded audio from the input ring to the matching region of the
output ring.
The main loop is driven by an absolute monotonic frame clock rather than
a fixed relative usleep delay. Wakeups are scheduled from the sample
rate using a small frame step similar to the SOSSO timing model, while
the audio path itself stays intentionally simple: just copy input to
output, with no explicit xrun recovery or processing beyond ring
wraparound handling.
MFC after: 1 week
Reviewed by: christos
Differential Revision: https://reviews.freebsd.org/D53749