Commit Graph

252578 Commits

Author SHA1 Message Date
Alexander V. Chernikov
b122304f6a Further split nhop creation and rtable operations.
As nexthops are immutable, some operations such as route attribute changes
 require nexthop fetching, forking, modification and route switching.
These operations are not atomic, so they may need to be retried multiple
 times in presence of multiple speakers changing the same route.

This change introduces "synchronisation" primitive: route_update_conditional(),
 simplifying logic for route changes and upcoming multipath operations.

Differential Revision:	https://reviews.freebsd.org/D26216
2020-08-28 21:59:10 +00:00
Michael Tuexen
404ff76bda Fix a regression with the explicit EOR mode I introduced in r364268.
A short MFC time as discussed with the secteam.

Reported by:		Taylor Brandstetter
MFC after:		1 day
2020-08-28 20:05:18 +00:00
Vincenzo Maffione
5c4f8d801c lib: add libnetmap
This changeset introduces the new libnetmap library for writing
netmap applications.
Before libnetmap, applications could either use the kernel API
directly (e.g. NIOCREGIF/NIOCCTRL) or the simple header-only-library
netmap_user.h (e.g. nm_open(), nm_close(), nm_mmap() etc.)

The new library offers more functionalities than netmap_user.h:
  - Support for complex netmap options, such as external memory
    allocators or per-buffer offsets. This opens the way to future
    extensions.
  - More flexibility in the netmap port bind options, such as
    non-numeric names for pipes, or the ability to specify the netmap
    allocator that must be used for a given port.
  - Automatic tracking of the netmap memory regions in use across the
    open ports.

At the moment there is no man page, but the libnetmap.h header file
has in-depth documentation.

Reviewed by:	hrs
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26171
2020-08-28 20:03:54 +00:00
Eric van Gyzen
609de97e04 vm_pageout_scan_active: ensure ps_delta is initialized
Reported by:	Coverity
Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26212
2020-08-28 19:59:02 +00:00
Eric van Gyzen
a2e194654f memstat_kvm_uma: fix reading of uma_zone_domain structures
Coverity flagged the scaling by sizeof(uzd).  That is the type
of the pointer, so the scaling was already done by pointer arithmetic.
However, this was also passing a stack frame pointer to kvm_read,
so it was doubly wrong.

Move ZDOM_GET into the !_KERNEL section and use it in libmemstat.

Reported by:	Coverity
Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26213
2020-08-28 19:50:40 +00:00
Hans Petter Selasky
2dea6902a9 Allow slow USB devices to be given more time to return their USB descriptors,
like Logitech HD Pro Webcam C920.

PR:		248926
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-08-28 19:21:11 +00:00
Matt Macy
6dfd7f4bc9 ZFS: add to arm64 NOTES to minimize potential for missing symbols 2020-08-28 19:02:05 +00:00
Matt Macy
ac0bf12ee5 ZFS: MFV 2.0-rc1-ga00c61 2020-08-28 18:53:45 +00:00
Matt Macy
93ddd0259d update vendor openzfs to a00c61 (2.0-rc1) 2020-08-28 18:41:28 +00:00
Emmanuel Vadot
341ccc993c arm: allwinner: clk: Add printfs when we cannot set the correct freq
For some unknown reason this seems to fix this function when we printf
the best variable. This isn't a delay problem as doing a printf without
it doesn't solve this problem.
This is way above my pay grade so add some printf that shouldn't be printed
in 99% of the case anyway.
Fix booting on most Allwinner boards as the mmc IP uses a NM clock.

Reported by:	Alexander Mishin <mishin@mh.net.ru>
MFC after:	3 days
X-MFC-With:	363887
2020-08-28 18:25:45 +00:00
Warner Losh
62693fe830 Treat the boot loader as the same as the kernel for what's visible
The boot loader will be growing some (limited) support for some kernel
interfaces for some of the timekeeping routines to support zstd code.
Allow the declarations for them to be visible when compiling for the
boot loader, rather than treating it like a user-space environment
(which stand.h already provides to a limited degree).
2020-08-28 17:55:54 +00:00
Warner Losh
0c35b86091 Allow the pseudo-errnos to be returned as well in boot loader
Expose the pseudo-errno values in _STANDALONE is defined so that code
in the boot loader can make use of them. Nothing uses them today, but
the zstd support that's coming will need them.
2020-08-28 17:49:56 +00:00
Warner Losh
f9553770c0 Create CFLAGS_EARLY.file for boot loader.
Some external code requires a specific set of include paths to work
properly since it emulates the typical environment the code is used
in. Enable this by creating a CFLAGS_EARLY.file variable that can be
used to build this stack. Otherwise the include stack we build for
stand programs may get in the way. Code that uses this feature has to
tolerate the normal stack of inclues being last on the list (and
presumably unused), though.

Generally, it it should only be used for the specific include
directories. Defines and that sort of thing should be done in the
normal CFLAGS variable. There is a global CFLAGS_EARY hook as well for
everything in a Makefile.
2020-08-28 17:36:14 +00:00
Matt Macy
fb702b4446 ZFS: clarify dependencies for static linking 2020-08-28 17:06:35 +00:00
Warner Losh
8383142cb1 Update outdated comment
There is no splnet anymore, so update the comment to drop references
to it.
2020-08-28 17:05:06 +00:00
Warner Losh
1f7705606e Remove splclock(). It's not useful to keep.
splclock is used in one driver (spkr) to control access to
timer_spkr_* routines.  However, nothing else does. So it shows no
useful locking info to someone that would want to lock spkr.

NOTE: I think there's races with timer_spkr_{acquire,release} since
there's no interlock in those routines, despite there being a spin
lock to protect the clock. Current other users appear to use no extra
locking protocol, though they themselves appear to be at least
attempting to make sure that only a single thread calls these
routines. I suspect the right answer is to update these routines to
take/release the clock spin lock since they are short and to the
point, but that's beyond the scope of this commit.
2020-08-28 16:40:33 +00:00
Jilles Tjoelker
1cffe8b812 sh: Keep ignored SIGINT/SIGQUIT after set in a background job
If job control is not enabled, a background job (... &) ignores SIGINT and
SIGQUIT, but this can be reverted using the trap builtin in the same shell
environment.

Using the set builtin to change options would also revert SIGINT and SIGQUIT
to their previous dispositions.

This broke due to r317298. Calling setsignal() reverts the effect of
ignoresig().

Reported by:	bdrewery
MFC after:	1 week
2020-08-28 15:35:45 +00:00
Warner Losh
27b293b022 remove splbio and splcam
splbio and splcan have been completely removed from the tree. We can
now remove their definitions here. They've been nops for a long time
and were only preserved to give hints on how to lock drivers. All
drivers have been deleted or converted, so they can be deleted now.
2020-08-28 15:09:43 +00:00
Warner Losh
b9c5b43263 Declare time()
Time is used and was accidentally brought in through header
pollution. Declare it in stand.h directly instead.
2020-08-28 05:40:02 +00:00
Glen Barber
233a5529d1 Add a new line to force a commit to verify if lwhsu did indeed
fix the jenkins build by adding git to the dependency list.

Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-08-28 02:09:10 +00:00
Rick Macklem
6e4b6ff88f Add flags to enable NFS over TLS to the NFS client and server.
An Internet Draft titled "Towards Remote Procedure Call Encryption By Default"
(soon to be an RFC I think) describes how Sun RPC is to use TLS with NFS
as a specific application case.
Various commits prepared the NFS code to use KERN_TLS, mainly enabling use
of ext_pgs mbufs for large RPC messages.
r364475 added TLS support to the kernel RPC.

This commit (which is the final one for kernel changes required to do
NFS over TLS) adds support for three export flags:
MNT_EXTLS - Requires a TLS connection.
MNT_EXTLSCERT - Requires a TLS connection where the client presents a valid
            X.509 certificate during TLS handshake.
MNT_EXTLSCERTUSER - Requires a TLS connection where the client presents a
            valid X.509 certificate with "user@domain" in the otherName
            field of the SubjectAltName during TLS handshake.
Without these export options, clients are permitted, but not required, to
use TLS.

For the client, a new nmount(2) option called "tls" makes the client do
a STARTTLS Null RPC and TLS handshake for all TCP connections used for the
mount. The CLSET_TLS client control option is used to indicate to the kernel RPC
that this should be done.

Unless the above export flags or "tls" option is used, semantics should
not change for the NFS client nor server.

For NFS over TLS to work, the userspace daemons rpctlscd(8) { for client }
or rpctlssd(8) daemon { for server } must be running.
2020-08-27 23:57:30 +00:00
Kirk McKusick
66ac5b2c5a Add a comment to clarify when and why cached names are deleted
during pathname lookup.

Reviewed by:  kib
MFC after:    3 days
Sponsored by: Netflix
2020-08-27 22:14:58 +00:00
Matt Macy
962619075c ZFS: remove duplicate "com.datto:encryption" from loader 2020-08-27 21:37:35 +00:00
Glen Barber
92fb4f8a61 Merge the projects/release-git branch to head.
This allows building 13.x from Git instead of Subversion.

No MFC to stable branches is planned at this time. [1]

Discussed with:	git working group [1]
Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-08-27 21:19:16 +00:00
Glen Barber
e25152834c MFH
Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-08-27 20:25:33 +00:00
Warner Losh
73be5dd2b2 Fix tiny style nit. 2020-08-27 17:46:13 +00:00
Mark Johnston
6255e8c8e2 Fix writing of the final block of encrypted, compressed kernel dumps.
Previously any residual data in the final block of a compressed kernel
dump would be written unencrypted.  Note, such a configuration already
does not work properly when using AES-CBC since the compressed data is
typically not a multiple of the AES block length in size and EKCD does
not implement any padding scheme.  However, EKCD more recently gained
support for using the ChaCha20 cipher, which being a stream cipher does
not have this problem.

Submitted by:	sigsys@gmail.com
Reviewed by:	cem
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26188
2020-08-27 17:36:06 +00:00
Warner Losh
d0fba0c58a Add note about NO_CLEAN build.
NO_CLEAN doesn't quite work for some scenarios when rebuilding older
kernels, but the kernels build w/o NO_CLEAN.
2020-08-27 17:30:57 +00:00
Jamie Gritton
0eb6603f6b Disregard jails in jail.conf that have bad parameters (parameter/variable
clash, or redefining name/jid).  The current behvaior, of merely warning
and moving on, can lead to unexpected behavior when a jail is created
without the offending parameter defined at all.
2020-08-27 17:04:55 +00:00
Mark Johnston
555e998919 snd_ich(4): Handle errors from ich_init() properly during resume.
ich_init() returns an errno value or 0, but ich_pci_resume() was
comparing the return value with -1 to determine whether an error had
occurred.

PR:		248941
Submitted by:	Tong Zhang <ztong0001@gmail.com>
MFC after:	1 week
2020-08-27 16:36:07 +00:00
Mark Johnston
b3cb04b930 fdc(4): Handle errors from fdc_in() properly.
fdc_in() returns only 0 and 1, some callers were checking incorrectly
for failure.

PR:		248940
Submitted by:	Tong Zhang <ztong0001@gmail.com>
MFC after:	1 week
2020-08-27 16:34:33 +00:00
Mark Johnston
9c325393d5 asmc(4): Handle errors from asmc_key_read() properly.
asmc_key_read() returns only 0 and 1, some callers were checking
incorrectly for failure.

PR:		248939
Submitted by:	Tong Zhang <ztong0001@gmail.com>
MFC after:	1 week
2020-08-27 16:34:20 +00:00
Glen Barber
884ea3e64c Correct the conditional evaluating if git exists.
Pointyhat to:	gjb (myself)
Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-08-27 14:36:00 +00:00
Cy Schubert
a784185078 /etc/zfs/zpool.cache is the preferred (and new) location of zpool.cache.
Check for it first. Only use /boot/zfs/zpool.cache if the /etc/zfs
version is not found and good.

Reported by:	avg
Suggested by:	avg, kevans
2020-08-27 14:33:46 +00:00
Glen Barber
eade353551 Do not unconditionally build git from ports if it already exists.
Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-08-27 14:29:06 +00:00
Glen Barber
6e7be14e7f Adjust the logic to locating GIT_CMD.
Use 'git -C' instead of cd(1). [1]

Suggested by:	garga [1]
Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-08-27 13:33:21 +00:00
Ryan Moeller
cd568e2b1b libzfs: Also add the crypto dependency to Makefile.inc1
Reported by:	kevans
Discussed with:	kevans
Sponsored by:	iXsystems, Inc.
2020-08-27 13:26:36 +00:00
Glen Barber
bee3d446c4 Fix passing OPTIONS_UNSET with multiple options to make(1).
While here, adjust the copyright.

Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-08-27 13:25:24 +00:00
Ryan Moeller
40d0fd2875 libzfs: Add missing crypto dependency
libzfs_crypto.c uses PKCS5_PBKDF2_HMAC_SHA1 from libcrypto.

Reported by:	John Kennedy
Sponsored by:	iXsystems, Inc.
2020-08-27 13:05:41 +00:00
Hans Petter Selasky
d96e599643 Implement extensible arrays API using the existing radix tree implementation
in the LinuxKPI.

Differential Revision:	https://reviews.freebsd.org/D25101
Reviewed by:	kib @
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-08-27 10:28:12 +00:00
Emmanuel Vadot
27998f7a02 arm: ti: Fix Beaglebone black MMC after DTS update
After DTS sync with Linux kernel 5.8 this patch was included:
"ARM: dts: Move am33xx and am43xx mmc nodes to sdhci-omap driver"
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/am33xx-l4.dtsi?h=v5.9-rc2&id=0b4edf111870b83ea77b1d7e16b8ceac29f9f388

Current will not load any driver for MMC and not mount the rootfs.
Simple patch add "ti,am335-sdhci" to compability strings in ti_sdhci.c

Submitted by:	oskar.holmlund@ohdata.se
Reported by:	phk
X-MFC-With:	363853
2020-08-27 08:08:49 +00:00
Mateusz Guzik
84ecea90b7 cache: don't update timestmaps on found entry 2020-08-27 06:31:55 +00:00
Mateusz Guzik
5f08d440b0 cache: assorted clean ups
In particular remove spurious comments, duplicate assertions and the
inconsistently done KTR support.
2020-08-27 06:31:27 +00:00
Mateusz Guzik
12441fcbe2 cache: ncp = NULL early to account for sdt probes in ailure path
CID:	1432106
2020-08-27 06:30:40 +00:00
Warner Losh
cbda6f66f4 Implement FLUSHO
Turn FLUSHO on/off with ^O (or whatever VDISCARD is). Honor that to
throw away output quickly. This tries to remain true to 4.4BSD
behavior (since that was the origin of this feature), with any
corrections NetBSD has done. Since the implemenations are a little
different, though, some edge conditions may be handled differently.

Reviewed by: kib, kevans
Differential Review: https://reviews.freebsd.org/D26148
2020-08-27 05:11:15 +00:00
Greg Lehey
23f93ed79b Update Hong Kong Liberation Day (hah!) 2020-08-27 03:50:34 +00:00
Jamie Gritton
bb4ec28922 Don't allow jail.conf variables to have the same names as jail parameters.
It was already not allowed in many cases, but crashed instead of giving an
error.

PR:		248444
2020-08-27 00:17:17 +00:00
John Baldwin
62cddd0e03 Name the on-stack union of compat thunks.
C does not permit an anonymous union at a top-level scope.

Pointy hat to:	jhb
2020-08-26 22:36:08 +00:00
Rick Macklem
df665abd34 Fix a "v_seqc_users == 0 not met" panic when VFS_STATFS() fails during mount.
r363210 introduced v_seqc_users to the vnodes.  This change requires
a vn_seqc_write_end() to match the vn_seqc_write_begin() in
vfs_cache_root_clear().
mjg@ provided this patch which seems to fix the panic.

Tested for an NFS mount where the VFS_STATFS() call will fail.

Submitted by:	mjg
Reviewed by:	mjg
Differential Revision:	https://reviews.freebsd.org/D26160
2020-08-26 21:49:43 +00:00
John Baldwin
113bcc82a2 Add freebsd32 compat support for CIOCCRYPTAEAD.
Reviewed by:	markj (earlier version)
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D26179
2020-08-26 21:28:47 +00:00