]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoindent(1): add new -sac and -U options.
pfg [Wed, 3 Aug 2016 22:08:07 +0000 (22:08 +0000)]
indent(1): add new -sac and -U options.

Add -sac (space after cast) and -nsac options.
These control whether space character is put after a cast operator or not.
Default is -nsac.

Add -U option for providing a file containing list of types.
This is needed for properly deciding which asterisks denote unary
operation and which denote binary.

These come from PostgreSQL.

Reference:
https://github.com/pstef/freebsd_indent/commit/84b00e3d46dfd6d955b2f481a1f3b275de9ad6d1
https://github.com/pstef/freebsd_indent/commit/49c52cf383fa2a246a1a22c6640a5a21b0f1fd90

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoFix a style(9) bug.
jkim [Wed, 3 Aug 2016 20:21:58 +0000 (20:21 +0000)]
Fix a style(9) bug.

7 years agoSupport nanosecond time stamps for pcap_dispatch(3) and pcap_loop(3).
jkim [Wed, 3 Aug 2016 20:08:39 +0000 (20:08 +0000)]
Support nanosecond time stamps for pcap_dispatch(3) and pcap_loop(3).

7 years ago[ar934x] shuffle AR93XX_BASE -> std.AR934X
adrian [Wed, 3 Aug 2016 19:23:22 +0000 (19:23 +0000)]
[ar934x] shuffle AR93XX_BASE -> std.AR934X

7 years ago[ar9330] ok, fine, I'll finally undo the 2011-era mistake of _BASE config files.
adrian [Wed, 3 Aug 2016 19:18:53 +0000 (19:18 +0000)]
[ar9330] ok, fine, I'll finally undo the 2011-era mistake of _BASE config files.

Repeated prodding by: imp

7 years ago[ar9330] add in module support for ipfw nat.
adrian [Wed, 3 Aug 2016 19:13:09 +0000 (19:13 +0000)]
[ar9330] add in module support for ipfw nat.

This actually does work, and works pretty well.

7 years agoCorrect some comments.
bdrewery [Wed, 3 Aug 2016 18:48:56 +0000 (18:48 +0000)]
Correct some comments.

Sponsored by: EMC / Isilon Storage Division
MFC after: 3 days

7 years agoWe need aw_nmi to be attached which needs GIC so attach a bit later.
manu [Wed, 3 Aug 2016 18:45:56 +0000 (18:45 +0000)]
We need aw_nmi to be attached which needs GIC so attach a bit later.
Also the GPIOC doesn't need to be attach early

Reviewed by: andrew
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7082

7 years agouuid_to_string(3) is allocating memory and can fail on that.
oshogbo [Wed, 3 Aug 2016 18:04:08 +0000 (18:04 +0000)]
uuid_to_string(3) is allocating memory and can fail on that.
Check if any error accrued.

7 years agoFix EHCI driver by excluding first 512K from available memory
gonzo [Wed, 3 Aug 2016 18:03:14 +0000 (18:03 +0000)]
Fix EHCI driver by excluding first 512K from available memory

On Zynq 256K-512K memory region is not accessible by all bus masters.
EHCI driver fails when trying to use it for DMA transfers. Patching
memory node does not help because ubldr overrides values there with
the ones obtained from u-boot. So as a workaround we just mark first
512K as reserved.

PR: 211484
Submitted by: Thomas Skibo <thoma555-bsd@yahoo.com>
MFC after: 3 days

7 years agoFix misleading description of the -b option in the geli init command.
oshogbo [Wed, 3 Aug 2016 18:02:10 +0000 (18:02 +0000)]
Fix misleading description of the -b option in the geli init command.

Reviewed by: bjk, wblock
Differential Revision: https://reviews.freebsd.org/D7226
Discussed with: AllanJude

7 years agoFix a few cosmetic issues in boot1.efi.
markj [Wed, 3 Aug 2016 17:17:01 +0000 (17:17 +0000)]
Fix a few cosmetic issues in boot1.efi.

- Use ANSI function signatures.
- Remove unneeded checks for a NULL boot module.
- Use nitems().

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoUse the port device name for the iov device for Chelsio T4/T5 cards.
jhb [Wed, 3 Aug 2016 17:11:08 +0000 (17:11 +0000)]
Use the port device name for the iov device for Chelsio T4/T5 cards.

Chelsio T4/T5 adapters are multifunction cards.  The main driver uses
physical function 4 (PF4).  However, VF devices for SR-IOV are only
supported on physical functions 0 through 3, where PF0 creates VFs tied
to port 0, etc.  The t4iov/t5iov driver was previously added to
create VF devices for ports that are present on each adapter.  This
change uses the recently added pci_iov_attach_name() function to
name the character device in /dev/iov after the associated port on
the card (e.g. /dev/iov/cxl0 is used to create VFs that share the
cxl0 port).  With this in place, mark the t4iov/t5iov devices quiet
to prevent them from cluttering dmesg.

Reviewed by: rstone
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7402

7 years agoPermit the name of the /dev/iov entry to be set by the driver.
jhb [Wed, 3 Aug 2016 17:09:12 +0000 (17:09 +0000)]
Permit the name of the /dev/iov entry to be set by the driver.

The PCI_IOV option creates character devices in /dev/iov for each PF
device driver that registers support for creating VFs.  By default the
character device is named after the PF device (e.g. /dev/iov/foo0).
This change adds a variant of pci_iov_attach() called pci_iov_attach_name()
that allows the name of the /dev/iov entry to be specified by the
driver.

Reviewed by: rstone
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7400

7 years agoApply the fix from r232612 to fixed function counters.
jhb [Wed, 3 Aug 2016 16:52:00 +0000 (16:52 +0000)]
Apply the fix from r232612 to fixed function counters.

Reviewed by: emaste
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7397

7 years agoDisable DSA again.
des [Wed, 3 Aug 2016 16:34:20 +0000 (16:34 +0000)]
Disable DSA again.

MFC after: 3 days

7 years agoindent(1): accept offsetof(3) as a keyword.
pfg [Wed, 3 Aug 2016 16:33:34 +0000 (16:33 +0000)]
indent(1): accept offsetof(3) as a keyword.

Reference:
https://github.com/pstef/freebsd_indent/commit/c470e5e2c974aa38450ca4762b93829f7a7bfa4d

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoRemove DSA from default cipher list and disable SSH1.
des [Wed, 3 Aug 2016 16:08:21 +0000 (16:08 +0000)]
Remove DSA from default cipher list and disable SSH1.

Upstream did this a long time ago, but we kept DSA and SSH1 in FreeBSD for
reasons which boil down to POLA.  Now is a good time to catch up.

MFC after: 3 days
Relnotes: yes

7 years agoRemove ncl_printf(), use printf(9) directly. After r303710 the
kib [Wed, 3 Aug 2016 15:58:20 +0000 (15:58 +0000)]
Remove ncl_printf(), use printf(9) directly.  After r303710 the
function duplicates printf().

Correct function names in the messages [*].

Noted by: bde [*]
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoCorrect assertion on vcpuid argument to vm_gpa_hold().
jhb [Wed, 3 Aug 2016 15:20:10 +0000 (15:20 +0000)]
Correct assertion on vcpuid argument to vm_gpa_hold().

PR: 208168
Submitted by: Dave Cameron <daverabbitz@ihug.co.nz>
Reviewed by: grehan
MFC after: 1 month

7 years agoMerge i386 and amd64 variants of mp_watchdog.c into x86/, there is no
kib [Wed, 3 Aug 2016 13:51:53 +0000 (13:51 +0000)]
Merge i386 and amd64 variants of mp_watchdog.c into x86/, there is no
difference between files.
For pc98, put x86/mp_x86.c into the same place as used by i386 file list.
Fix typo in comment.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove unneeded (recursing) Giant acquisition around vprintf(9).
kib [Wed, 3 Aug 2016 11:49:17 +0000 (11:49 +0000)]
Remove unneeded (recursing) Giant acquisition around vprintf(9).

Reviewed by: rmacklem
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agolocks: fix sx compilation on mips after r303643
mjg [Wed, 3 Aug 2016 09:15:10 +0000 (09:15 +0000)]
locks: fix sx compilation on mips after r303643

The kernel.h header is required for the SYSINIT macro, which apparently
was present on amd64 by accident.

Reported by: kib

7 years agoAlthough the code amount is not big, move POSIX error processing into
ache [Wed, 3 Aug 2016 09:09:34 +0000 (09:09 +0000)]
Although the code amount is not big, move POSIX error processing into
two sepatate functions to make glob(3) code less obscure and more simple.
There is no needs to make them inline since it is error path which supposed
to not happes often.

7 years agoRemove Giant asserts. Update comment.
kib [Wed, 3 Aug 2016 08:57:15 +0000 (08:57 +0000)]
Remove Giant asserts.  Update comment.

Owning Giant in the init/uninit is accidental due to the moment where
VFS modules initialization is performed, and is not enforced by the
VFS interface.  The Giant lock does not prevent a parallel execution
of the code, it is VFS which implements the proper protocol.

Approved by: des (pseudofs maintainer)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoSome style changes. Fix a typo in comment.
kib [Wed, 3 Aug 2016 08:53:29 +0000 (08:53 +0000)]
Some style changes.  Fix a typo in comment.

Approved by: des (pseudofs maintainer)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoExplain why swapgeom_close_ev() is delegated.
kib [Wed, 3 Aug 2016 07:11:19 +0000 (07:11 +0000)]
Explain why swapgeom_close_ev() is delegated.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove mention of the Giant from the fork_return() description.
kib [Wed, 3 Aug 2016 07:10:09 +0000 (07:10 +0000)]
Remove mention of the Giant from the fork_return() description.
Making emphasis on this lock in the core function comment is confusing
for the modern kernel.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoRegenerate system call tables for r303699 and r303700.
ed [Wed, 3 Aug 2016 06:36:45 +0000 (06:36 +0000)]
Regenerate system call tables for r303699 and r303700.

7 years agoRe-add traling slash that was removed in r303699.
ed [Wed, 3 Aug 2016 06:35:58 +0000 (06:35 +0000)]
Re-add traling slash that was removed in r303699.

I must have accidentally pressed some random key in vim.

7 years agomprotect(): Change prototype to comply to POSIX.
ed [Wed, 3 Aug 2016 06:33:04 +0000 (06:33 +0000)]
mprotect(): Change prototype to comply to POSIX.

Our mprotect() function seems to take a "const void *" address to the
pages whose permissions need to be adjusted. POSIX uses "void *". Simply
stick to the POSIX one to prevent us from writing unportable code.

PR: 211423 (exp-run)
Tested by: antoine@ (Thanks!)

7 years agoRemove a duplicate PMC CPU number
jhibbits [Wed, 3 Aug 2016 01:46:55 +0000 (01:46 +0000)]
Remove a duplicate PMC CPU number

CPU number for MPC85XX is a duplicate for E500.  Since we don't support MPC85XX
"uncore" registers right now, rather than renumbering it simply remove it, and
it will properly use the E500 CPU ID.

7 years agoMerge MPC85XX and QorIQ config options
jhibbits [Wed, 3 Aug 2016 01:22:11 +0000 (01:22 +0000)]
Merge MPC85XX and QorIQ config options

Summary:
MPC85XX and QorIQ are very similar.  When the DPAA dTSEC driver was
added, QORIQ_DPAA was brought in as a config option to support the differences
in hardware register settings between QorIQ (e500mc-, e5500- based) SoCs and
QUICC (e500v1/e500v2-based) SoCs, particularly in the Local Access Window (LAW)
target settings.

Unify these settings using macros to hide details and ease porting, and use a
new function (mpc85xx_is_qoriq()) to distinguish between QorIQ and QUICC SoCs at
runtime.

An alternative to using the function could be to use a variable initialized at
platform attach time, which may incur less overhead at runtime.  Since it's not
in the critical path once booted, this optimization doesn't seem necessary at
first pass.

Reviewed by: nwhitehorn
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7294

7 years agocxgbe/t4_tom: Read the chip's DDP page sizes and save them in a
np [Tue, 2 Aug 2016 23:54:21 +0000 (23:54 +0000)]
cxgbe/t4_tom: Read the chip's DDP page sizes and save them in a
per-adapter data structure.  This replaces a global array with hardcoded
page sizes.

Sponsored by: Chelsio Communications

7 years agoAdd link for getnetgrent_r(3).
bdrewery [Tue, 2 Aug 2016 23:46:32 +0000 (23:46 +0000)]
Add link for getnetgrent_r(3).

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agotruss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscall
bapt [Tue, 2 Aug 2016 22:47:06 +0000 (22:47 +0000)]
truss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscall

trussinfo->curthread must be initialized before calling enter_syscall(),
it is used by t->proc->abi->fetch_args().
Without that truss is segfaulting and the attached program also crash.

Submitted by: Nikita Kozlov (nikita@gandi.net)
Reviewed by: jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7399

7 years agotools/build looks for _WITH_GETLINE in /usr/include/stdio.h to see if
imp [Tue, 2 Aug 2016 21:55:23 +0000 (21:55 +0000)]
tools/build looks for _WITH_GETLINE in /usr/include/stdio.h to see if
we need to include it in -legacy or not. Since the ifdef was removed,
this broke building 10.x and older source trees on -current. Restore
just enough of _WITH_GETLINE to allow these older source trees to
still build and properly omit getline() from their -legacy library.

7 years agokgzip.8: note that it is deprecated and clarify BUGS section
emaste [Tue, 2 Aug 2016 21:48:26 +0000 (21:48 +0000)]
kgzip.8: note that it is deprecated and clarify BUGS section

kgzip is only useful on i386 and has a number of other limitations.
We're better served by officially deprecating it and encouraging users
to use loader(8) instead.

Reviewed by: dteske, wblock
Differential Revision: https://reviews.freebsd.org/D7098

7 years agopfctl: Use const where possible.
kp [Tue, 2 Aug 2016 20:32:02 +0000 (20:32 +0000)]
pfctl: Use const where possible.

This adds const qualifiers where it is possible.

Submitted by: Christian Mauderer <christian.mauderer@embedded-brains.de>

7 years agoMove/add ARM ELF PHDR types to elf_common.h
emaste [Tue, 2 Aug 2016 20:26:04 +0000 (20:26 +0000)]
Move/add ARM ELF PHDR types to elf_common.h

Accidentally missed in r303674

7 years agoFix a segfault in bsdgrep when parsing the invalid extended regexps "?"
dim [Tue, 2 Aug 2016 20:25:22 +0000 (20:25 +0000)]
Fix a segfault in bsdgrep when parsing the invalid extended regexps "?"
or "+" (these are invalid, because there is no preceding operand).

When bsdgrep attempts to emulate GNU grep in discarding and ignoring the
invalid ? or + operators, some later logic in tre_compile_fast() goes
beyond the end of the buffer, leading to a crash.

Fix this by bailing out, and reporting a bad pattern instead.

Reported by: Steve Kargl
MFC after: 1 week

7 years agoreadelf: report ARM program and section header types
emaste [Tue, 2 Aug 2016 20:11:04 +0000 (20:11 +0000)]
readelf: report ARM program and section header types

Reviewed by: andrew
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7390

7 years agopfctl: Match prototype of pfctl_load_hostid.
kp [Tue, 2 Aug 2016 19:54:40 +0000 (19:54 +0000)]
pfctl: Match prototype of pfctl_load_hostid.

The prototype and the implementation of the pfctl_load_hostid used a
different data type for one of the parameters.

Submitted by: Christian Mauderer <christian.mauderer@embedded-brains.de>

7 years agoAdd ELFOSABI_ARM_AEABI ELF OSABI constant
emaste [Tue, 2 Aug 2016 18:42:32 +0000 (18:42 +0000)]
Add ELFOSABI_ARM_AEABI ELF OSABI constant

Reported by: andrew
Sponsored by: The FreeBSD Foundation

7 years agoproc_init: Fix a few memory leaks of 'phdl'
cem [Tue, 2 Aug 2016 18:13:50 +0000 (18:13 +0000)]
proc_init: Fix a few memory leaks of 'phdl'

In the normal case and correct failure cases, the 'phdl' pointer is passed to
callers to use or clean up as needed.  However, some failure cases returned
early, failing to export the phdl pointer.

This was introduced in the restructuring of r303533.

Reported by: Coverity
CID: 1361070
Reviewed by: markj
Sponsored by: EMC / Isilon Storage Division

7 years agopfctl: Allow TOS bits to be cleared
kp [Tue, 2 Aug 2016 15:41:42 +0000 (15:41 +0000)]
pfctl: Allow TOS bits to be cleared

TOS value 0 is valid, so use 256 as an invalid value rather than zero.
This allows users to enforce TOS == 0 with pf.

Reported by: Radek Krejča <radek.krejca@starnet.cz>

7 years agosed(1): Revert r303047 "cleanup" and therefore r303572.
pfg [Tue, 2 Aug 2016 15:35:53 +0000 (15:35 +0000)]
sed(1): Revert r303047 "cleanup" and therefore r303572.

While big, the change was meant to have no effect on behavior and instead
so far we have found two regressions: one in the etcupdate tests and
another one in the games/openttd port[1].

Revert to a known working state. We will likely have to split the patch in
functional parts before bringing back the changes.

PR: 195929
Reported by: danfe, madpilot [1]

7 years agoRemove trailing whitespace from the arm64 pmap
andrew [Tue, 2 Aug 2016 15:26:46 +0000 (15:26 +0000)]
Remove trailing whitespace from the arm64 pmap

Obtained from: ABT Systems Ltd
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation

7 years agoUpdate RISC-V port to Privileged Architecture Version 1.9.
br [Tue, 2 Aug 2016 14:50:14 +0000 (14:50 +0000)]
Update RISC-V port to Privileged Architecture Version 1.9.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoFix NULL pointer dereference.
ae [Tue, 2 Aug 2016 12:18:06 +0000 (12:18 +0000)]
Fix NULL pointer dereference.
ro pointer can be NULL when IPSec consumes mbuf.

PR: 211486
MFC after: 3 days

7 years agotcp/lro: Implement hash table for LRO entries.
sephe [Tue, 2 Aug 2016 06:36:47 +0000 (06:36 +0000)]
tcp/lro: Implement hash table for LRO entries.

This significantly improves HTTP workload performance and reduces
HTTP workload latency.

Reviewed by: rrs, gallatin, hps
Obtained from: rrs, gallatin
Sponsored by: Netflix (rrs, gallatin) , Microsoft (sephe)
Differential Revision: https://reviews.freebsd.org/D6689

7 years agolocks: fix compilation for KDTRACE_HOOKS && !ADAPTIVE_* case
mjg [Tue, 2 Aug 2016 03:05:59 +0000 (03:05 +0000)]
locks: fix compilation for KDTRACE_HOOKS && !ADAPTIVE_* case

Reported by: Michael Butler <imb protected-networks.net>

7 years agolocks: fix up ifdef guards introduced in r303643
mjg [Tue, 2 Aug 2016 00:15:08 +0000 (00:15 +0000)]
locks: fix up ifdef guards introduced in r303643

Both sx and rwlocks had copy-pasted ADAPTIVE_MUTEXES instead of the correct
define.

MFC after: 1 week

7 years agortentry: Initialize rt_mtx with MTX_NEW
cem [Mon, 1 Aug 2016 23:07:31 +0000 (23:07 +0000)]
rtentry: Initialize rt_mtx with MTX_NEW

The "rtentry" zone does not use UMA_ZONE_ZINIT, so it is invalid to assume the
mutex's memory will be zero.  Without MTX_NEW, garbage backing memory may
trigger the "re-initializing a mutex" assertion.

PR: 200991
Submitted by: Chang-Hsien Tsai <luke.tw AT gmail.com>

7 years agoopencrypto AES-ICM: Fix heap corruption typo
cem [Mon, 1 Aug 2016 22:57:03 +0000 (22:57 +0000)]
opencrypto AES-ICM: Fix heap corruption typo

This error looks like it was a simple copy-paste typo in the original commit
for this code (r275732).

PR: 204009
Reported by: Chang-Hsien Tsai <luke.tw AT gmail.com>
Sponsored by: EMC / Isilon Storage Division

7 years agoFix ddb "show proc" to show full arguments
cem [Mon, 1 Aug 2016 22:41:50 +0000 (22:41 +0000)]
Fix ddb "show proc" to show full arguments

PR: 200052
Submitted by: Chang-Hsien Tsai <luke.tw AT gmail.com>

7 years agoStore the offset of the KDOORBELL and GTS registers in the softc.
jhb [Mon, 1 Aug 2016 22:39:51 +0000 (22:39 +0000)]
Store the offset of the KDOORBELL and GTS registers in the softc.

VF devices use a different register layout than PF devices.  Storing
the offset in a value in the softc allows code to be shared between the
PF and VF drivers.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7389

7 years agoipoib: Bound the number of egress mbufs buffered during pathrec lookups.
markj [Mon, 1 Aug 2016 22:22:11 +0000 (22:22 +0000)]
ipoib: Bound the number of egress mbufs buffered during pathrec lookups.

In pathological situations where the master subnet manager becomes
unresponsive for an extended period, we may otherwise end up queuing all
of the system's mbufs while waiting for a response to a path record lookup.

This addresses the same issue as commit 1e85b806f9 in Linux.

Reviewed by: cem, ngie
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoDisable PCI hotplug support for slots with power controllers.
jhb [Mon, 1 Aug 2016 22:19:23 +0000 (22:19 +0000)]
Disable PCI hotplug support for slots with power controllers.

After further review of the spec, I do not think the current HotPlug
code handles slots with power controllers correctly.  In particular,
the power state of the slot is to be inferred from other events, not
from examining the state of the power control bit in SLOT_CTL.  For now,
disable PCI hotplug support on such slots.

PR: 211081
Tested by: Jeffrey E Pieper <jeffrey.e.pieper@intel.com>
MFC after: 3 days

7 years agoImplement trivial backoff for locking primitives.
mjg [Mon, 1 Aug 2016 21:48:37 +0000 (21:48 +0000)]
Implement trivial backoff for locking primitives.

All current spinning loops retry an atomic op the first chance they get,
which leads to performance degradation under load.

One classic solution to the problem consists of delaying the test to an
extent. This implementation has a trivial linear increment and a random
factor for each attempt.

For simplicity, this first thouch implementation only modifies spinning
loops where the lock owner is running. spin mutexes and thread lock were
not modified.

Current parameters are autotuned on boot based on mp_cpus.

Autotune factors are very conservative and are subject to change later.

Reviewed by: kib, jhb
Tested by: pho
MFC after: 1 week

7 years agor293331 mistakingly failed to add an assignment of paddr to the rxbuf
sbruno [Mon, 1 Aug 2016 21:19:51 +0000 (21:19 +0000)]
r293331 mistakingly failed to add an assignment of paddr to the rxbuf
but only in the NETMAP code.  This lead to the NETMAP code paths
passing nothing up to userland.

Submitted by: Ad Schellevis <ad@opnsense.org>
Reported by: Franco Fichtner <franco@opnsense.org>
MFC after: 1 day

7 years agoDo not invoke resize event if initial disk size is zero. Some disks
ae [Mon, 1 Aug 2016 20:54:54 +0000 (20:54 +0000)]
Do not invoke resize event if initial disk size is zero. Some disks
report the size only after first opening.  And due to the events are
asynchronous, some consumers can receive this event too late and
this confuses them. This partially restores previous behaviour, and
at the same time this should fix the problem, when already opened
provider loses resize event.

PR: 211028
MFC after: 3 weeks

7 years agoMFV be9130cc9: "IB/cma: Check for GID on listening devices first"
markj [Mon, 1 Aug 2016 20:29:09 +0000 (20:29 +0000)]
MFV be9130cc9: "IB/cma: Check for GID on listening devices first"

This is an optimization that improves IB connection setup times.

Discussed with: hselasky
Obtained from: Linux
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoMFV 29f27e847: "IB/cma: Use cached gids"
markj [Mon, 1 Aug 2016 20:27:11 +0000 (20:27 +0000)]
MFV 29f27e847: "IB/cma: Use cached gids"

This addresses a regression from an earlier upstream change which caused
cma_acquire_dev() to bypass the port GID cache and instead query the HCA
for each entry in its GID table. These queries can become extremely slow on
multiport devices, which has a negative impact on connection setup times.

Discussed with: hselasky
Obtained from: Linux
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoFix non-functional bsdinstall services dialog.
dim [Mon, 1 Aug 2016 19:49:42 +0000 (19:49 +0000)]
Fix non-functional bsdinstall services dialog.

The most recent version of bsdinstall does not seem to respect any of
the checkboxes in the "Choose the services you would like to be started
at boot" dialog.  None of the chosen services end up in the rc.conf file
that is installed onto the target system.

This is caused by the bsdinstall/scripts/hardening script, which
implements the new hardening options dialog.  The script starts by
overwriting the previously written rc.conf.services file:

    echo -n > $BSDINSTALL_TMPETC/rc.conf.services

which is obviously incorrect.  It should clear out rc.conf.hardening
instead.

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

7 years agoMake boot code and loader check for unsupported ZFS feature flags
allanjude [Mon, 1 Aug 2016 19:37:43 +0000 (19:37 +0000)]
Make boot code and loader check for unsupported ZFS feature flags

OpenZFS uses feature flags instead of a zpool version number to track
features since the split from Oracle. In addition to avoiding confusion
on ZFS vs OpenZFS version numbers, this also allows features to be added
to different operating systems that use OpenZFS in different order.

The previous zfs boot code (gptzfsboot) and loader (zfsloader) blindly
tries to read the pool, and if failed provided only a vague error message.

With this change, both the boot code and loader check the MOS features
list in the ZFS label and compare it against the list of features that
the loader supports. If any unsupported feature is active, the pool is
not considered as a candidate for booting, and a helpful diagnostic
message is printed to the screen. Features that are merely enabled via
zpool upgrade, but not in use, do not block booting from the pool.

Submitted by: Toomas Soome <tsoome@me.com>
Reviewed by: delphij, mav
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D6857

7 years agoindent: Avoid using values of pointers that refer to deallocated space.
pfg [Mon, 1 Aug 2016 19:24:01 +0000 (19:24 +0000)]
indent: Avoid using values of pointers that refer to deallocated space.

For now maintain the local style in this file.

Reviewed by: jilles

Reference:
https://github.com/pstef/freebsd_indent/commit/9099a9f17bc5f579514a4c11111f5cf3df6624c6

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoRestore the historical behavior of "sysctl vm.swap_idle_enabled=1". Prior
alc [Mon, 1 Aug 2016 17:25:07 +0000 (17:25 +0000)]
Restore the historical behavior of "sysctl vm.swap_idle_enabled=1".  Prior
to r254304, we had separate functions for reclamation and laundering
(vm_pageout_scan) versus updating usage information, i.e., "reference
bits", on active pages (vm_pageout_page_stats), and we only performed
vm_req_vmdaemon(VM_SWAP_IDLE) if vm_pages_needed was true.  However, since
r254303, if vm_swap_idle_enabled was "1", we have performed
vm_req_vmdaemon(VM_SWAP_IDLE) regardless of whether we are short of free
pages.  This was unintended and too aggressive, so I suspect no one uses
this feature.  With this change, we restore the historical behavior and
only perform vm_req_vmdaemon(VM_SWAP_IDLE) when we are short of free
pages.

Reviewed by: kib, markj

7 years agoRework IPV6 TCP path MTU discovery to match IPv4
gallatin [Mon, 1 Aug 2016 17:02:21 +0000 (17:02 +0000)]
Rework IPV6 TCP path MTU discovery to match IPv4

- Re-write tcp_ctlinput6() to closely mimic the IPv4 tcp_ctlinput()

- Now that tcp_ctlinput6() updates t_maxseg, we can allow ip6_output()
  to send TCP packets without looking at the tcp host cache for every
  single transmit.

- Make the icmp6 code mimic the IPv4 code & avoid returning
  PRC_HOSTDEAD because it is so expensive.

Without these changes in place, every TCP6 pmtu discovery or host
unreachable ICMP resulted in a call to in6_pcbnotify() which walks the
tcbinfo table with the write lock held.  Because the tcbinfo table is
shared between IPv4 and IPv6, this causes huge scalabilty issues on
servers with lots of (~100K) TCP connections, to the point where even
a small percent of IPv6 traffic had a disproportionate impact on
overall throughput.

Reviewed by: bz, rrs, ae (all earlier versions), lstewart (in Netflix's tree)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D7272

7 years agoindent(1): Use a dash in the license headers.
pfg [Mon, 1 Aug 2016 16:40:42 +0000 (16:40 +0000)]
indent(1): Use a dash in the license headers.

Use of the canonical dash avoids indent(1) from reformatting the
license headers.

7 years ago[mips/broadcom] Fetch UART console configuration from CFE.
landonf [Mon, 1 Aug 2016 16:29:32 +0000 (16:29 +0000)]
[mips/broadcom] Fetch UART console configuration from CFE.

Relying on the boot loader console configuration allows us to use a
common set of device hints for all SENTRY5 devices.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7376

7 years agoSplit out the FDT parts of the GICv2 interrupt controller driver. This will
andrew [Mon, 1 Aug 2016 16:29:04 +0000 (16:29 +0000)]
Split out the FDT parts of the GICv2 interrupt controller driver. This will
allow us to add an ACPI attachment for arm64.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7307

7 years agoSync CFE interface with upstream cfe-1.4.2 release.
landonf [Mon, 1 Aug 2016 16:26:08 +0000 (16:26 +0000)]
Sync CFE interface with upstream cfe-1.4.2 release.

Approved by: adrian (mentor)
Obtained from: https://www.broadcom.com/support/communications-processors
Differential Revision: https://reviews.freebsd.org/D7375

7 years agoAn old tables implementation had all tables preallocated,
ae [Mon, 1 Aug 2016 13:38:48 +0000 (13:38 +0000)]
An old tables implementation had all tables preallocated,
so when user did `ipfw table N flush` it always worked, but now
when table N doesn't exist the kernel returns ESRCH error.
This isn't fatal error for flush and destroy commands. Do not
call err(3) when errno is equal to ESRCH. Also warn only when
quiet mode isn't enabled. This fixes a regression in behavior,
when old rules are loaded from file.
Also use correct value for switch in the table_swap().

Reported by: Kevin Oberman
MFC after: 3 days

7 years agoAdd a kernel variable to let the user to select their preferred order
andrew [Mon, 1 Aug 2016 12:17:44 +0000 (12:17 +0000)]
Add a kernel variable to let the user to select their preferred order
between ACPI and FDT. This will be needed on machines with both, e.g. the
SoftIron Overdrive 3000. The kernel will accept one or more comma separated
values of either 'acpi' or 'fdt'. Any other values are skipped.

To set it the user can either set it on the loader command line, or
in loader.conf e.g. in loader.conf:
kern.cfg.order=acpi,fdt

This will try using ACPI then FDT. If none of the selected options work the
kernel tries to use one to get the serial console, then panics.

Reviewed by: emaste (earlier version)
Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7274

7 years agoMan page for the new checksum netgraph module.
julian [Mon, 1 Aug 2016 12:14:21 +0000 (12:14 +0000)]
Man page for the new checksum netgraph module.

PR: 206186
Submitted by: Dmitry Vagin <daemon.hammer@ya.ru>
MFC after:  1 month

7 years agonetgraph module for reconstructing checksums
julian [Mon, 1 Aug 2016 12:09:04 +0000 (12:09 +0000)]
netgraph module for reconstructing checksums

PR: 206108
Submitted by: Dmitry Vagin  daemon.hammer@ya.ru
MFC after: 1 month

7 years agoslite style changes. There is an incoming patch that rewrites a
julian [Mon, 1 Aug 2016 11:34:12 +0000 (11:34 +0000)]
slite style changes. There is an incoming patch that rewrites a
lot of this module and I want to get the style and whitespace changes in
a separate commit (or maybe more).

PR: 206185
Submitted by: Dmitry Vagin
MFC after: 1 month

7 years agoAdd the fields for the PAR_EL1 register. This is used when performing an
andrew [Mon, 1 Aug 2016 10:36:58 +0000 (10:36 +0000)]
Add the fields for the PAR_EL1 register. This is used when performing an
address lookup with the AT instructions.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agohyperv/storvsc: Stringent PRP list assertions
sephe [Mon, 1 Aug 2016 05:09:11 +0000 (05:09 +0000)]
hyperv/storvsc: Stringent PRP list assertions

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7361

7 years agohyperv/storvsc: Set maxio to 128KB.
sephe [Mon, 1 Aug 2016 04:51:31 +0000 (04:51 +0000)]
hyperv/storvsc: Set maxio to 128KB.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7360

7 years agohyperv/vmbus: Remove the artificial entry limit of SG and PRP list.
sephe [Mon, 1 Aug 2016 04:26:24 +0000 (04:26 +0000)]
hyperv/vmbus: Remove the artificial entry limit of SG and PRP list.

Just make sure that the total channel packet size does not exceed 1/2
data size of the TX bufring.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7359

7 years ago[ath] update comments.
adrian [Mon, 1 Aug 2016 00:36:29 +0000 (00:36 +0000)]
[ath] update comments.

7 years agoindent(1): Rearrange option parsing code to squelch clang's static analyzer.
pfg [Sun, 31 Jul 2016 21:43:43 +0000 (21:43 +0000)]
indent(1): Rearrange option parsing code to squelch clang's static analyzer.

clang-analyzer complained that eqin() sets file-scoped pointer param_start
to point into char buffer defined in scan_profile(), and once
scan_profile() exits, param_start is a "dangling reference". param_start
was never used afterwards, but it's cleaner to move it to set_option()
which is the only branch where param_start is needed.

Reference:
https://github.com/pstef/freebsd_indent/commit/ab0e44e5da3ff0fa4b62e451e4bbc3ea1ec7f365

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoindent(1): replace function call to bzero with memset.
pfg [Sun, 31 Jul 2016 21:36:40 +0000 (21:36 +0000)]
indent(1): replace function call to bzero with memset.

Reference:
https://github.com/pstef/freebsd_indent/commit/7422f42f80099c69d34833d7106035dc09230235

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoindent(1): Don't newline on cpp lines like #endif unless -bacc is on.
pfg [Sun, 31 Jul 2016 21:29:10 +0000 (21:29 +0000)]
indent(1): Don't newline on cpp lines like #endif unless -bacc is on.

Reference:
https://github.com/pstef/freebsd_indent/commit/01f36f4141c71754b3a73a91886fb425bab0df3e

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoindent(1): Untangle the connection between pr_comment.c and io.c.
pfg [Sun, 31 Jul 2016 21:09:22 +0000 (21:09 +0000)]
indent(1): Untangle the connection between pr_comment.c and io.c.

It's pr_comment.c that should decide whether to put a "star comment
continuation" or not. This duplicates code a bit, but it simplifies
pr_comment() at the same time since pr_comment() no longer has to "signal"
whether a star continuation is needed or not.

This change requires indent(1) to not wrap comment lines that lack a blank
character, but I think it's for the better if you look at cases when that
happens (mostly long URIs and file system paths, which arguably shouldn't
be wrapped).

It also fixes two bugs:

1. Cases where asterisk is a part of the comment's content (like in "*we*
are the champions") and happens to appear at the beginning of the line,
misleading dump_line() into thinking that this is part of the star comment
continuation, leading to misalignment.

2. Cases where blank starred lines had three too many characters on the
line when wrapped.

Reference:
https://github.com/pstef/freebsd_indent/commit/3b41ee78aafafc7c3e662b794835e3253218dbb3

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoindent(1): Fix wrapping of some lines in comments.
pfg [Sun, 31 Jul 2016 20:13:00 +0000 (20:13 +0000)]
indent(1): Fix wrapping of some lines in comments.

After a blank line was printed (to separate paragraphs in comments), the
next line was sometimes wrapped to the column at which the previous
non-empty line ended. The fix is to reset the last blank pointer (last_bl)
on newline.

References:
https://github.com/pstef/freebsd_indent/commit/345663c07af0758fd10433bde14722dfd900f85c

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoindent(1): Simplify pr_comment().
pfg [Sun, 31 Jul 2016 20:04:18 +0000 (20:04 +0000)]
indent(1): Simplify pr_comment().

Modify count_spaces() to take a third parameter "end" that will make the
function return when the end is reached. This lets the caller pass a
pointer to non nul-terminated sequence of characters. Rename
count_spaces() to count_spaces_until() and reinstate count_spaces(), this
time based on count_spaces_until().

Use count_spaces_until() to recalculate current column when going through
a comment just before the fragment which decides if current line of the
comment should be wrapped. This move simplifies this code by eliminating
the need for keeping the column counter up to date every time e_com is
advanced and also reduces spread of code that has to know how many columns
a tab will produce.

Deduplicate code that decided if a comment needs a blank line at the top.

References:
https://github.com/pstef/freebsd_indent/commit/d9fa3b481532a448095f8ddd14fd0797ce59230c
https://github.com/pstef/freebsd_indent/commit/27185b4b336b0e2108a3d96aee6df80cced94192

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)
Submitted by: Piotr Stefaniak

7 years agoRemove another occurence of _WITH_GETLINE
bapt [Sun, 31 Jul 2016 19:02:19 +0000 (19:02 +0000)]
Remove another occurence of _WITH_GETLINE

7 years agoAdd the Data Fault Status Code values to the ESR_ELx registers for when the
andrew [Sun, 31 Jul 2016 18:58:20 +0000 (18:58 +0000)]
Add the Data Fault Status Code values to the ESR_ELx registers for when the
fault code is a Data Abort.

Obtained from: AT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoresolvconf(8) now needs an additional @RESTARTCMD@ replacement when installing.
pfg [Sun, 31 Jul 2016 18:14:42 +0000 (18:14 +0000)]
resolvconf(8) now needs an additional @RESTARTCMD@ replacement when installing.

After r303062, which brought openresolv 3.8.1, we need to replace an
additional @RESTARTCMD@ in resolvconf.
Apply a read fix this time.

Submitted by: Guy Yur
X-MFC with: r303062

7 years agoExtract the common parts of pmap_kenter_device to a new function. This will
andrew [Sun, 31 Jul 2016 17:53:09 +0000 (17:53 +0000)]
Extract the common parts of pmap_kenter_device to a new function. This will
be used when superpage support is added.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoindent(1): Remove dead code relating to unix-style comments.
pfg [Sun, 31 Jul 2016 15:02:53 +0000 (15:02 +0000)]
indent(1): Remove dead code relating to unix-style comments.

The original indent(1) described unix-style comments as similar to box
comments, except the first non-blank character on each line is lined up
with the '*' of the "/*" which appears on a line by itself.

The code has been turned off for ages and -sc/-nsc make it even
less relevant.

Reference:
https://github.com/pstef/freebsd_indent/commit/89c5fe2c56742d96975bb3ea6b99f28baf9d82f6

Differential Revision: https://reviews.freebsd.org/D6966  (Partial)

Submitted by: Piotr Stefaniak

7 years agoFix the comment above pmap_invalidate_page. tlbi will invalidate the tlb
andrew [Sun, 31 Jul 2016 14:59:44 +0000 (14:59 +0000)]
Fix the comment above pmap_invalidate_page. tlbi will invalidate the tlb
on all CPUs.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agosh: Fix a clang warning.
jilles [Sun, 31 Jul 2016 13:11:34 +0000 (13:11 +0000)]
sh: Fix a clang warning.

Submitted by: bdrewery

7 years agoRelax the barriers around a TLB invalidation to only wait on
andrew [Sun, 31 Jul 2016 12:59:10 +0000 (12:59 +0000)]
Relax the barriers around a TLB invalidation to only wait on
inner-shareable memory accesses. There is no need for full system barriers.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agolocks: change sleep_cnt and spin_cnt types to u_int
mjg [Sun, 31 Jul 2016 12:11:55 +0000 (12:11 +0000)]
locks: change sleep_cnt and spin_cnt types to u_int

Both variables are uint64_t, but they only count spins or sleeps.
All reasonable values which we can get here comfortably hit in 32-bit range.

Suggested by: kib
MFC after: 1 week

7 years agoamd64: implement pagezero using rep stos
mjg [Sun, 31 Jul 2016 11:34:08 +0000 (11:34 +0000)]
amd64: implement pagezero using rep stos

The current implementation uses non-temporal writes. This turns out to
be detrimental to performance if the page is used shortly after, which
is the typical case with page faults.

Switch to rep stos.

Reviewed by: kib
MFC after: 1 week

7 years agoFix date
ache [Sun, 31 Jul 2016 10:15:04 +0000 (10:15 +0000)]
Fix date