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

6 years agoStyle-only change: Consistently use the variable name "pdpg" throughout
Alan Cox [Sat, 15 Jul 2017 16:42:55 +0000 (16:42 +0000)]
Style-only change: Consistently use the variable name "pdpg" throughout
this file.  Previously, half of the pointers to a vm_page being used as
a page directory page were named "pdpg" and the rest were named "mpde".

Discussed with: kib
MFC after: 1 week

6 years agolibthr: check for possible overflow in the pthread_barrier_init() count.
Pedro F. Giffuni [Sat, 15 Jul 2017 15:00:13 +0000 (15:00 +0000)]
libthr: check for possible overflow in the pthread_barrier_init() count.

Following up on r320900, where the check for negative count values was
removed, add a check to prevent integer overflow. This is to account that
b_count, b_waiters but most importantly the total number of threads in
the system are signed values.

Discussed with: kib
MFC after: 2 weeks

6 years agoetc/rc.d: Only install ipfw_netflow is MK_IPFW and MK_NETGRAPH is defined
Emmanuel Vadot [Sat, 15 Jul 2017 09:04:23 +0000 (09:04 +0000)]
etc/rc.d: Only install ipfw_netflow is MK_IPFW and MK_NETGRAPH is defined

While here only install ipfw rc script if MK_IPFW is defined.

Reported by: ngie

6 years agoExtract the innermost loop of pmap_remove() out into its own function,
Alan Cox [Sat, 15 Jul 2017 01:49:54 +0000 (01:49 +0000)]
Extract the innermost loop of pmap_remove() out into its own function,
pmap_remove_ptes().  (This new function will also be used by an upcoming
change to pmap_enter() that adds support for psind == 1 mappings.)

Submitted by: Yufeng Zhou <yz70@rice.edu> (an earlier version)
Reviewed by: kib, markj
MFC after: 1 week

6 years agoRevert r320997. There are reports of it getting the wrong results, so
Ian Lepore [Sat, 15 Jul 2017 00:45:22 +0000 (00:45 +0000)]
Revert r320997.  There are reports of it getting the wrong results, so
clearly my testing was insuffficent, and it's best to just revert it
until I get it straightened out.

6 years agoFix the build with GCC after r320975
Alan Somers [Fri, 14 Jul 2017 21:50:04 +0000 (21:50 +0000)]
Fix the build with GCC after r320975

Reported by: pfg
MFC after: 20 days
X-MFC-With: 320975
Sponsored by: Spectra Logic Corp

6 years agoAdd 32-bit compat for kinfo_proc's ki_tdaddr.
Brooks Davis [Fri, 14 Jul 2017 21:13:05 +0000 (21:13 +0000)]
Add 32-bit compat for kinfo_proc's ki_tdaddr.

This appears to have been an oversight in r213536.

Reviewed by: markj
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11521

6 years agoMinor optimization: instead of converting between days and years using
Ian Lepore [Fri, 14 Jul 2017 18:36:15 +0000 (18:36 +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.

6 years agoAllow setting debug.clocktime as a tunable. Print 64-bit time_t correctly
Ian Lepore [Fri, 14 Jul 2017 18:13:54 +0000 (18:13 +0000)]
Allow setting debug.clocktime as a tunable.  Print 64-bit time_t correctly
on 32-bit systems.

6 years agoFollow up to r320992, properly escape the backslash so it renders properly.
Brad Davis [Fri, 14 Jul 2017 17:27:15 +0000 (17:27 +0000)]
Follow up to r320992, properly escape the backslash so it renders properly.

MFC after: 1 week
Forgotten by: brd
X-MFC-With: r320992

6 years agoAdd a complete example to tsearch(3)
Brad Davis [Fri, 14 Jul 2017 17:07:28 +0000 (17:07 +0000)]
Add a complete example to tsearch(3)

Reviewed by: wblock, sevan, bruffer
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11053

6 years agoAdd IBM TS1155 density codes to libmt and the mt(1) man page.
Kenneth D. Merry [Fri, 14 Jul 2017 16:45:46 +0000 (16:45 +0000)]
Add IBM TS1155 density codes to libmt and the mt(1) man page.

These are taken directly from the density report from a TS1155
tape drive.  (Using mt getdensity)

lib/libmt/mtlib.c:
Add 3592B5 encrypted/unencrypted density codes, and bpmm/bpi
values.  The bpmm/bpi values are the same as TS1150, but
there are 50% more tracks.

usr.bin/mt/mt.1:
Add 3592B5 encrypted/unencrypted density codes, bpmm/bpi
values and number of tracks.  Bump the man page date.

MFC after: 3 days
Sponsored by: Spectra Logic

6 years agolibthr: 'count' is unsigned so don't check for negative values.
Pedro F. Giffuni [Fri, 14 Jul 2017 16:05:54 +0000 (16:05 +0000)]
libthr: 'count' is unsigned so don't check for negative values.

Obtained from: DragonFlyBSD (git e7db8139)

6 years agoLanguage improvements.
Konstantin Belousov [Fri, 14 Jul 2017 15:42:12 +0000 (15:42 +0000)]
Language improvements.

Submitted by: wblock
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D10826

6 years agoUpdate pci_vendors to 2017.07.13
Baptiste Daroussin [Fri, 14 Jul 2017 14:58:10 +0000 (14:58 +0000)]
Update pci_vendors to 2017.07.13

MFC after: 2 days

6 years agoUpdate zstd to 1.3.0
Baptiste Daroussin [Fri, 14 Jul 2017 14:55:34 +0000 (14:55 +0000)]
Update zstd to 1.3.0

6 years agoUpdate arcmsr(4) to 1.40.00.00 in order to add support of
Xin LI [Fri, 14 Jul 2017 14:53:13 +0000 (14:53 +0000)]
Update arcmsr(4) to 1.40.00.00 in order to add support of
ARC-1884 SATA RAID controllers.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by: 黃清隆 <ching2048 areca com tw>
MFC after: 3 days

6 years agoThis adds CAM pass(4) support for NVMe IO's. Applications indicate
Warner Losh [Fri, 14 Jul 2017 14:52:20 +0000 (14:52 +0000)]
This adds CAM pass(4) support for NVMe IO's. Applications indicate
the IO type (Admin or NVM) using XPT op-codes XPT_NVME_ADMIN or
XPT_NVME_IO.

Submitted by:   Chuck Tuffli <chuck@tuffli.net>
Differential Revision:  https://reviews.freebsd.org/D10247

6 years agoImport zstd 1.3.0
Baptiste Daroussin [Fri, 14 Jul 2017 14:51:28 +0000 (14:51 +0000)]
Import zstd 1.3.0

6 years agoCorrect sysent flags for dynamically loaded syscalls.
Konstantin Belousov [Fri, 14 Jul 2017 09:34:44 +0000 (09:34 +0000)]
Correct sysent flags for dynamically loaded syscalls.

Using the https://github.com/google/capsicum-test/ suite, the
PosixMqueue.CapModeForked test was failing due to an ECAPMODE after
calling kmq_notify(). On further inspection, the dynamically
loaded syscall entry was initialized with sy_flags zeroed out, since
SYSCALL_INIT_HELPER() left sysent.sy_flags with the default value.

Add a new helper SYSCALL{,32}_INIT_HELPER_F() which takes an
additional argument to specify the sy_flags value.

Submitted by: Siva Mahadevan <smahadevan@freebsdfoundation.org>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D11576

6 years agoGeneralize vm_page_ps_is_valid() to support testing other predicates on
Alan Cox [Fri, 14 Jul 2017 02:15:48 +0000 (02:15 +0000)]
Generalize vm_page_ps_is_valid() to support testing other predicates on
the (super)page, renaming the function to vm_page_ps_test().

Reviewed by: kib, markj
MFC after: 1 week

6 years agoixl: gcc build errors
Ryan Libby [Fri, 14 Jul 2017 00:10:51 +0000 (00:10 +0000)]
ixl: gcc build errors

Fix minor -Werror issues when building with gcc from -Wredundant-decls,
-Wunused, -Wbool-operations.  Also ensure the M_IXL malloc type is only
defined once.

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

6 years agoAdd tests for aio(4) completion notification via signals and threads
Alan Somers [Thu, 13 Jul 2017 22:53:13 +0000 (22:53 +0000)]
Add tests for aio(4) completion notification via signals and threads

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

6 years agoUse ATF cleanup routines in aio_test.c
Alan Somers [Thu, 13 Jul 2017 22:49:55 +0000 (22:49 +0000)]
Use ATF cleanup routines in aio_test.c

Remove aio_test's legacy timeout handling and cleanup routines.  Instead,
use ATF's builtin capabilities.  ATF automatically cleans up newly created
files, too, so we don't have to explicitly unlink them.  The only tests than
need a cleanup routine are the md(4) tests, which must destroy their md
device.

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

6 years agoFix kldload of if_ixl without PCI_IOV kernel option.
Bryan Drewery [Thu, 13 Jul 2017 22:45:23 +0000 (22:45 +0000)]
Fix kldload of if_ixl without PCI_IOV kernel option.

This also avoids compiling in pci_iov support into the kernel if_ixoif
the PCI_IOV option is disabled.

Reviewed by: rstone
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11573

6 years agoixl(4)/ixlv(4): Stop leaking every busdma entry in receive path
Eric Joyner [Thu, 13 Jul 2017 22:12:41 +0000 (22:12 +0000)]
ixl(4)/ixlv(4): Stop leaking every busdma entry in receive path

From Brett:

In short, busdma maps for received packets were not being unloaded in the
interrupt handler before the packets were passed up the network stack. The fix
was to add a busdma sync and unload for the two receive maps.

This bug is significant for certain busdma providers, for example IOMMUs,
where not unloading the maps means that 1) the IOMMU mappings that allow the
NIC to DMA the received packets into host memory stay open indefinitely,
potentially violating a desired security policy, and 2) resources such as
device address space addresses and host memory for bookkeeping are never freed.

Without an IOMMU or bounce buffering enabled for the ixl device, I don't think
adding these calls will have any significant performance impact. With the
IOMMU enabled, I have noticed a performance impact on the receive side, which
is expected.

Submitted by: Brett Gutstein <bgutstein@rice.edu>
Reviewed by: erj@
MFC after: 1 week

6 years agoFix a missing comment marker.
Glen Barber [Thu, 13 Jul 2017 20:04:42 +0000 (20:04 +0000)]
Fix a missing comment marker.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoAdd some functions to jiffies.h.
Mark Johnston [Thu, 13 Jul 2017 18:27:22 +0000 (18:27 +0000)]
Add some functions to jiffies.h.

Also add some checks for overflow to existing functions.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11533

6 years agoAdd 4k and NCQ_TRIM_BROKEN quirks for Samsung 845 SSDs.
Sean Bruno [Thu, 13 Jul 2017 16:56:26 +0000 (16:56 +0000)]
Add 4k and NCQ_TRIM_BROKEN quirks for Samsung 845 SSDs.

Submitted by:  hannula@gmail.com
Differential Revision: https://reviews.freebsd.org/D7967

6 years agoAdd 4K quirks for Samsung 750 EVO SSD
Sean Bruno [Thu, 13 Jul 2017 15:33:08 +0000 (15:33 +0000)]
Add 4K quirks for Samsung 750 EVO SSD

Submitted by: lev
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D9478