Commit graph

286285 commits

Author SHA1 Message Date
Dag-Erling Smørgrav d2c839eee0 Belatedly document OPIE removal in RELNOTES and UPDATING.
MFC after:	3 days
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D41822
2023-09-13 11:43:45 +00:00
Kristof Provost 7d45cdbad4 pf tests: pfsync:defer requires scapy
Add the kyua hint so we skip the test if it's not installed.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-09-13 11:12:27 +02:00
Wei Hu ab7dc1ceb6 mana: add ioctl to support toggling offloading features
With this support, users can enable or disable offloading features
such as txcsum, rxcsum, tso and software lro through ifconfig.

To enable or disable tx features, do it on mana interface first,
then hn/netvsc to sync it up with mana. For example:

ifconfig mana0 -txcsum
ifconfig hn0 -tscsum

To enable or disable rx features, just applying on mana interface
would be sufficient.

Disabling txcsum imples disabling tso. Enabling tso when txcsum
is disabled will result in an error message in dmesg requesting
to enable txcsum first.

Above applies to ipv6 offloading features as well.

Tested by:	whu
MFC after:	3 days
Sponsored by:	Microsoft
2023-09-13 10:59:40 +00:00
Cy Schubert 7f5e3b9fa3 ipfilter: Avoid allocating a new ipf token when not needed
Only allocate a new ipftoken_t if one cannot be found. This eliminates
allocating unnecessary token structures that will never be used when
performing simple lookups for existing token structures.

MFC after:	2 weeks
2023-09-12 19:10:40 -07:00
Michael Tuexen 81c5f0fac9 sctp: improve shutting down the read side of a socket
When shutdown(..., SHUT_RD) or shutdown(..., SHUT_RDWR) is called,
really clean up the read queue and issue an ungraceful shutdown if
user messages are affected.

Reported by:	syzbot+d4e1d30d578891245f59@syzkaller.appspotmail.com
MFC after:	3 days
2023-09-13 01:36:14 +02:00
Kyle Evans c086d1cbc3 ncurses: avoid hardcoded assumptions about the layout of .OBJDIR
Abstract out the details of the FreeBSD build into a $TINFO_OBJDIR that
external builds can override if they orchestrate the build a bit
differently and have a different objdir layout as a result.  This makes
the ncurses build a little bit more flexible without requiring weird
backflips.

Reviewed by:	bapt, sjg
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D41834
2023-09-12 16:00:45 -05:00
Doug Moore e5635c3dab powerpc_mmu_radix: include vm_radix.h file
Replacing _vm_radix.h with vm_radix.h in one header file leaves one
source file short of function definitions.  Include vm_radix.h in that
source file.

Fixes a problem rooted in change 429c871ddd.
2023-09-12 14:35:48 -05:00
Piotr Pawel Stefaniak c996638497 tslog.4: fix typo 2023-09-12 21:10:08 +02:00
Piotr Pawel Stefaniak 8e5c53af83 sh: also auto-complete functions
Differential Revision:	https://reviews.freebsd.org/D40619
2023-09-12 18:40:05 +02:00
Piotr Pawel Stefaniak bec7b9a219 sh: introduce a function to iterate over all hashed commands
While aliases and built-ins are opportunistically stored in cmdtable, each
function will be added to it immediately on definition.

Factor out the hashing function, write the iterator function and make it use
the hashing function.

Add the cmdname pointer to struct cmdentry so that the command name can be
exposed that way.

Differential Revision:	https://reviews.freebsd.org/D40619
2023-09-12 18:39:54 +02:00
Piotr Pawel Stefaniak 0fd450e289 sh: tab-complete aliases
Differential Revision:	https://reviews.freebsd.org/D40619
2023-09-12 18:39:42 +02:00
Piotr Pawel Stefaniak 2fc4a84ed8 sh: introduce a function to iterate over all aliases
Currently the data structure holding alias information is opaque for
consumers outside alias.c and there is no way to iterate over all
aliases, which will become needed by a future commit.

The new function "iteralias" takes a null pointer to return the first
alias or an existing alias to return the next one, unless there is
no alias to return, in which case it returns a null pointer.

I slightly changed the static function hashalias so that it returns the
index into the array holding link heads, and not the link head directly.
In this form it's easier to use by iteralias and the slight adjustment
in the three existing callers doesn't look too bad.

Differential Revision:	https://reviews.freebsd.org/D40619
2023-09-12 18:39:20 +02:00
Piotr Pawel Stefaniak 63b6e661d2 sh: reindent a for loop in parser.c
Reduce indentation level before a commit that will add new code here.

Reviewed by:	jilles
Differential Revision:	https://reviews.freebsd.org/D37926
2023-09-12 18:36:32 +02:00
Alan Somers 0b294a386d Fix zfsd with the device_removal pool feature.
Previously zfsd would crash in the presence of a pool with a
top-level-vdev that had previously been removed.  The crash happened
because the configuration nvlist of such a TLV contains an empty
ZPOOL_CONFIG_CHILDREN array, which led to a pop_front from an empty
list, which has undefined behavior.

The crash only happened in stable/14 and later, probably do to
differences in libcxx, but the change should be MFCed anyway.

PR:		273663
Reported by:	Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
MFC after:	1 week
Sponsored by:	Axcient
Reviewed by:	mav
Differential Revision: https://reviews.freebsd.org/D41818
2023-09-12 08:46:12 -06:00
Damien Broka ff9c4abd9f
sysctl(9): Fix typo translatation -> translation
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/839
2023-09-12 22:42:03 +08:00
Damien Broka 06bac0da13
usbdi(9): Fix typo to simply -> to simplify
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/839
2023-09-12 22:41:42 +08:00
Doug Moore b24ed9c52d powerpc_pmap: include proper vm_radix file
Like the pmap.h files for amd64, arm64, i386 and riscv, the one for powerpc
should #include vm/_vm_radix.h, not vm/vm_radix.h, to get a definition for
struct vm_radix.

Fixes a problem introduced with 429c871ddd.
2023-09-12 08:10:15 -05:00
Doug Rabson 78847e1e59 pkgbase: Move headers and libs out of runtime and utilities
Headers from src/include were in the runtime-dev package but
subdirectories of src/include ended up in utilities-dev by default.
Neither package is a good choice - the headers in src/include are not
useful without the libraries contained in clibs-dev.

This moves the standard C headers to clibs-dev (C++ headers are already
in this package). While working on this, I found that various clang
libraries and headers were also bundled into utilities-dev by default
so these are also moved to clang-dev.

I also added a FreeBSD-build-essential meta package to make it simple to
install all the toolchain parts.

PR:		254173
Reviewed byb:	manu
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D41815
2023-09-12 13:22:21 +01:00
Dmitry Chagin d0266fbab9 linux(4): Cleanup dummy syscall list on arm64
These syscalls do not exist on arm64 Linux.

MFC after:		1 week
2023-09-12 13:37:45 +03:00
Doug Moore 10db91ecec vm_radix: add a missing paren
429c871ddd left parens unbalanced in a
powerpc case that my testing missed.  Restore balance.

Reported by:	jenkins
2023-09-12 04:19:51 -05:00
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