nvme: drop the S3X single-outstanding-I/O quirk
The quirk's 8KB transfer clamp exposed raw character-device I/O to
the oversized-mapping stall fixed earlier, and its single tracker
turned a stranded request into a complete I/O stall. Without it an
S3X controller runs 128 trackers at its MDTS-derived transfer size
with no retries, failures, or timeouts, at about seven times the
serialized throughput.
Reviewed by: imp, adrian, ngie
Approved by: ngie (co-mentor)
Differential Revision: https://reviews.freebsd.org/D59156
nvme: program the arbitration burst from Identify RAB
The controller's Recommended Arbitration Burst was ignored; the
specification advises matching the Arbitration feature's burst to it
even under plain round robin. Some controllers report unusable
values: programming the Apple S3X with its reported RAB wedged
sustained I/O, so quirked controllers keep their default
configuration. The hw.nvme.arb_burst tunable overrides the
recommendation.
Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59155
netlink: Pre-register the missing devctl event systems
devctl_notify() can be called with a mutex held. If the event system is
not listed in devctl_systems[], sysevent_get_group() calls
sysevent_new_group(), which calls strdup() with M_WAITOK, and we may end
up sleeping while holding a non-sleepable mutex.
Add the missing systems.
While here, remove the nonexistent KERNEL system.
PR: 299272
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61161
if_bnxt: skip HW kTLS on old firmware and add a tunable to disable it
Older Thor2 firmware serves key context allocation requests very
slowly, about a second each. The driver allocates key contexts in
batches of 128, so setting up 500k sessions takes roughly 3900
requests and driver load appears to hang.
Enable hardware kTLS only when the firmware's HWRM interface version
is 1.10.3.99 or newer. Keep the full four-part version in
hwrm_spec_code_ext for the comparison.
Also add a disable_hw_ktls loader tunable that turns hardware kTLS off
for a device without unloading kTLS support, which helps isolate kTLS
problems in the field.
Reviewed by: gallatin
Sponsored by: Broadcom Inc
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D60977
[2 lines not shown]
if_bnxt: size MRAV from the AV split entry for backing store V2
On RoCE-capable Thor2, attach fails with
HWRM_FUNC_BACKING_STORE_CFG_V2 returning INVALID_PARAMS, as MRAV is
sized the pre-V2 way and the firmware's AV split value is sent as is.
Size MRAV from the AV split entry, and move the legacy entry-count
packing into bnxt_hwrm_func_backing_store_cfg().
Fixes: d5ce906da7c5 ("bnxt_en: Add backing store V2 support")
Reviewed by: gallatin
Sponsored by: Broadcom Inc
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D60976
(cherry picked from commit aca2e5fae3d9c3350b47ee3e7d00937a73dba9a9)
libsecureboot restore default trust anchors
If site.trust.mk does not set VE_SIGNATURE_LIST
initialize it based on content of VE_SIGNATURE_EXT_LIST
which is in turn initialized from TRUST_ANCHORS.
Sponsored by: Hewlett Packard Enterprise Development LP
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D61245
15.2: create releng/15.2 branch
* Update from PRERELEASE to BETA1
* Ship quarterly packages on DVDs
* Point pkg at stable/15 kmod packages since releng/15.2 packages
don't exist yet
* Bump __FreeBSD_version to 1502000
Approved by: re (implicit)
xdr_mbuf.c: Add a check for the return value for xdrmbuf_getbytes()
The xdrmbuf_getlong() function failed to check for the return
value from xdrmbuf_getbytes(). This could have resulted in
a failure during NFS RPC message processing.
Reviewed by: rmacklem
MFC after: 2 weeks
Sponsored by: VersatusHPC
libc/locale: Check EILSEQ return
_citrus_iconv_std_iconv_convert can return EILSEQ without setting
invlen. As a result, we should check EILSEQ in the return value or it
will incorrectly return -2
Reviewed by: kevans
Fixes: e2030ca246a7 ("libc: fix c*rtomb/mbrtoc*")
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D61151
(cherry picked from commit b138d017c70421e9d074096fcc3ac676f7e1c846)
virtio_random: defer first enqueue until after DRIVER_OK
According to the virtio spec:
> The driver MUST NOT send any buffer available notifications to the
> device before setting DRIVER_OK.
DRIVER_OK isn't set until after attach completes, so defer the first
enqueue. We haven't found any problems as a result of this to the best
of my knowledge: q35 and other devices that we *have* been used with
will apparently check when we go DRIVER_OK.
Tested with q35 virtio-random, which still works.
Reported by: llm-postcr
Reviewed by: kfv, markj
Fixes: f1c5a2e3a62505 ("virtio_random: Pipeline fetching the data")
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D61228
ggate: fix test intermittency
* ggatel: fix piped output. Flush stdout before daemonizing, so the
output can be read when it's in a command pipeline.
* ggated: bind the port _before_ daemonizing, so an invoking script can
be sure that the port is bound as soon as the command returns.
* tests: allow ggatec or ggatel to automatically allocate a device
number instead of choosing one in a racy way.
With all of these changes I can no run the tests 1000 times without
fail. And in parallel, too.
Sponsored by: ConnectWise
PR: 298942
Reported by: siva
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D60707
[2 lines not shown]
nfsserver: Do not increment seqid on BADSEQID
When returning NFSERR_BADSEQID, the server should not have incremented
the sequence ID, yet the call to nfsrv_checkseqid() a few lines above
does precisely that. Instead, check for a legitimate retransmission
of the original successful request, and reject otherwise, before the
ticket is used and sequence ID incremented.
MFC after: 1 week
Fixes: ff45b9fc1a8c ("Bjorn reported a problem...")
Sponsored by: Klara, Inc.
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D61156
libc: Export timespec_getres(3) and add tests
timespec_getres() has been declared in <time.h> and built into libc,
but never listed in a symbol map. It is therefore local to libc.so,
and dynamically linked callers fail to link.
Reviewed by: ziaee, fuz, des
Approved by: fuz (mentor)
Fixes: 9b5d724cad10 ("libc: Add timespec_getres(3) as per C23.")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D60799
tpm_crb: wait for idle and locality release after each command
transmit only requested GO_IDLE and the locality release, so a back-to-back
command could see stale state and fail with EIO.
A post-send idle timeout no longer discards a completed response.
Reviewed by: kbowling
Approved by: kbowling
Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/93
tarfs: Fix length calculation for file read
When the offset is within a block rather than at its beginning, the
length should be clamped to the remaining length of the block, not its
total length.
Reported by: n0ps1ed
MFC after: 1 week
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D60904
(cherry picked from commit 18bce6e65cdf059618ff12ace82a9f7334e1b610)
vfs: Avoid integer overflow when faulting
In vn_io_fault1(), the read / write length can easily exceed INT_MAX.
Passing it directly to uiomove(), which expects an int, results in a
negative uio_resid, which to the caller looks like we read more than
was requested.
PR: 298159
MFC after: 1 week
Reviewed by: olce, kib
Differential Revision: https://reviews.freebsd.org/D59412
(cherry picked from commit b487aca48535e5f04e4913447fcbe33f1bf56c68)
tarfs: Limit file name length
When indexing the tarball on mount, fail if a file or directory name
exceeds MAXNAMLEN.
Reported by: n0ps1ed
Reported by: Franz Bettag <franz at bett.ag>
MFC after: 1 week
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D60903
(cherry picked from commit a38033234692e9dab6f3f4404adc693fccabc14a)
tarfs: Limit file name length
When indexing the tarball on mount, fail if a file or directory name
exceeds MAXNAMLEN.
Reported by: n0ps1ed
Reported by: Franz Bettag <franz at bett.ag>
MFC after: 1 week
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D60903
(cherry picked from commit a38033234692e9dab6f3f4404adc693fccabc14a)
tarfs: Fix length calculation for file read
When the offset is within a block rather than at its beginning, the
length should be clamped to the remaining length of the block, not its
total length.
Reported by: n0ps1ed
MFC after: 1 week
Reviewed by: markj, emaste
Differential Revision: https://reviews.freebsd.org/D60904
(cherry picked from commit 18bce6e65cdf059618ff12ace82a9f7334e1b610)
vfs: Avoid integer overflow when faulting
In vn_io_fault1(), the read / write length can easily exceed INT_MAX.
Passing it directly to uiomove(), which expects an int, results in a
negative uio_resid, which to the caller looks like we read more than
was requested.
PR: 298159
MFC after: 1 week
Reviewed by: olce, kib
Differential Revision: https://reviews.freebsd.org/D59412
(cherry picked from commit b487aca48535e5f04e4913447fcbe33f1bf56c68)
e6000sw: Write the value, not the register, in Clause 45 writes
e6000sw_write_xmdio() loaded the Clause 45 register address into the
SMI PHY data register a second time, where the value to write belongs,
so every Clause 45 write stored the register address.
Its only caller, e6000sw_serdes_power(), runs at attach for ports 9 and
10 of the 88E6190 and 88E6190X to power one SERDES interface up and the
other down. It wrote 0x2000 to the SGMII control register and 0x1000
to the 10GBASE-R PCS control register instead, so neither interface was
powered down and the rest of each register was overwritten.
Fixes: 9aba06377d26 ("Add support for the Marvell 88E6190 11 ports switch.")
Sponsored by: Rubicon Communications, LLC ("Netgate")
iflib: Use a single tx dma map
The need for a separate map for TSO and non-TSO seems to have arisen from
a misunderstanding about the DMA requirements for Intel drivers like
ice/ixl/iavf. Specifically, this Intel hardware has a quirk where no
more than N (=8) segs can be DMA'ed per packet on the wire. This limit
was enforced using a DMA map with a low segment limit for non-TSO and a
driver specific check for TSO. This led to a *lot* of complexity in
iflib (~80 extra lines of code that this change removes) when the
limit can simply be enforced via the existing EFBIG mechanisms.
This change adds a new flag, IFLIB_SPARSE_TX, that drivers for hardware
with this quirk must set. When set, it causes non-TSO sends that
exceed isc_tx_nsegment to be treated as if bus_dmamap_load_mbuf_sg()
had returned EFBIG.
Due to the API/KABI change, I've bumped the FreeBSD version as well.
Note kgalazka suggested the flag, rather than a more awkward
[5 lines not shown]
libthr: Create landing pad in thr_once in C++ exception
In _thr_once, if init_routine fails with exception, the stack allocate
__cup will become invalid when unwinder walk back and free the stack of
thr_once. This cause cleanup linked list be dangling. In here, we give
the cleanup function a landing pad so that we td can correctly point
to previous cleanup function.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D61212
libthr: Predict libthr is initialized in _thr_check_init
_thr_check_init() is called on hot paths such as pthread_once(), and
the uninitialized case can only happen once. Mark it with
__predict_false so the compiler lays out the initialized case as the
fall-through path.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D61213