]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoUse SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
Enji Cooper [Fri, 20 Jan 2017 03:27:47 +0000 (03:27 +0000)]
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones

This implifies pathing in make/displayed output

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoReplace dot-dot relative pathing with SRCTOP-relative paths where possible
Enji Cooper [Fri, 20 Jan 2017 03:23:24 +0000 (03:23 +0000)]
Replace dot-dot relative pathing with SRCTOP-relative paths where possible

This reduces build output, need for recalculating paths, and makes it clearer
which paths are relative to what areas in the source tree. The change in
performance over a locally mounted UFS filesystem was negligible in my testing,
but this may more positively impact other filesystems like NFS.

LIBC_SRCTOP was left alone so Juniper (and other users) can continue to
manipulate lib/libc/Makefile (and other Makefile.inc's under lib/libc) as
include Makefiles with custom options.

Discussed with: marcel, sjg
MFC after: 1 week
Reviewed by: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9207

7 years agoRemove obsolete /usr/lib/debug/usr/lib/private dir
Ed Maste [Fri, 20 Jan 2017 03:14:18 +0000 (03:14 +0000)]
Remove obsolete /usr/lib/debug/usr/lib/private dir

Missed in r282420

Reported by: dim

7 years agolibc: remove reference to nonexistent lib/locale directory
Ed Maste [Fri, 20 Jan 2017 02:09:59 +0000 (02:09 +0000)]
libc: remove reference to nonexistent lib/locale directory

As far as I can tell this was introduced in r72406 and updated in several
subsequent revisions, but the lib/locale directory it referenced never
existed.

Reviewed by: ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9252

7 years agomppc - Finish pluging NETGRAPH_MPPC_COMPRESSION.
Pedro F. Giffuni [Fri, 20 Jan 2017 00:02:11 +0000 (00:02 +0000)]
mppc - Finish pluging NETGRAPH_MPPC_COMPRESSION.

There were several places where reference to compression were left
unfinished. Furthermore, KASSERTs contained references to MPPC_INVALID
which is not defined in the tree and therefore were sure to break with
INVARIANTS: comment them out.

Reported by: Eugene Grosbein
PR: 216265
MFC after: 3 days

7 years agoMerge ACPICA 20170119.
Jung-uk Kim [Thu, 19 Jan 2017 22:07:21 +0000 (22:07 +0000)]
Merge ACPICA 20170119.

7 years agoRework the debug print API. Event printing no longer gets special handling.
Scott Long [Thu, 19 Jan 2017 21:47:50 +0000 (21:47 +0000)]
Rework the debug print API. Event printing no longer gets special handling.
All of the printing from the tables file now has wrappers so that the
handling is cleaner and it's possible to print something out (say, during
development) without having to fight the global debug flags. This re-org
will also make it easier to have the tables be compiled out at build time
if desired.

Other than fixing some minor bugs, there are no user-visible changes from
this change

Sponsored by: Netflix, Inc.
Differential Revision: D9238

7 years agoRemove mistakenly merged field.
Konstantin Belousov [Thu, 19 Jan 2017 20:03:26 +0000 (20:03 +0000)]
Remove mistakenly merged field.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdjust gtaskqueue startup again so that we catch the !SMP case and
Sean Bruno [Thu, 19 Jan 2017 19:58:08 +0000 (19:58 +0000)]
Adjust gtaskqueue startup again  so that we catch the !SMP case and
users that choose not to use EARLY_AP_STARTUP.

There is still an initialization issue/panic with !SMP and !EARLY_AP_STARTUP
that we have yet to resolve.

Submitted by: bde

7 years agoAdd mount option for tmpfs(5) to not use namecache.
Konstantin Belousov [Thu, 19 Jan 2017 19:46:49 +0000 (19:46 +0000)]
Add mount option for tmpfs(5) to not use namecache.

The option "nonc" disables using of namecache for the created mount,
by default namecache is used.  The rationale for the option is that
namecache duplicates the information which is already kept in memory
by tmpfs.  Since it believed that namecache scales better than tmpfs,
or will scale better, do not enable the option by default.  On the
other hand, smaller machines may benefit from lesser namecache
pressure.

Discussed with: mjg
Tested by: pho (as part of larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoImport ACPICA 20170119.
Jung-uk Kim [Thu, 19 Jan 2017 19:46:15 +0000 (19:46 +0000)]
Import ACPICA 20170119.

7 years agoImplement VOP_VPTOCNP() for tmpfs.
Konstantin Belousov [Thu, 19 Jan 2017 19:29:13 +0000 (19:29 +0000)]
Implement VOP_VPTOCNP() for tmpfs.

For directories, node->tn_spec.tn_dir.tn_parent pointer to the parent
is used.  For non-directories, the implementation is naive, all
directory nodes are scanned to find a dirent linking the specified
node.  This can be significantly improved by maintaining tn_parent for
all nodes, later.

Tested by: pho (as part of larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoVNON nodes cannot exist.
Konstantin Belousov [Thu, 19 Jan 2017 19:25:42 +0000 (19:25 +0000)]
VNON nodes cannot exist.

Tested by: pho (as part of larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoRefcount tmpfs nodes and mount structures.
Konstantin Belousov [Thu, 19 Jan 2017 19:15:21 +0000 (19:15 +0000)]
Refcount tmpfs nodes and mount structures.

On dotdot lookup and fhtovp operations, it is possible for the file
represented by tmpfs node to be removed after the thread calculated
the pointer.  In this case, tmpfs_alloc_vp() accesses freed memory.

Introduce the reference count on the nodes.  The allnodes list from
tmpfs mount owns 1 reference, and threads performing unlocked
operations on the node, add one transient reference.  Similarly, since
struct tmpfs_mount maintains the list where nodes are enlisted,
refcount it by one reference from struct mount and one reference from
each node on the list.  Both nodes and tmpfs_mounts are removed when
refcount goes to zero.

Note that this means that nodes and tmpfs_mounts might survive some
time after the node is deleted or tmpfs_unmount() finished.  The
tmpfs_alloc_vp() in these cases returns error either due to node
removal (tn_nlinks == 0) or because of insmntque1(9) error.

Tested by: pho (as part of larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoe1000: Add support for Kaby Lake generation i219 (4) and i219 (5) devices
Eric Joyner [Thu, 19 Jan 2017 18:52:38 +0000 (18:52 +0000)]
e1000: Add support for Kaby Lake generation i219 (4) and i219 (5) devices

MFC after: 1 week
Sponsored by: Intel Corporation

7 years agofix a thread preemption regression in schedulers introduced in r270423
Andriy Gapon [Thu, 19 Jan 2017 18:46:41 +0000 (18:46 +0000)]
fix a thread preemption regression in schedulers introduced in r270423

Commit r270423 fixed a regression in sched_yield() that was introduced
in earlier changes.  Unfortunately, at the same time it introduced an
new regression.  The problem is that SWT_RELINQUISH (6), like all other
SWT_* constants and unlike SW_* flags, is not a bit flag.  So, (flags &
SWT_RELINQUISH) is true in cases where that was not really indended,
for example, with SWT_OWEPREEMPT (2) and SWT_REMOTEPREEMPT (11).

A straight forward fix would be to use (flags & SW_TYPE_MASK) ==
SWT_RELINQUISH, but my impression is that the switch types are designed
mostly for gathering statistics, not for influencing scheduling
decisions.

So, I decided that it would be better to check for SW_PREEMPT flag
instead.  That's also the same flag that was checked before r239157.
I double-checked how that flag is used and I am confident that the flag
is set only in the places where we really have the preemption:
- critical_exit + td_owepreempt
- sched_preempt in the ULE scheduler
- sched_preempt in the 4BSD scheduler

Reviewed by: kib, mav
MFC after: 4 days
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D9230

7 years agoMake tmpfs directory cursor available outside tmpfs_subr.c.
Konstantin Belousov [Thu, 19 Jan 2017 18:38:58 +0000 (18:38 +0000)]
Make tmpfs directory cursor available outside tmpfs_subr.c.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFix problem with suspend and resume when using Skylake chipsets. Make
Hans Petter Selasky [Thu, 19 Jan 2017 18:33:27 +0000 (18:33 +0000)]
Fix problem with suspend and resume when using Skylake chipsets. Make
sure the XHCI controller is reset after halting it. The problem is
clearly a BIOS bug as the suspend and resume is failing without
loading the XHCI driver. The same happens when using Linux and the
XHCI driver is not loaded.

Submitted by: Yanko Yankulov <yanko.yankulov@gmail.com>
PR: 216261
MFC after: 1 week

7 years agoRefresh tmpfs(5) man page.
Konstantin Belousov [Thu, 19 Jan 2017 18:26:06 +0000 (18:26 +0000)]
Refresh tmpfs(5) man page.

Provide more useful explanation of features and quirks.

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

7 years agoOnly conditionally add in hyperv support if we're building amd64
Enji Cooper [Thu, 19 Jan 2017 18:07:24 +0000 (18:07 +0000)]
Only conditionally add in hyperv support if we're building amd64

This unbreaks the build because the assembly is written for x64.

MFC after: 3 weeks
X-MFC with: r312418
Pointyhat to: ngie
Reported by: Jenkins (i386 job)
Sponsored by: Dell EMC Isilon

7 years agoAdd manpage for mlx4ib(4)
Enji Cooper [Thu, 19 Jan 2017 17:09:11 +0000 (17:09 +0000)]
Add manpage for mlx4ib(4)

This manpage isn't differentiated from mlx4en except where necessary,
replacing eth/ETH with ib/IB.

Eventually the manpages will be split and the common bits be placed
in a manpage named "mlx4.4".

MFC after: 3 weeks
Reviewed by: hselasky
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9241

7 years agoConditionalize hyperv support in gettimeofday(2) based on MK_HYPERV
Enji Cooper [Thu, 19 Jan 2017 17:03:45 +0000 (17:03 +0000)]
Conditionalize hyperv support in gettimeofday(2) based on MK_HYPERV

The effect at runtime is negligible as the hyperv timer isn't available
except when hyperv is loaded.

This is a prerequisite for conditionalizing the header build/install out
of the build

MFC after: 3 weeks
Reviewed by: sephe
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9242

7 years agoFix build of devd with GCC 4.2
Alan Somers [Thu, 19 Jan 2017 16:59:55 +0000 (16:59 +0000)]
Fix build of devd with GCC 4.2

Reported by: olivier
Pointy-hat-to: asomers
MFC after: 27 days
X-MFC-with: 312395
Sponsored by: Spectra Logic Corp

7 years agoffs_vnops: Simplify extattr access
Conrad Meyer [Thu, 19 Jan 2017 16:46:05 +0000 (16:46 +0000)]
ffs_vnops: Simplify extattr access

As suggested in r167010, use the structure type and macros to access and
modify UFS2 extended attributes.  Add assertions that pointers are
aligned in places where we now access the data through a structure
pointer, instead of character-by-character.

PR: 216127
Reported by: dewayne at heuristicsystems.com.au
Reviewed by: kib@
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9225

7 years agoRename tmpfs_mount member allnode_lock to include namespace prefix.
Konstantin Belousov [Thu, 19 Jan 2017 16:01:36 +0000 (16:01 +0000)]
Rename tmpfs_mount member allnode_lock to include namespace prefix.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoProtect macro argument.
Konstantin Belousov [Thu, 19 Jan 2017 15:06:18 +0000 (15:06 +0000)]
Protect macro argument.

Requested by: hselasky
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoHandle the set capabilities ioctl, letting the hardware checksum be
Luiz Otavio O Souza [Thu, 19 Jan 2017 14:58:55 +0000 (14:58 +0000)]
Handle the set capabilities ioctl, letting the hardware checksum be
disabled (Hi netmap!).

Only remove the CRC bytes from packets when the hardware tell us to do so.

Fixes the 'discard frame w/o leading ethernet header' issues.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoRework some tmpfs lock assertions.
Konstantin Belousov [Thu, 19 Jan 2017 14:49:55 +0000 (14:49 +0000)]
Rework some tmpfs lock assertions.

Remove TMPFS_ASSERT_ELOCKED().  Its claims are already stated by other
asserts nearby and by VFS guarantees.
Change TMPFS_ASSERT_LOCKED() and one inlined place to use
ASSERT_VOP_(E)LOCKED() instead of hand-rolled imprecise asserts.

Tested by: pho (as part of the larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoStyle fixes and comment updates.
Konstantin Belousov [Thu, 19 Jan 2017 14:27:37 +0000 (14:27 +0000)]
Style fixes and comment updates.

Edit comments which explain no longer relevant details, and add
locking annotations to the struct tmpfs_node members.

Tested by: pho (as part of the larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoThe port number and the to_port_en flag are valid only on SOP descriptor.
Luiz Otavio O Souza [Thu, 19 Jan 2017 14:05:49 +0000 (14:05 +0000)]
The port number and the to_port_en flag are valid only on SOP descriptor.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoRemove unused union member, fifos on tmpfs are implemented in common code.
Konstantin Belousov [Thu, 19 Jan 2017 13:35:14 +0000 (13:35 +0000)]
Remove unused union member, fifos on tmpfs are implemented in common code.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUse S_ISREG instead of manual & (also it's better to compare the
Xin LI [Thu, 19 Jan 2017 08:01:35 +0000 (08:01 +0000)]
Use S_ISREG instead of manual & (also it's better to compare the
result from & and the pattern instead of just assuming it's one bit
value).

Pointed out by Tianjie Mao <tjmao tjmao com>.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D4827

7 years agoFix an unchecked return value in zfsd
Alan Somers [Wed, 18 Jan 2017 22:10:18 +0000 (22:10 +0000)]
Fix an unchecked return value in zfsd

It's pretty unlikely to actually hit this, but good to check it anyway

Reported by: Coverity
CID: 1362018
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

7 years agoFix several Coverity CIDs in devd
Alan Somers [Wed, 18 Jan 2017 20:24:37 +0000 (20:24 +0000)]
Fix several Coverity CIDs in devd

CID 13620551362054: File descriptor leaks during shutdown
CID 1362013: Potential null-termination fail with long network device names
CID 1362097: Uncaught exception during memory pressure
CID 13620171362016: Unchecked errors, possibly resulting in weird behavior
if two devd instances start at the same time.
CID 1362015: Unchecked error that will probably never fail

Reported by: Coverity
CID: 1362055 1362054 1362013 1362097 1362017 1362016 1362015
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

7 years agorestore(8): Handle extended attribute names correctly
Conrad Meyer [Wed, 18 Jan 2017 18:16:57 +0000 (18:16 +0000)]
restore(8): Handle extended attribute names correctly

UFS2 extended attribute names are not NUL-terminated.  Handle
appropriately.

Correct the EXTATTR_BASE_LENGTH() macro, which handled ea_namelength ==
one (mod eight) extended attributes incorrectly.

PR: 216127
Reported by: dewayne at heuristicsystems.com.au
Reviewed by: kib@
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9208

7 years agoUse SRCTOP instead of .CURDIR-relative path in .PATH directive
Enji Cooper [Wed, 18 Jan 2017 18:14:50 +0000 (18:14 +0000)]
Use SRCTOP instead of .CURDIR-relative path in .PATH directive

MFC after: 3 weeks
Sponsored by: Dell EMC Isilon

7 years agoufs/extattr.h: Fix documentation of ea_name termination
Conrad Meyer [Wed, 18 Jan 2017 17:55:49 +0000 (17:55 +0000)]
ufs/extattr.h: Fix documentation of ea_name termination

The ea_name string is not nul-terminated.  Correct the documentation.

Because the subsequent field is padded to 8 bytes, and the padding is
zeroed, the ea_name string will appear to be nul-terminated whenever the
length isn't exactly one (mod eight).

This was introduced in r167010 (2007).

Additionally, mark the length fields as unsigned.  This particularly
matters for the single byte ea_namelength field, which can represent
extended attribute names up to 255 bytes long.

No functional change.

PR: 216127
Reported by: dewayne at heuristicsystems.com.au
Reviewed by: kib@
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D9206

7 years agosx: reduce lock accesses similarly to r311172
Mateusz Guzik [Wed, 18 Jan 2017 17:55:08 +0000 (17:55 +0000)]
sx: reduce lock accesses similarly to r311172

Discussed with: jhb
Tested by: pho (previous version)

7 years agorwlock: reduce lock accesses similarly to r311172
Mateusz Guzik [Wed, 18 Jan 2017 17:53:57 +0000 (17:53 +0000)]
rwlock: reduce lock accesses similarly to r311172

Discussed with:     jhb
Tested by: pho (previous version)

7 years agoFormat and sort MSG_* flags, to prevent misedits in future. There is no
Gleb Smirnoff [Wed, 18 Jan 2017 17:21:28 +0000 (17:21 +0000)]
Format and sort MSG_* flags, to prevent misedits in future.  There is no
functional change.

7 years agoFix regression from r311568: collision of MSG_NOSIGNAL with MSG_MORETOCOME
Gleb Smirnoff [Wed, 18 Jan 2017 17:09:22 +0000 (17:09 +0000)]
Fix regression from r311568: collision of MSG_NOSIGNAL with MSG_MORETOCOME
lead to delayed send of data sent with sendto(MSG_NOSIGNAL).

Submitted by: rrs

7 years agoRemove empty ranges property so beri_simplebus can be attached again.
Ruslan Bukin [Wed, 18 Jan 2017 14:41:59 +0000 (14:41 +0000)]
Remove empty ranges property so beri_simplebus can be attached again.

Sponsored by: DARPA, AFRL

7 years agough, device_t not device_t *
Sean Bruno [Wed, 18 Jan 2017 14:23:43 +0000 (14:23 +0000)]
ugh, device_t not device_t *

Reported by: hps

7 years agoChange device type to unbreak drm-next testing and builds.
Sean Bruno [Wed, 18 Jan 2017 13:57:29 +0000 (13:57 +0000)]
Change device type to unbreak drm-next testing and builds.

Submitted by: Matt Macy <mmacy@nextbsd.org>

7 years agoImplement kernel support for hardware rate limited sockets.
Hans Petter Selasky [Wed, 18 Jan 2017 13:31:17 +0000 (13:31 +0000)]
Implement kernel support for hardware rate limited sockets.

- Add RATELIMIT kernel configuration keyword which must be set to
enable the new functionality.

- Add support for hardware driven, Receive Side Scaling, RSS aware, rate
limited sendqueues and expose the functionality through the already
established SO_MAX_PACING_RATE setsockopt(). The API support rates in
the range from 1 to 4Gbytes/s which are suitable for regular TCP and
UDP streams. The setsockopt(2) manual page has been updated.

- Add rate limit function callback API to "struct ifnet" which supports
the following operations: if_snd_tag_alloc(), if_snd_tag_modify(),
if_snd_tag_query() and if_snd_tag_free().

- Add support to ifconfig to view, set and clear the IFCAP_TXRTLMT
flag, which tells if a network driver supports rate limiting or not.

- This patch also adds support for rate limiting through VLAN and LAGG
intermediate network devices.

- How rate limiting works:

1) The userspace application calls setsockopt() after accepting or
making a new connection to set the rate which is then stored in the
socket structure in the kernel. Later on when packets are transmitted
a check is made in the transmit path for rate changes. A rate change
implies a non-blocking ifp->if_snd_tag_alloc() call will be made to the
destination network interface, which then sets up a custom sendqueue
with the given rate limitation parameter. A "struct m_snd_tag" pointer is
returned which serves as a "snd_tag" hint in the m_pkthdr for the
subsequently transmitted mbufs.

2) When the network driver sees the "m->m_pkthdr.snd_tag" different
from NULL, it will move the packets into a designated rate limited sendqueue
given by the snd_tag pointer. It is up to the individual drivers how the rate
limited traffic will be rate limited.

3) Route changes are detected by the NIC drivers in the ifp->if_transmit()
routine when the ifnet pointer in the incoming snd_tag mismatches the
one of the network interface. The network adapter frees the mbuf and
returns EAGAIN which causes the ip_output() to release and clear the send
tag. Upon next ip_output() a new "snd_tag" will be tried allocated.

4) When the PCB is detached the custom sendqueue will be released by a
non-blocking ifp->if_snd_tag_free() call to the currently bound network
interface.

Reviewed by: wblock (manpages), adrian, gallatin, scottl (network)
Differential Revision: https://reviews.freebsd.org/D3687
Sponsored by: Mellanox Technologies
MFC after: 3 months

7 years agoUse the kernel stack in the ARM FBT DTrace provider. This is used to find
Andrew Turner [Wed, 18 Jan 2017 13:27:24 +0000 (13:27 +0000)]
Use the kernel stack in the ARM FBT DTrace provider. This is used to find
the fifth argument to functions being traced, however there was an error
where the userspace stack was being used. This may be invalid leading to
a kernel panic if this address is unmapped.

Submitted by: Graeme Jenkinson <graeme.jenkinson@cl.cam.ac.uk>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9229

7 years agoloader: efi devpath api usage should be more aware of NULL pointers
Toomas Soome [Wed, 18 Jan 2017 08:18:07 +0000 (08:18 +0000)]
loader: efi devpath api usage should be more aware of NULL pointers

As the efi_devpath_last_node() and efi_devpath_trim() can return NULL
pointers, the consumers of this API should check the the NULL pointers.

Same for efinet_dev_init() using calloc().

Reported by: Robert Mustacchi <rm@joyent.com>
Reviewed by: jhb, allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D9203

7 years agoUse the explicit expanded form of cmp.
Justin Hibbits [Wed, 18 Jan 2017 03:42:21 +0000 (03:42 +0000)]
Use the explicit expanded form of cmp.

Clang apparently requires the explicit form of this instruction, and rejects
uses which ignore the optional cmpD register.  This was the only use of the
shorthand form of the instruction, so just fix it up to match the others.

PR: kern/215681
Submitted by: Mark Millard
Reported by: Mark Millard <markmi _AT_ dsl-only.net>
MFC after: 2 weeks

7 years agocxgbe/tom: Fix a case where do_pass_accept_req wasn't properly restoring
Navdeep Parhar [Wed, 18 Jan 2017 03:35:42 +0000 (03:35 +0000)]
cxgbe/tom: Fix a case where do_pass_accept_req wasn't properly restoring
the VNET.  This should have been in r311949.

MFC after: 2 days

7 years agoCatch up with changes to structure member names.
Ed Schouten [Tue, 17 Jan 2017 22:05:52 +0000 (22:05 +0000)]
Catch up with changes to structure member names.

Pointer/length pairs are now always named ${name} and ${name}_len.

7 years agoRegenerate sources based on the system call tables.
Ed Schouten [Tue, 17 Jan 2017 22:05:01 +0000 (22:05 +0000)]
Regenerate sources based on the system call tables.

7 years agoSync in the latest CloudABI generated source files.
Ed Schouten [Tue, 17 Jan 2017 22:03:08 +0000 (22:03 +0000)]
Sync in the latest CloudABI generated source files.

Languages like C++17 and Go provide direct support for slice types:
pointer/length pairs. The CloudABI generator now has more complete for
this, meaning that for the C binding, pointer/length pairs now use an
automatic naming scheme of ${name} and ${name}_len.

Apart from this change and some reformatting, the ABI definitions are
identical. Binary compatibility is preserved entirely.

7 years agoDon't compute MPATH during install.
Bryan Drewery [Tue, 17 Jan 2017 21:12:21 +0000 (21:12 +0000)]
Don't compute MPATH during install.

This saves time when building over NFS.  Nothing should be building during
this phase anyhow.

Sponsored by: Dell EMC Isilon

7 years agoRemove writing 'residual' field of struct ctl_scsiio.
Alexander Motin [Tue, 17 Jan 2017 18:32:47 +0000 (18:32 +0000)]
Remove writing 'residual' field of struct ctl_scsiio.

This field has no practical use and never readed.  Initiators already
receive respective residual size from frontends.  Removed field had
different semantics, which looks useless, and was never passed through
by any frontend.

While there, fix kern_data_resid field support in case of HA, missed in
r312291.

MFC after: 13 days

7 years agoThe write-protect is not wired on uFW, disable it to allow writes to SD
Luiz Otavio O Souza [Tue, 17 Jan 2017 18:04:13 +0000 (18:04 +0000)]
The write-protect is not wired on uFW, disable it to allow writes to SD
card.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoSet the the wp_disabled flag when asked to.
Luiz Otavio O Souza [Tue, 17 Jan 2017 17:41:14 +0000 (17:41 +0000)]
Set the the wp_disabled flag when asked to.

While here, add the missing new line.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoAdd 4k quirk for Micron 5100 and Intel S3610 SSDs
Sean Bruno [Tue, 17 Jan 2017 14:52:48 +0000 (14:52 +0000)]
Add 4k quirk for Micron 5100 and Intel S3610 SSDs

Submitted by: Jason Wolfe <j@nitrology.com>
MFH: 1 week
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D9209

7 years agoImprove error message on duplicate iSCSI port.
Alexander Motin [Tue, 17 Jan 2017 14:13:14 +0000 (14:13 +0000)]
Improve error message on duplicate iSCSI port.

MFC after: 2 weeks

7 years agoInitialize IPFW static rules rmlock with RM_RECURSE flag.
Andrey V. Elsukov [Tue, 17 Jan 2017 10:50:28 +0000 (10:50 +0000)]
Initialize IPFW static rules rmlock with RM_RECURSE flag.

This lock was replaced from rwlock in r272840. But unlike rwlock, rmlock
doesn't allow recursion on rm_rlock(), so at this time fix this with
RM_RECURSE flag. Later we need to change ipfw to avoid such recursions.

PR: 216171
Reported by: Eugene Grosbein
MFC after: 1 week

7 years agoAdd USB audio support for S/PDIF output with C-Media CM6206 devices.
Hans Petter Selasky [Tue, 17 Jan 2017 08:15:10 +0000 (08:15 +0000)]
Add USB audio support for S/PDIF output with C-Media CM6206 devices.

Submitted by: Julien Nadeau <vedge@hypertriton.com>
PR: 216131
MFC after: 1 week

7 years agoMFV r312333: zlib 1.2.11.
Xin LI [Tue, 17 Jan 2017 05:55:47 +0000 (05:55 +0000)]
MFV r312333: zlib 1.2.11.

MFC after: 1 month

7 years agoVendor import of zlib 1.2.11.
Xin LI [Tue, 17 Jan 2017 05:47:05 +0000 (05:47 +0000)]
Vendor import of zlib 1.2.11.

7 years agoUse SRCTOP where possible and use :H to manipulate .CURDIR to get rid of
Enji Cooper [Tue, 17 Jan 2017 03:58:37 +0000 (03:58 +0000)]
Use SRCTOP where possible and use :H to manipulate .CURDIR to get rid of
unnecessarily long relative path .PATH values with make

MFC after: 1 days
Sponsored by: Dell EMC Isilon

7 years agoFix regression from r310655, which broke operation of bsnmpd if it is bound
Gleb Smirnoff [Tue, 17 Jan 2017 03:52:57 +0000 (03:52 +0000)]
Fix regression from r310655, which broke operation of bsnmpd if it is bound
to a non-wildcard address.  As documented in ip(4), doing sendmsg(2) with
IP_SENDSRCADDR on a socket that is bound to non-wildcard address is
completely different to using this control message on a wildcard one.

A fix is to add a bool to mark whether we did setsockopt(IP_RECVDSTADDR)
on the socket, and use IP_SENDSRCADDR control message only if we did.

While here, garbage collect absolutely useless udp_recv() function that
establishes some structures on stack to never use them later.

7 years agoAdd smilint target to subdir targets so "make smilint" here will run
Enji Cooper [Tue, 17 Jan 2017 03:44:45 +0000 (03:44 +0000)]
Add smilint target to subdir targets so "make smilint" here will run
the smilint target in subdirs

While here, convert a path that's .CURDIR relative to SRCTOP

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoRemove ad hoc smilint targets made standard in bsd.snmpmod.mk in r312328
Enji Cooper [Tue, 17 Jan 2017 03:41:23 +0000 (03:41 +0000)]
Remove ad hoc smilint targets made standard in bsd.snmpmod.mk in r312328

MFC after: 1 week
X-MFC with: r312328
Sponsored by: Dell EMC Isilon

7 years agoAdd a make target (smilint) for running smilint tool against BMIBS
Enji Cooper [Tue, 17 Jan 2017 03:38:49 +0000 (03:38 +0000)]
Add a make target (smilint) for running smilint tool against BMIBS

Running smilint against MIB definitions is useful in finding
functional problems with MIB definitions/descriptions.

This is inspired by the smilint targets defined in
usr.sbin/bsnmpd/modules/{snmp_hostres,snmp_mibII}/Makefile

Document all of the variables that are involved in running the
smilint target, as well as all of the prerequisites to running
it.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9099

7 years agoAdd sys/dev/rtwn/rtl8821a/usb/r21au_dfs.c into sys/conf/files
Andriy Voskoboinyk [Tue, 17 Jan 2017 00:48:02 +0000 (00:48 +0000)]
Add sys/dev/rtwn/rtl8821a/usb/r21au_dfs.c into sys/conf/files

Reported by: adrian

7 years ago[zynq] Fix panic on USB PHY initialization failure
Oleksandr Tymoshenko [Tue, 17 Jan 2017 00:39:09 +0000 (00:39 +0000)]
[zynq] Fix panic on USB PHY initialization failure

The Zedboard has a hardware bug where initialization of the USB PHY
occasionally fails on boot-up. Fix regression in -CURRENT when
kernel panics on such occasion. 11-RELEASE branch works fine

PR: 215862
Submitted by: Thomas Skibo <thoma555-bsd@yahoo.com>

7 years agortwn: export more stats to net80211
Andriy Voskoboinyk [Tue, 17 Jan 2017 00:35:23 +0000 (00:35 +0000)]
rtwn: export more stats to net80211

Setup more ieee80211_rx_stats fields for received frames:
 - pktflags:
  * IEEE80211_RX_F_FAIL_FCSCRC;
  * IEEE80211_RX_F_AMPDU;
  * IEEE80211_RX_F_AMPDU_MORE;
  * IEEE80211_RX_F_SHORTGI;
 - rate flags (CCK, OFDM, HT);
 - width;
 - phytype;
 - rate;
 - rx_tsf;
 - rssi;
 - nf;
 - ieee, freq (RTL8188EU only, when ht40 support is disabled).

Tested with:
 - RTL8188CE, RTL8188EU, RTL8821AU (STA / AP modes, i386)
 - (by kevlo) RTL8188EU and RTL8812AU (amd64)

Reviewed by: adrian (previous version), kevlo
Differential Revision: https://reviews.freebsd.org/D9021

7 years agoloader: move device path definitions to include/efidevp.h
Toomas Soome [Mon, 16 Jan 2017 20:57:01 +0000 (20:57 +0000)]
loader: move device path definitions to include/efidevp.h

No functional change, only moving uuid and protocol bits to include/efidevp.h

Reviewed by: imp, jhb
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D9192

7 years agodisambiguate msleep KASSERT diagnostics
Ed Maste [Mon, 16 Jan 2017 20:34:42 +0000 (20:34 +0000)]
disambiguate msleep KASSERT diagnostics

Previously "panic: msleep" could happen for a few different reasons.
Break the KASSERTs out into individual cases to identify the failing
condition. Found during the investigation that resulted in r308288.

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

7 years agoImprove some of the sysctl descriptions added in r299827.
Mark Johnston [Mon, 16 Jan 2017 19:35:19 +0000 (19:35 +0000)]
Improve some of the sysctl descriptions added in r299827.

Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
(original version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5336

7 years agoRemove Assert that seems to be hit in various configurations during
Sean Bruno [Mon, 16 Jan 2017 19:01:41 +0000 (19:01 +0000)]
Remove Assert that seems to be hit in various configurations during
normal operations.

7 years agoAdd a new socket option SO_TS_CLOCK to pick from several different clock
Maxim Sobolev [Mon, 16 Jan 2017 17:46:38 +0000 (17:46 +0000)]
Add a new socket option SO_TS_CLOCK to pick from several different clock
sources to return timestamps when SO_TIMESTAMP is enabled. Two additional
clock sources are:

o nanosecond resolution realtime clock (equivalent of CLOCK_REALTIME);
o nanosecond resolution monotonic clock (equivalent of CLOCK_MONOTONIC).

In addition to this, this option provides unified interface to get bintime
(equivalent of using SO_BINTIME), except it also supported with IPv6 where
SO_BINTIME has never been supported. The long term plan is to depreciate
SO_BINTIME and move everything to using SO_TS_CLOCK.

Idea for this enhancement has been briefly discussed on the Net session
during dev summit in Ottawa last June and the general input was positive.

This change is believed to benefit network benchmarks/profiling as well
as other scenarios where precise time of arrival measurement is necessary.

There are two regression test cases as part of this commit: one extends unix
domain test code (unix_cmsg) to test new SCM_XXX types and another one
implementis totally new test case which exchanges UDP packets between two
processes using both conventional methods (i.e. calling clock_gettime(2)
before recv(2) and after send(2)), as well as using setsockopt()+recv() in
receive path. The resulting delays are checked for sanity for all supported
clock types.

Reviewed by:    adrian, gnn
Differential Revision:  https://reviews.freebsd.org/D9171

7 years agoChange startup order for the no EARLY_AP_STARTUP case to initialize
Sean Bruno [Mon, 16 Jan 2017 16:58:12 +0000 (16:58 +0000)]
Change startup order for the no EARLY_AP_STARTUP case to initialize
gtaskqueue bits at SI_SUB_INIT_IF instead of waiting until SI_SUB_SMP
which is far too late.

Add an assertion in taskqgroup_attach() to catch startup initialization
failures in the future.

Reported by: kib bde

7 years agoRemove arm's cpuconf.h, and references to it, after moving a few lines from
Ian Lepore [Mon, 16 Jan 2017 16:44:13 +0000 (16:44 +0000)]
Remove arm's cpuconf.h, and references to it, after moving a few lines from
it into pmap-v4.h where they are used.  Other than those few lines of
support for different MMU types, nothing in cpuconf.h has been used in our
code for quite a while.

The file existed to set up a variety of symbols to describe the
architecture.  Over the past few years we have converted all of our source
to use the new architecture symbols standardized by ARM Inc, and predefined
by both clang and gcc.

PR: 216104

7 years agoMake CTL frontends report kern_data_resid for under-/overruns.
Alexander Motin [Mon, 16 Jan 2017 16:19:55 +0000 (16:19 +0000)]
Make CTL frontends report kern_data_resid for under-/overruns.

It seems like kern_data_resid was never really implemented.  This change
finally does it.  Now frontends update this field while transferring data,
while CTL/backends getting it can more flexibly handle the result.
At this point behavior should not change significantly, still reporting
errors on write overrun, but that may be changed later, if we decide so.

CAM target frontend still does not properly handle overruns due to CAM API
limitations.  We may need to add some fields to struct ccb_accept_tio to
pass information about initiator requested transfer size(s).

MFC after: 2 weeks

7 years ago[gpioths] new driver for temperature/humidity sensor DHT11
Michael Zhilin [Mon, 16 Jan 2017 15:36:36 +0000 (15:36 +0000)]
[gpioths] new driver for temperature/humidity sensor DHT11

This patch adds driver for temperature/humidity sensor connected via GPIO.
To compile it into kernel add "device gpioths". To activate driver, use
hints (.at and .pins) for gpiobus. As result it will provide temperature &
humidity values via sysctl.

DHT11 is cheap & popular temperature/humidity sensor used via GPIO on ARM
or MIPS devices like Raspberry Pi or Onion Omega.

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

7 years ago[spibus] small code refactoring
Michael Zhilin [Mon, 16 Jan 2017 15:23:55 +0000 (15:23 +0000)]
[spibus] small code refactoring

Merge 3 sequential printf calls into one.

Reported by: rpokala
Reviewed by: rpokala, adrian
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D8795

7 years agortld: do not rely on a populated GOT on amd64
Ed Maste [Mon, 16 Jan 2017 14:49:29 +0000 (14:49 +0000)]
rtld: do not rely on a populated GOT on amd64

On rela architectures GNU BFD ld and gold store the relocation addend
in GOT entries (in addition to the relocation's r_addend field).
rtld previously relied on this to access its own _DYNAMIC symbol in
order to apply its own relocations.

However, recording addends in the GOT is not specified by the ABI,
and some versions of LLVM's LLD linker leave the GOT uninitialized on
rela architectures.

BFD ld does not populate the GOT on sparc64, and sparc64 rtld has a
machine-dependent rtld_dynamic_addr() function that returns the
_DYNAMIC address. Use the same approach on amd64, obtaining the %rip-
relative _DYNAMIC address following a suggestion from Rafael EspĂ­ndola.

Architectures other than amd64 should be addressed in future work.

PR: 214972
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9180

7 years agoAdd kevent EVFILT_EMPTY for notification when a client has received all data
Hiren Panchasara [Mon, 16 Jan 2017 08:25:33 +0000 (08:25 +0000)]
Add kevent EVFILT_EMPTY for notification when a client has received all data
i.e. everything outstanding has been acked.

Reviewed by: bz, gnn (previous version)
MFC after: 3 days
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D9150

7 years agoRemove a bit of armv6 support that didn't get deleted when this file was
Ian Lepore [Mon, 16 Jan 2017 03:11:30 +0000 (03:11 +0000)]
Remove a bit of armv6 support that didn't get deleted when this file was
split from trap.c into trap-v4.c and trap-v6.c.

7 years agoalc: Add Killer E2500 support
Sepherosa Ziehau [Mon, 16 Jan 2017 03:03:47 +0000 (03:03 +0000)]
alc: Add Killer E2500 support

Reviewed by: jhb, yongari
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D9058

7 years agoloader.efi: find_currdev() can leak memory
Toomas Soome [Sun, 15 Jan 2017 20:03:13 +0000 (20:03 +0000)]
loader.efi: find_currdev() can leak memory

The find_currdev() is using variable "copy" to store the reference to trimmed
devpath pointer, if for some reason the efi_devpath_handle() fails, we will
leak this copy.

Also we can simplify the code there a bit.

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

7 years ago[net80211] add some more "is this XXX" macros for CTRL and DATA.
Adrian Chadd [Sun, 15 Jan 2017 19:49:47 +0000 (19:49 +0000)]
[net80211] add some more "is this XXX" macros for CTRL and DATA.

There's already a macro for MGT.

7 years agoFix a variety of cosmetic typos and misspellings
Conrad Meyer [Sun, 15 Jan 2017 18:00:45 +0000 (18:00 +0000)]
Fix a variety of cosmetic typos and misspellings

No functional change.

PR: 216096, 216097, 216098, 216101, 216102, 216106, 216109, 216110
Reported by: Bulat <bltsrc at mail.ru>
Sponsored by: Dell EMC Isilon

7 years ago"Buses" is the preferred plural of "bus"
Conrad Meyer [Sun, 15 Jan 2017 17:54:01 +0000 (17:54 +0000)]
"Buses" is the preferred plural of "bus"

Replace archaic "busses" with modern form "buses."

Intentionally excluded:
* Old/random drivers I didn't recognize
  * Old hardware in general
* Use of "busses" in code as identifiers

No functional change.

http://grammarist.com/spelling/buses-busses/

PR: 216099
Reported by: bltsrc at mail.ru
Sponsored by: Dell EMC Isilon

7 years agoAdd under-/overrun support to IOCTL and CAM SIM frontends.
Alexander Motin [Sun, 15 Jan 2017 13:57:42 +0000 (13:57 +0000)]
Add under-/overrun support to IOCTL and CAM SIM frontends.

MFC after: 1 week

7 years agoWhen in kernel, map ctl_scsi_zero_io() to ctl_zero_io().
Alexander Motin [Sun, 15 Jan 2017 13:51:44 +0000 (13:51 +0000)]
When in kernel, map ctl_scsi_zero_io() to ctl_zero_io().

MFC after: 1 week

7 years agoskel: Do not set -o emacs in .shrc.
Jilles Tjoelker [Sun, 15 Jan 2017 13:40:14 +0000 (13:40 +0000)]
skel: Do not set -o emacs in .shrc.

sh has defaulted to 'set -o emacs' since FreeBSD 9.0. Therefore, do not set
this again in .shrc, since that only serves to prevent invocations like
'sh -o vi' and 'sh +o emacs' to have the intended effect.

PR: 215958
Submitted by: Andras Farkas
MFC after: 1 week

7 years agoMake `camcontrol cmd ... -i ...` return only valid bytes.
Alexander Motin [Sun, 15 Jan 2017 12:24:23 +0000 (12:24 +0000)]
Make `camcontrol cmd ... -i ...` return only valid bytes.

Previously code ignored resid field and returned extra zeroes in case of
data underflow.  Now it returns only real bytes received from target.

MFC after: 2 weeks

7 years agoFix typo in r312216
Enji Cooper [Sun, 15 Jan 2017 10:29:53 +0000 (10:29 +0000)]
Fix typo in r312216

I meant to replace "exp" with "exponent", not "expected"

MFC after: 13 days
Pointyhat to: ngie
Submitted by: bde

7 years agoarswitch: Ensure the lock is always held when calling arswitch_modifyreg()
Kristof Provost [Sun, 15 Jan 2017 10:21:25 +0000 (10:21 +0000)]
arswitch: Ensure the lock is always held when calling arswitch_modifyreg()

arswitch_setled() and a number of _global_setup functions did not acquire the
lock before calling arswitch_modifyreg(). With WITNESS enabled this would
instantly panic.

Discovered on a TPLink-3600:
("panic: mutex arswitch not owned at sys/dev/etherswitch/arswitch/arswitch_reg.c:236")

Reviewed by: adrian, kan
Differential Revision: https://reviews.freebsd.org/D9187

7 years agoRevert r312119 and reword the intent to fix -Wshadow issues
Enji Cooper [Sun, 15 Jan 2017 09:25:33 +0000 (09:25 +0000)]
Revert r312119 and reword the intent to fix -Wshadow issues
between exp(3) and `exp` var.

The approach taken previously was not ideal for multiple
functional and stylistic reasons.

Add to existing sed call in Makefile to replace `exp` with
`exponent` instead.

MFC after: 13 days
Requested by: bde

7 years agoMark testcases which use cap_enter as expected failures until the
Enji Cooper [Sun, 15 Jan 2017 09:13:41 +0000 (09:13 +0000)]
Mark testcases which use cap_enter as expected failures until the
PR is resolved so those of us that run the tests don't have the
bogus failures counted against our overall results

PR: 215690

7 years agoEnable IPv6 networking on Amazon EC2.
Colin Percival [Sun, 15 Jan 2017 09:06:45 +0000 (09:06 +0000)]
Enable IPv6 networking on Amazon EC2.

MFC after: 1 week

7 years agoTurn COMPILER_VERSION/COMPILER_TYPE make check into a compile-time check
Enji Cooper [Sun, 15 Jan 2017 09:05:26 +0000 (09:05 +0000)]
Turn COMPILER_VERSION/COMPILER_TYPE make check into a compile-time check
of the clang version

This works around breakage on ^/stable/10 when running installworld from
a ^/stable/10 host where the test wouldn't be compiled on the first
go-around and would be missing when make installworld is run.

MFC after: 1 week
PR: 208703
Reported by: emaste
Sponsored by: Dell EMC Isilon

7 years agoFix a minor typo (Seiral)
Conrad Meyer [Sun, 15 Jan 2017 08:05:00 +0000 (08:05 +0000)]
Fix a minor typo (Seiral)

PR: 216095
Reported by: <bltsrc at mail.ru>

7 years ago[ar71xx] add EARLY_PRINTF support for the rest of the non-AR933x SoCs.
Adrian Chadd [Sun, 15 Jan 2017 06:35:00 +0000 (06:35 +0000)]
[ar71xx] add EARLY_PRINTF support for the rest of the non-AR933x SoCs.

Tested:

* AR934x SoC