]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agolindebugfs: The Linux file operations use negative return values in the kernel.
Hans Petter Selasky [Fri, 11 Mar 2022 16:37:46 +0000 (17:37 +0100)]
lindebugfs: The Linux file operations use negative return values in the kernel.

Fix sign.

Sponsored by: NVIDIA Networking

(cherry picked from commit 68ec2949ad3411aa8a684dfca2cae90cbe202675)

2 years agolindebugfs: Zero the linux_file structure before use.
Hans Petter Selasky [Fri, 11 Mar 2022 16:29:54 +0000 (17:29 +0100)]
lindebugfs: Zero the linux_file structure before use.

This avoids clients using garbage values on the stack and makes
debugging easier.

Sponsored by: NVIDIA Networking

(cherry picked from commit 88a29d89ebab1ed60607c3dab73143c3b59a0f83)

2 years agonewfs(8): Fix a bug in initialization of sblock.fs_maxbsize .
Wuyang Chung [Tue, 8 Mar 2022 13:52:17 +0000 (21:52 +0800)]
newfs(8): Fix a bug in initialization of sblock.fs_maxbsize .

Fixes: 1c85e6a35d93195e896b030d9a55f7ac4ccee2c3 (SVN r98542)
Pull Request: https://github.com/freebsd/freebsd-src/pull/587
Sponsored by: NVIDIA Networking

(cherry picked from commit c5f549c1e0c9aa1764e87d55f183053c1545b1fc)

2 years agousbtest: Fix issue when multiple devices are sharing same USB vendor and product ID.
Hans Petter Selasky [Sun, 13 Mar 2022 14:17:06 +0000 (15:17 +0100)]
usbtest: Fix issue when multiple devices are sharing same USB vendor and product ID.

When there are multiple devices sharing the same USB vendor and product ID,
the wrong device may be selected. Fix this by also matching the bus and
device address, ugen<X>.<Y> .

Sponsored by: NVIDIA Networking

(cherry picked from commit 16346e1401b8b369e251bc70781349fb9b813cef)

2 years agodumpon: use underlying device if encrypted swap is in use
Ed Maste [Mon, 7 Mar 2022 19:17:01 +0000 (14:17 -0500)]
dumpon: use underlying device if encrypted swap is in use

/etc/rc.d/dumpon runs before /etc/rc.d/swap.  When encrypted swap is in
use the .eli or .bde device will not exist at the time dumpon runs.

Even if this is addressed it does not make sense to dump core to
encrypted swap, as the encryption key will not be available after
reboot rendering the dump useless.  Thus, for the case that dumpdev=AUTO
and encrypted swap is in use, strip the extension and use the underlying
device.

Emit a warning if we are using the underlying device and the user has not
configured dump encryption, so that the user knows that the will not be
encrypted.

PR: 238301
Reported by: Ivan Rozhuk
Reviewed by: jilles
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34474

(cherry picked from commit 67e751f167c98d02f85eb38401e3e6388db09ac1)

2 years agoif_epair: fix race condition on multi-core systems
Michael Gmelin [Wed, 16 Mar 2022 22:08:55 +0000 (23:08 +0100)]
if_epair: fix race condition on multi-core systems

As an unwanted side effect of the performance improvements in
24f0bfbad57b9, epair interfaces stop forwarding traffic on higher
load levels when running on multi-core systems.

This happens due to a race condition in the logic that decides when to
place work in the task queue(s) responsible for processing the content
of ring buffers.

In order to fix this, a field named state is added to the epair_queue
structure. This field is used by the affected functions to signal each
other that something happened in the underlying ring buffers that might
require work to be scheduled in task queue(s), replacing the existing
logic, which relied on checking if ring buffers are empty or not.

epair_menq() does:
  - set BIT_MBUF_QUEUED
  - queue mbuf
  - if testandset BIT_QUEUE_TASK:
      enqueue task

epair_tx_start_deferred() does:
  - swap ring buffers
  - process mbufs
  - clear BIT_QUEUE_TASK
  - if testandclear BIT_MBUF_QUEUED
      enqueue task

PR: 262571
Approved by:    re (gjb, early MFC)
Reported by: Johan Hendriks <joh.hendriks@gmail.com>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34569

(cherry picked from commit 66acf7685bcd8cf23b6c658a991637238a01859e)

2 years agoEnsure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices.
Kirk McKusick [Wed, 16 Mar 2022 18:37:15 +0000 (11:37 -0700)]
Ensure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices.

PR:          262580
Approved by: re (gjb, early MFC)

(cherry picked from commit 2983ec0a87a18943564548c5c00c879c8db83edf)

2 years agoxhci(4): Add quirk for "TUSB73x0 USB3.0 xHCI Controller".
Hans Petter Selasky [Thu, 3 Mar 2022 16:32:20 +0000 (17:32 +0100)]
xhci(4): Add quirk for "TUSB73x0 USB3.0 xHCI Controller".

Tested by: br@
Sponsored by: NVIDIA Networking

(cherry picked from commit 33cbbf268f7d0f3daff0c2aa06836d932faf56a9)

2 years agoOpenSSL: Merge OpenSSL 1.1.1n
Jung-uk Kim [Tue, 15 Mar 2022 23:35:22 +0000 (19:35 -0400)]
OpenSSL: Merge OpenSSL 1.1.1n

(cherry picked from commit 5ac766ab8ec23e780f108b7903d46e553d5e39d1)

2 years agovfs: [2/2] fix stalls in vnode reclaim by only counting attempts
Mateusz Guzik [Mon, 7 Mar 2022 10:38:17 +0000 (11:38 +0100)]
vfs: [2/2] fix stalls in vnode reclaim by only counting attempts

... and ignoring if they succeded, which matches historical behavior.

Reported by: pho

(cherry picked from commit 3a4c5dab9266fac93a5cb22c7cee3938466aedea)

2 years agovfs: [1/2] fix stalls in vnode reclaim by not requeieing from vnlru
Mateusz Guzik [Mon, 7 Mar 2022 10:33:59 +0000 (11:33 +0100)]
vfs: [1/2] fix stalls in vnode reclaim by not requeieing from vnlru

Reported by: pho

(cherry picked from commit c35ec1efdcb2978bc3b6a0098c2b412be8d33e39)

2 years agocache: hide hash stats behind DEBUG_CACHE
Mateusz Guzik [Thu, 3 Mar 2022 17:21:13 +0000 (17:21 +0000)]
cache: hide hash stats behind DEBUG_CACHE

They take a long time to dump and hinder sysctl -a when used with
DIAGNOSTIC.

(cherry picked from commit afb08a6d07174bab1a0fc2d01eb2d1b4bf481179)

2 years agoFix a bug in BN_mod_sqrt() that can cause it to loop forever.
Gordon Tetlow [Tue, 15 Mar 2022 16:48:59 +0000 (09:48 -0700)]
Fix a bug in BN_mod_sqrt() that can cause it to loop forever.

Obtained from: OpenSSL Project
Security: CVE-2022-0778
Security: FreeBSD-SA-22:03.openssl

(cherry picked from commit fdc418f15e92732a3551832bcb625ba9b47242df)

2 years agoi386: Call clock_init() after finishidentcpu()
Mark Johnston [Tue, 1 Mar 2022 14:00:05 +0000 (09:00 -0500)]
i386: Call clock_init() after finishidentcpu()

In a subsequent commit clock_init() will attempt to determine the TSC
frequency, and this requires that CPU identification is finalized.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit c3d830cf7c71614d21f57c24039de219e4a90538)

2 years agofasttrap: Avoid creating WX mappings
Mark Johnston [Tue, 1 Mar 2022 16:53:42 +0000 (11:53 -0500)]
fasttrap: Avoid creating WX mappings

fasttrap instruments certain instructions by overwriting them and
copying the original instruction to some per-thread scratch space which
is executed after the probe fires.  This trampoline jumps back to the
tracepoint after executing the original instruction.

The created mapping has both write and execute permissions, and so this
mechanism doesn't work when allow_wx is disabled.  Work around the
restriction by using proc_rwmem() to write to the trampoline.

Reviewed by: vangyzen
Tested by: Amit <akamit91@hotmail.com>
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 3a56cfedbc701f8026d38c0d808c614c9f0572ae)

2 years agofasttrap: Assert that fasttrap_fork() successfully unmaps scratch space
Mark Johnston [Tue, 1 Mar 2022 16:52:39 +0000 (11:52 -0500)]
fasttrap: Assert that fasttrap_fork() successfully unmaps scratch space

No functional change intended.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 83958173eb7d3f9d402e6dc81e66d179a808dd63)

2 years agoproc: Remove assertion that P_WEXIT is not set in proc_rwmem()
Mark Johnston [Tue, 1 Mar 2022 20:08:25 +0000 (15:08 -0500)]
proc: Remove assertion that P_WEXIT is not set in proc_rwmem()

exit1() sets P_WEXIT before waiting for holding threads to finish,
rather than after, so this assertion is racy.

Fixes: 12fb39ec3e6b ("proc: Relax proc_rwmem()'s assertion on the process hold count")
Reported by: Jenkins

(cherry picked from commit 879b0604a8940f575f03bde5457bcf13e64c1ae8)

2 years agoproc: Relax proc_rwmem()'s assertion on the process hold count
Mark Johnston [Tue, 1 Mar 2022 16:48:39 +0000 (11:48 -0500)]
proc: Relax proc_rwmem()'s assertion on the process hold count

This reference ensures that the process and its associated vmspace will
not be destroyed while proc_rwmem() is executing.  If, however, the
calling thread belongs to the target process, then it is unnecessary to
hold the process.  In particular, fasttrap - a module which enables
userspace dtrace - may frequently call proc_rwmem(), and we'd prefer to
avoid the overhead of locking and bumping the hold count when possible.

Thus, make the assertion conditional on "p != curproc".  Also assert
that the process is not already exiting.  No functional change intended.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 12fb39ec3e6bc529feff3ba2862c6a4a30bd54eb)

2 years agolibpfct: factor out pfctl_get_rules_info()
Kristof Provost [Fri, 4 Mar 2022 16:12:01 +0000 (17:12 +0100)]
libpfct: factor out pfctl_get_rules_info()

Introduce pfctl_get_rules_info(), similar to pfctl_get_eth_rules_info()
to retrieve rules information (ticket and total number of rules).

Use the new function in pfctl.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D34443

(cherry picked from commit 8c1400b0a1083c9e2bf8f3418eb3e3cfba1a8444)

2 years agolibpfctl: support flushing rules/nat/eth
Kristof Provost [Fri, 4 Mar 2022 14:50:43 +0000 (15:50 +0100)]
libpfctl: support flushing rules/nat/eth

Move the code to flush regular rules, nat rules and Ethernet rules into
libpfctl for easier re-use.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D34442

(cherry picked from commit f0c334e4deca08b56b4226539c844a7018e9182d)

2 years agopfctl: support recursive printing of nat rules
Kristof Provost [Sat, 5 Mar 2022 16:55:48 +0000 (17:55 +0100)]
pfctl: support recursive printing of nat rules

PR: 252617
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34455

(cherry picked from commit a20773c810814dd130ca1f0fbf08d27fea465555)

2 years agopfctl: remove unused variable
Kristof Provost [Tue, 8 Mar 2022 11:22:50 +0000 (12:22 +0100)]
pfctl: remove unused variable

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit c4e49c3a65df1e806399962e27eb47a0f611223d)

2 years agoMake the arm64 get_pcpu a function again
Andrew Turner [Tue, 8 Mar 2022 11:38:51 +0000 (11:38 +0000)]
Make the arm64 get_pcpu a function again

We assume the pointer returned from get_pcpu will be consistent even
if the thread is moved to a new CPU. Fix this by partially reverting
63c858a04d565 to make get_pcpu a function again.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit ed306634266002a05c88c3a4cd036c99d4cd139a)

2 years agoriscv: Add support for enabling SV48 mode
Mark Johnston [Tue, 1 Mar 2022 14:07:14 +0000 (09:07 -0500)]
riscv: Add support for enabling SV48 mode

This increases the size of the user map from 256GB to 128TB.  The kernel
map is left unchanged for now.

For now SV48 mode is left disabled by default, but can be enabled with a
tunable.  Note that extant hardware does not implement SV48, but QEMU
does.

- In pmap_bootstrap(), allocate a L0 page and attempt to enable SV48
  mode.  If the write to SATP doesn't take, the kernel continues to run
  in SV39 mode.
- Define VM_MAX_USER_ADDRESS to refer to the SV48 limit.  In SV39 mode,
  the region [VM_MAX_USER_ADDRESS_SV39, VM_MAX_USER_ADDRESS_SV48] is not
  mappable.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 31218f3209acf0f8f0dc54e436342c8fa604d279)

2 years agoriscv: Add support for dynamically allocating L1 page table pages
Mark Johnston [Tue, 1 Mar 2022 14:06:57 +0000 (09:06 -0500)]
riscv: Add support for dynamically allocating L1 page table pages

This is required in SV48 mode.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6ce716f7c31a0a1b5ca8224cbb627632f44e4e6c)

2 years agoriscv: Handle four-level page tables in various pmap traversal routines
Mark Johnston [Tue, 1 Mar 2022 14:06:42 +0000 (09:06 -0500)]
riscv: Handle four-level page tables in various pmap traversal routines

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 1321117200de1d1796adad856f7e04a66850e992)

2 years agoriscv: Maintain the allpmaps list only in SV39 mode
Mark Johnston [Tue, 1 Mar 2022 14:06:31 +0000 (09:06 -0500)]
riscv: Maintain the allpmaps list only in SV39 mode

When four-level page tables are used, there is no need to distribute
updates to the top-level page to all pmaps.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ceed61483ca9c3c0bf44e37118ae9c8377e6b9ff)

2 years agoriscv: Add pmap helper functions required by four-level page tables
Mark Johnston [Tue, 1 Mar 2022 14:06:15 +0000 (09:06 -0500)]
riscv: Add pmap helper functions required by four-level page tables

No functional change intended.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 5cf3a8216e3adad06f1ab02c9a9b201cebcd4809)

2 years agoriscv: Try to improve the comments for locore's page table setup
Mark Johnston [Tue, 1 Mar 2022 14:06:03 +0000 (09:06 -0500)]
riscv: Try to improve the comments for locore's page table setup

No functional change intended.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 43379792365130b1fa338c310f00aa6821493ead)

2 years agoriscv: Conditionally modify the ELF64 sysentvec for SV48
Mark Johnston [Tue, 1 Mar 2022 14:05:02 +0000 (09:05 -0500)]
riscv: Conditionally modify the ELF64 sysentvec for SV48

A sysinit determines whether the pmap has enabled SV48 mode and modifies
the corresponding fields which describe the user memory map.

Reviewed by: kib, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ecaf115434cf5b427339d27860bcbee3e9f48e39)

2 years agoriscv: Define a SV48 memory map
Mark Johnston [Tue, 1 Mar 2022 14:04:38 +0000 (09:04 -0500)]
riscv: Define a SV48 memory map

No functional change intended.

Reviewed by: kib, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 35d0f443cfaaa32afa43f4ffca986590fc56d827)

2 years agoriscv: Add various pmap definitions needed to support SV48 mode
Mark Johnston [Tue, 1 Mar 2022 14:04:01 +0000 (09:04 -0500)]
riscv: Add various pmap definitions needed to support SV48 mode

No functional change intended.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 59f192c507c49990b603f774bbb824fab71ee4c3)

2 years agoriscv: Use generic CSR macros for writing SATP
Mark Johnston [Tue, 1 Mar 2022 14:03:44 +0000 (09:03 -0500)]
riscv: Use generic CSR macros for writing SATP

Instead of having the one-off load_satp(), just use csr_write().  No
functional change intended.

Reviewed by: alc, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 2e956c30cab6a36fee9a3d5159c3903406e3e5e7)

2 years agoriscv: Rename struct pmap's pm_l1 field to pm_top
Mark Johnston [Tue, 1 Mar 2022 14:03:30 +0000 (09:03 -0500)]
riscv: Rename struct pmap's pm_l1 field to pm_top

In SV48 mode, the top-level page will be an L0 page rather than an L1
page.  Rename the field accordingly.  No functional change intended.

Reviewed by: alc, jhb
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 82f4e0d0f06456f2d070d2e0692a8f318f4eb90b)

2 years agormlock: Add required compiler barriers to _rm_runlock()
Mark Johnston [Tue, 1 Mar 2022 13:55:43 +0000 (08:55 -0500)]
rmlock: Add required compiler barriers to _rm_runlock()

Also remove excessive whitespace in _rm_rlock().

Reviewed by: jah, mjg
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 89ae8eb74e87ac19aa2d7abe4ba16bcccd32bb9f)

2 years agolibc __sfvwrite(): roll back FILE buffer pointer on fflush error
Konstantin Belousov [Sun, 6 Mar 2022 08:59:39 +0000 (10:59 +0200)]
libc  __sfvwrite(): roll back FILE buffer pointer on fflush error

__sfvwrite() advances the pointer before calling fflush.  If fflush()
fails, it is not enough to roll back inside it, because we cannot know
how much was advanced by the caller.

Reported by: Peter <pmc@citylink.dinoex.sub.org>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Fixes: 86a16ada1ea608408cec370171d9f59353e97c77

(cherry picked from commit bafaa70b6f9098d83d074968c8e6747ecec1e118)

2 years agobuf_alloc(): Stop using LK_NOWAIT, use LK_NOWITNESS
Konstantin Belousov [Wed, 16 Feb 2022 15:30:17 +0000 (17:30 +0200)]
buf_alloc(): Stop using LK_NOWAIT, use LK_NOWITNESS

Despite the buffer taken from cache or free list, it still can be
locked, due to 'lockless lookup' in getblkx() potentially operating on
the freed buffers.  The lock is transient, but prevents the use of
LK_NOWAIT there for the goal of neutralizing WITNESS.

Just use LK_NOWITNESS.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 1fb00c8f1060e18fed621f13d31db7b336d2267e)

2 years agolinuxkpi: fix module build outside of kernel build environment
Eugene Grosbein [Thu, 10 Mar 2022 21:31:23 +0000 (04:31 +0700)]
linuxkpi: fix module build outside of kernel build environment

(cherry picked from commit f5a2e7b0e8483bf51519046fd149a6a31acef6b1)

2 years agoBuild compiler-rt against libunwind, not libcxxrt
Dimitry Andric [Wed, 9 Mar 2022 21:23:35 +0000 (22:23 +0100)]
Build compiler-rt against libunwind, not libcxxrt

Parts of compiler-rt are also built for libgcc_eh and libgcc_s, and
these were already pointing to the libunwind unwind.h. For the sake of
consistency, also build compiler-rt itself against the libunwind
unwind.h, not the libcxxrt one.

MFC after: 3 days

(cherry picked from commit 7ecd99fa424df001028c5cddc52d25b29232f1af)

2 years agoRemove compat hacks from libcxxrt's _Unwind_Exception
Dimitry Andric [Tue, 8 Mar 2022 21:53:16 +0000 (22:53 +0100)]
Remove compat hacks from libcxxrt's _Unwind_Exception

This reverts 9097e3cbcac4, which was in itself a revert of upstream
libcxxrt commits 88bdf6b290da ("Specify double-word alignment for ARM
unwind") and b96169641f79 ("Updated Itanium unwind"), and a
reapplication of our commit 3c4fd2463bb2 ("libcxxrt: add padding in
__cxa_allocate_* to fix alignment").

The editors/libreoffice port will be patched to be able to cope with the
standards-compliant alignment of _Unwind_Exception and consequently,
that of __cxa_exception. The layouts and sizes of these structures
should then be completely the same for libcxxrt, libunwind and
libc++abi.

PR: 262008
Reviewed by: emaste, jhb, theraven
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34488

(cherry picked from commit 72df847a94bccee245a3316e4f848482b9ac2ac2)

2 years agoFix indentation in usr.bin/diff/pr.c
Dimitry Andric [Mon, 28 Feb 2022 20:06:19 +0000 (21:06 +0100)]
Fix indentation in usr.bin/diff/pr.c

In commit 6fa5bf0832ef the pr(1) related code in diff was moved around,
but some part of the indentation was messed up, and one line was
duplicated. Remove the duplicated line, and fix up the indentation.

Reviewed by: bapt
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D34398

(cherry picked from commit f7d6e97e4bf1fe4c70d5b0ef9fdf649bf07e1c91)

2 years agocap_net: plug memory leak
Mariusz Zaborski [Tue, 14 Dec 2021 10:57:36 +0000 (11:57 +0100)]
cap_net: plug memory leak

MFC after: 5 days

(cherry picked from commit 88910b8b7b14386e05bccda0317ace2bfd383ef5)

2 years agocap_net: fix verification of bind permission
Mariusz Zaborski [Tue, 14 Dec 2021 11:01:10 +0000 (12:01 +0100)]
cap_net: fix verification of bind permission

MFC after: 5 days

(cherry picked from commit f45ca435bd2cba2ea6d9b79dbef275bc5ea4036a)

2 years agotslog.4: Document TSLOG
Mateusz Piotrowski [Fri, 4 Mar 2022 19:33:22 +0000 (20:33 +0100)]
tslog.4: Document TSLOG

Based on commit messages and Colin Percival's presentation
from BSDCan 2018 [1].

[1]: https://papers.freebsd.org/2018/bsdcan/percival-Profiling_the_FreeBSD_kernel_boot.files/percival-Profiling_the_FreeBSD_kernel_boot.pdf

Reviewed by: cperciva, debdrup
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34430

(cherry picked from commit 5675bb582985654b172a4c1dd191e2b3bb8e78bb)

2 years agotime.3: Update ERRORS section
Mateusz Piotrowski [Fri, 4 Mar 2022 14:09:32 +0000 (15:09 +0100)]
time.3: Update ERRORS section

time() is now implemented using clock_gettime(2) instead of
gettimeofday(2).

Reviewed by: debdrup
Fixes: 358ed16f7505 Use clock_gettime(CLOCK_SECOND)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34438

(cherry picked from commit 413045a52c5f14ac22516b4f622d0132dc34e882)

2 years agoctime.3: Add a cross-reference to clock_gettime(2)
Mateusz Piotrowski [Fri, 4 Mar 2022 16:48:02 +0000 (17:48 +0100)]
ctime.3: Add a cross-reference to clock_gettime(2)

MFC after: 1 week

(cherry picked from commit dd74471e49fd927d5a3a16fcdf94243cdd34c3f3)

2 years agozfs: merge openzfs/zfs@ef83e07db (zfs-2.1-release) into stable/13
Martin Matuska [Fri, 11 Mar 2022 07:11:42 +0000 (08:11 +0100)]
zfs: merge openzfs/zfs@ef83e07db (zfs-2.1-release) into stable/13

OpenZFS release 2.1.3

Notable upstream pull request merges:
  #12569 FreeBSD: Really zero the zero page
  #12828 FreeBSD: Add vop_standard_writecount_nomsyn
  #12828 zfs: Fix a deadlock between page busy and the teardown lock
  #12828 FreeBSD: Catch up with more VFS changes
  #12851 FreeBSD: Provide correct file generation number
  #12857 Verify dRAID empty sectors
  #12874 FreeBSD: Update argument types for VOP_READDIR
  #12896 Reduce number of arc_prune threads
  #12934 FreeBSD: Fix zvol_*_open() locking
  #12961 FreeBSD: Fix leaked strings in libspl mnttab
  #12964 Fix handling of errors from dmu_write_uio_dbuf() on FreeBSD
  #12981 Introduce a flag to skip comparing the local mac when
         raw sending
  #12985 Avoid memory allocations in the ARC eviction thread
  #13014 Report dnodes with faulty bonuslen
  #13016 FreeBSD: Fix zvol_cdev_open locking
  #13027 Fix clearing set-uid and set-gid bits on a file when
         replying a write
  #13031 Add enumerated vdev names to 'zpool iostat -v' and
         'zpool list -v'
  #13074 Enable encrypted raw sending to pools with greater ashift
  #13076 Receive checks should allow unencrypted child datasets
  #13098 Avoid dirtying the final TXGs when exporting a pool
  #13172 Fix ENOSPC when unlinking multiple files from full pool

Obtained from: OpenZFS
OpenZFS commit: ef83e07db53e5d1017d3afbf376f4dbb2f6feada
OpenZFS tag: zfs-2.1.3
Relnotes: yes

2 years agoAdd support for getting early entropy from UEFI
Colin Percival [Thu, 17 Feb 2022 21:01:11 +0000 (13:01 -0800)]
Add support for getting early entropy from UEFI

UEFI provides a protocol for accessing randomness. This is a good way
to gather early entropy, especially when there's no driver for the RNG
on the platform (as is the case on the Marvell Armada8k (MACCHIATObin)
for now).

If the entropy_efi_seed option is enabled in loader.conf (default: YES)
obtain 2048 bytes of entropy from UEFI and pass is to the kernel as a
"module" of name "efi_rng_seed" and type "boot_entropy_platform"; if
present, ingest it into the kernel RNG.

Submitted by: Greg V
Reviewed by: markm, kevans
Approved by: csprng (markm)
Differential Revision: https://reviews.freebsd.org/D20780

2 years agoif_epair: fix build with RSS and INET or INET6 disabled
Santiago Martinez [Thu, 3 Mar 2022 09:44:43 +0000 (10:44 +0100)]
if_epair: fix build with RSS and INET or INET6 disabled

Reviewed by: kp
MFC after: 1 week

(cherry picked from commit 52bcdc5b809ea56cbdce0bd36499e4ae74780d2b)

2 years agoMake sure the avr32dci_odevd structure is used.
Hans Petter Selasky [Sat, 10 Jul 2021 16:13:21 +0000 (18:13 +0200)]
Make sure the avr32dci_odevd structure is used.
This fixes a compilation error.

Sponsored by: NVIDIA Networking

(cherry picked from commit 3f5054862a4603116bb872cf8b7b3cc946e93741)

2 years agoFactor out repeated code in the USB controller drivers to avoid bugs
Hans Petter Selasky [Sat, 10 Jul 2021 16:17:51 +0000 (18:17 +0200)]
Factor out repeated code in the USB controller drivers to avoid bugs
computing the same isochronous start frame number over and over again.

PR: 257082
Sponsored by: NVIDIA Networking

(cherry picked from commit 8fc2a3c41791b205a107dc2bec16ac7514a57958)
(cherry picked from commit f52783fcf5cc60734121d061beef0d4ea47b224a)
(cherry picked from commit cf48d1f77126d8de4c03c4dd7c8502be2b5f1954)

2 years agoMake sure the XHCI driver obeys the isochronous scheduling threshold value
Hans Petter Selasky [Sat, 10 Jul 2021 16:09:56 +0000 (18:09 +0200)]
Make sure the XHCI driver obeys the isochronous scheduling threshold value
as given by the XHCI hardware parameters to avoid scheduling isochronous
transfers too early.

Sponsored by: NVIDIA Networking

(cherry picked from commit d038463bd269031fa8f13c0951b223bcae02bbca)

2 years agoLet the xhci_hw_root structure span exactly XHCI_PAGE_SIZE bytes by increasing
Hans Petter Selasky [Sat, 10 Jul 2021 12:14:11 +0000 (14:14 +0200)]
Let the xhci_hw_root structure span exactly XHCI_PAGE_SIZE bytes by increasing
the number of completion event TRBs. This avoids wasting memory.

Sponsored by: NVIDIA Networking

(cherry picked from commit e036ee6ce2e4d6fe0564f8bb3aa99a2f61d48fc6)

2 years agoibcore: Fix multiple includes of same header file.
Hans Petter Selasky [Thu, 3 Mar 2022 11:51:05 +0000 (12:51 +0100)]
ibcore: Fix multiple includes of same header file.

Sponsored by: NVIDIA Networking

(cherry picked from commit fc99316ef97c3d21cc46f4459f3c2853f2e5be1a)

2 years agousb(4): Factor out the usb_check_request() function.
Hans Petter Selasky [Thu, 3 Mar 2022 09:22:41 +0000 (10:22 +0100)]
usb(4): Factor out the usb_check_request() function.

No functional change.

Sponsored by: NVIDIA Networking

(cherry picked from commit 8ed5bb59e913c61e61a4232e8221f35256f72ad2)

2 years agoipfilter: Reliably print the interface name
Cy Schubert [Thu, 3 Mar 2022 06:43:48 +0000 (22:43 -0800)]
ipfilter: Reliably print the interface name

When printing the interface name from the ipstate_t struct the interface
name in is_ifp may not always be avaiable when reading it from kmem
(tested on FreeBSD and NetBSD). However the is_ifname (the interface
name character string) is almost always available -- it is not available
when the source of the packet is a process running on the firewall
itself. Rather than print both interface name strings, print only the
one.

(cherry picked from commit 93c1048a1360c3a0f1a6a9248916ef06c52b4504)

2 years agoipfilter: Obtain the interface name more efficiently
Cy Schubert [Thu, 3 Mar 2022 06:40:18 +0000 (22:40 -0800)]
ipfilter: Obtain the interface name more efficiently

Rather than use a kmem read to determine the interface name used by a
nat_t structure through a pointer, nat_ipfs->netif->if_xname, obtain it
directly from nat_ifnames in the nat_t structure itself using the new
FORMAT_IF macro.

(cherry picked from commit ec793543feff027f0de9dff3708ab86f5e567d15)

2 years agoipfilter: Introduce the new FORMAT_IF macro
Cy Schubert [Thu, 3 Mar 2022 06:21:59 +0000 (22:21 -0800)]
ipfilter: Introduce the new FORMAT_IF macro

Interface names stored in the ipstate_t and ipnat_t structures can be
NULL. This occurs when an application, such as named, is running on the
firewall machine itself. For example an application, i.e. named, running
on the firewall itself will cause a state table display and NAT mapping
display to show a null ingress interface and its egress interface. This
is perfectly valid but confusing to human eyes. Rather than print
nothing, print "(null)".

(cherry picked from commit 915395a2800a09a64ae41ca96eabcb5e16b44309)

2 years agoRename stable/13 to -STABLE now that releng/13.1 has branched
Glen Barber [Thu, 10 Mar 2022 00:11:29 +0000 (19:11 -0500)]
Rename stable/13 to -STABLE now that releng/13.1 has branched

Bump __FreeBSD_version

Approved by: re (implicit)
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agocxgbe(4): dump_devlog should never fail silently.
Navdeep Parhar [Mon, 7 Mar 2022 19:17:05 +0000 (11:17 -0800)]
cxgbe(4): dump_devlog should never fail silently.

Do the same thing as dump_cimla and log a warning on failure.

Sponsored by: Chelsio Communications

(cherry picked from commit 9282f04ff0ee89cc4064e510f7fa505cfc890bf0)

2 years agotests: readlink: fix atf_test_case call [NFC]
Kyle Evans [Fri, 4 Mar 2022 03:48:21 +0000 (21:48 -0600)]
tests: readlink: fix atf_test_case call [NFC]

This was meant to read `basic`, rather than a duplicate of `f_flag`.  It
is largely irrelevant, though, as atf_test_case mostly just makes
sure that the proper functions are defined.

(cherry picked from commit 0e73b834f32224e3652f61e598c19f572a20cca3)

2 years agocp: Make -P work without -R as per POSIX
Cameron Katri [Wed, 23 Feb 2022 18:55:13 +0000 (12:55 -0600)]
cp: Make -P work without -R as per POSIX

According to POSIX, cp should allow the `-P` flag to work whether `-R`
is specified or not.  Currently, the `-P` option only works along with
`-R`.

PR: 199466

(cherry picked from commit 97e13037915c22162f199461f56951793d669f57)

2 years agocp: fix -R with links
Kyle Evans [Thu, 27 Jan 2022 18:02:17 +0000 (12:02 -0600)]
cp: fix -R with links

The traversal was previously not properly honoring -H/-L/-P.  Notably,
we should not have been resolving symlinks encountered during traversal
when either -H or -P are specified.

(cherry picked from commit 33ad990ce974be50abdc25427b0f365699d83a34)

2 years agolualoader: fix the autoboot_delay countdown message
Katsuyuki Miyoshi [Tue, 26 Oct 2021 16:21:34 +0000 (11:21 -0500)]
lualoader: fix the autoboot_delay countdown message

When the timer drops from double to single digits, a spare 'e' is left
on the end of the line as we don't overwrite it. Include an extra space
at the end to account for this and overwrite the leftover character.

PR: 259429

(cherry picked from commit bb4c691299c5d699cea29e18fef96bda1cef13da)

2 years agoAdd support for jail.conf.d
Antranig Vartanian [Wed, 8 Sep 2021 07:07:49 +0000 (02:07 -0500)]
Add support for jail.conf.d

Using /etc/jail.{jailname}.conf is nice, however it makes /etc/ very
messy if you have many jails.  This patch allows one to move these
config files out of the way into /etc/jail.conf.d/{jailname}.conf.

Note that the same caveat as /etc/jail.*.conf applies: the jail service
will not autodiscover all of these for starting 'all' jails.  This is
considered future work, since the behavior matches.

(cherry picked from commit 7955efd574b98601a95da45d6d8e7f452631fddd)

2 years agolibpmc: Allow specifying explicit EVENT_xxH events on armv7 and arm64
Jessica Clarke [Tue, 15 Feb 2022 16:10:34 +0000 (16:10 +0000)]
libpmc: Allow specifying explicit EVENT_xxH events on armv7 and arm64

This is useful for processors where we don't have an event table; in
those cases we default to a Cortex A8 (armv7) or Cortex A53 (arm64) in
order to attempt to provide something useful, but you're then limited to
the counters in those tables, some of which may also not be implemented
(e.g. LD/ST_RETIRED are no longer implemented in more recent cores,
replaced by LD/ST_SPEC).

Adding the raw EVENT_xxH event lists to each table ensures that you can
always request the exact events you want, regardless of what has been
detected or is known.

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33805

(cherry picked from commit 9f22e0959b1e2e3c9450f8b495d2c0c86699eb18)

2 years agoUpdate smartqpi driver to vendor's latest submission
Warner Losh [Wed, 9 Mar 2022 00:01:04 +0000 (17:01 -0700)]
Update smartqpi driver to vendor's latest submission

Newly added features & bug fixes

o Fixed an issue smartpqi debug log messages are flooding kernel logs.
o Fixed an issue where devices are shown as RAID 0 in display info.
o Feature: Changed 32 bit dma address to 64 bit address
o Added new controlller ids.

Submitted by: Microsemi
Reviewed by: Scott Benesh (Microsemi), imp
Differential Revision: https://reviews.freebsd.org/D34469
MFC After: 3 days

Sponsored by: Netflix

(cherry picked from commit 4f77349d5777c8ac504387e7e6d37c13da222294)

2 years agoFix "set but not used" in smartpqi. The PCI_MEM macros don't require a
Scott Long [Sat, 26 Feb 2022 17:25:43 +0000 (10:25 -0700)]
Fix "set but not used" in smartpqi.  The PCI_MEM macros don't require a
physical/absolute address in FreeBSD, but it looks like the calling
code might be somewhat portable to other OS's that do require this.
Therefore, set the variables to __unused instead of removing the code
entirely.

(cherry picked from commit e28289ca83673d753b7e479810947f6a1015ad39)

2 years agocamcontrol fwdownload minor improvements
Warner Losh [Tue, 22 Feb 2022 21:25:32 +0000 (14:25 -0700)]
camcontrol fwdownload minor improvements

Minor improvements to the fwdownload code suggested by chs@:
o Print the path_id/target we're rescanning so it's not invisible
o No need for XPT_GDEVLIST, all the info is filled in. Remove sending it
  as well as a comment related to it from a mistaken observation. libcam
  always fills these in properly, so use those for the ccb path/target.
o Don't leak /dev/xpt fd in success cases.
o Rename fw_rescan_lun to fw_rescan_target and pass sim_mode to
  only print path_id and target_id info.

Reviewed by: chs@
Fixes: 9835900cb95bcd068774934961fb1419719d595b
Sponsored by: Netflix
MFC After: 1 week
Differential Revision: https://reviews.freebsd.org/D34348

(cherry picked from commit 78fbaa1fac2677feeb2094048d77587a2ab80d11)

2 years agosmartpqi: Remove stray declaration
Warner Losh [Thu, 3 Jun 2021 23:44:27 +0000 (17:44 -0600)]
smartpqi: Remove stray declaration

pqisrc_is_firmware_feature_enabled shouldn't be declared inline in a
header, and then static inline in the .c function. Remove this stray
declartion from the header. gcc6 complains, but clang does not.

Sponsored by: Netflix

(cherry picked from commit eae2ef5a010366c673ad912cae23b426ebb9a8a2)

2 years agobio: make _bio_cflags match bio_cflags
Warner Losh [Wed, 23 Feb 2022 21:28:16 +0000 (14:28 -0700)]
bio: make _bio_cflags match bio_cflags

While none of the in-tree geoms that modify the bio_cflags use the top
half of the word, were they to do this in the future, we'd hit false
positives for DIAGNOSTIC kernels. Make both uint16_t.

MFC After: 1 week
Sponsored by: Netflix

(cherry picked from commit 077ab5bd43aaeb955d84c501ddddc7533f0a06b9)

2 years agodtc.1: Mention the existence of -i flag
Jose Luis Duran [Sat, 19 Feb 2022 13:43:18 +0000 (10:43 -0300)]
dtc.1: Mention the existence of -i flag

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/570

(cherry picked from commit 62d16ad37df7d9efb6e329c9e7ca1fc3975a1966)

2 years agodtc.1: Appease mandoc -T lint
Jose Luis Duran [Sat, 19 Feb 2022 13:47:31 +0000 (10:47 -0300)]
dtc.1: Appease mandoc -T lint

Prefer .Fx to bare FreeBSD

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/579

(cherry picked from commit 7ae5d1f00f8770b53a631d16c4be7a7cad7b477d)

2 years agolibefivar: Correct the string expression of UTF8 vendor device path
Jose Luis Duran [Tue, 22 Feb 2022 11:39:03 +0000 (08:39 -0300)]
libefivar: Correct the string expression of UTF8 vendor device path

According to UEFI spec, the string expression of UTF8 vendor
device node should be displayed as: VenUtf8(). Current code
display it as: VenUft8() by mistake when convert device
path node to text.

This commit is to fix this bug.

Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1225
Obtained from: https://github.com/tianocore/edk2/commit/959be180e185869b71db9dad34c3f4bba660d724
Pull Request: https://github.com/freebsd/freebsd-src/pull/580

(cherry picked from commit 91a35e5803bef59b8ca67b0621216124cc2e42f8)

2 years agocamcontrol: Force a rescan of the lun after firmware download.
Warner Losh [Tue, 22 Feb 2022 17:34:36 +0000 (10:34 -0700)]
camcontrol: Force a rescan of the lun after firmware download.

After downloading the firmware to a device, it's inquiry data likely
will change. Force a rescan of the target with the CAM_EXPECT_INQ_CHANGE
flag to get it to record the new inqury data as being expected. This
avoids the need for a 'camcontrol rescan' on the device which detaches
and re-attaches the disk (da, ada) device. This brings fwdownload up to
nvmecontrol's ability to do the same thing w/o changing the exposed
nvme/nvd/nda device. We scan the target and not the LUN because dual
actuator drives have multiple LUNs, but the firmware is global across
many vendors' drives (and the so far theoretical ones that aren't won't
be harmed by the rescan).

Since the underlying struct disk is now preserved accross this
operation, it's now possible to upgrade firmware of a root device w/o
crashing the system.  On systems that are quite busy, the worst that
happens is that certain operaions are reported cancelled when the new
firmware is activated. These operations are retried with the normal CAM
recovery mechanisms and will work on the retry. The only visible hiccup
is the time that new firmware is flashing / initializing. One should not
consider this operation completely risk free, however, since not all
drives are well behaved after a firmware download.

MFC After: 1 week
Relnotes: yes
Sponsored by: Netflix
Feedback by: mav
Differential Revision: https://reviews.freebsd.org/D34325

(cherry picked from commit 9835900cb95bcd068774934961fb1419719d595b)

2 years agousb(4): Don't skip calling uhub_explore_sub() even on HUB port errors.
Hans Petter Selasky [Tue, 8 Mar 2022 18:57:38 +0000 (19:57 +0100)]
usb(4): Don't skip calling uhub_explore_sub() even on HUB port errors.

This should fix an issue where the "udev->re_enumerate_wait" field never gets
processed and reset. In this case usbconfig will wait forever and never return.

Sponsored by: NVIDIA Networking

(cherry picked from commit c7cd6f809d2ce6b7d331717c31ce51c631ae00d7)

2 years agomlx5/mlx4: Bump driver version to 3.7.1
Hans Petter Selasky [Tue, 8 Mar 2022 11:16:00 +0000 (12:16 +0100)]
mlx5/mlx4: Bump driver version to 3.7.1

Sponsored by: NVIDIA Networking

(cherry picked from commit b18c510844fb631ea571f7f3edad6372e91501fa)

2 years agou3g(4): Add new USB IDs.
Hans Petter Selasky [Tue, 8 Mar 2022 10:02:52 +0000 (11:02 +0100)]
u3g(4): Add new USB IDs.

Submitted by: Matthew Luckie <mjl@luckie.org.nz>
Sponsored by: NVIDIA Networking

(cherry picked from commit a75444c14304e63a3b0369d01c86a077e98fc9f9)

2 years agofusefs: fix a cached attributes bug during directory rename
Alan Somers [Tue, 22 Feb 2022 05:00:42 +0000 (22:00 -0700)]
fusefs: fix a cached attributes bug during directory rename

When renaming a directory into a different parent directory, invalidate
the cached attributes of the new parent.  Otherwise, stat will show the
wrong st_nlink value.

Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D34336

(cherry picked from commit e8553be9bcfc2c0d78e9f379bd166dc0a9cae719)

2 years agoAdd serial-number to hw.fdt sysctl area if found in fdt.
Mike Karels [Wed, 23 Feb 2022 20:42:30 +0000 (14:42 -0600)]
Add serial-number to hw.fdt sysctl area if found in fdt.

Add serial-number sysctl if that fdt property exists and is a printable
string.  While here, ensure that the hw.fdt sysctl values fit in the
buffers provided so that they will be NUL-terminated.  Tested on
Raspberry Pi 3B+ and 4.

Reviewed by: manu imp
Differential Revision: https://reviews.freebsd.org/D34356

(cherry picked from commit b8b0c65e8a43cab95b97e28d3e3d73fc7d9c0a5e)

2 years agofdt: Expose the model, compatible and freebsd dts brandind as sysctl
Emmanuel Vadot [Sat, 17 Jul 2021 15:19:22 +0000 (17:19 +0200)]
fdt: Expose the model, compatible and freebsd dts brandind as sysctl

This make it easier for script to get the hardware on which they are running.

Sponsored by: Diablotin Systems
Differential Revision:   https://reviews.freebsd.org/D31205
Reviewed by:    imp
Should be ok on powerpc:  jhibbits (over irc)

(cherry picked from commit 50e0dc0c4b46ee62b898ce2d92e52be4f77383d9)

2 years agoTag zfs-2.1.3
Tony Hutter [Wed, 9 Mar 2022 02:03:54 +0000 (18:03 -0800)]
Tag zfs-2.1.3

META file and changelog updated.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
2 years agodtrace tests: Fix expected outout for tst.system.d
Li-Wen Hsu [Wed, 9 Mar 2022 03:39:12 +0000 (11:39 +0800)]
dtrace tests: Fix expected outout for tst.system.d

This is follow up of d500a85e640d1cd270747c12e17c511b53864436

PR: 262415
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 16e02ae401ebd9aa7d47f46dc4905f4f8add70a8)

2 years agostats.7: Fix a typo
Mateusz Piotrowski [Fri, 4 Mar 2022 11:35:55 +0000 (12:35 +0100)]
stats.7: Fix a typo

MFC after: 3 days

(cherry picked from commit 5d3007c1a26966f6c61ba50bea180c2f89f32ff8)

2 years agoFix ENOSPC when unlinking multiple files from full pool
Brian Behlendorf [Tue, 8 Mar 2022 17:16:35 +0000 (09:16 -0800)]
Fix ENOSPC when unlinking multiple files from full pool

When unlinking multiple files from a pool at 100% capacity, it was
possible for ENOSPC to be returned after the first unlink.  e.g.

    rm -f /mnt/fs/test1.0.0 /mnt/fs/test1.1.0 /mnt/fs/test1.2.0
    rm: cannot remove '/mnt/fs/test1.1.0': No space left on device
    rm: cannot remove '/mnt/fs/test1.2.0': No space left on device

After waiting for the pending deferred frees from the first unlink to
be processed the remaining files can then be unlinked.  This is caused
by the quota limit in dsl_dir_tempreserve_impl() being temporarily
decreased to the allocatable pool capacity less any deferred free
space.

This is resolved using the existing mechanism of returning ERESTART
when over quota as long as we know enough space will shortly be
available after processing the pending deferred frees.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13172

2 years agozfs: Update test format strings to match variable typtes
Ed Maste [Mon, 28 Feb 2022 01:11:20 +0000 (20:11 -0500)]
zfs: Update test format strings to match variable typtes

And drop stray 'd' from the end of some printed numbers.  I assume this
was the result of someone thinking u is a printf length modifier for d,
not a format specifier itself.

Reviewed by: kevans, rew
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34387

(cherry picked from commit f27fb06cadc6a8e75ebebd3b60c8a9dc9ae1b833)

2 years agopowerpc: enable initial-exec TLS
Piotr Kubaj [Fri, 18 Feb 2022 13:22:14 +0000 (14:22 +0100)]
powerpc: enable initial-exec TLS

Summary:
Use initial-exec, like other architectures.

While here, switch MACHINE_ARCH in lib/libc/Makefile to LIBC_ARCH and consistently use powerpc.

Subscribers: imp, #contributor_reviews_base

Differential Revision: https://reviews.freebsd.org/D34315
Reviewed by: luporl
MFC after: 2 weeks

(cherry picked from commit 884ba43116d4456d5900d3c8824153c604f132b8)

2 years agoopenssh: Add a note to check for deprecated and removed config options
Mark Johnston [Tue, 1 Mar 2022 14:36:23 +0000 (09:36 -0500)]
openssh: Add a note to check for deprecated and removed config options

Suggested by: emaste
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 9340d69e57764c6ead568dbf14a859d184c35b8e)

2 years agorelease: Remove references to ChallengeResponseAuthentication
Mark Johnston [Tue, 1 Mar 2022 13:54:55 +0000 (08:54 -0500)]
release: Remove references to ChallengeResponseAuthentication

This sshd_config keyword was replaced by KbdInteractiveAuthentication in
openssh 8.7, though ChallengeResponseAuthentication is silently accepted
as an alias.  However, this means that the code in ec2.conf which
modifies a commented-out line no longer does anything.  Apply a minimal
fix.

Reviewed by: cperciva, emaste
Sponsored by: The FreeBSD Foundation

(cherry picked from commit c1b656ac55eca1fc191225bd715b31ff25be9031)

2 years agoix(4): Add control of 2.5/5G autonegotiation speeds
Piotr Pietruszewski [Fri, 4 Mar 2022 18:37:59 +0000 (10:37 -0800)]
ix(4): Add control of 2.5/5G autonegotiation speeds

This change enables the user to control 2.5G and 5G autonegotiation
speeds via advertise_speed sysctl for X550T devices. Due to reported
interoperability issues with switches, 2.5G and 5G speeds will not be
advertised by default.

Signed-off-by: Piotr Pietruszewski <piotr.pietruszewski@intel.com>
Co-authored-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Tested by: gowtham.kumar.ks@intel.com
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D26245

(cherry picked from commit d381c807510de2ebb453a563540bd17e344a2aab)

2 years agoixv(4): Allow PF to control the VF link state
Piotr Pietruszewski [Fri, 4 Mar 2022 18:33:02 +0000 (10:33 -0800)]
ixv(4): Allow PF to control the VF link state

This patch adds checks of a VF link state provided by PF via mailbox
API. Such change enables the PF to disable a VF administratively.

Since command needed by the PF to control the VF is introduced in
mailbox api version 1.2, this patch also bumps supported mailbox api
version to 1.2.

Co-authored-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed By: kbowling@
Tested by: lukasz.szczepaniak@intel.com
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D32004

(cherry picked from commit a3e719bbc21a56230a5b8adeb4c531a6dfb77940)

2 years agoice(4): Update to 1.34.2-k
Eric Joyner [Fri, 4 Mar 2022 18:25:25 +0000 (10:25 -0800)]
ice(4): Update to 1.34.2-k

- Adds FW logging support
  - Once enabled, this lets the firmware print event and error messages
    to the log, increasing the visibility into what the hardware is
    doing; this is useful for debugging
- General bug fixes
- Adds inital DCB support to the driver
  - Notably, this adds support for DCBX to the driver; now with the
    fw_lldp sysctl set to 1, the driver and adapter will adopt a DCBX
    configuration sent from a link partner
  - Adds statistcs sysctls for priority flow control frames
  - Adds new configuration sysctls for DCB-related features: (VLAN) user
    priority to TC mapping; ETS bandwidth allocation; priority flow
    control
- Remove unused SR-IOV files (until support gets added)

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Tested by: jeffrey.e.pieper@intel.com
MFC after: 3 days
MFC with: 213e91399be438f0a975
Relnotes: yes
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D34024

(cherry picked from commit 56429daea255fa719169bb23ded66f8edb6f5408)
(cherry picked from commit 61d83041ab111fe491409f2eca2b528108b9ec29)

2 years agoice_ddp: Update to 1.3.27.0
Eric Joyner [Wed, 1 Dec 2021 20:48:36 +0000 (12:48 -0800)]
ice_ddp: Update to 1.3.27.0

This is intended to be used with forthcoming ice(4) driver version 1.34.2.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation

(cherry picked from commit e438f0a97538bf5cf6f3ff70a65c4d1f96b766aa)

2 years agoiflib: Allow drivers to determine which queue to TX on
Eric Joyner [Thu, 29 Jul 2021 23:24:14 +0000 (16:24 -0700)]
iflib: Allow drivers to determine which queue to TX on

Adds a new function pointer to struct if_txrx in order to allow
drivers to set their own function that will determine which queue
a packet should be sent on.

Since this includes a kernel ABI change, bump the __FreeBSD_version
as well.

(This motivation behind this is to allow the driver to examine the
UP in the VLAN tag and determine which queue to TX on based on
that, in support of HW TX traffic shaping.)

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: kbowling@, stallamr@netapp.com
Tested by: jeffrey.e.pieper@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D31485

(cherry picked from commit 213e91399b7998554d787bb290109ebe602aa279)

2 years agopowerpc: enable ice in GENERIC64LE
Piotr Kubaj [Thu, 20 Jan 2022 21:32:02 +0000 (22:32 +0100)]
powerpc: enable ice in GENERIC64LE

Approved by: erj
Differential Revision: https://reviews.freebsd.org/D33974

(cherry picked from commit a0f3abb098799ec05b6dd8a40363b1093cf81d49)

2 years agoixl(4): Remove unused function declaration
Eric Joyner [Wed, 12 Jan 2022 23:37:42 +0000 (15:37 -0800)]
ixl(4): Remove unused function declaration

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation

(cherry picked from commit 0e8181c01237141ed94d2efbb5b7efae39e6232e)

2 years agoiavf(4): Include RSS header file when RSS is defined
Eric Joyner [Fri, 3 Dec 2021 20:02:42 +0000 (12:02 -0800)]
iavf(4): Include RSS header file when RSS is defined

This should unbreak the kernel build when "options RSS" is
defined in the kernel configuration, and make the feature work.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reported by: adrian@
Sponsored by: Intel Corporation

(cherry picked from commit 5577aa338a675f2a465a58356894fbe24ba20407)

2 years agoixl(4): Remove iavf(4) source files
Eric Joyner [Sat, 13 Feb 2021 00:04:54 +0000 (16:04 -0800)]
ixl(4): Remove iavf(4) source files

Since iavf(4) no longer shares code with ixl(4) as of commit
f2fbd56a8d07665bc0a5e8b7e40026b50a591e2a and now has its own directory,
remove these now-unused iavf(4)-only files.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D28638

(cherry picked from commit 409b36ad911d0a12a45c1488369b458965691379)

2 years agoiavf(4): Split source and update to 3.0.26-k
Eric Joyner [Fri, 12 Feb 2021 21:28:18 +0000 (13:28 -0800)]
iavf(4): Split source and update to 3.0.26-k

The iavf(4) driver now uses a different source base from ixl(4), since
it will be the standard VF driver for new Intel Ethernet products going
forward, including ice(4). It continues to use the iflib framework
for network drivers.

Since it now uses a different source code base, this commit adds a new
sys/dev/iavf entry, but it re-uses the existing module name so no
configuration changes are necessary.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: kbowling@
Tested by: lukasz.szczepaniak@intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D28636

(cherry picked from commit ca853dee3b8f26f53d48d685f32ec0b8396369e8)

2 years agoice(4): Update to version 0.29.4-k
Eric Joyner [Wed, 23 Jun 2021 20:41:54 +0000 (13:41 -0700)]
ice(4): Update to version 0.29.4-k

Includes various feature improvements and bug fixes.

Notable changes include:
- Firmware logging support
- Link management flow changes
- New sysctl to report aggregated error counts
- Health Status Event reporting from firmware (Use the new read-only
  tunables hw.ice.enable_health_events / dev.ice.#.enable_health_events
  to turn this off)

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation

(cherry picked from commit 9cf1841c4aaf8fbab06132ab9f76094f34ad7c7b)