]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agosade(8): start new sentence on new line
Enji Cooper [Tue, 23 May 2017 07:50:42 +0000 (07:50 +0000)]
sade(8): start new sentence on new line

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agokill(2): add missing section for sysctl(9)
Enji Cooper [Tue, 23 May 2017 07:46:10 +0000 (07:46 +0000)]
kill(2): add missing section for sysctl(9)

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoptrace(2): clean up trailing whitespace
Enji Cooper [Tue, 23 May 2017 07:45:29 +0000 (07:45 +0000)]
ptrace(2): clean up trailing whitespace

Reviewed by: make manlint
MFC after: 2 weeks

7 years agoopen(2): fix manlint warnings
Enji Cooper [Tue, 23 May 2017 07:44:43 +0000 (07:44 +0000)]
open(2): fix manlint warnings

- Sort SEE ALSO .Xr entries.
- Sort sections (HISTORY comes after STANDARDS).

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agorctl_add_rule(2): fix manlint warnings
Enji Cooper [Tue, 23 May 2017 07:32:57 +0000 (07:32 +0000)]
rctl_add_rule(2): fix manlint warnings

- Fix commas (either missing or misused) after .Nm entries in SYNOPSIS

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agocap_enter(2): fix manlint issues
Enji Cooper [Tue, 23 May 2017 07:31:03 +0000 (07:31 +0000)]
cap_enter(2): fix manlint issues

- Sort SEE ALSO section appropriately.
- Correct section for sysctl(9).

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years ago_umtx_op(2): fix minor manlint issues
Enji Cooper [Tue, 23 May 2017 07:26:45 +0000 (07:26 +0000)]
_umtx_op(2): fix minor manlint issues

- Sort .Xr entries in SEE ALSO section.
- Sort SEE ALSO and STANDARDS sections properly, in terms of the
  entire document.

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoLet vmstat -o recognize OBJT_MGTDEVICE objects.
Mark Johnston [Tue, 23 May 2017 07:20:29 +0000 (07:20 +0000)]
Let vmstat -o recognize OBJT_MGTDEVICE objects.

MFC after: 1 week

7 years agoxdr(3): add missing comma after xdr_sizeof(3) in SYNOPSIS
Enji Cooper [Tue, 23 May 2017 07:17:52 +0000 (07:17 +0000)]
xdr(3): add missing comma after xdr_sizeof(3) in SYNOPSIS

This unbreaks the .Nm declaration

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agofopencookie(3): declare function pointers in SYNOPSIS correctly
Enji Cooper [Tue, 23 May 2017 07:15:57 +0000 (07:15 +0000)]
fopencookie(3): declare function pointers in SYNOPSIS correctly

Add obligatory `*` in declarations.

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoquick_exit(3): delete trailing whitespace in licensing tort
Enji Cooper [Tue, 23 May 2017 07:14:46 +0000 (07:14 +0000)]
quick_exit(3): delete trailing whitespace in licensing tort

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoacl_to_text(3): start sentences on new lines
Enji Cooper [Tue, 23 May 2017 07:12:31 +0000 (07:12 +0000)]
acl_to_text(3): start sentences on new lines

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoacl_create_entry(3): separate .Nm entries with commas in SYNOPSIS
Enji Cooper [Tue, 23 May 2017 07:11:15 +0000 (07:11 +0000)]
acl_create_entry(3): separate .Nm entries with commas in SYNOPSIS

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agosctp_send(3): start sentences on new lines
Enji Cooper [Tue, 23 May 2017 07:10:20 +0000 (07:10 +0000)]
sctp_send(3): start sentences on new lines

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agolocaleconv(3): start sentences on new lines
Enji Cooper [Tue, 23 May 2017 07:09:26 +0000 (07:09 +0000)]
localeconv(3): start sentences on new lines

Reported by: make manlint
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agofopen(3): make manlint fixes
Enji Cooper [Tue, 23 May 2017 07:08:30 +0000 (07:08 +0000)]
fopen(3): make manlint fixes

- Break on new lines.
- Use .Dv with NULL.
- Rewrap lines as necessary/when possible.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoposix1e(3): reference using the section (3) when referencing libbsm with .Xr
Enji Cooper [Tue, 23 May 2017 07:05:34 +0000 (07:05 +0000)]
posix1e(3): reference using the section (3) when referencing libbsm with .Xr

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years ago__iconv_get_list: separate .Nm entries with commas
Enji Cooper [Tue, 23 May 2017 07:02:01 +0000 (07:02 +0000)]
__iconv_get_list: separate .Nm entries with commas

MFC after: 2 weeks
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agovis(3): delete spurious .Pp macro
Enji Cooper [Tue, 23 May 2017 07:00:46 +0000 (07:00 +0000)]
vis(3): delete spurious .Pp macro

MFC after: 2 weeks
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agotcsendbreak(3): delete spurious blank line at the end of the man page
Enji Cooper [Tue, 23 May 2017 06:58:08 +0000 (06:58 +0000)]
tcsendbreak(3): delete spurious blank line at the end of the man page

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agodirname(3): fix section ordering
Enji Cooper [Tue, 23 May 2017 06:56:57 +0000 (06:56 +0000)]
dirname(3): fix section ordering

IMPLEMENTATION NOTES come before RETURN VALUES

MFC after: 2 weeks
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agodirectory(3): delete trailing whitespace and rewrite `E.g.` as `e.g.`
Enji Cooper [Tue, 23 May 2017 06:55:51 +0000 (06:55 +0000)]
directory(3): delete trailing whitespace and rewrite `E.g.` as `e.g.`

Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agobasename(3): fix section ordering
Enji Cooper [Tue, 23 May 2017 06:53:31 +0000 (06:53 +0000)]
basename(3): fix section ordering

IMPLEMENTATION NOTES come before RETURN VALUES

MFC after: 2 weeks
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years ago[ar71xx] remove dead code!
Adrian Chadd [Tue, 23 May 2017 06:20:24 +0000 (06:20 +0000)]
[ar71xx] remove dead code!

7 years ago[ar71xx] add a very simple early boot driver called "caldata" to commit cross-layer...
Adrian Chadd [Tue, 23 May 2017 06:20:06 +0000 (06:20 +0000)]
[ar71xx] add a very simple early boot driver called "caldata" to commit cross-layer atrocities.

The (eventually) upcoming ath(4) changes will include being able to load
ath(4) devices on the AHB bus (ie the on-die wifi part of the SoC)
as modules.

In order for this to happen, a copy of the calibration data needs to be
copied away before the SPI driver runs or the memory map access hack
won't work.

Now, ideally (!) there'd be some driver that can come up after the MTD
pieces (eg, SPI, NAND, etc) and load into a firmware chunk the calibration
data.

(Or, really really nicely, would be an actual async firmware API that
would lead itself to having a driver schedule a file read - or a raw device
read - to get to the calibration data.)

Now, until all of the above is done - I'm going to perpetuate the layer
breaking atrocity here by simply doing the PCI bus fixup EEPROM/calibration
data hack here.  This will work for any AR71xx (and later on, AR231x/AR531x)
device, as well as the handful of QCA MIPS + QCA9880v2 802.11ac boards with
NOR flash.

To use, this goes into the kernel config:

# Enable EEPROM hacks
options AR71XX_ATH_EEPROM
device ar71xx_caldata
device firmware

# This enables the ath_ahb driver (when I commit the change!) to
# pull data out of the firmware hack.
options ATH_EEPROM_FIRMWARE

In the hints file:

# ART calibration data mapping device
hint.ar71xx_caldata.0.at="nexus0"
hint.ar71xx_caldata.0.order=0

# Where the ART is - last 64k in the first 8MB of flash
hint.ar71xx_caldata.0.map.0.ath_fixup_addr=0x1fff0000
hint.ar71xx_caldata.0.map.0.ath_fixup_size=16384

# And now tell the ath(4) driver where to look!
hint.ath.0.eeprom_firmware="ar71xx_caldata.0.map.0.eeprom_firmware"

Tested:

* carambola2, AR933x SoC, using a set of ath and ath_hal modules to load

TODO:

* unify this bit of firmware loading code, as I will definitely need
  to include both the PCI bus firmware version (for PCI ID fixups too!)
  as well as AHB/on-chip calibration data.

* Commit the ath_ahb bus code

* Convert .. everything over.  That'll take the majority of the time.

7 years agoerr(3): use `NULL`, aka `(void*)0` per POSIX instead of `(FILE *)0`
Enji Cooper [Tue, 23 May 2017 06:14:02 +0000 (06:14 +0000)]
err(3): use `NULL`, aka `(void*)0` per POSIX instead of `(FILE *)0`

This is being done to aid humans and static analysis checkers.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agostyle(9): sort headers
Enji Cooper [Tue, 23 May 2017 06:05:54 +0000 (06:05 +0000)]
style(9): sort headers

MFC after: 2 weeks
MFC with: r318693
Sponsored by: Dell EMC Isilon

7 years agoSome minor style(9) fixes
Enji Cooper [Tue, 23 May 2017 06:04:38 +0000 (06:04 +0000)]
Some minor style(9) fixes

- Wrap at <80 columns.
- Sort by type

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years ago[arswitch] add phy debugging to the internal PHY read/write functions.
Adrian Chadd [Tue, 23 May 2017 03:48:42 +0000 (03:48 +0000)]
[arswitch] add phy debugging to the internal PHY read/write functions.

7 years agoAdd parent interface reference counting to if_vlan.
Alexander Motin [Tue, 23 May 2017 00:13:27 +0000 (00:13 +0000)]
Add parent interface reference counting to if_vlan.

Using plain ifunit() looks like a request for troubles.

MFC after: 1 week

7 years ago"struct ata_params" field "reserved206[2]" actually starts at offset 20*7*.
Ravi Pokala [Mon, 22 May 2017 23:31:28 +0000 (23:31 +0000)]
"struct ata_params" field "reserved206[2]" actually starts at offset 20*7*.

MFC after: 1 week
Sponsored by: Panasas

7 years agoEnsure that the mappings table is populated in proc_objname().
Mark Johnston [Mon, 22 May 2017 23:21:24 +0000 (23:21 +0000)]
Ensure that the mappings table is populated in proc_objname().

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agondbm.h: Add a comment pointing out our non-compliance with POSIX.
Pedro F. Giffuni [Mon, 22 May 2017 23:17:55 +0000 (23:17 +0000)]
ndbm.h: Add a comment pointing out our non-compliance with POSIX.

Changing it to full conformance breaks the ABI.

Reference:
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/ndbm.h.html

Discussion at: https://reviews.freebsd.org/D10544

7 years agoAdd a little helper program for tst.exitcore.ksh.
Mark Johnston [Mon, 22 May 2017 20:34:51 +0000 (20:34 +0000)]
Add a little helper program for tst.exitcore.ksh.

sleep(1) is capsicumized, which means that we cannot rely on it to dump
core as required by the test.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoFix powerpc compiler error.
Stephen McConnell [Mon, 22 May 2017 20:27:29 +0000 (20:27 +0000)]
Fix powerpc compiler error.

Approved by: ken

7 years agoReplacing iterating over rootpath by strsep(3).
Mariusz Zaborski [Mon, 22 May 2017 20:11:40 +0000 (20:11 +0000)]
Replacing iterating over rootpath by strsep(3).

Submitted by: kczekirda
Reviewed by: tsoome, bapt, jhb, oshogbo
MFC after: 3 weeks
Sponsored by: Oktawave
Differential Revision: https://reviews.freebsd.org/D10726

7 years agoFix regression in ndis(4) after r286410. This adds a bunch of checks for
Gleb Smirnoff [Mon, 22 May 2017 20:00:01 +0000 (20:00 +0000)]
Fix regression in ndis(4) after r286410. This adds a bunch of checks for
whether this is a Ethernet or 802.11 device and does proper dereferencing.

PR: 213237
Submitted by: <ota j.email.ne.jp>
MFC after: 2 weeks

7 years agoCheck for IPV6 TCP/UDP CSUM offload in pkt header during transmits.
David C Somayajulu [Mon, 22 May 2017 19:57:28 +0000 (19:57 +0000)]
Check for IPV6 TCP/UDP CSUM offload in pkt header during transmits.

Submitted by:Shminderjit.Singh@cavium.com

7 years agoPull in r302416 from upstream llvm trunk (by Martin Storsjö):
Dimitry Andric [Mon, 22 May 2017 16:16:48 +0000 (16:16 +0000)]
Pull in r302416 from upstream llvm trunk (by Martin Storsjö):

  [ARM] Clear the constant pool cache on explicit .ltorg directives

  Multiple ldr pseudoinstructions with the same constant value will
  reuse the same constant pool entry. However, if the constant pool is
  explicitly flushed with a .ltorg directive, we should not try to
  reference constants in the previous pool any longer, since they may
  be out of range.

  This fixes assembling hand-written assembler source which repeatedly
  loads the same constant value, across a binary size larger than the
  pc-relative fixup range for ldr instructions (4096 bytes). Such
  assembler source already uses explicit .ltorg instructions to emit
  constant pools with regular intervals. However if we try to reuse
  constants emitted in earlier pools, they end up out of range.

  This makes the output of the testcase match what binutils gas does
  (prior to this patch, it would fail to assemble).

  Differential Revision: https://reviews.llvm.org/D32847

This should fix "out of range pc-relative fixup value" errors, when
compiling certain ARM inline assembly for www/webkit-gtk[23].

Reported by: mmel
MFC after: 3 days

7 years agoFor now, disable building libc++experimental for arm, since there are a
Dimitry Andric [Mon, 22 May 2017 16:13:30 +0000 (16:13 +0000)]
For now, disable building libc++experimental for arm, since there are a
number of static assertion failures in the time_t related parts.

Reported by: mmel, kib

7 years agoRemove glimpse make target added in r181432
Enji Cooper [Mon, 22 May 2017 15:53:30 +0000 (15:53 +0000)]
Remove glimpse make target added in r181432

The textproc/glimpse port expired over 3 years ago because there weren't any
more publicly available distfiles, and because it lacked a maintainer. Remove
the target as it's no longer executable on FreeBSD.

Differential Revision: D10764
MFC after: 1 month
Reviewed by: imp
Sponsored by: Dell EMC Isilon

7 years agoThe connect() system call should return -1 and set errno to EAFNOSUPPORT
Michael Tuexen [Mon, 22 May 2017 15:29:10 +0000 (15:29 +0000)]
The connect() system call should return -1 and set errno to EAFNOSUPPORT
if it is called on a TCP socket
 * with an IPv6 address and the socket is bound to an
    IPv4-mapped IPv6 address.
 * with an IPv4-mapped IPv6 address and the socket is bound to an
   IPv6 address.
Thanks to Jonathan T. Leighton for reporting this issue.

Reviewed by: bz gnn
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D9163

7 years agoAdd support for Amazon Elastic Network Adapter (ENA) NIC
Zbigniew Bodek [Mon, 22 May 2017 14:46:13 +0000 (14:46 +0000)]
Add support for Amazon Elastic Network Adapter (ENA) NIC

ENA is a networking interface designed to make good use of modern CPU
features and system architectures.

The ENA device exposes a lightweight management interface with a
minimal set of memory mapped registers and extendable command set
through an Admin Queue.

The driver supports a range of ENA devices, is link-speed independent
(i.e., the same driver is used for 10GbE, 25GbE, 40GbE, etc.), and has
a negotiated and extendable feature set.

Some ENA devices support SR-IOV. This driver is used for both the
SR-IOV Physical Function (PF) and Virtual Function (VF) devices.

ENA devices enable high speed and low overhead network traffic
processing by providing multiple Tx/Rx queue pairs (the maximum number
is advertised by the device via the Admin Queue), a dedicated MSI-X
interrupt vector per Tx/Rx queue pair, and CPU cacheline optimized
data placement.

The ENA driver supports industry standard TCP/IP offload features such
as checksum offload and TCP transmit segmentation offload (TSO).
Receive-side scaling (RSS) is supported for multi-core scaling.

The ENA driver and its corresponding devices implement health
monitoring mechanisms such as watchdog, enabling the device and driver
to recover in a manner transparent to the application, as well as
debug logs.

Some of the ENA devices support a working mode called Low-latency
Queue (LLQ), which saves several more microseconds. This feature will
be implemented for driver in future releases.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Jakub Palider <jpa@semihalf.com>
Jan Medala <jan@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon.com Inc.
Differential revision: https://reviews.freebsd.org/D10427

7 years agoAllow PORTSDIR to be overridden in the pkg-stage target.
Glen Barber [Mon, 22 May 2017 14:21:45 +0000 (14:21 +0000)]
Allow PORTSDIR to be overridden in the pkg-stage target.

Submitted by: Johannes Jost Meixner (original)
PR: 218393
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoAdd 11.1 to the mdoc(7) mdoc.local.in.
Glen Barber [Mon, 22 May 2017 14:21:07 +0000 (14:21 +0000)]
Add 11.1 to the mdoc(7) mdoc.local.in.

Sponsored by: The FreeBSD Foundation

7 years agoCorrect the "first appeared in" version for efivar(8).
Glen Barber [Mon, 22 May 2017 13:55:59 +0000 (13:55 +0000)]
Correct the "first appeared in" version for efivar(8).

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoRevert r318583 (libthr: use default WARNS level of 6)
Eric van Gyzen [Mon, 22 May 2017 13:21:28 +0000 (13:21 +0000)]
Revert r318583 (libthr: use default WARNS level of 6)

Revert this while I fix RISC-V, SPARC, and probably all architectures
that use GCC.

Reported by: kib
Pointy hat to: vangyzen
Sponsored by: Dell EMC

7 years agoRegen sysent after r318634, no open(2) in capability mode
Ed Maste [Mon, 22 May 2017 11:45:45 +0000 (11:45 +0000)]
Regen sysent after r318634, no open(2) in capability mode

Sponsored by: The FreeBSD Foundation

7 years agodisallow open(2) in capability mode
Ed Maste [Mon, 22 May 2017 11:43:19 +0000 (11:43 +0000)]
disallow open(2) in capability mode

Previously open(2) was allowed in capability mode, with a comment that
suggested this was likely the case to facilitate debugging. The system
call would still fail later on, but it's better to disallow the syscall
altogether.

We now have the kern.trap_enotcap sysctl or PROC_TRAPCAP_CTL proccontrol
to aid in debugging.

In any case libc has translated open() to the openat syscall since
r277032.

Reviewed by: kib, rwatson
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10850

7 years agobsdinstall: do not use distextract in scripted mode
Roger Pau Monné [Mon, 22 May 2017 11:41:17 +0000 (11:41 +0000)]
bsdinstall: do not use distextract in scripted mode

It requires a tty, which might not be available in scripted installs. Instead
extract the sets manually using tar.

Reviewed by: tsoome
Sponsored by: Citrix Systems R&D
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D10736

7 years agobsdinstall: mount is not needed for the ZFS install case
Roger Pau Monné [Mon, 22 May 2017 11:38:39 +0000 (11:38 +0000)]
bsdinstall: mount is not needed for the ZFS install case

Because the datasets are already mounted by zfsboot, and the mount script
doesn't know anything about ZFS. Also do not execute the "umount" script for
ZFS for the same reasons.

Reviewed by: dteske, tsoome
Sponsored by: Citrix Systems R&D
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D10738

7 years agoxen/netfront: don't drop the RX lock in xn_rxeof
Roger Pau Monné [Mon, 22 May 2017 11:33:44 +0000 (11:33 +0000)]
xen/netfront: don't drop the RX lock in xn_rxeof

Since netfront uses different locks for the RX and TX paths there's no need to
drop the RX lock before calling if_input.

Suggested by: jhb
Tested by: cperciva
Sponsored by: Citrix Systems R&D
MFC with: r318523

7 years agoRefactor & compact struct i6addr_t #ifdef: remove redundant structure
Cy Schubert [Mon, 22 May 2017 03:01:35 +0000 (03:01 +0000)]
Refactor & compact struct i6addr_t #ifdef: remove redundant structure
definintion when USE_INET6 is false.

MFC after: 1 week

7 years agonm: document 'r' symbol type
Ed Maste [Mon, 22 May 2017 01:10:12 +0000 (01:10 +0000)]
nm: document 'r' symbol type

PR: 219245
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years ago[ar71xx] fix up dump space a la what jhb@ did elsewhere a while ago.
Adrian Chadd [Sun, 21 May 2017 23:55:58 +0000 (23:55 +0000)]
[ar71xx] fix up dump space a la what jhb@ did elsewhere a while ago.

7 years ago[libcompiler-rt] add bswapdi2/bswapsi2
Adrian Chadd [Sun, 21 May 2017 23:15:32 +0000 (23:15 +0000)]
[libcompiler-rt] add bswapdi2/bswapsi2

This is required for mips gcc 6.3 userland to build/run.

Reviewed by: emaste, dim
Approved by: emaste
Differential Revision: https://reviews.freebsd.org/D10838

7 years agoMake catman(1) use mandoc(1) by default
Baptiste Daroussin [Sun, 21 May 2017 22:28:28 +0000 (22:28 +0000)]
Make catman(1) use mandoc(1) by default

catman(1) checks if mandoc(1) do support the manpage before trying to generate
the catpage and falls back on nroff, using the same mechanism as man(1).

7 years agoUpdates for efivar.8
Benjamin Kaduk [Sun, 21 May 2017 22:10:08 +0000 (22:10 +0000)]
Updates for efivar.8

Fix spelling [1], appease igor and mandoc -Tlint, and adopt the
language style to be more consistent with our corpus.

PR: 219434 [1]
Submitted by: olgeni [1]

7 years agoAdd PICFLAG to build libc++experimental.a, so it can be used in all
Dimitry Andric [Sun, 21 May 2017 21:33:15 +0000 (21:33 +0000)]
Add PICFLAG to build libc++experimental.a, so it can be used in all
situations.

Noticed by: kib

7 years agomsdosfs: constify
Ed Maste [Sun, 21 May 2017 20:00:49 +0000 (20:00 +0000)]
msdosfs: constify

Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation

7 years agomsdosfs: correct constant and typo in comment
Ed Maste [Sun, 21 May 2017 19:48:16 +0000 (19:48 +0000)]
msdosfs: correct constant and typo in comment

Revisions:
fat.h 1.5 1.6

Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation

7 years agomsdosfs: capitalize FAT appropriately
Ed Maste [Sun, 21 May 2017 19:29:28 +0000 (19:29 +0000)]
msdosfs: capitalize FAT appropriately

Diff reduction with NetBSD, including some nearby minor whitespace or
style fixes.

Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation

7 years agoAdd libc++experimental.a for std::experimental support
Dimitry Andric [Sun, 21 May 2017 17:07:12 +0000 (17:07 +0000)]
Add libc++experimental.a for std::experimental support

This adds a separate library for supporting std::experimental features.
It is purposefully static, and must be explicitly linked into programs
using -lc++experimental.

PLEASE NOTE: there is NO WARRANTY as to any stability or continuing
existence of the features in the std::experimental parts of the C++
library!

Reviewed by: ed
Differential Revision: https://reviews.freebsd.org/D10840

7 years agoFix build of AIO tests with -DDEBUG
Alan Somers [Sun, 21 May 2017 15:37:08 +0000 (15:37 +0000)]
Fix build of AIO tests with -DDEBUG

Also, redefine some constants for clarity.  No functional change.

MFC after: 1 week

7 years agocompress: Allow uncompress -c with multiple pathnames, as required by POSIX.
Jilles Tjoelker [Sun, 21 May 2017 14:35:16 +0000 (14:35 +0000)]
compress: Allow uncompress -c with multiple pathnames, as required by POSIX.

Per POSIX, allow passing multiple pathnames to uncompress -c, concatenating
the uncompressed data.

Passing multiple pathnames to compress -c remains disallowed, since the
result cannot be decompressed.

PR: 219387
Reported by: Jörg Schilling

7 years agocompress: Add basic tests.
Jilles Tjoelker [Sun, 21 May 2017 14:05:32 +0000 (14:05 +0000)]
compress: Add basic tests.

7 years agoAdd get_cpu() and put_cpu().
Mark Johnston [Sun, 21 May 2017 00:06:36 +0000 (00:06 +0000)]
Add get_cpu() and put_cpu().

MFC after: 1 week

7 years agoUpdate the exports.5 man page to reflect the change in default uid/gid
Rick Macklem [Sat, 20 May 2017 23:25:07 +0000 (23:25 +0000)]
Update the exports.5 man page to reflect the change in default uid/gid
made by r318262.

This is a content change.

7 years agoFix up two assertions following malloc(). vangyzen@ notified me of
Cy Schubert [Sat, 20 May 2017 18:16:26 +0000 (18:16 +0000)]
Fix up two assertions following malloc(). vangyzen@ notified me of
the second one. The first one is fixed as well.

Reported by: vangyzen@
MFC after: 1 week

7 years agoAdd -w to usage string.
Dag-Erling Smørgrav [Sat, 20 May 2017 18:02:31 +0000 (18:02 +0000)]
Add -w to usage string.

Reported by: Jamie Landeg-Jones <jamie@catflap.org>
MFC after: 1 week

7 years agodma.8: fix problems reported by igor and 'mandoc -Tlint'
Eric van Gyzen [Sat, 20 May 2017 17:42:58 +0000 (17:42 +0000)]
dma.8: fix problems reported by igor and 'mandoc -Tlint'

dma.8:77:contraction:Queue the mail, but [don't] attempt to deliver it.
dma.8:85:repeated:s [are are] ignored.
dma.8:87:contraction:[Don't] run in the background.
dma.8:201:contraction:Use the catch-all alias only if you [don't] want any local mail to be

mandoc: dma.8:308:5: WARNING: macro neither callable nor escaped: Sm

MFC after: 3 days

7 years agodma.8: use the correct name for 'SECURETRANSFER'
Eric van Gyzen [Sat, 20 May 2017 17:39:23 +0000 (17:39 +0000)]
dma.8: use the correct name for 'SECURETRANSFER'

The code uses 'SECURETRANS', but the config file uses 'SECURETRANSFER'.

MFC after: 3 days

7 years agolibthr: Use CLI flags instead of pragmas to disable warnings
Eric van Gyzen [Sat, 20 May 2017 17:33:47 +0000 (17:33 +0000)]
libthr: Use CLI flags instead of pragmas to disable warnings

People tweaking the build system or compilers tend to look into
the Makefile and not into the source.  Having some warning controls
in the Makefile and some in the source code is surprising.

Pragmas have the advantage that they leave the warnings enabled
for more code, but that advantage isn't very relevant in these cases.

Requested by: kib
Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10832

7 years agolibthr: use default WARNS level of 6
Eric van Gyzen [Sat, 20 May 2017 17:32:30 +0000 (17:32 +0000)]
libthr: use default WARNS level of 6

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10832

7 years agoRemove old spinlock_debug code from libc
Eric van Gyzen [Sat, 20 May 2017 17:32:01 +0000 (17:32 +0000)]
Remove old spinlock_debug code from libc

This no longer seems useful.  Remove it.

This was prompted by a "cast discards volatile qualifier" warning
in libthr when WARNS=6.

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10832

7 years agolibthr: change CHECK_AND_INIT_RWLOCK to an inline function
Eric van Gyzen [Sat, 20 May 2017 17:30:48 +0000 (17:30 +0000)]
libthr: change CHECK_AND_INIT_RWLOCK to an inline function

This was prompted by a compiler warning about 'ret' shadowing
a local variable in the callers of the macro.

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10832

7 years agolibthr: disable thread-safety warnings
Eric van Gyzen [Sat, 20 May 2017 17:29:36 +0000 (17:29 +0000)]
libthr: disable thread-safety warnings

These warnings don't make sense for code that implements
the locking primitives.

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10832

7 years agoFix non-recoverable name resolution failures due to negative cache
Cy Schubert [Sat, 20 May 2017 16:58:48 +0000 (16:58 +0000)]
Fix non-recoverable name resolution failures due to negative cache
entries never expiring. This patch honours the negative cache timeout.

To test/experience the failure do the following:

1. Edit /etc/ncd.conf to adjust the cache timeouts as follows:

positive-time-to-live hosts 30
negative-time-to-live hosts 1

2. Ensure that nsswitch.conf hosts line contains something like:

hosts: files cache dns

Note that cache must be specified before dns.

3. Start nscd.

4. Run the following command:

while true; do nc -z -w 3 www.google.com 80; sleep 5; done

5. While running the command, remove or comment out all nameserver
   statements in /etc/resolv.conf. After a short while you will notice
   non-recoverable name rsolution failures.

6. Uncomment or replace all nameserver statements back into
   /etc/resolv.conf. Take note that name resolution never recovers.
   To recover nscd must be restarted. This patch fixes this.

PR: 207804
Submitted by: Jov <amutu@amutu.com>
MFC after: 1 week

7 years agoImprove time-since-last-scrub calculation.
Michael Reifenberger [Sat, 20 May 2017 16:47:00 +0000 (16:47 +0000)]
Improve time-since-last-scrub calculation.
This can be needed to compensate anticongestion delays in 410.pkg-audit or 480.leapfile-ntpd.

PR: 217622
Submitted by: wbe@psr.com
MFC after: 2 weeks

7 years agoAfter r317383 (removal of NATM), also remove usr/include/dev/utopia from
Dimitry Andric [Sat, 20 May 2017 11:40:37 +0000 (11:40 +0000)]
After r317383 (removal of NATM), also remove usr/include/dev/utopia from
BSD.include.dist.

7 years agobsdgrep: Correct per-line line metadata printing
Ed Maste [Sat, 20 May 2017 11:20:03 +0000 (11:20 +0000)]
bsdgrep: Correct per-line line metadata printing

Metadata printing with -b, -H, or -n flags suffered from a few flaws:

1) -b/offset printing was broken when used in conjunction with -o

2) With -o, bsdgrep did not print metadata for every match/line, just
   the first match of a line

3) There were no tests for this

Address these issues by outputting this data per-match if the -o flag is
specified, and prior to outputting any matches if -o but not --color,
since --color alone will not generate a new line of output for every
iteration over the matches.

To correct -b output, fudge the line offset as we're printing matches.

While here, make sure we're using grep_printline in -A context.  Context
printing should *never* look at the parsing context, just the line.

The tests included do not pass with gnugrep in base due to it exhibiting
similar quirky behavior that bsdgrep previously exhibited.

Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D10580

7 years agobsdgrep: emit more than MAX_LINE_MATCHES per line
Ed Maste [Sat, 20 May 2017 03:51:31 +0000 (03:51 +0000)]
bsdgrep: emit more than MAX_LINE_MATCHES per line

We should not set an arbitrary cap on the number of matches on a line,
and in any case MAX_LINE_MATCHES of 32 is much too low.  Instead, if we
match more than MAX_LINE_MATCHES, keep processing and matching from the
last match until all are found.

For the regression test, we produce 4096 matches (larger than we expect
we'll ever set MAX_LINE_MATCHES) and make sure we actually get 4096
lines of output with the -o flag.

We'll also make sure that every distinct line is getting its own line
number to detect line metadata not being printed as appropriate along
the way.

PR: 218811
Submitted by: Kyle Evans <kevans91@ksu.edu>
Reported by: jbeich
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D10577

7 years ago[net80211] prepare for A-MSDU/A-MPDU offload crypto / sequence number checking.
Adrian Chadd [Sat, 20 May 2017 00:43:52 +0000 (00:43 +0000)]
[net80211] prepare for A-MSDU/A-MPDU offload crypto / sequence number checking.

When doing AMSDU offload, the driver (for now!) presents 802.11 frames with
the same sequence number and crypto sequence number / IV values up to the stack.
But, this will trip afoul over the sequence number detection.

So drivers now have a way to signify that a frame is part of an offloaded
AMSDU group, so we can just ensure that we pass those frames up to the
stack.

The logic will be a bit messy - the TL;DR will be that if it's part of
the previously seen sequence number then it belongs in the same burst.
But if we get a repeat of the same sequence number (eg we sent an ACK
but the receiver didn't hear it) then we shouldn't be passing those frames
up.  So, we can't just say "all subframes go up", we need to track
whether we've seen the end of a burst of frames for the given sequence
number or not, so we know whether to actually pass them up or not.

The first part of doing all of this is to ensure the ieee80211_rx_stats
struct is available in the RX sequence number check path and the
RX ampdu reorder path.  So, start by passing the pointer into these
functions to avoid doing another lookup.

The actual support will come in a subsequent commit once I know the
functionality actually works!

7 years agobsdgrep: fix segfault with --mmap
Ed Maste [Sat, 20 May 2017 00:42:47 +0000 (00:42 +0000)]
bsdgrep: fix segfault with --mmap

r313948 partially fixed --mmap behavior but was incomplete.  This commit
generally reverts it and does it the more correct way- by just consuming
the rest of the buffer and moving on.

PR: 219402
Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D10820

7 years agoExclude ccr(4) from arm LINT since it excludes cxgbe(4).
John Baldwin [Fri, 19 May 2017 22:54:45 +0000 (22:54 +0000)]
Exclude ccr(4) from arm LINT since it excludes cxgbe(4).

7 years agoo Missed flag restored.
Maxim Konovalov [Fri, 19 May 2017 20:02:32 +0000 (20:02 +0000)]
o Missed flag restored.

PR: 219395
Submitted by: Tiwei Bie

7 years agomsdosfs: use C99 types
Ed Maste [Fri, 19 May 2017 18:13:41 +0000 (18:13 +0000)]
msdosfs: use C99 types

General cleanup, for diff reduction with NetBSD and future use by FAT
support in makefs.

Submitted by: Siva Mahadevan <smahadevan@freebsdfoundation.org>
Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10821

7 years agosys/fs/tmpfs/vnd_test: make md(4) allocation dynamic
Enji Cooper [Fri, 19 May 2017 17:14:29 +0000 (17:14 +0000)]
sys/fs/tmpfs/vnd_test: make md(4) allocation dynamic

The previous logic was flawed in the sense that it assumed that /dev/md3
was always available. This was a caveat I noted in r306038, that I hadn't
gotten around to solving before now.

Cache the device for the mountpoint after executing mdmfs, then use the
cached value in basic_cleanup(..) when unmounting/disconnecting the md(4)
device.

Apply sed expressions to use reuse logic in the NetBSD code that could
also be applied to FreeBSD, just with different tools.

Differential Revision: D10766
MFC after: 1 week
Reviewed by: bdrewery
Sponsored by: Dell EMC Isilon

7 years agoInstall {cron.d,newsyslog.conf.d,syslog.d} via `make distribution`, not `make install`
Enji Cooper [Fri, 19 May 2017 17:04:01 +0000 (17:04 +0000)]
Install {cron.d,newsyslog.conf.d,syslog.d} via `make distribution`, not `make install`

I incorrectly started this pattern in r277541 with the opensm newsyslog.conf.d file,
and continued using it in r318441 and r318443.

This will fix the files being handled improperly via installworld, preventing tools like
etcupdate, mergemaster, etc from functioning properly when comparing the installed
contents on a system vs the contents in a source tree when doing merges.

PR: 219404
Submitted by: Dan McGregor <dan.mcgregor@usask.ca>
MFC after: 2 weeks
MFC with: r277541, r318441, r318443
Sponsored by: Dell EMC Isilon

7 years agolibthr: fix warnings at WARNS=6
Eric van Gyzen [Fri, 19 May 2017 13:04:05 +0000 (13:04 +0000)]
libthr: fix warnings at WARNS=6

Fix warnings about the following when WARNS=6 (which I will commit soon):

- casting away const
- no previous 'extern' declaration for non-static variable
- others as explained by #pragmas and comments
- unused parameters

The last is the only functional change.

Reviewed by: kib
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10808

7 years agomlx4: Use the CQ quota for SRIOV when creating completion EQs
Hans Petter Selasky [Fri, 19 May 2017 12:22:48 +0000 (12:22 +0000)]
mlx4: Use the CQ quota for SRIOV when creating completion EQs

When creating EQs to handle CQ completion events for the PF or for
VFs, we create enough EQE entries to handle completions for the max
number of CQs that can use that EQ.

When SRIOV is activated, the max number of CQs a VF (or the PF) can
obtain is its CQ quota (determined by the Hypervisor resource
tracker).  Therefore, when creating an EQ, the number of EQE entries
that the VF should request for that EQ is the CQ quota value (and not
the total number of CQs available in the firmware).

Under SRIOV, the PF, also must use its CQ quota, because the resource
tracker also controls how many CQs the PF can obtain.

Using the firmware total CQs instead of the CQ quota when creating EQs
resulted wasting MTT entries, due to allocating more EQEs than were
needed.

MFC after: 3 days
Sponsored by: Mellanox Technologies

7 years agoIncrease maximum text segment size.
Michal Meloun [Fri, 19 May 2017 11:45:14 +0000 (11:45 +0000)]
Increase maximum text segment size.
LLVM binaries are huge...

MFC after: 3 days

7 years agoFix the queue delay estimation in PIE/FQ-PIE when the timestamp
Don Lewis [Fri, 19 May 2017 08:38:03 +0000 (08:38 +0000)]
Fix the queue delay estimation in PIE/FQ-PIE when the timestamp
(TS) method is used.  When packet timestamp is used, the "current_qdelay"
keeps storing the last queue delay value calculated in the dequeue
function.  Therefore, when a burst of packets arrives followed by
a pause, the "current_qdelay" will store a high value caused by the
burst and stick to that value during the pause because the queue
delay measurement is done inside the dequeue function.  This causes
the drop probability calculation function to calculate high drop
probability value instead of zero and prevents the burst allowance
mechanism from working properly.  Fix this problem by resetting
"current_qdelay" inside the drop probability calculation function
when the queue length is zero and TS option is used.

Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au>
MFC after: 1 week

7 years agoFix boot up on ARMADA38X uniprocessor variant
Wojciech Macek [Fri, 19 May 2017 08:26:41 +0000 (08:26 +0000)]
Fix boot up on ARMADA38X uniprocessor variant

Marvell Armada 380 is a uni-processor variant of the 38x SoC
family. A function platform_mp_setmaxid() was setting a hardcoded
value, which caused boot fail on A380. Fix this by relying on
the CPU count obtained from device tree nodes.

Submitted by:  Marcin Wojtas <mw@semihalf.com
Obtained from: Semihalf
Sponsored by:  Netgate
Reviewed by:   loos
Differential revision: https://reviews.freebsd.org/D10783

7 years agoFix MPIC mask/unmask
Wojciech Macek [Fri, 19 May 2017 08:25:40 +0000 (08:25 +0000)]
Fix MPIC mask/unmask

Before the fix for single interrupt, both percpu and non-percpu routes
were enabled/disable at the same time.

Submitted by:  Marcin Wojtas <mw@semihalf.com
Obtained from: Semihalf
Sponsored by:  Stormshield, Netgate
Reviewed by:   loos
Differential revision: https://reviews.freebsd.org/D10716

7 years agoPoll PHY status using internal e6000sw registers
Wojciech Macek [Fri, 19 May 2017 08:24:23 +0000 (08:24 +0000)]
Poll PHY status using internal e6000sw registers

e6000sw family automatically reflects PHY status in each port's registers.
Therefore it is not necessary to do a full PHY polling squence, which
results in much quicker operation and much less significant usage of
the SMI bus.

Care must be taken that the resulting ifmedia_active is identical to
what the PHY will compute, or gratuitous link status changes will
occur whenever the PHYs update function is called.

This patch implements above improvement. On the occasion set a pointer to
the proc structure to be part of software context instead of being
a global variable.

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10714

7 years agoxen/netfront: don't drop the ring RX lock with inconsistent ring state
Roger Pau Monné [Fri, 19 May 2017 08:19:51 +0000 (08:19 +0000)]
xen/netfront: don't drop the ring RX lock with inconsistent ring state

Make sure the RX ring lock is only released when the state of the ring is
consistent, or else concurrent calls to xn_rxeof might get an inconsistent ring
state and thus some packets might be processed twice.

Note that this is not very common, and could only happen when an interrupt is
delivered while in xn_ifinit.

Reported by: cperciva
Tested by: cperciva
MFC after: 1 week
Sponsored by: Citrix Systems R&D

7 years agoEnable proper configuration of CESA MBUS windows
Wojciech Macek [Fri, 19 May 2017 08:19:39 +0000 (08:19 +0000)]
Enable proper configuration of CESA MBUS windows

For all Marvell devices, MBUS windows configuration is done
in a common place. Only CESA was an exception, so move its
related code from driver to mv_common.c. This way it uses
same proper DRAM information, same as  all other interfaces
instead of parsing DT /memory node directly.

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10723

7 years agoImprove busy-wait loop during switch phy access in e6000sw
Wojciech Macek [Fri, 19 May 2017 08:16:47 +0000 (08:16 +0000)]
Improve busy-wait loop during switch phy access in e6000sw

Hitherto implementation of PHY polling resulted in a risk of an
endless loop and very high occupation of the SMI bus. Improve the
operation by limiting the polling tries and adding sleepable
pause.

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10713

7 years agoxen/blkfront: correctly detach a disk with active users
Roger Pau Monné [Fri, 19 May 2017 08:11:15 +0000 (08:11 +0000)]
xen/blkfront: correctly detach a disk with active users

Call disk_gone when the backend switches to the "Closing" state and blkfront
still has pending users. This allows the disk to be detached, and will call
into xbd_closing by itself when the geom layout cleanup has finished.

Reported by: bapt
Tested by: manu
Reviewed by: bapt
Sponsored by: Citrix Systems R&D
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D10772