Commit graph

286265 commits

Author SHA1 Message Date
Doug Moore 429c871ddd radix_trie: have vm_radix use pctrie code
Implement everything currently in vm_radix.c with calls to functions
in subr_pctrie.c, asccessed via the interface provided by the
DEFINE_PCTRIE_SMR macro.

Add back some #includes removed in the first attempt, and avoid the
use of a discontinued type in a bit of conditionally compiled code.

Reviewed by:	alc, markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D41344
2023-09-12 02:42:38 -05:00
Wolfram Schneider e47a47b215 no trailing dot (".") for FreeBSD releases
PR:		273690
2023-09-12 06:42:47 +00:00
Xin LI 9047451891 Disable byteswap.h for now.
Ideally we should be testing __FreeBSD_version (1400079) and/or
BOOTSTRAPPING from an older version, but restore compatibility to
older FreeBSD versions and macOS while we find out a better way to
fix it.
2023-09-11 23:24:08 -07:00
Robert Clausecker 52d4a4d4e0 lib/libc/amd64/string/strcspn.S: fix behaviour with sets of 17--32
When a string is matched against a set of 17--32 characters, each chunk
of the string is matched first against the first 16 characters of the
set and then against the remaining characters.  We also check at the
same time if the string has a nul byte in the current chunk, terminating
the search if it does.

Due to misconceived logic, the order of checks was "first half of set,
nul byte, second half of set", meaning that a match with the second half
of the set was ignored when the string ended in the same 16 bytes.
Reverse the order of checks to fix this problem.

Sponsored by:	The FreeBSD Foundation
Approved by:	mjg (blanket, via IRC)
MFC after:	1 week
MFC to:		stable/14
2023-09-11 22:58:43 -04:00
Cheng Cui fafb03ab42
siftr: flush pkt_nodes to the log file in batch
Reviewed by: rscheff, tuexen
Differential Revision: https://reviews.freebsd.org/D41175
2023-09-11 11:23:27 -04:00
Dmitry Chagin ba90a31d08 linux(4): Cleanup includes under amd64/linux32
No functional changes.

MFC after:		1 week
2023-09-11 21:29:40 +03:00
Dmitry Chagin 68df2376e0 linux(4): Cleanup includes under amd64/linux
No functional changes.

MFC after:		1 week
2023-09-11 21:29:34 +03:00
Dmitry Chagin 027d727d40 linux(4): Cleanup includes under arm64
No functional changes.

MFC after:		1 week
2023-09-11 21:29:28 +03:00
Gleb Smirnoff d13550f0c9 stand/loader.efi: fix regression with ignoring nvstore
To read/update the boot loader nvstore, we always need to call
zfs_attach_nvstore() regardless of whether we use bootonce key
in nvstore or the bootfs property of the pool.  The call was
unintentionally left in the block of code that is processed
only when bootonce key is present.

In particular this fixes broken 'nextboot -k'.

Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D41795
Fixes:			e3e2681d0e
2023-09-11 11:04:48 -07:00
Baptiste Daroussin d557a86c87 pkg: use https by default
Switch the repository to use https by default, base is providing a CA
root bundle suitable to validate the certificates used by the project.
This can now be activated without requiring another packages to be installed

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D40473
2023-09-11 17:41:32 +02:00
Bjoern A. Zeeb f0e59b6903 LinuxKPI: skbuff: remove assumption about mac_header
It seems the mac_header can be set to offset 0 for frames received.
Remove the warning splattering messages to the console for each packet.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-09-11 14:31:35 +00:00
Bjoern A. Zeeb 530c13c540 tools/wlanstats: fix -Wunused-but-set-variable
The "allnodes" code is currently #if 0 so also #if 0 the setting of the
command line option and variable in order to keep wlanstats compiling.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2023-09-11 14:28:07 +00:00
Bjoern A. Zeeb c45d05b718 net80211: fix ddb print alignment
Add missing \ts after new lines to properly align output of ddb show
commands.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2023-09-11 14:28:04 +00:00
Dag-Erling Smørgrav 88a9b6e1ed libc: Don't assume signed char.
MFC after:	3 days
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D41814
2023-09-11 13:18:25 +00:00
Li-Wen Hsu 4196186dbf
hyperv/vmbus: Flip a message to only be emitted on failure
This message is not very useful when things are working well.
Flip its meaning and let it only be emitted on failure.

While here, pet style(9).

Reviewed by:	mhorne, whu
Differential Revision:	https://reviews.freebsd.org/D41788
2023-09-11 16:51:46 +08:00
Doug Moore 6cec93da46 Revert "radix_trie: have vm_radix use pctrie code"
This reverts commit a494d30465.
2023-09-11 03:35:36 -05:00
Martin Matuska 3159b89b61 zfs: merge openzfs/zfs@0ee9b0239
Notable upstream pull request merges:
  #15251 Add more constraints for block cloning

Obtained from:	OpenZFS
OpenZFS commit:	0ee9b02390
2023-09-11 09:18:48 +02:00
Doug Moore a494d30465 radix_trie: have vm_radix use pctrie code
Implement everything currently in vm_radix.c with calls to functions
in subr_pctrie.c, asccessed via the interface provided by the
DEFINE_PCTRIE_SMR macro.

Reviewed by:	alc, markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D41344
2023-09-11 01:53:40 -05:00
Kristof Provost b6ce41118b pf: fix state leak
If we hit the csfailed case in pf_create_state() we may have allocated
a state, so we must also free it. While here reduce the amount of
duplicated cleanup code.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D41772
2023-09-10 22:40:22 +02:00
Xin LI 898496ee09 MFV: file 5.45.
MFC after:	3 days
2023-09-10 12:21:16 -07:00
Dag-Erling Smørgrav ef8abddf10 mkfile: getopt() returns an int, not a char.
MFC after:	3 days
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D41804
2023-09-10 18:33:32 +00:00
Navdeep Parhar e203cb393f cxgbe(4): Fix tracing with netlink enabled kernels.
1. The tracing ifnet's name must match the nexus name.  One way to do
   this is to not use a unit number.

2. Do not hold the tracer lock around ether_ifattach or ether_ifdetach.
   netlink calls back into the driver (see stack below) and that leads
   to illegal lock recursion.

   tracer_ioctl
   if_ioctl
   get_operstate_ether
   get_operstate
   dump_iface
   rtnl_handle_ifevent
   rtnl_handle_ifattach
   if_attach_internal
   if_attach
   ether_ifattach
   t4_cloner_create

MFC after:	3 days
Sponsored by:	Chelsio Communications
2023-09-10 07:06:32 -07:00
Kristof Provost f415a5c1bd pfsync: fix state leak
If we receive a state with a route-to interface name set and we can't
find the interface we do not insert the state. However, in that case we
must still clean up the state (and state keys).
Do so, so we do not leak states.

Reviewed by:	Kajetan Staszkiewicz <vegeta@tuxpowered.net>
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D41779
2023-09-10 15:12:51 +02:00
Robert Clausecker b2618b651b lib/libc/amd64/string/memchr.S: fix behaviour with overly long buffers
When memchr(buf, c, len) is called with a phony len (say, SIZE_MAX),
buf + len overflows and we have buf + len < buf.  This confuses the
implementation and makes it return incorrect results.  Neverthless we
must support this case as memchr() is guaranteed to work even with
phony buffer lengths, as long as a match is found before the buffer
actually ends.

Sponsored by:	The FreeBSD Foundation
Reported by:	yuri, des
Tested by:	des
Approved by:	mjg (blanket, via IRC)
MFC after:	1 week
MFC to:		stable/14
PR:		273652
2023-09-10 08:52:59 -04:00
Jens Schweikhardt 4fc08109fe Correct the grammo in "will underlined". 2023-09-10 11:00:21 +02:00
Xin LI 72d4668c77 Vendor import of file 5.45. 2023-09-09 21:50:07 -07:00
Konstantin Belousov 3482f57f0f netpfil/pf/pf.c: fix build without dtrace
Sponsored by:	The FreeBSD Foundation
2023-09-10 01:00:27 +03:00
Konstantin Belousov 6df6facf44 shmfd: hide direct rangelock(9) use under a wrapper
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2023-09-10 01:00:06 +03:00
Mateusz Guzik a87c6962af ufs: restore name cache fast path lookup
Found by:	dchagin
Fixes:	f3c81b9738 ("ufs: add missing vop_fplookup ops")
2023-09-09 21:48:57 +00:00
Mateusz Guzik ef545fe7ba drm2: fix build after abs64 became global
Fixes: 229c65a83f ("kern: Globally define abs64")
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-09-09 20:50:55 +00:00
John Baldwin d0af08c4ba gic_acpi: Limit the number of CPUs to GIC_MAXCPU
madt_table_data contains an array of pointers for each CPU and was
allocated on the stack.  If MAXCPU is raised to a sufficiently large
value this can overflow the kernel stack.  Cap the stack growth by
using GIC_MAXCPU instead as for other parts of the gicv1/v2 driver in
commit a0e20c0ded.

Suggested by:	andrew
Reviewed by:	andrew, emaste
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D41800
2023-09-09 12:13:57 -07:00
Ed Maste 98b98ec1bc ftpd: add deprecation notice
Approved by:	gordon
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26447
2023-09-09 14:46:58 -04:00
Archimedes Gaviola 9888a79ada udl.4: note that "device videomode" is also required
Reviewed by:	emaste
2023-09-09 13:39:46 -04:00
ednadolski-ix 0ee9b02390
update max_variance limit in zdb_block_size_histogram test for CI
Commit 2d7843401a had previously
updated this hardcoded limit to allow for CI testing. As there
is no deterministic pass/fail value, the need has arisen for
one more small increase.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Edmund Nadolski <edmund.nadolski@ixsystems.com>
Closes #15252
2023-09-09 10:23:29 -07:00
Alexander Motin 5cc1876f14
Add more constraints for block cloning.
- We cannot clone into files with smaller block size if there is
more than one block, since we can not grow the block size.
 - Block size must be power-of-2 if destination offset != 0, since
there can be no multiple blocks of non-power-of-2 size.

The first should handle the case when destination file has several
blocks but still is not bigger than one block of the source file.
The second fixes panic in dmu_buf_hold_array_by_dnode() on attempt
to concatenate files with equal but non-power-of-2 block sizes.

While there, assert that error is reported if we made no progress.

Reviewed-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
Reviewed-by: Kay Pedersen <mail@mkwg.de>
Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15251
2023-09-09 10:22:36 -07:00
Warner Losh c1944a82ae cam: Remove extra break
Sponsored by:		Netflix
2023-09-09 11:13:25 -06:00
Warner Losh 4cd94c8afb atkbdc: Add additional heurstic for Chromebook keyboards
It turns out that that heurstic used to determine if we have a Google
coreboot, and thus have the i8042 emulation bugs, is incorrect. At least
one Acer "Peppy" Chromebook has an issue because Acer space'd out the
smbios.bios.version string we're using as part of the heuristic. So, if
the version starts with a space, then enable the workarounds if the
smbios.bios.reldate is 2018 or earlier. While not perfect, it should be
a reasonable dividing line and still allow newer core boot-based
machines that aren't Chromebooks to not have the workaround.

Tested by:	Matthias Apitz
Sponsored by:	Netflix
MFC After:	3 days (14.0 candiate)
2023-09-09 11:13:25 -06:00
Warner Losh 5657e065bc procdesc: Remove stray references to pdwait4
We've never had pdwait4, and have no plans of adding pdwait4. Remove the
stray references here.

Sponsored by:		Netflix
2023-09-09 11:13:24 -06:00
Zhenlei Huang c1b26df297 UPDATING: Document the change that enable vnet sysctl variables to be loader tunable 2023-09-09 16:15:27 +08:00
Zhenlei Huang 242fa308f3 carp: Explicitly mark tunnable net.inet.carp.allow with CTLFLAG_NOFETCH
With recent change 110113bc08, a vnet tunable can be initialized when
there is a corresponding kernel environment variable unless it is marked
with the flag CTLFLAG_NOFETCH.

The initialization may happen during early boot(linker preload), at that
time vnet0 has not been created. The hander carp_allow_sysctl() for the
tunable net.inet.carp.allow requires vnet, thus invoking it during early
boot will cause kernel panic.

The tunnable is initialized by vnet sysinit routine ipcarp_sysinit() so
let's just mark it with flag CTLFLAG_NOFETCH.

No functional change intended.

Fixes:		110113bc08 sysctl(9): Enable vnet sysctl variables to be loader tunable
MFC after:	2 week
Differential Revision:	https://reviews.freebsd.org/D41525
2023-09-09 16:10:32 +08:00
Zhenlei Huang 205821a70d kernel linker: Eliminate unneeded vnet propagation
The module preload happens before vnet0 creation, at this moment the vnet
list is empty thus invoking vnet_data_copy() during preload is a noop.

With recent change 110113bc08, for dynamic module load, aka via kldload,
linker will do vnet propagation right after registering sysctls which
happens after module load, then previous propagation (during module load)
is redundant.

No functional change intended.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D39852
2023-09-09 16:06:24 +08:00
Zhenlei Huang 110113bc08 sysctl(9): Enable vnet sysctl variables to be loader tunable
Complete phase two of 3da1cf1e88.

In 3da1cf1e88, the meaning of the flag CTLFLAG_TUN is extended to
automatically check if there is a kernel environment variable which
shall initialize the SYSCTL during early boot. It works for all SYSCTL
types both statically and dynamically created ones, except for the
SYSCTLs which belong to VNETs.

This change extends the meaning further, to allow it also works for
the SYSCTLs which belong to VNETs. A typical usage is
```
VNET_DEFINE_STATIC(int, foo) = 0;
SYSCTL_INT(_net, OID_AUTO, foo, CTLFLAG_RWTUN | CTLFLAG_VNET,
    &VNET_NAME(foo), 0, "Description of the foo loader tunable");
```

Note that the implementation has a limitation. It behaves the same way
as that of non-vnet loader tunables. That is, after the kernel or modules
being initialized, any changes (e.g. via kenv) to kernel environment
variable will not affect the corresponding vnet variable of subsequently
created VNETs. To overcome it, we can use TUNABLE_XXX_FETCH to fetch
the kernel environment variable into those vnet variables during vnet
constructing.

This change will fix the following SYSCTLs those belong to VNETs and
have CTLFLAG_TUN flag:
```
net.add_addr_allfibs
net.bpf.optimize_writers
net.inet.tcp.fastopen.ccache_buckets
net.link.bridge.inherit_mac
net.link.bridge.ipfw_arp
net.link.bridge.log_stp
net.link.bridge.pfil_bridge
net.link.bridge.pfil_local_phys
net.link.bridge.pfil_member
net.link.bridge.pfil_onlyip
net.link.lagg.default_use_flowid
net.link.lagg.default_use_numa
net.link.lagg.default_flowid_shift
net.link.lagg.lacp.debug
net.link.lagg.lacp.default_strict_mode
```

Although the following vnet SYSCTLs have CTLFLAG_TUN flag, theirs
values are re-fetched via TUNABLE_XXX_FETCH, thus are not affected
by this change.
```
net.inet.ip.reass_hashsize
net.inet.tcp.hostcache.cachelimit
net.inet.tcp.hostcache.hashsize
net.inet.tcp.hostcache.bucketlimit
net.inet.tcp.syncache.bucketlimit
net.inet.tcp.syncache.cachelimit
net.inet.tcp.syncache.hashsize
net.key.spdcache.maxentries
net.key.spdcache.threshold
```

In memoriam:	hselasky
Discussed with:	hselasky, glebius
Fixes:		3da1cf1e88 Extend the meaning of the CTLFLAG_TUN flag ...
MFC after:	2 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D39638
2023-09-09 16:06:23 +08:00
John Baldwin 9c80d66ec1 makeman: Use ${make} instead of plain make to compute ${requireds}
This is currently a no-op but can matter for downstreams whose ${make}
includes additional settings.

Reviewed by:	imp, emaste
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D41777
2023-09-08 16:36:52 -07:00
John Baldwin 3555be0124 Move kern_extattr_* prototypes to <sys/syscallsubr.h>
All of the kern_* prototypes belong in this header.  While here, sort
the prototypes by function name.

Reviewed by:	dchagin
Fixes:		6453d4240f vfs: Export exattr methods to reuse by Linuxulator
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D41766
2023-09-08 16:36:28 -07:00
John Baldwin 3b5fc5eead riscv: Print stval in dump_regs for fatal exceptions
Reviewed by:	mhorne, markj
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D41700
2023-09-08 16:35:59 -07:00
John Baldwin 897e564361 cxgbe t4_tls: Call t4_rcvd_locked from do_rx_tls_cmp
Similar to dcfddc8dc0, replace the
simpler, inlined version with the full version.

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D41690
2023-09-08 16:31:38 -07:00
John Baldwin 75af2d951c cxgbe t4_tls: Don't bother returning RX credits for a protocol receive error
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D41689
2023-09-08 16:31:25 -07:00
John Baldwin dcfddc8dc0 cxgbe tom: Call t4_rcvd_locked from do_rx_data to return RX credits
In particular, the kernel RPC layer used by the NFS client never
invokes pru_rcvd since it always reads data from the socket upcall
via MSG_SOCALLBCK which avoids calling pru_rcvd.  As a result, on an
NFS client connection managed by t4_tom, RX credits were never
returned to the TOE connection to open the TCP window resulting in
connection hangs.

To fix, expand the set of conditions in do_rx_data where RX credits
are returned to match those in t4_rcvd_locked by calling the function
directly.

Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D41688
2023-09-08 16:31:21 -07:00
Robert Clausecker 2a4096b012 share/man/man7/simd.7: documend simd-enhanced memchr(3), strnlen(3)
Sponsored by:	The FreeBSD Foundation
Approved by:	mjg
MFC after:	1 week
MFC to:		stable/14
Differential Revision: https://reviews.freebsd.org/D41598
2023-09-08 17:22:31 -04:00
Robert Clausecker 331737281c lib/libc/amd64/string: implement strnlen(3) trough memchr(3)
Now that we have an optimised memchr(3), we can use it to implement
strnlen(3) with better perofrmance.

Sponsored by:	The FreeBSD Foundation
Approved by:	mjg
MFC after:	1 week
MFC to:		stable/14
Differential Revision:	https://reviews.freebsd.org/D41598
2023-09-08 17:22:31 -04:00