stdio: *memstream: grow the buffer by 1.5x on write
This improves performance by reducing the number of allocations as we
write into the memstream, both in the fully buffered case with larger
memstreams and also more trivially in the line- and un-buffered case as
they flush back to the underlying buffer more often.
The inspiration for this was taken from Apple's implementation in
https://github.com/apple-oss-distributions/libc, but expanded to include
wmemstream for consistency. I've added a test for the bug that I hit in
libder that caused me to notice this in the first place, and fixed that
bug in this version.
Reviewed by: des, jhb (both slightly previous version)
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D57355
stdio: *memstream: decouple the buffer size from the stream length
It's useful to be able to track both facts with a single variable, but
it also makes it more difficult to change how the buffer size scales.
As an example, Apple's implementation seems to scale the buffer size by
1.5x on growth, presumably in an attempt to reduce trips into realloc().
This might be questionable in the face of stdio buffering, but avoiding
serious churn in the line- or un-buffered case is a net positive if
doing so isn't incredibly invasive.
Reviewed by: des, jhb, obiwac
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D57354
stdio: *memstream: slightly streamline growth function
Inverting the condition after realloc*() is a minor cleanup, but makes
the success path a little cleaner to ease a future change.
Reviewed by: des, jhb
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D57353
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.
(cherry picked from commit 41a46c2d46aa4078c597ce3a0d19323cab988277)
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>
[3 lines not shown]
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.
(cherry picked from commit 41a46c2d46aa4078c597ce3a0d19323cab988277)
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>
[3 lines not shown]
security/py-{acme,certbot}: remove setuptools from RUN_DEPENDS
Removed since 3.1.0
Reported by: Christian Ullrich
PR: 294853
(cherry picked from commit c8b7fff07c4a6e6c9da0d8695110a458e57a7bed)
igc: Apply ASPM L1.2 workaround to all I226 devices
Classify I226_LMVP and I226_BLANK_NVM as I226 silicon so they
receive the I226-specific ASPM L1.2 workaround.
PR: 279245
MFC after: 1 week
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2318
nvmecontrol.8: Explain non-operational power modes
`nvmecontrol power -l ...` lists the available power modes.
Non-operational modes are marked with an asterisk. While here,
add <device-id | namespace-id> to the "nvmecontrol power" synopsis.
MFC after: 3 days
Reviewed by: dab, imp, michaelo, ziaee
Differential Revision: https://reviews.freebsd.org/D58480
all: expire direct consumers of www/node20 on 2026-09-30
This happens to be the date when www/qt5-webengine expires, which
is also a node20 consumer (on i386, same for qt6-webengine).
textproc/sigil: Add patch to workaround crash on close
Add a patch to workaround for issue:
https://github.com/Sigil-Ebook/Sigil/issues/874
Bump port revision.
PR: 296967
Reported-by: Jonathan Chen <jonc at chen.org.nz> (maintainer)
acpi: parse resources of not-present devices that are kept enabled
acpi_probe_child() keeps PCI link devices, the RTC,
and docking stations enabled even when _STA reports them not present,
but skipped acpi_parse_resources() for them. With an empty resource
list, resource-based hint matching (BUS_HINT_DEVICE_UNIT) cannot wire
such a device to its hinted unit, and the hinted ISA device is then
created as a duplicate.
Modern AMI firmware reports the PNP0B00 RTC as not present while
handing timekeeping to the ACPI Time-and-Alarm device.
Reviewed by: adrian, jhb
Differential Revision: https://reviews.freebsd.org/D58047
net/nfstrace: Fix build with json-c 0.19
json-c 0.19 added static inline accessors to <json-c/linkhash.h>,
which trigger -Wunused-function when building the bundled JSON
analyzer with -Werror.
Suppress the warning by adding -Wno-unused-function to CFLAGS.
Reported by: olgeni
Differential Revision: https://reviews.freebsd.org/D58135
(cherry picked from commit b58cd2fcc0590122badd493a528ff9b897b51d93)