]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agomca: use time_uptime instead of ticks for CMCI throttling
Andriy Gapon [Tue, 14 Feb 2017 22:46:39 +0000 (22:46 +0000)]
mca: use time_uptime instead of ticks for CMCI throttling

This solves several problems.
First of all, cmc_throttle is specified in seconds and there was no
conversion between ticks and seconds when they were mixed together.
Second, we avoid potential problems with ticks wrapping around.

Resolution of time_uptime should be sufficient for the throttling
purposes.

Discussed with: jhb
MFC after: 12 days

7 years agomca: fix writes to MSR_MC_CTL2 in cmci_update
Andriy Gapon [Tue, 14 Feb 2017 22:30:22 +0000 (22:30 +0000)]
mca: fix writes to MSR_MC_CTL2 in cmci_update

Previously, if the threshold was changed, then MC_CTL2_CMCI_EN would get
cleared and the logic would switch to the polling only mode.

Discussed with: jhb
MFC after: 2 weeks

7 years agoAdd a regression test for putting a socket on kqueue, and then doing
Gleb Smirnoff [Tue, 14 Feb 2017 21:56:01 +0000 (21:56 +0000)]
Add a regression test for putting a socket on kqueue, and then doing
listen(2) on it (see r313043).  Based on Hartmut's code.

7 years agoFix indentation in nss_configure().
Mark Johnston [Tue, 14 Feb 2017 21:55:50 +0000 (21:55 +0000)]
Fix indentation in nss_configure().

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoRegister nss_atexit() before parsing nsswitch.conf for the first time.
Mark Johnston [Tue, 14 Feb 2017 21:51:19 +0000 (21:51 +0000)]
Register nss_atexit() before parsing nsswitch.conf for the first time.

NSS modules are loaded when nsswitch.conf is parsed and may register their
own atexit handlers with libc. nss_atexit() unloads any dynamically loaded
NSS modules, so it should run only after the modules' atexit handlers have
been invoked.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoUnbreak the gcc build of netmap.
Mark Johnston [Tue, 14 Feb 2017 21:36:18 +0000 (21:36 +0000)]
Unbreak the gcc build of netmap.

This fixes several LINT targets.

Reviewed by: Vincenzo Maffione

7 years agoAdd missing check to fix the build with IPSEC_SUPPORT and without MAC.
Andrey V. Elsukov [Tue, 14 Feb 2017 21:33:10 +0000 (21:33 +0000)]
Add missing check to fix the build with IPSEC_SUPPORT and without MAC.

Submitted by: netchild

7 years ago* Add missing parameters to usage()
Renato Botelho [Tue, 14 Feb 2017 21:14:24 +0000 (21:14 +0000)]
* Add missing parameters to usage()
* Add missing parameters to manpage synopsis
* Add missing description of -d flag
* Sort flags descriptions

Reviewed by: allanjude, kib
Approved by: allanjude
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D9152

7 years agoNo need to erase sense_data when sense_len is set to zero.
Alexander Motin [Tue, 14 Feb 2017 21:05:36 +0000 (21:05 +0000)]
No need to erase sense_data when sense_len is set to zero.

MFC after: 2 weeks

7 years agoAdd myself as a new ports committer
Tobias Kortkamp [Tue, 14 Feb 2017 19:54:32 +0000 (19:54 +0000)]
Add myself as a new ports committer

Approved by: mat (mentor)
Differential Revision: https://reviews.freebsd.org/D9590

7 years agoReplace Linuxulator implementation of readdir(), getdents() and
Dmitry Chagin [Tue, 14 Feb 2017 19:13:27 +0000 (19:13 +0000)]
Replace Linuxulator implementation of readdir(), getdents() and
getdents64() with wrapper over kern_getdirentries().

The patch was originally written by emaste@ and then adapted by trasz@
and me.

Note:
1. I divided linux_getdents() and linux_readdir() as in case when the
getdents() called with count = 1 (readdir() case) it can overwrite
user stack (by writing to user buffer pointer more than 1 byte).

2. Linux returns EINVAL in case when user supplied buffer is not enough
to contain fetched dirent.

3. Linux returns ENOTDIR in case when fd points to not a directory.

Reviewed by: trasz@
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D2210

7 years agoDirectly call m_gethdr() instead of m_getm2() for BHS.
Alexander Motin [Tue, 14 Feb 2017 18:34:25 +0000 (18:34 +0000)]
Directly call m_gethdr() instead of m_getm2() for BHS.

All this code is based on assumption that data will be stored in one piece,
and since buffer size if known and fixed, it is easier to hardcode it.

MFC after: 2 weeks

7 years agoTemporary attach AHS to BHS to calculate header digest.
Alexander Motin [Tue, 14 Feb 2017 18:29:07 +0000 (18:29 +0000)]
Temporary attach AHS to BHS to calculate header digest.

MFC after: 2 weeks

7 years agoFix style(9)
Renato Botelho [Tue, 14 Feb 2017 18:11:16 +0000 (18:11 +0000)]
Fix style(9)

Reviewed by: allanjude, vangyzen
Approved by: allanjude
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D9510

7 years agoFix panic on shutdown of ramdisk LU with zero capacity.
Alexander Motin [Tue, 14 Feb 2017 18:03:17 +0000 (18:03 +0000)]
Fix panic on shutdown of ramdisk LU with zero capacity.

MFC after: 1 week

7 years agoadd svcpool_close to handle killed nfsd threads
Andriy Gapon [Tue, 14 Feb 2017 17:49:08 +0000 (17:49 +0000)]
add svcpool_close to handle killed nfsd threads

This patch adds a new function to the server krpc called
svcpool_close().  It is similar to svcpool_destroy(), but does not free
the data structures, so that the pool can be used again.

This function is then used instead of svcpool_destroy(),
svcpool_create() when the nfsd threads are killed.

PR: 204340
Reported by: Panzura
Approved by: rmacklem
Obtained from: rmacklem
MFC after: 1 week

7 years agoAdd RLIM_SAVED_MAX and RLIM_SAVED_CUR symbols.
Konstantin Belousov [Tue, 14 Feb 2017 17:44:30 +0000 (17:44 +0000)]
Add RLIM_SAVED_MAX and RLIM_SAVED_CUR symbols.

Define them as RLIM_INFINITY.  This is allowed by POSIX in case all
resource limits are representable in an object of type rlim_t.  Since
we do not allow negative rlim_t, with some strength this definition is
conforming.

We are not conforming fully still because POSIX requires rlim_t to be
unsigned type.  Fixing this without breaking ABI to redefine
RLIM_INFINITY is impossible.

PR: 209729
Submitted by: bltsrc@mail.ru
Exp-run done by: antoine
MFC after: 2 weeks

7 years agosleepq_catch_signals: do thread suspension before signal check
Eric Badger [Tue, 14 Feb 2017 17:13:23 +0000 (17:13 +0000)]
sleepq_catch_signals: do thread suspension before signal check

Since locks are dropped when a thread suspends, it's possible for another
thread to deliver a signal to the suspended thread. If the thread awakens from
suspension without checking for signals, it may go to sleep despite having
a pending signal that should wake it up. Therefore the suspension check is
done first, so any signals sent while suspended will be caught in the
subsequent signal check.

Reviewed by: kib
Approved by: kib (mentor)
MFC after: 2 weeks
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D9530

7 years agobhyve: whitespace fix for r313727
Ed Maste [Tue, 14 Feb 2017 16:49:32 +0000 (16:49 +0000)]
bhyve: whitespace fix for r313727

Reported by: jhb

7 years agoDo not rely on data alignment after m_pullup().
Alexander Motin [Tue, 14 Feb 2017 16:33:42 +0000 (16:33 +0000)]
Do not rely on data alignment after m_pullup().

In general case m_pullup() does not really guarantee any data alignment.
Instead of depenting on side effects caused by data being always copied
out of mbuf cluster (which is probably a bug by itself), always allocate
aligned BHS buffer and read data there directly from socket.

While there, reuse new icl_conn_receive_buf() function to read digests.
The code could probably be even more optimized to aggregate those reads,
but until that done, this is still easier then the way it was before.

MFC after: 2 weeks

7 years agotry to fix RACCT_RSS accounting
Andriy Gapon [Tue, 14 Feb 2017 13:54:05 +0000 (13:54 +0000)]
try to fix RACCT_RSS accounting

There could be a race between the vm daemon setting RACCT_RSS based on
the vm space and vmspace_exit (called from exit1) resetting RACCT_RSS to
zero.  In that case we can get a zombie process with non-zero RACCT_RSS.
If the process is jailed, that may break accounting for the jail.
There could be other consequences.

Fix this race in the vm daemon by updating RACCT_RSS only when a process
is in the normal state.  Also, make accounting a little bit more
accurate by refreshing the page resident count after calling
vm_pageout_map_deactivate_pages().
Finally, add an assert that the RSS is zero when a process is reaped.

PR: 210315
Reviewed by: trasz
Differential Revision: https://reviews.freebsd.org/D9464

7 years agoCapsicum support for bhyve(8).
Bartek Rutkowski [Tue, 14 Feb 2017 13:35:59 +0000 (13:35 +0000)]
Capsicum support for bhyve(8).

Adds Capsicum sandboxing to bhyve.

Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com>
Reviewed by: grehan, oshogbo
Approved by: emaste, grehan
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D8290

7 years agoOrder alphabetically.
Konstantin Belousov [Tue, 14 Feb 2017 03:32:37 +0000 (03:32 +0000)]
Order alphabetically.

Noted by: alc
MFC after: 3 days

7 years agoUse %s __func__ to print the actual function name (been looking at
Bjoern A. Zeeb [Tue, 14 Feb 2017 01:20:03 +0000 (01:20 +0000)]
Use %s __func__ to print the actual function name (been looking at
the wrong one for too often lately at first), and also use %#lx to
get the 0x prefix for the address.

MFC after: 1 week

7 years agoHandle clang 4.x+ with the compile-time exception added in r312213
Enji Cooper [Tue, 14 Feb 2017 00:54:48 +0000 (00:54 +0000)]
Handle clang 4.x+ with the compile-time exception added in r312213

It also fails the assertions noted in bug 208703

PR: 208703
PR: 217084
Submitted by: jbeich
MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years ago[sdhci_acpi] Add support for Bay Trail SDHC SD card slot
Oleksandr Tymoshenko [Tue, 14 Feb 2017 00:04:36 +0000 (00:04 +0000)]
[sdhci_acpi] Add support for Bay Trail SDHC SD card slot

Add ACPI device 80860F14 with _UID 3 to the list of known devices. It
make SD card available on NUCs and Minnowboard. Previously added _UID 1
covered only eMMC devices.

Reported by: kib@
MFC after: 1 week

7 years agovtnet: don't update VLAN filter when parent is not running
Philip Paeps [Mon, 13 Feb 2017 21:44:29 +0000 (21:44 +0000)]
vtnet: don't update VLAN filter when parent is not running

Submitted by: Gerrie Roos <groos -at- xiplink -dot- com>
Reviewed by: gnn
Sponsored by: XipLink, Inc.
Differential Revision: https://reviews.freebsd.org/D9573

7 years agoloader: cstyle fixes and DIOCGMEDIASIZE should use uint64_t
Toomas Soome [Mon, 13 Feb 2017 21:33:50 +0000 (21:33 +0000)]
loader: cstyle fixes and DIOCGMEDIASIZE should use uint64_t

Cleaned up some spaces where tabs should be.
efipart_ioctl() DIOCGMEDIASIZE needs to use uint64_t, not off_t

Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D9562

7 years agoFix build of BSD dtc when NDEBUG is defined (MK_ASSERT_DEBUG=no):
Dimitry Andric [Mon, 13 Feb 2017 20:56:53 +0000 (20:56 +0000)]
Fix build of BSD dtc when NDEBUG is defined (MK_ASSERT_DEBUG=no):
* Initialize correct parent in binary_operator's constructor.
* Include <errno.h> explicitly, otherwise errno is undefined (without
  NDEBUG, this is accidentally 'fixed' by including <iostream>).

Reported by: matteo
MFC after: 3 days

7 years agoRemove debugging code that was probably unused since before the arm code
Olivier Houchard [Mon, 13 Feb 2017 20:51:08 +0000 (20:51 +0000)]
Remove debugging code that was probably unused since before the arm code
was initially committed.

Reported by: Alexandre Martins <alexandre.martins@stormshield.eu>

7 years agoRemove M_PKTHDR from m_getm2() in icl_pdu_append_data().
Alexander Motin [Mon, 13 Feb 2017 20:36:28 +0000 (20:36 +0000)]
Remove M_PKTHDR from m_getm2() in icl_pdu_append_data().

ip_data_mbuf is always appended to ip_bhs_mbuf, so it does not need own
packet header.  This change first avoids allocation/initialization of the
header, and then avoids dropping one when it later gets to socket buffer.

MFC after: 2 weeks

7 years ago[mips/broadcom] Move MIPS-specific bhnd(4) nexus drivers to
Landon J. Fuller [Mon, 13 Feb 2017 19:58:55 +0000 (19:58 +0000)]
[mips/broadcom] Move MIPS-specific bhnd(4) nexus drivers to
sys/mips/broadcom, and add MIPS/BCM4706-specific workaround to
bhnd_nexus_is_hw_disabled() -- the BCM4706 low-cost package leaves
secondary GMAC cores floating.

Reviewed by: mizhka
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D9499

7 years agoMake <sys/event.h> work on its own.
Ed Schouten [Mon, 13 Feb 2017 19:00:09 +0000 (19:00 +0000)]
Make <sys/event.h> work on its own.

Right now this header file doesn't want to build when included on its
own, as it depends on some integer types that are only declared
internally. Switch it over to use <sys/_types.h> and the __*
counterparts.

7 years agoFix typo where opening brace was needed.
Stephen J. Kiernan [Mon, 13 Feb 2017 18:52:26 +0000 (18:52 +0000)]
Fix typo where opening brace was needed.

Reported by: Michael Butler
Reviewed by: sjg
Approved by: sjg (mentor)

7 years agoFor MD_PRELOAD type md(4) devices, if there is a file name in the preloaded
Stephen J. Kiernan [Mon, 13 Feb 2017 17:44:07 +0000 (17:44 +0000)]
For MD_PRELOAD type md(4) devices, if there is a file name in the preloaded
meta-data, copy it into the softc structure.

When returning md(4) device details to the caller, include the file name in
any MD_PRELOAD type devices if it is set (first character is not NUL.)

In mdconfig, for "preload" type md(4) devices, if there is file config
available, print it in the file column of the output.

Reviewed by: brooks
Approved by: sjg (mentor)
MFC after: 1 month
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D9529

7 years agoRemove IPsec related PCB code from SCTP.
Andrey V. Elsukov [Mon, 13 Feb 2017 11:37:52 +0000 (11:37 +0000)]
Remove IPsec related PCB code from SCTP.

The inpcb structure has inp_sp pointer that is initialized by
ipsec_init_pcbpolicy() function. This pointer keeps strorage for IPsec
security policies associated with a specific socket.
An application can use IP_IPSEC_POLICY and IPV6_IPSEC_POLICY socket
options to configure these security policies. Then ip[6]_output()
uses inpcb pointer to specify that an outgoing packet is associated
with some socket. And IPSEC_OUTPUT() method can use a security policy
stored in the inp_sp. For inbound packet the protocol-specific input
routine uses IPSEC_CHECK_POLICY() method to check that a packet conforms
to inbound security policy configured in the inpcb.

SCTP protocol doesn't specify inpcb for ip[6]_output() when it sends
packets. Thus IPSEC_OUTPUT() method does not consider such packets as
associated with some socket and can not apply security policies
from inpcb, even if they are configured. Since IPSEC_CHECK_POLICY()
method is called from protocol-specific input routine, it can specify
inpcb pointer and associated with socket inbound policy will be
checked. But there are two problems:
1. Such check is asymmetric, becasue we can not apply security policy
from inpcb for outgoing packet.
2. IPSEC_CHECK_POLICY() expects that caller holds INPCB lock and
access to inp_sp is protected. But for SCTP this is not correct,
becasue SCTP uses own locks to protect inpcb.

To fix these problems remove IPsec related PCB code from SCTP.
This imply that IP_IPSEC_POLICY and IPV6_IPSEC_POLICY socket options
will be not applicable to SCTP sockets. To be able correctly check
inbound security policies for SCTP, mark its protocol header with
the PR_LASTHDR flag.

Reported by: tuexen
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D9538

7 years agoRework r313352.
Konstantin Belousov [Mon, 13 Feb 2017 09:04:38 +0000 (09:04 +0000)]
Rework r313352.

Rename kern_vm_* functions to kern_*.  Move the prototypes to
syscallsubr.h.  Also change Mach VM types to uintptr_t/size_t as
needed, to avoid headers pollution.

Requested by: alc, jhb
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D9535

7 years agoMFV r313676: libpcap 1.8.1
Xin LI [Mon, 13 Feb 2017 08:23:39 +0000 (08:23 +0000)]
MFV r313676: libpcap 1.8.1

MFC after: 1 month

7 years agoiwi: add 12-14 2GHz channels into channel list.
Andriy Voskoboinyk [Mon, 13 Feb 2017 02:15:56 +0000 (02:15 +0000)]
iwi: add 12-14 2GHz channels into channel list.

Return full channel list via iwi_getradiocaps() method
(ieee80211_init_channels() was replaced with iwi_getradiocaps()
to be consistent with other drivers).

PR: 216923
Submitted and tested by: ds@ukrhub.net (original patch)
MFC after: 5 days

7 years agoRemove MPSAFE and ARGUSED annotations, ANSI-fy syscall handlers.
Konstantin Belousov [Mon, 13 Feb 2017 00:40:55 +0000 (00:40 +0000)]
Remove MPSAFE and ARGUSED annotations, ANSI-fy syscall handlers.

Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoStyle: wrap long line.
Konstantin Belousov [Mon, 13 Feb 2017 00:39:43 +0000 (00:39 +0000)]
Style: wrap long line.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoOnly trigger em_local_timer on queue index 0. This was causing continuous
Sean Bruno [Sun, 12 Feb 2017 23:06:41 +0000 (23:06 +0000)]
Only trigger em_local_timer on queue index 0.  This was causing continuous
em_local_timer() executions during normal operation and was very likely
to cause a lock up on igb(4) devices.

Submitted by: Matt Macy (mmacy@nextbsd.org)
Reported by: jtl
Reviewed by: gallatin
Sponsored by: Limelight Networks & Netflix

7 years agoConsistently handle negative or wrapping offsets in the mmap(2) syscalls.
Konstantin Belousov [Sun, 12 Feb 2017 21:05:44 +0000 (21:05 +0000)]
Consistently handle negative or wrapping offsets in the mmap(2) syscalls.

For regular files and posix shared memory, POSIX requires that
[offset, offset + size) range is legitimate.  At the maping time,
check that offset is not negative.  Allowing negative offsets might
expose the data that filesystem put into vm_object for internal use,
esp. due to OFF_TO_IDX() signess treatment.  Fault handler verifies
that the mapped range is valid, assuming that mmap(2) checked that
arithmetic gives no undefined results.

For device mappings, leave the semantic of negative offsets to the
driver.  Correct object page index calculation to not erronously
propagate sign.

In either case, disallow overflow of offset + size.

Update mmap(2) man page to explain the requirement of the range
validity, and behaviour when the range becomes invalid after mapping.

Reported and tested by: royger (previous version)
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoSwitch copyout_map() to use vm_mmap_object() instead of vm_mmap().
Konstantin Belousov [Sun, 12 Feb 2017 20:54:31 +0000 (20:54 +0000)]
Switch copyout_map() to use vm_mmap_object() instead of vm_mmap().

This is both a microoptimization and a move of the consumer to more
commonly used vm function.

Suggested and reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoremove l2_padding_needed statistic from zfs arc
Andriy Gapon [Sun, 12 Feb 2017 19:45:30 +0000 (19:45 +0000)]
remove l2_padding_needed statistic from zfs arc

It became obsolete when the Compressed ARC support was committed.

MFC after: 1 week

7 years agocheck remaining space in zfs implementations of vptocnp
Andriy Gapon [Sun, 12 Feb 2017 19:40:59 +0000 (19:40 +0000)]
check remaining space in zfs implementations of vptocnp

PR: 216939
Submitted by: Iouri V. Ivliev <fbsd@any.com.ru>
MFC after: 1 week

7 years agoFix r313284.
Dmitry Chagin [Sun, 12 Feb 2017 15:22:50 +0000 (15:22 +0000)]
Fix r313284.

Members of the syscall argument structures are padded to a word size. So,
for COMPAT_LINUX32 we should convert user supplied system call arguments
which is 32-bit in that case to the array of register_t.

Reported by: Oleg V. Nauman
MFC after: 1 week

7 years agolockmgr: implement fast path
Mateusz Guzik [Sun, 12 Feb 2017 09:49:44 +0000 (09:49 +0000)]
lockmgr: implement fast path

The main lockmgr routine takes 8 arguments which makes it impossible to
tail-call it by the intermediate vop_stdlock/unlock routines.

The routine itself starts with an if-forest and reads from the lock itself
several times.

This slows things down both single- and multi-threaded. With the patch
single-threaded fstats go 4% up and multithreaded up to ~27%.

Note that there is still a lot of room for improvement.

Reviewed by: kib
Tested by: pho

7 years agoUse SRCTOP/OBJTOP relative paths where possible; use :H manipulation in lieu
Enji Cooper [Sun, 12 Feb 2017 08:36:47 +0000 (08:36 +0000)]
Use SRCTOP/OBJTOP relative paths where possible; use :H manipulation in lieu
of ../ elsewhere

This simplifies pathing in make/displayed output

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoVendor import of libpcap 1.8.1.
Xin LI [Sun, 12 Feb 2017 07:04:44 +0000 (07:04 +0000)]
Vendor import of libpcap 1.8.1.

7 years agoCommitted without approval from mentor.
Ermal Luçi [Sun, 12 Feb 2017 06:56:33 +0000 (06:56 +0000)]
Committed without approval from mentor.

Reported by: gnn

7 years agoEnable usb low and full speed devices connected to the imx6 root hubs.
Ian Lepore [Sun, 12 Feb 2017 00:52:22 +0000 (00:52 +0000)]
Enable usb low and full speed devices connected to the imx6 root hubs.

This enables the PHY circuitry for UTMI+ level 2 and 3, and sets the
flag to tell the ehci code that the root hub has a transaction translator
in it.  For imx6 we can use the standard ehci_get_port_speed_portsc()
function to find out what speed device is connected to the port.

7 years agoRemove spaces at end of line
Baptiste Daroussin [Sat, 11 Feb 2017 23:45:50 +0000 (23:45 +0000)]
Remove spaces at end of line

Reported by: make manlint
MFC after: 2 days

7 years agoRemove useless Li macro
Baptiste Daroussin [Sat, 11 Feb 2017 23:45:10 +0000 (23:45 +0000)]
Remove useless Li macro

Reported by: make manlint
MFC after: 2 days

7 years agoUse correct date format
Baptiste Daroussin [Sat, 11 Feb 2017 23:44:37 +0000 (23:44 +0000)]
Use correct date format

Reported by: make manlint
MFC after: 2 days

7 years agoEscape Sm to avoid confusion with Sm macro
Baptiste Daroussin [Sat, 11 Feb 2017 23:43:12 +0000 (23:43 +0000)]
Escape Sm to avoid confusion with Sm macro

Reported by: make manlint
MFC after: 2 days

7 years agoProperly use .An macro before Authors name
Baptiste Daroussin [Sat, 11 Feb 2017 23:42:33 +0000 (23:42 +0000)]
Properly use .An macro before Authors name

Reported by: make manlint
MFC after: 2 days

7 years agoAdd missing section in manpage reference
Baptiste Daroussin [Sat, 11 Feb 2017 23:41:38 +0000 (23:41 +0000)]
Add missing section in manpage reference

Reported by: make manlint
MFC after: 2 days

7 years agoRemove spaces at EOL and sort correctly the SEE ALSO section
Baptiste Daroussin [Sat, 11 Feb 2017 23:40:57 +0000 (23:40 +0000)]
Remove spaces at EOL and sort correctly the SEE ALSO section

Reported by: make manlint
MFC after: 2 days

7 years agoRemove empty space at EOL and escept Ed
Baptiste Daroussin [Sat, 11 Feb 2017 23:39:56 +0000 (23:39 +0000)]
Remove empty space at EOL and escept Ed

Reported by: make manlint
MFC after: 2 days

7 years agoRemove useless .Pp after the .Sh macro and remove empty line
Baptiste Daroussin [Sat, 11 Feb 2017 23:39:14 +0000 (23:39 +0000)]
Remove useless .Pp after the .Sh macro and remove empty line

Reported by: make manlint
MFC after: 2 days

7 years agoEscape No to avoid confusion with the No macro
Baptiste Daroussin [Sat, 11 Feb 2017 23:38:28 +0000 (23:38 +0000)]
Escape No to avoid confusion with the No macro

Reported by: make manlint
MFC after: 2 days

7 years agoAdd missing section after .Xr reference
Baptiste Daroussin [Sat, 11 Feb 2017 23:37:48 +0000 (23:37 +0000)]
Add missing section after .Xr reference

Reported by: make manlint
MFC after: 2 days

7 years agoAdd missing -width after -Bl -tag
Baptiste Daroussin [Sat, 11 Feb 2017 23:36:52 +0000 (23:36 +0000)]
Add missing -width after -Bl -tag

Reported by: make manlint
MFC after: 2 days

7 years agoEscape Ss to avoid confusion by mdoc parser with the Ss macro
Baptiste Daroussin [Sat, 11 Feb 2017 23:14:28 +0000 (23:14 +0000)]
Escape Ss to avoid confusion by mdoc parser with the Ss macro

Reported by: make manlint
MFC after: 2 days

7 years agoRemove empty Li
Baptiste Daroussin [Sat, 11 Feb 2017 23:09:50 +0000 (23:09 +0000)]
Remove empty Li

Reported by: make manlint
MFC after: 2 days

7 years agoRemove space at and of line
Baptiste Daroussin [Sat, 11 Feb 2017 23:06:53 +0000 (23:06 +0000)]
Remove space at and of line

Reported by: make manlint
MFC after: 2 days

7 years agoRevert r313565 -- :mmap__bad_arguments passes again after r313655
Enji Cooper [Sat, 11 Feb 2017 20:31:57 +0000 (20:31 +0000)]
Revert r313565 -- :mmap__bad_arguments passes again after r313655

PR: 216976
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP to define .include with usr.bin/Makefile.inc
Enji Cooper [Sat, 11 Feb 2017 20:27:53 +0000 (20:27 +0000)]
Use SRCTOP to define .include with usr.bin/Makefile.inc

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoChange type of the prot parameter for kern_vm_mmap() from vm_prot_t to int.
Konstantin Belousov [Sat, 11 Feb 2017 20:27:39 +0000 (20:27 +0000)]
Change type of the prot parameter for kern_vm_mmap() from vm_prot_t to int.

This makes the code to pass whole word of the mmap(2) syscall argument
prot to the syscall helper kern_vm_mmap(), which can validate all
bits.  The change provides temporal fix for sys/vm/mmap_test
mmap__bad_arguments, which was broken after r313352.

PR: 216976
Reported and tested by: ngie
Sponsored by: The FreeBSD Foundation

7 years agoUse SRCTOP to refer to awk source in contrib/awk and remove unnecessary AWKSRC prefix
Enji Cooper [Sat, 11 Feb 2017 20:27:06 +0000 (20:27 +0000)]
Use SRCTOP to refer to awk source in contrib/awk and remove unnecessary AWKSRC prefix
for maketab.c

The former simplifies pathing in make/displayed output, whereas the latter was just
unnecessarily superfluous since .PATH referenced the path to maketab.c earlier on in
the Makefile.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP instead of .CURDIR relative paths with ".."
Enji Cooper [Sat, 11 Feb 2017 20:19:04 +0000 (20:19 +0000)]
Use SRCTOP instead of .CURDIR relative paths with ".."

This simplifies pathing in make/displayed output

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP instead of .CURDIR relative paths with ".."
Enji Cooper [Sat, 11 Feb 2017 20:18:24 +0000 (20:18 +0000)]
Use SRCTOP instead of .CURDIR relative paths with ".."

This simplifies pathing in make/displayed output

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoManipulate OBJDIR with :H when referencing dso directory
Enji Cooper [Sat, 11 Feb 2017 20:14:50 +0000 (20:14 +0000)]
Manipulate OBJDIR with :H when referencing dso directory

This reduces path lengths, etc in memory with make by a minimal value

Sponsored by: Dell EMC Isilon

7 years agoUse SRCTOP/OBJTOP and simplify output using :H instead of "../" for directory
Enji Cooper [Sat, 11 Feb 2017 20:12:54 +0000 (20:12 +0000)]
Use SRCTOP/OBJTOP and simplify output using :H instead of "../" for directory
entries

This simplifies pathing in make/displayed output

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agopciconf(8): Replace an assert with errx
Conrad Meyer [Sat, 11 Feb 2017 18:04:43 +0000 (18:04 +0000)]
pciconf(8): Replace an assert with errx

The condition can be hit with simple user input, so it isn't an invariant.
Just error out.

PR: 217003
Reported by: Vladislav V. Prodan <admin at support.od.ua>
Sponsored by: Dell EMC Isilon

7 years agoDon't zero out srtt after excess retransmits
Ryan Stone [Sat, 11 Feb 2017 17:05:08 +0000 (17:05 +0000)]
Don't zero out srtt after excess retransmits

If the TCP stack has retransmitted more than 1/4 of the total
number of retransmits before a connection drop, it decides that
its current RTT estimate is hopelessly out of date and decides
to recalculate it from scratch starting with the next ACK.

Unfortunately, it implements this by zeroing out the current RTT
estimate.  Drop this hack entirely, as it makes it significantly more
difficult to debug connection issues.  Instead check for excessive
retransmits at the point where srtt is updated from an ACK being
received.  If we've exceeded 1/4 of the maximum retransmits,
discard the previous srtt estimate and replace it with the latest
rtt measurement.

Differential Revision: https://reviews.freebsd.org/D9519
Reviewed by: gnn
Sponsored by: Dell EMC Isilon

7 years agoloader: implement MEDIA_FILEPATH_DP support in efipart
Toomas Soome [Sat, 11 Feb 2017 15:25:49 +0000 (15:25 +0000)]
loader: implement MEDIA_FILEPATH_DP support in efipart

The efipart rework did break the ARM systems as the new code is
using more exact filters to sort the devices and we need to
add support for MEDIA_FILEPATH_DP device paths.

PR: 216940
Reported by: karl@denninger.net
Reviewed by: allanjude, manu
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D9520

7 years ago[net80211] add a sysctl that forces a vap restart.
Adrian Chadd [Sat, 11 Feb 2017 05:33:49 +0000 (05:33 +0000)]
[net80211] add a sysctl that forces a vap restart.

Well, vap restart really does "all restart" for now, which will be a good
way of debugging firmware restart issues.

7 years agoAdding myself to committers-ports.dot and calendar.freebsd
Mahdi Mokhtari [Sat, 11 Feb 2017 05:19:45 +0000 (05:19 +0000)]
Adding myself to committers-ports.dot and calendar.freebsd

Submitted by: mmokhi
Approved by: feld, mat (mentors)
Differential Revision: https://reviews.freebsd.org/D9528

7 years agoRemove sys/boot/pc98 accidentally restored in r313575
Ed Maste [Sat, 11 Feb 2017 02:45:54 +0000 (02:45 +0000)]
Remove sys/boot/pc98 accidentally restored in r313575

Reported by: rpokala

7 years agomakefs: make the buffer functions look exactly like the kernel ones
Ed Maste [Sat, 11 Feb 2017 02:33:48 +0000 (02:33 +0000)]
makefs: make the buffer functions look exactly like the kernel ones

From NetBSD christos Sat Jan 26 00:19:39 2013 +0000

make the buffer functions look exactly like the kernel ones and add other
cruft to make the kernel files compile.

ffs.c 1.54
ffs/buf.c 1.13
ffs/buf.h 1.3
ffs/ffs_alloc.c 1.21
ffs/ffs_balloc.c 1.15

Reviewed by: marcel, ngie
Obtained from: NetBSD
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8404

7 years agoStop including sys/types.h from arm's machine/atomic.h, fix the places
Ian Lepore [Sat, 11 Feb 2017 01:07:46 +0000 (01:07 +0000)]
Stop including sys/types.h from arm's machine/atomic.h, fix the places
where atomic.h was being included without ensuring that types.h (via
param.h) was included first, as required by atomic(9).

7 years agoMFV r313569:313569:313569:
Martin Matuska [Sat, 11 Feb 2017 01:00:58 +0000 (01:00 +0000)]
MFV r313569:313569:313569:
Sync libarchive with vendor

Vendor bugfixes:
cpio reader sanity fix (OSS-Fuzz 504)
WARC reader sanity fixes (OSS-Fuzz 511, 526, 532, 552)
mtree reader time parsing fix (OSS-Fuzz 538)
XAR reader memleak fix (OSS-Fuzz 551)

MFC after: 1 week

7 years agoUpdate vendor/libarchive to git b3bd0b81a1a06909f766dea8be4072ef81de62b8
Martin Matuska [Fri, 10 Feb 2017 23:12:38 +0000 (23:12 +0000)]
Update vendor/libarchive to git b3bd0b81a1a06909f766dea8be4072ef81de62b8

Vendor bugfixes:
cpio reader sanity fix (OSS-Fuzz 504)
WARC reader sanity fixes (OSS-Fuzz 511, 526, 532, 552)
mtree reader time parsing fix (OSS-Fuzz 538)
XAR reader memleak fix (OSS-Fuzz 551)

7 years agoChange the isp(4) driver to not adjust the tag type for REQUEST SENSE.
Kenneth D. Merry [Fri, 10 Feb 2017 22:02:45 +0000 (22:02 +0000)]
Change the isp(4) driver to not adjust the tag type for REQUEST SENSE.

The isp(4) driver was changing the tag type for REQUEST SENSE
commands to Head of Queue, when the CAM CCB flag
CAM_TAG_ACTION_VALID was NOT set.  CAM_TAG_ACTION_VALID is set
when the tag action in the XPT_SCSI_IO is not CAM_TAG_ACTION_NONE
and when the target has tagged queueing turned on.

In most cases when CAM_TAG_ACTION_VALID is not set, it is because
the target is not doing tagged queueing.  In those cases, trying to
send a Head of Queue tag may cause problems.  Instead, default to
sending a simple tag.

IBM tape drives claim to support tagged queueing in their standard
Inquiry data, but have the DQue bit set in the control mode page
(mode page 10).  CAM correctly detects that these drives do not
support tagged queueing, and clears the CAM_TAG_ACTION_VALID flag
on CCBs sent down to the drives.

This caused the isp(4) driver to go down the path of setting the
tag action to a default value, and for Request Sense commands only,
set the tag action to Head of Queue.

If an IBM tape drive does get a Head of Queue tag, it rejects it with
Invalid Message Error (0x49,0x00).  (The Qlogic firmware translates that
to a Transport Error, which the driver translates to an Unrecoverable
HBA Error, or CAM_UNREC_HBA_ERROR.) So, by default, it wasn't possible
to get a good response from a REQUEST SENSE to an FC-attached IBM
tape drive with the isp(4) driver.

IBM tape drives (tested on an LTO-5 with G9N1 firmware and a TS1150
with 4470 firmware) also have a bug in that sending a command with a
non-simple tag attribute breaks the tape drive's Command Reference
Number (CRN) accounting and causes it to ignore all subsequent
commands because it and the initiator disagree about the next
expected CRN.  The drives do reject the initial command with a head
of queue tag with an Invalid Message Error (0x49,0x00), but after that
they ignore any subsequent commands.  IBM confirmed that it is a bug,
and sent me test firmware that fixes the bug.  However tape drives in
the field will still exhibit the bug until they are upgraded.

Request Sense is not often sent to targets because most errors are
reported automatically through autosense in Fibre Channel and other
modern transports.  ("Modern" meaning post SCSI-2.)  So this is not
an error that would crop up frequently.  But Request Sense is useful on
tape devices to report status information, aside from error reporting.

This problem is less serious without FC-Tape features turned on,
specifically precise delivery of commands (which enables Command
Reference Numbers), enabled on the target and initiator.  Without
FC-Tape features turned on, the target would return an error and
things would continue on.

And it also does not cause problems for targets that do tagged
queueing, because in those cases the isp(4) driver just uses the
tag type that is specified in the CCB, assuming the
CAM_TAG_ACTION_VALID flag is set, and defaults to sending a Simple
tag action if it isn't an ordered or head of queue tag.

sys/dev/isp/isp.c:
In isp_start(), don't try to send Request Sense commands
with the Head of Queue tag attribute if the CCB doesn't
have a valid tag action.  The tag action likely isn't valid
because the target doesn't support tagged queueing.

Sponsored by: Spectra Logic
MFC after: 3 days

7 years agoRegenerate all the system call tables to drop "created from" lines.
John Baldwin [Fri, 10 Feb 2017 19:45:02 +0000 (19:45 +0000)]
Regenerate all the system call tables to drop "created from" lines.

One of the ibcs2 files contains some actual changes (new headers) as
it hasn't been regenerated after older changes to makesyscalls.sh.

7 years agoExpect :mmap__bad_arguments to fail
Enji Cooper [Fri, 10 Feb 2017 19:31:09 +0000 (19:31 +0000)]
Expect :mmap__bad_arguments to fail

Some recent changes to vm related to mmap(2) have broken the prot checks that
would result with an EINVAL with this case

I suspect r313352 is the root-cause the issue

PR: 216976
Sponsored by: Dell EMC Isilon

7 years agoDrop the "created from" line from files generated by makesyscalls.sh.
John Baldwin [Fri, 10 Feb 2017 19:25:52 +0000 (19:25 +0000)]
Drop the "created from" line from files generated by makesyscalls.sh.

This information is less useful when the generated files are included in
source control along with the source.  If needed it can be reconstructed
from the $FreeBSD$ tag in the generated file.  Removing this information
from the generated output permits committing the generated files along
with the change to the system call master list without having inconsistent
metadata in the generated files.

Reviewed by: emaste, kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D9497

7 years agokldxref: bump MAXSEGS to 3
Ed Maste [Fri, 10 Feb 2017 19:17:10 +0000 (19:17 +0000)]
kldxref: bump MAXSEGS to 3

ld.bfd generates two PT_LOAD segments, but certain linkers or linker
configurations generate three PT_LOAD segments (one additional for
RELRO).

PR: 216975
Reported by: Shawn Webb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agokldxref: s/sections/segments/ in warning message
Ed Maste [Fri, 10 Feb 2017 19:11:33 +0000 (19:11 +0000)]
kldxref: s/sections/segments/ in warning message

The message refers to program header segments, not sections.

PR: 216975

7 years agoMove tcp_fields_to_net() static inline into tcp_var.h, just below its
Gleb Smirnoff [Fri, 10 Feb 2017 17:46:26 +0000 (17:46 +0000)]
Move tcp_fields_to_net() static inline into tcp_var.h, just below its
friend tcp_fields_to_host(). There is third party code that also uses
this inline.

Reviewed by: ae

7 years agoLast consumer of _WANT_RTENTRY gone.
Gleb Smirnoff [Fri, 10 Feb 2017 17:37:04 +0000 (17:37 +0000)]
Last consumer of _WANT_RTENTRY gone.

7 years agoDon't check struct rtentry on FreeBSD, it is an internal kernel structure.
Gleb Smirnoff [Fri, 10 Feb 2017 17:34:48 +0000 (17:34 +0000)]
Don't check struct rtentry on FreeBSD, it is an internal kernel structure.
On other systems it may be API structure for SIOCADDRT/SIOCDELRT.

Reviewed by: emaste, dim

7 years agoAllow Dtrace to be compiled into the kernel again after r313177.
Bjoern A. Zeeb [Fri, 10 Feb 2017 16:06:14 +0000 (16:06 +0000)]
Allow Dtrace to be compiled into the kernel again after r313177.

MFC after: 1 week

7 years agoChange mlx4 QP allocation scheme.
Hans Petter Selasky [Fri, 10 Feb 2017 15:28:18 +0000 (15:28 +0000)]
Change mlx4 QP allocation scheme.

When using Blue-Flame, BF, the QPN overrides the VLAN, CV, and SV
fields in the WQE. Thus, BF may only be used for QPNs with bits 6,7
unset.

The current ethernet driver code reserves a TX QP range with 256b
alignment.

This is wrong because if there are more than 64 TX QPs in use, QPNs >=
base + 65 will have bits 6/7 set.

This problem is not specific for the Ethernet driver, any entity that
tries to reserve more than 64 BF-enabled QPs should fail. Also, using
ranges is not necessary here and is wasteful.

The new mechanism introduced here will support reservation for "Eth
QPs eligible for BF" for all drivers: bare-metal, multi-PF, and VFs
(when hypervisors support WC in VMs). The flow we use is:

1. In mlx4_en, allocate Tx QPs one by one instead of a range allocation,
   and request "BF enabled QPs" if BF is supported for the function

2. In the ALLOC_RES FW command, change param1 to:
a. param1[23:0]  - number of QPs
b. param1[31-24] - flags controlling QPs reservation

Bit 31 refers to Eth blueflame supported QPs. Those QPs must have bits
6 and 7 unset in order to be used in Ethernet.

Bits 24-30 of the flags are currently reserved.

When a function tries to allocate a QP, it states the required
attributes for this QP. Those attributes are considered "best-effort".
If an attribute, such as Ethernet BF enabled QP, is a must-have
attribute, the function has to check that attribute is supported
before trying to do the allocation.

In a lower layer of the code, mlx4_qp_reserve_range masks out the bits
which are unsupported. If SRIOV is used, the PF validates those
attributes and masks out unsupported attributes as well. In order to
notify VFs which attributes are supported, the VF uses QUERY_FUNC_CAP
command. This command's mailbox is filled by the PF, which notifies
which QP allocation attributes it supports.

Obtained from: Linux (dual BSD/GPLv2 licensed)
Submitted by: Dexuan Cui @ microsoft . com
Differential Revision: https://reviews.freebsd.org/D8868
MFC after: 2 weeks
Sponsored by: Mellanox Technologies

7 years agoFlexible and asymmetric allocation of EQs and MSI-X vectors for PF/VFs.
Hans Petter Selasky [Fri, 10 Feb 2017 15:22:21 +0000 (15:22 +0000)]
Flexible and asymmetric allocation of EQs and MSI-X vectors for PF/VFs.

Previously, the mlx4 driver queried the firmware in order to get the
number of supported EQs. Under SRIOV, since this was done before the
driver notified the firmware how many VFs it actually needs, the
firmware had to take into account a worst case scenario and always
allocated four EQs per VF, where one was used for events while the
others were used for completions. Now, when the firmware supports the
asymmetric allocation scheme, denoted by exposing num_sys_eqs > 0 (-->
MLX4_DEV_CAP_FLAG2_SYS_EQS), we use the QUERY_FUNC command to query
the firmware before enabling SRIOV. Thus we can get more EQs and MSI-X
vectors per function. Moreover, when running in the new
firmware/driver mode, the limitation that the number of EQs should be
a power of two is lifted.

Obtained from: Linux (dual BSD/GPLv2 licensed)
Submitted by: Dexuan Cui @ microsoft . com
Differential Revision: https://reviews.freebsd.org/D8867
MFC after: 2 weeks
Sponsored by: Mellanox Technologies

7 years agoClean redundant MIN/MAX declarations in some HighPoint drivers.
Pedro F. Giffuni [Fri, 10 Feb 2017 15:18:41 +0000 (15:18 +0000)]
Clean redundant MIN/MAX declarations in some HighPoint drivers.

The hpt27xx(4), hptnr(4), and hptrr(4) drivers declare MIN() and MAX()
internally which match the macros from sys/param.h.

MIN() is not used, MAX is only used once and can be replaced with the
max() version in libkern.h which operates on u_ints.

MFC after: 2 weeks

7 years agoFix r313495.
Konstantin Belousov [Fri, 10 Feb 2017 14:49:04 +0000 (14:49 +0000)]
Fix r313495.

The file type DTYPE_VNODE can be assigned as a fallback if VOP_OPEN()
did not initialized file type.  This is a typical code path used by
normal file systems.

Also, change error returned for inappropriate file type used for
O_EXLOCK to EOPNOTSUPP, as declared in the open(2) man page.

Reported by: cy, dhw, Iblis Lin <iblis@hs.ntnu.edu.tw>
Tested by: dhw
Sponsored by: The FreeBSD Foundation
MFC after: 13 days

7 years agoo Reset mouse selection when new lines reach selection lines.
Aleksandr Rybalko [Fri, 10 Feb 2017 13:28:30 +0000 (13:28 +0000)]
o Reset mouse selection when new lines reach selection lines.
o Fix how selection handled on display.

Submitted by: hselasky
Reviewed by: hselasky, emaste(previous version)
Todo: track mouse select direction.