Commit Graph

141143 Commits

Author SHA1 Message Date
John Baldwin
69e533c3ff swcr_encdec: Rename blks to blksz.
This better reflects the variables purpose and matches other functions
in this file.

Requested by:	markj
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33755
2022-01-11 14:20:10 -08:00
John Baldwin
cfb7b942be cryptosoft: Use multi-block encrypt/decrypt for non-AEAD ciphers.
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33531
2022-01-11 14:18:57 -08:00
John Baldwin
d7f0b3ce6d crypto: Re-add encrypt/decrypt_multi hooks to enc_xform.
These callbacks allow multiple contiguous blocks to be manipulated in
a single call.  Note that any trailing partial block for a stream
cipher must still be passed to encrypt/decrypt_last.

While here, document the setkey and reinit hooks and reorder the hooks
in 'struct enc_xform' to better reflect the life cycle.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33529
2022-01-11 14:17:41 -08:00
John Baldwin
8f35841f1f crypto: Add support for the XChaCha20-Poly1305 AEAD cipher.
This cipher is a wrapper around the ChaCha20-Poly1305 AEAD cipher
which accepts a larger nonce.  Part of the nonce is used along with
the key as an input to HChaCha20 to generate a derived key used for
ChaCha20-Poly1305.

This cipher is used by WireGuard.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33523
2022-01-11 14:16:41 -08:00
John Baldwin
7df4c50643 crypto.ko: Add hchacha20 from libsodium.
This was added to 'device crypto' in the kernel in
bbb7a2c7c3 but was missing from the
module.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33522
2022-01-11 14:15:51 -08:00
Hans Petter Selasky
75d20a5e38 rtwn(4): Add new USB ID.
Submitted by:	Wensi <supdrewin@outlook.com>
PR:		261098
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-01-11 21:19:53 +01:00
Rick Macklem
a91a57846b nfsd: Do not accept audit/alarm ACEs for the NFSv4 server
The UFS and ZFS file systems only support Allow/Deny ACEs
in the NFSv4 ACLs.  This patch does not allow the server
to parse Audit/Alarm ACEs.  The NFSv4 client is still
allowed to pase Audit/Alarm ACEs, since non-FreeBSD NFSv4
servers may use them.

This patch should not have a significant effect, since the
UFS and ZFS file systems will not handle these ACEs anyhow.
It simply serves as an additional "safety belt" for the
NFSv4 server.

MFC after:	2 weeks
2022-01-11 09:40:07 -08:00
Andrew Turner
2754373f9a Use ${MACHINE} for the kernel modeule ldscript
For consistancy with the kernel linker script also use ${MACHINE} for
finding the kernel module linker script. As we currently only use this
for amd64 and i386 this is a no-op, but I'm planning on using this with
arm64 where ${MACHINE} != ${MACHINE_ARCH}.

Reviewed by:	markj, kib, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33841
2022-01-11 16:58:31 +00:00
Rick Macklem
5da9b3b011 Revert "nfscommon: Add arguments for support of the dacl attribute"
This reverts commit 0fa074b53e.

I now see that the implementation of the "dacl" operation
requires that the NFSv4 server to "automatic inheritance"
and I do not plan on doing this.  As such, this patch is
harmless, but unneeded.
2022-01-11 08:30:50 -08:00
Rick Macklem
b1f80dfac9 Revert "nfscommon: Return NFSERR_ATTRNOTSUPP for AUDIT/ALARM ACEs"
This reverts commit f10dc28ec2.

The client should still be able to getfacl
audit and alarm ACEs, for non-FreeBSD NFSv4 servers.

A patch that only disables audit/alarm for the server
side will be committed to replace this patch.
2022-01-11 08:26:42 -08:00
Vitaliy Gusev
c72e914cf1 vmm: vlapic resume can eat 100% CPU by vlapic_callout_handler
Suspend/Resume of Win10 leads that CPU0 is busy on handling interrupts.

Win10 does not use LAPIC timer to often and in most cases, and I see it
is disabled by writing 0 to Initial Count Register (for Timer).

During resume, restart timer only for enabled LAPIC and enabled timer
for that LAPIC.

Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D33448
2022-01-11 09:27:45 -05:00
Mark Johnston
c4a25e0713 vm_pageout: Group sysctl variables together with sysctl definitions
Fix some style bugs while here.  No functional change intended.

Reviewed by:	alc, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33811
2022-01-11 09:27:45 -05:00
Mark Johnston
43b3b8e52d swap_pager: uma_zcreate() doesn't fail
Remove always-false checks for UMA zone creation failure.  No functional
change intended.

Reviewed by:	alc, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33809
2022-01-11 09:27:45 -05:00
Andriy Gapon
94f4afd772 rk805 / rk808: re-add system poweroff support
This was lost by accident in 98c60dc31f.

Reviewed by:	manu
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D33844
2022-01-11 16:22:36 +02:00
Andriy Gapon
ee900888c4 dwwdt: make it actually useful
Flip dwwdt_prevent_restart to false.  What's the use of a watchdog if it
does not restart a hung system?

Add a knob for panic-ing on the first timeout, resetting on the second
one.  This can be useful if interrupts can still work, otherwise a reset
recovers a system without any aid for debugging the hang.

The change also doubles the timeout that's programmed into the hardware.
The previous version of the code always had the interrupt on the first
timeout enabled, but it took no action on it.  Only the second timeout
could be configured to reset the system.  So, the hardware timeout was
set to a half of the user requested timeout.  But now,we can take a
corrective action on the first timeout, so we use the user requested
timeout.

While here, define boolean sysctl-s as such.

Reviewed by:	manu
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D33534
2022-01-11 15:56:07 +02:00
Andriy Gapon
7fdf0e8835 dtrace: add a knob to control maximum size of principal buffers
We had a hardcoded limit of 1/128-th of physical memory that was further
subdivided between all CPUs as principal buffers are allocated on the
per-CPU basis.  Actually, the buffers could use up 1/64-th of the
memmory because with the default switch policy there are two buffers per
CPU.

This commit allows to change that limit.

Note that the discussed limit is per dtrace command invocation.
The idea is to limit the size of a single malloc(9) call, not the total
memory size used by DTrace buffers.

Reviewed by:	markj
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D33648
2022-01-11 15:47:50 +02:00
Andriy Gapon
75bc7150f4 add and use defintions for ATA power modes
Those can be returned by CHECK POWER MODE command (0xe5).
Note that some of the definitions duplicate definitions for Extended
Power Conditions.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D33646
2022-01-11 15:41:38 +02:00
Wojciech Macek
776c34f646 ip_mroute: remove unused variables
Sponsored by:	Stormshield
Obtained from:	Semihalf
2022-01-11 13:06:22 +01:00
Andrew Turner
e7961ccd9f Remove Arm barriers for pre-armv6 CPUs
Remove the macros that define the Arm barriers on Armv5 and earlier. We
don't support these CPUs.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33807
2022-01-11 11:22:29 +00:00
Andrew Turner
ac795a774c Remove old arm CPU macros
The _ARM_ARCH_* and _HAVE_ARMv*_INSTRUCTIONS macros are FreeBSD
specific. Remove them as they are unused in the base system.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33806
2022-01-11 11:22:29 +00:00
Wojciech Macek
2e72208b6c ip_mroute: do not call epoch_waitwhen lock is taken
mrouter_done is called with RAW IP lock taken. Some annoying
printfs are visible on the console if INVARIANTS option is enabled.

Provide atomic-based mechanism which counts enters and exits from/to
critical section in ip_input and ip_output.
Before de-initialization of function pointers ensure (with busy-wait)
that mrouter de-initialization is visible to all readers and that we don't
remove pointers (like ip_mforward etc.) in the middle of packet processing.
2022-01-11 11:19:32 +01:00
Wojciech Macek
68f28dd1cc ip_mroute: do not sleep when lock is taken
Kthread initialization calls uma_alloc which can sleep.
Modify the code to use deferred work instead.
2022-01-11 11:19:32 +01:00
Kristof Provost
751d4c7b87 pf: postpone clearing of struct pf_pdesc
Postpone zeroing out pd until after the PFI_IFLAG_SKIP/M_SKIP_FIREWALL
checks. We don't need it until then, and it saves us a few CPU cycles in
some cases.
This isn't expected to make a measurable performance change though.

Reviewed by:	mjg, glebius
Pointed out by:	markj
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33815
2022-01-11 10:10:23 +01:00
Kristof Provost
ecc393594d pf: remove PF_TAG_GENERATED
It's never set, so we can remove both the check for it and the
definition.

Reviewed by:	mjg, glebius
Pointed out by:	markj
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33814
2022-01-11 10:09:22 +01:00
Vladimir Kondratyev
ed6417cd8d Bump __FreeBSD_version for LinuxKPI changes 2022-01-11 10:36:14 +03:00
Bjoern A. Zeeb
bec766282f LinuxKPI: 802.11 fix locking in lkpi_stop_hw_scan()
In lkpi_stop_hw_scan() we have to unlock around cancelling the
hardware scan and an msleep to wait for the confirmation that the
scan ended.  Otherwise we are sleeping with the non-sleepable
net80211 com lock held.  At the same time we need to hold the lhw
lock for the msleep().
This lock change got lost in the refactoring of lkpi_iv_newstate().

Reported by:	ambrisko, delphij
PR:		261075
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-01-10 22:29:23 +00:00
Navdeep Parhar
d0ff9b029c cxgbe(4): Fix regression in previous attempt to fix FEC selection.
Fixes:	f3c2987f2f
MFC after:	3 days
Sponsored by:	Chelsio Communications
2022-01-10 14:04:56 -08:00
Navdeep Parhar
cdd7fe04cb cxgbe(4): Do not ignore the return value of ifmedia_ioctl.
This ensures that the driver reports an error instead of failing
silently when an invalid media is requested.

Reported by:	Suhas Lokesha @ Chelsio
MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-01-10 13:05:01 -08:00
Navdeep Parhar
94e6b3fee1 cxgbe(4): Fix build warning for LINT-NOIP.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-01-10 12:35:43 -08:00
Navdeep Parhar
39d5cbdc1b cxgbe(4): Fix "set but not used [-Wunused-but-set-variable]" warnings.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-01-10 12:15:12 -08:00
Navdeep Parhar
6792568fe2 cxgb(4): Fix "set but not used [-Wunused-but-set-variable]" warnings.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-01-10 12:15:12 -08:00
Vladimir Kondratyev
7356f661e8 LinuxKPI: Add sort() wrapper.
swap parameter is not supported as it is rarely used in Linux kernel
and its implementation will add some preprocessor spaghetti to qsort.

Required by drm-kmod.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33675
2022-01-10 22:49:38 +03:00
Vladimir Kondratyev
64dab63f3b LinuxKPI: Use negative bit field size to trigger BUILD_BUG_ON_ZERO
compile time assertion on non-NULL pointers. Tests conducted show that
_Static_assert, negative array size method and current code does not
handle pointers well enough. Bit field method solves this problem.

This change is derrived from Linux implementation of BUILD_BUG_ON_ZERO.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33674
2022-01-10 22:49:38 +03:00
Vladimir Kondratyev
307f78f3ed LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards
MFC after:	1 week
Reviewed by:	bz, emaste, hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33562
2022-01-10 22:49:38 +03:00
Vladimir Kondratyev
98b129783c LinuxKPI: Import MTRR support functions from drm-kmod
They are superseded by PAT and mostly useless nowadays but still can be
used on Pentium III/IV era processors. Unlike drm-kmod version, this one
ignores MTRR if PAT is available that fixes confusing "Failed to add WC
MTRR for [0xXXXX-0xYYYY]: 22; performance may suffer" message often
appearing during drm-kmod initialization process.

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33561
2022-01-10 22:49:38 +03:00
Vladimir Kondratyev
1456816425 LinuxKPI: Import linux/ratelimit.h
Required by drm-kmod.

Obtained from:	OpenBSD
MFC after:	1 week
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D33560
2022-01-10 22:49:38 +03:00
Vladimir Kondratyev
f9c8b5880d LinuxKPI: Add linux/capability.h header
Required by drm-kmod.

Obtained from:	DragonflyBSD
MFC after:	1 week
Reviewed by:	hselasky, manu

Differential Revision:	https://reviews.freebsd.org/D33559
2022-01-10 22:49:38 +03:00
Vladimir Kondratyev
2e194c20c1 LinuxKPI: Add readx_poll_timeout wrapper
Required by drm-kmod 5.7

MFC after:	1 week
Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D33307
2022-01-10 22:49:38 +03:00
Vladimir Kondratyev
f3ddb82d9a LinuxKPI: Add static_cpu_has() implementation
static_cpu_has returns true if CPU supports requested feature.

Obtained from:	OpenBSD
MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33301
2022-01-10 22:49:38 +03:00
Vladimir Kondratyev
89bb7f9bda LinuxKPI: Implement efi_enabled(EFI_BOOT)
efi_enabled(EFI_BOOT) returns true if machine was booted from EFI
Used by drm-kmod and some unported drm drivers like hyperv

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33300
2022-01-10 22:49:38 +03:00
Vladimir Kondratyev
882f8d059c LinuxKPI: Import linux/jump_label.h
Required by drm-kmod

Obtained from:	DragonflyBSD
Differential Revision:	https://reviews.freebsd.org/D33299
2022-01-10 22:49:38 +03:00
Vladimir Kondratyev
0b1244bd79 LinuxKPI: Move kfree_async() functionality in to kfree()
Obsolete it usage but keep for a while for drm-kmod 5.4 compatibility

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33298
2022-01-10 22:49:37 +03:00
Vladimir Kondratyev
35235d5ff6 LinuxKPI: Add stdarg.h proxy header
To reduce amount of drm-kmod patching

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33297
2022-01-10 22:49:37 +03:00
Vladimir Kondratyev
f1a7639a16 LinuxKPI: Add some typical header pollution
To reduce amount of drm-kmod patching

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33297
2022-01-10 22:49:37 +03:00
Vladimir Kondratyev
2fb5be7978 LinuxKPI: Implement smp_*mb barriers with atomic_thread_fence_*
for x86 and move them to asm/barrier.h

MFC after:	1 week
Reviewed by:	bz, hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33296
2022-01-10 22:49:37 +03:00
Vladimir Kondratyev
68fcdba38b LinuxKPI: Make lockdep*_pin_lock macros useable for drm-kmod
Summary:
- Add dummy struct pin_cookie definition;
- Convert lockdep_pin_lock macro to function;
- Fix 'unused variable' compile-time errors;

MFC after:	1 week
Reviewers:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33295
2022-01-10 22:49:37 +03:00
Vladimir Kondratyev
7ec6cbf1d2 LinuxKPI: Convert schedule() to inlined function
to prevent name clashing with drm-kmod

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33294
2022-01-10 22:49:37 +03:00
Vladimir Kondratyev
e705066cd8 LinuxKPI: Add support for XA_FLAGS_ALLOC1 xarray flag
XA_FLAGS_ALLOC1 causes allocation of xarray entries starting at 1

Required by drm-kmod 5.7

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33293
2022-01-10 22:49:37 +03:00
Vladimir Kondratyev
04d42cb453 LinuxKPI: Implement default sysfs kobject attribute operations
Required by drm-kmod 5.7

MFC after:	1 week
Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D33292
2022-01-10 22:49:37 +03:00
Vladimir Kondratyev
c427456fd5 LinuxKPI: Implement kstrtoull
Required by drm-kmod 5.7

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33291
2022-01-10 22:49:37 +03:00
Vladimir Kondratyev
bc923d93df LinuxKPI: Implement dev_driver_string()
Required by drm-kmod 5.7

MFC after:	1 week
Reviewed by:	bz, hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33290
2022-01-10 22:49:37 +03:00
Vladimir Kondratyev
db562aeff7 LinuxKPI: Implement clflush_cache_range()
Required by drm-kmod 5.7

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33289
2022-01-10 22:49:36 +03:00
Vladimir Kondratyev
9a79e08ae7 LinuxKPI: Add clflush argument type conversion wrapper
to reduce amount of source patching in drm-kmod.

MFC after:	1 week
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D33288
2022-01-10 22:49:36 +03:00
Vladimir Kondratyev
dbc920bd9a LinuxKPI: Implement interval_tree
Required by drm-kmod

MFC after:	1 week
Reviewed by:	hselasky, manu
Differential Revision: https://reviews.freebsd.org/D32869
2022-01-10 22:49:36 +03:00
Vladimir Kondratyev
dd52763387 LinuxKPI: Import some linux/rbtree.h functions from OpenBSD
Required by drm-kmod

Obtained from:	OpenBSD
MFC after:	1 week
2022-01-10 22:49:36 +03:00
Ruslan Makhmatkhanov
312ba38a9b LinuxKPI: 802.11 correctly spell queues
PR:		261078
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-01-10 18:08:17 +00:00
Mitchell Horne
d72e944812 riscv: gdb(4) support
Add the MD portion required for the gdb stub.

Reviewed by:	jhb (earlier version)
Discussed with:	jrtc27
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33734
2022-01-10 13:40:12 -04:00
Edward Tomasz Napierala
1866c766d2 linux: Improve debugging by recognizing TIOCGPTPEER
Sponsored By:	EPSRC
2022-01-10 15:36:11 +00:00
Alexander Motin
618d49f5ca Revert "iflib: Relax timer period from 0.5 to 0.5-0.75s."
I've noticed relations between iflib_timer() vs ixl_admin_timer().
Both scheduled at the same 2Hz rate, but the second is rescheduling
the first each time, so if the first get any slower, it won't be
executed at all.  Revert this until deeper investigation.

This reverts commit 90bc1cf657.
2022-01-10 09:40:38 -05:00
Jessica Clarke
e74c7ffcb1 hwpmc: Fix amd/arm64/armv7/uncore sampling overflow race
If a counter more than overflows just as we read it on switch out then,
if using sampling mode, we will negate this small value to give a huge
reload count, and if we later switch back in that context we will
validate that value against pm_reloadcount and panic an INVARIANTS
kernel with:

  panic: [pmc,1470] pmcval outside of expected range cpu=2 ri=16 pmcval=fffff292 pm_reloadcount=10000

or similar. Presumably in a non-INVARIANTS kernel we will instead just
use the provided value as the reload count, which would lead to the
overflow not happing for a very long time (e.g. 78 minutes for a 48-bit
counter incrementing at an averate rate of 1GHz).

Instead, clamp the reload count to 0 (which corresponds precisely to the
value we would compute if it had just overflowed and no more), which
will result in hwpmc using the full original reload count again. This is
the approach used by core for Intel (for both fixed and programmable
counters).

As part of this, armv7 and arm64 are made conceptually simpler; rather
than skipping modifying the overflow count for sampling mode counters so
it's always kept as ~0, those special cases are removed so it's always
applicable and the concatentation of it and the hardware counter can
always be viewed as a 64-bit counter, which also makes them look more
like other architectures.

Whilst here, fix an instance of UB (shifting a 1 into the sign bit) for
amd in its sign-extension code.

Reviewed by:	andrew, mhorne, kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33654
2022-01-10 14:30:05 +00:00
Andrew Turner
78c347d9f3 Fix a typo in an arm64 comment
This was pointed out by markj in the review, but I missed it and forgot
to fix before pushing.

Reported by:	markj
Sponsored by:	The FreeBSD Foundation
2022-01-10 14:08:15 +00:00
Wei Hu
ed65c80a34 Mana: report OS info to PF driver
The PF driver might use the OS info for statistical purposes.

MFC after:	2 weeks
Sponsored by:	Microsoft
2022-01-10 13:32:30 +00:00
Andrew Turner
77402d2834 Move instructions into the arm64 exception vectors
We have 32 instructions in each exception vector on arm64. Previously
only one was used to branch to the handler function. We can split the
start of these functions and move some of the instructions into the
vectors.

Reviewed by:	kib, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33751
2022-01-10 10:51:16 +00:00
Doug Moore
ae13829ddc vm_addr_ok: add power2 invariant check
With INVARIANTS defined, have vm_addr_align_ok and vm_addr_bound_ok
panic when passed an alignment/boundary parameter that is not a power
of two.

Reviewed by:	alc
Suggested by:	kib, se
Differential Revision:	https://reviews.freebsd.org/D33725
2022-01-10 01:17:25 -06:00
Alexander Motin
90bc1cf657 iflib: Relax timer period from 0.5 to 0.5-0.75s.
While there switch it from hardclock ticks to milliseconds.

MFC after:	2 weeks
2022-01-09 20:32:50 -05:00
Alexander Motin
cb1f5d1136 Reduce minimum idle hardclock rate from 2Hz to 1Hz.
On idle 80-thread system it allows to improve package-level idle state
residency and so power consumption by several percent.

MFC after:	2 weeks
2022-01-09 19:25:56 -05:00
Kirk McKusick
7ef56fb049 Avoid unnecessary setting of UFS flag requesting fsck(8) be run.
When the kernel is requested to mount a filesystem with a bad superblock
check hash, it would set the flag in the superblock requesting that the
fsck(8) program be run. The flag is only written to disk as part of a
superblock update. Since the superblock always has its check hash updated
when it is written to disk, the problem for which the flag has been set
will no longer exist. Hence, it is counter-productive to set the flag
as it will just cause an unnecessary run of fsck if it ever gets written.

Sponsored by: Netflix
2022-01-09 16:18:28 -08:00
Robert Wing
174d86a01b tws: fix "set but not used" in the tws driver
With __diagused, these warnings were still emitted since INVARIANTS was
defined but TWS_DEBUG was not.

Fixes:  a21f086a33 ("Fix "set but not used" in the tws driver")
Differential Revision:	https://reviews.freebsd.org/D33784
2022-01-09 14:28:08 -09:00
Alexander Motin
3455c738ac nfsd: Reduce callouts rate.
Before this callouts were scheduled twice a seconds even if nfsd was
never used.  This reduces the rate to ~1Hz and only after nfsd first
started.

MFC after:	2 weeks
2022-01-09 13:14:23 -05:00
Bjoern A. Zeeb
51b461b3db LinuxKPI: 802.11 update compat code for driver updates
Add more (dummy in case of HE) defines, structs, functions and another
mac80211 function pointer needed to update and support recent drivers.

MFC after:	3 days
2022-01-09 18:08:47 +00:00
Warner Losh
85056a56f3 cam: Include more statuses as errors for CAM_IO_STATS
Tag more status return values as an error for the
I/O. CAM_SCSI_STATUS_ERROR is returned for medium errors, for example,
but the counts weren't increased. The added errors all indicate a
problem with the device request.

Sponsored by:		Netflix
PR:			260257
Feedback from:		ken
Reviewed by:		asomers
Differential Revision:	https://reviews.freebsd.org/D33783
2022-01-09 10:13:05 -07:00
Bjoern A. Zeeb
2fb0569f1f LinuxKPI: bitfields add more *replace_bits()
Add or extend the already existing *_replace_bits() implementations
using macros as we do for the other parts in the file for
le<n>p_replace_bits(), u<n>p_replace_bits(), and _u<n>_replace_bits().

MFC after:	3 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D33799
2022-01-09 14:39:19 +00:00
Bjoern A. Zeeb
deb9bfbd5b LinuxKPI: add hex2bin()
Add a hex2bin() implementation needed by a driver's debugfs code.

MFC after:	3 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D33798
2022-01-09 14:36:28 +00:00
Bjoern A. Zeeb
e200809190 LinuxKPI / iwlwifi: fix spelling of constants
Fix the spelling of IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_*
(was "NOMIMAL").  The original version came from iwlwifi
in iwlwifi-next.  Other drivers (from wireless-testing) already
use the correct spelling and need this change in LinuxKPI.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-01-09 02:21:05 +00:00
Robert Wing
eb18708ec8 syncache: accept packet with no SA when TCP_MD5SIG is set
When TCP_MD5SIG is set on a socket, all packets are dropped that don't
contain an MD5 signature. Relax this behavior to accept a non-signed
packet when a security association doesn't exist with the peer.

This is useful when a listen socket set with TCP_MD5SIG wants to handle
connections protected with and without MD5 signatures.

Reviewed by:	bz (previous version)
Sponsored by:   nepustil.net
Sponsored by:   Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D33227
2022-01-08 16:32:14 -09:00
Robert Wing
91d388119a tcpmd5: return ENOENT when security association not found
Return ENOENT from tcp_ipsec_input() when a security association is not
found. This allows callers of TCP_MD5_INPUT() to differentiate between a
security association not found and receiving a bad signature.

Also return ENOENT from tcp_ipsec_output() for consistency.

Reviewed by:	ae
Sponsored by:   nepustil.net
Sponsored by:   Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D33226
2022-01-08 16:31:17 -09:00
Bjoern A. Zeeb
086be6a809 LinuxKPI: 802.11 handle IEEE80211_CONF_IDLE better
We never initialized hw->conf.flags for IEEE80211_CONF_IDLE but
on set_channel we would clear it and announce a change.
This lead to a problem that drivers may do some work every time
which was not needed and may lead to unexpected behaviour (for no
better driver code).

Properly initialize conf.flags with IEEE80211_CONF_IDLE.
Factor out the toggling into a function and clear IDLE while
sw scanning and when associated and set again when scan ends
or we are bouncing out of assoc.

MFC after:	3 days
2022-01-09 00:59:50 +00:00
Bjoern A. Zeeb
4ddc0079ea LinuxKPI: ip.h add #include
Also include netinet/in.h so that in_addr in known for ip.h.
Found by compiling a new piece of code which complained.

MFC after:	3 days
2022-01-09 00:57:13 +00:00
Konstantin Belousov
15964f1cb3 amd64 pmap: preset A and M bits for pmap_qenter() and pmap_kenter() mappings
This removes one or two atomic update of the pte on access. Also it
makes the pte constant during its lifecycle.

Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33778
2022-01-08 06:34:18 +02:00
Konstantin Belousov
720a892ac6 amd64 pmap: simplify vtopte() and vtopde()
Pre-calculate masks and page table/page directory bases, for LA48 and
LA57 cases, trading a conditional for the memory accesses.

This shaves 672 bytes of .text, by the cost of 32 .data bytes.  Note
that eliminated code contained one conditional, and several costly
movabs instructions, which are traded by two memory fetches per
vtop{t,d}e() inlines.

Reviewed by:	markj
Discussed with:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33776
2022-01-08 06:34:18 +02:00
Konstantin Belousov
aaaa4fb54e msdosfs: use mntfs vnode for pm_devvp
to prevent races with devfs VCHR vnode reclamation, same as it was
done for UFS.

Reported by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
2022-01-08 06:21:58 +02:00
Konstantin Belousov
41e85eeab9 msdosfs: on integrity error, fire a task to remount filesystem to ro
In collaboration with:	pho
Reviewed by:	markj, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
2022-01-08 06:20:48 +02:00
Konstantin Belousov
b2e4b63584 msdosfs: add msdosfs_integrity_error()
A function to remount the filesystem from rw to ro on integrity error.
The work is performed in taskqueue to allow the call to be done from
almost arbitrary context where erronous state was detected.

Tested by:	pho
Reviewed by:	markj, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
2022-01-08 06:20:48 +02:00
Konstantin Belousov
4a4b059a97 Add vfs_remount_ro()
a helper to remount filesystem from rw to ro.

Tested by:	pho
Reviewed by:	markj, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
2022-01-08 05:41:44 +02:00
Konstantin Belousov
ba2c98389b msdosfs: sanity check sector count from BPB
We use sector count to size the FAT inuse bitset.  If sector count is
corrupted, kernel might be tricked into doing unbound allocation.
Ensure that the sector count does not exceed the actual volume size.

In collaboration with:	pho
Reviewed by:	markj, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
2022-01-08 05:41:44 +02:00
Konstantin Belousov
65990b68a2 msdosfs: clusterfree() is used only in error handling cases
Change its return type to void, because its result is ignored in both
call sites.  Remove oldcnp argument as well, it is NULL always.

Suggested and reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
2022-01-08 05:41:44 +02:00
Konstantin Belousov
aec97963cd msdosfs: do no allow lookup to return vdp except for dot lookups
In collaboaration with:	pho
Reviewed by:	markj, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
2022-01-08 05:41:44 +02:00
Konstantin Belousov
1319c433f4 msdosfs: handle a case when non-dot lookup returned dvp
This means that filesystem is corrupted, there is a loop.

In collaboration with:	pho
Reviewed by:	markj, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
2022-01-08 05:41:44 +02:00
Konstantin Belousov
2c9a1c22c3 msdosfs: take inusemap inconsistency as an error, not invariants violation
In other words, stop silently accepting freeing free cluster in
non-debug kernels, but return the error to the caller.  Modify callers
to handle errors from usemap_free().

In collaboration with:	pho
Reviewed by:	markj, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
2022-01-08 05:41:44 +02:00
Konstantin Belousov
595ed4d767 msdosfs: handle inconsistently hashed denodes
It is possible, on the corrupted msdosfs volume, to have file which
denode inode number does not match the one calculated using directory
cluster.  Instead of asserting the condition as impossible, handle it
and return error, after reclaiming the aliased vnode.

In collaboration with:	pho
Reviewed by:	markj, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
2022-01-08 05:41:44 +02:00
Konstantin Belousov
9f4073d446 geom label msdosfs: sanity check BPB before using it for io request
It must be greater than zero, and be multiple of the device block size.

In collaboration with:	pho
Reviewed by:	markj, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33721
2022-01-08 05:41:44 +02:00
Alexander Motin
1849bc5f3f mps/mpr: Relax doorbell polling precision.
It does not matter how often do we check firmware for crashes.

MFC after:	2 weeks
2022-01-07 21:34:49 -05:00
Alexander Motin
135c269d87 Fix build. Sorry.
MFC after:	2 weeks
2022-01-07 14:33:51 -05:00
Alexander Motin
f4d499fd67 CTL: Relax callouts precisions.
MFC after:	2 weeks
2022-01-07 14:30:44 -05:00
Alexander Motin
b3c9b6060f nvme: Do not rearm timeout for commands without one.
Admin queues almost always have several ASYNC_EVENT_REQUEST outstanding.
They have no timeouts, but their presence in qpair->outstanding_tr caused
useless timeout callout rearming twice a second.

While there, relax timeout callout period from 0.5s to 0.5-1s to improve
aggregation.  Command timeouts are measured in seconds, so we don't need
to be precise here.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D33781
2022-01-07 12:59:16 -05:00
Alexander Motin
0e5c50bf60 cam: Relax callouts precisions.
On large systems even relatively rare callouts may fire many times
per second.  This should allow them to aggregate better, since we do
not require any precision when polling for media change, etc.

MFC after:	2 weeks
2022-01-07 12:59:16 -05:00
Warner Losh
d6c0538dae ddb: Remove SOFTWARE_SSTEP support
It was needed for mips only, and only kinda sorta worked for mips. It
can be brought back if we grow another architecture that need it.

Sponsored by:		Netflix
2022-01-07 09:25:33 -07:00
Warner Losh
1d85ab6b86 wbwd: Move set but not used variable test under notyet
Sponsored by:		Netflix
2022-01-07 09:23:00 -07:00
Warner Losh
746e31e418 Remove mips dtrace.
Remove mips dtrace code. It's no longer needed.

Sponsored by:		Netflix
2022-01-07 09:00:56 -07:00
Warner Losh
47796d47ec powerpc/aim: ifdef DDB pmap debugging functions
INVARIANTS and DDB can be enabled independently.

Submitted by: Sterling Jensen
Pull Request: https://github.com/freebsd/freebsd-src/pull/566
2022-01-07 08:56:57 -07:00
Mitchell Horne
153b6271a7 Fix 'make cscope' with ALL_ARCH defined
The sys/mips directory has been removed.
2022-01-07 11:53:52 -04:00
Hans Petter Selasky
2891a28052 rtwn(4): Add new USB ID.
Submitted by:	arved@
PR:		260952
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-01-07 14:02:30 +01:00
Hans Petter Selasky
34bedcee3c uchcom(4): Add new USB ID.
Submitted by:	darius@dons.net.au
PR:		260783
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-01-07 14:02:30 +01:00
Rick Macklem
e4df1036f6 nfscl: Always invalidate buffers for append writes
kib@ reported a problem which was resolved by
reverting commit 867c27c23a, which changed the NFS
client to use direct RPCs to the server for
IO_APPEND writes.  He also spotted that the
code only invalidated buffer cache buffers
when they were marked NMODIFIED (had been
written into).

This patch modifies the NFS VOP_WRITE() to
always invalidate the buffer cache buffers
and pages for the file when IO_APPEND is
specified.  It also includes some cleanup
suggested by kib@.

Reported by:	kib
Tested by:	kib
Reviewed by:	kib
MFC after:	10 weeks
2022-01-06 14:18:36 -08:00
Ryan Stone
5adea417d4 Fix ifa refcount leak in ifa_ifwithnet()
In 4f6c66cc9c, ifa_ifwithnet() was changed to no longer
ifa_ref() the returned ifaddr, and instead the caller was required
to stay in the net_epoch for as long as they wanted the ifaddr
to remain valid.  However, this missed the case where an AF_LINK
lookup would call ifaddr_byindex(), which still does ifa_ref()
the ifaddr.  This would cause a refcount leak.

Fix this by inlining the relevant parts of ifaddr_byindex() here,
with the ifa_ref() call removed.  This also avoids an unnecessary
entry and exit from the net_epoch for this case.

I've audited all in-tree consumers of ifa_ifwithnet() that could
possibly perform an AF_LINK lookup and confirmed that none of them
will expect the ifaddr to have a reference that they need to
release.

MFC after: 2 months
Sponsored by: Dell Inc
Differential Revision:	https://reviews.freebsd.org/D28705
Reviewed by: melifaro
2022-01-06 15:04:24 -05:00
Ram Kishore Vegesna
a2523baed5 ocs_fc: Remove giant lock usage in sysctl.
Summary: Replace CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE.

Reviewers: ken, mav

Subscribers: imp

Approved by: mav

Differential Revision: https://reviews.freebsd.org/D33752
2022-01-06 14:13:06 +05:30
Konstantin Belousov
3c94280825 Silent some warnings for i386 kernel build
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2022-01-06 07:53:04 +02:00
Konstantin Belousov
408334df5e link_elf.h: cleanup struct link_map definition, remove mips-specific field
Sponsored by:	The FreeBSD Foundation
2022-01-06 06:14:17 +02:00
Konstantin Belousov
c25a30e255 Dump page tracking no longer needed on mips
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D33763
2022-01-06 06:00:39 +02:00
Konstantin Belousov
f54882a862 Remove special kstack allocation code for mips.
The arch required two-pages alignment due to single TLB entry caching
two consequtive mappings.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D33763
2022-01-06 04:43:56 +02:00
John Baldwin
7def1e10b3 bus_dma: Deduplicate locking helper functions.
- Move busdma_lock_mutex to subr_bus_dma.c.

- Move _busdma_lock_dflt to subr_bus_dma.c.  This function was named a
  couple of different things previously.  It is not a public API but
  an internal helper used in place of a NULL pointer.  The prototype
  is in <sys/bus_dma.h> as not all backends include
  <sys/bus_dma_internal.h>.

Reviewed by:	kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D33694
2022-01-05 13:50:40 -08:00
John Baldwin
85b4607324 Deduplicate bus_dma bounce code.
Move mostly duplicated code in various MD bus_dma backends to support
bounce pages into sys/kern/subr_busdma_bounce.c.  This file is
currently #include'd into the backends rather than compiled standalone
since it requires access to internal members of opaque bus_dma
structures such as bus_dmamap_t and bus_dma_tag_t.

Reviewed by:	kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D33684
2022-01-05 13:50:40 -08:00
Warner Losh
9a498f9a14 lio: remove from NOIP
It doesn't build here. This was masked earlier by other build breakage.

Sponsored by:		Netflix
2022-01-05 14:19:34 -07:00
Alexander Motin
ce88117008 atkbd: Disable periodic polling by default.
It is one of the few remaining Giant-locked callouts.  It would be
good to remove it, not mentioning that polling itself is not good.

If this cause keyboard/mouse freezes on some hardware, please set
loader tunable hw.atkbd.hz=1 as workaround and report the issue.

Submitted by:	imp, jhb
2022-01-05 15:12:58 -05:00
Navdeep Parhar
f3c2987f2f cxgbe(4): Do not request an FEC that is invalid for the requested speed.
This eliminates error messages like this from the driver when running at
50Gbps with 100G cables:
[3726] cc0: l1cfg failed: 71
[4407] cc0: l1cfg failed: 71

Note that link comes up anyway with or without this change.

Reported by:	Suhas Lokesha @ Chelsio
MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-01-05 11:15:34 -08:00
Alexander Motin
9e007a88d6 atkbd: Reduce polling rate from 10Hz to ~1Hz.
In my understanding this is only needed to workaround lost interrupts.
I was thinking to remove it completely, but the comment about edge-
triggered interrupt may be true and needs deeper investigation.  ~1Hz
should be often enough to handle the supposedly rare loss cases, but
rare enough to not appear in top.  Add sysctl hw.atkbd.hz to tune it.

MFC after:	1 month
2022-01-05 11:41:26 -05:00
Andrew Turner
459e0b92e8 Use the arm64 ttbr macro to define the ASID shift
Now we have a macro to descrive the arm64 TTBR registers use it in the
ASID_TO_OPERAND pmap macro.

Sponsored by:	The FreeBSD Foundation
2022-01-05 14:56:25 +00:00
Andrew Turner
0accd72674 Add the arm64 TTBR fields to armreg.h
Sponsored by:	The FreeBSD Foundation
2022-01-05 14:56:25 +00:00
Ed Maste
a6668e31aa Fix kernel build without INET and INET6
Reviewed by:	brooks, melifaro
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33718
2022-01-05 09:41:38 -05:00
Andrew Turner
ce1e5d0d5e Add a missing space in the arm64 sendsig
Sponsored by:	The FreeBSD Foundation
2022-01-05 12:38:54 +00:00
Andrew Turner
fbdca14953 Remove the sigcode base check on arm64
This was added with the shared page support. It is unused as we always
enable the shared page on FreeBSD executables on arm64.
2022-01-05 11:57:38 +00:00
Gleb Smirnoff
3f6ab5493f vtnet: don't leak pfil(9) data on detach
PR:		260667
Submitted by:	<ghuckriede blackberry.com>
2022-01-04 18:41:05 -08:00
Warner Losh
b4dda138e8 neta: clk code ifdef'd aarch64
So #ifdef the clk.h include aarch64. Otherwise the right kernel options
aren't always present.

Sponsored by:		Netflix
2022-01-04 16:01:14 -07:00
Warner Losh
c47e2e5170 neta: need clknode_if.h
clknode_if.h is needed for this device on aarch64. Create it always.

Sponsored by:		Netflix
2022-01-04 16:01:14 -07:00
Warner Losh
44796b7e82 mips: remove saf1761
The saf1761 OTG support was only for mips targets (BERI?). Retire it.

Sponsored by:		Netflix
Reviewed by:		brooks
Differential Revision:	https://reviews.freebsd.org/D33706
2022-01-04 16:01:14 -07:00
John Baldwin
8903d8e37f iscsi: Pass the request PDU to icl_conn_transfer_setup().
This matches icl_conn_task_setup() which passes the PDU and avoids the
need for a layering violation in cxgbei to fetch the request PDU from
the ctl_io.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33746
2022-01-04 14:37:17 -08:00
John Baldwin
e43cf698d9 ccr: Use a software OCF session for requests which fallback to software.
Previously the driver duplicated code from cryptosoft.c to handle
certain edge case AES-CCM and AES-GCM requests.  However, this
approach has a few downsides:

1) It only uses "plain" software and not accelerated software since it
   uses enc_xform directly.

2) It performs the operation synchronously even though the caller
   believes it is invoking an async driver.  This was fine for the
   original use case of requests with only AAD and no payload that
   execute quickly, but is a bit more disingenuous for large requests
   which fall back due to exceeding the size of a firmware work
   request (e.g. due to large scatter/gather lists).

3) It has required several updates since ccr(4) was added to the tree.

Instead, allocate a software session for AES-CCM and AES-GCM sessions
and dispatch a cloned request asynchronusly to the software session.

Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33608
2022-01-04 14:22:32 -08:00
John Baldwin
74d3f1b63d OCF: Add crypto_clonereq().
This function clones an existing crypto request, but associates the
new request with a specified session.  The intended use case is for
drivers to be able to fall back to software by cloning a request and
dispatch it to an internally allocated software session.

Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33607
2022-01-04 14:22:12 -08:00
John Baldwin
753c851387 sigev_findtd: Fix whitespace nit in argument list.
Obtained from:	CheriBSD
2022-01-04 13:37:39 -08:00
Justin Hibbits
3a9688f8bc busdma: Fix powerpc DMA alignment check
The original logic was to check if there's no filter and the address is
misaligned relative to the requirements.  The refactoring in
c606ab59e7 missed this, and instead caused
it to return failure if the address *is* properly aligned.
2022-01-04 09:24:03 -06:00
Mark Johnston
ed166a0173 mvneta: Unconditionally print an error message if mii_attach() fails
The error message is useful for diagnosing mvneta_attach() failures.

MFC after:	1 week
2022-01-04 09:46:23 -05:00
Edward Tomasz Napierala
f7b04c53de linux(4): Reduce diffs between linux_rt_sendsig() and sendsig()
No functional changes (except for the uprintf).

Discussed With:	kib
Sponsored By:	EPSRC
2022-01-04 14:39:19 +00:00
Edward Tomasz Napierala
562bc0a943 Unstaticize {get,set}_fpcontext() on amd64
This will be used to fix Linux signal delivery.

Discussed With:	kib
Sponsored By:	EPSRC
2022-01-04 13:25:12 +00:00
Hubert Mazur
4885d6f3ec if_mvneta: Use clock frequency
Make neta use frequency obtained from clock, instead of
hardcoded one. Use default frequency in case of clock
device failure. Remove unnecessary function calls
to obtain frequency and use cached one instead.

Reviewed by:		manu
Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D32336
2022-01-04 13:26:35 +01:00
Hubert Mazur
f21c469dbc Add driver for marvell, a37x0 peripheral clocks
Add driver for Marvell, Armada-37xx peripheral clock.
Register clocks for various peripheral devices in
north bridge or south bridge domain. Dump clock's
domain while verbose boot.

Reviewed by:
Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D32294
2022-01-04 13:26:35 +01:00
Hubert Mazur
127e4d9524 Add driver for armada, 37x0-tbg-clock
Driver for tbg clocks. Read reference frequency from parent
and modify it depending on parameters read from register.

Reviewed by:		manu
Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D32293
2022-01-04 13:26:34 +01:00
Hubert Mazur
01b9c59fd2 Add driver for marvell, armada-3700 oscillator
Driver registers new clock device. Clock frequency is set depending
on tenth bit's value obtained from syscon register. Full information
about the clock is dumped if bootverbose is enabled.

Driver was tested on EspressoBin.

Reviewed by:		manu
Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D32292
2022-01-04 13:26:34 +01:00
Cy Schubert
701301511f ipfilter module: Style(9) requires a space after return
Reported by:	jrtc27
Fixes:		8c82b37461
MFC after:	1 month
2022-01-03 18:46:49 -08:00
Cy Schubert
6b54d2f4c5 ipfilter: Add SDT probe frb_natv6in
Like IPv4 NAT frb_natv4in, add a corresponding IPv6 NAT SDT probe called
frb_natv6in.

MFC after:	1 week
2022-01-03 18:06:44 -08:00
Cy Schubert
b6f072f767 ipfilter: Unconditionally expose SDT probe frb_natv4in
SDT probe frb_natv4in is only available when an error is encountered.
Make it also available when no error is encountered, i.e. NATed and
not translated.

MFC after:	1 week
2022-01-03 18:06:44 -08:00
Cy Schubert
80030b6cc7 ipfilter module: Fix whitespace errors
Replace leading spaces with a tabs on affected lines.

MFC after:	1 month
2022-01-03 18:06:44 -08:00
Cy Schubert
00a5b8c3d9 ipfilter: Remove extraneous comment line
MFC after:	1 month
2022-01-03 18:06:43 -08:00
Cy Schubert
2eef572879 ipfilter module: Remove trailing whitespace
MFC after:	1 month
2022-01-03 18:06:43 -08:00
Cy Schubert
8c82b37461 ipfilter: Adjust kernel module returns to conform to style(9)
Adjust ipfilter's kernel module return statements to conform to style(9).

MFC after:	1 month
2022-01-03 18:06:43 -08:00
Cy Schubert
9be9c1c084 ipfilter: INLINE --> inline
Replace the INLINE macro with inline. Some ancient compilers supported
__inline__ instead of inline. The INLINE hack compensated for it.
Ancient compilers are history.

Reported by:	glebius
MFC after:	1 month
2022-01-03 18:06:42 -08:00
Cy Schubert
064a5a9564 ipflter: ANSIfy kernel function declarations
Convert ipfilter kernel function declarations from K&R to ANSI. This
syncs our function declarations with NetBSD hg commit 75edcd7552a0
(apply our changes). Though not copied from NetBSD, this change was
partially inspired by NetBSD's work and inspired by style(9).

Reviewed by:		glebius (for #network)
MFC after:		1 month
Differential Revision:	https://reviews.freebsd.org/D33595
2022-01-03 18:06:42 -08:00
Robert Wing
bb8441184b cam: don't lock while handling an AC_UNIT_ATTENTION
Don't take the device_mtx lock in daasync() when handling an
AC_UNIT_ATTENTION. Instead, assert the lock is held before modifying the
periph's softc flags.

The device_mtx lock is taken in xptdevicetraverse() before daasync()
is eventually called in xpt_async_bcast().

PR:             240917, 226510, 226578
Reviewed by:    imp
MFC after:      3 weeks
Differential Revision: https://reviews.freebsd.org/D27735
2022-01-03 16:56:48 -09:00
Navdeep Parhar
3b76242433 cxgbe(4): Update firmwares to 1.26.6.0.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CHANGES
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Version : 1.26.6.0
Date    : 01/03/2022
================================================================================

Fixes
-----
BASE:
- Fixed one module eeprom read failure.
- Fixed an issue with speed selection when 40G and 25G are advertised and
  supported.
- Fixed a random traffic hang when T5 receives invalid ets BW in dcbx
  messages from a switch.
- Fixed very long link up time with few switches.
================================================================================

Obtained from:	Chelsio Communications
MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2022-01-03 15:24:42 -08:00
Navdeep Parhar
bbab9ab579 cxgbe(4): Fix stats collection for ports with port_id != tx_chan
This fixes a driver panic during stats collection when a port's id does
not match its tx channel.  The bug affected only the T580 card running
with a non-default VPD.

Reported by:	Suhas Lokesha @ Chelsio
MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-01-03 15:24:34 -08:00
Michael Tuexen
f87818eacf sctp: miror change due to upstreaming 2022-01-03 23:03:06 +01:00