]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoMerge libxo 0.4.6
phil [Tue, 12 Apr 2016 23:30:56 +0000 (23:30 +0000)]
Merge libxo 0.4.6

Reviewed by: sjg
Approved by: sjg (mentor)

8 years agoTag libxo 0.4.6
phil [Tue, 12 Apr 2016 23:03:37 +0000 (23:03 +0000)]
Tag libxo 0.4.6

8 years agoimport libso 0.4.6
phil [Tue, 12 Apr 2016 23:03:01 +0000 (23:03 +0000)]
import libso 0.4.6

8 years agoRemove PS_STRINGS fallback from setproctitle
emaste [Tue, 12 Apr 2016 22:59:20 +0000 (22:59 +0000)]
Remove PS_STRINGS fallback from setproctitle

In r103767 the kern.ps_strings sysctl was added as the preferred way to
locate the ps_strings struct and is available in any FreeBSD release
supported within the last decade.

Reviewed by: kib

8 years agofsck_ffs for pointers replace 0 with NULL.
pfg [Tue, 12 Apr 2016 22:55:47 +0000 (22:55 +0000)]
fsck_ffs for pointers replace 0 with NULL.

Found with devel/coccinelle.

Reviewed by: mckusick

8 years agoImport libxo 0.4.6
phil [Tue, 12 Apr 2016 22:54:19 +0000 (22:54 +0000)]
Import libxo 0.4.6

8 years agoAdd support for Flash Update
davidcs [Tue, 12 Apr 2016 22:31:48 +0000 (22:31 +0000)]
Add support for Flash Update

Submitted by:nrapendra.singh@qlogic.com;vaishali.kulkarni@qlogic.com;davidcs@freebsd.org
Approved by:davidcs@freebsd.org
MFC after:5 days

8 years agocxgbe(4): Always dispatch all work requests that have been written to the
np [Tue, 12 Apr 2016 22:11:29 +0000 (22:11 +0000)]
cxgbe(4): Always dispatch all work requests that have been written to the
descriptor ring before leaving drain_wrq_wr_list.

8 years agoRefactor the handling of ICMP/IPv4 packets for SCTP/IPv4.
tuexen [Tue, 12 Apr 2016 21:40:54 +0000 (21:40 +0000)]
Refactor the handling of ICMP/IPv4 packets for SCTP/IPv4.

This cleansup the code and prepares upcoming handling of ICMP/IPv4 packets
for SCTP/UDP/IPv4 packets. IPv6 changes will follow...

MFC after: 3 days

8 years agoAdd fastreg support to krping (ported from upstream).
np [Tue, 12 Apr 2016 21:34:04 +0000 (21:34 +0000)]
Add fastreg support to krping (ported from upstream).

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D5777

8 years agoEnable DEVICE_NUMA with up to 8 domains by default on amd64.
jhb [Tue, 12 Apr 2016 21:23:44 +0000 (21:23 +0000)]
Enable DEVICE_NUMA with up to 8 domains by default on amd64.

8 memory domains should handle a quad-socket board with dual-domain
processors.

Reviewed by: kib
Relnotes: maybe?
Differential Revision: https://reviews.freebsd.org/D5893

8 years agocxgbe(4): Always read the entire mailbox into the reply buffer.
np [Tue, 12 Apr 2016 21:17:19 +0000 (21:17 +0000)]
cxgbe(4): Always read the entire mailbox into the reply buffer.

The size of the reply can be different from the size of the command in
case a debug firmware asserts.  fw_asrt() needs the entire reply in
order to decode the location of the assert.

Sponsored by:   Chelsio Communications

8 years ago1. Process tx completions in bxe_periodic_callout_func() and restart
davidcs [Tue, 12 Apr 2016 21:00:38 +0000 (21:00 +0000)]
1. Process tx completions in bxe_periodic_callout_func() and restart
   transmissions if possible.
2. For SIOCSIFFLAGS call bxe_init_locked() only if !BXE_STATE_DISABLED
3. remove code not needed in bxe_init_internal_common()

Submitted by:vaishali.kulkarni@qlogic.com;venkata.bhavaraju@qlogic.com
Approved by:davidcs@freebsd.org
MFC after:5 days

8 years agoboot1: regenerate FAT templates after r297871
emaste [Tue, 12 Apr 2016 20:59:25 +0000 (20:59 +0000)]
boot1: regenerate FAT templates after r297871

Sponsored by: The FreeBSD Foundation

8 years agoboot1.efifat: provide a fallback startup.nsh
emaste [Tue, 12 Apr 2016 20:52:28 +0000 (20:52 +0000)]
boot1.efifat: provide a fallback startup.nsh

In case the firmware falls through to executing startup.sh, populate it
with the name of our boot loader. In normal operation this should not be
necessary but may allow the system to boot if it would otherwise just
remain at a shell prompt.

Reviewed by: andrew, imp, smh
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5878

8 years agoIf the VOP_SETATTR() call that saves the exclusive create verifier failed,
rmacklem [Tue, 12 Apr 2016 20:23:09 +0000 (20:23 +0000)]
If the VOP_SETATTR() call that saves the exclusive create verifier failed,
the NFS server would leave the newly created vnode locked. This could
result in a file system that would not unmount and processes wedged,
waiting for the file to be unlocked.
Since this VOP_SETATTR() never fails for most file systems, this bug
doesn't normally manifest itself. I found it during testing of an
exported GlusterFS file system, which can fail.
This patch adds the vput() and changes the error to the correct NFS one.

MFC after: 2 weeks

8 years agoFix rare double free in vdev_geom_attrchanged
asomers [Tue, 12 Apr 2016 19:11:14 +0000 (19:11 +0000)]
Fix rare double free in vdev_geom_attrchanged

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Don't drop the g_topology_lock before freeing old_physpath. That
opens up a race where one thread can call vdev_geom_attrchanged,
set old_physpath, drop the g_topology_lock, then block trying to
acquire the SCL_STATE lock. Then another thread can come into
vdev_geom_attrchanged, set old_physpath to the same value, and
proceed to free it. When the first thread resumes, it will free
the same location.

It turns out that the SCL_STATE lock isn't needed. It was
originally added by gibbs to protect vd->vdev_physpath while
updating the same. However, the update process subsequently was
switched to an atomic operation (a pointer swap). Now, there is
no need for the SCL_STATE lock, and hence no need to drop the
g_topology_lock.

Reviewed by: delphij
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D5413

8 years agoMake all CT Pass-Through (name server requests) asynchronous.
mav [Tue, 12 Apr 2016 18:50:37 +0000 (18:50 +0000)]
Make all CT Pass-Through (name server requests) asynchronous.

Previously we had to do it synchronously because we could not drop the lock
due to potential scratch memory use conflicts.  Previous commits fixed that
collision, so here it goes -- slower and less reliable external requests
are executed asynchronously without spinning in tight loop and with more
safe timeout handling.

8 years agoRestore some comments in previous commit.
pfg [Tue, 12 Apr 2016 18:24:02 +0000 (18:24 +0000)]
Restore some comments in previous commit.

8 years agobootpd(8): De-register and minor cleanups.
pfg [Tue, 12 Apr 2016 18:18:26 +0000 (18:18 +0000)]
bootpd(8): De-register and minor cleanups.

For bootptest(8) also remuve an unused variable and replace
0 with a NULL for a pointer.

8 years agoFix overflow checking.
trasz [Tue, 12 Apr 2016 18:13:24 +0000 (18:13 +0000)]
Fix overflow checking.

There are some other potential problems related to overflowing racct
counters; I'll revisit those later.

Submitted by: Pieter de Goeje (earlier version)
Reviewed by: emaste@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRename the 'M_B' macro in t4_regs.h to 'CXGBE_M_B'.
jhb [Tue, 12 Apr 2016 17:44:34 +0000 (17:44 +0000)]
Rename the 'M_B' macro in t4_regs.h to 'CXGBE_M_B'.

This fixes a conflict with the M_B macro in powerpc's
<machine/db_machdep.h> exposed by the recent addition of DDB commands
to the cxgbe driver.

Discussed with: np
Reported by: bz
Sponsored by: Chelsio Communications

8 years agoReplace 0 with NULL for pointers in misc. device drivers.
pfg [Tue, 12 Apr 2016 17:23:03 +0000 (17:23 +0000)]
Replace 0 with NULL for pointers in misc. device drivers.

Found with devel/coccinelle.

8 years agoMake the usage() mention the -u option added in r295212.
trasz [Tue, 12 Apr 2016 16:07:41 +0000 (16:07 +0000)]
Make the usage() mention the -u option added in r295212.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoSwitch isp_getpdb() to synchronous IOCB DMA area.
mav [Tue, 12 Apr 2016 14:43:17 +0000 (14:43 +0000)]
Switch isp_getpdb() to synchronous IOCB DMA area.

While technically it is not IOCB, it is synchronous and can be called from
different places, so calling FC_SCRATCH_ACQUIRE() here is inconvenient.

8 years agoAllocate separate DMA area for synchronous IOCB execution.
mav [Tue, 12 Apr 2016 14:19:19 +0000 (14:19 +0000)]
Allocate separate DMA area for synchronous IOCB execution.

Usually IOCBs should be put on queue for asynchronous processing and should
not require additional DMA memory.  But there are some cases like aborts and
resets that for external reasons has to be synchronous.  Give those cases
separate 2*64 byte DMA area to decouple them from other DMA scratch area
users, using it for asynchronous requests.

8 years agore-enable AMD Topology extension on certain models if disabled by BIOS
avg [Tue, 12 Apr 2016 13:30:39 +0000 (13:30 +0000)]
re-enable AMD Topology extension on certain models if disabled by BIOS

Some BIOSes disable AMD Topology extension on AMD Family 15h notebook
processors.  We re-enable the extension, so that we can properly discover
core and cache topology.  Linux seems to do the same.

Reported by: Johannes Dieterich <dieterich.joh@gmail.com>
Reviewed by: jhb, kib
Tested by: Johannes Dieterich <dieterich.joh@gmail.com>
(earlier version)
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D5883

8 years agoReimplement ISP_TSK_MGMT IOCTL via asynchronous request.
mav [Tue, 12 Apr 2016 12:31:41 +0000 (12:31 +0000)]
Reimplement ISP_TSK_MGMT IOCTL via asynchronous request.

I am not sure this code is not completely dead, but it used DMA scratch
are without good reason and asked to be refactored.

8 years agoWhen processing an ICMP packet containing an SCTP packet, it
tuexen [Tue, 12 Apr 2016 11:48:54 +0000 (11:48 +0000)]
When processing an ICMP packet containing an SCTP packet, it
is required to check the verification tag. However, this
requires the verification tag to be not 0. Enforce this.
For packets with a verification tag of 0, we need to
check it it contains an INIT chunk and use the initiate
tag for the validation. This will be a separate commit,
since it touches also other code.

MFC after: 1 week

8 years agoAdd couple missing memory barriers.
mav [Tue, 12 Apr 2016 11:48:50 +0000 (11:48 +0000)]
Add couple missing memory barriers.

8 years agoIf off-page lookup failed, there is no memory to perform
kib [Tue, 12 Apr 2016 10:25:44 +0000 (10:25 +0000)]
If off-page lookup failed, there is no memory to perform
shared_mutex_init() upon.

Sponsored by: The FreeBSD Foundation

8 years agoMove Mediatek/Ralink PCIe to NEW_PCIB
sgalabov [Tue, 12 Apr 2016 07:21:22 +0000 (07:21 +0000)]
Move Mediatek/Ralink PCIe to NEW_PCIB

This revision fixes minor issues and moves the Mediatek/Ralink PCIe
support to use NEW_PCIB.

https://svnweb.freebsd.org/changeset/base/297849 is the other part of
this changeset.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5908

8 years agoDefine PCI_RES_BUS for MIPS.
sgalabov [Tue, 12 Apr 2016 07:18:48 +0000 (07:18 +0000)]
Define PCI_RES_BUS for MIPS.

This is done as part of the work on D5908, but as a separate commit.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD

8 years agol2arc: make sure that all writes honor ashift of a cache device
avg [Tue, 12 Apr 2016 06:56:35 +0000 (06:56 +0000)]
l2arc: make sure that all writes honor ashift of a cache device

Previously uncompressed buffers did not obey that rule.

Type of b_asize is changed to uint64_t for consistency,
given that this is a zeta-byte filesystem.

l2arc_compress_buf is renamed to l2arc_transform_buf to better reflect
its new utility.  Now not only we ensure that a compressed buffer has
a size aligned to ashift, but we also allocate a properly sized
temporary buffer if the original buffer is not compressed and it has
an odd size.  This ensures that all I/O to the cache device is always
ashift-aligned, in terms of both a request offset and a request size.

If the aligned data is larger than the original data, then we have to use
a temporary buffer when reading it as well.

Also, enhance physical zio alignment checks using vdev_logical_ashift.
On FreeBSD we have this information, so we can make stricter assertions.

Reviewed by: smh, mav
MFC after: 1 month
Sponsored by: ClusterHQ
Differential Revision: https://reviews.freebsd.org/D2789

8 years agoRevert r297396 Modify "4958 zdb trips assert on pools with ashift >= 0xe"
avg [Tue, 12 Apr 2016 06:54:18 +0000 (06:54 +0000)]
Revert r297396 Modify "4958 zdb trips assert on pools with ashift >= 0xe"

A better fix is following.

8 years ago[amd64] dtrace_invop handler is to be called only for kernel exceptions
avg [Tue, 12 Apr 2016 06:46:54 +0000 (06:46 +0000)]
[amd64] dtrace_invop handler is to be called only for kernel exceptions

DTrace-related exceptions in userland code are handled elsewhere.
One practical problem was a crash in dtrace_invop_start() when saved
%rsp pointed to a virtual address that was not backed.

i386 code already ignored userland exceptions.

Reviewed by: markj, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D5906

8 years agoRegenerate
bdrewery [Tue, 12 Apr 2016 03:55:33 +0000 (03:55 +0000)]
Regenerate

8 years agoAdd some more content for WITH_META_MODE.
bdrewery [Tue, 12 Apr 2016 03:40:13 +0000 (03:40 +0000)]
Add some more content for WITH_META_MODE.

Sponsored by: EMC / Isilon Storage Division

8 years agoDocument the behavior of NO_DIRDEPS/NO_DIRDEPS_BELOW.
bdrewery [Tue, 12 Apr 2016 03:37:42 +0000 (03:37 +0000)]
Document the behavior of NO_DIRDEPS/NO_DIRDEPS_BELOW.

Sponsored by: EMC / Isilon Storage Division

8 years agoMETA_MODE: Avoid changed build command every build.
bdrewery [Tue, 12 Apr 2016 02:45:19 +0000 (02:45 +0000)]
META_MODE: Avoid changed build command every build.

Because the file is generated with -f using another Makefile, 2
different Makefiles are trying to handle the .meta file for the
target.  The obvious .NOMETA_CMP or .NOMETA on the ${MAKE} targets
don't work as they are very limited in scope in bmake.  Using
.PHONY fixes the problem and ensures that the ${MAKE} command
is always ran to check if it is outdated in the sub-make.

An example of the problem in gnu/lib/libgcc (with make -dM):
  /usr/obj/root/git/freebsd/gnu/lib/libgcc/tm.h.meta: 2: a build command has changed
  TARGET_CPU_DEFAULT=""  HEADERS="options.h i386/biarch64.h i386/i386.h i386/unix.h i386/att.h dbxelf.h elfos-undef.h elfos.h freebsd-native.h freebsd-spec.h freebsd.h i386/x86-64.h i386/freebsd.h i386/freebsd64.h defaults.h"  DEFINES=""  /bin/sh /root/git/freebsd/gnu/lib/libgcc/../../../contrib/gcc/mkconfig.sh tm.h
  vs
  (cd /root/git/freebsd/gnu/lib/libgcc; make -f /root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile MFILE=/root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile GCCDIR=/root/git/freebsd/gnu/lib/libgcc/../../../contrib/gcc tm.h)
  Skipping meta for tm.h: .NOMETA
  (cd /root/git/freebsd/gnu/lib/libgcc; make -f /root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile MFILE=/root/git/freebsd/gnu/lib/libgcc/../../usr.bin/cc/cc_tools/Makefile GCCDIR=/root/git/freebsd/gnu/lib/libgcc/../../../contrib/gcc tm.h)
  `tm.h' is up to date.

Sponsored by: EMC / Isilon Storage Division

8 years agohyperv: Replace 0 w/ NULL
sephe [Tue, 12 Apr 2016 02:01:16 +0000 (02:01 +0000)]
hyperv: Replace 0 w/ NULL

Submitted by: pfg
MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agoFix an intermittent bug in sbin/devd/client_test.stream
asomers [Mon, 11 Apr 2016 22:14:29 +0000 (22:14 +0000)]
Fix an intermittent bug in sbin/devd/client_test.stream

In case where the two events were being received in separate reads, the
event buffer was being null-terminated at the wrong offset.

Also, factored out some common code between the tests, and fixed a comment.

Submitted by: will
MFC after: 3 days
Sponsored by: Spectra Logic Corp

8 years agoBruce Evans reported that there was a performance regression between
rmacklem [Mon, 11 Apr 2016 21:55:21 +0000 (21:55 +0000)]
Bruce Evans reported that there was a performance regression between
the old and new NFS clients. He did a good job of isolating the problem
which was caused by the new NFS client not setting the post write mtime
correctly. The new NFS client code was cloned from the old client, but
was incorrect, because the mtime in the nfs vnode's cache wasn't yet
updated. This patch fixes this problem. The patch also adds missing mutex
locking.

Reported and tested by: bde
MFC after: 2 weeks

8 years agoFix appending -O0 to CFLAGS
ngie [Mon, 11 Apr 2016 21:15:48 +0000 (21:15 +0000)]
Fix appending -O0 to CFLAGS

The previous method would completely nerf CFLAGS once bsd.progs.mk had
recursed into the per-PROG logic and make the CFLAGS for tap testcases
to -O0, instead of appending to CFLAGS for all of the tap testcases.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoMETA_MODE: Support targets that already have .OBJDIR in them for META_COOKIE.
bdrewery [Mon, 11 Apr 2016 21:12:24 +0000 (21:12 +0000)]
META_MODE: Support targets that already have .OBJDIR in them for META_COOKIE.

Sponsored by: EMC / Isilon Storage Division

8 years agoRevert r297833 which committed the wrong file
bdrewery [Mon, 11 Apr 2016 21:12:00 +0000 (21:12 +0000)]
Revert r297833 which committed the wrong file

8 years agoMETA_MODE: Support targets that already have .OBJDIR in them for META_COOKIE.
bdrewery [Mon, 11 Apr 2016 21:10:14 +0000 (21:10 +0000)]
META_MODE: Support targets that already have .OBJDIR in them for META_COOKIE.

Sponsored by: EMC / Isilon Storage Division

8 years agoMFV r297831: 6322 ZFS indirect block predictive prefetch
mav [Mon, 11 Apr 2016 21:09:15 +0000 (21:09 +0000)]
MFV r297831: 6322 ZFS indirect block predictive prefetch

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Author: Alexander Motin <mav@FreeBSD.org>

Improve speculative prefetch of indirect blocks.

Scalability of many operations on wide ZFS pool can be limited by
requirement to prefetch indirect blocks first.  Recently added
asynchronous indirect block read partially helped, but did not
solve the problem completely.  This patch extends existing prefetcher
functionality to explicitly work with indirect blocks.

Before this change prefetcher issued reads for up to 8MB of data in
advance.  With this change it also issues indirect block reads
for up to 64MB of data in advance, so that when it will be time to
actually read those data, it can be done immediately.  Alike effect
can be achieved by just increasing maximal data prefetch distance,
but at higher memory cost.

Also this change introduces indirect block prefetch for rewrite
operations, that was never done before.  Previously ARC miss for
Indirect blocks regularly blocked rewrites, converting perfectly
aligned asynchronous operations into synchronous read-write pairs,
significantly reducing maximal rewrite speed.

While being there this issue was also fixed:
 - prefetch was done always, even if caching for the dataset was
completely disabled.

Testing on FreeBSD with zvol on top of 6x striped 2x mirrored pool
of 12 assorted HDDs shown me such performance numbers:
------- BEFORE --------
Write       491363677 bytes/sec
Read        312430631 bytes/sec
Rewrite      97680464 bytes/sec
-------- AFTER --------
Write       493524146 bytes/sec
Read        438598079 bytes/sec
Rewrite     277506044 bytes/sec

Closes #65
Closes #80

openzfs/openzfs@792fd28ac04f78cc5e43ead2d72a96f244ea84e8

8 years agolibc: cleanup unnecessary semicolons (part 2).
pfg [Mon, 11 Apr 2016 18:09:38 +0000 (18:09 +0000)]
libc: cleanup unnecessary semicolons (part 2).

Found with devel/coccinelle.

8 years agolibc: cleanup unnecessary semicolons.
pfg [Mon, 11 Apr 2016 18:08:12 +0000 (18:08 +0000)]
libc: cleanup unnecessary semicolons.

Found with devel/coccinelle.

8 years agolibdtrace: Add a missing unlock to an error handler.
markj [Mon, 11 Apr 2016 17:57:54 +0000 (17:57 +0000)]
libdtrace: Add a missing unlock to an error handler.

Submitted by: Jihyun Yu <yjh0502@gmail.com>
MFC after: 3 days

8 years agorcp(1): replace 0 with NULL for pointers.
pfg [Mon, 11 Apr 2016 17:24:26 +0000 (17:24 +0000)]
rcp(1): replace 0 with NULL for pointers.

Found with devel/coccinelle.

8 years agoFix the problem, when gpart(8) can't write both bootcode and partcode
ae [Mon, 11 Apr 2016 13:44:31 +0000 (13:44 +0000)]
Fix the problem, when gpart(8) can't write both bootcode and partcode
in one command due to wrong file size limit. Do not use bootcode size
to calculate partsize limit.
Also add report message about successful partcode writing.

Reported by: Trond Endrestøl
MFC after: 2 weeks

8 years agoOnly include sysctl in kernel build
smh [Mon, 11 Apr 2016 13:17:11 +0000 (13:17 +0000)]
Only include sysctl in kernel build

Only include sysctl in kernel builds fixing warning about implicit
declaration of function 'sysctl_handle_int'.

PR: 204140
MFC after: 1 week
X-MFC-With: r297813
Sponsored by: Multiplay

8 years agoUpdate 25xx chips firmware from 7.03.00 to 8.03.00.
mav [Mon, 11 Apr 2016 10:53:25 +0000 (10:53 +0000)]
Update 25xx chips firmware from 7.03.00 to 8.03.00.

While the same update is also available for 24xx chips, it seems have
a problem with disabling virtual ports -- firmware handles the request,
but does not respong on it, causing timeout in driver.

MFC after: 1 month

8 years agoPolish debugging IOCB dumping.
mav [Mon, 11 Apr 2016 10:48:26 +0000 (10:48 +0000)]
Polish debugging IOCB dumping.

Add few more missing cases, unify byte order.

MFC after: 1 month

8 years agoDuring if_vmove() we call if_detach_internal() which in turn calls the event
bz [Mon, 11 Apr 2016 10:00:38 +0000 (10:00 +0000)]
During if_vmove() we call if_detach_internal() which in turn calls the event
handler notifying about interface departure and one of the consumers will
detach if_bpf.
There is no way for us to re-attach this easily as the DLT and hdrlen are
only given on interface creation.
Add a function to allow us to query the DLT and hdrlen from a current
BPF attachment and after if_attach_internal() manually re-add the if_bpf
attachment using these values.

Found by panics triggered by nd6 packets running past BPF_MTAP() with no
proper if_bpf pointer on the interface.

Also add a basic DDB show function to investigate the if_bpf attachment
of an interface.

Reviewed by: gnn
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5896

8 years agohyperv: Typo
sephe [Mon, 11 Apr 2016 09:52:24 +0000 (09:52 +0000)]
hyperv: Typo

Noticed by: kib
MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agoOnly include sysctl in kernel build
smh [Mon, 11 Apr 2016 08:57:54 +0000 (08:57 +0000)]
Only include sysctl in kernel build

Only include sysctl in kernel builds fixing warning about implicit
declaration of function 'sysctl_handle_int'.

Sponsored by: Multiplay

8 years agozio: align use of "no dump" flag between use_uma and !use_uma cases
avg [Mon, 11 Apr 2016 07:11:20 +0000 (07:11 +0000)]
zio: align use of "no dump" flag between use_uma and !use_uma cases

At the moment no ZFS buffers are included into a crash dump unless
ZFS_DEBUG (or INVARIANTS) kernel option is enabled.  That's not very
helpful for debugging of ZFS problems, because important information
often resides in metadata buffers.
This change switches the dumping behavior when UMA is used from the
illumos behavior to a more useful behavior that we have on FreeBSD
when ZFS buffers are allocated via malloc.

Reviewed by: smh, mav
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D5892

8 years agohyperv/hn: Remove unnecessary NULL checks
sephe [Mon, 11 Apr 2016 06:59:13 +0000 (06:59 +0000)]
hyperv/hn: Remove unnecessary NULL checks

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: sephe
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5905

8 years agohyperv/hn: By default enable multiple TX/RX rings, aka vRSS.
sephe [Mon, 11 Apr 2016 06:37:50 +0000 (06:37 +0000)]
hyperv/hn: By default enable multiple TX/RX rings, aka vRSS.

Reviewed by: Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5880

8 years agohyperv/hn: Cap default # of rings to 8.
sephe [Mon, 11 Apr 2016 06:31:52 +0000 (06:31 +0000)]
hyperv/hn: Cap default # of rings to 8.

8 gives the best performance in both Azure and local Hyper-V on both
10Ge and 40Ge. More rings are still allowed by manual configuration.

Reviewed by: Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5879

8 years agohyperv: Define macro for Hyper-V interface
sephe [Mon, 11 Apr 2016 06:22:26 +0000 (06:22 +0000)]
hyperv: Define macro for Hyper-V interface

Suggested by: rpokala
MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv: Print more features
sephe [Mon, 11 Apr 2016 06:15:40 +0000 (06:15 +0000)]
hyperv: Print more features

And add comment about the MSR features.

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agoAllow guest writes to AMD microcode update[0xc0010020] MSR without updating actual...
anish [Mon, 11 Apr 2016 05:09:43 +0000 (05:09 +0000)]
Allow guest writes to AMD microcode update[0xc0010020] MSR without updating actual hardware MSR. This allows guest microcode update to go through which otherwise failing because wrmsr() was returning EINVAL.

Submitted by:Yamagi Burmeister
Approved by:grehan
MFC after:2 weeks

8 years agohyperv: Break long line
sephe [Mon, 11 Apr 2016 04:56:23 +0000 (04:56 +0000)]
hyperv: Break long line

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv: Declare hyperv_{features,recommends} properly
sephe [Mon, 11 Apr 2016 04:49:21 +0000 (04:49 +0000)]
hyperv: Declare hyperv_{features,recommends} properly

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv: Resurrect r297481
sephe [Mon, 11 Apr 2016 03:36:07 +0000 (03:36 +0000)]
hyperv: Resurrect r297481

This time we make sure that the TIME_REF_COUNT MSR exists.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: sephe, Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv: Identify Hyper-V features and recommends properly
sephe [Mon, 11 Apr 2016 03:28:17 +0000 (03:28 +0000)]
hyperv: Identify Hyper-V features and recommends properly

Features bits will be used to detect devices, e.g. timers, which
do not have corresponding event channels.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: sephe, Dexuan Cui <decui microsoft com>
Rearranged by: sephe
MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv/vmbus: Get rid of max_leaf detection; this is actually not used.
sephe [Mon, 11 Apr 2016 03:14:28 +0000 (03:14 +0000)]
hyperv/vmbus: Get rid of max_leaf detection; this is actually not used.

It will be replaced by a new one.

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv/vmbus: Nuke unused function
sephe [Mon, 11 Apr 2016 03:07:35 +0000 (03:07 +0000)]
hyperv/vmbus: Nuke unused function

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agocxgbe(4): Provide an explicit value for nqpcq in the firmware
np [Mon, 11 Apr 2016 02:18:59 +0000 (02:18 +0000)]
cxgbe(4): Provide an explicit value for nqpcq in the firmware
configuration file.

8 years agoext2fs: replace 0 with NULL for pointers.
pfg [Mon, 11 Apr 2016 00:12:24 +0000 (00:12 +0000)]
ext2fs: replace 0 with NULL for pointers.

While here do late initialization of ebap, similar as was
done in UFS.

Found with devel/coccinelle.

MFC after: 2 weeks

8 years agolpr: replace 0 with NULL for pointers.
pfg [Sun, 10 Apr 2016 23:47:40 +0000 (23:47 +0000)]
lpr: replace 0 with NULL for pointers.

Found with devel/coccinelle.

Reviewed by: gad

8 years agoFix IIC "how" argument dereferencing on big-endian platforms
gonzo [Sun, 10 Apr 2016 23:17:06 +0000 (23:17 +0000)]
Fix IIC "how" argument dereferencing on big-endian platforms

"how" argument is passed as value of int* pointer to callback
function but dereferenced as char* so only one byte taken into
into account. On little-endian systems it happens to work because
first byte is LSB that contains actual value, on big-endian it's
MSB and in this case it's always equal zero

PR: 207786
Submitted by: chadf@triularity.org

8 years agoCleanup unnecessary semicolons from the kernel.
pfg [Sun, 10 Apr 2016 23:07:00 +0000 (23:07 +0000)]
Cleanup unnecessary semicolons from the kernel.

Found with devel/coccinelle.

8 years agoSince r296250 it is no longer possible for devices to use bus space
marius [Sun, 10 Apr 2016 22:43:36 +0000 (22:43 +0000)]
Since r296250 it is no longer possible for devices to use bus space
addresses exceeding 32 bit, so bump BUS_SPACE_MAXADDR to 64 bit.
The whole situation is sub par, though; prior to r296250 and despite
what their names imply, BUS_SPACE_MAX* were primarily, even almost
exclusively used for bus_dma(9). Now these macros also have a vital
role for bus_space(9). However, it does not necessarily hold that
both bus DMA and space addresses universally have the same limits
per platform.
As for sparc64, 64 bit clearly is beyond what can be addressed via
the various IOMMUs. With this change in place, we now rely on the
parent bus DMA tags of the host-to-foo drivers causing the child
tags to be capped as necessary.

PR: 207998

8 years agoufs: replace 0 with NULL for pointers.
pfg [Sun, 10 Apr 2016 21:48:11 +0000 (21:48 +0000)]
ufs: replace 0 with NULL for pointers.

While here also do late initialization of the variables we are
changing.

Found with devel/coccinelle.

Reviewed by: mckusick
MFC after: 2 weeks

8 years agolibc: replace 0 with NULL for pointers.
pfg [Sun, 10 Apr 2016 19:33:58 +0000 (19:33 +0000)]
libc: replace 0 with NULL for pointers.

While here also cleanup some surrounding code; particularly
drop some malloc() casts.

Found with devel/coccinelle.

Reviewed by: bde (previous version - all new bugs are mine)

8 years agoAdd bofh@ in calendar.freebsd
bofh [Sun, 10 Apr 2016 16:48:21 +0000 (16:48 +0000)]
Add bofh@ in calendar.freebsd

8 years agoVM_MAXUSER_ADDRESS is highest page start, not highest address.
jhibbits [Sun, 10 Apr 2016 15:50:45 +0000 (15:50 +0000)]
VM_MAXUSER_ADDRESS is highest page start, not highest address.

In case a single page mapping is requested first, which might overlap the user
address space, fix the device map block to the next page.

8 years agoRestructure device mappings for Book-E.
jhibbits [Sun, 10 Apr 2016 15:48:09 +0000 (15:48 +0000)]
Restructure device mappings for Book-E.

Summary:
There is currently a 1GB hole between user and kernel address spaces
into which direct (1:1 PA:VA) device mappings go.  This appears to go largely
unused, leaving all devices to contend with the 128MB block at the end of the
32-bit space (0xf8000000-0xffffffff).  This easily fills up, and needs to be
densely packed.  However, dense packing wastes precious TLB1 space, of which
there are only 16 (e500v2) or 64(e5500) entries available.

Change this by using the 1GB space for all device mappings, and allow the kernel
to use the entire upper 1GB for KVA.  This also allows us to use sparse device
mappings, freeing up TLB entries.

Test Plan: Boot tested on p5020.

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

8 years agoMore complete implementation of /proc/self/limits.
dchagin [Sun, 10 Apr 2016 07:11:29 +0000 (07:11 +0000)]
More complete implementation of /proc/self/limits.
Fix the way the code accesses process limits struct - pointed out by mjg@.

PR: 207386
Reviewed by: no objection form des@
MFC after: 3 weeks

8 years agoAdd a 'show t4 devlog <nexus>' DDB command.
jhb [Sun, 10 Apr 2016 06:19:26 +0000 (06:19 +0000)]
Add a 'show t4 devlog <nexus>' DDB command.

This command displays the adapter's firmware device log similar to the
dev.<nexus>.misc.devlog sysctl.

Sponsored by: Chelsio Communications

8 years agoAllow the location of the kernel source tree to be overridden.
grehan [Sun, 10 Apr 2016 05:58:19 +0000 (05:58 +0000)]
Allow the location of the kernel source tree to be overridden.
This makes it easier for the bhyve executable to be built
out of the tree.

8 years agoAdd a 'show t4 tcb <nexus> <tid>' command to dump a TCB from DDB.
jhb [Sun, 10 Apr 2016 05:06:58 +0000 (05:06 +0000)]
Add a 'show t4 tcb <nexus> <tid>' command to dump a TCB from DDB.

This allows the contents of a TCB to be extracted from a T4/T5 card in
DDB after a panic.

8 years agoAdd a function to lookup a device_t object by name.
jhb [Sun, 10 Apr 2016 05:05:02 +0000 (05:05 +0000)]
Add a function to lookup a device_t object by name.

This just walks the global list of devices looking for one with the
requested name.  The one use case outside of devctl2's implementation
is for DDB commands that wish to lookup devices by name.

8 years ago[net80211] correctly (i hope, wow) do a ticks comparison to limit A-MPDU attempts
adrian [Sun, 10 Apr 2016 04:16:34 +0000 (04:16 +0000)]
[net80211] correctly (i hope, wow) do a ticks comparison to limit A-MPDU attempts

I was seeing the stack constantly attempt to renegotiate A-MPDU TX
even after 3 failures.  My hunch is that the direct ticks comparison
is failing around the ticks wrap-around point.

This failure shouldn't /really/ happen normally, but it turns out being
the IBSS master node on FreeBSD doesn't quite setup 11n right, so
negotiating A-MPDU TX fails.

8 years ago[net80211] unconditionally do A-MPDU RX aging.
adrian [Sun, 10 Apr 2016 03:35:17 +0000 (03:35 +0000)]
[net80211] unconditionally do A-MPDU RX aging.

It's 2016 and vendors (including us!) still have 802.11n TX/RX sequence
handling bugs.  It's suboptimal, but I'd rather see us default to handling
things in a sensible way.

So, just delete the #ifdef'ed code for now.  I'll leave the option in
so it doesn't break existing configurations.

This all started because I've started getting reports about urtwn not
working after I enabled 802.11n support, and it's because the ARM kernel
configs don't include A-MPDU RX aging.

8 years agoImplement support for boot-time DTrace.
markj [Sun, 10 Apr 2016 01:25:48 +0000 (01:25 +0000)]
Implement support for boot-time DTrace.

This allows one to enable DTrace probes relatively early during boot,
during SI_SUB_DTRACE_ANON, before dtrace(1) can invoked. The desired
enabling is created using dtrace -A, which writes a /boot/dtrace.dof
file and uses nextboot(8) to ensure that DTrace kernel modules are loaded
and that the DOF file describing the enabling is loaded by loader(8)
during the subsequent boot. The trace output can then be fetched with
dtrace -a.

With this commit, boot-time DTrace is only functional on i386 and amd64: on
other architectures, the high-resolution timer frequency is initialized
during SI_SUB_CLOCKS and is thus not available when the anonymous
tracing state is initialized. On x86, the TSC is used and is thus available
earlier.

MFC after: 1 month
Relnotes: yes

8 years agonextboot(8): add a -a option for appending to a configuration.
markj [Sun, 10 Apr 2016 01:25:12 +0000 (01:25 +0000)]
nextboot(8): add a -a option for appending to a configuration.

By default, a nextboot invocation will clobber any existing nextboot
configuration.

MFC after: 2 weeks
Relnotes: yes

8 years agoInitialize SDT probes during SI_SUB_DTRACE_PROVIDER.
markj [Sun, 10 Apr 2016 01:24:27 +0000 (01:24 +0000)]
Initialize SDT probes during SI_SUB_DTRACE_PROVIDER.

This is consistent with all other DTrace providers and ensures that
SDT probes are available for boot-time tracing.

MFC after: 2 weeks

8 years agoInitialize DTrace hrtimer frequency during SI_SUB_CPU on i386 and amd64.
markj [Sun, 10 Apr 2016 01:23:39 +0000 (01:23 +0000)]
Initialize DTrace hrtimer frequency during SI_SUB_CPU on i386 and amd64.

This allows the hrtimer to be used earlier during boot. This is required
for boot-time DTrace: anonymous enablings are created during
SI_SUB_DTRACE_ANON, which runs before APs are started. In particular,
the DTrace deadman timer requires that the hrtimer be functional.

MFC after: 2 weeks

8 years ago[net80211] log the node pointer when calling ht node init/cleanup
adrian [Sat, 9 Apr 2016 22:01:32 +0000 (22:01 +0000)]
[net80211] log the node pointer when calling ht node init/cleanup

This makes it easier to track which node is having what done do it
during normal use.

This is likely the eighth time I've done this since I started doing
net80211 development, so I think it's about time I just committed it.

8 years ago[net80211] add back in the ff/superg node init call that I accidentally
adrian [Sat, 9 Apr 2016 21:57:34 +0000 (21:57 +0000)]
[net80211] add back in the ff/superg node init call that I accidentally
deleted.

It's mostly a no-op right now, so it shouldn't have changed behaviour.

8 years agoUSB: replace 0 with NULL for pointers.
pfg [Sat, 9 Apr 2016 20:36:07 +0000 (20:36 +0000)]
USB: replace 0 with NULL for pointers.

Found with devel/coccinelle.

Reviewed by: hselasky

8 years agoMFV r297760: 6418 zpool should have a label clearing command
mav [Sat, 9 Apr 2016 20:30:50 +0000 (20:30 +0000)]
MFV r297760: 6418 zpool should have a label clearing command

Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Author: Will Andrews <will@firepipe.net>

Closes #83
Closes #32

openzfs/openzfs@9663688425131744221ea99f9e66b9ed964492ae

FreeBSD already had `zpool labelclear` functionality, so this is mostly
just a diff reduction.

MFC after: 1 month

8 years agoUse DELAY() instead of sleeping during boot-time attach.
jhb [Sat, 9 Apr 2016 20:18:34 +0000 (20:18 +0000)]
Use DELAY() instead of sleeping during boot-time attach.

Tested by: Wolfgang Zenker <wolfgang@lyxys.ka.sub.org>

8 years agosh(1): replace 0 with NULL for pointers.
pfg [Sat, 9 Apr 2016 20:05:39 +0000 (20:05 +0000)]
sh(1): replace 0 with NULL for pointers.

Found with devel/coccinelle.

Reviewed by: jilles