Commit Graph

210185 Commits

Author SHA1 Message Date
Edward Tomasz Napierala
e321146fc5 Make the usage() mention the -u option added in r295212.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-04-12 16:07:41 +00:00
Alexander Motin
e3188c2f31 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.
2016-04-12 14:43:17 +00:00
Alexander Motin
4ff970c462 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.
2016-04-12 14:19:19 +00:00
Andriy Gapon
0d63fc3ed8 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
2016-04-12 13:30:39 +00:00
Alexander Motin
53791a95a4 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.
2016-04-12 12:31:41 +00:00
Michael Tuexen
cf4476eb39 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
2016-04-12 11:48:54 +00:00
Alexander Motin
003c82d713 Add couple missing memory barriers. 2016-04-12 11:48:50 +00:00
Konstantin Belousov
fe60c14631 If off-page lookup failed, there is no memory to perform
shared_mutex_init() upon.

Sponsored by:	The FreeBSD Foundation
2016-04-12 10:25:44 +00:00
Stanislav Galabov
6573205a07 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
2016-04-12 07:21:22 +00:00
Stanislav Galabov
a82ccc6f1e 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
2016-04-12 07:18:48 +00:00
Andriy Gapon
c3249989ef 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
2016-04-12 06:56:35 +00:00
Andriy Gapon
6a50036052 Revert r297396 Modify "4958 zdb trips assert on pools with ashift >= 0xe"
A better fix is following.
2016-04-12 06:54:18 +00:00
Andriy Gapon
9054bcbce7 [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
2016-04-12 06:46:54 +00:00
Bryan Drewery
7f76a95cd0 Regenerate 2016-04-12 03:55:33 +00:00
Bryan Drewery
d32e910cb2 Add some more content for WITH_META_MODE.
Sponsored by:	EMC / Isilon Storage Division
2016-04-12 03:40:13 +00:00
Bryan Drewery
4cfc7d9db5 Document the behavior of NO_DIRDEPS/NO_DIRDEPS_BELOW.
Sponsored by:	EMC / Isilon Storage Division
2016-04-12 03:37:42 +00:00
Bryan Drewery
8a5f439677 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
2016-04-12 02:45:19 +00:00
Sepherosa Ziehau
3d861d81b9 hyperv: Replace 0 w/ NULL
Submitted by:	pfg
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-12 02:01:16 +00:00
Alan Somers
2c6254c287 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
2016-04-11 22:14:29 +00:00
Rick Macklem
84aa8a8ad1 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
2016-04-11 21:55:21 +00:00
Enji Cooper
306c3c4d90 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
2016-04-11 21:15:48 +00:00
Bryan Drewery
0457a4e053 META_MODE: Support targets that already have .OBJDIR in them for META_COOKIE.
Sponsored by:	EMC / Isilon Storage Division
2016-04-11 21:12:24 +00:00
Bryan Drewery
5528bda1b2 Revert r297833 which committed the wrong file 2016-04-11 21:12:00 +00:00
Bryan Drewery
63208a7a29 META_MODE: Support targets that already have .OBJDIR in them for META_COOKIE.
Sponsored by:	EMC / Isilon Storage Division
2016-04-11 21:10:14 +00:00
Alexander Motin
78aec5c610 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@792fd28ac0
2016-04-11 21:09:15 +00:00
Alexander Motin
6257b60dd0 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@792fd28ac0
2016-04-11 21:07:18 +00:00
Pedro F. Giffuni
341f552d8c libc: cleanup unnecessary semicolons (part 2).
Found with devel/coccinelle.
2016-04-11 18:09:38 +00:00
Pedro F. Giffuni
3fc873ffe2 libc: cleanup unnecessary semicolons.
Found with devel/coccinelle.
2016-04-11 18:08:12 +00:00
Mark Johnston
f7d5087af2 libdtrace: Add a missing unlock to an error handler.
Submitted by:	Jihyun Yu <yjh0502@gmail.com>
MFC after:	3 days
2016-04-11 17:57:54 +00:00
Pedro F. Giffuni
3b7175bdc7 rcp(1): replace 0 with NULL for pointers.
Found with devel/coccinelle.
2016-04-11 17:24:26 +00:00
Andrey V. Elsukov
b2d7040c1c 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
2016-04-11 13:44:31 +00:00
Steven Hartland
2dcee04b3a 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
2016-04-11 13:17:11 +00:00
Alexander Motin
2b2f4008d0 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
2016-04-11 10:53:25 +00:00
Alexander Motin
5e3e6a8241 Polish debugging IOCB dumping.
Add few more missing cases, unify byte order.

MFC after:	1 month
2016-04-11 10:48:26 +00:00
Bjoern A. Zeeb
05fc416403 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
2016-04-11 10:00:38 +00:00
Sepherosa Ziehau
9859c43dfe hyperv: Typo
Noticed by:	kib
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-11 09:52:24 +00:00
Steven Hartland
7bc47b4ea3 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
2016-04-11 08:57:54 +00:00
Andriy Gapon
1da2e1e353 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
2016-04-11 07:11:20 +00:00
Sepherosa Ziehau
e331206e0f 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
2016-04-11 06:59:13 +00:00
Sepherosa Ziehau
b81e22fced 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
2016-04-11 06:37:50 +00:00
Sepherosa Ziehau
0e86334196 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
2016-04-11 06:31:52 +00:00
Sepherosa Ziehau
083b2c353d hyperv: Define macro for Hyper-V interface
Suggested by:	rpokala
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-11 06:22:26 +00:00
Sepherosa Ziehau
29b7b56766 hyperv: Print more features
And add comment about the MSR features.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-11 06:15:40 +00:00
Anish Gupta
441a3497f5 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
2016-04-11 05:09:43 +00:00
Sepherosa Ziehau
3f2b057e35 hyperv: Break long line
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-11 04:56:23 +00:00
Sepherosa Ziehau
e4276edca5 hyperv: Declare hyperv_{features,recommends} properly
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-11 04:49:21 +00:00
Sepherosa Ziehau
c8d7fb6a5c 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
2016-04-11 03:36:07 +00:00
Sepherosa Ziehau
68247c05c2 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
2016-04-11 03:28:17 +00:00
Sepherosa Ziehau
e69fbdcbdf 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
2016-04-11 03:14:28 +00:00
Sepherosa Ziehau
2924c4efeb hyperv/vmbus: Nuke unused function
MFC after:	1 week
Sponsored by:	Microsoft OSTC
2016-04-11 03:07:35 +00:00