FreeBSD/src 297394eshare/man/man4 igc.4

igc(4): document adaptive interrupt moderation

Describe the disabled, adaptive, and low-latency settings and their
interrupt-rate tradeoffs.

MFC after:      1 week
DeltaFile
+14-0share/man/man4/igc.4
+14-01 files

FreeBSD/src dc4a508sys/dev/e1000 if_em.c if_em.h

e1000: restore packet-size AIM

Restore the packet-size calculation introduced in a69ed8dfb381 and used
by igb(4) until the iflib conversion in f2d6ace4a684.  It derives
interrupt holdoff from average packet size, so RSS queue count does not
change its behavior.

The calculation follows the pre-iflib code.  Retain the current normal
and low-latency rate caps, and keep the current setting when an interval
has no usable sample.

Fixes:          3e501ef89667 ("e1000: Re-add AIM")
MFC after:      1 week
DeltaFile
+67-107sys/dev/e1000/if_em.c
+8-3sys/dev/e1000/if_em.h
+75-1102 files

FreeBSD/src e389a05sys/dev/igc igc_txrx.c

igc: count TSO wire segments in the AIM counters

The transmit path bills one packet of ipi_len bytes per request.  For
TSO that is the whole unsegmented payload, up to 64 KiB, rather than a
packet size that appears on the wire.

Count the segments the hardware emits and the header carried by each
segment.  Non-TSO accounting is unchanged.

MFC after:      1 week
DeltaFile
+19-2sys/dev/igc/igc_txrx.c
+19-21 files

FreeBSD/src 072e098sys/dev/e1000 em_txrx.c igb_txrx.c

e1000: count TSO wire segments in the AIM counters

The transmit paths billed one packet of ipi_len bytes per request.  For
TSO that is the whole unsegmented payload, up to 64KB, so the average
size the moderation calculation sees is not a size that appears on the
wire.

Count the segments the hardware will put on the wire and the header each
of them carries.

Non-TSO accounting is unchanged.

MFC after:      1 week
DeltaFile
+19-2sys/dev/e1000/em_txrx.c
+19-2sys/dev/e1000/igb_txrx.c
+38-42 files

FreeBSD/src 01e7acdsys/dev/igc if_igc.c if_igc.h

igc: use packet-size AIM

Use the packet-size calculation introduced for igb(4) in a69ed8dfb381
and retained there until the iflib conversion in f2d6ace4a684.  It
derives interrupt holdoff from average packet size, so RSS queue count
does not change its behavior.

The calculation follows the pre-iflib igb code.  Retain igc's normal and
low-latency rate caps, and keep the current setting when an interval has
no usable sample.

MFC after:      1 week
DeltaFile
+67-108sys/dev/igc/if_igc.c
+8-3sys/dev/igc/if_igc.h
+75-1112 files

FreeBSD/src bbf0372sys/dev/igc igc_txrx.c

igc: fix RX accounting for multi-descriptor packets

The receive path adds the running packet length to rx_bytes for every
descriptor.  A packet spanning descriptors of length l1, l2, and l3 is
therefore counted as 3*l1 + 2*l2 + l3.

Add each descriptor length once.  Single-descriptor accounting remains
unchanged.

MFC after:      1 week
DeltaFile
+1-1sys/dev/igc/igc_txrx.c
+1-11 files

FreeBSD/src bc5e7b0sys/dev/e1000 if_em.c if_em.h

e1000: make AIM counter sampling coherent

Sample free-running counters by delta instead of clearing them from the
interrupt filter, which can race their producers.  Publish byte and
packet counts together at the TX and RX doorbells so each sample is
coherent.

Aggregate every TX ring assigned to the interrupt vector so unequal RX
and TX queue counts are safe.  Count RX bytes only after a frame is
accepted.

MFC after:      1 week
DeltaFile
+72-25sys/dev/e1000/if_em.c
+42-4sys/dev/e1000/if_em.h
+6-2sys/dev/e1000/em_txrx.c
+3-1sys/dev/e1000/igb_txrx.c
+123-324 files

FreeBSD/src e355334sys/dev/igc if_igc.c if_igc.h

igc: synchronize interrupt moderation state

Keep the saved EITR value synchronized with hardware across
reinitialization.  Correct EITR encoding, decoding, and MSI-X register
selection, and reject nonpositive fallback rates.

Apply the packet-buffer fallback without permanently disabling AIM.

MFC after:      1 week
DeltaFile
+25-10sys/dev/igc/if_igc.c
+4-2sys/dev/igc/if_igc.h
+29-122 files

FreeBSD/src b6b379bshare/man/man4 em.4

em(4): document adaptive interrupt moderation

Describe the disabled, adaptive, and low-latency settings and their
interrupt-rate tradeoffs.

MFC after:      1 week
DeltaFile
+14-0share/man/man4/em.4
+14-01 files

FreeBSD/src 2290ea7sys/dev/igc if_igc.c if_igc.h

igc: make AIM counter sampling coherent

Sample free-running counters by delta instead of clearing them from the
interrupt filter, which can race their producers.  Publish byte and
packet counts together at the TX and RX doorbells so each sample is
coherent.

Aggregate every TX ring assigned to the interrupt vector so unequal RX
and TX queue counts are safe.  Count RX bytes only after a frame is
accepted.

MFC after:      1 week
DeltaFile
+72-25sys/dev/igc/if_igc.c
+41-4sys/dev/igc/if_igc.h
+3-1sys/dev/igc/igc_txrx.c
+116-303 files

FreeBSD/src 6ef368asys/dev/e1000 if_em.c if_em.h

e1000: synchronize interrupt moderation state

Keep the saved EITR and PBA values synchronized with hardware across
reinitialization.  Correct EITR encoding, decoding, and MSI-X register
selection, and reject nonpositive fallback rates.

Treat only sub-gigabit links as sub-gigabit and apply the packet-buffer
fallback without permanently disabling AIM.

MFC after:      1 week
DeltaFile
+38-22sys/dev/e1000/if_em.c
+4-2sys/dev/e1000/if_em.h
+42-242 files

FreeBSD/src 41a46c2sys/dev/e1000 em_txrx.c igb_txrx.c

e1000: fix rx accounting for multi-descriptor packets

The receive paths accumulate ri->iri_len across the descriptors making
up a packet, then add that running total to rxr->rx_bytes on every
iteration of the loop.  A packet spanning descriptors of length l1, l2
and l3 thus contributes 3*l1 + 2*l2 + l3 instead of l1 + l2 + l3.

Single descriptor packets, the common case, are accounted correctly,
so this only shows up on jumbo frames.

Add the per descriptor length instead.  iflib memsets the if_rxd_info
before each isc_rxd_pkt_get() call, so summing len gives the same total
as the final iri_len, and the frame error path that returns without
incrementing rx_packets keeps counting bytes exactly as before.

MFC after:      1 week
DeltaFile
+2-2sys/dev/e1000/em_txrx.c
+1-1sys/dev/e1000/igb_txrx.c
+3-32 files

FreeBSD/src 941113asys/dev/e1000 if_em.c

e1000: fix 82574 MSI-X interrupt throttling

em_newitr() and the per-queue interrupt_rate sysctl both tested
que->msix to decide whether an 82574 is running in MSI-X mode.  0 is a
valid MSI-X vector so queue 0 was misclassified as legacy/MSI.

Test sc->intr_type == IFLIB_INTR_MSIX instead.  While here, index the tx
EITR read by tque->msix rather than tque->me so it matches the register
em_newitr() actually writes; the two differ once tx_num_queues exceeds
rx_num_queues.

Also seed que->itr_setting in em_initialize_receive_unit() with the rate
the hardware was just programmed with.  Otherwise an itr_setting left
over from AIM across an interface re-init makes the change detection in
em_newitr() suppress the write that would restore it, leaving the
hardware at the default rate while software believes otherwise.

Fixes:          3e501ef89667 ("e1000: Re-add AIM")
MFC after:      3 days
DeltaFile
+20-4sys/dev/e1000/if_em.c
+20-41 files

FreeBSD/src 0bd6a16sys/dev/e1000 if_em.c if_em.h

e1000: Defer link-up notification until after TSO reset

em_automask_tso() changes the enabled TSO capabilities when the link
moves between 10/100 and 1000 Mb/s.  A running interface must be
reinitialized to apply the new capability set.  Do not publish
LINK_STATE_UP until the requested iflib reset has completed.

Replace link_active with an explicit state machine that distinguishes
the physical link, its publication to iflib, and an outstanding reset
barrier.  Preserve that barrier across a link flap with
DOWN_RESET_PENDING, and only publish DOWN if UP was previously
published.

Only request a reset for a running interface or for an initialization
while the interface is administratively up.  In other states the next
initialization will apply the capability changes, avoiding a reset
request that iflib's admin task could discard.

Reviewed by:    Faraz Vahedi <kfv at kfv.io>

    [2 lines not shown]
DeltaFile
+61-18sys/dev/e1000/if_em.c
+9-1sys/dev/e1000/if_em.h
+70-192 files

FreeBSD/src 9af47fcusr.bin/tail tail.c

tail: Allow repetitive or contraditory options

Unlike its GNU counterpart, our tail(1) has always errored out if given
repetitive or contradictory options, even prior to Keith Bostic's 1991
reimplementation.  There is no good reason to continue to do so, not
even tradition, since many other commands (including head(1)) simply
apply the rightmost option in cases like this.

MFC after:      1 week
Reviewed by:    allanjude, markj
Differential Revision:  https://reviews.freebsd.org/D58192

(cherry picked from commit 9fc14dbe4897c4541113b9ba98236fbd7eb75380)
DeltaFile
+0-2usr.bin/tail/tail.c
+0-21 files

FreeBSD/src 3ab5936contrib/tzcode zic.c localtime.c

tzcode: Update to 2026c

MFC after:      1 week

(cherry picked from commit 28f617de7d9b9c708eacb3c2c13e5287e1b7354d)
DeltaFile
+181-170contrib/tzcode/zic.c
+44-34contrib/tzcode/localtime.c
+70-7contrib/tzcode/NEWS
+10-56contrib/tzcode/zdump.c
+23-27contrib/tzcode/tz-link.html
+17-28contrib/tzcode/Makefile
+345-3229 files not shown
+414-37915 files

FreeBSD/src 8c2e1decontrib/tzcode zic.c localtime.c

tzcode: Update to 2026c

MFC after:      1 week

(cherry picked from commit 28f617de7d9b9c708eacb3c2c13e5287e1b7354d)
DeltaFile
+181-170contrib/tzcode/zic.c
+44-34contrib/tzcode/localtime.c
+70-7contrib/tzcode/NEWS
+10-56contrib/tzcode/zdump.c
+23-27contrib/tzcode/tz-link.html
+17-28contrib/tzcode/Makefile
+345-3229 files not shown
+414-37915 files

FreeBSD/src 58e2ad5usr.bin/tail tail.c

tail: Allow repetitive or contraditory options

Unlike its GNU counterpart, our tail(1) has always errored out if given
repetitive or contradictory options, even prior to Keith Bostic's 1991
reimplementation.  There is no good reason to continue to do so, not
even tradition, since many other commands (including head(1)) simply
apply the rightmost option in cases like this.

MFC after:      1 week
Reviewed by:    allanjude, markj
Differential Revision:  https://reviews.freebsd.org/D58192

(cherry picked from commit 9fc14dbe4897c4541113b9ba98236fbd7eb75380)
DeltaFile
+0-2usr.bin/tail/tail.c
+0-21 files

FreeBSD/src bc81728lib/libc/tests/stdlib/libatexit libatexit.cc

[test] libatexit: leverage __{BEGIN,END}_DECLS

This change converts the longhand form of `extern "C" {` and its
corresponding `}` into `__BEGIN_DECLS` and `__END_DECLS`, respectively.

The new form is much easier to grep for and is a best practice to use in
the FreeBSD tree.

This is meant to be a non-functional change.

MFC after:      1 week
DeltaFile
+7-4lib/libc/tests/stdlib/libatexit/libatexit.cc
+7-41 files

FreeBSD/src 64038dblib/libc/tests/stdlib/libatexit libatexit.cc

libc: tests: add static to resolve -Wmissing-prototypes

The function create_staticobj() is only used inside this translation unit.
Clang produces a -Wmissing-prototypes warning during standard buildworld.
This warning will become a fatal compile error if MK_WERROR is enabled for hardened builds.

PR: 285870
Fixes: ee9ce1078 ("libc: tests: add some tests for __cxa_atexit...")
Signed-off-by: Zhang Qiyue <peter-open-source.probing805 at aleeas.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2321
DeltaFile
+1-1lib/libc/tests/stdlib/libatexit/libatexit.cc
+1-11 files

FreeBSD/src 5f346dblib/libusb libusb.h

libusb: Sync interface for libusb_init_option

Sponsored by:   The FreeBSD Foundation
DeltaFile
+5-3lib/libusb/libusb.h
+5-31 files

FreeBSD/src 340c6aflib/libusb libusb.h

libusb: Add LIBUSB_DT_SUPERSPEED_HUB

Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-0lib/libusb/libusb.h
+1-01 files

FreeBSD/src 3ebb70fstand/common gfx_fb.c

stand: Fix build failure due to old EDK2 interface

In 43b8edb320519, we change EFI_GRAPHICS_OUTPUT_PROTOCOL from
EFI_GRAPHICS_OUTPUT. However, this patch is not MFC to stable/15. As a
result, we need to use the old interface to prevent compile failure.

Fixes: 1802f2ca7215
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1stand/common/gfx_fb.c
+1-11 files

FreeBSD/src b78f880sys/x86/include specialreg.h

x86/specialreg: Add MSR_AMD_CPUID01 MSR

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D56311
DeltaFile
+1-0sys/x86/include/specialreg.h
+1-01 files

FreeBSD/src 8f7ea6bsys/x86/cpufreq hwpstate_intel.c

hwpstate_intel: Minimize ifdef for i386 build

Reported by:    jrtc27
Fixes:  bdc0f7678257
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 02c440e204041e92da403a64b70c2e1fdf3a4f73)
DeltaFile
+0-4sys/x86/cpufreq/hwpstate_intel.c
+0-41 files

FreeBSD/src 493676dsys/x86/include kvm.h

kvm: Support non-default CPUID leaf

KVM does not always use 0x40000000 as its CPUID base. For example, QEMU
adds a 0x100 offset when nested virtualization is detected and the host
exposes Hyper-V enlightenment hints. To accommodate this behavior,
switch the detection logic to use the CPUID leaf returned by do_cpuid(),
making the implementation more flexible.

See:
https://github.com/qemu/qemu/blob/master/target/i386/kvm/kvm.c#L2300

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58146

(cherry picked from commit 86691d52a6d3796ad36ba474cf0a9493f6d99202)
DeltaFile
+3-4sys/x86/include/kvm.h
+3-41 files

FreeBSD/src 1802f2cstand/common gfx_fb.c gfx_fb.h, stand/ficl gfx_loader.c

stand: Bulk operations on each gfxfb_blt if shadow buffer enabled

Previously, gfxfb_blt flushed the framebuffer on every call. Since a
single drawing operation may invoke gfxfb_blt multiple times, this can
result in unnecessary flushes.

Instead, write updates to the shadow buffer (when present) and mark the
affected area as dirty. Flushing is deferred so multiple gfxfb_blt calls
can be coalesced into a single update. As before, only the dirty region
is flushed.

This fixes the slow bootloader problem in some platforms.

Reviewed by:    imp, adrian, obiwac
Tested by:      obiwac, jrm
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57373

(cherry picked from commit 32da2f23ae4d18888d34682b0ddb49ec80c0bb26)
DeltaFile
+203-22stand/common/gfx_fb.c
+7-0stand/common/gfx_fb.h
+4-3stand/ficl/gfx_loader.c
+2-1stand/liblua/gfx_utils.c
+216-264 files

FreeBSD/src 592bf24sys/x86/cpufreq hwpstate_intel.c

hwpstate_intel: Fix i386 build

Reviewed by:    olce
Fixes:  7b26353a59d6
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58208

(cherry picked from commit bdc0f7678257eaa739b9c816285504470e71e3de)
DeltaFile
+8-0sys/x86/cpufreq/hwpstate_intel.c
+8-01 files

FreeBSD/src 4a1a1bfstand/common gfx_fb.c

stand: Fix shadow buffer offset handling

The shadow buffer is addressed relative to `tg_origin`, which includes
the padding offset, whereas `gfxfb_blt` operates on coordinates without
that offset. To make `gfx_fb_copy_area` emulate the behavior of
`gfxfb_blt`, the source coordinates must include the padding offset,
while the destination coordinates must not. The original implementation
omitted the offset from the source coordinates; this change corrects
that.

Additionally, `gfx_fb_cons_display` already applies the padding offset,
so the redundant adjustment is removed.

PR:             296246
Reported by:    2khramtsov at gmail.com
Reviewed by:    imp
Tested by:      2khramtsov at gmail.com, junchoon at dec.sakura.ne.jp,
naito.yuichiro_ at gmail.com
Fixes:          32da2f23ae4d

    [5 lines not shown]
DeltaFile
+15-11stand/common/gfx_fb.c
+15-111 files

FreeBSD/src 73a7f5apackages/bhyve Makefile

packages: make bhyve depend on acpi

bhyve(8) on amd64 needs iasl(8) to run, otherwise it fails with:

  /bin/sh: /usr/sbin/iasl: not found
  bhyve: BASL failed @ build_dsdt:484
      Failed to execute basl_compile(ctx, basl_fwrite_dsdt): Unknown
  error: 32512
  bhyve: BASL failed @ acpi_build:899
      Failed to execute build_dsdt(ctx): Unknown error: 32512
  Assertion failed: (error == 0), function bhyve_init_platform_late, file
  /home/pkgbuild/worktrees/main/usr.sbin/bhyve/amd64/bhyverun_machdep.c,
  line 394.

Register the "acpi" package which provides iasl(8) as a dependency for
bhyve on amd64.

Reviewed by:            markj (previous revision), ivy
Differential Revision:  https://reviews.freebsd.org/D56498

    [3 lines not shown]
DeltaFile
+5-0packages/bhyve/Makefile
+5-01 files