Commit Graph

277613 Commits

Author SHA1 Message Date
Mateusz Guzik
9488262679 rms: add rms_assert_rlock_ok
So that callers which opportunistically elide the lock can still
assert that they can take it.

Reviewed by:
Differential Revision:
2022-08-23 19:15:48 +00:00
John Baldwin
9e4e7bcaef *DRIVER_MODULE*: Remove the compat shims to accept the devclass argument.
PR:		264969 (exp-run)
Differential Revision:	https://reviews.freebsd.org/D35168
2022-08-23 09:38:09 -07:00
John Baldwin
6ea773d49a pmu_dmc620: Remove unused devclass from DRIVER_MODULE. 2022-08-23 09:36:12 -07:00
John Baldwin
9a777495df cmn600: Remove unused devclass from DRIVER_MODULE. 2022-08-23 09:36:11 -07:00
John Baldwin
51480b486a mv88e151x: Remove unused devclass argument from DRIVER_MODULE. 2022-08-23 09:36:11 -07:00
Alexander V. Chernikov
cf145eb25f arcanist: use FreeBSD/git project repository instead of FreeBSD/svn
Current `.arcconfig` specifies explicit mapping to the FreeBSD/SVN
 project in Phabricator, which is inactive. This mapping only gets
 updated to the current "production" (FreeBSD/git) project when the
 underlying change is committed.
Update arcanist configuration to create all new diffs in the
 FreeBSD/git project.

Reviewed By: dim, emaste
Differential Revision: https://reviews.freebsd.org/D36204
2022-08-23 14:16:41 +00:00
Eric van Gyzen
3d268c19ef Fix shared_shadow_inval_test when superpages are disabled
In that case, there is only one page size.

Reviewed by:	kib
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D36265
2022-08-23 09:12:51 -05:00
Randall Stewart
62ce18fc9a tcp: Rack rwnd collapse.
Currently when the peer collapses its rwnd, we mark packets to be retransmitted
and use the must_retran flags like we do when a PMTU collapses to retransmit the
collapsed packets. However this causes a problem with some middle boxes that
play with the rwnd to control flow. As soon as the rwnd increases we start resending
which may be not even a rtt.. and in fact the peer may have gotten the packets. Which
means we gratuitously retransmit packets we should not.

The fix here is to make sure that a rack time has passed before retransmitting the packets.
This makes sure that the rwnd collapse was real and the packets do need retransmission.

Reviewed by: tuexen
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D35166
2022-08-23 09:17:05 -04:00
Randall Stewart
4e0ce82b53 TCP Lro has a loss of timestamp precision and reorders packets.
A while back Hans optimized the LRO code. This is great but one
optimization he did degrades the timestamp precision so that
all flushed LRO entries end up with the same LRO timestamp
if there is not a hardware timestamp. The intent of the LRO timestamp
is to get as close to the time that the packet arrived as possible. Without
the LRO queuing this works out fine since a binuptime is taken and then
the rx_common code is called. But when you go through the queue path
you end up *not* updating the M_LRO_TSTMP fields.

Another issue in the LRO code is several places that cause packet reordering. In
general TCP can handle reordering but it can cause extra un-needed retransmission
as well as other oddities. We will fix all of the reordering problems.

Lets fix this so that we restore the precision to the timestamp.

Reviewed by: tuexen, gallatin
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D36043
2022-08-23 09:12:31 -04:00
Luiz Amaral
485be9798a pfsync: replace struct pfsync_pkt with int flags
Get rid of struct pfsync_pkt. It was used to store data on the stack to
pass to all the submessage handlers, but only the flags part of it was
ever used. Just pass the flags directly instead.

Reviewed by:		kp
Obtained from:		OpenBSD
Sponsored by:		InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D36294
2022-08-22 23:46:50 +02:00
Jessica Clarke
fba998a3d8 tools/build: Unbreak bmake bootstrap on Linux
Currently make.py has a hack to add the cross-build headers to the
include search path when bootstrapping bmake on Linux (but not macOS).
This is a bit of an abuse of these headers, and e9ba1fd5ed was not
prepared for this, since sys/bitcount.h won't exist in that instance (it
gets copied into WORLDTMP during the legacy build). Work around this
until we can wean the bmake bootstrap off using these headers by not
including sys/bitcount.h when it doesn't exist.

Fixes:	e9ba1fd5ed ("tools/build: Provide FreeBSD's bitstring API when cross-building")
2022-08-22 22:02:53 +01:00
Rick Macklem
564ed8e806 nfsd: Allow multiple instances of rpc.tlsservd
During a discussion with someone working on NFS-over-TLS
for a non-FreeBSD platform, we agreed that a single server
daemon for TLS handshakes could become a bottleneck when
an NFS server first boots, if many concurrent NFS-over-TLS
connections are attempted.

This patch modifies the kernel RPC code so that it can
handle multiple rpc.tlsservd daemons.  A separate commit
currently under review as D35886 for the rpc.tlsservd
daemon.
2022-08-22 13:54:24 -07:00
Dmitry Salychev
a070c11afe
Add dsl to the src committers and bz as my mentor
Approved by:		bz (mentor)
Differential Revision:	https://reviews.freebsd.org/D36276
2022-08-22 15:59:21 +02:00
Bjoern A. Zeeb
11d08e7e8d arm/gic: fix a KASSERT in arm_gic_reserve_msi_range()
Fix the off-by-one in the KASSERT in arm_gic_reserve_msi_range()
allowing the MSIs being allocated at the end of the IRQ range.

Reported by:	bz
Submitted by:	andrew
Reviewed by:	andrew
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D36291
2022-08-22 11:59:02 +00:00
Hans Petter Selasky
57af517ac4 ibcore: Add support for RDMA/RoCE using VLAN(4) devices.
Classify VLAN devices as ethernet in rdma_copy_addr().
This fixes the following error message:

rdma_bind_addr: No such file or directory

Submitted by:	bartosz.sobczak@intel.com (Bartosz Sobczak)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36120
Sponsored by:	NVIDIA Networking
2022-08-22 10:04:26 +02:00
Hans Petter Selasky
e7314192ce sound(4): Fix order of parameters for custom equalizer band pass filter.
When specifying a custom band-pass filter for the sound(4) equalizer,
use the same format as used by the resulting C-code define to avoid
confusion.

PR:		195760
Sponsored by:	NVIDIA Networking
2022-08-22 10:04:26 +02:00
Mateusz Kozyra
7cb73f654f uart: Add ACPI entry for LS1046A UART
NXP defines unique name for LS1046A UART - "NXP0018".
It is ns8250 compatible, adding a new uart compat data entry is enough
to make it work.
Tested on LS1046ARDB.

Approved by:	mw(mentor)
Reviewed by:	mw, kd
Obtained from:	Semihalf
Differential Revision:	https://reviews.freebsd.org/D36260
2022-08-22 09:16:08 +02:00
Warner Losh
9d70108a74 stand: Use bool for stage_offset_set
stage_offset_set is a boolean, convert it to a bool.

Sponsored by:		Netflix
2022-08-21 09:48:02 -06:00
Gleb Smirnoff
9d54812421 snmp_mibII: use net.inet.ip.fragttl sysctl for ipReasmTimeout
Using IPFRAGTTL define was never correct, as it was measured in
PR_SLOWTIMO intervals.  The sysctl returns seconds, just what
ipReasmTimeout is.
2022-08-21 07:44:58 -07:00
Gleb Smirnoff
6498153665 ip_reass: don't drain all vnets on a vnet destroy 2022-08-21 07:44:58 -07:00
Robert Wing
3454a7caa0 kqueue: retire knlist_init_rw_reader()
Last usage was removed in afa85850e7.

Reviewed by:	pauamma, melifaro, kib
Differential Revision:	https://reviews.freebsd.org/D36205
2022-08-20 21:17:39 -08:00
Gleb Smirnoff
8338690a0a ip_reass: provide sysctl MIB returning IP fragment TTL
For now it is read-only, but eventually the cycle that goes over
all fragments should be refactored and this MIB should also become
read/write.

This MIB will allow SNMP daemons to implement MIB-II ipReasmTimeout MIB
straightfoward.  Right now net-snmp compilation is broken by 1922eb3e9c.
The base system bsnmpd is not broken just because it ignored PR_SLOWTIMO,
and thus always returned incorrectly doubled value for ipReasmTimeout.
2022-08-20 13:39:12 -07:00
Konstantin Belousov
f829268bcc Remove TDF_DOING_SA
We cannot see a thread with the flag set in unsuspend, after we stopped
doing SINGLE_ALLPROC from user processes.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:34:30 +03:00
Konstantin Belousov
5e5675cb4b Remove struct proc p_singlethr member
It does not serve any purpose after we stopped doing
thread_single(SINGLE_ALLPROC) from stoppable user processes.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:34:30 +03:00
Konstantin Belousov
2842ec6d99 REAP_KILL_PROC: kill processes in the threaded taskqueue context
There is a problem still left after the fixes to REAP_KILL_PROC.  The
handling of the stopping signals by sig_suspend_threads() can occur
outside the stopping process context by tdsendsignal(), and it uses
mostly the same mechanism of aborting sleeps as suspension.  In other
words, it badly interacts with thread_single(SINGLE_ALLPROC).

But unlike single threading from the process context, we cannot wait by
sleep for other single threading requests to pass, because we own
spinlock(s).

Fix this by moving both the thread_single(p2, SINGLE_ALLPROC), and the
signalling, to the threaded taskqueue which cannot be single-threaded
itself.

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:34:11 +03:00
Konstantin Belousov
5e9bba94bd fork_norfproc(): unlock p1 before retrying
Reported and reviewed by:	markj
Tested by:	pho
Syzkaller:	647212368c3f32c6f13f
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:18 +03:00
Konstantin Belousov
0a4f2ac3b7 kern_sig.c: style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:18 +03:00
Konstantin Belousov
cdb58f9d04 ksiginfo_tryfree(): change return type to bool
The function result is already used as bool.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:18 +03:00
Konstantin Belousov
cc29f221aa ksiginfo_alloc(): change to directly take M_WAITOK/NOWAIT flags
Also style, and remove unneeded cast.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
5c78797e42 reap_kill_proc_locked(): remove outdated part of the comment
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
30b16a6bcf exit1(): update comment about thread_single()
We do not check single-threading conditions in trap, or when sleeping
uninterruptible.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
f835be5822 sleepq_set_timeout_sbt(): correct comment to not talk about ticks
It is sbt now.  Also, explain what flags are.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
da39a100db sleepq_check_ast_sc_locked(): update comment
The relock order is important not only for a signal delivery, but also
for the suspension requests.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Konstantin Belousov
bd76586bb7 fork_norfproc(): style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D36207
2022-08-20 20:33:17 +03:00
Ed Maste
6b598e263b pf: Reduce diffs against OpenBSD in pf_if.c
Use memset instead of bzero, memcpy instead of bcopy, and add some
optional {}s.

Reviewed by:	kp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36267
2022-08-20 11:52:05 -04:00
Søren Schmidt
ec556724d7 Add interrupt handling to rk_gpio driver. 2022-08-20 11:30:54 +00:00
Piotr Pawel Stefaniak
a142345641 sh: nullify ENV in tests
This is to avoid loading .shrc which may contain commands that would
result in output different than expected.

Reviewed by:	jilles
Differential Revision:	https://reviews.freebsd.org/D35876
2022-08-20 13:27:42 +02:00
Piotr Pawel Stefaniak
755a1be6d0 sh: accept fc options grouped behind one '-'
As per Utility Syntax Guidelines, accept both forms: -l -n and -ln.

To do that, anticipate the source string for the next option that will
be parsed by nextopt(). It's not always *argptr, sometimes it is
nextopt_optptr.

To simplify the check for not_fcnumber, slightly modify nextopt() to
always nullify nextopt_optptr in cases where it would have been set
to point to a NUL character.

Reviewed by:	jilles
Differential Revision:	https://reviews.freebsd.org/D35836
2022-08-20 13:26:05 +02:00
Mateusz Guzik
497240def8 Retire clone_drain_lock
It is only ever xlocked in drain_dev_clone_events and the only consumer of
that routine does not need it -- eventhandler code already makes sure the
relevant callback is no longer running.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D36268
2022-08-20 09:44:05 +00:00
Doug Moore
02d0c43c9e rb_tree: speed-up double rotation
RB_ROTATE_LEFT (and it symmetric twin) modify the rb-tree, adjusting
pointers so that what started as a proper tree ends up a proper
tree. When two consecutive rotations move the same node up the tree,
some of the pointers changed in the first rotation are immediately
changed again in the second - namely, the pointer from the rising node
to its new parent, and the pointer from that parent back to the rising
node. This change removes from RB_ROTATE macros the responsibility for
managing those two pointers, and leaves it to the code that calls for
rotations to fix up those pointers afterward. That drops a comparison
and a pair of assignments from every INSERT_COLOR or REMOVE_COLOR call
that ends in a double rotation.

A side-effect of this change is that the SWAP_CHILD macro must take as
a parameter a pointer to the node that is changing children, where it
is now computed from the old child. Since this macro is called in a
couple of places besides the RB_ROTATE macros, those calls are also
affected.

Reviewed by:	alc
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D36266
2022-08-19 18:11:29 -05:00
Navdeep Parhar
f6cc21e8e1 cxgbetool: remove unnecessary vertical whitespace.
No functional change.

MFC after:	3 days
2022-08-19 15:38:13 -07:00
John Baldwin
c94f30ea85 bhyve: Validate host PAs used to map passthrough BARs.
Reject attempts to map host physical address ranges that are not
subsets of a passthrough device's BAR into a guest.

Reviewed by:	markj, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36238
2022-08-19 15:03:01 -07:00
John Baldwin
16bedf532c pci: Add helper routines to iterate over a device's BARs.
Reviewed by:	imp, markj, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36237
2022-08-19 14:59:06 -07:00
John Baldwin
baf753cc19 bhyve: Support other schemes for naming pass-through devices.
Permit naming pass through devices using the syntax accepted by
pciconf (pci[<domain>:]<bus>:<slot>:<func>) as well as by device name
(e.g. "ppt0").

While here, fix an error in the manpage that had the bus and slot
arguments for the original /-delimited scheme swapped.

Reviewed by:	imp, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36147
2022-08-19 14:58:55 -07:00
Kristof Provost
7647626d33 e6000sw: fix incorrect locking
During attach we release the lock to call e6000sw_attach_miibus(), which
calls mii_attach(). The mii_attach() function calls miibus_readreg() /
miibus_writereg(). However, these are set to be
e6000sw_readphy_locked().

That is, the read/write phy functions do not acquire the lock, but
expect to be called while locked.  Simply do not unlock and relock while
calling mii_attach().

Reviewed by:	Hubert Mazur <hum@semihalf.com>
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36117
2022-08-19 23:09:11 +02:00
Gleb Smirnoff
820bafd0bc unix/dgram: don't panic if socket buffer has negative space
That's a legitimate scenario, although unlikely.

Reported by:	https://syzkaller.appspot.com/bug?extid=6e8be1ec8d77578a3df4
2022-08-19 12:15:38 -07:00
Ed Maste
97be6fced7 openssh: Remove description of VersionAddendum in upgrade doc 2022-08-19 10:39:17 -04:00
Ed Maste
bffe60ead0 ssh: retire client VersionAddendum
FreeBSD introduced VersionAddendum for the server as a local change in
2001 in commit 933ca70f8f and later extended it to the client in
commit 9e2cbe04ff.

In 2012 upstream added support for server VersionAddendum, in commit
23528816dc10.  They do not support it for the client.

The argument for supporting this in the client is not nearly as strong
as for the server, so retire this option to reduce the scope of our
local patch set.  This also avoids some cases of conflicts in ssh_config
during update, as a user's configuration would typically follow the
commented-out default VersionAddendum value.

Reviewed by:	gordon, glebius
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32930
2022-08-19 10:38:42 -04:00
Søren Schmidt
901df07a47 Code refactoring for existing rk_gpio driver.
It supports gpio type checking. Depending on gpio type some
register addresses are different.

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D36262
2022-08-19 13:22:01 +00:00
Kristof Provost
c780d3ad7b pf: clear ethernet rules prior to shutdown
Ethernet rule cleanup is postponed to an epoch callback. Ensure it's
been called before we remove the entire vnet, or we risk the rules still
getting hit after we've freed the uma zone, i.e. a use-after-free.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-08-19 14:53:09 +02:00