Commit Graph

252104 Commits

Author SHA1 Message Date
Glen Barber
440cec3faf MFH
Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-08-12 17:16:26 +00:00
Mitchell Horne
f7d79f6c6d Correctly set error in rt_mpath_unlink
It is possible for rn_delete() to return NULL. If this happens, then set
*perror to ESRCH, as is done in the rest of the function.

Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D25871
2020-08-12 16:43:20 +00:00
Glen Barber
0a459a714f release: update to use git instead of svn:
Makefile.* (cloudware):
 - Consistify setting the BUILDDATE for snapshots.
   (Missed a spot)

Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-08-12 16:30:33 +00:00
Glen Barber
86e5b1377d release: update to use git instead of svn:
Makefile.* (cloudware):
 - Consistify setting the BUILDDATE for snapshots.

release.conf.sample/release.sh:
 - Run 'git clone' in 'quiet' mode.

Makefile.inc1:
 - Set BUILDDATE and export the variable.

Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-08-12 16:25:25 +00:00
Mark Johnston
9eb0cd08ae linprocfs: Fix some inaccuracies in meminfo.
- Fill out MemFree correctly.  Delete an ancient comment suggesting that
  we don't want to advertise the true quantity of free memory.
- Populate the Buffers field by reading vfs.bufspace.
- The page cache consists of all pages in page queues, not just the
  inactive queue.

PR:		248463
Reported and tested by:	danfe
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-08-12 16:08:44 +00:00
Alex Richardson
cad2917baf Fix stand/newvers.sh with zsh in sh mode
When building on macOS with sh==zsh, newvers.sh was producing an
unterminated string literal due to \\n being turned as a newline. Fix this
by using a here document instead.

Reviewed By:	imp
Differential Revision: https://reviews.freebsd.org/D26036
2020-08-12 15:49:10 +00:00
Alex Richardson
188d6f4bc6 Fix crunchgen usage of mkstemp()
On Glibc systems mkstemp can only be used once with the same template
string since it will be modified in-place and no longer contain any 'X' chars.
It is fine to reuse the same file here but we need to be explicit and use
open() instead of mkstemp() on the second use.

While touching this file also avoid a hardcoded /bin/pwd since that may not
work when building on non-FreeBSD systems.

Reviewed By:	brooks
Differential Revision: https://reviews.freebsd.org/D25990
2020-08-12 15:49:06 +00:00
Vincenzo Maffione
6d84e76a25 iflib: netmap: improve rxsync to support IFLIB_HAS_RXCQ
For drivers with IFLIB_HAS_RXCQ set, there is a separate completion
queue. In this case, the netmap rxsync routine needs to update
rxq->ifr_cq_cidx in the same way it is updated by iflib_rxeof().
This improves the situation for vmx(4) and bnxt(4) drivers, which
use iflib and have the IFLIB_HAS_RXCQ bit set.

PR:	248494
MFC after:	3 weeks
2020-08-12 14:45:31 +00:00
Vincenzo Maffione
530960be8d iflib: refactor netmap_fl_refill and fix off-by-one issue
First, fix the initialization of the fl->ifl_rxd_idxs array,
which was affected by an off-by-one bug.
Once there, refactor the function to use better names for
local variables, optimize the variable assignments, and
merge the bus_dmamap_sync() inner loop with the outer one.

PR:	248494
MFC after:	3 weeks
2020-08-12 14:17:38 +00:00
Andriy Gapon
a089fa298d hook cp2112.4 to the build
Reported by:	0mp
MFC after:	1 week
X-MFC with:	r364144
2020-08-12 11:37:28 +00:00
Andriy Gapon
758fac8f87 hook gpiokeys.4 to the build
Reported by:	0mp
MFC after:	3 days
X-MFC with:	r363905
2020-08-12 11:36:09 +00:00
Andrew Turner
da11e1f9ee Add support for Cortex-A76/Neoverse-N1 to hwpmc
This adds support for the Cortex-A76 and Neoverse-N1 PMU counters to pmc.

While here add more PMCR_IDCODE values and check the implementers code is
correct before setting the PMU type.

Reviewed by:	bz, emaste (looks reasonable to me)
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D25959
2020-08-12 10:17:17 +00:00
Andriy Gapon
d9fe3aed75 aw_cir: in the pulse encoding the actual length is one greater than value
While here change type of some variables from long to int, it's sufficient.
Also, add length reporting to a couple of debug printfs.

MFC after:	3 weeks
2020-08-12 09:57:28 +00:00
Andriy Gapon
852d135791 aw_cir: lower activation threshold to support NECx protocol
In NECx the leading mark has length of 8T as opposed to 16T in NEC,
where T is  562.5 us.  So, 4.5 ms.
Our threshold was set to 128 * 42.7 us (derived from the sampling
frequency of 3/128 MHz).  So, ~5.5 ms.

The new threshold is set to AW_IR_L1_MIN.  I think that's a good enough
lower bound for detecting the leading pulse.

Also, calculations of active_delay (which is activation delay) are fixed.
Previously they would be wrong if AW_IR_ACTIVE_T was anything but zero,
because the value was already bit-shifted.

Finally, I am not sure why the activation delay was divided by two when
calculating the initial pulse length.  I have not found anything that
would explain or justify it.  So, I removed that division.

MFC after:	3 weeks
2020-08-12 09:56:21 +00:00
Andriy Gapon
8b616b263d aw_cir: minor cleanups
MFC after:	1 week
2020-08-12 09:52:39 +00:00
Andriy Gapon
012fba460a aw_cir: add support for allwinner,sun6i-a31-ir (found, e.g., on h3)
MFC after:	1 week
2020-08-12 09:52:12 +00:00
Andriy Gapon
2ad1660ae4 gpiokeys: add evdev support
Only linux,code is supported as it maps 1:1 to evdev key codes.
No reverse mapping for freebsd,code yet.

Reviewed by:	wulf
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D25940
2020-08-12 09:49:25 +00:00
Andriy Gapon
470d07d417 add a manual page for cp2112
MFC after:	1 week
2020-08-12 09:42:05 +00:00
Andriy Gapon
ef32901b25 cp2112: a number of cleanups and improvements
- hoist all request / response structures from function level to top level
- replace magic numeric literals with constants
- regroup types, data and functions
- remove setting of the id field in responses as they are completely
  overwritten with data from the device
- centralize setting of the id field as it is always set to the value of
  request type
- fix setting and querying of open-drain vs push-pull configuration of
  an output pin -- it's always in one of those configurations
- detect special pin configurations: a pin in a special configuration is
  neither general purpose input or output
- there is still no support for setting special configurations

MFC after:	2 weeks
2020-08-12 09:07:07 +00:00
Mateusz Guzik
36f47512d9 vfs: inline vrefcnt 2020-08-12 04:53:20 +00:00
Mateusz Guzik
4c2d103a02 vfs: garbage collect vrefactn 2020-08-12 04:53:02 +00:00
Mateusz Guzik
6883f07e97 vfs: reimplement vref on top of vget
No change in generated assembly.
2020-08-12 04:52:35 +00:00
Rick Macklem
90cf38f22e Fix a bug introduced by r363001 for the ext_pgs case.
r363001 added support for ext_pgs mbufs to nfsm_uiombuf().
By inspection, I noticed that "mlen" was not set non-zero and, as such, there
would be an iteration of the loop that did nothing.
This patch sets it.
This bug would have no effect on the system, since the ext_pgs mbuf code
is not yet enabled.
2020-08-12 04:35:49 +00:00
Conrad Meyer
0ac9e27ba9 devfs: Abstract locking assertions
The conversion was largely mechanical: sed(1) with:

  -e 's|mtx_assert(&devmtx, MA_OWNED)|dev_lock_assert_locked()|g'
  -e 's|mtx_assert(&devmtx, MA_NOTOWNED)|dev_lock_assert_unlocked()|g'

The definitions of these abstractions in fs/devfs/devfs_int.h are the
only non-mechanical change.

No functional change.
2020-08-12 00:32:31 +00:00
Conrad Meyer
b7883452d4 Back out unrelated change
Reported by:	kib, markj
X-MFC-With:	r364129
2020-08-12 00:21:30 +00:00
Cy Schubert
51da4b19be When booting a system with WITHOUT_IPFILTER the following errors
are encountered at boot time:

rcorder: requirement `ipfs' in file `/etc/rc.d/netif' has no providers.
rcorder: requirement `ipfilter' in file `/etc/rc.d/netif' has no
providers.
rcorder: requirement `ipfilter' in file `/etc/rc.d/netwait' has no
providers.
rcorder: requirement `ipfilter' in file `/etc/rc.d/net_watchdog' has no
providers.
rcorder: requirement `ipfilter' in file `/etc/rc.d/securelevel' has no
providers.

Listing its own requrements in BEFORE rather than use REQUIRE of
non-optional scripts resolves this issue.

The issue was discovered and patched by glebius at Netflix.

Submitted by:	glebius
Reported by:	glebius
MFC after:	1 week
2020-08-11 23:36:38 +00:00
John-Mark Gurney
af59394536 since kld_deb.py was removed a while back, this script isn't useful
anymore...
2020-08-11 22:33:56 +00:00
Gordon Bergling
48bd73d9f5 tput(1): Several enhancements for the manual page
- a couple of descriptions are incomplete
- synopsis doesn't show that all arguments are optional
- missing an ENVIRONMENT section with TERM mentioned

PR:		84670
Submitted by:	Gary W. Swearingen <garys at opusnet dot com>
Reviewed by:	bcr
Approved by:	bcr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26009
2020-08-11 21:44:43 +00:00
Conrad Meyer
6eecc07f65 smp.h: Reconcile definition and declaration of smp_ncpus
The variable is defined unconditionally; declare it unconditionally as well.

It is already initialized to the correct value (1) for !SMP builds.

No functional change.
2020-08-11 20:42:21 +00:00
Conrad Meyer
0292c54bdb Add support for multithreading the inactive queue pageout within a domain.
In very high throughput workloads, the inactive scan can become overwhelmed
as you have many cores producing pages and a single core freeing.  Since
Mark's introduction of batched pagequeue operations, we can now run multiple
inactive threads working on independent batches.

To avoid confusing the pid and other control algorithms, I (Jeff) do this in
a mpi-like fan out and collect model that is driven from the primary page
daemon.  It decides whether the shortfall can be overcome with a single
thread and if not dispatches multiple threads and waits for their results.

The heuristic is based on timing the pageout activity and averaging a
pages-per-second variable which is exponentially decayed. This is visible in
sysctl and may be interesting for other purposes.

I (Jeff) have verified that this does indeed double our paging throughput
when used with two threads. With four we tend to run into other contention
problems.  For now I would like to commit this infrastructure with only a
single thread enabled.

The number of worker threads per domain can be controlled with the
'vm.pageout_threads_per_domain' tunable.

Submitted by:	jeff (earlier version)
Discussed with:	markj
Tested by:	pho
Sponsored by:	probably Netflix (based on contemporary commits)
Differential Revision:	https://reviews.freebsd.org/D21629
2020-08-11 20:37:45 +00:00
Alex Richardson
91b31c100b Allow linking the kernel with a linker that doesn't support -z ifunc-noplt
This can happen when linking with upstream LLD < 9.0.

Reviewed By:	markj
Differential Revision: https://reviews.freebsd.org/D25985
2020-08-11 16:47:00 +00:00
Alex Richardson
fded98749a Fix libdtrace build with zsh as /bin/sh
When zsh runs in POSIX sh mode it does not support the -e flag to echo.
Use printf instead of echo to avoid the "-e" characters being printed.

Obtained from:	CheriBSD
Reviewed By:	markj
Differential Revision: https://reviews.freebsd.org/D26026
2020-08-11 16:46:54 +00:00
Alex Richardson
f57b27e3f8 Fix -DBUILD_WITH_STRICT_TMPPATH dtrace builds
Some of the scripts used for libdtrace invoke nawk instead of awk
(for example cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh).
When bootstrapping all tools, we get the nawk -> awk link while building
usr.bin/awk, but when linking/copying the dependencies from the host we
were only adding awk but not nawk.

This was silently generating invalid files when building libdtrace with
BUILD_WITH_STRICT_TMPPATH=1 since those scripts invoke nawk instead of
awk. In addition to adding the missing link this commit also adds
set -e to those scripts to catch errors like this in the future.

Reviewed By:	markj, emaste
Differential Revision: https://reviews.freebsd.org/D26025
2020-08-11 16:46:48 +00:00
Alex Richardson
14267d398f Add CLANG/LLD/LLD to BROKEN_OPTIONS when building on non-FreeBSD
These tools require a bootstrap llvm-tblgen/clang-tblgen and that cannot
be built with the current make infrastructure: the config header is not
correct for Linux/macOS and we don't include the CMakeLists.txt in contrib
so we can't generate one that would be correct.

Reviewed By:	emaste, imp, dim
Differential Revision: https://reviews.freebsd.org/D14245
2020-08-11 16:46:43 +00:00
Alex Richardson
b05fc77a36 Fix bootstrapping of pwd_mkdb after r364049
I moved the bootstrap pwd.h to a subdirectory in r364049 but forgot to
adjust the #include path.
2020-08-11 16:46:38 +00:00
Alex Richardson
313232ddf9 Fix bootstrapping ldd after r362152
r362152 started using DF_1_PIE, which is not present in older versions
of sys/elf_common.h. To fix this include the ELF headers as part of -legacy.
2020-08-11 16:46:33 +00:00
Alex Richardson
1a18ab420b Allow overriding the tool used for stripping binaries
Since the make variable STRIP is already used for other purposes, this
uses STRIPBIN (which is also used for the same purpose by install(1).
This allows using LLVM objcopy to strip binaries instead of the in-tree
elftoolchain objcopy. We make use of this in CheriBSD since passing
binaries generated by our toolchain to elftoolchain strip sometimes results
in assertion failures.

This allows working around https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248516
by specifying STRIPBIN=/path/to/llvm-strip

Obtained from:	CheriBSD
Reviewed By:	emaste, brooks
Differential Revision: https://reviews.freebsd.org/D25988
2020-08-11 16:46:27 +00:00
Mark Johnston
aa5dbc8953 Remove sys/compat/netbsd.
It contained only a header used by ncv(4), which was mainly used on pc98
systems.  Both ncv(4) and pc98 support have long been removed.
2020-08-11 16:40:09 +00:00
Gleb Smirnoff
825398f946 ipfw: make the "frag" keyword accept additional options "mf",
"df", "rf" and "offset".  This allows to match on specific
bits of ip_off field.

For compatibility reasons lack of keyword means "offset".

Reviewed by:	ae
Differential Revision:	https://reviews.freebsd.org/D26021
2020-08-11 15:46:22 +00:00
Mateusz Guzik
3b44443626 devfs: rework si_usecount to track opens
This removes a lot of special casing from the VFS layer.

Reviewed by:	kib (previous version)
Tested by:	pho (previous version)
Differential Revision:	https://reviews.freebsd.org/D25612
2020-08-11 14:27:57 +00:00
Mark Johnston
8bc30d2afd script: Minor cleanups.
- Instead of using isatty() to decide whether to call tcgetattr(), just
  call tcgetattr() directly, since that's all that isatty() does anyway.
- Simplify error handling in termset().  Check for errno != ENOTTY from
  tcgetattr() to handle errors that may be raised while running
  script(1) under a debugger.

PR:		248377
Submitted by:	Soumendra Ganguly <soumendraganguly@gmail.com>
MFC after:	1 week
2020-08-11 14:19:05 +00:00
Hans Petter Selasky
74d3a63559 Use atomic_clear_rel_long() to implement clear_bit_unlock() in the LinuxKPI
after r363842.

Suggested by:	alc@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-08-11 12:41:40 +00:00
Hans Petter Selasky
6ae240797f Need to clone the task struct fields related to RCU aswell in the
LinuxKPI after r359727. This fixes a minor regression issue. Else the
priority tracking won't work properly when both sleepable and
non-sleepable RCU is in use on the same thread.

Bump the __FreeBSD_version to force recompilation of external kernel
modules.

PR:		242272
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-08-11 12:17:46 +00:00
Emmanuel Vadot
a90022d4d1 pkgbase: Replace / with | for PKG_WWW
PKG_WWW contain / char, replace the delimiter by a '|'.

Reported by:	0mp
2020-08-11 10:07:59 +00:00
Emmanuel Vadot
82087d4b68 pkgbase: Add PKG_NAME_PREFIX, PKG_MAINTAINER and PKG_WWW
This is useful for downstream users to customize the packages.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D26019
2020-08-11 08:42:24 +00:00
Hans Petter Selasky
b453d3d239 Use a static initializer for the multicast free tasks.
This makes the SYSINIT() function updated in r364072 superfluous.

Suggested by:	glebius@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-08-11 08:31:40 +00:00
Alexander V. Chernikov
8a0917c35b Do not enter epoch in add_route(), as it is already called in epoch.
Reviewed by:	glebius
2020-08-11 07:23:07 +00:00
Alexander V. Chernikov
136a1f8da8 Make <add|del|change>_route() static to finish the transition to the new kpi.
Discussed with:	glebius
2020-08-11 07:21:32 +00:00
Alexander V. Chernikov
9a00f6d067 Fix rib_subscribe() waitok flag by performing allocation outside epoch.
Make in6_inithead() use rib_subscribe with waitok to achieve reliable
 subscription allocation.

Reviewed by:	glebius
2020-08-11 07:05:30 +00:00
Li-Wen Hsu
fc254a2e4a Fix armv{6,7} build after r364088
Sponsored by:	The FreeBSD Foundation
2020-08-11 05:17:10 +00:00