]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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'

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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)

6 years 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]

6 years 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

6 years 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

6 years 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.

6 years 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.

6 years 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.

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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!

6 years agoRemove trailing slash (/) for consistency.
cy [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.
scottl [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.
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

6 years 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

6 years 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

6 years 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.

6 years 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>

6 years 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.

6 years 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

6 years 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

6 years 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)

6 years 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.

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years agoRemove duplicate statement.
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 [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.
kib [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.
dchagin [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
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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years agoFix style and wrap lines to 80 columns in savecore.c.
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

6 years 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

6 years 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

6 years 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

6 years 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

6 years 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

6 years agofix typo
imp [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.
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

6 years 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

6 years 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

6 years 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

6 years agoChange the interactions of the interface functions with the "meta" and
alc [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
trasz [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
dim [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
emaste [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
sjg [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.
sephe [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
sephe [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
sephe [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