Commit graph

22805 commits

Author SHA1 Message Date
Timo Völker
2927ebde30 sctp, tcp, udp: improve deferred computation of checksums
When the SCTP, TCP, or UDP implementation send a packet, it does not
compute the corresponding checksum but defers that. The network layer
will determine whether the network interface selected for the packet
has the requested capability and computes the checksum in software,
if the selected network interface doesn't have the requested
capability.
Do this not only for packets being sent by the local SCTP, TCP,
and UDP stack, but also when forwarding packets. Furthermore, when
such packets are delivered to a local SCTP, TCP, or UDP stack, do not
compute or validate the checksum, since such packets never have been on
the wire.
This allows to support checksum offloading also in the case of local
virtual machines or jails.
Support for epair, vtnet, and tap interfaces will be added in
separate commits.

Reviewed by:		kp, rgrimes, tuexen, manpages
Differential Revision:	https://reviews.freebsd.org/D51475

(cherry picked from commit bcb298fa9e23c1192c5707086a67d3b396186abc)
2025-10-23 08:10:56 +02:00
Michael Tuexen
2f2e8368a3 mbuf.9: describe checksum offloading for SCTP
This describes the current status of the implementation.
While there, be a bit more precise on how long the checksum
computation is delayed.

Reviewed by:		Timo Völker, bcr
Differential Revision:	https://reviews.freebsd.org/D51590

(cherry picked from commit fe35f275ab0240cb5ed05484c943293a71aadb5f)
2025-10-23 08:10:52 +02:00
Michael Tuexen
63f53b6f3e vtnet.4: use transmit checksum offloading
Use transmit checksum offloading instead transmission checksum
offloading to be consistent with other man pages.

Reported by:	Peter Lei
Sponsored by:	Netflix, Inc.

(cherry picked from commit c7263f873ee9abb772f67b5536e2380a046e1b94)
2025-10-10 13:33:44 +02:00
Michael Tuexen
c7cd4884ca vtnet: disable hardware TCP LRO by default
Hardware TCP LRO results in problems in settings with IP forwarding
being enabled. In case of nodes without IP forwarding, using
software LRO is also beneficial in general, since it can provide better
information about what was received on the wire.
Therefore, disable hardware TCP LRO by default.
By tuning the loader tunable, this can be changed.

PR:			263229
Reviewed by:		Timo Völker
Differential Revision:	https://reviews.freebsd.org/D52684

(cherry picked from commit 6e4b811009d63f33c59d51f28fd4a030ca90843e)
2025-10-10 13:33:17 +02:00
Michael Tuexen
b0b3245d3d vtnet: improve interface capability handling
Enable the handling of the IFCAP_RXCSUM_IPV6 handling by handling
IFCAP_RXCSUM and IFCAP_RXCSUM_IPV6 as a pair. Also make clear, that
software and hardware LRO require receive checksum offload.

Reviewed by:		Timo Völker
Differential Revision:	https://reviews.freebsd.org/D52682

(cherry picked from commit eaf619fddcb21859311b895a0836da3171a01531)
2025-10-10 13:33:10 +02:00
Timo Völker
4ac0fb6ca4 vtnet: deprecate loader tunable fixup_needs_csum
If this tunable is enabled and vtnet receives a packet with
VIRTIO_NET_HDR_F_NEEDS_CSUM set, vtnet computes the TCP/UDP checksum
and writes it in the checksum field.
This was somewhat useful when vtnet pretended that such a packet has
a correct checksum and set the mbuf flag CSUM_DATA_VALID.
But this is not the case anymore.

Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D52546

(cherry picked from commit 5da388d93917f5fa74022960cc65452592f71539)
2025-10-10 13:32:59 +02:00
Timo Völker
52cbb08e60 vtnet: improve checksum offloading
When transmitting a packet over the vtnet interface, map the
csum flags CSUM_DATA_VALID | CSUM_PSEUDO_HDR to the virtio
flag VIRTIO_NET_HDR_F_DATA_VALID.
When receiving a packet over the virtio network channel, translate
the virtio flag VIRTIO_NET_HDR_F_NEEDS_CSUM not to CSUM_DATA_VALID |
CSUM_PSEUDO_HDR, but to CSUM_TCP, CSUM_TCP_IPV6, CSUM_UDP, or
CSUM_UDP_IPV6.
The second change fixes a series of issue related to checksum
offloading for if_vtnet.
While there, improve the stats counters to allow a detailed view
on what is going on in relation to checksum offloading.

PR:			165059
Reviewed by:		tuexen, manpages
Differential Revision:	https://reviews.freebsd.org/D51686

(cherry picked from commit 3008f30d2c2cabdd7e17f7fb922139da8681ffbd)
2025-10-10 13:31:36 +02:00
Michael Tuexen
911cfd88c0 vtnet.4: remove stray line
Reported by:	Timo Völker
Fixes:		ac87d70563f8 ("vtnet.4: improve existing descriptions and add missing ones")
Sponsored by:	Netflix, Inc.

(cherry picked from commit 491986942dd2b3be8a6f232c487b3bb7c1ea412b)
2025-10-10 13:31:32 +02:00
Michael Tuexen
7941abc3ed vtnet.4: improve existing descriptions and add missing ones
Improve several descriptions for loader tunables and add descriptions
of the statistics provided by read only sysctl-variables.

Reviewed by:		bcr
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D51985

(cherry picked from commit ac87d70563f85d53575956c6fe40615b2e501c13)
2025-10-10 13:30:45 +02:00
Michael Tuexen
69287ad075 vtnet.4: update description of loader tunables
This is based on the description of sysctl -d.

Reviewed by:		Timo Völker, bcr
Differential Revision:	https://reviews.freebsd.org/D51604

(cherry picked from commit 0ded4647215cffde9076ab4e82870b0f491bd0b2)
2025-10-10 13:30:33 +02:00
Timo Völker
57f383bbc6 epair: add support for checksum offloading
Add capabilities RXCSUM and RXCSUM6 as well as TXCSUM and TXCSUM6 for
for receive and transmit checksum offloading for TCP and UDP to the
epair interface and enable them by default.
RXCSUM and RXCSUM6 are enabled because an epair interface may receive
a packet with the csum_flag CSUM_DATA_VALID set, which is expected
only if these capabilities are enabled. Since it seems not helpful to
remove this flag, it is not possible to disable these capabilities.
TXCSUM and TXCSUM6 are synchronized between the two epair interface
ends. If enabled/disabled on one end, it will be enabled/disabled on
the other end. If the sending epair interface end has TXCSUM or TXCSUM6
enabled and the receiving end is in a bridge, it is assumed that all
interfaces in the bridge have that capability enabled. Otherwise the
bridge would have disabled that capability on the receiving epair
interface end in the bridge which would have disabled that capability
on the sending epair interface end as well due to the synchronization.

Reviewed by:		bcr, Seyed Pouria Mousavizadeh Tehrani
Differential Revision:	https://reviews.freebsd.org/D51639

(cherry picked from commit e4ea162509e400340a2bc3e755071a92f3465e2d)
2025-10-07 12:15:01 +02:00
Ronald Klop
2d705b23bf 590493c1:
if_epair(4): use ether_gen_addr(9) for stable MAC address

Before this change epair interfaces get a random MAC. This does
not help dhcp/dyndns when an epair gets destroyed/recreated
after restart of a jail.

With this change:
$ sysctl net.link.epair.ether_gen_addr=0
$ ifconfig epair8 create > /dev/null; ifconfig epair8a | grep ether; ifconfig epair8b | grep ether; ifconfig epair8a destroy
	ether 02:cb:78:56:e4:0a
	ether 02:cb:78:56:e4:0b
$ ifconfig epair8 create > /dev/null; ifconfig epair8a | grep ether; ifconfig epair8b | grep ether; ifconfig epair8a destroy
	ether 02:8b:9b:6a:8f:0a
	ether 02:8b:9b:6a:8f:0b

$ sysctl net.link.epair.ether_gen_addr=1
$ ifconfig epair8 create > /dev/null; ifconfig epair8a | grep ether; ifconfig epair8b | grep ether; ifconfig epair8a destroy
	ether 58:9c:fc:10:2b:b4
	ether 58:9c:fc:00:39:10
$ ifconfig epair8 create > /dev/null; ifconfig epair8a | grep ether; ifconfig epair8b | grep ether; ifconfig epair8a destroy
	ether 58:9c:fc:10:2b:b4
	ether 58:9c:fc:00:39:10

A follow up commit will change the default to 1 in main.

Approved by:	bz,ivy,kp
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D51157

78537728:
Document tunable net.link.epair.ether_gen_addr

Approved by:	hrs
Fixes:	590493c1419092e98f7ad1dcadb886973502341e ("if_epair(4): use ether_gen_addr(9) for stable MAC address")
Differential Revision: https://reviews.freebsd.org/D51861

(cherry picked from commit 590493c1419092e98f7ad1dcadb886973502341e)
(cherry picked from commit 78537728efc5387558c97ba2730ce746d6259013)
2025-10-07 12:14:51 +02:00
Franco Fichtner
45e47679fe rc: also run NAME_setup on NAME_reload
Reload is used for service reconfiguration as well
and lacks a NAME_prepend-like mechanism so it makes
sense to extend the NAME_reload hook into this
action.

precmd may use configuration checks and blocks setup
from doing its designated work (e.g. nginx). In moving
the invoke of the setup script in front allows us to
provide custom scripts for config file generation and
fixing prior to precmd checking configuration integrity.

Also introduce _run_rc_setup to separate the launcher
from the main one. Let it run correctly in the case
of restart_precmd and block further execution as
would be the case in start due to the internal plumbing
of restart being split into calling stop and start
afterwards.

PR: https://reviews.freebsd.org/D36259
2025-07-09 10:05:48 +02:00
Franco Fichtner
3ff0d1f502 etc: OPNsense customisations
o add more key bindings to .cshrc
o add .vimrc to base installation
o disable fortune cookie
2025-07-09 10:05:46 +02:00
Hareshx Sankar Raj
6f3c8060d5 qat: add disable safe dc mode for QAT SPR devices
Build and sysctl configuration modes are introduced for QAT SPR
devices to disable safe dc mode. A new QAT driver build option
‘QAT_DISABLE_SAFE_DC_MODE’ is required to build the QAT driver
with code that allows a request to be sent to FW to override the
‘History Buffer’ mitigation. Default QAT driver builds do not
include this ‘QAT_DISABLE_SAFE_DC_MODE’ build option. Even if the
QAT driver was built with code that allows a request to be sent to
FW to override the ‘History Buffer’ mitigation, the QAT driver must
still be configured using sysctl to request an override of the
‘History Buffer’ mitigation if desired. The default QAT driver
configuration option sysctl dev.qat.X.disable_safe_dc_mode does not
allow override of the mitigation. The new sysctl attribute
disable_safe_dc_mode is to be set to 1 for overriding the history
buffer mitigation. Firmware for qat_4xxx is updated for this change.
If this mode is enabled, decompression throughput increases but may
result in a data leak if num_user_processes is more than 1.
This option is to be enabled only if your system is not prone to
user data leaks.

Reviewed by:	markj, ziaee
MFC after:	2 weeks
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D50379

(cherry picked from commit 5a8e5215cef0dac1115853889e925099f61bb5fa)
2025-07-09 10:05:45 +02:00
Lexi Winter
cd5b92eb56 bridge: allow IP addresses on members to be disabled
add a new sysctl, net.link.bridge.member_ifaddrs, which defaults to 1.

if it is set to 1, bridge behaviour is unchanged.

if it is set to 0:

- an interface which has AF_INET6 or AF_INET addresses assigned cannot
  be added to a bridge.
- an interface in a bridge cannot have an AF_INET6 or AF_INET address
  assigned to it.
- the bridge will no longer consider the lladdrs on bridge members to be
  local addresses, i.e. frames sent to member lladdrs will not be
  processed by the host.

update bridge.4 to document this behaviour, as well as the existing
recommendation that IP addresses should not be configured on bridge
members anyway, even if it currently partially works.

in testing, setting this to 0 on a bridge with 50 member interfaces
improved throughput by 22% (4.61Gb/s -> 5.67Gb/s) across two member
epairs due to eliding the bridge member list walk in GRAB_OUR_PACKETS.

Reviewed by:	kp, des
Approved by:	des (mentor)
Differential Revision:	https://reviews.freebsd.org/D49995

(cherry picked from commit 0a1294f6c610948d7447ae276df74a6d5269b62e)
2025-07-09 10:05:41 +02:00
Doug Rabson
1ca2f5d1f7 Add an implementation of the 9P filesystem
This is derived from swills@ fork of the Juniper virtfs with many
changes by me including bug fixes, style improvements, clearer layering
and more consistent logging. The filesystem is renamed to p9fs to better
reflect its function and to prevent possible future confusion with
virtio-fs.

Several updates and fixes from Juniper have been integrated into this
version by Val Packett and these contributions along with the original
Juniper authors are credited below.

To use this with bhyve, add 'virtio_p9fs_load=YES' to loader.conf. The
bhyve virtio-9p device allows access from the guest to files on the host
by mapping a 'sharename' to a host path. It is possible to use p9fs as a
root filesystem by adding this to /boot/loader.conf:

	vfs.root.mountfrom="p9fs:sharename"

for non-root filesystems add something like this to /etc/fstab:

	sharename /mnt p9fs rw 0 0

In both examples, substitute the share name used on the bhyve command
line.

The 9P filesystem protocol relies on stateful file opens which map
protocol-level FIDs to host file descriptors. The FreeBSD vnode
interface doesn't really support this and we use heuristics to guess the
right FID to use for file operations.  This can be confused by privilege
lowering and does not guarantee that the FID created for a given file
open is always used for file operations, even if the calling process is
using the file descriptor from the original open call. Improving this
would involve changes to the vnode interface which is out-of-scope for
this import.

Differential Revision: https://reviews.freebsd.org/D41844
Reviewed by: kib, emaste, dch
MFC after: 3 months
Co-authored-by: Val Packett <val@packett.cool>
Co-authored-by: Ka Ho Ng <kahon@juniper.net>
Co-authored-by: joyu <joyul@juniper.net>
Co-authored-by: Kumara Babu Narayanaswamy <bkumara@juniper.net>
2025-06-20 09:54:02 +02:00
Kenneth Raplee
cd46420a61 ure.4: add a HARDWARE section + add RTL8156BG as a compatible controller
While here, rename all instances of "RealTek" to "Realtek" for
authenticity.

Approved by:	re (cperciva)
Reviewed by: imp, lwshu, zaiee
Pull Request: https://github.com/freebsd/freebsd-src/pull/1649

(cherry picked from commit 76ed6f2db316bf2240d36d3c92316da4d1e5b174)
(cherry picked from commit f336a04960b608d2caeaf964663c3a8425f31d71)
2025-06-03 11:35:21 -07:00
Alexander Ziaee
6fe425b4c4 ure.4: description consistencies + tag spdx
+ consistent document description languague with other USB-BaseT drivers
+ mention newly added adapters from 6ea4d9
+ attempt to mention rgephy(4) phys feed into ure interfaces

Approved by:	re (cperciva)
Fixes:		6ea4d9 (Move RTL8156 from cdce(4) to ure(4))
MFC after:	3 days

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1384

(cherry picked from commit 4c72525953fdf618a3fc0a45f3ef3f071dcc0c52)
(cherry picked from commit b529a06d1db4bb27895465ba8692d6c4427e32d8)
2025-06-03 11:35:11 -07:00
Kenneth Raplee
9efdb081e8 puc.4: Add a HARDWARE section based off device data from pucdata.c
While here, change applicable uses of "ports" to "adapters" to be more
precise and improve searchability.

This is a 14.3 candate since it affects (positively) the release notes
generated from the hardware secionts.

Approved by:	re (cperciva)
MFC After: 3 days
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1663

(cherry picked from commit 794ee43e75066bfcbc00545b5bf600b9cda2d5f1)
(cherry picked from commit 827153d21219f76cf006d50af4cdf85f22b75de0)
2025-06-03 11:35:01 -07:00
Philip Paeps
a48dc9b03b zoneinfo: don't install version
The commit teaching the build to install tzdata.zi for libcxx also
instals version.  It turns out this makes at least one piece of third
party software cry: rubygem-tzinfo expects any file in zoneinfo to be at
least 44 bytes long.  Clearly this is a bug in rubygem-tzinfo but since
nothing actually uses version, we may as well not install it ... as we
did previously.

Reported by:	delphij
Fixes:		91506dba7f2e zoneinfo: also install tzdata.zi and version
MFC after:	1 day
Approved by:	re (cperciva)

(cherry picked from commit 23a0c88b037625745b88d1661b9552f1ebe97ebc)
(cherry picked from commit 16ad4d77121dd117513c6044c0f076df144fa368)
2025-05-24 11:33:02 +06:00
Alexander Ziaee
5af0942052
mtkswitch.4: Initial manual page
Add a stub manual only saying what it is, how to include it, what is
supported, and since when. This plugs the mtkswitch driver into the
manual subsystem and the release hardware notes.

MFC to:			14.3
MFC after:		3 days
Reviewed by:		adrian, carlavilla
Approved by:		carlavilla (mentor)
Approved by:		re (cperciva)
Differential Revision:	https://reviews.freebsd.org/D50412

(cherry picked from commit 37f00bc257d0e785fad1d0ffbd7dcbf09e863417)
(cherry picked from commit f31ac06711e69aed7cb4b38d8eb2aba2d7149ed8)
2025-05-21 23:01:36 -04:00
Alexander Ziaee
dc8ade18cf
ip17x.4: Initial manual page
Add a stub manual only saying what it is, how to include it, what is
supported, and since when. This plugs the ip17x driver into the manual
subsystem and the release hardware notes.

MFC to:			14.3
MFC after:		3 days
Reviewed by:		adrian, carlavilla
Approved by:		carlavilla (mentor)
Approved by:		re (cperciva)
Differential Revision:	https://reviews.freebsd.org/D50411

(cherry picked from commit f750a114d2c50c4d25d304dbf1dabfd3ae3aa013)
(cherry picked from commit ded154a1df97e3340f129394cbcaa1a50439d1bf)
2025-05-21 23:01:22 -04:00
Alexander Ziaee
86b04d37f0
qat.4: Cleanup
+ copyright symbols do not belong in Nd's (apropos results)
+ move hardware to HARDWARE for inclusion in the hw release notes
+ improve sysctls
+ lines which say nothing removed
+ links moved to see also
+ spacing and markup corrections

MFC after:		3 days
Reviewed by:		markj, mhorne
Approved by:		mhorne (mentor)
Approved by:		re (cperciva)
Differential Revision:	https://reviews.freebsd.org/D50381

(cherry picked from commit c1d9b2c9b03cade19cb4f94d3e29fba7179ac11a)
(cherry picked from commit 802edf23079388447659136805d97b95b0f90899)
2025-05-21 23:00:56 -04:00
Alexander Ziaee
b7fc3fbe32
e6000sw.4: Add HISTORY
MFC after:		3 days
Reviewed by:		mhorne
Approved by:		mhorne (mentor)
Approved by:		re (cperciva)
Differential Revision:	https://reviews.freebsd.org/D50358

(cherry picked from commit c808bee35b1129abd9af137204ebd15559b90b5b)
(cherry picked from commit 6426b01310122c7563d982ec21c91b98f3f5bd3b)
2025-05-21 23:00:39 -04:00
Alexander Ziaee
ee743b40ac
e6060sw.4: Improve title and add HARDWARE
For visibility in apropos and inclusion in the hardware release notes.

MFC after:		3 days
Reviewed by:		adrian, mhorne
Approved by:		mhorne (mentor)
Approved by:		re (cperciva)
Differential Revision:	https://reviews.freebsd.org/D50321

(cherry picked from commit bef89c155e77dd471af596a43f3914b754cc5155)
(cherry picked from commit 5e0e046d95a92aab8bea856fe0008870ee11bfc9)
2025-05-21 23:00:26 -04:00
Alexander Ziaee
fddd2c4d37
ar40xx.4: Initial manual page
For inclusion in apropos and the hardware release notes. While here,
add xrefs to this page and the previous e6000sw in etherswitch.4.

MFC after:		3 days (but adjusted for 14.3)
Reported by:		adrian
Reviewed by:		adrian, mhorne
Approved by:		mhorne (mentor)
Approved by:		re (cperciva)
Differential Revision:	https://reviews.freebsd.org/D50324

(cherry picked from commit 91c9751c3913497db2fbad1fcf7491557bbd2a75)
(cherry picked from commit 17e9eb1e0eb721e2400232c71f20bc490c416c60)
2025-05-21 23:00:12 -04:00
Alexander Ziaee
5dbcb9bfd0
arswitch.4: Improve title and add HARDWARE
For visibility in apropos and inclusion in the hardware release notes.

MFC after:		3 days
Reviewed by:		adrian (previous), mhorne
Approved by:		mhorne (mentor)
Approved by:		re (cperciva)
Differential Revision:	https://reviews.freebsd.org/D50322

(cherry picked from commit 9692d5e15e9bd7e628b06d655522477ce8c5b6fe)
(cherry picked from commit 1343a5b616ec4e11047c5024bb844e7275f84ddd)
2025-05-21 22:58:47 -04:00
Alexander Ziaee
66a6607089
e6000sw.4: Initial manual page
For inclusion in the HW relnotes.

MFC after:		3 days, note removed entries which didn't mfc
Reviewed by:		adrian, ivy, mhorne
Approved by:		mhorne (mentor)
Approved by:		re (cperciva)
Differential Revision:	https://reviews.freebsd.org/D50293

(cherry picked from commit 6da793a8caa15ee2cbb984ea39ac87c6cd2fdf63)
(cherry picked from commit d0e29f92f7a252b382d76c1e6bac33d8424af5fa)
2025-05-21 22:56:59 -04:00
Dag-Erling Smørgrav
747efc2aee namei: Update documentation.
This should have been done 2+ years ago when the td argument was dropped
from NDINIT() and the NDFREE() macro and the SAVENAME and SAVESTART
flags were retired.

Approved by:	re (cperciva)
MFC after:	3 days
Fixes:		7e1d3eefd4 ("vfs: remove the unused thread argument from NDINIT*")
Fixes:		269c564b90 ("vfs: retire NDFREE")
Sponsored by:	NetApp, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D50375

(cherry picked from commit ee84b4e2fdf09f9a6dfa43e0931d8671cc15ebf9)
(cherry picked from commit 68bc635cc9b099fb03cfcd519046c385af0c5355)
2025-05-21 19:37:10 +02:00
Bjoern A. Zeeb
361a8fdefa iwlwifi.4: Update modes for recent 802.11ac
By:			ziaee
Reported by:		Pat Maddox <pat@patmaddox.com>
Reviewed by:		bz (previous version), emaste, mhorne
Differential Revision:	https://reviews.freebsd.org/D49937

iwlwifi: update man pages for generations, firmware. and 11n/11ac

Put Intel's iwlwifi better in context to iwm, iwx and iwn.
Document the important tunables so users know where to go.
Document the port/package for firmware where firmware is now
maintained.
Adjust wording and table for the firmware and a flavor column.
Update History sections for 11n/11ac support as well as firmware
module removal from base.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	ziaee, emaste (comments)
Differential Revision: https://reviews.freebsd.org/D50319

Approved by:	re (cperciva)

(cherry picked from commit c33945a112c84795c7bd87a8e94d0cf322ef5000)
(cherry picked from commit a7e183c0c9a5579cdaa3e2ff9597e5e3d41dbdb4)
(cherry picked from commit 4ae64bd33f24cff90ff75efe67176a6df1c3af62)
2025-05-19 19:28:40 +00:00
Roger Pau Monné
a7277b98b8 xen: improve man (4) page
Update the xen(4) man page to reflect the current support status.

Approved by: re (cperciva)
Reported by: kevans
Reviewed by: bcr kevans imp
Differential revision: https://reviews.freebsd.org/D43373

(cherry picked from commit 82126ef92fdb3c13a67ad44d33c0fe6ea479c01a)
(cherry picked from commit 7dc0a9fa76a8df6dfaf26ff36a11aa9fe060a201)
2025-05-19 10:01:30 -07:00
Olivier Certner
10944406be
queue(3): Install *_SPLIT_AFTER() links to the main manual page
Completes commit "queue(3): New *_SPLIT_AFTER(), *_ASSERT_EMPTY(),
*_ASSERT_NONEMPTY()" (c02880233949b01f).

MFC after:      1 day
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit c071616b06aa0f51ac4314f989c472d0268c2ddb)
(cherry picked from commit eca0ce8afb15ef9f01703c4d15273eaf66eb63f5)

Approved by:    re (cperciva)
2025-05-13 14:41:33 +02:00
Olivier Certner
d156cabc0f
sysctl.9: Constant integer example: Do not promote 'debug.sizeof'
Replace it with another one, selected from current in-tree uses.

MFC after:      1 day
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 129a6cf886e108b67f637a271f003519c99b9abd)
(cherry picked from commit 1ca993dd454445ad766f8b8b39103e09c1dccce9)

Approved by:    re (implicit)
2025-05-13 14:41:33 +02:00
Brooks Davis
f383cfc03b sys.mk: Improve ports compatibility hack guard
Back in 9ca5434380 and include of bsd.cpu.mk in sys.mk was added as a
hack for ports Makefiles.  This works fine in general (for values of
fine that include not being able to use MK_ variables in bsd.cpu.mk),
but has surprising effects on MacOS with a case insensitive filesystems.
There we build things in paths like share/docs/IPv6 where
../../Mk/bsd.port.mk matches share/mk/bsd.port.mk.

Fix this issue by checking for ../../Mk/Uses which seems highly unlikely
to match something in share/mk.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D49232

(cherry picked from commit e62ff34a6761025203b77ffb241c926ac8d218c8)
2025-05-01 21:14:24 +01:00
Olivier Certner
5ef005d378
queue.3: Update .Dd
Noted by:       lwhsu
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit c3b03044e7e3a0a37159acf97d2f94d3a21449f3)
2025-05-01 21:48:47 +02:00
Olivier Certner
64ca7e040a
queue(3): Debug macros: Finer control knobs, userland support
Support enabling debugging macros for userland and _STANDALONE builds,
in addition to the already existing kernel support.  On runtime error,
panic() is used for kernel and _STANDALONE builds, and a simple
fprintf() + abort() combination for userland ones.  These can be
overriden if needed by defining the QMD_PANIC() and/or QMD_ASSERT()
macros.

The expansion of queue debug macros can now be controlled more finely
thanks to the QUEUE_MACRO_DEBUG_ASSERTIONS and
QUEUE_MACRO_NO_DEBUG_ASSERTIONS macros.  The first one serves to
forcibly enable debug code and the second to forcibly disable it.  These
are meant to be used as compile options only, and should normally not be
defined in a source file.  It is an error to have both of them defined.

If none of the two above-mentioned macros are defined, an automatic
determination is performed.  When compiling kernel code,
QUEUE_MACRO_DEBUG_ASSERTIONS is defined if INVARIANTS has been defined
(as before).  For userland and _STANDALONE builds, no debug code is ever
automatically inserted even if NDEBUG is not defined, as doing so would
inflate code size and users may want to have working assert() calls
without this overhead by default.

In the manual page, document check code control under DIAGNOSTICS.
While here, rework a bit the rest of the DIAGNOSTICS section.

Reviewed by:    markj (older version)
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D49973

(cherry picked from commit 1c5fea9e8b563186b8f5773064458c4ecf2d7004)
2025-05-01 21:46:38 +02:00
Olivier Certner
c4ee6d4acb
queue(3): New *_SPLIT_AFTER(), *_ASSERT_EMPTY(), *_ASSERT_NONEMPTY()
*_SPLIT_AFTER() allows to split an existing queue in two.  It is the
missing block that enables arbitrary splitting and recombinations of
lists/queues together with *_CONCAT() and *_SWAP().

Add *_ASSERT_NONEMPTY(), used by *_SPLIT_AFTER().

Reviewed by:    markj
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D49608 (stailq)
Differential Revision:  https://reviews.freebsd.org/D49969 (rest)

(cherry picked from commit c02880233949b01fcfb2067962596f5c05553471)
2025-05-01 21:37:04 +02:00
Maxim Konovalov
ce9eaeeb92 bsd-family-tree: add OpenBSD 7.7 release
(cherry picked from commit b08bc953f1b704573838ddf34348df67d0c7fcea)
2025-05-01 12:34:30 -04:00
Maxim Konovalov
4955144080 bsd-family-tree: add FreeBSD 13.5
(cherry picked from commit 2bc9d7a3ac8dce2138e409b31a7f727303b38167)
2025-05-01 12:34:01 -04:00
Gordon Bergling
fb85ce09f6 ascii(7): Correct the history section
The man page ascii(7) first appears in the first edition manual.

Reviewed by:	imp, Alexander Ziaee
Obtained from:	OpenBSD
Differential Revision:	https://reviews.freebsd.org/D48224

(cherry picked from commit 6145586a6c74e99969d74384066ecaf6580a8015)
2025-05-01 15:48:48 +02:00
Alexander Ziaee
72f62f3367
networking.7: Clarifications
+ standardize my license formatting with style guides
+ remove loading now-automatically loaded last-gen tethering driver
+ show contemporary internal hardware drivers for examples
+ tweak example language to hopefully improve clarity

MFC after:		3 days
Reviewed by:		adrian, mhorne, Quentin Thebault
Approved by:		mhorne (mentor)
Differential Revision:	https://reviews.freebsd.org/D49762

(cherry picked from commit 70b66cf804345902bb5baadd27448c4bf5251552)
2025-05-01 08:18:16 -04:00
Philip Paeps
4aed98a65a zoneinfo: also install tzdata.zi and version
Build and install the shrunk version of the time zone database required
by libc++ 19 std::chrono::current_zone (etc).  While here, also install
the tzdata 'version' file to align more closely with other vendors.

PR:		282377
Reviewed by:	dim, emaste, imp
Differential Revision:	https://reviews.freebsd.org/D49577

(cherry picked from commit 91506dba7f2eb147eeb55ec30640bc11755a1e8e)
2025-05-01 08:51:12 +08:00
Baptiste Daroussin
004f8bd947 usb_vendors: update to 2025-04-01
(cherry picked from commit 8c3aac52f5efe80720f35c578a9644609000a99c)
2025-04-30 10:03:27 +02:00
Baptiste Daroussin
9225ca95c0 pci_vendors: update to 2025-03-09
(cherry picked from commit 9b397d784bcfff49f467b879f0d425412d55b094)
2025-04-30 10:03:27 +02:00
Siva Mahadevan
86baac4a2e termcap: add entry for Alacritty
Out of the box on other platforms, alacritty reports `TERM=alacritty`. This requires an updated terminfo/termcap database that contains an entry for `alacritty`. Prior to this change, when you ssh into a FreeBSD machine using a default configuration of alacritty on a client system, it reports this in `motd(5)`:

```
No entry for terminal type "alacritty";
using dumb terminal settings.
```

This change adds a termcap entry for alacritty, converted from the upstream-provided `alacritty.info` using `tic -C`.

Signed-off-by: Siva Mahadevan <me@svmhdvn.name>

MFC After:	3 days

(cherry picked from commit 7a4c662f407f074287f42cf0652dff74a294bf0e)
2025-04-30 10:03:27 +02:00
Dave Cottlehuber
f5418217db release: use "runtime" instead of "minimal" for OCI image name
The runtime name is taken from the main pkg-base package that this
image is built off.

Sponsored by:	SkunkWerks, GmbH
MFC after:	3 days
Reviewed by:	dfr, emaste
Differential Revision:	https://reviews.freebsd.org/D50043

(cherry picked from commit a0165254bfeb5e310f92d4e0c88fcb5c6ea802bf)
2025-04-30 07:55:41 +00:00
Vladimir Kondratyev
7545c8c116 hidraw(4): Add additional hidraw input/output report ioctls
to Linux hidraw compatibility API.

Respective Linux commit f43d3870cafa made by Dean Camera message is:

Currently the hidraw module can only read and write feature HID reports on
demand, via dedicated ioctls. Input reports are read from the device through
the read() interface, while output reports are written through the write
interface().

This is insufficient; it is desirable in many situations to be able to read and
write input and output reports through the control interface to cover
additional scenarios:

  - Reading an input report by its report ID, to get initial state
  - Writing an input report, to set initial input state in the device
  - Reading an output report by its report ID, to obtain current state
  - Writing an output report by its report ID, out of band

This patch adds these missing ioctl requests to read and write the remaining
HID report types. Note that not all HID backends will neccesarily support this
(e.g. while the USB link layer supports setting Input reports, others may not).

FreeBSD native uhid(4) compatible API already has similar ioctls.

MFC after:	3 days

(cherry picked from commit fd6690e2d5cd5b15fce2c74ab0cac77a83514f6a)
2025-04-30 10:32:22 +03:00
Vladimir Kondratyev
9b5f1a6cd6 acpi_asus_wmi(4): Improve keyboard backlight support.
- Fix maximal keyboard backlight level, Although Linux source code
  comment says that backlight level is encoded in 3 bits of data,
  actual code limits maximum level to 3.
- Add backlight(9) support for keyboard
- Turn off/on keyboard backlight on suspend/resume

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D48983

(cherry picked from commit f134662a1a5726d78880385002a03b8fe68805f6)
2025-04-30 10:32:22 +03:00
John Baldwin
b8b5dbdb93 pci: Add helper routines to manage PME in device drivers
pci_has_pm is a quick check that returns true if a PCI device supports
the power management capability.

pci_enable_pme can be used in DEVICE_SUSPEND driver methods to enable
PME# during suspend.

Reviewed by:	Krzysztof Galazka <krzysztof.galazka@intel.com>x
Differential Revision:	https://reviews.freebsd.org/D49250

(cherry picked from commit e5cbf0e881fa1851912be77c62aa7ab17f844c3d)
2025-04-29 10:44:58 -04:00