]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoifconfig displays ND6_IFF_NO_DAD as "IGNORELOOP"
asomers [Wed, 3 May 2017 01:46:39 +0000 (01:46 +0000)]
ifconfig displays ND6_IFF_NO_DAD as "IGNORELOOP"

PR: 218958
Reviewed by: kristof
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D10543

7 years agoAdd regression tests for r317712 and r306743.
markj [Tue, 2 May 2017 23:31:39 +0000 (23:31 +0000)]
Add regression tests for r317712 and r306743.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoSynchronize unclean mirrors before adding them to a running gmirror.
markj [Tue, 2 May 2017 23:29:42 +0000 (23:29 +0000)]
Synchronize unclean mirrors before adding them to a running gmirror.

During gmirror startup, if component mirrors are found to be dirty as is
typical after a system crash, the mirrors are synchronized to the mirror
with highest priority. However if a gmirror starts without all of its
mirrors present, for example because of some transient delays during
tasting, the remaining mirrors must be synchronized before they may become
active.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoRemove expected failure now that it was fixed in r317660.
brooks [Tue, 2 May 2017 22:14:55 +0000 (22:14 +0000)]
Remove expected failure now that it was fixed in r317660.

PR: 211804
Reviewed by: ngie
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10576

7 years agocsplit: Fix check of fputs() return value, making csplit work again.
jilles [Tue, 2 May 2017 21:56:20 +0000 (21:56 +0000)]
csplit: Fix check of fputs() return value, making csplit work again.

As of r295638, fputs() returns the number of bytes written (if not more than
INT_MAX). This broke csplit completely, since csplit assumed only success
only for the return value 0.

PR: 213510
Submitted by: J.R. Oldroyd
MFC after: 1 week
Relnotes: yes

7 years agoAdd powerpcspe to arch(7)
jhibbits [Tue, 2 May 2017 21:33:27 +0000 (21:33 +0000)]
Add powerpcspe to arch(7)

Reviewed by: emaste

7 years agoCorrect an out-of-bounds read in regcomp when the RE is bad.
brooks [Tue, 2 May 2017 21:20:27 +0000 (21:20 +0000)]
Correct an out-of-bounds read in regcomp when the RE is bad.

When passed the invalid regular expression "a**", the error is
eventually detected and seterr() is called. It sets p->error
appropriatly and p->next and p->end to nuls which is a never used char
nuls[10] which is zeros due to .bss initialization. Unfortunatly,
p_ere_exp() and p_simp_re() both have fall through cases where they set
the error, decrement p->next and access it which means a read from what
ever .bss variable comes before nuls.

Found with regex_test:repet_multi and CHERI bounds checking.

Reviewed by: ngie, pfg, emaste
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D10541

7 years agoUse MAN=<empty> rather than MK_MAN=no to not install a manpage.
brooks [Tue, 2 May 2017 21:09:07 +0000 (21:09 +0000)]
Use MAN=<empty> rather than MK_MAN=no to not install a manpage.

MFC after: 1 week

7 years agobsdgrep: avoid use of magic number for REG_NOSPEC
emaste [Tue, 2 May 2017 21:08:38 +0000 (21:08 +0000)]
bsdgrep: avoid use of magic number for REG_NOSPEC

Submitted by: Kyle Evans <kevans91 at ksu.edu>
Differential Revision: https://reviews.freebsd.org/D10420

7 years agobsdgrep: fix escape map building for multibyte strings
emaste [Tue, 2 May 2017 20:44:06 +0000 (20:44 +0000)]
bsdgrep: fix escape map building for multibyte strings

In BSD grep, fix escape map building in the regex parser. It was
previously using memory not explicitly initialized, and the MBS escape
map was being built based on a version of the pattern with escapes
already parsed out.

This is Kyle's change, but I restored the broken style that already
exists in this file.

Submitted by: Kyle Evans <kevans91 at ksu.edu>
Reviewed by: cem, Kyle Evans (my style changes)
Differential Revision: https://reviews.freebsd.org/D10098

7 years agobsdgrep: fix -w flag matching with an empty pattern
emaste [Tue, 2 May 2017 20:39:33 +0000 (20:39 +0000)]
bsdgrep: fix -w flag matching with an empty pattern

-w flag matching with an empty pattern was generally 'broken', allowing
matches to occur on any line whether or not it actually matches -w
criteria.

This fix required a good amount of refactoring to address.  procline()
is altered to *only* process the line and return whether it was a match
or not, necessary to be able to short-circuit the whole function in case
of this matchall flag. -m flag handling is moved out as well because it
suffers from the same fate as context handling if we bypass any actual
pattern matching.

The matching context (matches, mostly) didn't previously exist outside
of procline(), so we go ahead and create context object for file
processing bits to pass around.  grep_printline() was created due to
this, for the scenarios where the matches don't actually matter and we
just want to print a line or two, a la flushing the context queue and
no -o or --color specified.

Damage from this broken behavior would have been mitigated by the fact
that it is unlikely users would invoke grep -w with an empty pattern.

This was identified while checking PR 105221 for problems it this may
cause in BSD grep, but PR 105221 is *not* a report of this behavior.

Submitted by: Kyle Evans <kevans91 at ksu.edu>
Differential Revision: https://reviews.freebsd.org/D10433

7 years agocxgbe(4): Support routines for Tx traffic scheduling.
np [Tue, 2 May 2017 20:38:10 +0000 (20:38 +0000)]
cxgbe(4): Support routines for Tx traffic scheduling.

- Create a new file, t4_sched.c, and move all of the code related to
  traffic management from t4_main.c and t4_sge.c to this file.
- Track both Channel Rate Limiter (ch_rl) and Class Rate Limiter (cl_rl)
  parameters in the PF driver.
- Initialize all the cl_rl limiters with somewhat arbitrary default
  rates and provide routines to update them on the fly.
- Provide routines to reserve and release traffic classes.

MFC after: 1 month
Sponsored by: Chelsio Communications

7 years agobsdgrep: correct test sense from r317700
emaste [Tue, 2 May 2017 20:08:04 +0000 (20:08 +0000)]
bsdgrep: correct test sense from r317700

Kyle's change in review D10098 was correct. I introduced the error when
extracting a portion of that change.

7 years agobsdgrep: use calloc where appropriate in grep's tre-fastmatch
emaste [Tue, 2 May 2017 19:56:42 +0000 (19:56 +0000)]
bsdgrep: use calloc where appropriate in grep's tre-fastmatch

Also apply style(9) to a related NULL check.

Submitted by: Kyle Evans <kevans91 at ksu.edu> (D10098)

7 years agoIntroduce sleepable locks into if_lagg.
mav [Tue, 2 May 2017 19:09:11 +0000 (19:09 +0000)]
Introduce sleepable locks into if_lagg.

Before this change if_lagg was using nonsleepable rmlocks to protect its
internal state.  This patch introduces another sx lock to protect code
paths that require sleeping, while still uses old rmlock to protect hot
nonsleepable data paths.

This change allows to remove taskqueue decoupling used before to change
interface addresses without holding the lock.  Instead it uses sx lock to
protect direct if_ioctl() calls.

As another bonus, the new code synchronizes enabled capabilities of member
interfaces, and allows to control them with ifconfig laggX, that was
impossible before.  This part should fix interoperation with if_bridge,
that may need to disable some capabilities, such as TXCSUM or LRO, to allow
bridging with noncapable interfaces.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D10514

7 years agoEmulate pre-r317061 ABI.
kib [Tue, 2 May 2017 18:40:41 +0000 (18:40 +0000)]
Emulate pre-r317061 ABI.

This restores 32bit-sized accesses to vmcnt sysctls, making old
binaries like top(1), systat(8) and reboot(8) mostly functional on
newer kernel.

Reviewed by: bde
Sponsored by: The FreeBSD Foundation

7 years agobsdgrep: revise test case which will soon become a failure
emaste [Tue, 2 May 2017 18:37:11 +0000 (18:37 +0000)]
bsdgrep: revise test case which will soon become a failure

Work in progress (D10315) is going to make egrep_empty_invalid an
actually invalid regex, to be consistent with the equivalent BRE "{"
behavior, when using regex(3).

Any non-0 exit value is acceptable, depending on how the installed grep
interprets the expression. GNU grep interprets it as non-matching, and
in the future BSD grep will interpret it is an error.

Submitted by: Kyle Evans <kevans91 at ksu.edu>
Reviewed by: cem, ngie
Differential Revision: https://reviews.freebsd.org/D10572`

7 years agoAdd `ipfw table all destroy` support.
ae [Tue, 2 May 2017 17:16:24 +0000 (17:16 +0000)]
Add `ipfw table all destroy` support.

PR: 212669
MFC after: 1 week

7 years agoDocument time_t size.
kib [Tue, 2 May 2017 14:52:35 +0000 (14:52 +0000)]
Document time_t size.

Reviewed by: emaste, imp, vangyzen
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D10568

7 years agoAdd the SCSI SSC Manufacturer assigned serial number VPD page.
ken [Tue, 2 May 2017 14:52:28 +0000 (14:52 +0000)]
Add the SCSI SSC Manufacturer assigned serial number VPD page.

This is current as of SSC-5r03.

Submitted by: Sam Klopsch
MFC after: 3 days

7 years agobsdgrep: correct nls usage data after r317049
emaste [Tue, 2 May 2017 13:47:15 +0000 (13:47 +0000)]
bsdgrep: correct nls usage data after r317049

r317049 added -z/--null-data to BSD grep but missed the update to nls
catalogs.

Submitted by: Kyle Evans <kevans91 at ksu.edu>
Differential Revision: https://reviews.freebsd.org/D10456

7 years agobsdgrep: Add GNU compatible version string indicator
emaste [Tue, 2 May 2017 13:38:20 +0000 (13:38 +0000)]
bsdgrep: Add GNU compatible version string indicator

As reported in r218614 it's useful to have an indication of whether or not
BSD grep was built with GNU_GREP_COMPAT.

Submitted by: Kyle Evans <kevans91 at ksu.edu>
Reported by: mandree
Differential Revision: https://reviews.freebsd.org/D10451

7 years agoIn parse_range() validate both range values instead of checking
ae [Tue, 2 May 2017 05:20:54 +0000 (05:20 +0000)]
In parse_range() validate both range values instead of checking
the top  value twice.

PR: 202295
MFC after: 1 week

7 years agoAdd sets support for ipfw table info/list/flush commands.
ae [Tue, 2 May 2017 05:02:12 +0000 (05:02 +0000)]
Add sets support for ipfw table info/list/flush commands.

PR: 212668
MFC after: 1 week

7 years agobsdgrep: fix -w -v matching improperly with certain patterns
emaste [Tue, 2 May 2017 02:32:10 +0000 (02:32 +0000)]
bsdgrep: fix -w -v matching improperly with certain patterns

-w and -v flag matching was mostly functional but had some minor
problems:

1. -w flag processing only allowed one iteration through pattern
   matching on a line. This was problematic if one pattern could match
   more than once, or if there were multiple patterns and the earliest/
   longest match was not the most ideal, and

2. Previous work "fixed" things to not further process a line if the
   first iteration through patterns produced no matches. This is clearly
   wrong if we're dealing with the more restrictive -w matching.

#2 breakage could have also occurred before recent broad rewrites, but
it would be more arbitrary based on input patterns as to whether or not
it actually affected things.

Fix both of these by forcing a retry of the patterns after advancing
just past the start of the first match if we're doing more restrictive
-w matching and we didn't get any hits to start with. Also move -v flag
processing outside of the loop so that we have a greater change to match
in the more restrictive cases. This wasn't strictly wrong, but it could
be a little more error prone.

While here, introduce some regressions tests for this behavior and fix
some excessive wrapping nearby that hindered readability. GNU grep
passes these new tests.

PR: 218467, 218811
Submitted by: Kyle Evans <kevans91 at ksu.edu>
Reviewed by: cem, ngie
Differential Revision: https://reviews.freebsd.org/D10329

7 years agoProperly initialize ipfw_range_tlv variable to fix possible EINVAL
ae [Tue, 2 May 2017 01:03:59 +0000 (01:03 +0000)]
Properly initialize ipfw_range_tlv variable to fix possible EINVAL
in case when ipfw delete/zero/resetlog command issued for several rules
in the loop. Also reorder some variables by size.

PR: 218993
MFC after: 1 week

7 years agoSupport clnt_raw's use of FD_SETSIZE as a fake file descriptor.
brooks [Mon, 1 May 2017 20:04:07 +0000 (20:04 +0000)]
Support clnt_raw's use of FD_SETSIZE as a fake file descriptor.

Accomplish this by allocating space for it in __svc_xports and allowing
it to be registered.  The failure to allocate space was causing an
out-of-bounds read in svc_getreq_common().  The failure to register
caused PR 211804.

The bug was found with CHERI bounds checking.

PR: 211804
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Reviewed by: ngie
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10528

7 years agoMake some UART consoles to not spin wait for data to be sent.
mav [Mon, 1 May 2017 19:47:10 +0000 (19:47 +0000)]
Make some UART consoles to not spin wait for data to be sent.

At least with Tx FIFO enabled it shows me ~10% reduction of verbose boot
time with serial console at 115200 baud.

Reviewed by: marcel
MFC after: 2 weeks

7 years agoRedo r288270: Hookup mkcsmapper_static and mkesdb_static for 'make clean'
bdrewery [Mon, 1 May 2017 19:34:15 +0000 (19:34 +0000)]
Redo r288270: Hookup mkcsmapper_static and mkesdb_static for 'make clean'

These are only built as part of the top-level 'build-tools' call for
'make buildworld'.  They still need to be cleaned during the 'make clean'
treewalks though.

Reported by: markj
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoFix camcontrol timestamp setting and update the man page.
ken [Mon, 1 May 2017 18:53:47 +0000 (18:53 +0000)]
Fix camcontrol timestamp setting and update the man page.

camcontrol timestamp -s would somtimes fail due to stack garbage.  Zero out
the timestamp parameters to fix it.

Fix another nearby bug, and update the man page.

sbin/camcontrol/timestamp.c:
In set_timestamp(), bzero ts_p prior to creating the timestamp.
Previously stack garbage could cause some tape drives to reject the
timestamp.

In set_timestamp(), check for failures from strptime().

sbin/camcontrol/camcontrol.8:
Add the time argument to the -T option to camcontrol timestamp -s
in the long description.

Change the time/date format used in the camcontrol timestamp
example to RFC 2822 format.  This fixes a time zone issue with the
original example by specifying the time zone as -0600.  Otherwise,
the time zone seems to default to standard time in the current
locale, which makes the time, when reported back from the drive,
1 hour off from the intended setting.  This also fixes a duplicate
day of the week ("Wednesday Wed") in the previous example.

Submitted by: Sam Klopsch
MFC after: 3 days
Sponsored by: Spectra Logic

7 years agoFix a harmless LOR in dtrace_load().
markj [Mon, 1 May 2017 17:01:00 +0000 (17:01 +0000)]
Fix a harmless LOR in dtrace_load().

MFC after: 1 week

7 years agoloader.efi: ResetSystem does not use data with EFI_SUCCESS
tsoome [Mon, 1 May 2017 16:56:34 +0000 (16:56 +0000)]
loader.efi: ResetSystem does not use data with EFI_SUCCESS

The current reboot command in efi/loader/main.c is passing extra data with
ResetSystem, however, UEFI spec 2.6, page 265 does state:

"ResetData is only valid if ResetStatus is something other than EFI_SUCCESS
unless the ResetType is EfiResetPlatformSpecific where a minimum amount of
ResetData is always required."

Therefore we should use DataSize 0 and ResetData NULL - those are two last
arguments for the call.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D10562

7 years agoAdd on_each_cpu() and wbinvd_on_all_cpus().
markj [Mon, 1 May 2017 16:32:28 +0000 (16:32 +0000)]
Add on_each_cpu() and wbinvd_on_all_cpus().

Reviewed by: hselasky
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10550

7 years agoFix misport of compressed ZFS send/recv from 317414
jpaetzel [Mon, 1 May 2017 12:56:12 +0000 (12:56 +0000)]
Fix misport of compressed ZFS send/recv from 317414

Reported by: Michael Jung <mikej@mikej.com>
Reviewed by: avg

7 years agoFix NULL pointer dereference in futex_wake_op() in case when the same
dchagin [Mon, 1 May 2017 12:25:37 +0000 (12:25 +0000)]
Fix NULL pointer dereference in futex_wake_op() in case when the same
address specified for arguments uaddr and uaddr2.

PR: 218987
Reported by: luke.tw gmail
MFC after: 1 week

7 years agoFix "make cscope-clean" when .OBJDIR already exists
ngie [Mon, 1 May 2017 05:59:52 +0000 (05:59 +0000)]
Fix "make cscope-clean" when .OBJDIR already exists

The cscope generated files are always put in .CURDIR .

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoFix "make cscope" after r317411
ngie [Mon, 1 May 2017 05:54:33 +0000 (05:54 +0000)]
Fix "make cscope" after r317411

Sponsored by: Dell EMC Isilon

7 years agorevert r308465: c++filt: flush output after newline
emaste [Mon, 1 May 2017 01:56:11 +0000 (01:56 +0000)]
revert r308465: c++filt: flush output after newline

The ELF Tool Chain update to r3520 uses setvbuf to set line buffering.

Sponsored by: The FreeBSD Foundation

7 years agoFix a comment that's been wrong ever since this file was imported in 1997
asomers [Mon, 1 May 2017 01:42:26 +0000 (01:42 +0000)]
Fix a comment that's been wrong ever since this file was imported in 1997

7 years agomakefs: remove unused cd9660_defaults_set global
emaste [Mon, 1 May 2017 00:53:07 +0000 (00:53 +0000)]
makefs: remove unused cd9660_defaults_set global

Sponsored by: The FreeBSD Foundation

7 years agoMake semaphore names list mutex non-recursive.
kib [Sun, 30 Apr 2017 19:37:45 +0000 (19:37 +0000)]
Make semaphore names list mutex non-recursive.

The mutex is used in sem_open() and sem_close(), which cannot
recurse. The atfork handlers cannot collide with the open and close
code.

Reviewed by: vangyzen
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D10545

7 years agoRestructure normal (non-error) control flow in sem_close().
kib [Sun, 30 Apr 2017 19:32:51 +0000 (19:32 +0000)]
Restructure normal (non-error) control flow in sem_close().

Do not retest for the found semaphore after the loop to look it up.
Instead, handle both cases of last and non-last close simultaneously,
which allows to consolidate the list unlock and successful return.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agorevert r313473 (Disable LLD_IS_LD option combinations that fail)
emaste [Sun, 30 Apr 2017 16:12:23 +0000 (16:12 +0000)]
revert r313473 (Disable LLD_IS_LD option combinations that fail)

r316647 corrected the build of tblgen and libllvm as dependencies for
LLD so undo the temporary seat-belt.

We still want to extend the build infrastructure to automatically detect
the case where the host LLD can be used instead of building a bootstrap
LLD, and likely extend libllvmminimal to meet LLD's needs for cases
where the build includes LLD but not Clang.

Sponsored by: The FreeBSD Foundation

7 years agoStyle.
kib [Sun, 30 Apr 2017 10:47:59 +0000 (10:47 +0000)]
Style.
- Use ANSI C function definitions.
- Remove redundand cast.
- Minor style compliance tweaks.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoWhen the switch is set to operate in the Multi Chip Addressing Mode we
loos [Sun, 30 Apr 2017 07:51:31 +0000 (07:51 +0000)]
When the switch is set to operate in the Multi Chip Addressing Mode we
cannot access the GLOBAL2 register directly.

Despite the comment in code (which was misleading), the indirect access is
only used to read the switch CONFIG data from the scrap register and not
for the GLOBAL2 access.

Use the dsa data to define when the switch is in the Multi Chip Addressing
Mode (a even address different than zero).

While here fix a typo.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoSet the correct default for #address-cells variable when the property does
loos [Sun, 30 Apr 2017 07:31:48 +0000 (07:31 +0000)]
Set the correct default for #address-cells variable when the property does
not exist.

This has never caused any issue because #address-cells is mandatory.

Sponsored by: Rubicon Communications, LLC (Netgate)
MFC after: 2 weeks

7 years agoFix symlinkat() which use the newdfd argument to look up the old path,
dchagin [Sun, 30 Apr 2017 05:56:57 +0000 (05:56 +0000)]
Fix symlinkat() which use the newdfd argument to look up the old path,
while it should use it for the new path instead.

Reported by: trasz@
MFC after: 1 month

7 years agoAdd AMD IOMMU/AMD-Vi support in bhyve for passthrough/direct assignment to VMs. To...
anish [Sun, 30 Apr 2017 02:08:46 +0000 (02:08 +0000)]
Add AMD IOMMU/AMD-Vi support in bhyve for passthrough/direct assignment to VMs. To enable AMD-Vi, set hw.vmm.amdvi.enable=1.

Reviewed by:bcr
Approved by:grehan
Tested by:rgrimes
Differential Revision:https://reviews.freebsd.org/D10049

7 years agoprintf: Output formatted data directly, instead of via asprintf.
jilles [Sat, 29 Apr 2017 21:48:11 +0000 (21:48 +0000)]
printf: Output formatted data directly, instead of via asprintf.

Long ago, sh used to have its own optimized and restricted string formatting
implementation, which the printf builtin had to bypass via asprintf() to a
temporary buffer. Since sh has used libc's string formatting implementation
for a long time, remove the workaround.

Add a check to keep  printf %c ''  working the same way (output nothing);
POSIX allows both outputting nothing and outputting a NUL byte.

Also, this change avoids silently discarding format directives for whose
output asprintf() cannot allocate memory.

7 years agoAllow SCTP to use the hostcache.
tuexen [Sat, 29 Apr 2017 19:20:50 +0000 (19:20 +0000)]
Allow SCTP to use the hostcache.

This patch allows the MTU stored in the hostcache to be used as an
initial value for SCTP paths. When an ICMP PTB message is received,
store the MTU in the hostcache.

MFC after: 1 week

7 years agomixer(8): Prevent possible sscanf() overflow.
pfg [Sat, 29 Apr 2017 19:12:44 +0000 (19:12 +0000)]
mixer(8): Prevent possible sscanf() overflow.

Fix %s buffer sizes in sscanf().

Obtained from: DragonflyBSD (git dab952e2)
MFC after: 5 days

7 years ago<stdio.h>: ftello() and fseeko() were in SUSv2, so extend visibility.
pfg [Sat, 29 Apr 2017 18:48:05 +0000 (18:48 +0000)]
<stdio.h>: ftello() and fseeko() were in SUSv2, so extend visibility.

See:

http://pubs.opengroup.org/onlinepubs/007908799/xsh/fseek.html
http://pubs.opengroup.org/onlinepubs/007908799/xsh/ftell.html

Hinted from: DragonFlyBSD (git 58696e28)

7 years agousb(4): manpage cleanup
ngie [Sat, 29 Apr 2017 16:44:36 +0000 (16:44 +0000)]
usb(4): manpage cleanup

1. Wrap at <80 columns for readability when editing. Rewrap some lines
   prematurely wrapped to better fit in <80 columns and not waste
   vertical space.
2. Fix SEE ALSO sorting (sort by section first, then manpage name).
3. Tweak the compound device description slightly by adding soft stops
   via commas.

MFC after: 1 week
Reported by: igor [3], manlint [2]
Sponsored by Dell EMC Isilon

7 years agoDocument in ifconfig(8) that gre(4) accepts tunnel commands
feld [Sat, 29 Apr 2017 15:35:30 +0000 (15:35 +0000)]
Document in ifconfig(8) that gre(4) accepts tunnel commands

- Also ensure wording is consistent for gif and gre

Reviewed by: wblock
Differential Revision: https://reviews.freebsd.org/D5667

7 years agoDon't set the DF-bit on timer based retransmissions.
tuexen [Sat, 29 Apr 2017 09:57:27 +0000 (09:57 +0000)]
Don't set the DF-bit on timer based retransmissions.

MFC after: 1 week

7 years agoAdd TUNABLE_INT to radeonkms driver parameters.
nyan [Sat, 29 Apr 2017 09:47:15 +0000 (09:47 +0000)]
Add TUNABLE_INT to radeonkms driver parameters.
They are required by PowerMac G5 DP.

PR: 217852
Submitted by: Hiroo Ono
MFC after: 1 week

7 years agoMake if_bridge complain if it can't disable some capabilities.
mav [Sat, 29 Apr 2017 08:52:07 +0000 (08:52 +0000)]
Make if_bridge complain if it can't disable some capabilities.

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

7 years agoPropagate IFCAP_LRO from trunk to vlan interface.
mav [Sat, 29 Apr 2017 08:28:59 +0000 (08:28 +0000)]
Propagate IFCAP_LRO from trunk to vlan interface.

False positive here cost nothing, while false negative may lead to some
confusions.

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

7 years agoCorrect manual page link to usbdi(9).
hselasky [Sat, 29 Apr 2017 07:59:09 +0000 (07:59 +0000)]
Correct manual page link to usbdi(9).

MFC after: 1 week

7 years agoFix some cases where an index was used before its limits check.
pfg [Sat, 29 Apr 2017 06:41:51 +0000 (06:41 +0000)]
Fix some cases where an index was used before its limits check.

Obtained from: DragonFlyBSD (git 799ba435)
MFC after: 5 days

7 years agoFix a bug introduced as part of r287726; use the right device_t for
marius [Sat, 29 Apr 2017 00:53:17 +0000 (00:53 +0000)]
Fix a bug introduced as part of r287726; use the right device_t for
determining the softc of the bridge in psycho_route_interrupt(). [1]
While at it, update the corresponding comment that the code in
question is also necessary for U30s in addition to E450s (a fact
that has been known for ages).

PR: 218478
Submitted by: Yoshihiko Iwama

7 years agoModify the NFSv4.1/pNFS client to ask for a maximum length of layout.
rmacklem [Sat, 29 Apr 2017 00:34:53 +0000 (00:34 +0000)]
Modify the NFSv4.1/pNFS client to ask for a maximum length of layout.

The code specified the length of a layout as INT64_MAX instead of
UINT64_MAX. This could result in getting a layout for less than the
full file for extremely large files. Although having little practical
effect, this patch corrects this in the code.
Detected during recent testing of the pNFS server.

MFC after: 2 weeks

7 years agoGet rid of some ifdef soup in the fasttrap ioctl handler.
markj [Fri, 28 Apr 2017 22:25:22 +0000 (22:25 +0000)]
Get rid of some ifdef soup in the fasttrap ioctl handler.

No functional change intended.

MFC after: 1 week

7 years agoeditline.3: Add missing argument to H_SET description
cem [Fri, 28 Apr 2017 21:05:28 +0000 (21:05 +0000)]
editline.3: Add missing argument to H_SET description

The H_SET operation of the history() function takes an int argument which is
the position of the item to which the cursor should be moved to.

Submitted by: Abhinav Upadhyay <abhinav@NetBSD.org>

7 years agoImprove sysadmin visibility of physical port error counters in the
hselasky [Fri, 28 Apr 2017 19:38:57 +0000 (19:38 +0000)]
Improve sysadmin visibility of physical port error counters in the
mlx5en driver.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agox86 MCA: Fix a deadlock in MCA exception processing
cem [Fri, 28 Apr 2017 18:25:10 +0000 (18:25 +0000)]
x86 MCA: Fix a deadlock in MCA exception processing

In exceptional circumstances, an MCA exception will trigger when the
freelist is exhausted. In such a case, no error will be logged on the list
and 'mca_count' will not be incremented.

Prior to this patch, all CPUs that received the exception would spin
forever.

With this change, the CPU that detects the error but finds the freelist
empty will proceed to panic the machine, ending the deadlock.

A follow-up to r260457.

Reported by: Ryan Libby <rlibby at gmail.com>
Reviewed by: jhb@
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D10536

7 years agoDon't pass size_t arguments to setsockopt(SO_SNDBUF/SO_RCVBUF).
brooks [Fri, 28 Apr 2017 17:58:15 +0000 (17:58 +0000)]
Don't pass size_t arguments to setsockopt(SO_SNDBUF/SO_RCVBUF).

These command take an int. The tests work by accident on little-endian,
64-bit systems.

PR: 218919
Tested with: qemu-cheri and CheriBSD built for mips64
Reviewed by: asomers, ngie
Obtained from: CheriBSD
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10518

7 years agoSimplify the code a bit. No functional change.
jkim [Fri, 28 Apr 2017 16:42:52 +0000 (16:42 +0000)]
Simplify the code a bit.  No functional change.

7 years agoFix end coordinate of the drawable area of border. Although the name tr_end
jkim [Fri, 28 Apr 2017 16:39:09 +0000 (16:39 +0000)]
Fix end coordinate of the drawable area of border.  Although the name tr_end
suggests it is the end coordinate, tr_end.tp_row is width and tr_end.tp_col
is height of the drawable area in reality.

PR: 202288

7 years agosh: Simplify handling of newlines in command substitution.
jilles [Fri, 28 Apr 2017 16:16:22 +0000 (16:16 +0000)]
sh: Simplify handling of newlines in command substitution.

Unless we need to split on newlines, just append them as normal and remove
them at the end.

7 years agoSet the DF bit for responses to out-of-the-blue packets.
tuexen [Fri, 28 Apr 2017 15:38:34 +0000 (15:38 +0000)]
Set the DF bit for responses to out-of-the-blue packets.

MFC after: 1 week

7 years agoAllow some control over enabled capabilities for if_vlan.
mav [Fri, 28 Apr 2017 11:00:58 +0000 (11:00 +0000)]
Allow some control over enabled capabilities for if_vlan.

It improves interoperability with if_bridge, which may need to disable
some capabilities not supported by other members.  IMHO there is still
open question about LRO capability, which may need to be disabled on
physical interface.

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

7 years agoo Clean the whole array of IPv4 addresses not just a local part.
maxim [Fri, 28 Apr 2017 09:17:16 +0000 (09:17 +0000)]
o Clean the whole array of IPv4 addresses not just a local part.

PR: 218923
Submitted by: Daniel McRobb

7 years agoDocument raw framebuffer device and XHCI device configurations.
glebius [Fri, 28 Apr 2017 05:43:27 +0000 (05:43 +0000)]
Document raw framebuffer device and XHCI device configurations.

7 years ago- For security reasons by default listen on localhost address,
glebius [Fri, 28 Apr 2017 05:32:26 +0000 (05:32 +0000)]
- For security reasons by default listen on localhost address,
  not on wildcard. [1]
- Move the default port assignment from pci_fbuf.c to rfb.c,
  to avoid polluting pci_fbuf.c with network things.

Suggested by: grehan

7 years agoWhen no "rfb" configuration specified bind to the default VNC
glebius [Fri, 28 Apr 2017 05:13:27 +0000 (05:13 +0000)]
When no "rfb" configuration specified bind to the default VNC
port instead of binding to a random one.

7 years agoMake comments match the code. No functional change.
glebius [Fri, 28 Apr 2017 05:09:51 +0000 (05:09 +0000)]
Make comments match the code. No functional change.

7 years agoMFV 316905
jpaetzel [Fri, 28 Apr 2017 02:11:29 +0000 (02:11 +0000)]
MFV 316905

7740 fix for 6513 only works in hole punching case, not truncation

illumos/illumos-gate@7de35a3ed0c2e6d4256bd2fb05b48b3798aaf553
https://github.com/illumos/illumos-gate/commit/7de35a3ed0c2e6d4256bd2fb05b48b3798aaf553

https://www.illumos.org/issues/7740
  The problem is that dbuf_findbp will return ENOENT if the block it's
  trying to find is beyond the end of the file. If that happens, we assume
  there is no birth time, and so we lose that information when we write
  out new blkptrs. We should teach dbuf_findbp to look for things that are
  beyond the current end, but not beyond the absolute end of the file.
  To verify, create a large file, truncate it to a short length, and then
  write beyond the end. Check with zdb to make sure that there are no
  holes with birth time zero (will appear as gaps).

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Paul Dagnelie <pcd@delphix.com>

7 years agoMFV 316900
jpaetzel [Thu, 27 Apr 2017 23:31:38 +0000 (23:31 +0000)]
MFV 316900

7743 per-vdev-zaps have no initialize path on upgrade

illumos/illumos-gate@555da5111b0f2552c42d057b211aba89c9c79f6c
https://github.com/illumos/illumos-gate/commit/555da5111b0f2552c42d057b211aba89c9c79f6c

https://www.illumos.org/issues/7743
  When loading a pool that had been created before the existance of
  per-vdev zaps, on a system that knows about per-vdev zaps, the
  per-vdev zaps will not be allocated and initialized.
  This appears to be because the logic that would have done so, in
  spa_sync_config_object(), is not reached under normal operation. It is
  only reached if spa_config_dirty_list is non-empty.
  The fix is to add another `AVZ_ACTION_` enum that will allow this code
  to be reached when we detect that we're loading an old pool, even when
  there are no dirty configs.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Don Brady <don.brady@intel.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>

7 years agoUse unconditional jr (jump register) so cerror relocation offset fits.
br [Thu, 27 Apr 2017 22:40:39 +0000 (22:40 +0000)]
Use unconditional jr (jump register) so cerror relocation offset fits.

This fixes libc build on riscv64sf.

Reviewed by: jhb
Sponsored by: DARPA, AFRL

7 years agoMFV 316898
jpaetzel [Thu, 27 Apr 2017 22:00:03 +0000 (22:00 +0000)]
MFV 316898

7613 ms_freetree[4] is only used in syncing context

illumos/illumos-gate@5f145778012b555e084eacc858ead9e1e42bd149
https://github.com/illumos/illumos-gate/commit/5f145778012b555e084eacc858ead9e1e42bd149

https://www.illumos.org/issues/7613
  metaslab_t:ms_freetree[TXG_SIZE] is only used in syncing context. We should
  replace it with two trees: the freeing tree (ranges that we are freeing this
  syncing txg) and the freed tree (ranges which have been freed this txg).

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoAdd asserts to verify stability of struct proc and struct thread layouts.
kib [Thu, 27 Apr 2017 21:24:50 +0000 (21:24 +0000)]
Add asserts to verify stability of struct proc and struct thread layouts.

Some notes:
- Only i386 and amd64 layouts are checked, other Tier-1 (or close to
  it) architectures would benefit from the same check.
- Unconditional enabling of the asserts depend on the stability of locks
  memory layout.  If locks are optimized to avoid bloat when some debugging
  or profiling features turned off, it makes sense to only assert layout
  for production configs.

Reviewed by: badger, emaste, jhb, vangyzen
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D10526

7 years agoMFV 316897
jpaetzel [Thu, 27 Apr 2017 21:11:57 +0000 (21:11 +0000)]
MFV 316897

7586 remove #ifdef __lint hack from dmu.h

illumos/illumos-gate@4ba5b9616327ef64e8abc737d29b3faabc6ae68c
https://github.com/illumos/illumos-gate/commit/4ba5b9616327ef64e8abc737d29b3faabc6ae68c

https://www.illumos.org/issues/7586
  The #ifdef __lint in dmu.h is ugly, and it would be nice not to duplicate it if
  we add other inline functions into header files in ZFS, especially since it is
  difficult to make any other solution work across all compilation targets. We
  should switch to disabling the lint flags that are failing instead.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Dan Kimmel <dan.kimmel@delphix.com>

7 years agoImport Amazon Elastic Network Adapter (ENA) HAL to sys/contrib/
zbb [Thu, 27 Apr 2017 19:57:18 +0000 (19:57 +0000)]
Import Amazon Elastic Network Adapter (ENA) HAL to sys/contrib/

Import from vendor-sys/ena-com/1.1.4.1
SVN rev.: 317516
Version: 1.1.4.1

Obtained from: Amazon.com, Inc.

7 years agoAdvertise kldxref(8) a little better.
trasz [Thu, 27 Apr 2017 19:48:00 +0000 (19:48 +0000)]
Advertise kldxref(8) a little better.

MFC after: 2 weeks

7 years agoIntroduce HAL for Amazon Elastic Network Adapter (ENA)
zbb [Thu, 27 Apr 2017 19:40:53 +0000 (19:40 +0000)]
Introduce HAL for Amazon Elastic Network Adapter (ENA)

This commit adds HAL (Hardware Abstraction Layer) code
for Amazon Elastic Network Adapter (ENA).

Version: 1.1.4.1

Obtained from: Amazon.com, Inc.

7 years agoFix withered handling of r280687, broken by r286719.
mav [Thu, 27 Apr 2017 19:03:08 +0000 (19:03 +0000)]
Fix withered handling of r280687, broken by r286719.

MFC after: 1 week.

7 years agosh: Add some tests for command substitution final newline stripping.
jilles [Thu, 27 Apr 2017 18:52:18 +0000 (18:52 +0000)]
sh: Add some tests for command substitution final newline stripping.

7 years agoarmv8 has support for optional CRC32C instructions. This patch checks if they are
tuexen [Thu, 27 Apr 2017 17:53:05 +0000 (17:53 +0000)]
armv8 has support for optional CRC32C instructions. This patch checks if they are
available and if that is true make use of them.
Thank you very much to Andrew Turner for providing help and review the patch!
Reviewed by: andrew
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D10499

7 years agoMFV 316896
jpaetzel [Thu, 27 Apr 2017 16:38:28 +0000 (16:38 +0000)]
MFV 316896

7580 ztest failure in dbuf_read_impl

illumos/illumos-gate@1a01181fdc809f40c64d5c6881ae3e4521a9d9c7
https://github.com/illumos/illumos-gate/commit/1a01181fdc809f40c64d5c6881ae3e4521a9d9c7

https://www.illumos.org/issues/7580
  We need to prevent any reader whenever we're about the zero out all the
  blkptrs. To do this we need to grab the dn_struct_rwlock as writer in
  dbuf_write_children_ready and free_children just prior to calling bzero.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: George Wilson <george.wilson@delphix.com>

7 years agoVarious fixes for PCI _OSC handling so HotPlug works again.
jhb [Thu, 27 Apr 2017 16:32:42 +0000 (16:32 +0000)]
Various fixes for PCI _OSC handling so HotPlug works again.

- Rename the default implementation of 'pcib_request_feature' and add
  a pcib_request_feature() wrapper function (as is often done for
  new-bus APIs implemented via kobj) that accepts a single function.
  Previously the call to pcib_request_feature() ended up invoking the
  method on the great-great-grandparent of the bridge device instead
  of the grandparent.  For a bridge that was a direct child of pci0 on
  x86 this resulted in the method skipping over the Host-PCI bridge
  driver and being invoked against nexus0
- When invoking _OSC from a Host-PCI bridge driver, invoke
  device_get_softc() against the Host-PCI bridge device instead of the
  child bridge that is requesting HotPlug.  Using the wrong softc data
  resulted in garbage being passed for the ACPI handle causing the
  _OSC call to fail.
- While here, perform some other cleanups to _OSC handling in the ACPI
  Host-PCI bridge driver:
  - Don't invoke _OSC when requesting a control that has already been
    granted by the firmware.
  - Don't set the first word of the capability array before invoking
    _OSC.  This word is always set explicitly by acpi_EvaluateOSC()
    since it is UUID-independent.
  - Don't modify the set of granted controls unless _OSC doesn't exist
    (which is treated as always successful), or the _OSC method
    doesn't fail.
  - Don't require an _OSC status of 0 for success.  _OSC always
    returns the updated control mask even if it returns a non-zero
    status in the first word.
  - Whine if _OSC ever tries to revoke a previously-granted control.
    (It is not supposed to do that.)
- While here, add constants for the _OSC status word in acpivar.h
  (though currently unused).

Reported by: adrian
Reviewed by: imp
MFC after: 1 week
Tested on: Lenovo x220
Differential Revision: https://reviews.freebsd.org/D10520

7 years agoRevert r317446 and bring back cy(4).
jhb [Thu, 27 Apr 2017 16:14:32 +0000 (16:14 +0000)]
Revert r317446 and bring back cy(4).

Requested by: bde

7 years agoMore ATM and NATM removal
brooks [Thu, 27 Apr 2017 16:05:12 +0000 (16:05 +0000)]
More ATM and NATM removal

Submitted by: ak
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D10511

7 years agoMFV 316895
jpaetzel [Thu, 27 Apr 2017 15:10:45 +0000 (15:10 +0000)]
MFV 316895

7606 dmu_objset_find_dp() takes a long time while importing pool

illumos/illumos-gate@7588687e6ba67c47bf7c9805086dec4a97fcac7b
https://github.com/illumos/illumos-gate/commit/7588687e6ba67c47bf7c9805086dec4a97fcac7b

https://www.illumos.org/issues/7606
  When importing a pool with a large number of filesystems within the same
  parent filesystem, we see that dmu_objset_find_dp() takes a long time.
  It is called from 3 places: spa_check_logs(), spa_ld_claim_log_blocks(),
  and spa_load_verify().
  There are several ways to improve performance here:
  1. We don't really need to do spa_check_logs() or
         spa_ld_claim_log_blocks() if the pool was closed cleanly.
  2. spa_load_verify() uses dmu_objset_find_dp() to check that no
         datasets have too long of names.
  3. dmu_objset_find_dp() is slow because it's doing
         zap_value_search() (which is O(N sibling datasets)) to determine
         the name of each dsl_dir when it's opened. In this case we
         actually know the name when we are opening it, so we can provide
         it and avoid the lookup.
  This change implements fix #3 from the above list; i.e. make
  dmu_objset_find_dp() provide the name of the dataset so that we don't
  have to search for it.

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <prashksp@gmail.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMake cached Bluetooth LE host advertise information visible from userland.
takawata [Thu, 27 Apr 2017 15:03:24 +0000 (15:03 +0000)]
Make cached Bluetooth LE host advertise information visible from userland.

Differential Revision: https://reviews.freebsd.org/D10362

7 years agoDon't free uninitialized sysctl contexts in the mlx4en driver. This
hselasky [Thu, 27 Apr 2017 14:39:52 +0000 (14:39 +0000)]
Don't free uninitialized sysctl contexts in the mlx4en driver. This
can cause NULL pointer panics during failed device attach.

Differential Revision: https://reviews.freebsd.org/D8876
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoPrefer to use real virtual address over direct map address in the
hselasky [Thu, 27 Apr 2017 14:29:21 +0000 (14:29 +0000)]
Prefer to use real virtual address over direct map address in the
linux_page_address() function in the LinuxKPI. This solves an issue
where the return value from linux_page_address() is passed to
kmem_free().

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoWe need CAP_MMAP_RW on memfd, since init_msix_table() may call mmap().
glebius [Thu, 27 Apr 2017 05:48:52 +0000 (05:48 +0000)]
We need CAP_MMAP_RW on memfd, since init_msix_table() may call mmap().

7 years agoFix handling of a NFSv4.1 callback reply from the session cache.
rmacklem [Wed, 26 Apr 2017 21:54:53 +0000 (21:54 +0000)]
Fix handling of a NFSv4.1 callback reply from the session cache.

The nfsv4_seqsession() call returns NFSERR_REPLYFROMCACHE when it has a
reply in the session, due to a requestor retry. The code erroneously
assumed a return of 0 for this case. This patch fixes this and adds
a KASSERT(). This would be an extremely rare occurrence. It was found
during code inspection during the pNFS server development.

MFC after: 2 weeks

7 years agoFix an issue with MTU calculation if an ICMP messaeg is received
tuexen [Wed, 26 Apr 2017 20:21:05 +0000 (20:21 +0000)]
Fix an issue with MTU calculation if an ICMP messaeg is received
for an SCTP/UDP packet.

MFC after: 1 week