]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFC r352591: MFZoL: Retire send space estimation via ZFS_IOC_SEND
Andriy Gapon [Wed, 9 Oct 2019 09:40:03 +0000 (09:40 +0000)]
MFC r352591: MFZoL: Retire send space estimation via ZFS_IOC_SEND

Add a small wrapper around libzfs_core's lzc_send_space() to libzfs so
that every legacy ZFS_IOC_SEND consumer, along with their userland
counterpart estimate_ioctl(), can leverage ZFS_IOC_SEND_SPACE to
request send space estimation.

The legacy functionality in zfs_ioc_send() is left untouched for
compatibility purposes.

Obtained from: ZoL
Obtained from: zfsonlinux/zfs@cf7684bc8d57
Author: loli10K <ezomori.nozomu@gmail.com>

4 years agoNeed to use ${${_${group}DIR_${file}}} for STAGE_DIR
Simon J. Gerraty [Tue, 8 Oct 2019 20:14:33 +0000 (20:14 +0000)]
Need to use ${${_${group}DIR_${file}}} for STAGE_DIR

STAGE_DIR.${${_${group}DIR_${file}}:C,[/*],_,g} was getting
${STAGE_OBJTOP}BINDIR rather than
${STAGE_OBJTOP}${BINDIR} when FILESDIR=BINDIR

MFC of r352942

Reviewed by: stevek
Differential Revision: https://reviews.freebsd.org/D21858

4 years agoMFC r352919:
Brooks Davis [Tue, 8 Oct 2019 18:06:02 +0000 (18:06 +0000)]
MFC r352919:

Update cloudabi(32|64) sysents with "make sysent".

4 years agoMFC r352618:
Tijl Coosemans [Tue, 8 Oct 2019 10:24:48 +0000 (10:24 +0000)]
MFC r352618:

Create a "drm" subdirectory for drm devices in linsysfs.  Recent versions of
linux libdrm check for the existence of this directory:

https://cgit.freedesktop.org/mesa/drm/commit/?id=f8392583418aef5e27bfed9989aeb601e20cc96d

4 years agoMFC 351557: Adjust the deprecated warnings for /dev/crypto to be less noisy.
John Baldwin [Mon, 7 Oct 2019 20:41:55 +0000 (20:41 +0000)]
MFC 351557: Adjust the deprecated warnings for /dev/crypto to be less noisy.

Warn when actual operations are performed instead of when sessions are
created.  The /dev/crypto engine in OpenSSL 1.0.x tries to create
sessions for all possible algorithms each time it is initialized
resulting in spurious warnings.

4 years agoMFC r353010:
Mark Johnston [Mon, 7 Oct 2019 14:46:23 +0000 (14:46 +0000)]
MFC r353010:
Disallow fcntl(F_READAHEAD) when the vnode is not a regular file.

4 years agoMFC r352998:
Hans Petter Selasky [Mon, 7 Oct 2019 10:32:23 +0000 (10:32 +0000)]
MFC r352998:
Bump driver version for mlx5core, mlx5en(4) and mlx5ib(4).

Sponsored by: Mellanox Technologies

4 years agoMFC r352997:
Hans Petter Selasky [Mon, 7 Oct 2019 10:30:49 +0000 (10:30 +0000)]
MFC r352997:
Print numeric error_type and module_status in mlx5core
in case the strings are not available.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352996:
Hans Petter Selasky [Mon, 7 Oct 2019 10:29:30 +0000 (10:29 +0000)]
MFC r352996:
Add print to show user a reason for rejecting buffer size change in mlx5en(4).

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352995:
Hans Petter Selasky [Mon, 7 Oct 2019 10:27:50 +0000 (10:27 +0000)]
MFC r352995:
Only update lossy buffers config when manual PFC configuration was done
in mlx5en(4).

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352994:
Hans Petter Selasky [Mon, 7 Oct 2019 10:26:23 +0000 (10:26 +0000)]
MFC r352994:
Improve mlx5_fwdump_prep logging in mlx5core.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352993:
Hans Petter Selasky [Mon, 7 Oct 2019 10:25:08 +0000 (10:25 +0000)]
MFC r352993:
Randomize the delay when waiting for VSC flag in mlx5core.

The PRM suggests random 0 - 10ms to prevent multiple waiters on the same
interval in order to avoid starvation.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352992:
Hans Petter Selasky [Mon, 7 Oct 2019 10:23:27 +0000 (10:23 +0000)]
MFC r352992:
Use size_t for byte_to_write variable when comparing to eeprom_info_out_len
which is also size_t in mlx5tool(8).

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352991 and 353000:
Hans Petter Selasky [Mon, 7 Oct 2019 10:20:23 +0000 (10:20 +0000)]
MFC r352991 and 353000:
Wait for FW readiness before initializing command interface in mlx5core.

Before attempting to initialize the command interface we must wait till
the fw_initializing bit is clear.

If we fail to meet this condition the hardware will drop our
configuration, specifically the descriptors page address.  This scenario
can happen when the firmware is still executing an FLR flow and did not
finish yet so the driver needs to wait for that to finish.

Linux commits:
6c780a0267b8
b8a92577f4be.

Sponsored by: Mellanox Technologies

4 years agoMFC r352989:
Hans Petter Selasky [Mon, 7 Oct 2019 10:09:26 +0000 (10:09 +0000)]
MFC r352989:
Seal transmit path with regards to using destroyed mutex in mlx5en(4).

It may happen during link down that the running state may be observed
non-zero in the transmit routine, right before the running state is
cleared. This may end up using a destroyed mutex.

Make all channel mutexes and callouts persistant.

Preserve receive and send queue statistics during link toggle.

Sponsored by: Mellanox Technologies

4 years agoMFC r352988:
Hans Petter Selasky [Mon, 7 Oct 2019 09:57:57 +0000 (09:57 +0000)]
MFC r352988:
Remove unused cpu field from channel structure in mlx5en(4).

Sponsored by: Mellanox Technologies

4 years agoMFC r352987:
Hans Petter Selasky [Mon, 7 Oct 2019 09:55:13 +0000 (09:55 +0000)]
MFC r352987:
Remove mkey_be from channel structure in mlx5en(4).
Use value from priv structure instead.
This saves some space in the channel structure.

Sponsored by: Mellanox Technologies

4 years agoMFC r352986:
Hans Petter Selasky [Mon, 7 Oct 2019 09:53:12 +0000 (09:53 +0000)]
MFC r352986:
Return an error from ioctl(MLX5_FW_RESET) if reset was rejected in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352985:
Hans Petter Selasky [Mon, 7 Oct 2019 09:51:03 +0000 (09:51 +0000)]
MFC r352985:
Add sysctl(8) to get and set forward error correction, FEC, configuration
in mlx5en(4).

Sponsored by: Mellanox Technologies

4 years agoMFC r352984:
Hans Petter Selasky [Mon, 7 Oct 2019 09:48:20 +0000 (09:48 +0000)]
MFC r352984:
Add the ability to query the EEPROM information in mlx5tool(8).

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352983 and r353001:
Hans Petter Selasky [Mon, 7 Oct 2019 09:45:20 +0000 (09:45 +0000)]
MFC r352983 and r353001:
Move EEPROM information query from a sysctl in mlx5en(4) to an ioctl
in mlx5core. The EEPROM information is not only a property of the
mlx5en(4) driver.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352982:
Hans Petter Selasky [Mon, 7 Oct 2019 09:42:08 +0000 (09:42 +0000)]
MFC r352982:
Add support for buffer parameter manipulations in mlx5en(4).

The following sysctls are added:
dev.mce.N.conf.qos.cable_length
dev.mce.N.conf.qos.buffers_size
dev.mce.N.conf.qos.buffers_prio

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352981:
Hans Petter Selasky [Mon, 7 Oct 2019 09:39:05 +0000 (09:39 +0000)]
MFC r352981:
Import Linux code to query/set buffer state in mlx5en(4).

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352980:
Hans Petter Selasky [Mon, 7 Oct 2019 09:35:38 +0000 (09:35 +0000)]
MFC r352980:
Add mlx5e_dbg() compatibility macro.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352979:
Hans Petter Selasky [Mon, 7 Oct 2019 09:33:49 +0000 (09:33 +0000)]
MFC r352979:
Update definitons for PPTB and PBMC registers layouts in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352978:
Hans Petter Selasky [Mon, 7 Oct 2019 09:32:02 +0000 (09:32 +0000)]
MFC r352978:
Add definition for the Port Buffer Status Register in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352977:
Hans Petter Selasky [Mon, 7 Oct 2019 09:30:06 +0000 (09:30 +0000)]
MFC r352977:
Sort the ports registers definitions numerically in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352976:
Hans Petter Selasky [Mon, 7 Oct 2019 09:25:14 +0000 (09:25 +0000)]
MFC r352976:
Unify prints in mlx5en(4).

All prints in mlx5en(4) should use on of the macros:
mlx5_en_err/dbg/warn

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352975:
Hans Petter Selasky [Mon, 7 Oct 2019 09:19:46 +0000 (09:19 +0000)]
MFC r352975:
Unify prints in mlx5core.

All prints in mlx5core should use on of the macros:
mlx5_core_err/dbg/warn

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352974:
Hans Petter Selasky [Mon, 7 Oct 2019 09:18:09 +0000 (09:18 +0000)]
MFC r352974:
Add proper print in case of 0x0 health syndrome in mlx5core.

In case of health counter fails to increment it indicates a bad device health.
In case when the syndrome indicated by firmware is 0x0, this indicates that
firmware is unable to respond to initialization segment reads.
Add proper print in this case.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352973:
Hans Petter Selasky [Mon, 7 Oct 2019 09:16:43 +0000 (09:16 +0000)]
MFC r352973:
Add missing blank line at the end of the print in mlx5core.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352972:
Hans Petter Selasky [Mon, 7 Oct 2019 09:14:50 +0000 (09:14 +0000)]
MFC r352972:
Remove no longer needed fwdump register tables from mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352971:
Hans Petter Selasky [Mon, 7 Oct 2019 09:12:58 +0000 (09:12 +0000)]
MFC r352971:
Read rege map from crdump scan space in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352970:
Hans Petter Selasky [Mon, 7 Oct 2019 09:10:29 +0000 (09:10 +0000)]
MFC r352970:
Define MLX5_VSC_DOMAIN_SCAN_CRSPACE.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352969:
Hans Petter Selasky [Mon, 7 Oct 2019 09:08:33 +0000 (09:08 +0000)]
MFC r352969:
Use the MLX5_VSC_DOMAIN_SEMAPHORES constant instead of hand-rolled symbol
in mlx5core.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352968:
Hans Petter Selasky [Mon, 7 Oct 2019 09:06:37 +0000 (09:06 +0000)]
MFC r352968:
Move mlx5_ifc_vsc_space_bits and mlx5_ifc_vsc_addr_bits to mlx5_ifc.h.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352967:
Hans Petter Selasky [Mon, 7 Oct 2019 09:03:51 +0000 (09:03 +0000)]
MFC r352967:
Make the mlx5_vsc_wait_on_flag(9) function global.

Submitted by: kib@
Sponsored by: Mellanox Technologies

4 years agoMFC r352966:
Hans Petter Selasky [Mon, 7 Oct 2019 09:01:21 +0000 (09:01 +0000)]
MFC r352966:
Add port module event software counters in mlx5core.
While at it, fixup PME based on latest PRM defines.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352965:
Hans Petter Selasky [Mon, 7 Oct 2019 08:59:09 +0000 (08:59 +0000)]
MFC r352965:
Correct and update some counter names in mlx5en(4).

Sponsored by: Mellanox Technologies

4 years agoMFC r352964:
Hans Petter Selasky [Mon, 7 Oct 2019 08:50:22 +0000 (08:50 +0000)]
MFC r352964:
Export channel IRQ number as part of the "hw_ctx_debug" sysctl(8) in mlx5en(4).

Sponsored by: Mellanox Technologies

4 years agoMFC r352963:
Hans Petter Selasky [Mon, 7 Oct 2019 08:48:49 +0000 (08:48 +0000)]
MFC r352963:
Cleanup naming of IRQ vectors in mlx5en.
Remove unused IRQ naming functions and arrays.

Sponsored by: Mellanox Technologies

4 years agoMFC r352962:
Hans Petter Selasky [Mon, 7 Oct 2019 08:46:22 +0000 (08:46 +0000)]
MFC r352962:
Add support for Multi-Physical Function Switch, MPFS, in mlx5en.

MPFS is a logical switch in the Mellanox device which forward packets
based on a hardware driven L2 address table, to one or more physical-
or virtual- functions. The physical- or virtual- function is required
to tell the MPFS by using the MPFS firmware commands, which unicast
MAC addresses it is requesting from the physical port's traffic.
Broadcast and multicast traffic however, is copied to all listening
physical- and virtual- functions and does not need a rule in the MPFS
switching table.

Linux commit: eeb66cdb682678bfd1f02a4547e3649b38ffea7e
Sponsored by: Mellanox Technologies

4 years agoMFC r352961:
Hans Petter Selasky [Mon, 7 Oct 2019 08:44:29 +0000 (08:44 +0000)]
MFC r352961:
Implement macro for asserting priv lock in mlx5en.

Sponsored by: Mellanox Technologies

4 years agoMFC r352960:
Hans Petter Selasky [Mon, 7 Oct 2019 08:43:03 +0000 (08:43 +0000)]
MFC r352960:
Fix for missing cleanup code in error case in mlx5en.

Sponsored by: Mellanox Technologies

4 years agoMFC r352959:
Hans Petter Selasky [Mon, 7 Oct 2019 08:41:16 +0000 (08:41 +0000)]
MFC r352959:
Check return value of mlx5_vector2eqn() function in mlx5en.

Sponsored by: Mellanox Technologies

4 years agoMFC r352958:
Hans Petter Selasky [Mon, 7 Oct 2019 08:39:55 +0000 (08:39 +0000)]
MFC r352958:
Make sure the number of IRQ vectors doesn't exceed 256 in mlx5core.
The "intr" field in "struct mlx5_ifc_eqc_bits" is only 8 bits wide.

Sponsored by: Mellanox Technologies

4 years agoMFC r352957:
Hans Petter Selasky [Mon, 7 Oct 2019 08:38:32 +0000 (08:38 +0000)]
MFC r352957:
Update warning and error print formats in mlx5ib.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352956:
Hans Petter Selasky [Mon, 7 Oct 2019 08:35:48 +0000 (08:35 +0000)]
MFC r352956:
Fix reported max SGE calculation in mlx5ib.

Add the 512 bytes limit of RDMA READ and the size of remote address to the max
SGE calculation.

Submitted by: slavash@
Linux commit: 288c01b746aa
Sponsored by: Mellanox Technologies

4 years agoMFC r352955:
Hans Petter Selasky [Mon, 7 Oct 2019 08:31:31 +0000 (08:31 +0000)]
MFC r352955:
Make sure the transmit loop doesn't get starved in ipoib.

When the software send queue gets filled up, callbacks to
if_transmit will stop. Make sure the transmit callback
routine checks the send queue and outputs any remaining
mbufs. Else the remaining mbufs may simply sit in the
output queue blocking the transmit path.

Sponsored by: Mellanox Technologies

4 years agoMFC r352954:
Hans Petter Selasky [Mon, 7 Oct 2019 08:28:05 +0000 (08:28 +0000)]
MFC r352954:
Notify all sleeping threads of device removal in krping.
Implement d_purge for krping_cdevsw.

Submitted by: slavash@
Sponsored by: Mellanox Technologies

4 years agoMFC r352556:
Hans Petter Selasky [Mon, 7 Oct 2019 08:24:07 +0000 (08:24 +0000)]
MFC r352556:
Add quirk for XHCI(4) controllers to support USB control transfers
above 1Kbyte.  It might look like some XHCI(4) controllers do not
support when the USB control transfer is split using a link TRB. The
next NORMAL TRB after the link TRB is simply failing with XHCI error
code 4. The quirk ensures we allocate a 64Kbyte buffer so that the
data stage TRB is not broken with a link TRB.

Found at: EuroBSDcon 2019
Sponsored by: Mellanox Technologies

4 years agoMFC r352555:
Hans Petter Selasky [Mon, 7 Oct 2019 08:12:28 +0000 (08:12 +0000)]
MFC r352555:
Increase the maximum user-space buffer size from 256kBytes to 32MBytes for
libusb. This is useful for speeding up large data transfers while reducing
the interrupt rate.

Found at: EuroBSDcon 2019
Sponsored by: Mellanox Technologies

4 years agoMFC r352554:
Hans Petter Selasky [Mon, 7 Oct 2019 08:09:39 +0000 (08:09 +0000)]
MFC r352554:
The maximum TD size is 31 and not 15.

Found at: EuroBSDcon 2019
Sponsored by: Mellanox Technologies

4 years agoMFC r353116:
Cy Schubert [Mon, 7 Oct 2019 04:44:01 +0000 (04:44 +0000)]
MFC r353116:

Add missing definition in DEBUG code.

4 years agoMFC r353103: tuntap(4): loosen up tunclose restrictions
Kyle Evans [Mon, 7 Oct 2019 01:03:14 +0000 (01:03 +0000)]
MFC r353103: tuntap(4): loosen up tunclose restrictions

Realistically, this cannot work. We don't allow the tun to be opened twice,
so it must be done via fd passing, fork, dup, some mechanism like these.
Applications demonstrably do not enforce strict ordering when they're
handing off tun devices, so the parent closing before the child will easily
leave the tun/tap device in a bad state where it can't be destroyed and a
confused user because they did nothing wrong.

Concede that we can't leave the tun/tap device in this kind of state because
of software not playing the TUNSIFPID game, but it is still good to find and
fix this kind of thing to keep ifconfig(8) up-to-date and help ensure good
discipline in tun handling.

4 years agoMFC r352495,r352869: Adjust tests for page fault changes in r353102
Jilles Tjoelker [Sun, 6 Oct 2019 20:36:25 +0000 (20:36 +0000)]
MFC r352495,r352869: Adjust tests for page fault changes in r353102

PR: 211924

4 years agoMFC r348503, r351769: bsdgrep nits
Kyle Evans [Sun, 6 Oct 2019 04:12:08 +0000 (04:12 +0000)]
MFC r348503, r351769: bsdgrep nits

r348503:
grep: Move lone 'r'grep case into the adjacent switch

This 'r' case should have belonged to the switch in the first place, but
I had somehow missed the switch when initially adding the rgrep link. The
zgrep script later came along and faithfully left this case standing alone,
so we will now go ahead and join it.

Nearby comment also adjusted a tad bit for wording and style.

r351769:
bsdgrep(1): add some basic tests for some GNU Extension support

These will be expanded later as I come up with good test cases; for now,
these seem to be enough to trigger bugs in base gnugrep and expose missing
features in bsdgrep.

4 years agoMFC r352691: bsdgrep(1): fixes of empty pattern/exit code/-c behavior
Kyle Evans [Sun, 6 Oct 2019 04:10:28 +0000 (04:10 +0000)]
MFC r352691: bsdgrep(1): fixes of empty pattern/exit code/-c behavior

When an empty pattern is encountered in the pattern list, I had previously
broken bsdgrep to count that as a "match all" and ignore any other patterns
in the list. This commit rectifies that mistake, among others:

- The -v flag semantics were not quite right; lines matched should have been
  counted differently based on whether the -v flag was set or not. procline
  now definitively returns whether it's matched or not, and interpreting
  that result has been kicked up a level.
- Empty patterns with the -x flag was broken similarly to empty patterns
  with the -w flag. The former is a whole-line match and should be more
  strict, only matching blank lines. No -x and no -w will will match the
  empty string at the beginning of each line.
- The exit code with -L was broken, w.r.t. modern grep. Modern grap will
  exit(0) if any file that didn't match was output, so our interpretation
  was simply backwards. The new interpretation makes sense to me.

Tests updated and added to try and catch some of this.

This misbehavior was found by autoconf while fixing ports found in PR 229925
expecting either a more sane or a more GNU-like sed.

4 years agoMFC r352559: loader: Respect loader_color=YES for serial consoles
Kyle Evans [Sun, 6 Oct 2019 04:02:29 +0000 (04:02 +0000)]
MFC r352559: loader: Respect loader_color=YES for serial consoles

It's not uncommon these days for the terminals attached to serial consoles
to support ANSI escape sequences. However, we assume escape sequences may
break some serial consoles and default to not using them when boot_serial or
boot_multicons (or if console contains "comconsole" in the forth loader) for
broader compatibility. We also have loader_color which can be explicitly set
to "NO" to disable the use of ANSI escape sequences.

The problem is that loader_color=YES gets ignored when boot_serial=YES or
boot_multicons=YES (or when console contains "comconsole" in the forth
loader).

To fix, the existing default behavior remains unchanged when loader_color is
unset, loader_color=NO explicitly disables the use of ANSI escape sequences
still, and the change is that loader_color=YES can now be used to explicitly
allow ANSI escapes when a serial console is enabled.

4 years agoMFC r352314: lualoader: Add reload-conf loader command
Kyle Evans [Sun, 6 Oct 2019 04:01:15 +0000 (04:01 +0000)]
MFC r352314: lualoader: Add reload-conf loader command

This command will trigger a reload of the configuration from disk. This is
useful if you've changed currdev from recovery media to local disk as much
as I have over the past ~2 hours and are tired of the extra keystrokes.

This is really just a glorified shortcut, but reload-conf is likely easier
to remember for other people and does save some keystrokes when reloading
the configuration. It is also resilient to the underlying config method
changing interface, but this is unlikely to happen.

4 years agoMFC r353009: libusb: LIBUSB_DEBUG env var override of libusb_set_debug
Kyle Evans [Sun, 6 Oct 2019 03:59:05 +0000 (03:59 +0000)]
MFC r353009: libusb: LIBUSB_DEBUG env var override of libusb_set_debug

The debug level generally just controls verbosity of libusb for debugging
libusb devices/usage. We allow the environment to set the debug level
independent of the application, but the application will always override
this if it explicitly sets the debug level.

Changing the environment is easy, but patching the software to change the
debug level isn't necessarily easy or possible. Further, there's this
write-only debug_fixed variable that would seem to imply that the debug
level should be fixed, but it isn't currently used. Change the logic to use
strtol() so we can detect real 0 vs. conversion failure, then honor
debug_fixed in libusb_set_debug.

4 years agoMFC r352668: cron: log suppression and mail suppression for successful runs
Kyle Evans [Sun, 6 Oct 2019 03:56:02 +0000 (03:56 +0000)]
MFC r352668: cron: log suppression and mail suppression for successful runs

This commit adds two new extensions to crontab, ported from OpenBSD:
- -n: suppress mail on succesful run
- -q: suppress logging of command execution

The -q option appears decades old, but -n is relatively new. The
original proposal by Job Snijder can be found here [1], and gives very
convincing reasons for inclusion in base.

This patch is a nearly identical port of OpenBSD cron for -q and -n
features. It is written to follow existing conventions and style of the
existing codebase.

Example usage:

# should only send email, but won't show up in log
* * * * * -q date

# should not send email
* * * * * -n date

# should not send email or log
* * * * * -n -q date

# should send email because of ping failure
* * * * * -n -q ping -c 1 5.5.5.5

[1]: https://marc.info/?l=openbsd-tech&m=152874866117948&w=2

PR: 237538
Relnotes: yes

4 years agoMFC r352841
Vincenzo Maffione [Sat, 5 Oct 2019 10:59:41 +0000 (10:59 +0000)]
MFC r352841

bhyve: support for enabling/disabling the net backend

Extend the net backend interface with two functions, namely netbe_rx_disable()
and netbe_rx_enable(), which can be used by the net device emulators to stop
the backend from invoking the receive callback. This is useful for device
emulators, i.e., on hardware resets or to implement receive backpressure.
The mevent module has been extendede to support the addition of a disabled
event. To prevent race conditions, the net backends will start with receive
operation disabled. A follow-up patch will use the new functionalities in
the virtio-net device.

Reviewed by:    jhb, markj
Differential Revision: https://reviews.freebsd.org/D20973

4 years agoMFC r352826:
Mark Johnston [Fri, 4 Oct 2019 15:27:10 +0000 (15:27 +0000)]
MFC r352826:
Implement pmap_page_is_mapped() correctly on arm64 and riscv.

4 years agoMFC r352823:
Mark Johnston [Fri, 4 Oct 2019 15:24:16 +0000 (15:24 +0000)]
MFC r352823:
Correct the scope of several global variables.

4 years agoMFC r352807:
Konstantin Belousov [Fri, 4 Oct 2019 12:18:03 +0000 (12:18 +0000)]
MFC r352807:
Improve MD page fault handlers.

PR: 211924

4 years agoMFC r352786:
Cy Schubert [Fri, 4 Oct 2019 02:11:45 +0000 (02:11 +0000)]
MFC r352786:

Implement the dynamic add (-A) and removal (-R) of ippool pools
from the command line. Prior to this the functionality was mostly there
however since the pool type (-t) was not recognized by the -A and -R
command options -- not recognized by getopt(). Additionally the code to
implement the dynamic add and removal of pools didn't work.

When dynamically adding (-A) a pool a type (-t) to specify if the pool
is a tree or hash pool must  be specified. When dynamically removing (-R)
a pool, omitting -t will cause a search-and-destroy which will remove
both types of pools matching the name given (-m).

PR: 218433

4 years agoMFC r352785:
Cy Schubert [Fri, 4 Oct 2019 02:09:51 +0000 (02:09 +0000)]
MFC r352785:

The no resolve (OPT_NORESOLVE) does nothing. Additionally, it (-R)
conflicts with the command option of the same name (also -R).
Remove the superfluous and confusing non-global non-command -R option.

PR: 218433

4 years agoMFC r352918:
Brooks Davis [Thu, 3 Oct 2019 20:09:50 +0000 (20:09 +0000)]
MFC r352918:

Regen after r347228 and r352693.

No functional change.

4 years agoMFC r352917:
Brooks Davis [Thu, 3 Oct 2019 18:50:57 +0000 (18:50 +0000)]
MFC r352917:

Restore the ability to set capenabled directly in syscalls.conf.

This fixes generation of cloudabi syscall tables broken in r340424.

Reviewed by: kevans, emaste
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21821

4 years agoMFC r352220:
Brooks Davis [Thu, 3 Oct 2019 17:41:20 +0000 (17:41 +0000)]
MFC r352220:

Avoid the use of the non-portable -D argument to ls.

This was used to store the mtime of the source file in a commment in a
generated header file.  This is of little-to-no diagnostic value and
the result doesn't even end up in the source tree.

Reported by: arichardson
Reviewed by: arichardson
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21605

4 years agoMFC r352906:
Mark Johnston [Thu, 3 Oct 2019 14:55:07 +0000 (14:55 +0000)]
MFC r352906:
Add IFLIB_SINGLE_IRQ_RX_ONLY.

PR: 239118

4 years agoMFC r352748:
Mark Johnston [Thu, 3 Oct 2019 14:54:26 +0000 (14:54 +0000)]
MFC r352748:
Fix handling of invalid pages in exec_map_first_page().

4 years agoMFC r353004, r353012:
Glen Barber [Thu, 3 Oct 2019 14:39:15 +0000 (14:39 +0000)]
MFC r353004, r353012:
 r353004:
  Explicitly add opensolaris_load="YES" to loader.conf through the
  installer when installing the system on a ZFS root filesystem.

  For arm64, zfs_load="YES" does not add opensolaris.ko as a kld
  dependency, so add it explicitly to prevent boot-time failures
  out-of-box.

 r353012:
  Add a comment explaining why the opensolaris_load line in loader.conf
  is explicitly added.

PR: 240478
Approved by: re (kib, early MFC)
Sponsored by: Rubicon Communications, LLC (Netgate)

4 years agoMFC r352742: bspatch: add integer overflow checks
Ed Maste [Thu, 3 Oct 2019 13:02:04 +0000 (13:02 +0000)]
MFC r352742: bspatch: add integer overflow checks

Introduce a new add_off_t static function that exits with an error
message if there's an overflow, otherwise returns their sum.  Use this
when adding values obtained from the input patch.

Sponsored by: The FreeBSD Foundation

4 years agoMFC r352863: fdt_slicer: bump to SI_ORDER_THIRD following r347183
Kyle Evans [Thu, 3 Oct 2019 12:47:05 +0000 (12:47 +0000)]
MFC r352863: fdt_slicer: bump to SI_ORDER_THIRD following r347183

r347183 bumped GEOM classes to SI_ORDER_SECOND to resolve a race between
them and the initialization of devsoftc.mtx in devinit, but missed this
dependency on g_flashmap that may now lose the race against GEOM
classes/g_init.

There's a great comment that describes the situation that has also been
updated with the new ordering of GEOM classes.

4 years agoMFC r352894:
Michael Tuexen [Thu, 3 Oct 2019 10:46:09 +0000 (10:46 +0000)]
MFC r352894:

Don't use stack memory which is not initialized.
Thanks to Mark Wodrich for reporting this issue for the userland stack in
https://github.com/sctplab/usrsctp/issues/380
This issue was also found for usrsctp by OSS-fuzz in
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17778

4 years agoMFC r352868:
Michael Tuexen [Thu, 3 Oct 2019 10:44:09 +0000 (10:44 +0000)]
MFC r352868:

RFC 7112 requires a host to put the complete IP header chain
including the TCP header in the first IP packet.
Enforce this in tcp_output(). In addition make sure that at least
one byte payload fits in the TCP segement to allow making progress.
Without this check, a kernel with INVARIANTS will panic.
This issue was found by running an instance of syzkaller.

Manually resolved a conflict, since we don't have BBR in stable/12.

Reviewed by: jtl@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D21665

4 years agoMFC r352652:
Michael Tuexen [Thu, 3 Oct 2019 10:37:53 +0000 (10:37 +0000)]
MFC r352652:

Plumb a memory leak.
Thnanks to Felix Weinrank for finding this issue using fuzz testing
and reporting it for the userland stack:
https://github.com/sctplab/usrsctp/issues/378

4 years agoMFC r352796:
Andrew Turner [Thu, 3 Oct 2019 07:17:26 +0000 (07:17 +0000)]
MFC r352796:

Check the vfs option length is valid before accessing through

When a VFS option passed to nmount is present but NULL the kernel will
place an empty option in its internal list. This will have a NULL
pointer and a length of 0. When we come to read one of these the kernel
will try to load from the last address of virtual memory. This is
normally invalid so will fault resulting in a kernel panic.

Fix this by checking if the length is valid before dereferencing.

Sponsored by: DARPA, AFRL

4 years agoMFC r352915:
Dimitry Andric [Thu, 3 Oct 2019 06:08:04 +0000 (06:08 +0000)]
MFC r352915:

Pull in r357528 from upstream llvm trunk (by Craig Topper):

  [X86] Check MI.isConvertibleTo3Addr() before calling
  convertToThreeAddress in X86FixupLEAs.

  X86FixupLEAs just assumes convertToThreeAddress will return nullptr
  for any instruction that isn't convertible.

  But the code in convertToThreeAddress for X86 assumes that any
  instruction coming in has at least 2 operands and that the second one
  is a register. But those properties aren't guaranteed of all
  instructions. We should check the instruction property first.

Pull in r365720 from upstream llvm trunk (by Craig Topper):

  [X86] Don't convert 8 or 16 bit ADDs to LEAs on Atom in FixupLEAPass.

  We use the functions that convert to three address to do the
  conversion, but changing an 8 or 16 bit will cause it to create a
  virtual register. This can't be done after register allocation where
  this pass runs.

  I've switched the pass completely to a white list of instructions
  that can be converted to LEA instead of a blacklist that was
  incorrect. This will avoid surprises if we enhance the three address
  conversion function to include additional instructions in the future.

  Fixes PR42565.

This should fix assertions/segfaults when compiling certain ports with
CPUTYPE=atom.

PR: 240928

4 years agoMFC r352684:
Konstantin Belousov [Wed, 2 Oct 2019 13:43:24 +0000 (13:43 +0000)]
MFC r352684:
x86: Fall back to leaf 0x16 if TSC frequency is obtained by CPUID and
leaf 0x15 is not functional.

4 years agoMFC of 352453
Kirk McKusick [Tue, 1 Oct 2019 23:26:52 +0000 (23:26 +0000)]
MFC of 352453

Check bread_gb() return value in cluster_collectbufs() code.

4 years agoMFC r352580: Fix a regression introduced in r344601 for zfs send
Sean Eric Fagan [Tue, 1 Oct 2019 03:35:54 +0000 (03:35 +0000)]
MFC r352580: Fix a regression introduced in r344601 for zfs send

4 years agoMFC r352656: ix/ixv: Read MSI-X bar from device config
Eric Joyner [Mon, 30 Sep 2019 17:36:49 +0000 (17:36 +0000)]
MFC r352656: ix/ixv: Read MSI-X bar from device config

This fixes an issue with some HP-branded Intel 10G cards not being able to use
MSI-X.

Sponsored by: Intel Corporation

4 years agoMFC r352655: iflib: Remove redundant VLAN events deregistration
Eric Joyner [Mon, 30 Sep 2019 17:34:25 +0000 (17:34 +0000)]
MFC r352655: iflib: Remove redundant VLAN events deregistration

This fixes a kernel panic that can occur when unloading an iflib-using driver.

Sponsored by: Intel Corporation

4 years agoMFC r352505: vt: fix problems with trying to switch to a closed VT
Andriy Gapon [Mon, 30 Sep 2019 13:33:37 +0000 (13:33 +0000)]
MFC r352505: vt: fix problems with trying to switch to a closed VT

4 years agoMFC r352620:
Konstantin Belousov [Mon, 30 Sep 2019 07:42:07 +0000 (07:42 +0000)]
MFC r352620:
Fix destruction of the robust mutexes.

4 years agoMFC r351325:
Xin LI [Mon, 30 Sep 2019 07:27:07 +0000 (07:27 +0000)]
MFC r351325:

r351325: Fix sound on headset jack for ThinkPad T51.

4 years agoMFC r351417: r351417: INVARIANTS: treat LA_LOCKED as the same of LA_XLOCKED
Xin LI [Mon, 30 Sep 2019 06:38:34 +0000 (06:38 +0000)]
MFC r351417: r351417: INVARIANTS: treat LA_LOCKED as the same of LA_XLOCKED
in mtx_assert.

4 years agoMFC r352804:
Dimitry Andric [Mon, 30 Sep 2019 06:09:32 +0000 (06:09 +0000)]
MFC r352804:

Correct the final argument name in the top(1) manpage.

The description talks about 'number', while the final argument was
'count'.  Since 'count' is already used for the count of displays,
change the final argument name to 'number'.

MFC r352818:

Make fractional delays for top(1) work for interactive mode.

In r334906, the -s option was changed to allow fractional times, but
this only functioned correctly for batch mode.  In interactive mode, any
delay below 1.0 would get floored to zero.  This would put top(1) into a
tight loop, which could be difficult to interrupt.

Fix this by storing the -s option value (after validation) into a struct
timeval, and using that struct consistently for delaying with select(2).

Next up is to allow interactive entry of a fractional delay value.

MFC r352819:

Allow entering fractional delays in top(1) interactive mode.

This uses the same logic as with the -s option, first validating the
entered value, then storing the result in a struct timeval.

4 years agoMFC r351501: MFV r351500: Fix CLEAR_HASH macro to be usable as a single
Xin LI [Mon, 30 Sep 2019 06:04:22 +0000 (06:04 +0000)]
MFC r351501: MFV r351500: Fix CLEAR_HASH macro to be usable as a single
statement.

4 years agoMFC r351382:
Xin LI [Mon, 30 Sep 2019 05:43:57 +0000 (05:43 +0000)]
MFC r351382:

When creating a new FAT32 filesystem, use "unknown" (0xFFFFFFFF) for
FSI_Nxt_Free instead of providing a wrong value.

With this change, fsck_msdosfs would no longer complain about invalid
FSInfo information.

4 years agoMFC r352783:
Cy Schubert [Mon, 30 Sep 2019 02:32:51 +0000 (02:32 +0000)]
MFC r352783:

Fix a typo.

4 years agoMFC r351828:
Warner Losh [Mon, 30 Sep 2019 01:59:27 +0000 (01:59 +0000)]
MFC r351828:

  Support doorbell strides != 0.

4 years agoMFC r352627:
Mark Johnston [Mon, 30 Sep 2019 01:25:37 +0000 (01:25 +0000)]
MFC r352627:
Implement x86 dtrace_invop_(un)init() in C.

4 years agoMFC r352624:
Mark Johnston [Mon, 30 Sep 2019 01:25:14 +0000 (01:25 +0000)]
MFC r352624:
Set NX on some non-leaf direct map page table entries.

4 years agoMFC r352626:
Mark Johnston [Mon, 30 Sep 2019 01:24:44 +0000 (01:24 +0000)]
MFC r352626:
Fix a harmless typo.

4 years agoMFC r349225:
Li-Wen Hsu [Mon, 30 Sep 2019 00:01:54 +0000 (00:01 +0000)]
MFC r349225:

Finsh readding Big5 in r317204, which was reverting r315568.  This commit
reverts r315569.

Reported by: Ting-Wei Lan <lantw44 gmail com>
Discussed with: kevlo
Sponsored by: The FreeBSD Foundation

4 years agoMFC r351728, r352581 (by kib), r352606 (by kib):
Mark Johnston [Sun, 29 Sep 2019 22:41:06 +0000 (22:41 +0000)]
MFC r351728, r352581 (by kib), r352606 (by kib):
Add a sysctl to dump kernel mappings and their properties on amd64.