]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r346571,r346572:
ngie [Mon, 29 Apr 2019 19:36:46 +0000 (19:36 +0000)]
MFC r346571,r346572:

Update the spelling of my name

Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji
instead for clarity.

While here, remove "All Rights Reserved" from copyrights I "own".

5 years agoMFC r345723:
ngie [Mon, 29 Apr 2019 19:35:34 +0000 (19:35 +0000)]
MFC r345723:

PROG_OVERRIDE_VARS should override default values if specified

The behavior prior to this change would not override default values if set in
`bsd.own.mk`, or (in the more general case) globally before `bsd.progs.mk` was
included. This affected `bsd.test.mk` as well, since it consumes
`bsd.progs.mk`.

Some examples of this failing behavior are as follows:

* `BINMODE` defaults to 0555 per `bsd.own.mk`. If someone wanted to set the
  `BINMODE` to `NOBINMODE` (0444) for `prog`, for example, like
  `BINMODE.prog= ${NOBINMODE}`, `bsd.progs.mk` would not honor the per-PROG
  setting.
* An application, `prog`, does not build at `WARNS?= 6`. Before this change,
  setting to a lower `WARNS` value, e.g., `WARNS.prog= 3`, would have been
  impossible, requiring that `prog` be built from another directory,
  the global `WARNS` be lowered, or a per-PROG value needing to be set
  across the board. None of the above workarounds is desirable.

This change unbreaks variables defined in `PROG_OVERRIDE_VARS` which have
defaults set before `bsd.progs.mk` is included, by setting them to their
defined values if set on a per-PROG basis.

5 years agoMFC r338940:
np [Mon, 29 Apr 2019 19:25:06 +0000 (19:25 +0000)]
MFC r338940:

cxgbe(4): Treat base/end of firmware parameters as signed integers when
figuring out whether the range is valid or not.

5 years agoMFC r338874:
np [Mon, 29 Apr 2019 19:23:27 +0000 (19:23 +0000)]
MFC r338874:

cxgbe(4): Reuse existing "switching" L2T entries when possible.

5 years agoMFC r338669:
np [Mon, 29 Apr 2019 19:16:29 +0000 (19:16 +0000)]
MFC r338669:

cxgbe(4): Use the correct number of parameters when querying the tid
range for hashfilters.

5 years agoMFC r338355:
np [Mon, 29 Apr 2019 19:15:50 +0000 (19:15 +0000)]
MFC r338355:

cxgbe/tom: Unregister shared CPL handlers on module unload.  This fixes
a panic with INVARIANTS that occurs when t4_tom is unloaded and reloaded.

5 years agoMFC r346539:
ngie [Mon, 29 Apr 2019 19:11:56 +0000 (19:11 +0000)]
MFC r346539:

Fix `get_int_via_sysctlbyname(..)` on Jenkins

Initialize `oldlen` to the size of the value, instead of leaving the value
unitialized. Leaving it unitialized seems to work by accident on amd64 when
running 64-bit programs, but not on i386.

This matches patterns in use in other programs.

PR: 237458
Tested on: ^/head (amd64), ^/stable/11 (i386)

5 years agoMFC r346113:
oshogbo [Mon, 29 Apr 2019 18:55:49 +0000 (18:55 +0000)]
MFC r346113:
 libnv: fix compilation warnings

 When building libnv without a debug those arguments are no longer used
 because assertions will be changed to NOP.

 Submitted by: Mindaugas Rasiukevicius <rmind@netbsd.org>

5 years agoMFC r346112:
oshogbo [Mon, 29 Apr 2019 18:52:04 +0000 (18:52 +0000)]
MFC r346112:
  libnv: fix compilation warnings

  When building libnv without a debug those arguments are no longer used
  because assertions will be changed to NOP.

  Submitted by: Mindaugas Rasiukevicius <rmind@netbsd.org>

MFC r346115:
  The nvlist_report_missing is also used by the cnvlist.
  It can't be a static one.

  Reported by:  jenkins

5 years agoMFC ar: implement support for /SYM64/ 64-bit archives
emaste [Mon, 29 Apr 2019 18:37:39 +0000 (18:37 +0000)]
MFC ar: implement support for /SYM64/ 64-bit archives

r346079: ar: implement support for /SYM64/ 64-bit archives

Submitted by: Gerald Aryeetey <aryeeteygerald_rogers.com>
Reviewed by: imp (earlier)

r346568: ar: test for writing 64-bit format only if symbol count is nonzero

This is a minor simplification; if we do not have any symbols the empty
symbol table can be in 32-bit format.

r346569: ar: use array notation to access s_so

This is somewhat more readable than pointer arithmetic.  Also remove an
unnecessary cast while here.

r346582: ar: shuffle symbol offsets during conversion for 32-bit ar archives

During processing we maintain symbol offsets in the 64-bit s_so array,
and when writing the archive convert to 32-bit if no offsets are greater
than 4GB.  However, this was somewhat inefficient as we looped over the
array twice: first, converting to big endian and second, writing each
32-bit value one at a time (and incorrectly so on big-endian platforms).

Instead, when writing a 32-bit archive shuffle convert symbol data to
big endian (as required by the ar format) and shuffle to the beginning
of the allocation at the same time.

Also correct emission of the symbol count on big endian platforms.

Further changes are planned, but this should fix powerpc64.

Reported by: jhibbits, mlinimon
Reviewed by: jhibbits, Gerald Aryeetey (earlier)
Tested by: jhibbits

PR: 234454
Sponsored by: The FreeBSD Foundation

5 years agoMFC r339648: ar: report errno on warning/error
emaste [Mon, 29 Apr 2019 18:28:34 +0000 (18:28 +0000)]
MFC r339648:     ar: report errno on warning/error

Previously ar would report an error like "ar: fatal: Write error"
without including additional errno information.  Change warnings and
errors to include archive_errno() so that the user may have some idea
of the reason for the failure.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r346016:
mhorne [Mon, 29 Apr 2019 16:14:24 +0000 (16:14 +0000)]
MFC r346016:
Add option to build LLVM RISC-V target

Approved by: markj (mentor)

5 years agoMFC r346544:
markj [Mon, 29 Apr 2019 13:20:55 +0000 (13:20 +0000)]
MFC r346544:
Clarify the relationship between INVARIANTS and DIAGNOSTIC a bit.

5 years agoMFC r338218:
np [Mon, 29 Apr 2019 05:35:52 +0000 (05:35 +0000)]
MFC r338218:

cxgbev(4): Updates to the VF driver to cope with recent ifmedia and
ctrlq changes in the base driver.

Sponsored by: Chelsio Communications

5 years agoMFC r338156, r338158-r338161, r338166.
np [Mon, 29 Apr 2019 05:26:27 +0000 (05:26 +0000)]
MFC r338156, r338158-r338161, r338166.

r338156:
cxgbe(4): Avoid overflow while calculating channel rate.

Reported by: Coverity (CID 1008352)

r338158:
cxgbe(4): Check the RO bit properly before disabling relaxed ordering.

Reported by: Coverity (CID 1384286)

r338159:
cxgbe(4): Make it clear that VI_INIT_DONE implies vi->ntxq > 0, and so
rc will never be returned uninitialized.

Reported by: Coverity (CID 1394884).  This is a false positive though.

r338160:
cxgbe(4): Do not leak memory in case of errors during VI initialization.

Reported by: Coverity (CID 1392026)

r338161:
cxgbe/tom: Make sure 'matched' is always initialized before use.

Reported by: Coverity (CID 1390894)

r338166:
cxgbe(4): Be explicit about ignoring the return value of cmpset in some
cases.

Reported by: Coverity (CIDs 10093981009400100940113573251394783).  All false positives.

5 years agoMFC r337873:
np [Mon, 29 Apr 2019 05:01:34 +0000 (05:01 +0000)]
MFC r337873:

cxgbe(4): Use VLAN_TRUNKDEV instead of private cookie to figure out the
parent of a VLAN ifnet.

Sponsored by: Chelsio Communications

5 years agoMFC r337830:
np [Mon, 29 Apr 2019 04:51:30 +0000 (04:51 +0000)]
MFC r337830:

cxgbe(4): Use two hashes instead of a table to keep track of
hashfilters.  Two because the driver needs to look up a hashfilter by
its 4-tuple or tid.

A couple of fixes while here:
- Reject attempts to add duplicate hashfilters.
- Do not assume that any part of the 4-tuple that isn't specified is 0.
  This makes it consistent with all other mandatory parameters that
  already require explicit user input.

5 years agoMFC r337659:
np [Mon, 29 Apr 2019 04:42:18 +0000 (04:42 +0000)]
MFC r337659:

cxgbe(4): Move all control queues to the adapter.

There used to be one control queue per adapter (the mgmtq) that was
initialized during adapter init and one per port that was initialized
later during port init.  This change moves all the control queues (one
per port/channel) to the adapter so that they are initialized during
adapter init and are available before any port is up.  This allows the
driver to issue ctrlq work requests over any channel without having to
bring up any port.

5 years agoMFC r337609:
np [Mon, 29 Apr 2019 04:31:27 +0000 (04:31 +0000)]
MFC r337609:

cxgbe(4): Create two variants of service_iq, one for queues with
freelists and one for those without.

MFH: 3 weeks
Sponsored by: Chelsio Communications

5 years agoMFC r337538, r337987
np [Mon, 29 Apr 2019 03:52:03 +0000 (03:52 +0000)]
MFC r337538, r337987

r337538:
cxgbe(4): Add support for high priority filters on T6+.  They have their
own region in the TCAM starting with T6, unlike previous chips where
they were in the same region as normal filters.

These filters "hit" before anything else in the LE's lookup.  The exact
order is:
a) High priority filters
b) TOE's active region (TCAM and/or hash)
c) Servers (TOE hw listeners)
d) Normal filters

Sponsored by: Chelsio Communications

r337987:
cxgbe(4):  Adjust ntids to account for nhptids in the TOE case too.
This should have been part of r337538.

5 years agoMFC r337192:
np [Mon, 29 Apr 2019 03:31:20 +0000 (03:31 +0000)]
MFC r337192:

cxgbe(4): Improvements in TID management.

- Ignore any type of TID where the start/end values are not in the
  correct order.  There are situations where the firmware isn't able to
  reserve room for the number requested in the config file but doesn't
  report a failure during configuration and instead sets end <= start.

- Track start/end in tid_tab and remove some redundant copies from
  adapter->params.

- Move all the start/end and other read-only parameters to a quiet part
  of tid_tab, away from the tid locks.

Sponsored by: Chelsio Communications

5 years agoMFC r336718, r336720, r336734-r336735, r337398, r337439, and r337540.
np [Mon, 29 Apr 2019 03:10:58 +0000 (03:10 +0000)]
MFC r336718, r336720, r336734-r336735, r337398, r337439, and r337540.
These are all related to tx rate limiting in cxgbe.

r336718:
cxgbe(4): Validate only those parameters that are relevant to the
type of rate limiter being programmed.  Skip the ones that are not
applicable.

Sponsored by: Chelsio Communications

r336720:
cxgbe(4): Remove useless code that crept in with r336718.

X-MFC With: 336718

r336734:
cxgbe(4): Better defaults for all cl-rl rate limiters.

Start in "class" instead of "flow" mode.  This eliminates the need to
specify an MTU, which is not available that early anyway.  It also
allows the user to manually configure ch-rl rate limiting after attach.
This used to fail because ch-rl isn't supported if cl-rl "flow" mode is
configured.

Set all traffic classes to 1Gbps during initialization.  The goal is to
start off with _any_ valid configuration and 1Gbps works even for
gigabit cards.

Sponsored by: Chelsio Communications

r336735:
cxgbe(4): Consider rateunit before ratemode when displaying information
about a traffic class.  This matches the order in which the firmware
evaluates unit and mode internally.

Sponsored by: Chelsio Communications

r337398:
cxgbe(4): Allow user-configured and driver-configured traffic classes to
be used simultaneously.  Move sysctl_tc and sysctl_tc_params to
t4_sched.c while here.

Sponsored by: Chelsio Communications

r337439:
cxgbe(4): Allow the driver to specify a burst size when configuring a
traffic class for rate limiting.

Add experimental knobs that allow the user to specify a default pktsize
and burstsize for traffic classes associated with a port:

dev.<ifname>.<instance>.tc.pktsize
dev.<ifname>.<instance>.tc.burstsize

Sponsored by: Chelsio Communications

r337540:
cxgbe(4): Display pkt-size and burst-size in traffic class parameters.

5 years agoMFC r337397:
np [Mon, 29 Apr 2019 02:38:51 +0000 (02:38 +0000)]
MFC r337397:

cxgbe(4): Break up sysctl_bitfield into 8 bit and 16 bit variants.  Have
them display the current value of the bitfield rather than the fixed
value that was provided when the sysctl node was created.

Sponsored by: Chelsio Communications

5 years agoMFC r335223:
np [Mon, 29 Apr 2019 02:30:06 +0000 (02:30 +0000)]
MFC r335223:

cxgbe(4): sysctls to display the local and intr CPUs for the adapter.

The driver assumes the list can change (even though it does't right now)
and queries it every time the sysctl runs.

sysctl dev.<nexus>.<inst>.local_cpus
sysctl dev.<nexus>.<inst>.intr_cpus

sysctl dev.t6nex.0.local_cpus
sysctl dev.t6nex.0.intr_cpus

Sponsored by: Chelsio Communications

5 years agoMFC r335701:
np [Mon, 29 Apr 2019 01:22:58 +0000 (01:22 +0000)]
MFC r335701:

cxgbe/cxgbei: Fix harmful typo in the iSCSI offload driver.

Reported by: gcc8 (via mmacy@)
Sponsored by: Chelsio Communications

5 years agoMFC r334467:
np [Mon, 29 Apr 2019 01:15:22 +0000 (01:15 +0000)]
MFC r334467:

cxgbe(4): Retire an old check.

5 years agoMFC r334139:
np [Mon, 29 Apr 2019 00:57:47 +0000 (00:57 +0000)]
MFC r334139:

cxgbe/t4_tom: ABORT_RPL_RSS is a shared CPL and t4_tom shouldn't remove
the global handler when it's being unloaded.

5 years agoMFC r334138:
np [Mon, 29 Apr 2019 00:40:02 +0000 (00:40 +0000)]
MFC r334138:

r334138: cxgbe(4): Make FW4_ACK a shared CPL.

5 years agoMFC r334137:
np [Mon, 29 Apr 2019 00:31:58 +0000 (00:31 +0000)]
MFC r334137:

cxgbe(4): Fix range checks in is_etid.

5 years agoMFC r334136:
np [Mon, 29 Apr 2019 00:22:34 +0000 (00:22 +0000)]
MFC r334136:

cxgbe(4): Slightly simpler needs_<foo> functions.

5 years agoMFC r334132:
np [Mon, 29 Apr 2019 00:16:20 +0000 (00:16 +0000)]
MFC r334132:

cxgbe(4): Make sure that the egress queue's cidx is updated periodically
when the driver is writing WRs using start_wrq_wr/commit_wrq_wr all the
time.

Sponsored by: Chelsio Communications

5 years agoMFC r333141 (by gallatin@):
np [Mon, 29 Apr 2019 00:08:30 +0000 (00:08 +0000)]
MFC r333141 (by gallatin@):

Optionally panic when cxgbe encounters a fatal error

Sometimes it is better to panic than to leave a machine
unreachable.

Reviewed by: np
Sponsored by: Netflix

5 years agoMFC r333153, r333394, r333442, r333472, r333620, r334058, r334447,
np [Sun, 28 Apr 2019 19:52:48 +0000 (19:52 +0000)]
MFC r333153, r333394, r333442, r333472, r333620, r334058, r334447,
r334452, and r335684.  These revisions added hashfilters, NAT offload,
and SMAC/DMAC swapping filters to cxgbe.

r333153:
cxgbe(4): Move all TCAM filter code into a separate file.

Sponsored by: Chelsio Communications

r333394:
cxgbe(4): Add support for hash filters.

These filters reside in the card's memory instead of its TCAM and can be
configured via a new "hashfilter" subcommand in cxgbetool.  Hash and
normal TCAM filters can be used together.  The hardware does an
exact-match of packet fields for hash filters, unlike the masked match
performed for TCAM filters.  Any T5/T6 card with memory can support at
least half a million hash filters.  The sample config file with the
driver configures 512K of these, it is possible to double this to 1
million+ in some cases.

The chip does an exact-match of fields of incoming datagrams with hash
filters and performs the action configured for the filter if it matches.
The fields to match are specified in a "filter mask" in the firmware
config file.  The filter mask always includes the 5-tuple (sip, dip,
sport, dport, ipproto).  It can, optionally, also include any subset of
the filter mode (see filterMode and filterMask in the firmware config
file).

For example:
filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe
filterMask = protocol, port, vlan

Exact values of the 5-tuple, the physical port, and VLAN tag would have
to be provided while setting up a hash filter with the chip
configuration above.

Hash filters support all actions supported by TCAM filters.  A packet
that hits a hash filter can be dropped, let through (with optional
steering to a specific queue or RSS region), switched out of another
port (with optional L2 rewrite of DMAC, SMAC, VLAN tag), or get NAT'ed.
(Support for some of these will show up in the driver in a follow-up
commit very shortly).

Sponsored by: Chelsio Communications

r333442:
cxgbe(4): Determine whether the firmware supports the FILTER2 work
request, which can be used to configure hardware NAT and swapmac.

All firmwares released after Jan 2017 support this work request.

Sponsored by: Chelsio Communications

r333472:
cxgbe(4): Add fields to support configuration of hardware NAT and
swapmac (SMAC/DMAC switcheroo) from userspace.

Sponsored by: Chelsio Communications

r333620:
cxgbe(4): Filtering related features and fixes.

- Driver support for hardware NAT.
- Driver support for swapmac action.
- Validate a request to create a hashfilter against the filter mask.
- Add a hashfilter config file for T5.

Sponsored by: Chelsio Communications

r334058:
cxgbe(4): Only valid filters are expected to have a valid tid.

r334447:
cxgbe(4): Add code to deal with the chip's source MAC table (aka SMT).

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

r334452:
cxgbe(4): Add support for SMAC-rewriting filters.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

r335684:
cxgbe(4): Do not leak the filters in the hashfilter table on module
unload.

Sponsored by: Chelsio Communications

Relnotes: Yes

5 years agoMFC r333121, r333128
np [Sun, 28 Apr 2019 19:02:34 +0000 (19:02 +0000)]
MFC r333121, r333128

r333121:
cxgbe/t4_tom: Use appropriate macros instead of magic math while
constructing the atid of an active open work request.

Sponsored by: Chelsio Communications

r333128:
cxgbe(4): Convert ACT_OPEN_RPL to a shared CPL.

Reserve 3b in the 14b atid to identify the owner and use it to dispatch
the CPL.  This allows all CPLs that use an atid to be used as shared
CPLs, although ACT_OPEN_RPL is the only one being converted in this
revision.

Sponsored by: Chelsio Communications

5 years agoMFC r333114:
np [Sun, 28 Apr 2019 18:50:25 +0000 (18:50 +0000)]
MFC r333114:

cxgbe(4): Use opaque cookies or tid range-checks to determine the
intended recipient of a CPL when it can't be determined solely from the
opcode.  Retire the per-queue handlers for such CPLs in favor of the new
scheme.

Sponsored by: Chelsio Communications

5 years agoMFC r333043:
np [Sun, 28 Apr 2019 18:44:29 +0000 (18:44 +0000)]
MFC r333043:

cxgbe(4): Move release_tid to the base NIC driver for future consumers.

Sponsored by: Chelsio Communications.

5 years agoMFC r333030:
np [Sun, 28 Apr 2019 18:36:54 +0000 (18:36 +0000)]
MFC r333030:

cxgbe(4): Break up alloc_tid_tabs and move the atid routines to the base
NIC driver.  The atid services will be used by new features (hashfilters
and inline TLS) that do not involve TOE.

Sponsored by: Chelsio Communications

5 years agoMFC r331902:
np [Sun, 28 Apr 2019 18:30:19 +0000 (18:30 +0000)]
MFC r331902:

r331902: cxgbe: Implement tcp_info handler for connections handled by t4_tom.

5 years agoMFC r345473:
dchagin [Sun, 28 Apr 2019 14:20:29 +0000 (14:20 +0000)]
MFC r345473:

Whitespace cleanup (annoying).

5 years agoMFC r345471, r345472, r346603:
dchagin [Sun, 28 Apr 2019 14:19:31 +0000 (14:19 +0000)]
MFC r345471, r345472, r346603:

Update syscall.master to 5.0.

For 32-bit Linuxulator, ipc() syscall was historically
the entry point for the IPC API. Starting in Linux 4.18, direct
syscalls are provided for the IPC. Enable it.

5 years agoMFC r345469, r345470:
dchagin [Sun, 28 Apr 2019 14:16:00 +0000 (14:16 +0000)]
MFC r345469, r345470:

Linux between 4.18 and 5.0 split IPC system calls.
In preparation for doing this in the Linuxulator modify our linux_shmat()
to match actual Linux shmat() system call.

5 years agoMFC r345468:
dchagin [Sun, 28 Apr 2019 14:11:21 +0000 (14:11 +0000)]
MFC r345468:

Revert r313993.
AMD64_SET_**BASE expects a pointer to a pointer, we just passing in the pointer value itself.

Set PCB_FULL_IRET for doreti to restore %fs, %gs and its correspondig base.

5 years agoMFC r335644 (by emaste@):
dchagin [Sun, 28 Apr 2019 14:09:31 +0000 (14:09 +0000)]
MFC r335644 (by emaste@):

Quiet unused fn warning for linuxulator w/o legacy syscalls.

5 years agoMFC r335515 (by chuck@):
dchagin [Sun, 28 Apr 2019 14:08:05 +0000 (14:08 +0000)]
MFC r335515 (by chuck@):

Fix the Linux kernel version number calculation

The Linux compatibility code was converting the version number (e.g.
2.6.32) in two different ways and then comparing the results.

The linux_map_osrel() function converted MAJOR.MINOR.PATCH similar to
what FreeBSD does natively. I.e. where major=v0, minor=v1, and patch=v2
    v = v0 * 1000000 + v1 * 1000 + v2;

The LINUX_KERNVER() macro, on the other hand, converted the value with
bit shifts. I.e. where major=a, minor=b, and patch=c
    v = (((a) << 16) + ((b) << 8) + (c))

The Linux kernel uses the later format via the KERNEL_VERSION() macro in
include/generated/uapi/linux/version.h

Fix is to use the LINUX_KERNVER() macro in linux_map_osrel() as well as
in the .trans_osrel functions.

PR: 229209

5 years agoMFC r335387 (by emaste@):
dchagin [Sun, 28 Apr 2019 14:06:22 +0000 (14:06 +0000)]
MFC r335387 (by emaste@):

linuxulator: handle V3 capget/capset

Linux 2.6.26 introduced 64-bit capability sets.  Extend our stub
implementation to handle both 32- and 64-bit.  (We still report no
capabilities in capget, and disallow any in capset.)

5 years agoMFC r335327 (by emaste@):
dchagin [Sun, 28 Apr 2019 14:05:05 +0000 (14:05 +0000)]
MFC r335327 (by emaste@):

linuxulator: add debugging for invalid capget/capset version.

5 years agoMFC r335201 (by emaste@):
dchagin [Sun, 28 Apr 2019 14:03:32 +0000 (14:03 +0000)]
MFC r335201 (by emaste@):

linuxulator: do not include legacy syscalls on arm64

Existing linuxulator platforms (i386, amd64) support legacy syscalls,
such as non-*at ones like open, but arm64 and other new platforms do
not.

Wrap these in #ifdef LINUX_LEGACY_SYSCALLS, #defined in the MD linux.h
files.  We may need finer grained control in the future but this is
sufficient for now.

5 years agoMFC r335200 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:45:18 +0000 (13:45 +0000)]
MFC r335200 (by emaste@):

Correct debug control for linuxulator faccessat

The Linuxulator provides per-syscall debug control via the
compat.linux.debug sysctl.  There's generally a 1:1 mapping between
sysctl setting and syscall, but faccessat was controlled by the access
setting, perhaps due to copy-paste.

5 years agoMFC r332893 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:43:58 +0000 (13:43 +0000)]
MFC r332893 (by emaste@):

Map FreeBSD EDOOFUS to Linux EINVAL

Previously EDOOFUS mapped to EBUSY.  EINVAL seems more appropriate.

5 years agoMFC r332333 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:42:34 +0000 (13:42 +0000)]
MFC r332333 (by emaste@):

linuxulator: deduplicate linux_exec_imgact_try

Previously linuxulator had three identical copies of
linux_exec_imgact_try.  Deduplicate before adding another arch to
linuxulator.

5 years agoMFC r331462 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:41:23 +0000 (13:41 +0000)]
MFC r331462 (by emaste@):

Remove redundant cast from Linuxulator SYSINITs.

5 years agoMFC r331356 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:40:17 +0000 (13:40 +0000)]
MFC r331356 (by emaste@):

Share Linux errno table with libsysdecode.

5 years agoMFC r331256 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:38:29 +0000 (13:38 +0000)]
MFC r331256 (by emaste@):

Make linuxulator fn declaration match definition

I accidentally swapped 'linux_fixup_elf' to 'linux_elf_fixup' in amd64's
declaration (only),  while bringing this change over from git and
encountering a conflict.

5 years agoMFC r331226 (byu emaste@):
dchagin [Sun, 28 Apr 2019 13:37:13 +0000 (13:37 +0000)]
MFC r331226 (byu emaste@):

Rename linuxulator functions with linux_ prefix

It's preferable to have a consistent prefix.  This also reduces
differences between the three linux*_sysvec.c files.

5 years agoMFC r331208 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:35:36 +0000 (13:35 +0000)]
MFC r331208 (by emaste@):

linux*_sysvec.c: rationalize whitespace and comments

There's a fair amount of duplication between MD linuxulator files.
Make indentation and comments consistent between the three versions of
linux_sysvec.c to reduce diffs when comparing them.

5 years agoMFC r331056:
dchagin [Sun, 28 Apr 2019 13:33:35 +0000 (13:33 +0000)]
MFC r331056:
Share a single bsd-linux errno table across MD consumers

Three copies of the linuxulator linux_sysvec.c contained identical
BSD to Linux errno translation tables, and future work to support other
architectures will also use the same table.  Move the table to a common
file to be used by all.  Make it 'const int' to place it in .rodata.

(Some existing Linux architectures use MD errno values, but x86 and Arm
share the generic set.)

This change should introduce no functional change; a followup will add
missing errno values.

MFC r331057:
linux_errno.c: add newer errno values

Also introduce a static assert to ensure the list is kept up to date.

MFC r331060:
Chase r331057 in libsysdecode erno table

5 years agoMFC r330927 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:29:29 +0000 (13:29 +0000)]
MFC r330927 (by emaste@):

Remove stray ; at end of linux_vdso_deinstall()

5 years agoMFC r330866 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:28:05 +0000 (13:28 +0000)]
MFC r330866 (by emaste@):

Use C99 boolean type for translate_osrel

Migrate to modern types before creating MD Linuxolator bits for new
architectures.

5 years agoMFC r330822 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:26:55 +0000 (13:26 +0000)]
MFC r330822 (by emaste@):

imgact_linux.c: use standard indentation.

5 years agoMFC r330798 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:23:52 +0000 (13:23 +0000)]
MFC r330798 (by emaste@):

Linuxulator: apply style(9) to return.

5 years agoMFC r329876 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:22:30 +0000 (13:22 +0000)]
MFC r329876 (by emaste@):

Use linux types for linux-specific syscalls.

5 years agoMFC r329873 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:21:01 +0000 (13:21 +0000)]
MFC r329873 (by emaste@):

Correct pseudo misspelling in sys/ comments

contrib code and #define in intel_ata.h unchanged.

5 years agoMFC r329794, r329801 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:19:28 +0000 (13:19 +0000)]
MFC r329794, r329801 (by emaste@):

Correct proper nouns in the Linuxulator

- Capitalize Linux
- Spell FreeBSD out in full
- Address some style(9) on changed lines

5 years agoMFC r329787 (by emaste@):
dchagin [Sun, 28 Apr 2019 13:16:54 +0000 (13:16 +0000)]
MFC r329787 (by emaste@):

Use 'const int *' for sysentvec errno translation table

This allows an sv_errtbl to be read-only .rodata.

5 years agoMFC r328894 (by emaste@):
dchagin [Sun, 28 Apr 2019 09:54:50 +0000 (09:54 +0000)]
MFC r328894 (by emaste@):

Additional linuxolator whitespace cleanup, missed in r328890.

5 years agoMFC r328890 (by emaste@):
dchagin [Sun, 28 Apr 2019 09:53:08 +0000 (09:53 +0000)]
MFC r328890 (by emaste@):

Linuxolator whitespace cleanup

A version of each of the MD files by necessity exists for each CPU
architecture supported by the Linuxolator.  Clean these up so that new
architectures do not inherit whitespace issues.

Clean up shared Linuxolator files while here.

5 years agoMFC r328598 (by emaste@):
dchagin [Sun, 28 Apr 2019 09:49:30 +0000 (09:49 +0000)]
MFC r328598 (by emaste@):

makesyscalls: permit a range of syscall numbers for UNIMPL

Some ABIs have large gaps in syscall numbers.  Allow gaps to be filled
as ranges of UNIMPL, with an entry like:

248-1023 AUE_NULL UNIMPL unimplemented

5 years agoMFC Linuxulator part of r326333 (by brooks@):
dchagin [Sun, 28 Apr 2019 09:47:33 +0000 (09:47 +0000)]
MFC Linuxulator part of r326333 (by brooks@):

Disable vim syntax highlighting.

Vim's default pick doesn't understand that ';' is a comment character
and the result looks horrible.

5 years agoMFC r323980 (by pfg@):
dchagin [Sun, 28 Apr 2019 09:38:41 +0000 (09:38 +0000)]
MFC r323980 (by pfg@):

Small style(9) issue: spaces vs TAB.

5 years agoMFC r321728:
dchagin [Sun, 28 Apr 2019 09:35:39 +0000 (09:35 +0000)]
MFC r321728:

Avoid using [LINUX_]SHAREDPAGE constant directly in the vdso code.
This is needed for https://reviews.freebsd.org/D11780.

5 years agocxgbetool(8): Make sure getline is available.
np [Sun, 28 Apr 2019 08:22:37 +0000 (08:22 +0000)]
cxgbetool(8): Make sure getline is available.

This is a direct commit to stable/11.

5 years agoMFC r317849 (partial), r332506, and r332787.
np [Sun, 28 Apr 2019 06:51:59 +0000 (06:51 +0000)]
MFC r317849 (partial), r332506, and r332787.

r317849 (partial, required by r332506):
cxgbe/t4_tom: Per-connection rate limiting for TCP sockets handled by
the TOE.

Sponsored by: Chelsio Communications

r332506:
cxgbe(4): Add support for Connection Offload Policy (aka COP).

COP allows fine-grained control on whether to offload a TCP connection
using t4_tom, and what settings to apply to a connection selected for
offload.  t4_tom must still be loaded and IFCAP_TOE must still be
enabled for full TCP offload to take place on an interface.  The
difference is that IFCAP_TOE used to be the only knob and would enable
TOE for all new connections on the inteface, but now the driver will
also consult the COP, if any, before offloading to the hardware TOE.

A policy is a plain text file with any number of rules, one per line.
Each rule has a "match" part consisting of a socket-type (L = listen,
A = active open, P = passive open, D = don't care) and a pcap-filter(7)
expression, and a "settings" part that specifies whether to offload the
connection or not and the parameters to use if so.  The general format
of a rule is: [socket-type] expr => settings

Example.  See cxgbetool(8) for more information.
[L] ip && port http => offload
[L] port 443 => !offload
[L] port ssh => offload
[P] src net 192.168/16 && dst port ssh => offload !nagle !timestamp cong newreno
[P] dst port ssh => offload !nagle ecn cong tahoe
[P] dst port http => offload
[A] dst port 443 => offload tls
[A] dst net 192.168/16 => offload !timestamp cong highspeed

The driver processes the rules for each new listen, active open, or
passive open and stops at the first match.  There is an implicit rule at
the end of every policy that prohibits offload when no rule in the
policy matches:
[D] all => !offload

This is a reworked and expanded version of a patch submitted by
Krishnamraju Eraparaju @ Chelsio.

Sponsored by: Chelsio Communications

r332787:
cxgbe(4): Fix bugs in the handling of COP rules that match on VLAN tag.

Retrieve the tag from the correct ifnet and use the provided tag
(instead of hardcoded 0xffff, implying no tag) in the routines that
process offload policy.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

5 years agoMFC r346688-r346689: tap(4) MODULE_VERSION
kevans [Sun, 28 Apr 2019 03:51:08 +0000 (03:51 +0000)]
MFC r346688-r346689: tap(4) MODULE_VERSION

r346688:
tap(4): Add a MODULE_VERSION

Otherwise tap(4) can be loaded by loader despite being compiled into the
kernel, causing a panic as things try to double-initialize.

r346689:
tap(4): Correct driver name...

PR: 220867

5 years agoMFC r346545-r346546, r346680, r346700, r346705
kevans [Sun, 28 Apr 2019 03:49:40 +0000 (03:49 +0000)]
MFC r346545-r346546, r346680, r346700, r346705

r346545:
libbe(3): allow creation of arbitrary depth boot environments

libbe currently only provides an API to create a recursive boot environment,
without any formal support for intentionally limiting the depth. This
changeset adds an API, be_create_depth, that may be used to arbitrarily
restrict the depth of the new BE.

r346546:
libbe(3): Add a test for be creation

r346680:
libbe(3): Copy received properties as well

This was inherently broken on send|recv datasets.

r346700:
libbe(3): Fix mis-application of patch (SHLIBDIR)

Rob's patch in D18564 cemented the SHLIBDIR because bsd.own.mk (included by
src.opts.mk) sets it to /usr/lib. r346546 did somehow not apply this part of
the patch, leaving it to get installed to the wrong place and subsequently
removed via ObsoleteFiles.

r346705:
libbe(3): Fix libcompat build

SHLIBDIR should still be optionally set, just before src.opts.mk is included
so that libcompat can properly override it. This fixes lib32 failures
reported by both Jenkins and Michael Butler.

5 years agoMFC r346440:
markj [Sat, 27 Apr 2019 05:35:51 +0000 (05:35 +0000)]
MFC r346440:
Export cpu_core from opensolaris.ko.

PR: 191462

5 years agoBump __FreeBSD_version for ether_gen_addr availability
kevans [Sat, 27 Apr 2019 04:51:57 +0000 (04:51 +0000)]
Bump __FreeBSD_version for ether_gen_addr availability

This is a direct commit to stable branches as the bump wasn't present in
head.

5 years agoMFC r345139, r345151, r346324, r346328: ether_gen_addr KPI
kevans [Sat, 27 Apr 2019 04:39:41 +0000 (04:39 +0000)]
MFC r345139, r345151, r346324, r346328: ether_gen_addr KPI

if_bridge and if_vxlan conversion to this deterministic MAC address KPI has
been MFC as well.  This is potentially error prone as the generated address
range for these has decreased, but I've deemed this acceptable for stable
branches due to collisions for thees interfaces being easily remedied.

I have no intention of switching anything else to this KPI in any stable
branches.

r345139:
ether: centralize fake hwaddr generation

We currently have two places with identical fake hwaddr generation --
if_vxlan and if_bridge. Lift it into if_ethersubr for reuse in other
interfaces that may also need a fake addr.

r345151:
ether_fakeaddr: Use 'b' 's' 'd' for the prefix

This has the advantage of being obvious to sniff out the designated prefix
by eye and it has all the right bits set. Comment stolen from ffec.

I've removed bryanv@'s pending question of using the FreeBSD OUI range --
no one has followed up on this with a definitive action, and there's no
particular reason to shoot for it and the administrative overhead that comes
with deciding exactly how to use it.

r346324:
net: adjust randomized address bits

Give devices that need a MAC a 16-bit allocation out of the FreeBSD
Foundation OUI range. Change the name ether_fakeaddr to ether_gen_addr now
that we're dealing real MAC addresses with a real OUI rather than random
locally-administered addresses.

r346328:
Compile sha1.c when ether support is included

sha1 is used by ether_gen_addr after r346324. Perhaps in an ideal world we
could detect that the kernel's been compiled without sha1_* bits included
and silently fallback to arc4random instead because these platforms/kernel
configs are far and few between. It's fairly lightweight, though, so just
include it for now.

5 years agoMFC r346469: dtc(1): Pull in fix for segfault-upon-error condition
kevans [Sat, 27 Apr 2019 04:16:15 +0000 (04:16 +0000)]
MFC r346469: dtc(1): Pull in fix for segfault-upon-error condition

Specifically, parse errors within a node would lead to a segfault due to
an unconditional dereference after emitting the error.

5 years agoMFC: r346191
rmacklem [Sat, 27 Apr 2019 02:24:58 +0000 (02:24 +0000)]
MFC: r346191
Add support for INET6 addresses to the kernel code that dumps open/lock state.

PR#223036 reported that INET6 callback addresses were not printed by
nfsdumpstate(8). This kernel patch adds INET6 addresses to the dump structure,
so that nfsdumpstate(8) can print them out, post-r346190.

5 years agoMFC: r346190
rmacklem [Sat, 27 Apr 2019 02:13:15 +0000 (02:13 +0000)]
MFC: r346190
Fix nfsdumpstate(8) so that it can print out INET6 callback addresses.

The patch adds support for printing of INET6 callback addresses.
It also adds the #ifdef INET, INET6 as requested by bz@.

5 years agoMFC r333322: Keep CARP state as INIT when net.inet.carp.allow=0.
mav [Fri, 26 Apr 2019 22:18:22 +0000 (22:18 +0000)]
MFC r333322: Keep CARP state as INIT when net.inet.carp.allow=0.

Currently when net.inet.carp.allow=0 CARP state remains as MASTER, which is
not very useful (if there are other masters -- it can lead to split brain,
if there are none -- it makes no sense).  Having it as INIT makes it clear
that carp packets are disabled.

Sponsored by: iXsystems, Inc.

5 years agoMFC r341641 (by sef): Reduce number of DNS queries in mountd.
mav [Fri, 26 Apr 2019 21:44:51 +0000 (21:44 +0000)]
MFC r341641 (by sef): Reduce number of DNS queries in mountd.

5 years agoMFC r344402 (by sef):
mav [Fri, 26 Apr 2019 21:34:08 +0000 (21:34 +0000)]
MFC r344402 (by sef):

* Handle SIGPIPE in gssd
We've got some cases where the other end of gssd's AF_LOCAL socket gets
closed, resulting in an error (and SIGPIPE) when it tries to do I/O to it.
Closing without cleaning up means the next time nfsd starts up, it hangs,
unkillably; this allows gssd to handle that particular error.

* Limit the retry cound in gssd_syscall to 5.
The default is INT_MAX, which effectively means forever.  And it's an
uninterruptable RPC call, so it will never stop.

The two changes mitigate the problem.

5 years agoMFC r344782: bridge: Fix spurious warnings about capabilities
mav [Fri, 26 Apr 2019 21:21:55 +0000 (21:21 +0000)]
MFC r344782: bridge: Fix spurious warnings about capabilities

Mask off the bits we don't care about when checking that capabilities
of the member interfaces have been disabled as intended.

5 years agoMFC r317586: Make if_bridge complain if it can't disable some capabilities.
mav [Fri, 26 Apr 2019 21:19:06 +0000 (21:19 +0000)]
MFC r317586: Make if_bridge complain if it can't disable some capabilities.

5 years agoMFC r345656: Do not map small IOCTL buffers to KVA, but copy.
mav [Fri, 26 Apr 2019 17:28:06 +0000 (17:28 +0000)]
MFC r345656: Do not map small IOCTL buffers to KVA, but copy.

CAM IOCTL interfaces traditionally mapped user-space data buffers to KVA.
It was nice originally, but now it takes too much to handle respective
TLB shootdowns, while small kernel memory allocations up to 64KB backed
by UMA and accompanied by copyin()/copyout() can be much cheaper.

For large buffers mapping still may have sense, and unmapped I/O would
be even better, but the last unfortunately is more tricky, since unmapped
I/O API is too specific to struct bio now.

Sponsored by: iXsystems, Inc.

5 years agoMFC r335837 (by kp): carp: Set DSCP value CS7
mav [Fri, 26 Apr 2019 17:01:56 +0000 (17:01 +0000)]
MFC r335837 (by kp): carp: Set DSCP value CS7

Update carp to set DSCP value CS7(Network Traffic) in the flowlabel field of
packets by default. Currently carp only sets TOS_LOWDELAY in IPv4 which was
deprecated in 1998. This also implements sysctl that can revert carp back to
it's old behavior if desired.

This will allow implementation of QOS on modern network devices to make sure
carp packets aren't dropped during interface contention.

Submitted by: Nick Wolff <darkfiberiru AT gmail.com>
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14536

5 years agoMFC r317515: Fix withered handling of r280687, broken by r286719.
mav [Fri, 26 Apr 2019 16:26:01 +0000 (16:26 +0000)]
MFC r317515: Fix withered handling of r280687, broken by r286719.

5 years agoMFC r346349:
kp [Fri, 26 Apr 2019 13:00:25 +0000 (13:00 +0000)]
MFC r346349:

pf: No need to M_NOWAIT in DIOCRSETTFLAGS

Now that we don't hold a lock during DIOCRSETTFLAGS memory allocation we can
use M_WAITOK.

Pointed out by: glebius@

5 years agoMFC r343455: Fix tpm2 acpidump compilation on 32-bit
mw [Fri, 26 Apr 2019 02:19:25 +0000 (02:19 +0000)]
MFC r343455: Fix tpm2 acpidump compilation on 32-bit

5 years agoMFC r345438,r345842,r346259,r346261: TPM as possible entropy source
mw [Fri, 26 Apr 2019 01:58:36 +0000 (01:58 +0000)]
MFC r345438,r345842,r346259,r346261: TPM as possible entropy source

r345438:
Allow using TPM as entropy source

TPM has a built-in RNG, with its own entropy source.
The driver was extended to harvest 16 random bytes from TPM every 10 seconds.
A new build option "TPM_HARVEST" was introduced - for now, however, it
is not enabled by default in the GENERIC config.

Reviewed by: markm, delphij
Approved by: secteam

r345842:
Add a cv_wait to the TPM2.0 harvesting function

r346259:
tpm: Prevent session hijack

r346261:
Improve tpm20 style

Submitted by: Kornel Duleba <mindal@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield

5 years agoMFC r343438: Use ACPI TPM2 table to probe tpmtis and tpmcrb device
mw [Fri, 26 Apr 2019 01:20:39 +0000 (01:20 +0000)]
MFC r343438: Use ACPI TPM2 table to probe tpmtis and tpmcrb device

Submitted by: Kornel Duleba <mindal@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield

5 years agoMFC r342084,r342251,r342271,r342285: Introduce TPM2.0 driver
mw [Fri, 26 Apr 2019 01:02:24 +0000 (01:02 +0000)]
MFC r342084,r342251,r342271,r342285: Introduce TPM2.0 driver

r342084
Introduce driver for TPM 2.0 in CRB and FIFO (TIS) modes

r342251
Include the new TPM 2.0 driver in the TPM module.

r342271
Fix obtaining RSP address in TPM CRB for non-amd64 platforms

r342285
tpm(4): Fix GCC build after r342084 (TPM 2.0 driver commit)

Submitted by: Kornel Duleba <mindal@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield

5 years agoFix build with r346707.
mav [Thu, 25 Apr 2019 22:53:25 +0000 (22:53 +0000)]
Fix build with r346707.

5 years agoMFC r339826 (by yuripv):
mav [Thu, 25 Apr 2019 21:09:07 +0000 (21:09 +0000)]
MFC r339826 (by yuripv):
Provide basic descriptions for VMX exit reason (from "Intel 64 and IA-32
Architectures Software Developer’s Manual Volume 3").  Add the document
to SEE ALSO in bhyve.8 (and pet manlint here a bit).

5 years agoMFC r340731 (by markj): Use taskqueue_quiesce(9) to implement taskq_wait().
mav [Thu, 25 Apr 2019 18:49:29 +0000 (18:49 +0000)]
MFC r340731 (by markj): Use taskqueue_quiesce(9) to implement taskq_wait().

5 years agoMFC r344569, r344618, r344621 (by bapt):
mav [Thu, 25 Apr 2019 18:30:47 +0000 (18:30 +0000)]
MFC r344569, r344618, r344621 (by bapt):

r344569:
Implement parallel mounting for ZFS filesystem

It was first implemented on Illumos and then ported to ZoL.
This patch is a port to FreeBSD of the ZoL version.
This patch also includes a fix for a race condition that was amended

With such patch Delphix has seen a huge decrease in latency of the mount phase
(https://github.com/openzfs/openzfs/commit/a3f0e2b569 for details).
With that current change Gandi has measured improvments that are on par with
those reported by Delphix.

Zol commits incorporated:
https://github.com/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825c70c9c9e303
https://github.com/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d4077567dfea21

Reviewed by: avg, sef
Approved by: avg, sef
Obtained from: ZoL
Relnotes: yes
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D19098

r344618:
Fix regression introduced in r344569

Reported by: cy
Tested by: cy
Submitted by: Fatih Acar <fatih@gandi.net>

r344621:
Fix a regression introduced in r344569

Import a fix from illumos (thanks Toomas Soomas for pointing at it)

See https://www.illumos.org/issues/10205 for more details
Illumos commit: https://github.com/illumos/illumos-gate/commit/247b7da039fd88350c50e3d7fef15bdab6bef215

Submitted by: jack@gandi.net
Reported by: cy
Reviewed by: tsoome, cy, bapt
Obtained from: Illumos

5 years agoMFC r345200: MFV r336930: 9284 arc_reclaim_thread has 2 jobs
mav [Thu, 25 Apr 2019 17:28:36 +0000 (17:28 +0000)]
MFC r345200: MFV r336930: 9284 arc_reclaim_thread has 2 jobs

`arc_reclaim_thread()` calls `arc_adjust()` after calling
`arc_kmem_reap_now()`; `arc_adjust()` signals `arc_get_data_buf()` to
indicate that we may no longer be `arc_is_overflowing()`.

The problem is, `arc_kmem_reap_now()` can take several seconds to
complete, has no impact on `arc_is_overflowing()`, but due to how the
code is structured, can impact how long the ARC will remain in the
`arc_is_overflowing()` state.

The fix is to use seperate threads to:

1. keep `arc_size` under `arc_c`, by calling `arc_adjust()`, which
    improves `arc_is_overflowing()`

2. keep enough free memory in the system, by calling
 `arc_kmem_reap_now()` plus `arc_shrink()`, which improves
 `arc_available_memory()`.

illumos/illumos-gate@de753e34f9c399037936e8bc547d823bba9d4b0d

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Tim Kordas <tim.kordas@joyent.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Brad Lewis <brad.lewis@delphix.com>

5 years agoMFC r344601 (by sef): Set process title during zfs send.
mav [Thu, 25 Apr 2019 17:25:13 +0000 (17:25 +0000)]
MFC r344601 (by sef): Set process title during zfs send.

This adds a '-V' option to 'zfs send', which sets the process title once a
second to the progress information.

This code has been in FreeNAS for a long time now; this is just upstreaming
it here.  It was originially written by delphij.

5 years agoMFC r340311: Do not ignore arc_adjust() return value.
mav [Thu, 25 Apr 2019 17:22:41 +0000 (17:22 +0000)]
MFC r340311: Do not ignore arc_adjust() return value.

This covers scenario when ARC may not shrink as fast as it could:
1. arc_size < arc_c and arc_adjust() does not evict anything, returning
   zero to arc_reclaim_thread();
2. arc_available_memory() reports memory pressure, which can not be
   satisfied by arc_kmem_reap_now();
3. arc_shrink() reduces arc_c and calls arc_adjust(), return of which is
   ignored;
4. even if the last arc_adjust() could not satisfy arc_size < arc_c,
   arc_reclaim_thread() will still go to sleep, since the first one
   returned zero.