freebsd.git
12 hours agoRemove the unused mutex since r273220. master github/master
loos [Fri, 28 Jul 2017 04:41:57 +0000 (04:41 +0000)]
Remove the unused mutex since r273220.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)

13 hours agoFix style bugs in ksyms.c.
markj [Fri, 28 Jul 2017 03:18:18 +0000 (03:18 +0000)]
Fix style bugs in ksyms.c.

No functional change intended.

MFC after: 3 days

13 hours agoRestrict permissions on /dev/ksyms to 0400.
markj [Fri, 28 Jul 2017 03:14:31 +0000 (03:14 +0000)]
Restrict permissions on /dev/ksyms to 0400.

The ksyms(4) device was added specifically for use by lockstat(1), which
as a DTrace consumer must run as root.

Discussed with: emaste
MFC after: 3 days

14 hours agoAllow _.disk.image to be specified.
imp [Fri, 28 Jul 2017 02:00:03 +0000 (02:00 +0000)]
Allow _.disk.image to be specified.

Submitted by: ask at develooper dot com (reworked to new structure)
PR: 199191
Sponsored by: Netflix
MFC After: 3 days

14 hours agoEnsure that ordinary files that happen to start with .git, .hg and
imp [Fri, 28 Jul 2017 01:59:58 +0000 (01:59 +0000)]
Ensure that ordinary files that happen to start with .git, .hg and
.cvs into the image.

This makes .gitignore files in the working tree appear in the final
tree...

PR: 192178
Submitted by: Jason Unovitch
Sponsored by: Netflix
MFC After: 3 days

14 hours agoProperly expand shell glob characters in NANO_PACKAGE_LIST.
imp [Fri, 28 Jul 2017 01:59:53 +0000 (01:59 +0000)]
Properly expand shell glob characters in NANO_PACKAGE_LIST.

The defualt NANO_PACKAGE_LIST is *, which fails to work
properly. Expand glob characters and make sure that we install the
special pkg package first.

Sponsored by: Netflix
Submitted by: wout at canodus dot be
PR: 219405
MFC After: 3 days

15 hours ago[ar71xx] get rid of ath_pci - it's built as a module now.
adrian [Fri, 28 Jul 2017 01:17:38 +0000 (01:17 +0000)]
[ar71xx] get rid of ath_pci - it's built as a module now.

17 hours agoFix TEX index acquisition using L2 attributes
zbb [Thu, 27 Jul 2017 23:14:17 +0000 (23:14 +0000)]
Fix TEX index acquisition using L2 attributes

The TEX index is selected using (TEX0 C B) bits
from the L2 descriptor. Use correct index by masking
and shifting those bits accordingly.

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

17 hours agoDrop IXL RX lock during TCP_LRO, fixes LOR mahem while holding the RX
sbruno [Thu, 27 Jul 2017 23:01:07 +0000 (23:01 +0000)]
Drop IXL RX lock during TCP_LRO, fixes LOR mahem while holding the RX
queue lock when the uppoer stack is called inside TCP_LRO

Submitted by: Kevin Bowling <kevin.bowling@kev009.com>
Reviewed by: erj
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11724

17 hours agoSlight restructure of iflib_busdma_load_mbuf_sg() to fix accounting
sbruno [Thu, 27 Jul 2017 22:53:47 +0000 (22:53 +0000)]
Slight restructure of iflib_busdma_load_mbuf_sg() to fix accounting
when m_collapse() fails.

Submitted by: krzystof.galazka@intel.com
Reviewed by: Jeb Cramer <cramerj@intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D11476

19 hours agoDeprecate unused int isc_max_txqsets and int isc_max_rxqsets as they
sbruno [Thu, 27 Jul 2017 21:21:43 +0000 (21:21 +0000)]
Deprecate unused int isc_max_txqsets and int isc_max_rxqsets as they
were redundant and not being used to set anything up.

Submitted by: Matt Macy <mmacy@mattmacy.io>
Reported by: Jeb Cramer <cramerj@intel.com>
Sponsored by: Limelight Networks

19 hours agoReplace the checks for MNTK_UNMOUNTF with a macro that does the same thing.
rmacklem [Thu, 27 Jul 2017 20:55:31 +0000 (20:55 +0000)]
Replace the checks for MNTK_UNMOUNTF with a macro that does the same thing.

This patch defines a macro that checks for MNTK_UNMOUNTF and replaces
explicit checks with this macro. It has no effect on semantics, but
prepares the code for a future patch where there will also be a
NFS specific flag for "forced dismount about to occur".

Suggested by: kib
MFC after: 2 weeks

20 hours agoMake it possible to request nosys logging to console.
kib [Thu, 27 Jul 2017 20:45:41 +0000 (20:45 +0000)]
Make it possible to request nosys logging to console.

New kern.lognosys values are
1 - log to ctty
2 - log to console
3 - log to both.

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

23 hours agoAllwinner A64: fix typo
manu [Thu, 27 Jul 2017 17:51:51 +0000 (17:51 +0000)]
Allwinner A64: fix typo

'pll_ddr0' is the dram parent, not 'pll_ddr'

24 hours agoMake the number of children for pctrie node available outside subr_pctrie.c.
kib [Thu, 27 Jul 2017 16:40:14 +0000 (16:40 +0000)]
Make the number of children for pctrie node available outside subr_pctrie.c.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D11435

25 hours agoRemove duplicate assignments from r321622.
ken [Thu, 27 Jul 2017 15:51:56 +0000 (15:51 +0000)]
Remove duplicate assignments from r321622.

Submitted by: mav
MFC after: 3 days
Sponsored by: Spectra Logic

25 hours agoFix probing FC targets with hard addressing turned on.
ken [Thu, 27 Jul 2017 15:33:57 +0000 (15:33 +0000)]
Fix probing FC targets with hard addressing turned on.

This largely reverts FreeBSD SVN change 289937 from October 25th, 2015.

The intent of that change was to keep loop IDs persistent across
chip reinits.

The problem is that the change turned on the PREVLOOP /
PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the
Qlogic chip to not participate in the loop if it can't get the
requested loop address.  It also turned off soft addressing on 2400
(4Gb) and newer controllers.

The isp(4) driver defaults to loop address 0, and the tape drives
I have tested default to loop address 0 if hard addressing is turned
on.  So when hard loop addressing is turned on on the drive, the isp(4)
driver just refuses to participate in the loop.

The solution is to largely revert that change.  I left some elements
in place that are related to virtual ports, since they were new.

This does work with IBM tape drives with hard and soft addressing
turned on.  I have tested it with 4Gb, 8Gb, and 16Gb controllers.

sys/dev/isp.c:
Largely revert FreeBSD SVN change 289937.  I left the
ispmbox.h changes in place.

Don't use the PREV_ADDRESS bit on initialization.  It tells
the chip to not participate if it can't get the requested
loop ID.

Do use soft addressing on 2400 and newer chips.

Use hard addressing when the user has requested a specific
initiator ID.  (hint.isp.X.iid=N in /boot/loader.conf)

Leave some of the virtual port options from that change in
place, but don't turn on the PREV_ADDRESS bit.

Reviewed by: mav
MFC after: 3 days
Sponsored by: Spectra Logic

25 hours agoAlways set the receive mask in loader.efi. Some UEFI implementations set
andrew [Thu, 27 Jul 2017 15:06:34 +0000 (15:06 +0000)]
Always set the receive mask in loader.efi. Some UEFI implementations set
this to be too restrictive. We need to have both broadcast and unicast
enabled for loader to work. Set them in all cases to ensure this is true.

This allows the Cavium ThunderX 2s in the netperf cluster to netboot using
a USB NIC.

PR: 221001
Reviewed by: emaste, tsoome
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11732

26 hours agoFix singular/plural "users" output.
mav [Thu, 27 Jul 2017 14:34:57 +0000 (14:34 +0000)]
Fix singular/plural "users" output.

It was broken during libxo'fication.

PR: 221039
Submitted by: timur@
MFC after: 1 week

27 hours agoBump the image size for BANANAPI and CUBIEBOARD2 to 1.5G, as
gjb [Thu, 27 Jul 2017 13:37:21 +0000 (13:37 +0000)]
Bump the image size for BANANAPI and CUBIEBOARD2 to 1.5G, as
1G is no longer large enough.

Reported by: manu
Sponsored by: The FreeBSD Foundation

27 hours agoAfter inpcb route caching was put back in place there is no need for
bz [Thu, 27 Jul 2017 13:03:36 +0000 (13:03 +0000)]
After inpcb route caching was put back in place there is no need for
flowtable anymore (as flowtable was never considered to be useful in
the forwarding path).

Reviewed by: np
Differential Revision: https://reviews.freebsd.org/D11448

28 hours agogenericize target exclusion for missing external toolchain
emaste [Thu, 27 Jul 2017 12:29:31 +0000 (12:29 +0000)]
genericize target exclusion for missing external toolchain

Previously we excluded riscv from make universe / tinderbox if the
required xtoolchain package was not installed. Make that logic generic
so that we can loop over multiple architectures, in preparation to test
patches to have other architectures rely on external toolchain.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11652

32 hours agoUse MFENCE to serialize RDTSC on non-Intel CPUs.
kib [Thu, 27 Jul 2017 08:37:07 +0000 (08:37 +0000)]
Use MFENCE to serialize RDTSC on non-Intel CPUs.

Kernel already used the stronger barrier instruction for AMDs, correct
the userspace fast gettimeofday() implementation as well.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D11728

32 hours agoAllow to specify targets by absolute paths in libmap.conf.
kib [Thu, 27 Jul 2017 08:33:31 +0000 (08:33 +0000)]
Allow to specify targets by absolute paths in libmap.conf.

Submitted by: Tatu Kilappa <tatu.kilappa@iki.fi>
PR: 221032
MFC after: 2 weeks

33 hours agoadaasync(): Set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE
mav [Thu, 27 Jul 2017 07:28:29 +0000 (07:28 +0000)]
adaasync(): Set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE

The attached patch lets adaasync() set ADA_STATE_WCACHE based on
ADA_FLAG_CAN_WCACHE instead of ADA_FLAG_CAN_RAHEAD.

This fixes a regression introduced in r300207 which changed
the flag names.

PR: 220948
Submitted by: Fabian Keil <fk@fabiankeil.de>
Obtained from: ElectroBSD
MFC after: 1 week

34 hours agoAs in r315225, discard 3072 bytes of RC4 bytestream instead of 1024.
cy [Thu, 27 Jul 2017 06:26:15 +0000 (06:26 +0000)]
As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024.

PR: 217920
Submitted by: codarren@hackers.mu
Reviewed by: emaste, cem
Approved by: so (implicit, in r315225)
MFC after: 1 week
Differential Revision: D11747
Patterned after: r315225

35 hours agoFix some broken logic used in obtaining the certain config pages. I'm
scottl [Thu, 27 Jul 2017 05:31:48 +0000 (05:31 +0000)]
Fix some broken logic used in obtaining the certain config pages.  I'm
surprised that this even pretended to work.

PR: 215793
Submitted by: longwitz@incore.de

38 hours agouart: add AX99100 chipset support
emaste [Thu, 27 Jul 2017 02:53:18 +0000 (02:53 +0000)]
uart: add AX99100 chipset support

PR: 215837
Submitted by: joe@thrallingpenguin.com
MFC after: 2 weeks

38 hours agoFix the port vlan support in e6000 based switches.
loos [Thu, 27 Jul 2017 02:38:53 +0000 (02:38 +0000)]
Fix the port vlan support in e6000 based switches.

Reduce the use of local copies of switch register data.

The switch now works with the upstream dsa node (i.e. the upstream DTS).

Tested on: ClearFog Pro (88E6176), SG-3100 (88E6141)
Sponsored by: Rubicon Communications, LLC (Netgate)

42 hours ago- Check the slot type capability, set SDHCI_SLOT_{EMBEDDED,NON_REMOVABLE}
marius [Wed, 26 Jul 2017 22:04:23 +0000 (22:04 +0000)]
- Check the slot type capability, set SDHCI_SLOT_{EMBEDDED,NON_REMOVABLE}
  for embedded slots. Fail in the sdhci(4) initialization for slot type
  shared, which is completely unsupported by this driver at the moment. [1]
  For Intel eMMC controllers, taking the embedded slot type into account
  obsoltes setting SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE so remove these quirk
  entries.
- Hide the 1.8 V VDD capability when the slot is detected as non-embedded,
  as the SDHCI specification explicitly states that 1.8 V VDD is applicable
  to embedded slots only. [2]
- Define some easy bits of the SDHCI specification v4.20. [3]
- Don't leak bus_dma(9) resources in failure paths of sdhci_init_slot().

Obtained from: DragonFlyBSD 65704a46 [1], 7ba10b88 [2], 0df14648 [3]

42 hours agoCorrectly use the size of a pointer rather than that of a pointer to a
marius [Wed, 26 Jul 2017 21:59:37 +0000 (21:59 +0000)]
Correctly use the size of a pointer rather than that of a pointer to a
pointer.

Reported by: Coverity
CID: 1378432

43 hours agocc_cubic: restore braces around if-condition block
emaste [Wed, 26 Jul 2017 21:23:09 +0000 (21:23 +0000)]
cc_cubic: restore braces around if-condition block

r307901 was reverted in r321480, restoring an incorrect block
delimitation bug present in the original cc_cubic commit. Restore
only the bugfix (brace addition) from r307901.

CID: 1090182
Approved by: sbruno

43 hours agoAdd a debug sysctl that lets you see i2c bus traffic through this device.
ian [Wed, 26 Jul 2017 21:20:57 +0000 (21:20 +0000)]
Add a debug sysctl that lets you see i2c bus traffic through this device.

43 hours agoAdd support for tracking nested calls to iicbus_request/release_bus().
ian [Wed, 26 Jul 2017 21:06:26 +0000 (21:06 +0000)]
Add support for tracking nested calls to iicbus_request/release_bus().

Usually it is sufficient to use iicbus_transfer_excl(), or one of the
higher-level convenience functions that use it, to reserve the bus for the
duration of each register access.  Occasionally it is important that a
series of accesses or read-modify-write operations must be done without any
other intervening access to the device, to prevent corrupting state.

Without support for nested request/release, slave device drivers would have
to stop using high-level convenience functions and resort to working with
arrays of iic_msg structs just for a few operations (often involving
one-time device setup or infrequent configuration changes).

The changes here appear large from a glance at the diff, but in fact they're
nearly trivial, and the large diff is because of changes in indentation and
the re-wrapping of comments caused by that.  One notable change is that
iicbus_release_bus() now ignores the IICBUS_CALLBACK(IIC_RELEASE_BUS) return
value.  The old error handling left the bus in a kind of limbo state where
it was still owned at the iicbus layer, but drivers rarely check the return
of the release call, and it's unclear what they would do to recover from an
error return anyway.  No existing low-level drivers return any kind of error
from IIC_RELEASE_BUS except one EINVAL for "you don't own the bus", to which
the right response is probably to carry on with the process of releasing the
reference to the bus anyway.

44 hours agoAdd a pair of convenience routines for doing simple "register" read/writes
ian [Wed, 26 Jul 2017 20:40:24 +0000 (20:40 +0000)]
Add a pair of convenience routines for doing simple "register" read/writes
on i2c devices, where the "register" can be any length.

Many (perhaps most) common i2c devices are organized as a collection of
(usually 1-byte-wide) registers, and are accessed by first writing a 1-byte
register index/offset number, then by reading or writing the data.
Generally there is an auto-increment feature so the when multiple bytes
are read or written, multiple contiguous registers are accessed.

Most existing slave device drivers allocate an array of iic_msg structures,
fill in all the transfer info, and invoke iicbus_transfer().  These new
functions commonize all that and reduce register access to a simple call
with a few arguments.

44 hours agocxgbe(4): Some updates to the common code.
np [Wed, 26 Jul 2017 20:20:58 +0000 (20:20 +0000)]
cxgbe(4): Some updates to the common code.

- Updated register ranges.
- Helper routines for access to TP registers.
- Updated routine to read flash parameters.

Obtained from: Chelsio Communications
MFC after: 2 weeks
Sponsored by: Chelsio Communications

44 hours agoMark pages after EOF as clean after pageout.
kib [Wed, 26 Jul 2017 20:07:05 +0000 (20:07 +0000)]
Mark pages after EOF as clean after pageout.

Suppose that a file on NFS has partially filled last page, and this
page is dirty.  NFS VOP_PAGEOUT() method only marks the the page clean
up to the block of the last written byte, leaving other blocks dirty.
Also any page which erronously exists in the vnode vm_object past EOF
is also left marked as dirty.

With the introduction of the buf-cache coherent pager, each pass of
syncer over the object with such page results in creation of B_DELWRI
buffer due to VOP_WRITE() call.  This buffer is noted on next syncer
pass, which results e.g. a visible manifestation of shutdown never
finishing vnode sync.  Note that before buf-cache coherency commit, a
dirty page might left never synced to server if a partial writes
occur.

Fix this by clearing dirty bits after EOF.  Only blocks of the partial
page which are completely after EOF are marked clean, to avoid
possible user data loss.

Reported by: mav
Reviewed by: alc, markj
Tested by: mav, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D11697

44 hours agoMove rtvals initialization out of the region protected by NFS node
kib [Wed, 26 Jul 2017 20:01:31 +0000 (20:01 +0000)]
Move rtvals initialization out of the region protected by NFS node
lock.

Noted by: alc
Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D11697

47 hours agoPass the last exception trap frame to kdb_trap. This allows show registers
andrew [Wed, 26 Jul 2017 17:39:10 +0000 (17:39 +0000)]
Pass the last exception trap frame to kdb_trap. This allows show registers
in ddb to show the traps registers, and not the registers from within the
panic call.

Sponsored by: DARPA, AFRL

2 days agoAdd an auxiliary subroutine to generate some events for testing
lwhsu [Wed, 26 Jul 2017 12:07:46 +0000 (12:07 +0000)]
Add an auxiliary subroutine to generate some events for testing

This test is also timeout on a quiet system because there is nobody triggering
read probefunc while test execution.

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

2 days agoUpgrade to the latest sources generated from the CloudABI specification.
ed [Wed, 26 Jul 2017 06:57:15 +0000 (06:57 +0000)]
Upgrade to the latest sources generated from the CloudABI specification.

The CloudABI specification has had some minor changes over the last half
year. No substantial features have been added, but some features that
are deemed unnecessary in retrospect have been removed:

- mlock()/munlock():

  These calls tend to be used for two different purposes: real-time
  support and handling of sensitive (cryptographic) material that
  shouldn't end up in swap. The former use case is out of scope for
  CloudABI. The latter may also be handled by encrypting swap.

  Removing this has the advantage that we no longer need to worry about
  having resource limits put in place.

- SOCK_SEQPACKET:

  Support for SOCK_SEQPACKET is rather inconsistent across various
  operating systems. Some operating systems supported by CloudABI (e.g.,
  macOS) don't support it at all. Considering that they are rarely used,
  remove support for the time being.

- getsockname(), getpeername(), etc.:

  A shortcoming of the sockets API is that it doesn't allow you to
  create socket(pair)s, having fake socket addresses associated with
  them. This makes it harder to test applications or transparently
  forward (proxy) connections to them.

  With CloudABI, we're slowly moving networking connectivity into a
  separate daemon called Flower. In addition to passing around socket
  file descriptors, this daemon provides address information in the form
  of arbitrary string labels. There is thus no longer any need for
  requesting socket address information from the kernel itself.

This change also updates consumers of the generated code accordingly.
Even though system calls end up getting renumbered, this won't cause any
problems in practice. CloudABI programs always call into the kernel
through a kernel-supplied vDSO that has the numbers updated as well.

Obtained from: https://github.com/NuxiNL/cloudabi

2 days agoMark name_PCTRIE_LOOKUP_LE() generated function unused.
kib [Wed, 26 Jul 2017 06:42:01 +0000 (06:42 +0000)]
Mark name_PCTRIE_LOOKUP_LE() generated function unused.

The PCTRIE macro will be shortly applied in a situation where
LOOKUP_LE is not needed.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D11435

2 days ago[iwm] Sync rs (rate-selection) API definitions from Linux iwlwifi.
adrian [Wed, 26 Jul 2017 05:52:37 +0000 (05:52 +0000)]
[iwm] Sync rs (rate-selection) API definitions from Linux iwlwifi.

* While there clean up alignments and line wrapping in existing
  definitions for rs API in if_iwmreg.h

Obtained from: dragonflybsd.git 085e37a042bdb17081e495e46919359ce43aa118

2 days ago[iwm] Add iwm_mvm_send_lq_cmd() from Linux iwlwifi to if_iwm_util.c.
adrian [Wed, 26 Jul 2017 05:51:31 +0000 (05:51 +0000)]
[iwm] Add iwm_mvm_send_lq_cmd() from Linux iwlwifi to if_iwm_util.c.

Obtained from: dragonflybsd.git 8a5dd7783e407856754093f5b1c9c757c64534b7

2 days ago[iwm] Sync statistics API definitions with Linux iwlwifi.
adrian [Wed, 26 Jul 2017 05:40:52 +0000 (05:40 +0000)]
[iwm] Sync statistics API definitions with Linux iwlwifi.

Obtained from: dragonflybsd.git 75895a53a9c1ba60d75be9b4bf6e49a37f91a7cf

2 days ago[iwm] Cleanup mbufq draining. Add iwm_xmit_queue_drain() like in iwn(4).
adrian [Wed, 26 Jul 2017 05:29:08 +0000 (05:29 +0000)]
[iwm] Cleanup mbufq draining. Add iwm_xmit_queue_drain() like in iwn(4).

* iwm_xmit_queue_drain() calls ieee80211_free_node(), removing a possible
  memory leak, compared to using just mbufq_drain().

* Remove duplicate mbufq_drain() from iwm_mvm_rm_sta(), this should be
  handled in the caller.

Obtained from: dragonflybsd.git 339d45fda40072e0aca5ece639173204716f11fe

2 days ago[iwm] if_iwm - Use chan list from ieee80211_scan_state for scan, not ic_channels.
adrian [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!

2 days agoRemove trailing slash (/) for consistency.
cy [Wed, 26 Jul 2017 02:05:09 +0000 (02:05 +0000)]
Remove trailing slash (/) for consistency.

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

2 days agoNO_CLEAN: Hide delete-old output.
bdrewery [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

2 days agoOnly build libzfs_core in 'make libraries' if needed.
bdrewery [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

2 days agoRemove unneeded dependency for libzfs.
bdrewery [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

2 days agoImprove the clarity of a comment added in r321385 by not referring to
marius [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.

2 days agoUse the MD __size_t to avoid a dependency on/include of non-MD header files.
ian [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>

2 days agoindent(1): add option -tsn for setting tab size.
pstef [Tue, 25 Jul 2017 17:04:35 +0000 (17:04 +0000)]
indent(1): add option -tsn for setting tab size.

2 days agoRe-add #endif accidentally deleted in r321484
ngie [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

3 days agoAllow -DNO_SKIP_DEPEND to override the _SKIP_DEPEND logic.
bdrewery [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

3 days agoOnly test ld_pi_odd with LDBL_MANT_DIG == 64 to fix the build
ngie [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)

3 days agoMask issues with duplicate definitions for __fnstcw, __fldenv, and __fldcw on
ngie [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.

3 days agobnxt: Implement interrupt coalescing options using sysctl.
sbruno [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

3 days agoRevert r307901 - Inform CC modules about loss events.
sbruno [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

3 days agoRevert r308180 - Set slow start threshold more accurrately on loss ...
sbruno [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

3 days agoDon't hold the RM lock during lagg_proto_addport() to avoid an LOR.
sbruno [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

3 days agoDrop ixgbe RX lock during TCP_LRO processing. This eliminates a "storm"
sbruno [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

3 days agoThe test case common.funcs.t_dtrace_contrib.tst_basename_d generates a
lwhsu [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

3 days agospa_import_rootpool should be able to handle an imported root pool
avg [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

3 days agoModify glob patterns and expected output to match FreeBSD's implementation.
lwhsu [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

3 days agoMake this test case accepts basename() in D script returns "" or "."
lwhsu [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

3 days agoExplicitly set dynamic variable buffer size.
lwhsu [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

3 days agoExplicitly set dynamic variable buffer size.
lwhsu [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

3 days agoAdd an auxiliary subroutine to generate read(2) event while testing.
lwhsu [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

3 days agoAdd a simple script which calls open(2) and others to generate events for
lwhsu [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

3 days agoAdd a simple program which calls sigtimedwait(2) to generate events for testing
lwhsu [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

3 days agoRemove duplicate statement.
tuexen [Tue, 25 Jul 2017 11:05:53 +0000 (11:05 +0000)]
Remove duplicate statement.

3 days agoBuild the 32-bit ARM libstand and loader parts with -fPIC. Many of them are
andrew [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

3 days agoFix indent.
kib [Tue, 25 Jul 2017 09:48:33 +0000 (09:48 +0000)]
Fix indent.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

3 days agoReplace unnecessary _KERNEL by double-include protection.
dchagin [Tue, 25 Jul 2017 06:59:35 +0000 (06:59 +0000)]
Replace unnecessary _KERNEL by double-include protection.

MFC after: 2 week

3 days agoMark :reduction as an expected failure
ngie [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

3 days agoConvert lib/msun/trig_test from TAP to ATF format
ngie [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

3 days agoRaise WARNS to 1
ngie [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

3 days agobsdgrep(1): Don't exit before processing every file
kevans [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

3 days agoUnconditionally install etc/mtree/BSD.debug.dist again
ngie [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

3 days agocleandir: Fix ESTALE errors from parallel removals.
bdrewery [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

3 days agoRemove ${MTREE} and leverage etc/mtree/Makefile instead with
ngie [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

3 days agoNO_CLEAN: Utilize delete-old to remove old orphaned libraries/headers in WORLDTMP.
bdrewery [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

3 days agoThe .depend.obj cleanup hacks are only needed with -DNO_CLEAN.
bdrewery [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

3 days agoAllow disabling dependency tracking if DEPEND_CFLAGS is empty.
bdrewery [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

3 days agoSlightly simplify logic for which depend file is expected.
bdrewery [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

3 days agoMove llvm Options.inc hack from r321433 for NO_CLEAN to lib/clang/libllvm.
bdrewery [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

3 days agoFix style and wrap lines to 80 columns in savecore.c. github/projects/make-check-sandbox
markj [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

3 days agoar: handle partial writes from archive_write_data
emaste [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

3 days agocxgbe(4): Display some more TOE parameters related to retransmission
np [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

3 days agoAdd some .ORDER for distrib-dirs, distribute, distribution and distributeworld.
bdrewery [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

3 days agoCleanup stale Options.inc files from the previous libllvm build for
dim [Mon, 24 Jul 2017 18:52:46 +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

3 days agoUse __DEFAULT_DEPENDENT_OPTIONS for articulating dependency relationship
ngie [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

3 days agofix typo
imp [Mon, 24 Jul 2017 18:10:42 +0000 (18:10 +0000)]
fix typo

3 days agoPROGS: Fix ESTALE errors on NFS while cleaning in directories with PROGS.
bdrewery [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

3 days agocleanobj: Unhide removal of directory.
bdrewery [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

3 days agoFix whitespace on a line in fix(..) accidentally missed in r321424
ngie [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

3 days agoStyle cleanup: delete spurious trailing whitespace
ngie [Mon, 24 Jul 2017 17:27:21 +0000 (17:27 +0000)]
Style cleanup: delete spurious trailing whitespace

MFC after: 1 month