if_bnxt: Implementation of Extended Port Hardware Stats Support for THOR Controller
The newly added port extended hardware statistics are now accessible to
users through the sysctl interface. Also, Few obsolete stats are removed
and few stats are renamed.
if_bnxt: Fix media speed update issue in "ifconfig -m" during PHY hot plug
Currently, if a media type (e.g., DAC) is hot-plugged out and another type
(e.g., optical cable) is hot-plugged in, the new speed is not reflected in
ifconfig. This occurs when the driver fails to update speeds with unchanged
tx and rx flow control.
To fix, a phy_type check ensures update of phy speeds upon detecting the new
phy.
Warner Losh [Thu, 7 Mar 2024 01:22:34 +0000 (18:22 -0700)]
nvme: Log reset success or failure to devd
We're logging when we start a reset, but not when we complete it, nor
the result. Create now log a success or timed_out event for the reset.
Currently, the only detectable error we have from reset is 'failure to
become ready in time,' though the code looks like it might be more
generic. Log this and if we ever have other failure modes, change the
logging to devd when that happens.
Warner Losh [Thu, 7 Mar 2024 01:22:13 +0000 (18:22 -0700)]
nvme: split devctl out to its own function
Split the devctl aspect of things out to its own function in
nvme_ctrlr_devctl_log. In preparing to document this, and based on
actual use, we want something different for the SMART errors, so this
will facilitate that.
Brooks Davis [Thu, 7 Mar 2024 01:01:36 +0000 (01:01 +0000)]
libsys: don't try to expose yield
The undocumented yield system call has never been implemented via libc
or libsys (except accidentally for <15 minutes in 1998 between commits abd529cebab9 and 0db2fac06ab7). Avoid trying to export it now to avoid
failures when linking with --no-undefined-version.
Brooks Davis [Thu, 7 Mar 2024 00:59:07 +0000 (00:59 +0000)]
syscall(2): make i386 less of an outlier
Unlike other architectures, i386 only defined syscall() and not
_syscall() or __sys_syscall(). The syscall() function then invoked the
desired system call directly rather than invoking syscall(2). Keep the
latter as it's marginally more efficent, but also create the
conventional _syscall() and __sys_syscall() stubs.
This avoids the need to special case syscall(2) in the symbol list
generation in libsys.
Brooks Davis [Thu, 7 Mar 2024 00:55:11 +0000 (00:55 +0000)]
heimdal: don't try to expose nonexistant symbols
For one reason or another these symbols aren't present so don't try to
make them available for linkage.
In the case of libroken these seem to be compatability bits we don't
need a thus don't compile. For others it seems to rot upstream, but
I've not investigated deeply.
Brooks Davis [Thu, 7 Mar 2024 00:54:55 +0000 (00:54 +0000)]
heimdal: don't export nonexistant _wind_ucs2read
This symbol table entry came in with the 1.5 import (commit 7c450da7b446), but the only other mention is a commented out entry in
lib/wind/libwind-exports.def.
Remove the include that crept in by accident
Clang complains about CLOCK_BOOTTIME being the same for now as
CLOCK_UPTIME, so remove CLOCK_BOOTTIME and leave a comment for
what to do when CLOCK_BOOTTIME will be different for real.
The checksum code assumed that struct ustar_header filled an entire
block and calculcated the checksum based on the size of the structure.
The header is in fact only 500 bytes long while the checksum covers
the entire block (“logical record” in POSIX terms). Add padding and
an assertion, and clean up the checksum code.
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44226
* Reject hard or soft links with an empty target path. Currently, a
debugging kernel will hit an assertion in tarfs_lookup_path() while
a non-debugging kernel will happily create a link to the mount root.
* Use a temporary variable to store the result of the link target path,
and copy it to tnp->other only once we have found it to be valid.
Otherwise we error out after creating a reference to the target but
before incrementing the target's reference count, which results in a
use-after-free situation in the cleanup code.
* Correctly return ENOENT from tarfs_lookup_path() if the requested
path was not found and create_dirs is false. Luckily, existing
callers did not rely solely on the return value.
MFC after: 3 days
PR: 277360
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D44161
Sumit Saxena [Fri, 23 Feb 2024 08:20:26 +0000 (08:20 +0000)]
if_bnxt: Correcting the firmware package version parsing logic
The firmware package version currently appears as "Unknown" through
the sysctl interface. The parsing logic for extracting the firmware
package version from the package log has been modified to ensure
compatibility with all controllers.
Alan Somers [Tue, 5 Mar 2024 17:55:55 +0000 (10:55 -0700)]
zfsd: Use vdev prop values for fault/degrade thresholds
ZED uses vdev props for setting disk fault/degrade thresholds, this
patch enables zfsd to use the same vdev props for these same tasks.
OpenZFS on Linux is using vdev props for ZED disk fault/degrade
thresholds. Originally the thresholds supported were for io and checksum
events and recently this was updated to process slow io events as
well, see
https://github.com/openzfs/zfs/commit/cbe882298e4ddc3917dfaf239eca475fe06d62d4
This patch enables us to use the same vdev props in zfsd as ZED uses.
After this patch is merged both OSs will use the same vdev props to set
retirement thresholds.
It's probably important to note that the threshold defaults are
different between OS. I've kept the existing defaults inside zfsd and
DID NOT match them to what ZED does.
Eugene Grosbein [Tue, 5 Mar 2024 17:23:41 +0000 (00:23 +0700)]
diskinfo(8): introduce new option -l
In modes -p or -s, add an option -l to start each line
with a device name separated with a tab. Update the manual page.
Add an example to list names with corresponding serial numbers:
Kyle Evans [Tue, 5 Mar 2024 04:14:07 +0000 (22:14 -0600)]
ktrace: log genio events on failed write
Visibility into the contents of the buffer when a write(2) has failed
can be immensely useful in debugging IPC issues -- pushing this to
discuss the idea, or maybe an alternative where we can set a flag like
KTRFAC_ERRIO to enable it.
When a genio event is potentially raised after an error, currently we'll
just free the uio and return. However, such data can be useful when
debugging communication between processes to, e.g., understand what the
remote side should have grabbed before closing a pipe. Tap out the
entire buffer on failure rather than simply discarding it.
Kyle Evans [Tue, 5 Mar 2024 04:14:06 +0000 (22:14 -0600)]
kern: poll: tap out the pollfd array on successful return
We do this in kern_poll() to include freebsd32 but exclude the linux
compat layer. The ABI should be the same, but the POLL constants are
probably different or should be assumed so.
John Baldwin [Tue, 5 Mar 2024 04:52:54 +0000 (20:52 -0800)]
pci_host_generic: Pass a valid end address in generic_pcie_translate_resource
The generic_pcie_containing_range helper added in commit d79b6b8ec267
assumed that the passed in (start, end) range used to locate the
containing mapping range was a valid address range (with end >=
start). The previous version of
generic_pcie_translate_resource_common only used the start address to
locate a mapping range, so the end address of 0 did not matter, but an
end of 0 now causes the first range to match and an incorrect
translation for resources using a later range.
The private symbol __collate_load_error was removed in 2015 in commit 2a6abeebef96. While it had previously been accidently removed in 2011
(commit 3c87aa1d3dc1a) and restored in 2012 (commit bb4317bf3c99) I
think it's time to write it off after four major releases without it.
Fixes: 2a6abeebef96 The collate functions within libc have...
Cy Schubert [Tue, 27 Feb 2024 03:34:09 +0000 (19:34 -0800)]
hostapd: Work around lack of MLME support
hostap MLME uses Linux data structures and definitions not available
in FreeBSD. The ability for hostapd to select the frequency (channel)
depends Linux MLME, though strictly it's not required. Work around the
Linux MLME requirement to configure device frequency.
The detailed description is: hostapd will only set the channel (frequency)
when Linux MLME is configured. Enabling NEED_AP_MLME will result in
numerous build errors due do Linux data structures and definitions not
available under FreeBSD. The code to set the frequency from the selected
channel is only within the NEED_AP_MLME code path because without MLME,
hostapd_get_hw_features() is an inline that always returns -1 whereas with
MLME hostapd_get_hw_features() will obtain hardware features from the
kernel. Until such time we simply set the frequency as configured.
Tom Coldrick [Sat, 2 Mar 2024 19:22:55 +0000 (14:22 -0500)]
LinuxKPI: Queue skbuffs at tail in __skb_queue_tail
Correct skb_queue_tail to queue the buffer at the tail of the skbuff.
The skbuff is a circular doubly-linked list, and we call with a pointer
to the head of the list. Thus queueing before the head gives us a
queueing at the tail.
As a motivating factor, the current behaviour (queueing at the head) was
causing frequent kernel panics from my RTL8822BE wireless card, which
uses the rtw88 driver. Interrupts can cause buffers to be added to the
rtwdev c2h_queue while the queue is being drained in rtw_c2h_work.
Queueing at the head would leave the nascent entry in the linked list
pointing to the old, now freed, memory for the buffer being processed.
When rtw_c2h_work is next called, we try reading this and so panic.
Gleb Smirnoff [Sun, 3 Mar 2024 20:56:58 +0000 (12:56 -0800)]
linux: require vnet(9) context in ifname_bsd_to_linux_name()
This function is used by netlink(9) only. The netlink(9) taskqueue thread
runs in the vnet of the socket whose request the thread is processing
right now. This is a correct vnet and resetting it to vnet0 is incorrect.
If the function is to be used by any other caller in addition to
netlink(9), it would be caller's responsiblity to provide correct vnet(9).
getblkx(9): be more tolerant but also strict with the buffer size checks
It is possible that on-disk filesystem format causes allocation of
buffers of size larger than maxbcachebuf. Currently, getblkx() and
indirectly bufkva_alloc() panic in that situation.
It is more useful to return an error instead, allowing the system to
continue running.
PR: 277414
Reported by: Robert Morris <rtm@lcs.mit.edu>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Brooks Davis [Fri, 1 Mar 2024 23:21:46 +0000 (23:21 +0000)]
Add an UNDEFINED_VERSION option
When enabled (current default) link with --undefined-version to allow
symbol maps to contain symbols not defined by libraries. When disabled,
link with --no-undefined-version to disallow these bugs.
WITHOUT_UNDEFINED_VERSION is currently broken. Once it is fixed it
should be made the default and this option should likely be removed.
John Baldwin [Fri, 1 Mar 2024 22:20:10 +0000 (14:20 -0800)]
pci_host_generic: Enumerate resource ranges under bootverbose
Previously ranges were only enumerated for the FDT attachment but not
ACPI. This commit moves the enumeration to the shared attach routine
so it is done for both. While here, don't list empty ranges but do
include the resource type for each range.
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D44132
Randall Stewart [Fri, 1 Mar 2024 20:21:15 +0000 (15:21 -0500)]
HTPS has actually three states not two so the macro needs to account for that.
Ok lets fix up the tcp_in_hpts() so that it also says yes if you
are in the race state moving and you are scheduled to be put in.
This also requires changing the MPASS to be the old version non
inline function of tcp_in_hpts().
This change also adds a new inline macro so that a uint64_t timestamp can be
obtained by a transport (aka Rack will use this).
Stefan Eßer [Fri, 1 Mar 2024 17:31:15 +0000 (18:31 +0100)]
mqueuefs: fix statfs report to not signal file system full
Synthetic file systems that do not actually allocate file system
blocks or inodes should report that they have space available and
that they provide 0 inodes, in order to prevent capacity monitoring
tools from warning about resource exhaustion.
This has been fixed in all other synthetic file systems in base in
commit 88a795e80c0, but this file was overlooked since its name does
not indicate that it also provides a file system.
Ed Maste [Fri, 1 Mar 2024 13:21:54 +0000 (08:21 -0500)]
Cirrus-CI: Add manual Clang 18 jobs
Work is in progress to import Clang/LLVM 18 as the base system compiler.
llvm18-lite is not yet in the quarterly package set but but will be
available in the not too distant future, and is available for src forks
that switch to latest packages. Add manual llvm18 jobs now so that they
can be used for testing.
Stefan Eßer [Fri, 1 Mar 2024 15:29:31 +0000 (16:29 +0100)]
ldconfig: remove ignored -v (verbose) option
The -v option used to print useful information when operating on a.out
format libraries. After the removal of a.out support, it was accepted
but did not have any effect.
Remove the option and update the man-page.
While here mention the set of historic options that are accepted but
ignored: "-elf", "-s", and "-v".
The FILES section contained outdated information and did not mention
the way library directories of optional ports and packages are
included in the library search path recorded in the hints file.
The description of the "-B" option was incorrect (described a planned
change) for big-endian platforms (powerpc64). These do still default
to big-endian hints files, since the current version of the "pkg"
program expects the hints file to be in native byte-order.
Kristof Provost [Fri, 2 Feb 2024 20:56:55 +0000 (21:56 +0100)]
pf: support if-bound with reply-to
On reply-to we don't know what interface to bind to when we create
the state. Create any reply-to state as floating, but bind to the
appropriate interface once we're handling the reply.
See also: https://redmine.pfsense.org/issues/15220
Sponsored by: Rubicon Communications, LLC ("Netgate")
Ed Maste [Thu, 29 Feb 2024 22:00:39 +0000 (17:00 -0500)]
Cirrus-CI: bump Clang versions to 16 and 17
Clang/LLVM 17 is currently the in-tree default compiler, so use it as
the default Cirrus-CI toolchain. Clang/LLVM 18 is coming soon and needs
to be added here, but I ran into trouble with llvm18-lite package
availability so will look at that later.
Reviewed by: dim (earlier), Jose Luis Duran
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44162
Brooks Davis [Thu, 29 Feb 2024 19:46:33 +0000 (19:46 +0000)]
lib{c,sys}: expose _getlogin consistently
Historically we exposed _getlogin as a private symbol on a per-arch basis
(except on aarch64 and riscv) for no obvious reason. We now need to
expose it for libc's use so remove the special case from
makesyscalls.lua and expose it in the generated syscalls.map.
Brooks Davis [Thu, 29 Feb 2024 19:19:01 +0000 (19:19 +0000)]
libsys: make PSEUDO take a bare syscall name
Rather than having PSEUDO be a list of object files when all consumers
want syscall names or source files, make it a list of bare syscall
names like INTERPOSED (which is built on PSEUDO).
Brooks Davis [Thu, 29 Feb 2024 19:19:01 +0000 (19:19 +0000)]
libsys: reduce makefile declaration duplication
Every PSEUDO entry (_foo.o) has a corresponding NOASM entry (foo.o) to
suppress its addition to ASM. Check PSEUDO instead when adding entries
to ASM. No functional change.
Warner Losh [Thu, 29 Feb 2024 17:58:43 +0000 (10:58 -0700)]
loader/lua: Remove pager shim
Just after 12.2 and before the stable/13 branch, kevans added lpager.c
to provide a pager interface for commands written in lua. It was merged
into 12.3. Now that 12.2 is long since EOL, we can remove the pager shim
here. Nobody needs that old loader + new lua scripts. Plus only one
command is affected.