FreeBSD/src 895a0aelib/libsys getsockopt.2, share/man/man4 divert.4

divert: Define semantics for SO_REUSEPORT_LB on divert sockets

Allow SO_REUSEPORT_LB to be set on divert sockets.  If set, then bind()
will add the socket to a "load-balancing group".  When a divert-to rule
matches a port with an associated group, the corresponding state ID is
used to select a specific socket from the group.  Packets without an
associated state are simply forwarded to the first socket in the group.
For now I only pass a state ID from pf, as I couldn't see a useful
identifier on the ipfw side.

This implementation is simple but has a caveat, that being that if
sockets are added to the group while flows are being processed, the size
of the group will change and this changes the mapping of state IDs to
sockets.  So, to get a consistent mapping, the divert socket application
must bind all of its sockets before any traffic is diverted by the
firewall.

Reviewed by:    glebius
MFC after:      1 month

    [3 lines not shown]
DeltaFile
+143-17sys/netinet/ip_divert.c
+21-3share/man/man4/divert.4
+5-1lib/libsys/getsockopt.2
+1-1sys/netinet/ip_var.h
+1-1sys/netinet/raw_ip.c
+1-1sys/netpfil/ipfw/ip_fw_pfil.c
+172-241 files not shown
+173-257 files

FreeBSD/src 9542ddbusr.sbin/bhyve pci_virtio_scsi.c pci_virtio_scsi.h

bhyve/virtio-scsi: Support multiple backends

In order to support multiple backends for virtio-scsi, we should isolate
the core of virtio-scsi from the backend-specific code. The existing
interface to CTL will become the new "CTL" backend for virtio-scsi.

Care has been taken to keep compatibility with previous configurations:
The first backend linked (CTL) will be the default backend if none is
specified, and it does provide a default configuration if no further
options such as targets are explicitly configured.

Reviewed by:    markj
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D53223
DeltaFile
+102-515usr.sbin/bhyve/pci_virtio_scsi.c
+394-0usr.sbin/bhyve/pci_virtio_scsi.h
+377-0usr.sbin/bhyve/pci_virtio_scsi_ctl.c
+30-14usr.sbin/bhyve/bhyve.8
+23-6usr.sbin/bhyve/bhyve_config.5
+1-0usr.sbin/bhyve/Makefile
+927-5356 files

FreeBSD/src ccb14beusr.sbin/bhyve pci_virtio_scsi.c pci_virtio_scsi.h

bhyve/virtio-scsi: Make all I/O processing parameters configurable

This includes:
- seg_max, the number of segments allowed in a single command
- {ctl,evt,req}_ringsz, the number of descriptors in a queue
- thr_per_q, the number of processing threads per request queue
- num_queues, the number of request queues

Reviewed by:    markj
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D54073
DeltaFile
+169-53usr.sbin/bhyve/pci_virtio_scsi.c
+57-23usr.sbin/bhyve/pci_virtio_scsi.h
+14-2usr.sbin/bhyve/bhyve_config.5
+12-0usr.sbin/bhyve/bhyve.8
+252-784 files

FreeBSD/src 19728f9usr.sbin/bhyve pci_virtio_scsi.c

bhyve/virtio-scsi: Implement task management functions

Currently, all I/O requests are queued internally, and a number of
threads will pick I/O requests of the queue and send them to CTL with
a synchronous CTL_IO ioctl. On the other hand, TMF requests are sent
to CTL immediately using the same synchronous ioctl.

Besides being unworkable for non-CTL backends such as for SCSI
passthrough, this simple approach may easily run into situations
where a TMF request operating on a particular I/O request is sent
to CTL while it is still on our queue and thus unknown to CTL.
In addition, for target and/or LUN resets we should really clear
our queue and return all outstanding I/O requests with a proper
status.

Reviewed by:    markj
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D53222
DeltaFile
+422-32usr.sbin/bhyve/pci_virtio_scsi.c
+422-321 files

FreeBSD/src 4151296usr.sbin/bhyve pci_virtio_scsi.c bhyve.8

bhyve/virtio-scsi: Support for multiple targets

Currently, virtio-scsi supports only one target with 16383 LUNs, which
fits nicely with what CTL provides. It would be useful to support more
than that, multiple targets each with 16383 LUNs.

While this can be useful with CTL by attaching each target to another
CTL target port, this will be necessary to support SCSI passthrough.

The new syntax for configuring targets will look like this:

-s X,virtio-scsi,target=/dev/foo,target=/dev/bar,target=4:/dev/baz

This will create the following configuration nodes:

pci.0.X.0.device=virtio-scsi
pci.0.X.0.target.0=/dev/foo
pci.0.X.0.target.1=/dev/bar
pci.0.X.0.target.4=/dev/baz

    [16 lines not shown]
DeltaFile
+318-45usr.sbin/bhyve/pci_virtio_scsi.c
+37-1usr.sbin/bhyve/bhyve.8
+24-4usr.sbin/bhyve/bhyve_config.5
+379-503 files

FreeBSD/src 9823698. RELNOTES

RELNOTES: Add entries for various commits through early March 2026

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56485
DeltaFile
+56-0RELNOTES
+56-01 files

FreeBSD/src 183dd2esys/dev/smartpqi smartpqi_discovery.c smartpqi_event.c

smartpqi: Add runtime sysctl for debug_level and log device state changes

The smartpqi driver did not log device add/remove or controller events
to syslog, and hw.smartpqi.debug_level could only be set at boot via
loader.conf with no runtime sysctl interface.

Add a read-write sysctl at dev.smartpqi.N.debug_level for runtime
debug level changes. Add device_printf calls for device addition,
removal, and controller events (hotplug, hardware, physical/logical
device, AIO state/config changes) so state changes always appear in
dmesg. Add DBG_DISC logging for discovery state transitions. Fix
spelling errors in strings and comments across the driver.

Bump driver version to 14.4691.1.2000 / 15.2.1.2000.

PR:             294161
Reviewed by:    imp
Approved by:    imp
MFC after:      2 weeks

    [4 lines not shown]
DeltaFile
+18-3sys/dev/smartpqi/smartpqi_discovery.c
+14-3sys/dev/smartpqi/smartpqi_event.c
+11-1sys/dev/smartpqi/smartpqi_main.c
+4-4sys/dev/smartpqi/smartpqi_defines.h
+3-3sys/dev/smartpqi/smartpqi_sis.c
+2-2sys/dev/smartpqi/smartpqi_misc.c
+52-165 files not shown
+62-2611 files

FreeBSD/src e1e281asys/dev/smartpqi smartpqi_discovery.c smartpqi_event.c

smartpqi: Add runtime sysctl for debug_level and log device state changes

The smartpqi driver did not log device add/remove or controller events
to syslog, and hw.smartpqi.debug_level could only be set at boot via
loader.conf with no runtime sysctl interface.

Add a read-write sysctl at dev.smartpqi.N.debug_level for runtime
debug level changes. Add device_printf calls for device addition,
removal, and controller events (hotplug, hardware, physical/logical
device, AIO state/config changes) so state changes always appear in
dmesg. Add DBG_DISC logging for discovery state transitions. Fix
spelling errors in strings and comments across the driver.

Bump driver version to 14.4691.1.2000 / 15.2.1.2000.

PR:             294161
Reviewed by:    imp
Approved by:    imp
MFC after:      2 weeks

    [4 lines not shown]
DeltaFile
+18-3sys/dev/smartpqi/smartpqi_discovery.c
+14-3sys/dev/smartpqi/smartpqi_event.c
+11-1sys/dev/smartpqi/smartpqi_main.c
+4-4sys/dev/smartpqi/smartpqi_defines.h
+3-3sys/dev/smartpqi/smartpqi_sis.c
+2-2sys/dev/smartpqi/smartpqi_request.c
+52-165 files not shown
+62-2611 files

FreeBSD/src 44eb288sys/dev/acpica acpi.c

acpi: On /dev/power suspend, trigger userspace notifications

On a suspend request via ioctl(), /dev/acpi (and compatible /dev/apm)
both call acpi_ReqSleepState() instead of directly calling
acpi_EnterSleepState().  The former does more checks, returns success if
the machine is already suspending, and notifies user space (via devd(8))
about the impending suspend.  In other words, it seems to have been
designed for user consumption more than the latter function.

So, use acpi_ReqSleepState() in place of acpi_EnterSleepState() in
acpi_pm_func(), which is ultimately called by power_pm_suspend(), itself
called by power_ioctl().  Other callers of power_pm_suspend() (such as
the console drivers) are also user-facing facilities, so should also
benefit from this change.

Reviewed by:    mhorne, imp
Tested by:      mhorne
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57239
DeltaFile
+1-1sys/dev/acpica/acpi.c
+1-11 files

FreeBSD/src ee7148fsys/dev/sound/pci/hda hdaa.c

snd_hda: Reassign duplicate HDMI/DP pin sequences instead of disabling

Some firmware (e.g. Apple EFI on Sandy Bridge Mac hardware) programs all
HDMI/DP output pins in an association with identical sequence numbers.

The existing code disables the entire association on the first
duplicate, leaving HDMI/DP audio non-functional.

For digital output pins (HDMI/DP) with seq=0 duplicates, search for the
next free sequence slot and reassign the duplicate rather than
disabling.

The seq=0 restriction targets the known Apple firmware pattern; any
other duplicate sequence is more likely a genuine firmware error and the
association is still disabled.

Update first after reassignment so that hpredir is not left pointing at
a stale sequence. Non-digital and input associations retain the existing
disable behaviour.

    [6 lines not shown]
DeltaFile
+45-4sys/dev/sound/pci/hda/hdaa.c
+45-41 files

FreeBSD/src c6cefcbsys/dev/sound/pci/hda hdaa_patches.c hdac.h

snd_hda: Patch Dell WYSE 7040

https://forums.freebsd.org/threads/dell-wyse-7040-thin-client-intel-i5-6500te-built-in-sound-alc255-mini-how-to.102656/

Reported by:    razif (on the forum)
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+9-0sys/dev/sound/pci/hda/hdaa_patches.c
+1-0sys/dev/sound/pci/hda/hdac.h
+10-02 files

FreeBSD/src fda33aeusr.sbin/bsnmpd/modules/snmp_pf pf_snmp.c

snmp_pf: fix refresh

Some refresh functions had two layers of 'do we need to refresh now?'
checks, leading to inconsistent refreshes.
Consolidate them.

PR:             291725
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit a862e4b5a27c356e2584ee74fd9e211c18b1b125)
DeltaFile
+3-12usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
+3-121 files

FreeBSD/src e0d4064usr.sbin/bsnmpd/modules/snmp_pf pf_snmp.c

snmp_pf: fix refresh

Some refresh functions had two layers of 'do we need to refresh now?'
checks, leading to inconsistent refreshes.
Consolidate them.

PR:             291725
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit a862e4b5a27c356e2584ee74fd9e211c18b1b125)
DeltaFile
+3-12usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
+3-121 files

FreeBSD/src f09c84a. Makefile

universe: emit warning instead of error for bad/missing KERNCONF

When doing a large `make universe` build with multiple KERNCONFS,
it should not be an error when a particular target has a missing
KERNCONF.

In this example,

```
$ make universe TARGETS='arm64 riscv' KERNCONFS='QEMU VIRT'
```

Currently, arm64 does not have a QEMU conf, and riscv
does not have a VIRT conf. However, this command should still
succeed instead of failing with the following message:

```
make[2]: /usr/src/Makefile:767: Target architecture for riscv/conf/VIRT unknown.  config(8) likely too old.
        in .for loop from /usr/src/Makefile:761 with kernel = VIRT

    [15 lines not shown]
DeltaFile
+5-1Makefile
+5-11 files

FreeBSD/src 6b1f521. Makefile, share/man/man7 build.7

universe: allow moving build logs to UNIVERSE_LOGDIR

This allows `make universe` or `make tinderbox`
to build from a read-only src tree.

Reviewed by:    ziaee, imp, delphij
Approved by:    lwhsu (mentor), emaste (mentor)
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55566

(cherry picked from commit 02ef0b6d76e9717b8e3182dd706e23fd2702701d)
DeltaFile
+8-9Makefile
+6-1share/man/man7/build.7
+14-102 files

FreeBSD/src b97ee5esys/dev/hwpmc hwpmc_ibs.c

hwpmc: Avoid panic on AMD cpus where IBS is not available

The recent IBS work intruduced a bug on older CPUs where the
IBS handler will be called on NMIs even when IBS is not initialized.
Work around this in the IBS handler by checking to see if ibs_pcpu
is NULL before accessing it.
DeltaFile
+3-0sys/dev/hwpmc/hwpmc_ibs.c
+3-01 files

FreeBSD/src 6e7c10clib/libc/posix1e acl_id_to_name.c acl_to_text_nfs4.c

acl_id_to_name.c: Fix printing of uids and gids

uid_t and gid_t are uint32_t (unsigned 32bit integers).
They are printed as signed integers when calling getfacl
(and other tools using the acl_to_text() libc function).
This causes uid/gids larger than 2G (214783648) to print
as negative numbers
- which causes problem with setfacl since the acl_from_text()
  libc function fails on negative numbers.

Reviewed by:    rmacklem
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D57179
DeltaFile
+2-2lib/libc/posix1e/acl_id_to_name.c
+2-2lib/libc/posix1e/acl_to_text_nfs4.c
+4-42 files

FreeBSD/src 4d80d49sys/fs/nfs nfs_commonkrpc.c nfs_commonsubs.c

nfs: Fix argument typo to avoid a crash

A typo resulted in the wrong argument for a bytewise
comparison that could result in a crash if
the incorrect argument was not a valid pointer.

This patch fixes the argument.

While investigating this, I noticed that the
correct argument was not being filled in as
required, so this patch fixes that, as well.

Somehow, recovery from a NFSv4.1/4.2 server
crash worked during testing, so this was not
detected.  The bug/patch only affects NFS
client mounts using NFSv4.1/4.2.

PR:     294925
Reported by:    Jov <amutu at amutu.com>
MFC after:      3 days
DeltaFile
+3-2sys/fs/nfs/nfs_commonkrpc.c
+3-0sys/fs/nfs/nfs_commonsubs.c
+6-22 files

FreeBSD/src be9f353bin/sh/tests/builtins read12.0 read11.0

Revert "sh/tests: Cut down builtins/read12.0 by 2 seconds"

Dag-Erling Smørgrav does not like this, but I do not understand why.

This reverts commit 1df431576f99c3cc26dd4ceb1a6eda864cc9f196.
DeltaFile
+6-8bin/sh/tests/builtins/read12.0
+1-2bin/sh/tests/builtins/read11.0
+7-102 files

FreeBSD/src 5b8f59econtrib/sqlite3 sqlite3.c shell.c, contrib/sqlite3/autosetup proj.tcl sqlite-config.tcl

sqlite3: Vendor import of sqlite3 3.53.1

Release notes at https://www.sqlite.org/releaselog/3_53_1.html.

Obtained from:  https://www.sqlite.org/2026/sqlite-autoconf-3530100.tar.g

Merge commit 'b00eb376e3fb28e738f9370552dae9d92c1fdd76' into sqlite3
DeltaFile
+11,180-5,219contrib/sqlite3/sqlite3.c
+9,171-5,882contrib/sqlite3/shell.c
+753-193contrib/sqlite3/sqlite3.h
+454-141contrib/sqlite3/autosetup/proj.tcl
+505-57contrib/sqlite3/tea/generic/tclsqlite3.c
+182-77contrib/sqlite3/autosetup/sqlite-config.tcl
+22,245-11,56919 files not shown
+22,595-11,83825 files

FreeBSD/src b00eb37. sqlite3.c shell.c, autosetup proj.tcl sqlite-config.tcl

sqlite3: Vendor import of sqlite3 3.53.1

Release notes at https://www.sqlite.org/releaselog/3_53_1.html.

Obtained from:  https://www.sqlite.org/2026/sqlite-autoconf-3530100.tar.gz
DeltaFile
+11,180-5,219sqlite3.c
+9,171-5,882shell.c
+753-193sqlite3.h
+454-141autosetup/proj.tcl
+505-57tea/generic/tclsqlite3.c
+182-77autosetup/sqlite-config.tcl
+22,245-11,56919 files not shown
+22,595-11,83825 files

FreeBSD/src 123591eusr.sbin/lpr/lpd printjob.c

lpd: Style and whitespace cleanup

No functional change intended.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57186
DeltaFile
+92-99usr.sbin/lpr/lpd/printjob.c
+92-991 files

FreeBSD/src 0f3e148usr.sbin/lpr/lpd printjob.c

lpd: Fix issues reported by clang-analyzer

Also, unlink our temporary file if we fail to chmod it.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57185
DeltaFile
+20-19usr.sbin/lpr/lpd/printjob.c
+20-191 files

FreeBSD/src f2c7c5fusr.sbin/lpr/lpd printjob.c

lpd: Avoid buffer overflow when sending a job

When forwarding a print job to a remote server, we could overflow the
command buffer if a control or data file had a very long name.

MFC after:      1 week
Reported by:    Joshua Rogers <joshua at joshua.hu>
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57184
DeltaFile
+20-11usr.sbin/lpr/lpd/printjob.c
+20-111 files

FreeBSD/src 6047f6ausr.sbin/lpr/lpd lpd.8 lpd.c

lpd: Drop deprecated -p option

This alias for the -s option has been deprecated since 2002.  Time to
drop it from the documentation.

MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57183
DeltaFile
+1-10usr.sbin/lpr/lpd/lpd.8
+0-3usr.sbin/lpr/lpd/lpd.c
+1-132 files

FreeBSD/src c0cae7dusr.sbin/lpr/lpd lpd.c lpd.8

lpd: Restore ability to specify a port number

This has been broken since IPv6 support was added in 2000.  We would
validate the port number (which had to be a port number, but can now
also be a service name) and then ignore it.

MFC after:      1 week
Fixes:          08829865f659 ("IPv6 support for lpr.")
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57181
DeltaFile
+9-19usr.sbin/lpr/lpd/lpd.c
+10-9usr.sbin/lpr/lpd/lpd.8
+19-282 files

FreeBSD/src 8e91778usr.sbin/lpr/lpd lpd.8

lpd: Reorder option list in manual page

MFC after:      1 week
Reviewed by:    ziaee, markj
Differential Revision:  https://reviews.freebsd.org/D57182
DeltaFile
+18-24usr.sbin/lpr/lpd/lpd.8
+18-241 files

FreeBSD/src 05e8f2blibexec/talkd announce.c, usr.bin/wall ttymsg.c wall.c

ttymsg: Overhaul

* Instead of an error string, return the usual 0 or -1 and let the caller
  figure out what, if anything, to tell the user.

* Avoid string manipulations by opening /dev first and using openat()
  with O_RESOLVE_BENEATH.

* Add a boolean argument which, if false, causes ttymsg() to return
  without sending the message if the tty's group-writable bit is not
  set.  This saves programs that respect this setting (like syslogd(8))
  from having to check before calling ttymsg().

* Update all callers.

The observable effect of this change is minimal except for slightly
different error messages when ttymsg() fails.  However, syslogd(8) will
no longer print spurious error messages on the console after trying and
failing to write a log message to an X11 session.

    [5 lines not shown]
DeltaFile
+64-56usr.bin/wall/ttymsg.c
+21-37usr.sbin/syslogd/syslogd_cap_log.c
+10-37usr.sbin/syslogd/syslogd.c
+4-4usr.sbin/syslogd/syslogd_cap.h
+3-3usr.bin/wall/wall.c
+2-1libexec/talkd/announce.c
+104-1382 files not shown
+106-1408 files

FreeBSD/src 33acf0fsys/netlink/route rt.c

netlink: Fix RTM_GETROUTE loop for RT_TABLE_UNSPEC

Reviewed by: bz, pouria
Fixes: 7e5bf68495cc ("netlink: add netlink support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57234
DeltaFile
+1-1sys/netlink/route/rt.c
+1-11 files

FreeBSD/src 151f097sys/kern subr_eventhandler.c

eventhandler: Fix the NODEBUG build

Reported by:    Michael Butler <imb at protected-networks.net>
Fixes:          735b16d490ae ("eventhandler: Fix a race when pruning eventhandlers")

(cherry picked from commit 3d8928114c4fec6cefbb1cd566ef8d1b3d2999e2)
DeltaFile
+3-1sys/kern/subr_eventhandler.c
+3-11 files