]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoProperly set userid for truncate_test.
Bryan Drewery [Fri, 21 Jul 2017 16:14:06 +0000 (16:14 +0000)]
Properly set userid for truncate_test.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoImplement SIGEV_THREAD notifications for lio_listio(2)
Alan Somers [Fri, 21 Jul 2017 15:09:24 +0000 (15:09 +0000)]
Implement SIGEV_THREAD notifications for lio_listio(2)

Our man pages have always indicated that this was supported, but in fact the
feature was never implemented for lio_listio(2).

Reviewed by: jhb, kib (earlier version)
MFC after: 20 days
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11680

6 years agoAdd warning flags for GCC 7.1.0 compiler.
Ruslan Bukin [Fri, 21 Jul 2017 14:50:32 +0000 (14:50 +0000)]
Add warning flags for GCC 7.1.0 compiler.

Sponsored by: DARPA, AFRL

6 years agoFix style: change spaces to tabs.
Ruslan Bukin [Fri, 21 Jul 2017 14:14:47 +0000 (14:14 +0000)]
Fix style: change spaces to tabs.

Sponsored by: DARPA, AFRL

6 years agoMake truss(1) cross-reference dtrace(1) and bump .Dd.
Edward Tomasz Napierala [Fri, 21 Jul 2017 13:58:51 +0000 (13:58 +0000)]
Make truss(1) cross-reference dtrace(1) and bump .Dd.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoUse more usual formatting for the EXAMPLES section of truss(1).
Edward Tomasz Napierala [Fri, 21 Jul 2017 13:50:59 +0000 (13:50 +0000)]
Use more usual formatting for the EXAMPLES section of truss(1).

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoUse more usual formatting for the EXAMPLES section of ktrace(1).
Edward Tomasz Napierala [Fri, 21 Jul 2017 13:27:25 +0000 (13:27 +0000)]
Use more usual formatting for the EXAMPLES section of ktrace(1).

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoRemove stack guard option from hardening menu.
Bartek Rutkowski [Fri, 21 Jul 2017 08:50:22 +0000 (08:50 +0000)]
Remove stack guard option from hardening menu.

Since kib's change the stack guard is now ON by default,
this option in hardening menu of bsdinstall is no longer needed.

Submitted by: Bartlomiej Rutkowski <robak@FreeBSD.org>
Reviewed by: bapt
Approved by: bapt
MFC after: 1 day
Sponsored by: Pixeware LTD
Differential Revision: https://reviews.freebsd.org/D11686

6 years agoFix getsockopt() for listening sockets when using SO_SNDBUF, SO_RCVBUF,
Michael Tuexen [Fri, 21 Jul 2017 07:44:43 +0000 (07:44 +0000)]
Fix getsockopt() for listening sockets when using SO_SNDBUF, SO_RCVBUF,
SO_SNDLOWAT, SO_RCVLOWAT. Since r31972 it only worked for non-listening
sockets.

Sponsored by: Netflix, Inc.

6 years agoRestore the changes done in r313982: Replace zero with NULL for pointers.
Luiz Otavio O Souza [Fri, 21 Jul 2017 03:59:56 +0000 (03:59 +0000)]
Restore the changes done in r313982: Replace zero with NULL for pointers.

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

6 years agoCompile the atomic64 emulation for powerpcspe
Justin Hibbits [Fri, 21 Jul 2017 03:48:09 +0000 (03:48 +0000)]
Compile the atomic64 emulation for powerpcspe

With this, ZFS builds for and runs (not quite stablely) on powerpcspe.

6 years agoUpdate netmap_user.h with the current version of netmap. This file should
Luiz Otavio O Souza [Fri, 21 Jul 2017 03:42:09 +0000 (03:42 +0000)]
Update netmap_user.h with the current version of netmap.  This file should
have been committed together with r319881.

MFC after: 1 week
MFC with: r319881
Pointy hat to: loos

6 years agoAdd cpufreq support for P1022 and MPC8536
Justin Hibbits [Fri, 21 Jul 2017 03:40:05 +0000 (03:40 +0000)]
Add cpufreq support for P1022 and MPC8536

P1022 and MPC8536  include a 'jog' feature for clock control
(jog being a slower form of run mode).  This is done by changing the
PLL multiplier, and cannot be done if any core is in doze or sleep mode.

6 years agoDo not allow the use of the loopback interface in netmap.
Luiz Otavio O Souza [Fri, 21 Jul 2017 03:28:35 +0000 (03:28 +0000)]
Do not allow the use of the loopback interface in netmap.

The generic support in netmap send the packets using if_transmit() and the
loopback do not support packets coming from if_transmit()/if_start().

This avoids the use of the loopback interface and the subsequent crash that
happens when the application send packets to the loopback interface.

Details in: https://github.com/luigirizzo/netmap/issues/322
Reported by: Vincenzo Maffione <v.maffione@gmail.com>
Sponsored by: Rubicon Communications, LLC (Netgate)

6 years agoFix a couple of typos in a comment.
Luiz Otavio O Souza [Fri, 21 Jul 2017 03:04:55 +0000 (03:04 +0000)]
Fix a couple of typos in a comment.

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

6 years agoAdd regression test for recent regex(3) breakage
Kyle Evans [Fri, 21 Jul 2017 01:35:55 +0000 (01:35 +0000)]
Add regression test for recent regex(3) breakage

BREs recently became prematurely sensitive to the branching operator, which
outright broke expressions that used it instead of failing silently. Test
that \| is matching a literal | for the time being.

Reviewed by: cem, emaste, ngie
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11577

6 years agor320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.
Rick Macklem [Fri, 21 Jul 2017 00:14:43 +0000 (00:14 +0000)]
r320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.

r320062 used nm_rsize, nm_wsize to set the maximum request/response sizes for
the NFSv4.1 session. If rsize,wsize are not specified as options, the
value of nm_rsize, nm_wsize is 0 at session creation, resulting in
values for request/response that are too small.
This patch fixes the problem. A workaround is to specify rsize=N,wsize=N
mount options explicitly, so they are set before session creation.
This bug only affects NFSv4.1 mounts against some non-FreeBSD servers.

MFC after: 1 week

6 years agoRevert r321308. I'll commit a better fix soon.
Rick Macklem [Thu, 20 Jul 2017 23:59:47 +0000 (23:59 +0000)]
Revert r321308. I'll commit a better fix soon.

6 years agor320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.
Rick Macklem [Thu, 20 Jul 2017 23:15:50 +0000 (23:15 +0000)]
r320062 introduced a bug when doing NFSv4.1 mounts against some non-FreeBSD servers.

r320062 used nm_rsize, nm_wsize to set the maximum request/response sizes for
the NFSv4.1 session. If rsize,wsize are not specified as options, the
value of nm_rsize, nm_wsize is 0 at session creation, resulting in
values for request/response that are too small.
This patch fixes the problem. A workaround is to specify rsize=N,wsize=N
mount options explicitly, so they are set before session creation.
This bug only affects NFSv4.1 mounts against some non-FreeBSD servers.

MFC after: 1 week

6 years agoFix printf format warning in iflib.c
Dimitry Andric [Thu, 20 Jul 2017 20:28:31 +0000 (20:28 +0000)]
Fix printf format warning in iflib.c

Clang 5.0.0 got better warnings about printf format strings using %zd,
and this leads to the following -Werror warning on e.g. arm:

    sys/net/iflib.c:1517:8: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat]
                                              sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize);
                                              ^~~~~~~~~~~~~~~~~~~~
    sys/net/iflib.c:1517:41: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat]
                                              sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize);
                                                                               ^~~~~~~~~~~~~~~~~~~~~~~

Fix this by casting bus_size_t arguments to uintmax_t, and using %ju
instead.

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

6 years agoFix printf format warning in zfs_module.c
Dimitry Andric [Thu, 20 Jul 2017 20:27:19 +0000 (20:27 +0000)]
Fix printf format warning in zfs_module.c

Clang 5.0.0 got better warnings about print format strings using %zd,
and this leads to the following -Werror warning on e.g. arm:

    sys/boot/efi/boot1/zfs_module.c:186:18: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
                        "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status));
                                   ^~~~~~~~~~

Fix this by casting off_t arguments to intmax_t, and using %jd instead.

Reviewed by: tsoome
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11678

6 years agoadd arm64 objcopy output target for embedfs
Ed Maste [Thu, 20 Jul 2017 18:22:49 +0000 (18:22 +0000)]
add arm64 objcopy output target for embedfs

PR: 220877
Submitted by: David NewHamlet
MFC after: 1 week

6 years agoAdd myself and mentor line to committers-src.dot.
Matt Joras [Thu, 20 Jul 2017 18:14:27 +0000 (18:14 +0000)]
Add myself and mentor line to committers-src.dot.

Approved by: rstone (mentor)
Differential Revision: https://reviews.freebsd.org/D11672

6 years agoacpidump: add GIC ITS srat type
Ed Maste [Thu, 20 Jul 2017 17:36:17 +0000 (17:36 +0000)]
acpidump: add GIC ITS srat type

From ACPI 6.2, 5.2.16.5

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

6 years agoacpidump: add ACPI NFIT (NVDIMM Firmware Interface Table)
Ed Maste [Thu, 20 Jul 2017 17:31:27 +0000 (17:31 +0000)]
acpidump: add ACPI NFIT (NVDIMM Firmware Interface Table)

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11479

6 years agoRemove some private symbols from librt
Alan Somers [Thu, 20 Jul 2017 16:24:29 +0000 (16:24 +0000)]
Remove some private symbols from librt

Private functions like __aio_read and _aio_read were exposed in
FBSDprivate_1.0 by r169090, even though they've never been used outside of
librt. Also, remove some weak references from r156136 that have never
resolved.

Reviewed by: kib
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11649

6 years agoacpidump: use C99 designated initializers
Ed Maste [Thu, 20 Jul 2017 15:52:36 +0000 (15:52 +0000)]
acpidump: use C99 designated initializers

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11659

6 years agodate: avoid crash on invalid time
Ed Maste [Thu, 20 Jul 2017 15:28:48 +0000 (15:28 +0000)]
date: avoid crash on invalid time

localtime(3) returns NULL when passed an invalid time_t but date(1)
previously did not handle it. Exit with an error in that case.

PR: 220828
Reported by: Vinícius Zavam
Reviewed by: cem, kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11660

6 years agoDeal with listening socket correctly.
Michael Tuexen [Thu, 20 Jul 2017 14:50:13 +0000 (14:50 +0000)]
Deal with listening socket correctly.

6 years agoFix the explicit EOR mode. If the final messages is not complete, send
Michael Tuexen [Thu, 20 Jul 2017 11:09:33 +0000 (11:09 +0000)]
Fix the explicit EOR mode. If the final messages is not complete, send
an ABORT.
Joint work with rrs@
MFC after: 1 week

6 years agohyperv/storvsc: Force SPC3 for CDROM attached.
Sepherosa Ziehau [Thu, 20 Jul 2017 07:13:26 +0000 (07:13 +0000)]
hyperv/storvsc: Force SPC3 for CDROM attached.

This unbreaks the CDROM attaching on GEN2 VMs.  On GEN1 VMs, CDROM is
attached to emulated ATA controller.

PR: 220790
Submitted by: Hongjiang Zhang <honzhan microsoft com>
MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11634

6 years agoefi: restrict visibility of EFIABI_ATTR-declared functions
Ryan Libby [Thu, 20 Jul 2017 06:47:06 +0000 (06:47 +0000)]
efi: restrict visibility of EFIABI_ATTR-declared functions

In-tree gcc (4.2) doesn't understand __attribute__((ms_abi))
(EFIABI_ATTR).  Avoid declaring functions with that attribute when the
compiler is detected to be gcc < 4.4.

Reviewed by: kib, imp (previous version)
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11636

6 years agoprocstat(8): clarify program usage
Enji Cooper [Thu, 20 Jul 2017 05:43:48 +0000 (05:43 +0000)]
procstat(8): clarify program usage

- Visualize mutually exclusive options and their corresponding
  arguments.
- Try to make the subtleties that are expressed in the code, and
  potentially in the manpages, more apparent.

6 years agoSome trivial style(9) fixes
Enji Cooper [Thu, 20 Jul 2017 04:32:06 +0000 (04:32 +0000)]
Some trivial style(9) fixes

- Delete trailing whitespace.
- Fix leading indentation (convert single column spaces to tabs).
- Convert "[Ff]all through" to "FALLTHROUGH", per implicit project
  style/spelling.

Reviewed by: sbruno
Differential Revision: D11665

6 years agoClean up leading whitespace (convert single column spaces to hard tabs)
Enji Cooper [Thu, 20 Jul 2017 00:40:03 +0000 (00:40 +0000)]
Clean up leading whitespace (convert single column spaces to hard tabs)

MFC after: now

6 years agoDecode FreeBSD11 fstatat calls.
Mark Johnston [Wed, 19 Jul 2017 23:34:28 +0000 (23:34 +0000)]
Decode FreeBSD11 fstatat calls.

6 years agoRestore igb(4) code dropped during iflib conversion
Sean Bruno [Wed, 19 Jul 2017 22:41:22 +0000 (22:41 +0000)]
Restore igb(4) code dropped during iflib conversion
 - restore newer code for vf, i350, i210, i211
 - restore dmac init code for i354 and i350
 - restore WUC/WUFC update
 - check for igb mac type before attempting trying to assert
   a media changed event.
 - handle link events for igb(4) and em(4) devices differently
   and appropriately for their respective model types.

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

6 years agoInclude ARCH_FLAGS in CFLAGS when building modules.
Brooks Davis [Wed, 19 Jul 2017 22:06:35 +0000 (22:06 +0000)]
Include ARCH_FLAGS in CFLAGS when building modules.

Without this change, modules will match the default compiler
configuration which may not be the same as the kernel values.

Reviewed by: imp
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11633

6 years agoDon't cache mbuf pointers if the number of descriptors is greater than
Sean Bruno [Wed, 19 Jul 2017 21:18:04 +0000 (21:18 +0000)]
Don't cache mbuf pointers if the number of descriptors is greater than
the number of buffers.

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

6 years agoUpdate the nfsv4 man page to reflect recent changes to support
Rick Macklem [Wed, 19 Jul 2017 20:57:41 +0000 (20:57 +0000)]
Update the nfsv4 man page to reflect recent changes to support
the newer RFCs (5661 and 7530). The main man changes are for the
case of "numbers in strings" for user/groups that RFC7530 allows
and avoids use of nfsuserd(8).

This is a content change.

Reviewed by: trasz (earlier version)
MFC after: 1 week

6 years agoAdd pctrie_init() and vm_radix_init() to initialize generic pctrie and
Konstantin Belousov [Wed, 19 Jul 2017 20:52:47 +0000 (20:52 +0000)]
Add pctrie_init() and vm_radix_init() to initialize generic pctrie and
vm_radix trie.

Existing vm_radix_init() function is renamed to vm_radix_zinit().
Inlines moved out of the _ headers.

Reviewed by: alc, markj (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D11661

6 years agocron(8) manpage updates
Enji Cooper [Wed, 19 Jul 2017 19:53:07 +0000 (19:53 +0000)]
cron(8) manpage updates

- Document /etc/cron.d and /usr/local/etc/cron.d under FILES.
- Reword documentation for -n: add appropriate soft-stop and remove
  contraction to appease igor.

MFC after: 3 days

6 years agoFix trivial whitespace bug introduced in usage message changes for -n
Enji Cooper [Wed, 19 Jul 2017 19:38:25 +0000 (19:38 +0000)]
Fix trivial whitespace bug introduced in usage message changes for -n
support (r304570).

MFC after: now

6 years agoRaise the watchdog timer interval to 2 ticks, there by guaranteeing
David C Somayajulu [Wed, 19 Jul 2017 19:08:37 +0000 (19:08 +0000)]
Raise the watchdog timer interval to 2 ticks, there by guaranteeing
that it fires between 1ms and 2ms. `
Treat two consecutive occurrences of Heartbeat failures as a legitimate
Heartbeat failure

MFC after:3 days

6 years agoDisable stack growth when accessed by AIO daemons.
Konstantin Belousov [Wed, 19 Jul 2017 19:00:32 +0000 (19:00 +0000)]
Disable stack growth when accessed by AIO daemons.

Commit message for r321173 incorrectly stated that the change disables
automatic stack growth from the AIO daemons contexts, with explanation
that this is currently prevents applying wrong resource limits.  Fix
this by actually disabling the growth.

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

6 years agoAllow matches of truncated version strings.
Mark Johnston [Wed, 19 Jul 2017 18:41:16 +0000 (18:41 +0000)]
Allow matches of truncated version strings.

Long objdir paths make it easy to hit the version string length limit in
kernel dump headers. The build number and timestamp are unlikely to be
truncated and ought to be sufficient to protect against false positives.

Discussed with: jhb
MFC after: 1 week

6 years agoUse more flexible expression for replacing t_diff in
Enji Cooper [Wed, 19 Jul 2017 18:30:16 +0000 (18:30 +0000)]
Use more flexible expression for replacing t_diff in
contrib/netbsd-tests/usr.bin/diff/t_diff.sh with the name of the script via
`basename $0`.

This was a change I forgot to port over from
^/head/gnu/usr.bin/diff/tests/Makefile@r272787.

6 years agobsdinstall: improve checksum mismatch error for snapshots
Ed Maste [Wed, 19 Jul 2017 18:25:52 +0000 (18:25 +0000)]
bsdinstall: improve checksum mismatch error for snapshots

The usual case of a mismatched checksum for installer snapshots
(e.g., -CURRENT, -ALPHA*) is that a newer snapshot has been built and
the old install sets have been replaced.  Provide a specific error
message for checksum mismatches there that suggests looking for a newer
snapshot.

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11641

6 years agozfs: Fix a typo in the delay_min_dirty_percent sysctl description
Ed Maste [Wed, 19 Jul 2017 18:17:41 +0000 (18:17 +0000)]
zfs: Fix a typo in the delay_min_dirty_percent sysctl description

The description is FreeBSD-specific and was added in r266497
to fix PR189865.

PR: 220825
Submitted by: Fabian Keil
Obtained from: ElectroBSD
MFC after: 1 week

6 years agoRemove unused function swap_pager_isswapped().
Konstantin Belousov [Wed, 19 Jul 2017 17:28:46 +0000 (17:28 +0000)]
Remove unused function swap_pager_isswapped().

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

6 years agoUpdate targets/pseudo/tests/Makefile.depend after recent additions/subtractions
Enji Cooper [Wed, 19 Jul 2017 16:45:57 +0000 (16:45 +0000)]
Update targets/pseudo/tests/Makefile.depend after recent additions/subtractions
from the FreeBSD test suite.

MFC after: 3 days
MFC with: r316603

6 years agoClean up :coredump_phnum
Enji Cooper [Wed, 19 Jul 2017 16:23:02 +0000 (16:23 +0000)]
Clean up :coredump_phnum

- Use "atf_check -x 'cmd1 | cmd2'" instead of "cmd1 | atf_check cmd2". The
  two forms are idiomatically similar, but subtly different in the sense of
  what program invokes the other, and there could be unwanted side effects
  of the latter idiom dealing with forking, pipes, etc.
- Remove chmod and instead source coredump_phnum_restore_state.sh directly.
  This avoids the need to check the result of the chmod call.
- Fix indentation in an if-block (4 column space indentation -> hard tab).

6 years agoRemove expected failure for :coredump_phnum
Enji Cooper [Wed, 19 Jul 2017 16:08:08 +0000 (16:08 +0000)]
Remove expected failure for :coredump_phnum

The testcase no longer fails on ^/head because readelf has established parity
with binutils' copy of readelf.

This issue is not seen on Jenkins because
`test_suites.FreeBSD.allow_sysctl_side_effects` isn't set in kyua.conf on
the CI host, i.e., the test is skipped.

PR: 215019
Tested with: binutils (amd64-binutils-2.28,1); elftoolchain (r3561M)

6 years agoFix spurious timeouts on commands sent to mps(4) and mpr(4) controllers.
Kenneth D. Merry [Wed, 19 Jul 2017 15:39:01 +0000 (15:39 +0000)]
Fix spurious timeouts on commands sent to mps(4) and mpr(4) controllers.

mps_wait_command() and mpr_wait_command() were using getmicrotime() to
determine elapsed time when checking for a timeout in polled mode.
getmicrotime() isn't guaranteed to monotonically increase, and that
caused spurious timeouts occasionally.

Switch to using getmicrouptime(), which does increase monotonically.
This fixes the spurious timeouts in my test case.

Reviewed by: slm, scottl
MFC after: 3 days
Sponsored by: Spectra Logic

6 years agoRemove dead code that was killed by r320975
Alan Somers [Wed, 19 Jul 2017 15:22:10 +0000 (15:22 +0000)]
Remove dead code that was killed by r320975

Reported by: Coverity
CID: 1377977
MFC after: 15 days
X-MFC-With: 320975
Sponsored by: Spectra Logic Corp

6 years agoAvoid shadowed variables.
Michael Tuexen [Wed, 19 Jul 2017 15:12:23 +0000 (15:12 +0000)]
Avoid shadowed variables.

MFC after: 1 week

6 years agoUse memset/memcpy instead of bzero/bcopy.
Michael Tuexen [Wed, 19 Jul 2017 14:28:58 +0000 (14:28 +0000)]
Use memset/memcpy instead of bzero/bcopy.

Just use one variant instead of both. Use the memset/memcpy
ones since they cause less problems in crossplatform deployment.

MFC after: 1 week

6 years agoAdd HPE FlexFabric 10Gb 4-port 536FLR-T device id to the bxe(4) driver.
Andrey V. Elsukov [Wed, 19 Jul 2017 14:21:29 +0000 (14:21 +0000)]
Add HPE FlexFabric 10Gb 4-port 536FLR-T device id to the bxe(4) driver.

Tested by: David Miguel Almas <dmalmas gmail com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11478

6 years agoenable pidfile tests on arm64
Ed Maste [Wed, 19 Jul 2017 14:07:38 +0000 (14:07 +0000)]
enable pidfile tests on arm64

Pidfile tests were disabled on arm64 (in r286863) because they hung.
They have been fixed (r306098) and so can be enabled now.

PR: 202304
Sponsored by: The FreeBSD Foundation

6 years agoFix the accounting and add code to detect errors in accounting.
Michael Tuexen [Wed, 19 Jul 2017 12:27:40 +0000 (12:27 +0000)]
Fix the accounting and add code to detect errors in accounting.
Joint work with rrs@
MFC after: 1 week

6 years agoRename vfs.nfsd.enable_uidtostring to vfs.nfs.enable_uidtostring.
Edward Tomasz Napierala [Wed, 19 Jul 2017 09:59:32 +0000 (09:59 +0000)]
Rename vfs.nfsd.enable_uidtostring to vfs.nfs.enable_uidtostring.
It applies to both NFS client and NFS server, and is useful for both.
This is different from vfs.nfsd.enable_stringtouid, which is specific
to server side.

Reviewed by: rmacklem@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agocxgbe/t4_tom: Log more details about the newly ESTABLISHED tid to the
Navdeep Parhar [Wed, 19 Jul 2017 01:49:01 +0000 (01:49 +0000)]
cxgbe/t4_tom: Log more details about the newly ESTABLISHED tid to the
trace buffer.

MFC after: 3 days

6 years agobsdinstall: remove EOL whitespace
Ed Maste [Tue, 18 Jul 2017 23:35:19 +0000 (23:35 +0000)]
bsdinstall: remove EOL whitespace

6 years agoRemove special handling for 'disk*.h'
John Baldwin [Tue, 18 Jul 2017 21:09:29 +0000 (21:09 +0000)]
Remove special handling for 'disk*.h'

This was originally added so that only one of diskmbr.h or diskpc98.h
was chosen and is no longer needed after PC98's removal.  However, the
special handling was also broken as it effectively prevented the decoding
of ioctls declared in other headers such as <sys/disk.h> or
<sys/disklabel.h>.

6 years agoConvert assertion that only vmspace owner grows the stack, into a
Konstantin Belousov [Tue, 18 Jul 2017 20:26:41 +0000 (20:26 +0000)]
Convert assertion that only vmspace owner grows the stack, into a
check blocking grow from other processes accesses.

Debugger may access stack grow area with ptrace(2).  In this case,
real state of the process is to not have the stack grown, which
provides more accurate inspection.  Technical reason to avoid the grow
is to avoid applying wrong process (debugger) stack limit.

This change also has a consequence of making aio workers accesses past
the bottom of stacks into EFAULT, arguably the situation is a
programmers mistake.

Reported by: jhb
Discussed with: alc, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agoAllwinner EHCI: Do not fail if we cannot get a phy
Emmanuel Vadot [Tue, 18 Jul 2017 19:50:02 +0000 (19:50 +0000)]
Allwinner EHCI: Do not fail if we cannot get a phy

If we cannot get a phy, do not detach the driver, some boards have phy
always enabled and not exposed.
While here do not release the clocks if we fails as we release them
in a10_ehci_detach.

Tested-on: OrangePi-One

6 years agosh: Remove broken #ifdef NOHACK code (related to sh -c).
Jilles Tjoelker [Tue, 18 Jul 2017 19:00:15 +0000 (19:00 +0000)]
sh: Remove broken #ifdef NOHACK code (related to sh -c).

Apart from the fact that subtle syntactic changes make a poor compile-time
option, the NOHACK case has been obviously broken since it was added,
because it uses q uninitialized if (*p != '\0').

No functional change is intended.

6 years agoRemove unnecessary make logic added in r319339
Enji Cooper [Tue, 18 Jul 2017 17:29:12 +0000 (17:29 +0000)]
Remove unnecessary make logic added in r319339

This makes the change cleaner and easier to backport to ^/stable/10.

MFC after: now

6 years agoAdd support for passing FPU_KERN_NOCTX to fpu_kern_enter on arm64. This
Andrew Turner [Tue, 18 Jul 2017 16:36:32 +0000 (16:36 +0000)]
Add support for passing FPU_KERN_NOCTX to fpu_kern_enter on arm64. This
will be used to call into UEFI from the kernel.

Sponsored by: DARPA, AFRL

6 years agoipfw_netflow: Add support for FIB
Emmanuel Vadot [Tue, 18 Jul 2017 14:02:02 +0000 (14:02 +0000)]
ipfw_netflow: Add support for FIB

If ipfw_netflow_fib, the ipfw rule will only match packets in that FIB.

While here correct some value in rc.conf(5) to be int and not str.

Sponsored by: Gandi.net

6 years agofix a regression in r320452, ZFS ABD import
Andriy Gapon [Tue, 18 Jul 2017 07:41:38 +0000 (07:41 +0000)]
fix a regression in r320452, ZFS ABD import

I overlooked the fact that vdev_op_io_done hook is called even if the
actual I/O is skipped, for example, in the case of a missing vdev.
Arguably, this could be considered an issue in the zio pipeline engine,
but for now I am adding defensive code to check for io_bp being NULL
along with assertions that that happens only when it can be really
expected.

PR: 220691
Reported by: peter, cy
Tested by: cy
MFC after: 1 week
X-MFC with: r320156, r320452

6 years agoFix whitespace regression accidentally checked in via ^/head@r280149
Enji Cooper [Tue, 18 Jul 2017 06:51:27 +0000 (06:51 +0000)]
Fix whitespace regression accidentally checked in via ^/head@r280149

MFC after: now

6 years agoqlnx: gcc build errors
Ryan Libby [Tue, 18 Jul 2017 06:15:05 +0000 (06:15 +0000)]
qlnx: gcc build errors

Propagate warning flags from kern.opts.mk and then fix minor -Werror
issues when building with gcc from -Wredundant-decls, -Wnested-externs,
-Wuninitialized.

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

6 years agocxgbetool(8): Add loadboot and loadboot-cfg subcommands to install or
Navdeep Parhar [Tue, 18 Jul 2017 03:58:59 +0000 (03:58 +0000)]
cxgbetool(8): Add loadboot and loadboot-cfg subcommands to install or
remove bootrom and boot config.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoMake ZFS not crash on mount on 32-bit systems
Justin Hibbits [Tue, 18 Jul 2017 01:08:45 +0000 (01:08 +0000)]
Make ZFS not crash on mount on 32-bit systems

ZPL_VERSION is unsigned long long, not an int.  With this change, a zpool can be
created on a 32-bit system (tested on powerpcspe) and mounted correctly.

Reviewed by: allanjude

6 years agocxgbe(4): New ioctls to flash bootrom and boot config to the card.
Navdeep Parhar [Tue, 18 Jul 2017 00:50:58 +0000 (00:50 +0000)]
cxgbe(4): New ioctls to flash bootrom and boot config to the card.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoTidy up before making another round of functional changes: Remove end-
Alan Cox [Mon, 17 Jul 2017 23:16:33 +0000 (23:16 +0000)]
Tidy up before making another round of functional changes: Remove end-
of-line whitespace, remove excessive whitespace and blank lines, remove
dead code, follow our standard style for function definitions, and
correct grammatical and factual errors in some of the comments.

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

6 years ago[iwm] actually use the new rxon function now.
Adrian Chadd [Mon, 17 Jul 2017 21:32:35 +0000 (21:32 +0000)]
[iwm] actually use the new rxon function now.

It turns out the /next/ dragonflybsd git actually uses the scan channel list,
so just kick this along to make the next commit easier.

Obtained from: dragonflybsd.git 53a009d6f66108b40d622ed90ea95eba5c0e5432

6 years ago[iwm] if_iwm - Factor out and improve iwm_mvm_scan_rxon_flags() in if_iwm_scan.c.
Adrian Chadd [Mon, 17 Jul 2017 21:29:18 +0000 (21:29 +0000)]
[iwm] if_iwm - Factor out and improve iwm_mvm_scan_rxon_flags() in if_iwm_scan.c.

From the original commit:

==

* Actually look at the first channel in the list. If it's a 2.4GHz channel,
  set IWM_PHY_BAND_24 flag. The IWM_PHY_BAND_5 flag is 0 anyway, so we
  don't need to look further.

* While there factor out the iwm_mvm_rrm_scan_needed() tlv capability check.

Taken-From: Linux iwlwifi
==

However, this only really does the latter.  The sc_ic channel list isn't the
scan channel list, it's the /whole list/ for the set of active channels,
so I don't know what the right thing to do is here.

So I'll commit this as an intermediary commit and we'll have to revisit whether
to finish the refactor as-is.

Tested:

* Intel 7260, STA mode

Obtained from: dragonflybsd.git 53a009d6f66108b40d622ed90ea95eba5c0e5432

6 years agoAdd regression tests for bugs 220459 and 220398
Alan Somers [Mon, 17 Jul 2017 18:33:30 +0000 (18:33 +0000)]
Add regression tests for bugs 220459 and 220398

Bug 220398 - lio_listio(2) never sends asynchronous notification if nent==0
Bug 220459 - lio_listio(2) doesn't support SIGEV_THREAD

PR: 220459
PR: 220398
Reviewed by: cem, jhb
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11470

6 years agoSort the tests alphabetically before adding them to the Kyuafiles
Enji Cooper [Mon, 17 Jul 2017 18:20:54 +0000 (18:20 +0000)]
Sort the tests alphabetically before adding them to the Kyuafiles

This is being done to aid in debugging test runs, in the event the
output shifts due to refactored Makefiles, added tests, etc.

MFC after: 1 month

6 years agoExpose the ILP32/LP64 programming environments based on
Enji Cooper [Mon, 17 Jul 2017 18:12:08 +0000 (18:12 +0000)]
Expose the ILP32/LP64 programming environments based on
__ILP32__/__LP64__ instead of by architecture.

The list was incomplete (previous commits purged invalid architectures,
like __alpha__, but failed to add new ones). It's best to base the symbol
presence on whether or not the architecture is ILP32 / LP64 capable, per
the compiler.

This fixes the ILP32/LP64 program environments on some architectures like
arm64, and by proxy fixes the tests on those architectures.

MFC after: 1 month
Reviewed by: no one (timed out on feedback from imp)
Differential Revision: D10787

6 years agoAdd tests that exercise -q, like -rq and add tests that test -q like -Nrq
Enji Cooper [Mon, 17 Jul 2017 18:07:53 +0000 (18:07 +0000)]
Add tests that exercise -q, like -rq and add tests that test -q like -Nrq

MFC after: 2 months
MFC with: r321076, r321077, r321078

6 years agoFix exit status with -rq when there is a file in one directory but not another,
Enji Cooper [Mon, 17 Jul 2017 18:06:42 +0000 (18:06 +0000)]
Fix exit status with -rq when there is a file in one directory but not another,
i.e., when print_only is called.

Prior to this change, -rq was always returning 0. After this change it will
return 1 if there is a difference between two directories.

This fixes compatibility with GNU diff and unbreaks backwards compatibility
expectations.

Found when trying to extend diff_test:brief_format_test.

MFC after: 2 months
MFC with: r321076, r321077

6 years agoAdd some tests for brief (--brief/-q) format
Enji Cooper [Mon, 17 Jul 2017 17:50:50 +0000 (17:50 +0000)]
Add some tests for brief (--brief/-q) format

MFC after: 2 months
MFC with: r321076

6 years agoDon't emit "diff: diff <options> arguments" when diffing files if
Enji Cooper [Mon, 17 Jul 2017 17:36:04 +0000 (17:36 +0000)]
Don't emit "diff: diff <options> arguments" when diffing files if
-q is specified.

This improves compatibility with GNU diff.

Found by accident with `diff -Nrq /usr/tests /usr/tests.new | grep Kyuafile`.

MFC after: 2 months
Relnotes: yes

6 years agoSet the current vnet pointer in the socket buffer AIO handler.
John Baldwin [Mon, 17 Jul 2017 16:59:22 +0000 (16:59 +0000)]
Set the current vnet pointer in the socket buffer AIO handler.

This fixes panics when using AIO under VIMAGE.

Reported by: kp
MFC after: 3 days
Sponsored by: Chelsio Communications

6 years agoipfw_netflow: add +ipfw_netflow_enable="NO" to defaults/rc.conf and document
Emmanuel Vadot [Mon, 17 Jul 2017 08:53:51 +0000 (08:53 +0000)]
ipfw_netflow: add +ipfw_netflow_enable="NO" to defaults/rc.conf and document
usage in rc.conf(5)

Reported by: markj
Sponsored by: Gandi.net

6 years agocxgbe(4): Various link/media related improvements.
Navdeep Parhar [Mon, 17 Jul 2017 00:42:13 +0000 (00:42 +0000)]
cxgbe(4): Various link/media related improvements.

- Deal with changes to port_type, and not just port_mod when a
  transceiver is changed.  This fixes hot swapping of transceivers of
  different types (QSFP+ or QSA or QSFP28 in a QSFP28 port, SFP+ or
  SFP28 in a SFP28 port, etc.).

- Always refresh media information for ifconfig if the port is down.
  The firmware does not generate tranceiver-change interrupts unless at
  least one VI is enabled on the physical port.  Before this change
  ifconfig diplayed potentially stale information for ports that were
  administratively down.

- Always recalculate and reapply L1 config on a transceiver change.

- Display PAUSE settings in ifconfig.  The driver sysctls for this
  continue to work as well.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

6 years agoMinor optimization: instead of converting between days and years using loops
Ian Lepore [Sun, 16 Jul 2017 16:54:03 +0000 (16:54 +0000)]
Minor optimization: instead of converting between days and years using loops
that start in 1970, assume most conversions are going to be for recent dates
and use a precomputed number of days through the end of 2016.

This is a do-over of r320997, hopefully this time with 100% more workiness.

The first attempt had an off-by-one error, but instead of just adding
another mysterious +1 adjustment, this rearranges the relationship between
recent_base_year and recent_base_days so that the latter is the number of
days that occurred before the start of the associated year (instead of the
count thru the end of that year).  This makes the recent_base stuff work
more like the original loop logic that didn't need any +1 adjustments.

6 years agoreadelf: correct printing of DT_FILTER and DT_AUXILIARY values
Ed Maste [Sun, 16 Jul 2017 16:22:52 +0000 (16:22 +0000)]
readelf: correct printing of DT_FILTER and DT_AUXILIARY values

Previously these were shown only for MIPS objects.

Obtained from: ELF Tool Chain r3564
MFC after: 1 week
MFC with: r321045
Sponsored by: The FreeBSD Foundation

6 years agoreadelf: fix printing of DT_FILTER and some other DT_* values
Ed Maste [Sun, 16 Jul 2017 12:30:39 +0000 (12:30 +0000)]
readelf: fix printing of DT_FILTER and some other DT_* values

Some non-processor-specific DT_* values overlap the range DT_LOPROC to
DT_HIPROC.  Handle common ones first, then the processor-specific ones.

Obtained from: ELF Tool Chain r3563
Sponsored by: The FreeBSD Foundation

6 years agoRemove write-only variable.
Konstantin Belousov [Sun, 16 Jul 2017 07:12:04 +0000 (07:12 +0000)]
Remove write-only variable.

Tested by: pho
Sponsored by: The FreeBSD Foundation

6 years agoA followup to r320453, correct removal of the blocks from UFS snapshots.
Konstantin Belousov [Sun, 16 Jul 2017 07:11:29 +0000 (07:11 +0000)]
A followup to r320453, correct removal of the blocks from UFS snapshots.

Tested by: pho
PR:    220693
Sponsored by: The FreeBSD Foundation

6 years agoImport bmake-20170711
Simon J. Gerraty [Sat, 15 Jul 2017 21:19:27 +0000 (21:19 +0000)]
Import bmake-20170711

6 years agoRevert r320918 and have mkdumpheader() handle version string truncation.
Mark Johnston [Sat, 15 Jul 2017 20:53:08 +0000 (20:53 +0000)]
Revert r320918 and have mkdumpheader() handle version string truncation.

Reported by: jhb
MFC after: 1 week

6 years agoFix the handling of Explicit EOR mode.
Michael Tuexen [Sat, 15 Jul 2017 19:54:03 +0000 (19:54 +0000)]
Fix the handling of Explicit EOR mode.

While there, appropriately handle the overhead depending on
the usage of DATA or I-DATA chunks. Take the overhead only
into account, when required.

Joint work with rrs@
MFC after: 1 week

6 years agopfctl parser tests
Kristof Provost [Sat, 15 Jul 2017 19:22:01 +0000 (19:22 +0000)]
pfctl parser tests

Copy the most important test cases from OpenBSD's corresponding
src/regress/sbin/pfctl, those that run pfctl on a test input file and check
correctness of its output. We have also added some new tests using the same
format.

The tests consist of a collection of input files (pf*.in) and
corresponding output files (pf*.ok). We run pfctl -nv on the input
files and check that the output matches the output files. If any
discrepancy is discovered during future development in the source
tree, we know that a regression bug has been introduced into the tree.

Submitted by: paggas
Sponsored by: Google, Inc (GSoC 2017)
Differential Revision: https://reviews.freebsd.org/D11322

6 years agoImport bmake-20170711
Simon J. Gerraty [Sat, 15 Jul 2017 18:43:39 +0000 (18:43 +0000)]
Import bmake-20170711

Several misc cleanups, refactor main() to reduce size.
Adds -v option to always fully expand variables (only interesting to NetBSD)
And in particular (from ChangeLog):

  o meta.c: ensure command output in meta file has ending newline
    even when filemon not being used.
    When matching ${.MAKE.META.IGNORE_PATTERNS} do not use
    pathname via ':L' since any ':' in pathname breaks that.
    Instead set a '${.p.}' to pathname in the target context and
    use that.

6 years agoThe ctladm man page incorrectly duplicated the text for the
Benedict Reuschling [Sat, 15 Jul 2017 17:59:28 +0000 (17:59 +0000)]
The ctladm man page incorrectly duplicated the text for the
delete subcommand in the modify section. Rewrite the
modify description text in two places to say modify/modified
instead of remove/removed.

PR: 220710
Submitted by: sseekamp@risei.net
Reviewed by: mav@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11608