Commit Graph

272263 Commits

Author SHA1 Message Date
Adrian Chadd
29332c0dce qcom_mdio: add initial IPQ4018 MDIO support
This adds support for the IPQ4018/IPQ4019 MDIO bus.  This is used to
talk to external PHYs and switches.  (There's an internal switch
in the IPQ4018/IPQ4019 as well, but it's accessible via MMIO/AXI.)

Differential Revision: https://reviews.freebsd.org/D34110
Reviewed by: manu
2022-02-03 21:26:14 -08:00
Henri Hennebert
ad494d3b2d rtsx: Update driver version number to 2.1c
Differential Revision:	https://reviews.freebsd.org/D32154
2022-02-03 18:43:13 -05:00
Henri Hennebert
1e800a5934 rtsx: Do not display pci_read_config() errors during rtsx_init()
Differential Revision:	https://reviews.freebsd.org/D32154
2022-02-03 18:43:13 -05:00
Henri Hennebert
ec1f122b56 rtsx: Add CTLFLAG_STATS flag for read and write counters
Differential Revision:	https://reviews.freebsd.org/D32154
2022-02-03 18:43:12 -05:00
Henri Hennebert
7e5933b333 rtsx: Prefer __FreeBSD_version over __FreeBSD__
No functional change.

Differential Revision:	https://reviews.freebsd.org/D32154
2022-02-03 18:43:12 -05:00
Henri Hennebert
8e9740b62e rtsx: Convert driver to use the mmc_sim interface
A lot more generic cam related things were done in mmc_sim so this
simplifies the driver a lot.

Differential Revision:	https://reviews.freebsd.org/D32154
Reviewed by:		imp
2022-02-03 18:43:12 -05:00
Justin Hibbits
aa4736459e powerpc/atomic: Fix atomic_testand_*_long on powerpc64
After b5d227b0 FreeBSD was panicking on boot with "Duplicate free" in
UMA.  Analyzing the asm, the '1' mask was treated as an integer, rather
than a long, causing 'slw' (shift left word) to be used for the shifting
instruction, not 'sld' (shift left double).  This means the upper bits
of the bitfield were not getting used, resulting in corruption of the
bitfield.

While fixing this, the 'and' check of the mask does not need to be
recorded, so don't record (drop the '.').
2022-02-03 17:25:39 -06:00
Alexander Motin
3b248a2113 APEI: Make sure event data fit into the buffer.
There seem to be systems returning some garbage here.  I still don't
know why, but at least I hope this check fix indefinite printf loop.

MFC after:	2 weeks
2022-02-03 15:33:01 -05:00
Richard Scheffenegger
fd723975ec tcp: fix typo in commit f026275e26
missed one bitmask inversion while committing D34148

Differential Revision: https://reviews.freebsd.org/D34148
Differential Revision: https://reviews.freebsd.org/D34160
2022-02-03 21:05:09 +01:00
Richard Scheffenegger
3b0ee68050 tcp: Prevent setting of ECN bits with setsockopt()
setsockopt() grants full access to the deprecated
TOS byte. For TCP, mask out the ECN codepoint, so that
only the DSCP portion can be adjusted.

Reviewed By: tuexen, hselasky, #manpages, #transport, debdrup
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34154
2022-02-03 20:06:42 +01:00
Jesper Schmitz Mouridsen
ea07ba1170 sys/arm64/iommu/iommu_pmap.c readd sys/systm.h
after d950c5898a UINT64_C and bzero were no longer defined

Approved by:	kib
Differential Revision:	https://reviews.freebsd.org/D34155
2022-02-03 20:03:29 +01:00
Konstantin Belousov
529575be27 lnumeric.c: replace some space*8 by tabs
Reported by:	brooks
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2022-02-03 20:56:03 +02:00
John Baldwin
87c5d39f77 iwlwifi: Disable -Wformat when building with GCC.
GCC's -Wformat complains about NULL format strings passed to
iwl_fw_dbg_collect_trig (though the function handles NULL format
strings).  Curious that upstream iwlwifi in Linux is built with GCC
and explicitly opts into this warning via the __printf() attribute.

Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D34146
2022-02-03 10:48:18 -08:00
Wolfram Schneider
d43255b50c remove dead code
A lookup array is faster than a function with linear search.
The old function was not used for years - spring cleaning.
2022-02-03 17:02:37 +00:00
Wolfram Schneider
39a30a8097 better printf(3) format usage
Reported by: jhb
2022-02-03 16:57:25 +00:00
Hans Petter Selasky
c830e92924 mlx5ib: Fix whitespace.
Found by:	kib@
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-03 17:45:19 +01:00
Cy Schubert
5d4a348d0b ipfilter: Fix indentation error
Fixes:		064a5a9564
MFC after:	3 days
2022-02-03 08:37:11 -08:00
Hans Petter Selasky
12af59c2cf mlx5ib: Add missing auto generated header file to Makefile.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-03 17:35:12 +01:00
Alexander Motin
1a8d8a3a90 CTL: Fix mode page trucation on HA synchronization.
Due to variable size of struct ctl_ha_msg_mode ctl_isc_announce_mode()
sent only first 4 bytes of modified mode page to the other HA side,
that caused its corruption there, noticeable only after failover.

I've found alike bug also in ctl_isc_announce_lun(), but there it was
sending slightly more than needed, that is a smaller problem.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2022-02-03 11:10:12 -05:00
Kyle Evans
642701abc8 kern: harvest entropy from callouts
74cf7cae4d ("softclock: Use dedicated ithreads for running callouts.")
switched callouts away from the swi infrastructure.  It turns out that
this was a major source of entropy in early boot, which we've now lost.

As a result, first boot on hardware without a 'fast' entropy source
would block waiting for fortuna to be seeded with little hope of
progressing without manual intervention.

Let's resolve it by explicitly harvesting entropy in callout_process()
if we've handled any callouts.  cc/curthread/now seem to be reasonable
sources of entropy, so use those.

Discussed with:	jhb (also proposed initial patch)
Reported by:	many
Reviewed by:	cem, markm (both csprng)
Differential Revision:	https://reviews.freebsd.org/D34150
2022-02-03 10:05:06 -06:00
Richard Scheffenegger
f026275e26 tcp: set IP ECN header codepoint properly
TCP RACK can cache the IP header while preparing
a new TCP packet for transmission. Thus all the
IP ECN codepoint bits need to be assigned, without
assuming a clear field beforehand.

Reviewed By: tuexen, kbowling, #transport
MFC after:   3 days
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34148
2022-02-03 16:53:41 +01:00
Richard Scheffenegger
1ebf460758 tcp: Access all 12 TCP header flags via inline function
In order to consistently provide access to all
(including reserved) TCP header flag bits,
use an accessor function tcp_get_flags and
tcp_set_flags. Also expand any flag variable from
uint8_t / char to uint16_t.

Reviewed By: hselasky, tuexen, glebius, #transport
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34130
2022-02-03 16:21:58 +01:00
Mark Johnston
03399cd6e0 filemon.4: Document FILEMON_SET_FD errors and refine wording a bit
Reviewed by:	emaste, debdrup, Pau Amma
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34128
2022-02-03 09:46:34 -05:00
Mark Johnston
b84ed4e7f6 filemon: Reject FILEMON_SET_FD commands when the fd is a kqueue
When FILEMON_SET_FD is used, the filemon handle effectively wraps the
passed file.  In particular, the handle may be inherited by a child
process, or transferred over a unix domain socket, so we must verify
that the backing file permits this.

Reported by:	syzbot+36e6be9e02735fe66ca8@syzkaller.appspotmail.com
Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34128
2022-02-03 09:41:53 -05:00
Michael Tuexen
d51c80351f rack: fix compilation and small cleanup
Fix a function prototype missed in the last commit and whitespace
change.
Sponsored by:	Netflix, Inc.
2022-02-02 09:41:40 +01:00
Michael Tuexen
3b3c08c135 tcp: cleanup functions related to socket option handling
Consistently only pass the inp and the sopt around. Don't pass the
so around, since in a upcoming commit tcp_ctloutput_set() will be
called from a context different from setsockopt(). Also expect
the inp to be locked when calling tcp_ctloutput_[gs]et(), this is
also required for the upcoming use by tcpsso, a command line tool
to set socket options.
Reviewed by:		glebius, rscheff
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D34151
2022-02-02 09:27:59 +01:00
Peter Holm
8d72c409cd stress2: Fix "set but not used [-Wunused-but-set-variable]" warnings 2022-02-03 11:52:38 +01:00
Peter Holm
656194f140 stress2: Finish work on a unionfs test scenario. Enable three unionfs tests 2022-02-03 08:04:56 +01:00
Warner Losh
e30fceb89b mps: Use 64-bit chain structures
According to Broadcom, mixing 64-bit SGEs with 32-bit chain entries can
lead to IOC Fault code 0x40000d04. This fault code has been observed to
suddenly increase on certain machines when the OCA firmware images are
deployed. The hardware interprets all elements of a 64-bit SGE, even
ones marked as 32-bit. Depending on the other bits, this will just work,
but sometimes generate the above fault. Broadcom recommends this
practice, and the Linux and NetBSD drivers follow it.

Rework the chaining code to use MPI2_SGE_CHAIN64 instead of
MPI2_SGE_CHAIN32. Adjust MPS_SGC_SIZE from 8 to 12 to match the size of
the new structure. Flag the structure as being 64-bits now. Since
MPS_SGE64_SIZE and MPS_SGC_SIZE are the same now, mps_push_sge could be
simplified (after the same fashion of mpr). The different number of
cases collapse to whether or not there's room for the segments and if
not we need a chain, however these changes haven't been made yet as the
current code handles those cases properly with the new defines.

Made chain_busaddr 64-bits, even though we ask for all allocations to be
below 4GB for this tag. Use it to set both parts of the CHAIN64 address
rather than baking the 4GB assumption. Add asserts around the allocation
to detect and BUSDMA bugs in allocation.

Remove asserts and associated comment in mpi_pre_fw_download and
mpi_pre_fw_upload. The code does not, it seems, depend on this
invariant. The mpr driver has similar code, no asserts and also doesn't
depend on this.

Adjust comments to reflect the updated size.

Sponsored by:		Netflix
Reviewed by:		scottl, mav
Differential Revision:	https://reviews.freebsd.org/D34016
2022-02-02 22:35:33 -07:00
Jason A. Harmening
83d61d5b73 unionfs: do not force LK_NOWAIT if VI_OWEINACT is set
I see no apparent need to avoid waiting on the lock just because
vinactive() may be called on another thread while the thread that
cleared the vnode refcount has the lock dropped.  In fact, this
can at least lead to a panic of the form "vn_lock: error <errno>
incompatible with flags" if LK_RETRY was passed to VOP_LOCK().
In this case LK_NOWAIT may cause the underlying FS to return an
error which is incompatible with LK_RETRY.

Reported by:	pho
Reviewed by:	kib, markj, pho
Differential Revision:	https://reviews.freebsd.org/D34109
2022-02-02 21:08:17 -06:00
Jason A. Harmening
6ff167aa42 unionfs: allow lock recursion when reclaiming the root vnode
The unionfs root vnode will always share a lock with its lower vnode.
If unionfs was mounted with the 'below' option, this will also be the
vnode covered by the unionfs mount.  During unmount, the covered vnode
will be locked by dounmount() while the unionfs root vnode will be
locked by vgone().  This effectively requires recursion on the same
underlying like, albeit through two different vnodes.

Reported by:	pho
Reviewed by:	kib, markj, pho
Differential Revision:	https://reviews.freebsd.org/D34109
2022-02-02 21:08:17 -06:00
Jason A. Harmening
0cd8f3e958 unionfs: fix assertion order in unionfs_lock()
VOP_LOCK() may be handed a vnode that is concurrently reclaimed.
unionfs_lock() accounts for this by checking for empty vnode private
data under the interlock.  But it incorrectly asserts that the vnode
is using the unionfs dispatch table before making this check.
Reverse the order, and also update KASSERT_UNIONFS_VNODE() to provide
more useful information.

Reported by:	pho
Reviewed by:	kib, markj, pho
Differential Revision:	https://reviews.freebsd.org/D34109
2022-02-02 21:08:17 -06:00
Konstantin Belousov
ef061a2e29 __ctype_load(): check for calloc() failure
Noted and reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:04:00 +02:00
Konstantin Belousov
87151b60e0 __numeric_load(): check for calloc() failure
Noted and reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:03:52 +02:00
Konstantin Belousov
1aa669c5f9 libc/locale/lnumeric.c: minor style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:03:44 +02:00
Konstantin Belousov
4d3b84f67c __monetary_load(): check for calloc() failure
Noted and reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:03:35 +02:00
Konstantin Belousov
0fed1e6f18 libc/locale/lmonetary.c: minor style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:03:29 +02:00
Konstantin Belousov
bc9ce839f9 __messages_load(): check for calloc() failure
Noted and reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:03:24 +02:00
Konstantin Belousov
5b7e92d48f libc/locale/lmessages.c: minor style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:03:17 +02:00
Konstantin Belousov
b8ad908ad9 __collate_load(): check for calloc failure
Noted and reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:03:07 +02:00
Konstantin Belousov
a8be061167 libc/locale/collate.c: minor style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:02:59 +02:00
Konstantin Belousov
7bf532c9d4 xlocale.c: only call init_key() when locale was successfully allocated
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:02:59 +02:00
Konstantin Belousov
b68522308d xlocale.c: check for allocation failure
PR:	261679
Reported by:	phil.stone@gmx.com
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:02:58 +02:00
Konstantin Belousov
fcdf9d7de5 xlocale.c:init_key(): do not ignore errors from pthread_key_create()
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:02:58 +02:00
Konstantin Belousov
aaa6fa65a6 libc/locale/xlocale.c: minor style
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34140
2022-02-03 03:02:58 +02:00
Rick Macklem
e2fe58d61b nfsd: Allow file owners to perform Open(Delegate_cur)
Commit b0b7d978b6 changed the NFSv4 server's default
behaviour to check the file's mode or ACL for permission to
open the file, to be Linux and Solaris compatible.
However, it turns out that Linux makes an exception for
the case of Claim_delegate_cur(_fh).

When a NFSv4 client is returning a delegation, it must
acquire Opens against the server to replace the ones
done locally in the client.  The client does this via
an Open operation with Claim_delegate_cur(_fh).  If
this operation fails, due to a change to the file's
mode or ACL after the delegation was issued, the
client does not have any way to retain the open.

As such, the Linux client allows the file's owner
to perform an Open with Claim_delegate_cur(_fh)
no matter what the mode or ACL allows.

This patch makes the FreeBSD server allow this case,
to be Linux compatible.

This patch only affects the case where delegations
are enabled, which is not the default.

MFC after:	2 weeks
2022-02-02 14:10:16 -08:00
Warner Losh
03f6e18206 Makefile.libcompat: Sort
Sort MK_BOOT before MK_CTF and remove now-useless NO_LINT while I'm
here.

Suggested by:		brooks, emaste
Sponsored by:		Netflix
2022-02-02 14:34:29 -07:00
Warner Losh
034755623d stand: Fix kboot issue on powerpc64 with MK_LIB32=yes
When MK_LIB32 is true, we descend into stand for make includes, make
clean, etc. We shouldn't do this, so set MK_BOOT=no when we're building
includes.

Fixes:		6497250f6f
PR:		261497
Sponsored by:	Netflix
Reviewed by:	emaste, brooks (he suggested this)
Differential Revision:	https://reviews.freebsd.org/D34141
2022-02-02 14:27:56 -07:00
Warner Losh
356deeb2e7 kyua/qemu: When running in qemu, don't teset sendfile
qemu's bsd-user doesn't implement sendfile, so just skip those tests
that use it.

Sponsored by:		Netflix
2022-02-02 14:27:51 -07:00
John Baldwin
63b7c2df8e Disable -Wunused-function for {ed,x}25519_ref10.c in libsodium. 2022-02-02 12:25:16 -08:00