]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoConnect ena(4) to the build.
gjb [Fri, 7 Jul 2017 16:22:09 +0000 (16:22 +0000)]
Connect ena(4) to the build.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoRemove the MULTIDELAY option from arm. It's now enabled when PLATFORM is
andrew [Fri, 7 Jul 2017 13:55:11 +0000 (13:55 +0000)]
Remove the MULTIDELAY option from arm. It's now enabled when PLATFORM is
enabled.

7 years agoComplete r320189 which allows a NULL VM fault handler in the LinuxKPI.
hselasky [Fri, 7 Jul 2017 13:44:14 +0000 (13:44 +0000)]
Complete r320189 which allows a NULL VM fault handler in the LinuxKPI.
Instead of mapping a dummy page upon a page fault, map the page
pointed to by the physical address given by IDX_TO_OFF(vmap->vm_pfn).
To simplify the implementation use OBJT_DEVICE to implement our own
linux_cdev_pager_fault() instead of using the existing
linux_cdev_pager_populate().

Some minor code factoring while at it.

Reviewed by: markj @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix a bug in synchronize RCU when the calling thread is bound to a CPU.
hselasky [Fri, 7 Jul 2017 13:15:00 +0000 (13:15 +0000)]
Fix a bug in synchronize RCU when the calling thread is bound to a CPU.

Set "td_pinned" to zero after "sched_unbind()" to prevent "td_pinned"
from temporarily becoming negative during "sched_bind()". This can
happen if "sched_bind()" uses "sched_pin()" and "sched_unpin()".

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoImplement fix for BULK IN-token retry mechanism. When the hardware is
hselasky [Fri, 7 Jul 2017 12:03:58 +0000 (12:03 +0000)]
Implement fix for BULK IN-token retry mechanism. When the hardware is
programmed for infinite IN token retry after NAK, the SAF1761
hardware, however, does not retry the IN-token. This problem is
described in the SAF1761 errata, section 18.1.1.

While at it:
- Add some minor chip specific initialization for RTEMS.
- Add debug print for status registers in the interrupt filter.

Submitted by: Christian Mauderer <christian.mauderer@embedded-brains.de>
MFC after: 1 week

7 years agoamd-vi: gcc build errors
rlibby [Fri, 7 Jul 2017 06:37:19 +0000 (06:37 +0000)]
amd-vi: gcc build errors

amdvi_cmp_wait: gcc complained about a malformed string behind an ifdef.

struct amdvi_dte: widen the type of the first reserved bitfield so that
the packed representation would not cross an alignment boundary for that
type. Apparently that causes in-tree gcc (4.2) to insert padding
(despite packed, resulting in a wrong structure definition), and causes
more modern gcc to emit a warning.

ivrs_hdr_iterate_tbl: delete a misleading check about header length
being less than 0 (the type is unsigned) and replace it with a check
that the length doesn't exceed the table size.

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

7 years agoImprove BIT_FLS() documentation.
kib [Fri, 7 Jul 2017 05:43:44 +0000 (05:43 +0000)]
Improve BIT_FLS() documentation.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 6 days

7 years ago - Use strlcat() instead of strncat().
delphij [Fri, 7 Jul 2017 02:48:55 +0000 (02:48 +0000)]
 - Use strlcat() instead of strncat().
 - Use asprintf() and handle allocation errors.

Reviewed by: kevlo
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11486

7 years agoDocument the changes done to nfsuserd by r320757.
rmacklem [Thu, 6 Jul 2017 22:34:34 +0000 (22:34 +0000)]
Document the changes done to nfsuserd by r320757.

This is a content change.

7 years agoModify the nfsuserd daemon so that it uses an AF_LOCAL socket for upcalls.
rmacklem [Thu, 6 Jul 2017 22:04:37 +0000 (22:04 +0000)]
Modify the nfsuserd daemon so that it uses an AF_LOCAL socket for upcalls.

This patch modifies the nfsuserd daemon so that it uses an AF_LOCAL socket
for upcalls by default. This should fix the problem with using a UDP
socket upcall to 127.0.0.1 when jails are used.
The AF_LOCAL socket case only supports a single server daemon, since hangs
were observed by the original problem reporter when multiple daemons
were used.
The patch adds a command line option called "-use-udpsock" which makes
the daemon revert to its prepatched behaviour.

Suggested by: dfr
PR: 205193
Relnotes: yes

7 years agoAdd BIT_FLS() analogous to BIT_FFS().
kib [Thu, 6 Jul 2017 21:47:17 +0000 (21:47 +0000)]
Add BIT_FLS() analogous to BIT_FFS().

The benefit of BIT_FLS() is that ffsl() can be implemented with a
count leading zeros instruction which is more widespread available.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 1 week

7 years agoUpdate copyright e-mail address to @FreeBSD.org address
kevans [Thu, 6 Jul 2017 19:53:30 +0000 (19:53 +0000)]
Update copyright e-mail address to @FreeBSD.org address

Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11508

7 years agoFix sparc64 libc build after r320742.
kevans [Thu, 6 Jul 2017 18:21:30 +0000 (18:21 +0000)]
Fix sparc64 libc build after r320742.

p_branch_empty was declared but never used due to an oversight. Use it as
designed, further comment on its return value.

Reported by: Jenkins (head-sparc64)
Reviewed by: emaste
Approved by: emaste (mentor)
MFC with: r320742
Differential Revision: https://reviews.freebsd.org/D11506

7 years agoAllow passing NOPKG= to make(1) to prevent the pkg-stage target
gjb [Thu, 6 Jul 2017 17:54:03 +0000 (17:54 +0000)]
Allow passing NOPKG= to make(1) to prevent the pkg-stage target
from getting executed.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoFix drivers that assume ticks starts at zero. These drivers all have logic
ian [Thu, 6 Jul 2017 17:03:22 +0000 (17:03 +0000)]
Fix drivers that assume ticks starts at zero.  These drivers all have logic
similar to "if (ticks > localvar+interval) {localvar=ticks; ...}" where
localvar is initialized to zero.  Ticks is initialized to a negative value
since r278230, and that leads to these if statements never being true.

7 years agoThe impending libregex will implement GNU extensions to bring BREs and
kevans [Thu, 6 Jul 2017 17:01:51 +0000 (17:01 +0000)]
The impending libregex will implement GNU extensions to bring BREs and
EREs closer together. Prepare for this and reduce the diff of libregex changes by
refactoring and combining the top-level parsers for EREs/BREs ahead of time.

Branching functionality has been split out to make it easier to follow the combined
version of the top-level parser. It may also be enabled in the parsing context to make
it easier when libregex enables branching for BREs.

A branching context was also added for the various branching functions and so that
BREs, for instance, can determine if they're the first expression in a chain of expressions
within the current branch and treat '*' as ordinary if so.

This should have no functional impact and negligible performance impact.

Reviewed by: cem, emaste, pfg
Approved by: emaste (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D10920

7 years agoMake ^c work in ddb(4).
trasz [Thu, 6 Jul 2017 15:27:34 +0000 (15:27 +0000)]
Make ^c work in ddb(4).

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoMake ^w work in ddb(4).
trasz [Thu, 6 Jul 2017 15:21:57 +0000 (15:21 +0000)]
Make ^w work in ddb(4).

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoMake ddb(4) disassembler (x/i) use n32 register names.
trasz [Thu, 6 Jul 2017 15:08:51 +0000 (15:08 +0000)]
Make ddb(4) disassembler (x/i) use n32 register names.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoSimplify UIO_SYSSPACE and UIO_NOCOPY paths in uiomove
gallatin [Thu, 6 Jul 2017 15:03:54 +0000 (15:03 +0000)]
Simplify UIO_SYSSPACE and UIO_NOCOPY paths in uiomove

Uiomove can only block when the segflag is UIO_USERSPACE,
otherwise we end up just doing a bcopy (or nothing) and
moving cursors. So only emit witness warnings and
set deadlock thread flags in the UIO_USERSPACE case.

Reviewed by: kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D11489

7 years agoFix cleanup in lib/libc/gen/setdomainname_test
asomers [Thu, 6 Jul 2017 14:47:59 +0000 (14:47 +0000)]
Fix cleanup in lib/libc/gen/setdomainname_test

ATF cleanup routines run in separate processes from the tests themselves, so
they can't share global variables.

Also, setdomainname_test needs to be is_exclusive because the test cases
access a global resource.

PR: 219967
Reviewed by: ngie
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11188

7 years agoacpidump: warn and exit loop on invalid subtable length
emaste [Thu, 6 Jul 2017 14:35:47 +0000 (14:35 +0000)]
acpidump: warn and exit loop on invalid subtable length

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by: The FreeBSD Foundation

7 years agocompiler_rt: provide bswap buildins on sparc64
emaste [Thu, 6 Jul 2017 13:27:01 +0000 (13:27 +0000)]
compiler_rt: provide bswap buildins on sparc64

Attempting to build sparc64 world with GCC 6.3 previously failed with
zstd_compress.c:(.text+0x8fc): undefined reference to `__bswapsi2'

7 years agoImprove ddb(4) error reporting a bit.
trasz [Thu, 6 Jul 2017 12:30:39 +0000 (12:30 +0000)]
Improve ddb(4) error reporting a bit.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoMake ddb(4) a bit more user-friendly by improving "help".
trasz [Thu, 6 Jul 2017 12:27:14 +0000 (12:27 +0000)]
Make ddb(4) a bit more user-friendly by improving "help".

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agousr.sbin/bsdinstall/scripts/hardening: fix options numbers
robak [Thu, 6 Jul 2017 12:19:15 +0000 (12:19 +0000)]
usr.sbin/bsdinstall/scripts/hardening: fix options numbers

Submitted by: Bartek Rutkowski <robak@FreeBSD.org>
Reviewed by: bapt
Approved by: bapt
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D11505

7 years agoReport device descr in addition to ident.
mav [Thu, 6 Jul 2017 09:05:38 +0000 (09:05 +0000)]
Report device descr in addition to ident.

Serial number without device model is somewhat less useful.

MFC after: 2 weeks

7 years agoAdd GEOM::descr attribute for symmetry with GEOM::ident.
mav [Thu, 6 Jul 2017 08:36:14 +0000 (08:36 +0000)]
Add GEOM::descr attribute for symmetry with GEOM::ident.

MFC after: 2 weeks

7 years agoChase upstream change deprecating LIBXO_OPTIONS similar to r320521
ngie [Thu, 6 Jul 2017 08:05:57 +0000 (08:05 +0000)]
Chase upstream change deprecating LIBXO_OPTIONS similar to r320521

LIBXO_OPTIONS was deprecated in favor of the --libxo options.

Inspired by: https://github.com/Juniper/libxo (02272d5c6d7d)

7 years ago:snprintf_float: don't blindly set RLIMIT_DATA and RLIMIT_AS to 1 MB -- raise
ngie [Thu, 6 Jul 2017 07:59:00 +0000 (07:59 +0000)]
:snprintf_float: don't blindly set RLIMIT_DATA and RLIMIT_AS to 1 MB -- raise
the limit to 32MB instead.

Require user=root and memory=64MB+ first so one can be reasonably sure that
the test will function appropriately.

MFC after: 1 month
MFC with: r320726
PR: 220502

7 years agoExpect :snprintf_float to segfault
ngie [Thu, 6 Jul 2017 07:45:20 +0000 (07:45 +0000)]
Expect :snprintf_float to segfault

This issue started occurring within the past month or so.

PR: 220502
Reported by: Jenkins (amd64-head job)

7 years agortwn: add Rx descriptor structures for common code.
avos [Thu, 6 Jul 2017 07:37:33 +0000 (07:37 +0000)]
rtwn: add Rx descriptor structures for common code.

Remove any chipset specific usage of Rx descriptor structure / bits
from common code to prevent misuse of fields that may differ
between various chipsets.

Checked with:  RTL8821AU in STA mode.

7 years ago:l_flag:: be more aggressive when normalizing whitespace
ngie [Thu, 6 Jul 2017 07:37:03 +0000 (07:37 +0000)]
:l_flag:: be more aggressive when normalizing whitespace

Save output from ls -ldT and stat -l, then normalize all repeating whitespace using
sed to single column spaces.

This makes the test flexible with single-digit days, etc, similar to r320723. This
approach is just a bit more of a hammer approach because of how the columns are
ordered/spaced in both ls and stat.

MFC after: 1 week
MFC with: r319841

7 years agoUse %e instead of %d with x_output_date(..)
ngie [Thu, 6 Jul 2017 06:15:44 +0000 (06:15 +0000)]
Use %e instead of %d with x_output_date(..)

stat -x doesn't 0-fill days so %d is inappropriate. %e is correct.

MFC after: 1 week
MFC with: r319841

7 years agoRegenerate src.conf(5)
ngie [Thu, 6 Jul 2017 05:43:04 +0000 (05:43 +0000)]
Regenerate src.conf(5)

7 years agoAdd WITH_RCMDS for parity with WITHOUT_RCMDS
ngie [Thu, 6 Jul 2017 05:40:51 +0000 (05:40 +0000)]
Add WITH_RCMDS for parity with WITHOUT_RCMDS

7 years agohptmv: avoid gcc variably-modified warning
rlibby [Thu, 6 Jul 2017 05:32:22 +0000 (05:32 +0000)]
hptmv: avoid gcc variably-modified warning

gcc produces a "variably modified X at file scope" warning for
structures that use these size definitions.

PR: 211540
Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential revision: https://reviews.freebsd.org/D11416

7 years agoRelease mtx hw_lock before calling pause() in qla_stop() and
davidcs [Thu, 6 Jul 2017 05:16:06 +0000 (05:16 +0000)]
Release mtx hw_lock before calling pause() in qla_stop() and
qla_error_recovery()

MFC after: 5 days

7 years ago[ar724x] put in explicit memory barriers now that read/write register no longer
adrian [Thu, 6 Jul 2017 04:56:23 +0000 (04:56 +0000)]
[ar724x] put in explicit memory barriers now that read/write register no longer
implicitly do them.

They were removed as part of my "fix this to actually work" a few commits
ago in this file.

Tested:

* AP93, AR7240 + AR9280 PCI

7 years agoAdd tests to help verify Links functionality for .../contrib/tzdata/backwards
ngie [Thu, 6 Jul 2017 04:30:06 +0000 (04:30 +0000)]
Add tests to help verify Links functionality for .../contrib/tzdata/backwards

MFC after: 1 month
MFC with: r320702

7 years agoFormalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as
ngie [Thu, 6 Jul 2017 04:19:33 +0000 (04:19 +0000)]
Formalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as
`MK_ZONEINFO_LEAPSECONDS_SUPPORT == yes` and
`MK_ZONEINFO_OLD_TIMEZONES_SUPPORT == yes`.

Keep `LEAPSECONDS` and `OLDTIMEZONES` for backwards compatibility,
but print out a warning notifying users that they should use the new
variables, in an effort to migrate them to the variables. This is being
done mostly for automated build tools, etc, that might rely on these
variables being set. The variables will be removed in the future on
^/head, e.g., after ^/stable/12 is cut.

MFC after:      1 month
Relnotes:       yes
Reviewed by: bdrewery
Differential Revision: D11376

7 years agoRemove SUBDIR ordering/uniquifying in *bin/Makefile
ngie [Thu, 6 Jul 2017 04:15:30 +0000 (04:15 +0000)]
Remove SUBDIR ordering/uniquifying in *bin/Makefile

After the addition of SUBDIR.yes, uniquifying/ordering the SUBDIRs doesn't
make a whole lot of sense, and it's in effect a half measure.

Ordering SUBDIR (after adding SUBDIR.yes to it) in bsd.subdir.mk is a
separate change that warrants more discussion/testing, because while
the SUBDIR_PARALLEL work largely fixed dependency ordering for SUBDIRs,
there might be downstream FreeBSD consumers that rely on the SUBDIR
ordering.

MFC after: 2 months
Reviewed by: bdrewery
Differential Revision: D11398

7 years ago[ar71xx] Start migrating the AR934x based boards over to the new world order.
adrian [Thu, 6 Jul 2017 04:06:25 +0000 (04:06 +0000)]
[ar71xx] Start migrating the AR934x based boards over to the new world order.

This unifies the PCI hints with the AHB/NOR hint syntax.

Tested:

* DIR825C1, AR9344 SoC / 2x2 2G + AR9580 PCI 2x2 5G

7 years agoAdd support for AF_LOCAL socket upcalls to the nfsuserd daemon.
rmacklem [Thu, 6 Jul 2017 00:53:12 +0000 (00:53 +0000)]
Add support for AF_LOCAL socket upcalls to the nfsuserd daemon.

This patch adds support for AF_LOCAL socket upcalls to an nfsuserd daemon
that supports them. A future patch to the nfsuserd daemon will use AF_LOCAL
sockets to avoid a problem when using upcalls to 127.0.0.1 if jails are
in use.

Suggested by: dfr
PR: 205193

7 years agoAllow ipsec to run in vnet jails
kp [Wed, 5 Jul 2017 20:00:58 +0000 (20:00 +0000)]
Allow ipsec to run in vnet jails

ipsec is usable in vnet jails, so allow it to run there.

PR: 211364
Submitted by: Matthias Meyser <meyser xenet.de>

7 years agoFix out-of-tree kernel builds after r320275 when bsd.linker.mk not yet installed.
bdrewery [Wed, 5 Jul 2017 19:43:16 +0000 (19:43 +0000)]
Fix out-of-tree kernel builds after r320275 when bsd.linker.mk not yet installed.

Submitted by: bde

7 years agoAllow MTU changes without ifconfig down/up
davidcs [Wed, 5 Jul 2017 19:25:09 +0000 (19:25 +0000)]
Allow MTU changes without ifconfig down/up

MFC after:5 days

7 years agoFix create-kernel-packages with multiple BUILDKERNELS after r320284
bdrewery [Wed, 5 Jul 2017 19:24:38 +0000 (19:24 +0000)]
Fix create-kernel-packages with multiple BUILDKERNELS after r320284

Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: ngie

7 years agoDefer ACPI taskqueue creation to SI_SUB_KICK_SCHEDULER.
markj [Wed, 5 Jul 2017 17:39:17 +0000 (17:39 +0000)]
Defer ACPI taskqueue creation to SI_SUB_KICK_SCHEDULER.

This addresses a deadlock during boot when EARLY_AP_STARTUP is configured:
a taskqueue thread may call pause() with an ACPI mutex held, and thread0
may block on this mutex before configuring the eventtimer. In this case
the taskqueue thread will sleep forever waiting for its callout to fire.

PR: 220277
Submitted by: jhb
MFC after: 3 days

7 years agoixgbe(4): Update HEAD (p3) to 3.2.12-k
erj [Wed, 5 Jul 2017 17:27:03 +0000 (17:27 +0000)]
ixgbe(4): Update HEAD (p3) to 3.2.12-k

Includes:

- Support for X550EM devices.
- Support for Bypass adapters.
- Flow Director code moved to separate files
- SR-IOV code moved to separate files
- Netmap code moved to separate files

Differential Revision: https://reviews.freebsd.org/D11232
Submitted by: Jeb Cramer <cramerj@intel.com>
Reviewed by: erj@
Tested by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Sponsored by: Intel Corporation

7 years agoFix the ftp-stage target for RPI3 images by loosening the
gjb [Wed, 5 Jul 2017 16:55:45 +0000 (16:55 +0000)]
Fix the ftp-stage target for RPI3 images by loosening the
constraints on the TARGET and TARGET_ARCH variables.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoAdd naive benchmark for SSDs in ZFS SLOG role.
mav [Wed, 5 Jul 2017 16:20:22 +0000 (16:20 +0000)]
Add naive benchmark for SSDs in ZFS SLOG role.

ZFS SLOGs have very specific access pattern with many cache flushes,
which none of benchmarks I know can simulate.  Since SSD vendors rarely
specify cache flush time, this measurement can be useful to explain why
some ZFS pools are slower then expected.  This test writes data chunks
of different size followed by cache flush, alike to what ZFS SLOG does,
and measures average time.

To illustrate, here is result for 6 years old SATA Intel 710 Series SSD:

Synchronous random writes:
         0.5 kbytes:    138.3 usec/IO =      3.5 Mbytes/s
           1 kbytes:    137.7 usec/IO =      7.1 Mbytes/s
           2 kbytes:    151.1 usec/IO =     12.9 Mbytes/s
           4 kbytes:    158.2 usec/IO =     24.7 Mbytes/s
           8 kbytes:    175.6 usec/IO =     44.5 Mbytes/s
          16 kbytes:    210.1 usec/IO =     74.4 Mbytes/s
          32 kbytes:    274.2 usec/IO =    114.0 Mbytes/s
          64 kbytes:    416.5 usec/IO =    150.1 Mbytes/s
         128 kbytes:    776.6 usec/IO =    161.0 Mbytes/s
         256 kbytes:   1503.1 usec/IO =    166.3 Mbytes/s
         512 kbytes:   2968.7 usec/IO =    168.4 Mbytes/s
        1024 kbytes:   5866.8 usec/IO =    170.5 Mbytes/s
        2048 kbytes:  11696.6 usec/IO =    171.0 Mbytes/s
        4096 kbytes:  23329.6 usec/IO =    171.5 Mbytes/s
        8192 kbytes:  46779.5 usec/IO =    171.0 Mbytes/s

, and much newer and supposedly much faster NVMe Samsung 950 PRO SSD:

Synchronous random writes:
         0.5 kbytes:   2092.9 usec/IO =      0.2 Mbytes/s
           1 kbytes:   2013.1 usec/IO =      0.5 Mbytes/s
           2 kbytes:   2014.8 usec/IO =      1.0 Mbytes/s
           4 kbytes:   2090.7 usec/IO =      1.9 Mbytes/s
           8 kbytes:   2044.5 usec/IO =      3.8 Mbytes/s
          16 kbytes:   2084.8 usec/IO =      7.5 Mbytes/s
          32 kbytes:   2137.1 usec/IO =     14.6 Mbytes/s
          64 kbytes:   2173.4 usec/IO =     28.8 Mbytes/s
         128 kbytes:   2923.9 usec/IO =     42.8 Mbytes/s
         256 kbytes:   3085.3 usec/IO =     81.0 Mbytes/s
         512 kbytes:   3112.2 usec/IO =    160.7 Mbytes/s
        1024 kbytes:   2430.6 usec/IO =    411.4 Mbytes/s
        2048 kbytes:   3788.9 usec/IO =    527.9 Mbytes/s
        4096 kbytes:   6198.0 usec/IO =    645.4 Mbytes/s
        8192 kbytes:  10764.9 usec/IO =    743.2 Mbytes/s

While the first one obviously has maximal throughput limitations, the
second one has so high cache flush latency (about 2 millisecond), that
it makes one almost useless in SLOG role, despite of its good throughput
numbers.  Power loss protection is out of scope of this test, but I
suspect it can be related.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

7 years agoDon't overpromote values when calculating len in tcp_output().
jtl [Wed, 5 Jul 2017 16:10:30 +0000 (16:10 +0000)]
Don't overpromote values when calculating len in tcp_output().

sbavail() returns u_int and sendwin is a uint32_t. Therefore, min() (which
operates on two u_int values) is able to correctly calculate the minimum
of these two arguments.

Reported by: rrs
MFC after: 1 week
Sponsored by: Netflix

7 years agoFix typo introduced in r320672 - check for existence of the right file.
trasz [Wed, 5 Jul 2017 15:42:33 +0000 (15:42 +0000)]
Fix typo introduced in r320672 - check for existence of the right file.

Reported by: rpokala@
MFC after: 2 weeks

7 years agoAdd deprecation notices for gdb and kgdb.
jhb [Wed, 5 Jul 2017 15:23:30 +0000 (15:23 +0000)]
Add deprecation notices for gdb and kgdb.

Even though gdb and kgdb may not be removed for 12.0 on some architectures,
the notice is unconditional as these tools will likely be removed at some
point in the future when adequate replacements are available (gdb in ports
or lldb in base).

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11477

7 years agoAdd option to bsdinstall to disable insecure console, update stack guard option
robak [Wed, 5 Jul 2017 13:37:27 +0000 (13:37 +0000)]
Add option to bsdinstall to disable insecure console, update stack guard option

This patch adds new bsdinstall option to hardening section that allows users
to change this behaviour to secure one and updates stack guard option so it
would set the value of relevant sysctl to 512 (2MB)

Submitted by: Bartek Rutkowski
Reviewed by: adrian, bapt, emaste
Approved by: bapt, emaste
MFC after: 1 day
Sponsored by: Pixeware LTD
Differential Revision: https://reviews.freebsd.org/D9700

7 years agoSort entries in libgcc_s Version.map
emaste [Wed, 5 Jul 2017 13:13:38 +0000 (13:13 +0000)]
Sort entries in libgcc_s Version.map

7 years agoCosmetic tweaks to the default shell rc files, mostly comments.
trasz [Wed, 5 Jul 2017 13:08:07 +0000 (13:08 +0000)]
Cosmetic tweaks to the default shell rc files, mostly comments.

MFC after: 2 weeks

7 years agoUse more canonical .Dt for vt(4).
trasz [Wed, 5 Jul 2017 10:43:27 +0000 (10:43 +0000)]
Use more canonical .Dt for vt(4).

MFC after: 2 weeks

7 years agoRun "resizewin -z" from the default shell profile files. This makes
trasz [Wed, 5 Jul 2017 10:37:37 +0000 (10:37 +0000)]
Run "resizewin -z" from the default shell profile files. This makes
the terminal work properly out of the box when logging over a serial
line, which is quite important for the user experience on boards like
Raspberry Pi.  It doesn't affect cases where the terminal size is
already non-zero, such as SSH or vt(4) sessions.

Note that this doesn't handle a scenario pointed out by rgrimes@:
when the terminal is resized after login, the terminal size won't
get updated even after logging out and back in.

Reviewed by: imp
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10642

7 years agoMake MULTIDELAY a requirement in the MPCore Timer driver when using
andrew [Wed, 5 Jul 2017 10:29:05 +0000 (10:29 +0000)]
Make MULTIDELAY a requirement in the MPCore Timer driver when using
PLATFORM. This will help with removing the MULTIDELAY option, enabling
it when PLATFORM is enabled.

7 years agoRequire the ARM Generic Timer driver is built for MULTIDELAY on 32bit arm.
andrew [Wed, 5 Jul 2017 09:27:18 +0000 (09:27 +0000)]
Require the ARM Generic Timer driver is built for MULTIDELAY on 32bit arm.
As this driver is also used for DELAY on arm64 we need to keep the existing
DELAY code for it to use.

7 years agoIn open_binary_fd: when using buffer size for strl* and snprintf,
delphij [Wed, 5 Jul 2017 06:12:21 +0000 (06:12 +0000)]
In open_binary_fd: when using buffer size for strl* and snprintf,
always use >= instead of > to avoid truncation.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D11474
MFC after: 3 days

7 years agoDocument supported poollist() (ippool -l) options in usage() and in
cy [Wed, 5 Jul 2017 05:50:36 +0000 (05:50 +0000)]
Document supported poollist() (ippool -l) options in usage() and in
ippool.8 man page.

7 years agolibelftc: bump version, tracking import in r320343
emaste [Wed, 5 Jul 2017 02:58:46 +0000 (02:58 +0000)]
libelftc: bump version, tracking import in r320343

7 years agoRemove an obsolete comment
jhibbits [Wed, 5 Jul 2017 02:20:03 +0000 (02:20 +0000)]
Remove an obsolete comment

This has been wrong for well over a year, we support the full 36-bit
(or more) PA space.

7 years agoAdd a Bugs section that indicates that the nfsuserd doesn't work
rmacklem [Tue, 4 Jul 2017 22:20:30 +0000 (22:20 +0000)]
Add a Bugs section that indicates that the nfsuserd doesn't work
when jails are being used on the system.
It is hoped that the patches in PR#205193 will someday get tested/debugged
so that they can be committed to fix this.

This is a content change.

PR: 205193
MFC after: 2 weeks

7 years agoWhen reporting undefined symbol, note the version, if specified.
kib [Tue, 4 Jul 2017 20:19:36 +0000 (20:19 +0000)]
When reporting undefined symbol, note the version, if specified.

Use the standard syntax of name@version, I do not expect a confusion
due to unlikely possibility of the name containing the '@' character.

Requested by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agocam: EOL whitespace cleanup and line wrapping changes
emaste [Tue, 4 Jul 2017 18:48:08 +0000 (18:48 +0000)]
cam: EOL whitespace cleanup and line wrapping changes

NFC. This cleanup simplifies diffs for review of the MMC-CAM work.

Submitted by: kibab

7 years agoInvoke suspend/resume methods from the driver pmops if available.
markj [Tue, 4 Jul 2017 18:44:14 +0000 (18:44 +0000)]
Invoke suspend/resume methods from the driver pmops if available.

Obtained from: kmacy (original version)
MFC after: 1 week

7 years agoAdd a driver for the imx6 on-chip realtime clock.
ian [Tue, 4 Jul 2017 18:38:34 +0000 (18:38 +0000)]
Add a driver for the imx6 on-chip realtime clock.

This driver is standard rather than optional because it can always provide
time after a reboot, but it will only provide time after a power cycle if
battery power is supplied to the chip's SNVS power domain.

7 years agoMove to open state after plausibility checks.
tuexen [Tue, 4 Jul 2017 18:24:50 +0000 (18:24 +0000)]
Move to open state after plausibility checks.

When doing this too early, the MIB counters go wrong.

MFC after: 1 week

7 years agoAfter r319722 two fields were left uninitialized when transforming a
hselasky [Tue, 4 Jul 2017 18:23:17 +0000 (18:23 +0000)]
After r319722 two fields were left uninitialized when transforming a
socket structure into a listening socket. This resulted in an invalid
instruction fault for all 32-bit platforms.

When INVARIANTS is set the union where the two uninitialized fields
reside gets properly zeroed. This patch ensures the two uninitialized
fields are zeroed when INVARIANTS is undefined.

For 64-bit platforms this issue was not visible because so->sol_upcall
which is uninitialized overlaps with so->so_rcv.sb_state which is
already zero during soalloc();

For 32-bit platforms this issue was visible and resulted in an invalid
instruction fault, because so->sol_upcall overlaps with
so->so_rcv.sb_sel which is always initialized to a valid data pointer
during soalloc().

Verifying the offset locations mentioned above are identical is left
as an exercise to the reader.

PR: 220452
PR: 220358
Reviewed by: ae (network), gallatin
Differential Revision: https://reviews.freebsd.org/D11475
Sponsored by: Mellanox Technologies

7 years agoMove the simple armv6 only timer drivers to require MULTIDELAY to help
andrew [Tue, 4 Jul 2017 18:07:09 +0000 (18:07 +0000)]
Move the simple armv6 only timer drivers to require MULTIDELAY to help
move all armv6 configs it.

7 years agoDon't hold if refcount on an stcb when it is not needed.
tuexen [Tue, 4 Jul 2017 18:04:44 +0000 (18:04 +0000)]
Don't hold if refcount on an stcb when it is not needed.
This improves the consistency with other parts of the code.

7 years agoAdd a delay count to the last few places. This will help make MULTIDELAY
andrew [Tue, 4 Jul 2017 17:15:23 +0000 (17:15 +0000)]
Add a delay count to the last few places. This will help make MULTIDELAY
a requirement on armv6 with PLATFORM.

7 years agoRemove PLATFORM_SMP. It's unneeded as all configs with both PLATFORM and
andrew [Tue, 4 Jul 2017 16:52:55 +0000 (16:52 +0000)]
Remove PLATFORM_SMP. It's unneeded as all configs with both PLATFORM and
SMP use it so we can switch to the combination of these as the check.

7 years agoAdd deprecation notices for all rcmd tools
allanjude [Tue, 4 Jul 2017 15:44:30 +0000 (15:44 +0000)]
Add deprecation notices for all rcmd tools

Submitted by: bcr
Reviewed by: emaste, bapt, jhl
MFC after: immediate
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11471

7 years agoAdd PLATFORM and PLATFORM_SMP support to the ALPINE kernel configuration.
andrew [Tue, 4 Jul 2017 12:26:47 +0000 (12:26 +0000)]
Add PLATFORM and PLATFORM_SMP support to the ALPINE kernel configuration.
This will help move it to be part of GENERIC.

7 years agoTeach VERSATILEPB about PLATFORM. This will help move it into the GENERIC
andrew [Tue, 4 Jul 2017 12:17:49 +0000 (12:17 +0000)]
Teach VERSATILEPB about PLATFORM. This will help move it into the GENERIC
kernel configuration.

7 years agortwn_usb: reject too long (>16K) mbufs.
avos [Tue, 4 Jul 2017 07:07:08 +0000 (07:07 +0000)]
rtwn_usb: reject too long (>16K) mbufs.

While here move RTWN_TXBUFSZ constant from common to USB specific code
(it's not used anywhere else).

7 years agoAdd some auxiliary types for device driver support.
markj [Tue, 4 Jul 2017 01:23:36 +0000 (01:23 +0000)]
Add some auxiliary types for device driver support.

MFC after: 1 week

7 years agoAdd a field for the class code to struct pci_driver.
markj [Tue, 4 Jul 2017 01:05:20 +0000 (01:05 +0000)]
Add a field for the class code to struct pci_driver.

Fill out some previously uninitialized fields as well.

MFC after: 1 week

7 years agoAdd some PCI class definitions.
markj [Tue, 4 Jul 2017 00:48:50 +0000 (00:48 +0000)]
Add some PCI class definitions.

MFC after: 1 week

7 years agoRename the "driver" field to "bsddriver" to avoid a name collision.
markj [Tue, 4 Jul 2017 00:30:48 +0000 (00:30 +0000)]
Rename the "driver" field to "bsddriver" to avoid a name collision.

MFC after: 1 week

7 years agoReplace mbuf defragmentation with collapse
zbb [Tue, 4 Jul 2017 00:10:29 +0000 (00:10 +0000)]
Replace mbuf defragmentation with collapse

Collapse should be more effective than defragmentation.
Added missing declaration of ena_check_and_collapse_mbuf().

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoFix creation of dma tags and TSO settings
zbb [Tue, 4 Jul 2017 00:08:47 +0000 (00:08 +0000)]
Fix creation of dma tags and TSO settings

TSO settings were not reflecting real HW capabilities.

DMA tags were created with wrong window - high address was the same as
low, so excluding window was not working.

Capabilities of TX dma transaction were not set properly - TSO max size
had been increased and size of one segment had been adjusted.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoRemove RX mtx from ENA driver
zbb [Tue, 4 Jul 2017 00:06:56 +0000 (00:06 +0000)]
Remove RX mtx from ENA driver

RX lock is no longer required. There can only be one RX cleanup task
running at a time, RX cleanup cannot be executed if interface is not
yet initialized and ena_down() will not free any RX resources if any io
interrupt is being handled - RX cleanup task is only called from an
interrupt handler.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoCall drbr_advance() before leaving TX routine
zbb [Tue, 4 Jul 2017 00:04:31 +0000 (00:04 +0000)]
Call drbr_advance() before leaving TX routine

If drbr_advance() is not called before doing cleanup and packet is
already enqueued for sending (tx_info is holding pointer to mbuf), then
mbuf is cleaned both in drbr_flush() and in cleanup routine, when all
mbufs hold by tx_buffer_info are being released.

This causes panic, because mbuf is released twice.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoUnmask all IO irqs after driver state is set as running
zbb [Tue, 4 Jul 2017 00:02:28 +0000 (00:02 +0000)]
Unmask all IO irqs after driver state is set as running

If driver left MSI-x handlling routine because interface was put down,
it is not unmasking IRQs, so any requesting interrupt will be awaiting
for unmasking.

On ena_up() routine all interrupts are being unmasked and any awaiting
interrupt will be handled right away.

If handler was executed before driver state was set as running, handling
routine is being ended immediately, leaving IO irqs for given queue
masked.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoHold the PCI device list lock when removing an element.
markj [Tue, 4 Jul 2017 00:02:06 +0000 (00:02 +0000)]
Hold the PCI device list lock when removing an element.

MFC after: 1 week

7 years agoAcquire locks before calling drbr_flush()
zbb [Tue, 4 Jul 2017 00:00:42 +0000 (00:00 +0000)]
Acquire locks before calling drbr_flush()

It is required to hold lock that is associated with buffer ring before
flushing drbr.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoAdd missing lock upon initialization of the interface
zbb [Mon, 3 Jul 2017 23:59:11 +0000 (23:59 +0000)]
Add missing lock upon initialization of the interface

Lack of this lock was causing crash if down was called in
parallel with the initialization routine.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoFix a few issues with the lockstat provider man page.
markj [Mon, 3 Jul 2017 23:54:39 +0000 (23:54 +0000)]
Fix a few issues with the lockstat provider man page.

- Address most of the post-commit comments on D11128.[1]
- Reference the man pages for the lock types supported by the provider.
- Add a BUGS section.
- Eliminate some redundancy by describing similar probes in the same
  paragraph.
- Fix several inaccuracies, particularly in the probe argument
  descriptions.

Submitted by: wblock [1]
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11293

7 years agoUpdate jemalloc to 5.0.1.
jasone [Mon, 3 Jul 2017 23:27:57 +0000 (23:27 +0000)]
Update jemalloc to 5.0.1.

7 years agoCorrect a typo in the comment part of r320577, later on copied into
marius [Mon, 3 Jul 2017 20:47:32 +0000 (20:47 +0000)]
Correct a typo in the comment part of r320577, later on copied into
the commit message; as actually implemented, the intent is to retry
up to 2 ms for controllers to enable bus power.
Noticed by: ian@, rgrimes@

Additional note: Among others, the problem addressed by r320577 is
the APL32 ("Storage Controllers May Not Be Power Gated") erratum.
Hopefully, along with r318282, r320577 works around the remaining
problems seen with Intel Apollo Lake eMMC and SDXC controllers.

7 years agoResolve confusion between different error code spaces.
kib [Mon, 3 Jul 2017 20:44:01 +0000 (20:44 +0000)]
Resolve confusion between different error code spaces.

The vm_map_fixed() and vm_map_stack() VM functions return Mach error
codes.  Convert them into errno values before returning result from
exec_new_vmspace().

While there, modernize the comment and do minor style adjustments.

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

7 years agoAllow rtadvd and bsnmpd to run in vnet jails
kp [Mon, 3 Jul 2017 20:36:58 +0000 (20:36 +0000)]
Allow rtadvd and bsnmpd to run in vnet jails

Both of these tools are usable in vnet jails, so allow them to run there.

PR: 220431, 220432
Submitted by: olivier@freebsd.org

7 years agoClear clang warning:
sbruno [Mon, 3 Jul 2017 19:49:25 +0000 (19:49 +0000)]
Clear clang warning:
  warning: macro expansion producing 'defined' has undefined behavior
  [-Wexpansion-to-defined]

Submitted by: Aaron Prieger <aprieger@llnw.com>
Reviewed by: dim
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11166

7 years agoAdd a sysctl to toggle the use of the sockets LOWAT when calculating auto window...
sbruno [Mon, 3 Jul 2017 19:39:58 +0000 (19:39 +0000)]
Add a sysctl to toggle the use of the sockets LOWAT when calculating auto window growth

Submitted by: j@nitrology.com (Jason Wolfe)
Reviewed by: gnn hiren
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11016