]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years ago[iwm] if_iwm - Use chan list from ieee80211_scan_state for scan, not ic_channels.
Adrian Chadd [Wed, 26 Jul 2017 05:26:01 +0000 (05:26 +0000)]
[iwm] if_iwm - Use chan list from ieee80211_scan_state for scan, not ic_channels.

* Limiting the channel list with "ifconfig wlan0 chanlist ..." now will
  actually set the list of channels scanned by iwm.

Tested:

* Intel 7260, STA mode, setting chanlist to 1-14 and 36-254, and indeed it does what
  it should!

6 years agoRemove trailing slash (/) for consistency.
Cy Schubert [Wed, 26 Jul 2017 02:05:09 +0000 (02:05 +0000)]
Remove trailing slash (/) for consistency.

6 years agoQuiet a message that sounds far more dire than it really is.
Scott Long [Wed, 26 Jul 2017 01:48:13 +0000 (01:48 +0000)]
Quiet a message that sounds far more dire than it really is.

6 years agoNO_CLEAN: Hide delete-old output.
Bryan Drewery [Tue, 25 Jul 2017 20:51:06 +0000 (20:51 +0000)]
NO_CLEAN: Hide delete-old output.

It is full of distracting noise about UPDATING and may confuse
the user about what is actually being deleted.  It is also
possible to have directories removed on every run with
use of WITHOUT_ knobs that the mtree files do not
account for and for which the directories are incorrectly
in OLD_DIRS currently.

X-MFC-With: r321443
MFC after: 1 month
Sponsored by: Dell EMC Isilon

6 years agoOnly build libzfs_core in 'make libraries' if needed.
Bryan Drewery [Tue, 25 Jul 2017 20:43:37 +0000 (20:43 +0000)]
Only build libzfs_core in 'make libraries' if needed.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoRemove unneeded dependency for libzfs.
Bryan Drewery [Tue, 25 Jul 2017 20:43:26 +0000 (20:43 +0000)]
Remove unneeded dependency for libzfs.

This dependency does nothing since cddl/lib/libzfs is never
added into the 'make libraries' dependency chain
directly.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoImprove the clarity of a comment added in r321385 by not referring to
Marius Strobl [Tue, 25 Jul 2017 20:36:44 +0000 (20:36 +0000)]
Improve the clarity of a comment added in r321385 by not referring to
volatile SDHCI specification lingo.

6 years agoUse the MD __size_t to avoid a dependency on/include of non-MD header files.
Ian Lepore [Tue, 25 Jul 2017 17:39:06 +0000 (17:39 +0000)]
Use the MD __size_t to avoid a dependency on/include of non-MD header files.

This should fix the compilation of the lua 5.3.4 port, among others.

Reported by: Russell Haley <russ.haley@gmail.com>

6 years agoindent(1): add option -tsn for setting tab size.
Piotr Pawel Stefaniak [Tue, 25 Jul 2017 17:04:35 +0000 (17:04 +0000)]
indent(1): add option -tsn for setting tab size.

6 years agoRe-add #endif accidentally deleted in r321484
Enji Cooper [Tue, 25 Jul 2017 16:57:25 +0000 (16:57 +0000)]
Re-add #endif accidentally deleted in r321484

MFC after: 1 month
MFC with: r321455, r321484

6 years agoAllow -DNO_SKIP_DEPEND to override the _SKIP_DEPEND logic.
Bryan Drewery [Tue, 25 Jul 2017 16:46:12 +0000 (16:46 +0000)]
Allow -DNO_SKIP_DEPEND to override the _SKIP_DEPEND logic.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoOnly test ld_pi_odd with LDBL_MANT_DIG == 64 to fix the build
Enji Cooper [Tue, 25 Jul 2017 16:21:22 +0000 (16:21 +0000)]
Only test ld_pi_odd with LDBL_MANT_DIG == 64 to fix the build

The empty (unimplemented) test inputs for sparc64 trigger a -Wtype-limits build
failure because nitems of an empty array is always false, i.e., deadcode.

MFC after: 1 month
MFC with: r321455
Reported by: Jenkins (sparc64 job)

6 years agoMask issues with duplicate definitions for __fnstcw, __fldenv, and __fldcw on
Enji Cooper [Tue, 25 Jul 2017 16:11:36 +0000 (16:11 +0000)]
Mask issues with duplicate definitions for __fnstcw, __fldenv, and __fldcw on
i386 by ignoring -Wmacro-redefined.

This is a bandaid until the code is fixed and will be reverted before MFC.

6 years agobnxt: Implement interrupt coalescing options using sysctl.
Sean Bruno [Tue, 25 Jul 2017 15:33:34 +0000 (15:33 +0000)]
bnxt: Implement interrupt coalescing options using sysctl.

Submitted by:  bhargava.marreddy@broadcom.com
Differential Revision: https://reviews.freebsd.org/D11702

6 years agoRevert r307901 - Inform CC modules about loss events.
Sean Bruno [Tue, 25 Jul 2017 15:08:52 +0000 (15:08 +0000)]
Revert r307901 - Inform CC modules about loss events.

This was discussed between various transport@ members and it was
requested to be reverted and discussed.

Submitted by: Kevin Bowling <kevin.bowling@kev009.com>
Reported by: lawrence
Reviewed by: hiren
Sponsored by: Limelight Networks

6 years agoRevert r308180 - Set slow start threshold more accurrately on loss ...
Sean Bruno [Tue, 25 Jul 2017 15:03:05 +0000 (15:03 +0000)]
Revert r308180 - Set slow start threshold more accurrately on loss ...

This was discussed between various transport@ members and it was
requested to be reverted and discussed.

Submitted by: kevin
Reported by: lawerence
Reviewed by: hiren

6 years agoDon't hold the RM lock during lagg_proto_addport() to avoid an LOR.
Sean Bruno [Tue, 25 Jul 2017 14:41:50 +0000 (14:41 +0000)]
Don't hold the RM lock during lagg_proto_addport() to avoid an LOR.

Submitted by: Kevin Bowling <kevin.bowling@kev009.com>
Reviewed by: mav
MFC after: 1 week
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11711

6 years agoDrop ixgbe RX lock during TCP_LRO processing. This eliminates a "storm"
Sean Bruno [Tue, 25 Jul 2017 14:38:30 +0000 (14:38 +0000)]
Drop ixgbe RX lock during TCP_LRO processing.  This eliminates a "storm"
of LOR detection and a bit of lock release/acquire collision when using LRO.

Submitted by:   Kevin Bowling <kevin.bowling@kev009.com>
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D11712

6 years agoThe test case common.funcs.t_dtrace_contrib.tst_basename_d generates a
Li-Wen Hsu [Tue, 25 Jul 2017 13:18:28 +0000 (13:18 +0000)]
The test case common.funcs.t_dtrace_contrib.tst_basename_d generates a
verifying script which needs being run to complete the test.

While here, add missing shebang.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11716

6 years agospa_import_rootpool should be able to handle an imported root pool
Andriy Gapon [Tue, 25 Jul 2017 13:17:06 +0000 (13:17 +0000)]
spa_import_rootpool should be able to handle an imported root pool

That is required to support reboot -r with a new root filesystem being
on an already imported pool.

PR: 210721
Reported by: Jan Bramkamp <crest_maintainer@rlwinm.de>
MFC after: 2 weeks

6 years agoModify glob patterns and expected output to match FreeBSD's implementation.
Li-Wen Hsu [Tue, 25 Jul 2017 13:14:02 +0000 (13:14 +0000)]
Modify glob patterns and expected output to match FreeBSD's implementation.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11713

6 years agoMake this test case accepts basename() in D script returns "" or "."
Li-Wen Hsu [Tue, 25 Jul 2017 13:11:20 +0000 (13:11 +0000)]
Make this test case accepts basename() in D script returns "" or "."

In Solaris, basename(1) and basename(3) both return "." while being given an
empty string (""), while in BSD (and Linux) basename(1) returns "" and
basename(3) returns "."

While here, also change #!/usr/bin/ksh to #!/usr/bin/env ksh to find ksh in
$PATH

Reviewed by: gnn, markj (earlier version), ngie (earlier version)
Differential Revision: https://reviews.freebsd.org/D11707

6 years agoExplicitly set dynamic variable buffer size.
Li-Wen Hsu [Tue, 25 Jul 2017 13:07:06 +0000 (13:07 +0000)]
Explicitly set dynamic variable buffer size.

We added too many variable assignments in BEGIN block, which will run out of
default auto-configured variable buffer space.  The test VM has 4G RAM which
should be enough for most cases so it's reasonable to increase limitation to
these case.

Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D11676

6 years agoExplicitly set dynamic variable buffer size.
Li-Wen Hsu [Tue, 25 Jul 2017 13:04:24 +0000 (13:04 +0000)]
Explicitly set dynamic variable buffer size.

We added too many variable assignments in BEGIN block, which will run out of
default auto-configured variable buffer space.  The test VM has 4G RAM which
should be enough for most cases so it's reasonable to increase limitation to
these case.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11674

6 years agoAdd an auxiliary subroutine to generate read(2) event while testing.
Li-Wen Hsu [Tue, 25 Jul 2017 13:01:10 +0000 (13:01 +0000)]
Add an auxiliary subroutine to generate read(2) event while testing.

Reviewed by: gnn, ngie
Differential Revision: https://reviews.freebsd.org/D11673

6 years agoAdd a simple script which calls open(2) and others to generate events for
Li-Wen Hsu [Tue, 25 Jul 2017 12:58:03 +0000 (12:58 +0000)]
Add a simple script which calls open(2) and others to generate events for
testing.

This test times-out on a quiet system because there is nobody triggers
syscall::open:entry or syscall::: probe while test execution.

Reviewed by: gnn, markj (earlier version)
Differential Revision: https://reviews.freebsd.org/D11671

6 years agoAdd a simple program which calls sigtimedwait(2) to generate events for testing
Li-Wen Hsu [Tue, 25 Jul 2017 12:52:32 +0000 (12:52 +0000)]
Add a simple program which calls sigtimedwait(2) to generate events for testing

This test timeout on a quiet system because there is nobody triggers
'syscall::*wait*:entry' probe while test execution.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11668

6 years agoRemove duplicate statement.
Michael Tuexen [Tue, 25 Jul 2017 11:05:53 +0000 (11:05 +0000)]
Remove duplicate statement.

6 years agoBuild the 32-bit ARM libstand and loader parts with -fPIC. Many of them are
Andrew Turner [Tue, 25 Jul 2017 10:41:34 +0000 (10:41 +0000)]
Build the 32-bit ARM libstand and loader parts with -fPIC. Many of them are
already built with this flag so libstand should also be build as such.
This will be needed when moving to lld as it refuses to link due to
incompatible relocations.

Sponsored by: DARPA, AFRL

6 years agoFix indent.
Konstantin Belousov [Tue, 25 Jul 2017 09:48:33 +0000 (09:48 +0000)]
Fix indent.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agoReplace unnecessary _KERNEL by double-include protection.
Dmitry Chagin [Tue, 25 Jul 2017 06:59:35 +0000 (06:59 +0000)]
Replace unnecessary _KERNEL by double-include protection.

MFC after: 2 week

6 years agoMark :reduction as an expected failure
Enji Cooper [Tue, 25 Jul 2017 03:56:42 +0000 (03:56 +0000)]
Mark :reduction as an expected failure

It fails with clang 5.0+.

PR: 220989
MFC after: 2 months
MFC with: r321369
Reported by: Jenkins

6 years agoConvert lib/msun/trig_test from TAP to ATF format
Enji Cooper [Tue, 25 Jul 2017 03:55:44 +0000 (03:55 +0000)]
Convert lib/msun/trig_test from TAP to ATF format

Only expose :accuracy and :reduction if !i386, similar to before,
but more holistically to avoid future -Wunused issue with the unused
functions.

MFC after: 1 month

6 years agoRaise WARNS to 1
Enji Cooper [Tue, 25 Jul 2017 03:54:35 +0000 (03:54 +0000)]
Raise WARNS to 1

This will enable warnings with the msun tests.

MFC after: 1 month

6 years agobsdgrep(1): Don't exit before processing every file
Kyle Evans [Tue, 25 Jul 2017 01:50:37 +0000 (01:50 +0000)]
bsdgrep(1): Don't exit before processing every file

Given an empty pattern (i.e. grep "" A B), bsdgrep(1) would previously exit()
with the appropriate exit code upon encountering an empty file. Likely intended
as an optimization, but this behavior is technically incorrect since an empty
pattern should match every line.

PR: 220924
Reviewed by: emaste, cem (earlier version), ngie
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11698

6 years agoUnconditionally install etc/mtree/BSD.debug.dist again
Enji Cooper [Tue, 25 Jul 2017 00:28:23 +0000 (00:28 +0000)]
Unconditionally install etc/mtree/BSD.debug.dist again

r279248 unconditionally installed BSD.debug.dist for ease-of-developer-use.
Restore the previous behavior.

While here, add a comment to note that this is intentional to avoid accidental
future removal.

MFC after: 2 months
MFC with: r321444

6 years agocleandir: Fix ESTALE errors from parallel removals.
Bryan Drewery [Tue, 25 Jul 2017 00:12:48 +0000 (00:12 +0000)]
cleandir: Fix ESTALE errors from parallel removals.

This fixes 'make cleandir' to use the same ordering as 'make cleanobj'.
Meaning that SUBDIR will be recursed before the current directory is
handled.  This avoids an 'rm -rf /usr/obj/usr/src/lib/libc' while
a child 'rm -rf /usr/obj/usr/src/lib/libc/tests' is being ran next,
or even removing the current directory and then recursing into a child
and using the 'missing OBJDIR' logic to remove files rather than the
directory.

The most ideal ordering here would be for 'cleanobj' and 'cleandir' to
simply remove the .OBJDIR and then not recurse at all.  This is only
safe if it is guaranteed that all children directories have no orphaned
files in their source checkout and are only using obj directories.  This
is usually safe from the top-level build targets and when using
WITH_AUTO_OBJ.  Improving the build for those cases is coming.

Reported by: cperciva, scottl
X-MFC-With: r321427
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoRemove ${MTREE} and leverage etc/mtree/Makefile instead with
Enji Cooper [Mon, 24 Jul 2017 23:57:43 +0000 (23:57 +0000)]
Remove ${MTREE} and leverage etc/mtree/Makefile instead with
"make distribution".

This also fixes the fact that BSD.debug.dist was being installed if/when
${MK_DEBUG_FILES} != "no" before this commit.

MFC after: 2 months

6 years agoNO_CLEAN: Utilize delete-old to remove old orphaned libraries/headers in WORLDTMP.
Bryan Drewery [Mon, 24 Jul 2017 23:32:46 +0000 (23:32 +0000)]
NO_CLEAN: Utilize delete-old to remove old orphaned libraries/headers in WORLDTMP.

This prevents situations with -DNO_CLEAN from finding stale headers or
libraries in places that no longer exist or have moved.  It avoids
the need to remove all of WORLDTMP by reusing what we already know
is obsolete.

MFC after: 1 month
Sponsored by: Dell EMC Isilon

6 years agoThe .depend.obj cleanup hacks are only needed with -DNO_CLEAN.
Bryan Drewery [Mon, 24 Jul 2017 23:32:43 +0000 (23:32 +0000)]
The .depend.obj cleanup hacks are only needed with -DNO_CLEAN.

Sponsored by: Dell EMC Isilon

6 years agoAllow disabling dependency tracking if DEPEND_CFLAGS is empty.
Bryan Drewery [Mon, 24 Jul 2017 23:32:40 +0000 (23:32 +0000)]
Allow disabling dependency tracking if DEPEND_CFLAGS is empty.

This falls back on using the guesssed dependencies if so.
Also remove a pre-bmake check while here.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoSlightly simplify logic for which depend file is expected.
Bryan Drewery [Mon, 24 Jul 2017 23:32:36 +0000 (23:32 +0000)]
Slightly simplify logic for which depend file is expected.

This is a NOP.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoMove llvm Options.inc hack from r321433 for NO_CLEAN to lib/clang/libllvm.
Bryan Drewery [Mon, 24 Jul 2017 23:32:24 +0000 (23:32 +0000)]
Move llvm Options.inc hack from r321433 for NO_CLEAN to lib/clang/libllvm.

The files are only ever generated to .OBJDIR, not to WORLDTMP (as a
sysroot) and are only ever included from a compilation.  So using
a beforebuild target here removes the file before the compilation
tries to include it.

MFC after: 2 months
X-MFC-With: r321369

6 years agoFix style and wrap lines to 80 columns in savecore.c.
Mark Johnston [Mon, 24 Jul 2017 21:51:41 +0000 (21:51 +0000)]
Fix style and wrap lines to 80 columns in savecore.c.

No functional change intended.

MFC after: 3 days

6 years agoar: handle partial writes from archive_write_data
Ed Maste [Mon, 24 Jul 2017 21:25:49 +0000 (21:25 +0000)]
ar: handle partial writes from archive_write_data

libarchive may limit a single archive_write_data call to handling
0x7fffffff bytes. Add a loop to handle partial writes.

Reviewed by: kib, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11715

6 years agocxgbe(4): Display some more TOE parameters related to retransmission
Navdeep Parhar [Mon, 24 Jul 2017 19:17:13 +0000 (19:17 +0000)]
cxgbe(4): Display some more TOE parameters related to retransmission
and keepalive in the sysctl MIB.  Provide tunables to change some of
these parameters.  These are supposed to be setup by the firmware so
these tunables are for experimentation only.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoAdd some .ORDER for distrib-dirs, distribute, distribution and distributeworld.
Bryan Drewery [Mon, 24 Jul 2017 18:54:56 +0000 (18:54 +0000)]
Add some .ORDER for distrib-dirs, distribute, distribution and distributeworld.

Reported by: Mark Millard
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoCleanup stale Options.inc files from the previous libllvm build for
Dimitry Andric [Mon, 24 Jul 2017 18:52:40 +0000 (18:52 +0000)]
Cleanup stale Options.inc files from the previous libllvm build for
clang 4.0.0.  Otherwise, these can get included before the two newly
generated ones (which are different) for clang 5.0.0.

Reported by: Mark Millard
MFC after: 2 months
X-MFC-With: r321369

6 years agoUse __DEFAULT_DEPENDENT_OPTIONS for articulating dependency relationship
Enji Cooper [Mon, 24 Jul 2017 18:21:01 +0000 (18:21 +0000)]
Use __DEFAULT_DEPENDENT_OPTIONS for articulating dependency relationship
between MK_STALE_STAGED and MK_STAGING instead of using equivalent ad hoc
logic.

MFC after: 1 month

6 years agofix typo
Warner Losh [Mon, 24 Jul 2017 18:10:42 +0000 (18:10 +0000)]
fix typo

6 years agoPROGS: Fix ESTALE errors on NFS while cleaning in directories with PROGS.
Bryan Drewery [Mon, 24 Jul 2017 17:54:03 +0000 (17:54 +0000)]
PROGS: Fix ESTALE errors on NFS while cleaning in directories with PROGS.

- Only recurse on cleanobj/cleandir if there is no .OBJDIR being used.
  If we don't recurse then bsd.obj.mk will just rm -rf the OBJDIR dir.
- When recursing on cleanobj/cleandir don't remove dependfiles/dirs
  redundantly from the child and main processes.  Meaning '.depend', and
  'tags', and '.depend.*' will now only be removed from the main
  process.
- Stop recursing on 'cleandepend' since the main process can handle
  removing all files via the default glob patterns in CLEANDEPENDFILES.
- This reverts r288201, by readding recursion on 'cleanobj', due to
  r291635 changing how bsd.subdir.mk handles recursion.

This is primarily targeting ESTALE NFS errors from rm(1) during a
buildworld but is also a performance optimization as both issues fixed
were redundant anyway.

Reported by: cperciva, scottl
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agocleanobj: Unhide removal of directory.
Bryan Drewery [Mon, 24 Jul 2017 17:53:45 +0000 (17:53 +0000)]
cleanobj: Unhide removal of directory.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoFix whitespace on a line in fix(..) accidentally missed in r321424
Enji Cooper [Mon, 24 Jul 2017 17:29:56 +0000 (17:29 +0000)]
Fix whitespace on a line in fix(..) accidentally missed in r321424

MFC after: 1 month
MFC with: r321424

6 years agoStyle cleanup: delete spurious trailing whitespace
Enji Cooper [Mon, 24 Jul 2017 17:27:21 +0000 (17:27 +0000)]
Style cleanup: delete spurious trailing whitespace

MFC after: 1 month

6 years agoChange the interactions of the interface functions with the "meta" and
Alan Cox [Mon, 24 Jul 2017 17:23:53 +0000 (17:23 +0000)]
Change the interactions of the interface functions with the "meta" and
"leaf" functions for alloc, free, and fill.  After the change, the interface
functions call "meta" unconditionally, and the "meta" functions recur
unconditionally in looping over their descendants. The "meta" functions
start with a validity test, and then a test for the "leaf" case, before
falling into the general recursive case.  This simplifies and shrinks the
code, and, for "free" and "fill" moves panic tests that check the same meta
node repeatedly in a loop to a place that will have each node tested once.

Remove irrelevant null checks from blist_free and blist_fill.

Make the code that initializes a meta node the same in blist_meta_alloc and
blist_meta_fill.

Parenthesize return expressions in blst_meta_fill.

Submitted by: Doug Moore <dougm@rice.edu>
MFC after: 1 week

6 years agoImprove the ktrace(1) man page to make it slightly more obvious that there
Edward Tomasz Napierala [Mon, 24 Jul 2017 16:58:54 +0000 (16:58 +0000)]
Improve the ktrace(1) man page to make it slightly more obvious that there
are _two_ options that control its behaviour wrt child processes; slightly
improve the example[1], and add Xrefs.

Discussed with: wblock [1]
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAdd a few more object files to liblldb, which should solve errors when
Dimitry Andric [Mon, 24 Jul 2017 16:33:06 +0000 (16:33 +0000)]
Add a few more object files to liblldb, which should solve errors when
linking the lldb executable in some cases.  In particular, when the
-ffunction-sections -fdata-sections options are turned off, or
ineffective.

Reported by: Shawn Webb, Mark Millard
MFC after: 2 months
X-MFC-With: r308421

6 years agolld 5.0 supports filter libraries, so enable linker feature flag
Ed Maste [Mon, 24 Jul 2017 15:39:09 +0000 (15:39 +0000)]
lld 5.0 supports filter libraries, so enable linker feature flag

Also switch the logic to enable this for any non-lld linker, since
filter library support is fairly simple and is very likely supported
by any other linker capable of linking the FreeBSD base system.

MFC after: 2 months
MFC with: r321369
Sponsored by: The FreeBSD Foundation

6 years agoImport bmake-20170720
Simon J. Gerraty [Mon, 24 Jul 2017 04:38:05 +0000 (04:38 +0000)]
Import bmake-20170720

Includes fix for compat handling of interrupts.

6 years agohyperv/hn: Ignore LINK_SPEED_CHANGE status.
Sepherosa Ziehau [Mon, 24 Jul 2017 04:00:43 +0000 (04:00 +0000)]
hyperv/hn: Ignore LINK_SPEED_CHANGE status.

This status will be reported if the backend NIC is wireless; it's not
useful.  Due to the high frequency of the reporting, this could be
pretty annoying; ignore it.

MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11651

6 years agorndis: Add LINK_SPEED_CHANGE status
Sepherosa Ziehau [Mon, 24 Jul 2017 03:59:50 +0000 (03:59 +0000)]
rndis: Add LINK_SPEED_CHANGE status

Reviewed by: hselasky
MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11650

6 years agohyperv/hn: Export VF list and VF-HN mapping
Sepherosa Ziehau [Mon, 24 Jul 2017 03:52:32 +0000 (03:52 +0000)]
hyperv/hn: Export VF list and VF-HN mapping

The VF-HN map will be used later on to implement "transparent VF".

MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11618

6 years agoethernet: Add ethernet interface attached event and devctl notification.
Sepherosa Ziehau [Mon, 24 Jul 2017 03:32:10 +0000 (03:32 +0000)]
ethernet: Add ethernet interface attached event and devctl notification.

ifnet_arrival_event may not be adequate under certain situation; e.g.
when the LLADDR is needed.  So the ethernet ifattach event is announced
after all necessary bits are setup.

MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11617

6 years agoImport bmake-20170720
Simon J. Gerraty [Mon, 24 Jul 2017 00:52:52 +0000 (00:52 +0000)]
Import bmake-20170720

compat.c: pass SIGINT etc onto child and wait for it to exit
before we self-terminate.

6 years agonet80211: do not allow to unload rate control module if it is still in use.
Andriy Voskoboinyk [Sun, 23 Jul 2017 22:38:00 +0000 (22:38 +0000)]
net80211: do not allow to unload rate control module if it is still in use.

Keep 'nrefs' counter up-to-date, so 'kldunload wlan_amrr' with 1+ active
wlan(4) interface will not lead to kernel panic.

MFC after: 5 days

6 years agoAdd common code to support realtime clocks that store year without century.
Ian Lepore [Sun, 23 Jul 2017 21:28:00 +0000 (21:28 +0000)]
Add common code to support realtime clocks that store year without century.

Most realtime clocks store the year as 2 BCD digits.  Some add a century bit
to extend the range another hundred years.  Every clock driver has its own
code to determine the century and pass a full year value to clock_ct_to_ts().
Now clock drivers can just convert BCD to bin and store the result in the
clocktime struct and let the common code figure out the century.  Clocks
with a century bit can just add 100 to year if the century bit is on.

6 years agoChange my email address to wulf@FreeBSD.org in copyright headers.
Vladimir Kondratyev [Sun, 23 Jul 2017 20:41:58 +0000 (20:41 +0000)]
Change my email address to wulf@FreeBSD.org in copyright headers.

Approved by: gonzo (mentor)
MFC after: 2 weeks

6 years agoevdev: Macroize common locking sequences
Vladimir Kondratyev [Sun, 23 Jul 2017 20:35:26 +0000 (20:35 +0000)]
evdev: Macroize common locking sequences

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks

6 years agoevdev: style(9), sort headers alphabetically
Vladimir Kondratyev [Sun, 23 Jul 2017 20:32:54 +0000 (20:32 +0000)]
evdev: style(9), sort headers alphabetically

Pointed out by: bde
Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks

6 years agoindent(1): better alignment of comments on code.
Piotr Pawel Stefaniak [Sun, 23 Jul 2017 20:25:53 +0000 (20:25 +0000)]
indent(1): better alignment of comments on code.

If aligning the beginning of a comment to -cn would mean no space between
code and the comment, align it to the next tab stop.

6 years agoAddress a compilation warning on some architectures that was introduced
Alan Cox [Sun, 23 Jul 2017 19:35:14 +0000 (19:35 +0000)]
Address a compilation warning on some architectures that was introduced
by the previous change, r321386.

Reported by: ian
MFC after: 10 days
X-MFC after: r321386

6 years agoAdd myself (mw) as a src committer and cognet as my mentor.
Marcin Wojtas [Sun, 23 Jul 2017 19:00:28 +0000 (19:00 +0000)]
Add myself (mw) as a src committer and cognet as my mentor.

Reviewed by: cognet (mentor)
Approved by: cognet (mentor)

6 years agocxgbe(4): Install the firmware bundled with the driver to the card if it
Navdeep Parhar [Sun, 23 Jul 2017 18:10:47 +0000 (18:10 +0000)]
cxgbe(4): Install the firmware bundled with the driver to the card if it
doesn't seem to have one.  This lets the driver recover automatically
from incomplete firmware upgrades (panic, reboot, power loss, etc. in
the middle of an upgrade).

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoDon't use incorrect hardcoded path to ksh -- use /usr/bin/env
Enji Cooper [Sun, 23 Jul 2017 17:57:00 +0000 (17:57 +0000)]
Don't use incorrect hardcoded path to ksh -- use /usr/bin/env
to find ksh instead

MFC after: 1 month

6 years agoUtilize pmap_enter(..., psind=1) in vm_fault_soft_fast() on amd64. (The
Alan Cox [Sun, 23 Jul 2017 16:28:13 +0000 (16:28 +0000)]
Utilize pmap_enter(..., psind=1) in vm_fault_soft_fast() on amd64.  (The
Differential Revision discusses the benefits of this change.)

Add a function, vm_reserv_to_superpage(), that returns the superpage
containing the specified base page.

Reviewed by: kib, markj
Tested by: pho
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D11556

6 years agoo Add support for eMMC HS200 and HS400 bus speed modes at 200 MHz to
Marius Strobl [Sun, 23 Jul 2017 16:11:47 +0000 (16:11 +0000)]
o Add support for eMMC HS200 and HS400 bus speed modes at 200 MHz to
  sdhci(4), mmc(4) and mmcsd(4). For the most part, this consists of:
  - Correcting and extending the infrastructure for negotiating and
    enabling post-DDR52 modes already added as part of r315598. In
    fact, HS400ES now should work as well but hasn't been activated
    due to lack of corresponding hardware.
  - Adding support executing standard SDHCI initial tuning as well
    as re-tuning as required for eMMC HS200/HS400 and the fast UHS-I
    SD card modes. Currently, corresponding methods are only hooked
    up to the ACPI and PCI front-ends of sdhci(4), though. Moreover,
    sdhci(4) won't offer any modes requiring (re-)tuning to the MMC/SD
    layer in order to not break operations with other sdhci(4) front-
    ends. Likewise, sdhci(4) now no longer offers modes requiring the
    set_uhs_timing method introduced in r315598 to be implemented/
    hooked up (previously, this method was used with DDR52 only, which
    in turn is only available with Intel controllers so far, i. e. no
    such limitation was necessary before). Similarly for 1.2/1.8 V VCCQ
    support and the switch_vccq method.
  - Addition of locking to the IOCTL half of mmcsd(4) to prevent races
    with detachment and suspension, especially since it's required to
    immediately switch away from RPMB partitions again after an access
    to these (so re-tuning can take place anew, given that the current
    eMMC specification v5.1 doesn't allow tuning commands to be issued
    with a RPMB partition selected). Therefore, the existing part_mtx
    lock in the mmcsd(4) softc is additionally renamed to disk_mtx in
    order to denote that it only refers to the disk(9) half, likewise
    for corresponding macros.

  On the system where the addition of DDR52 support increased the read
  throughput to ~80 MB/s (from ~45 MB/s at high speed), HS200 yields
  ~154 MB/s and HS400 ~187 MB/s, i. e. performance now has more than
  quadrupled compared to pre-r315598.

  Also, with the advent of (re-)tuning support, most infrastructure
  necessary for SD card UHS-I modes up to SDR104 now is also in place.
  Note, though, that the standard SDHCI way of (re-)tuning is special
  in several ways, which also is why sending the actual tuning requests
  to the device is part of sdhci(4). SDHCI implementations not following
  the specification, MMC and non-SDHCI SD card controllers likely will
  use a generic implementation in the MMC/SD layer for executing tuning,
  which hasn't been written so far, though.

  However, in fact this isn't a feature-only change; there are boards
  based on Intel Bay Trail where DDR52 is problematic and the suggested
  workaround is to use HS200 mode instead. So far exact details are
  unknown, however, i. e. whether that's due to a defect in these SoCs
  or on the boards.

  Moreover, due to the above changes requiring to be aware of possible
  MMC siblings in the fast path of mmc(4), corresponding information
  now is cached in mmc_softc. As a side-effect, mmc_calculate_clock(),
  mmc_delete_cards(), mmc_discover_cards() and mmc_rescan_cards() now
  all are guaranteed to operate on the same set of devices as there no
  longer is any use of device_get_children(9), which can fail in low
  memory situations. Likewise, mmc_calculate_clock() now longer will
  trigger a panic due to the latter.

o Fix a bug in the failure reporting of mmcsd_delete(); in case of an
  error when the starting block of a previously stored erase request
  is used (in order to be able to erase a full erase sector worth of
  data), the starting block of the newly supplied bio_pblkno has to be
  returned for indicating no progress. Otherwise, upper layers might
  be told that a negative number of BIOs have been completed, leading
  to a panic.

o Fix 2 bugs on resume:
  - Things done in fork1(9) like the acquisition of an SX lock or the
    sleepable memory allocation are incompatible with a MTX_DEF taken.
    Thus, mmcsd_resume() must not call kproc_create(9), which in turn
    uses fork1(9), with the disk_mtx (formerly part_mtx) held.
  - In mmc_suspend(), the bus is powered down, which in the typical
    case of a device being selected at the time of suspension, causes
    the device deselection as part of the bus acquisition by mmc(4) in
    mmc_scan() to fail as the bus isn't powered up again before later
    in mmc_go_discovery(). Thus, power down with the bus acquired in
    mmc_suspend(), which will trigger the deselection up-front.

o Fix a memory leak in mmcsd_ioctl() in case copyin(9) fails. [1]

o Fix missing variable initialization in mmc_switch_status(). [2]

o Fix R1_SWITCH_ERROR detection in mmc_switch_status(). [3]

o Handle the case of device_add_child(9) failing, for example due to
  a memory shortage, gracefully in mmc(4) and sdhci(4), including not
  leaking memory for the instance variables in case of mmc(4) (which
  might or might not fix [4] as the latter problem has been discovered
  independently).

o Handle the case of an unknown SD CSD version in mmc_decode_csd_sd()
  gracefully instead of calling panic(9).

o Again, check and handle the return values of some additional function
  calls in mmc(4) instead of assuming that everything went right or mark
  non-fatal errors by casting the return value to void.

o Correct a typo in the Linux IOCTL compatibility; it should have been
  MMC_IOC_MULTI_CMD rather than MMC_IOC_CMD_MULTI.

o Now that we are reaching ever faster speeds (more improvement in this
  regard is to be expected when adding ADMA support to sdhci(4)), apply
  a few micro-optimizations like predicting mmc(4) and sdhci(4) debugging
  to be off or caching erase sector and maximum data sizes as well support
  of block addressing in mmsd(4) (instead of doing 2 indirections on every
  read/write request for determining the maximum data size for example).

Reported by: Coverity
CID: 1372612 [1], 1372624 [2], 1372594 [3], 1007069 [4]

6 years agoindent(1): rename the profile file.
Piotr Pawel Stefaniak [Sun, 23 Jul 2017 15:07:52 +0000 (15:07 +0000)]
indent(1): rename the profile file.

Currently, indent's testing mechanism will attempt to apply options from
a file named ${test}.pro - and this test's filename is comments.0.

6 years agoindent(1): don't produce unnecessary blank lines.
Piotr Pawel Stefaniak [Sun, 23 Jul 2017 14:33:04 +0000 (14:33 +0000)]
indent(1): don't produce unnecessary blank lines.

Don't force a blank line between an opening brace and a block comment -- not
even if -bbb (blank lines before block comments) is on.

6 years agoindent(1): don't produce unneeded space character in function declarators.
Piotr Pawel Stefaniak [Sun, 23 Jul 2017 14:04:45 +0000 (14:04 +0000)]
indent(1): don't produce unneeded space character in function declarators.

6 years ago[ar933x] make carambola2 work again!
Adrian Chadd [Sun, 23 Jul 2017 07:10:41 +0000 (07:10 +0000)]
[ar933x] make carambola2 work again!

* Add in the hints needed for AR933x ath(4) support - this is the nicer way
  that allows ath to be a module;
* ATH_EEPROM_FIRMWARE is also required for all AR933x chipsets.

Tested:

* Carambola2, AR933x

6 years ago[ar933x] re-add the ar71xx_apb device for AR933x.
Adrian Chadd [Sun, 23 Jul 2017 07:02:10 +0000 (07:02 +0000)]
[ar933x] re-add the ar71xx_apb device for AR933x.

This prevents the console from working!

Tested:

* carambola2, AR933x

6 years agoAdd support for pmap_enter(..., psind=1) to the amd64 pmap. In other words,
Alan Cox [Sun, 23 Jul 2017 06:33:58 +0000 (06:33 +0000)]
Add support for pmap_enter(..., psind=1) to the amd64 pmap.  In other words,
add support for explicitly requesting that pmap_enter() create a 2MB page
mapping.  (Essentially, this feature allows the machine-independent layer to
create superpage mappings preemptively, and not wait for automatic promotion
to occur.)

Export pmap_ps_enabled() to the machine-independent layer.

Add a flag to pmap_pv_insert_pde() that specifies whether it should fail or
reclaim a PV entry when one is not available.

Refactor pmap_enter_pde() into two functions, one by the same name, that is
a general-purpose function for creating PDE PG_PS mappings, and another,
pmap_enter_2mpage(), that is used to prefault 2MB read- and/or execute-only
mappings for execve(2), mmap(2), and shmat(2).

Submitted by: Yufeng Zhou <yz70@rice.edu> (an earlier version)
Reviewed by: kib, markj
Tested by: pho
MFC after: 10 days
Differential Revision: https://reviews.freebsd.org/D11556

6 years agoIn vm_page_ps_test(), always check that the base pages within the specified
Alan Cox [Sun, 23 Jul 2017 05:54:56 +0000 (05:54 +0000)]
In vm_page_ps_test(), always check that the base pages within the specified
superpage all belong to the same object.  To date, that check has not been
needed, but upcoming changes require it.  (See the Differential Revision.)

Reviewed by: kib, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11556

6 years agolinuxkpi compiler.h: avoid gcc -Wunused-value in dummy expressions
Ryan Libby [Sat, 22 Jul 2017 21:29:44 +0000 (21:29 +0000)]
linuxkpi compiler.h: avoid gcc -Wunused-value in dummy expressions

It looks like the __acquire and __release macros are for the consumption
of static analysis tools and have no semantic effect.  Transform the
definitions from constant expressions to empty statements in order to
avoid -Wunused-value from gcc.

Likewise avoid future warnings for __chk_{user,io}_ptr, but with a cast
to void, because it looks like some linux kernel code may use those in
expression contexts.

Reviewed by: hselasky, markj
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11695

6 years agoDo not allocate struct kinfo_vmobject on stack.
Konstantin Belousov [Sat, 22 Jul 2017 13:33:06 +0000 (13:33 +0000)]
Do not allocate struct kinfo_vmobject on stack.

Its size is 1184 bytes.

Noted by: eugen
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoHandle WITH/WITHOUT_PF in libsysdecode
Kristof Provost [Sat, 22 Jul 2017 12:51:19 +0000 (12:51 +0000)]
Handle WITH/WITHOUT_PF in libsysdecode

Only filter out the PF ioctls if we're building without pf support.
Until now those were always filtered out, so truss did not show symbolic
names for pf ioctls.

Differential Revision: https://reviews.freebsd.org/D11629

6 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
Dimitry Andric [Sat, 22 Jul 2017 11:08:25 +0000 (11:08 +0000)]
Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
5.0.0 (trunk r308421).  Upstream has branched for the 5.0.0 release,
which should be in about a month.  Please report bugs and regressions,
so we can get them into the release.

Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11
support to build; see UPDATING for more information.

MFC after: 2 months

6 years agoUse the "tree" word in ps(1) -d option description, to make it easier
Edward Tomasz Napierala [Sat, 22 Jul 2017 10:38:44 +0000 (10:38 +0000)]
Use the "tree" word in ps(1) -d option description, to make it easier
to find.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoStyle(9) whitespace fix.
Dmitry Chagin [Sat, 22 Jul 2017 09:03:40 +0000 (09:03 +0000)]
Style(9) whitespace fix.

MFC after: 1 week

6 years agoFix top(1) output when zfs.ko is loaded but ZFS is not in use.
Mark Johnston [Fri, 21 Jul 2017 23:53:48 +0000 (23:53 +0000)]
Fix top(1) output when zfs.ko is loaded but ZFS is not in use.

Reviewed by: allanjude
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11693

6 years agoMerge ^/head r321307 through r321350.
Dimitry Andric [Fri, 21 Jul 2017 18:54:34 +0000 (18:54 +0000)]
Merge ^/head r321307 through r321350.

6 years agoSet tentative merge dates, bump __FreeBSD_version.
Dimitry Andric [Fri, 21 Jul 2017 18:53:43 +0000 (18:53 +0000)]
Set tentative merge dates, bump __FreeBSD_version.

6 years agoImprove publication of the newly allocated snapdata.
Konstantin Belousov [Fri, 21 Jul 2017 18:42:35 +0000 (18:42 +0000)]
Improve publication of the newly allocated snapdata.

For freshly allocated snapdata, Lock sn_lock in advance, so
si_snapdata readers see the locked snapdata and not race.

For existing snapdata, if the thread was put to sleep waiting for
sn_lock, re-read si_snapdata.  This either closes the race or makes
the reliance on LK_DRAIN less important.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

6 years agoUnlock correct lock in ffs_snapblkfree().
Konstantin Belousov [Fri, 21 Jul 2017 18:36:17 +0000 (18:36 +0000)]
Unlock correct lock in ffs_snapblkfree().

It is possible for ffs_snapblkfree() to race and lock snaplock while
the devvp snapdata is instantiated, but no snapshots exist.  In this
case the loop over snapshots in ffs_snapblkfree() is not executed, and
the local variable vp is left initialized to NULL.

Unlock using &sn->sn_lock and not vp->v_vnlock.  For the inodes on the
snapshot list, the locks are same.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

6 years agoAccount for lock recursion when transfering snaplock to the vnode lock
Konstantin Belousov [Fri, 21 Jul 2017 18:28:27 +0000 (18:28 +0000)]
Account for lock recursion when transfering snaplock to the vnode lock
in ffs_snapremove().

Apparently ffs_snapremove() may be called with the snap lock recursed,
at least one trace demonstrated this when snapshot vnode was unlinked
while synced.  It was inactivated from the syncer thread.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

6 years agoPull in r295886 from upstream clang trunk (by Richard Smith):
Dimitry Andric [Fri, 21 Jul 2017 17:59:54 +0000 (17:59 +0000)]
Pull in r295886 from upstream clang trunk (by Richard Smith):

  PR32034: Evaluate _Atomic(T) in-place when T is a class or array type.

  This is necessary in order for the evaluation of an _Atomic
  initializer for those types to have an associated object, which an
  initializer for class or array type needs.

This fixes an assertion when building recent versions of LinuxCNC.

Reported by: trasz
PR: 220883
MFC after: 1 week

6 years agoDo not update stats counter in SWI context. Defer to the already existing
Sean Bruno [Fri, 21 Jul 2017 17:42:54 +0000 (17:42 +0000)]
Do not update stats counter in SWI context.  Defer to the already existing
admin thread.

Submitted by: Matt Macy <mmacy@mattmacy.io>
Sponsored by: Limelight Networks

6 years ago__pcpu: gcc -Wredundant-decls
Ryan Libby [Fri, 21 Jul 2017 17:11:36 +0000 (17:11 +0000)]
__pcpu: gcc -Wredundant-decls

Pollution from counter.h made __pcpu visible in amd64/pmap.c.  Delete
the existing extern decl of __pcpu in amd64/pmap.c and avoid referring
to that symbol, instead accessing the pcpu region via PCPU_SET macros.
Also delete an unused extern decl of __pcpu from mp_x86.c.

Reviewed by: kib
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11666

6 years agoRespect INSTALL_AS_USER for FILES.
Bryan Drewery [Fri, 21 Jul 2017 16:14:35 +0000 (16:14 +0000)]
Respect INSTALL_AS_USER for FILES.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoProperly set userid for truncate_test.
Bryan Drewery [Fri, 21 Jul 2017 16:14:06 +0000 (16:14 +0000)]
Properly set userid for truncate_test.

MFC after: 1 week
Sponsored by: Dell EMC Isilon