]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoSimplify building libpam and fix libpam.a not containing the modules since r284345.
bdrewery [Thu, 14 Apr 2016 01:17:03 +0000 (01:17 +0000)]
Simplify building libpam and fix libpam.a not containing the modules since r284345.

The change in r284345 moved the creation of openpam_static_modules.o to
lib/libpam/static_modules but never managed to get them into libpam.a.

Move this logic to lib/libpam/static_libpam and have it create a static
library for libpam.a  The main lib/libpam/libpam will only create a
shared library.  No redundancy in compilation or installation exists
in this solution.

This avoids requiring a pass with -D_NO_LIBPAM_SO_YET.

Sponsored by: EMC / Isilon Storage Division

8 years agoSend krping output to the log instead of the tty, as is done upstream.
np [Thu, 14 Apr 2016 00:25:11 +0000 (00:25 +0000)]
Send krping output to the log instead of the tty, as is done upstream.

Reviewed by: hselasky@
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D5931

8 years agoFix UART3 and UART4 clock offsets.
gonzo [Wed, 13 Apr 2016 21:39:45 +0000 (21:39 +0000)]
Fix UART3 and UART4 clock offsets.

Original values were copy-pasted from UART1 and UART2

PR: 197037
Submitted by: Scott Ellis <scott@jumpnowtek.com>

8 years agolibgssapi: avoid NULL pointer dereferences.
pfg [Wed, 13 Apr 2016 21:08:02 +0000 (21:08 +0000)]
libgssapi: avoid NULL pointer dereferences.

While here also use NULL instead of zero for pointers.

Found with coccinelle.

MFC after: 1 week

8 years agoNote the brokenness of WITHOUT_INSTALLLIB.
bdrewery [Wed, 13 Apr 2016 21:01:58 +0000 (21:01 +0000)]
Note the brokenness of WITHOUT_INSTALLLIB.

Sponsored by: EMC / Isilon Storage Division

8 years agoarm64: Avoid null dereference in its_init_cpu
emaste [Wed, 13 Apr 2016 21:00:00 +0000 (21:00 +0000)]
arm64: Avoid null dereference in its_init_cpu

its_init_cpu() is called from gic_v3_init_secondary(), and its_sc will
be NULL if its did not attach.

Sponsored by: The FreeBSD Foundation

8 years agoThe build does work now with WITHOUT_TOOLCHAIN.
bdrewery [Wed, 13 Apr 2016 20:55:05 +0000 (20:55 +0000)]
The build does work now with WITHOUT_TOOLCHAIN.

The bootstrap cross tools are still built in this mode as well.

Sponsored by: EMC / Isilon Storage Division

8 years agoRemove misspelled and redundant MK_INSTALLIB=no.
bdrewery [Wed, 13 Apr 2016 20:43:02 +0000 (20:43 +0000)]
Remove misspelled and redundant MK_INSTALLIB=no.

8 years agosh: Simplify code by removing variable bracketed_name.
jilles [Wed, 13 Apr 2016 20:32:35 +0000 (20:32 +0000)]
sh: Simplify code by removing variable bracketed_name.

8 years agoSeparate POSIX mqueue objects in jails; actually, separate them by the
jamie [Wed, 13 Apr 2016 20:15:49 +0000 (20:15 +0000)]
Separate POSIX mqueue objects in jails; actually, separate them by the
jail's root, so jails that don't have their own filesystem directory
also won't have their own mqueue namespace.

PR: 208082

8 years agoSeparate POSIX sem/shm objects in jails, by prepending the jail's path
jamie [Wed, 13 Apr 2016 20:14:13 +0000 (20:14 +0000)]
Separate POSIX sem/shm objects in jails, by prepending the jail's path
name to the object's "path".  While the objects don't have real path
names, it's a filesystem-like namespace, which allows jails to be
kept to their own space, but still allows the system / jail parent to
access a jail's IPC.

PR: 208082

8 years agoAdd sbuf variants ata_cmd_sbuf() and ata_res_sbuf(), and reimplement the
scottl [Wed, 13 Apr 2016 20:10:06 +0000 (20:10 +0000)]
Add sbuf variants ata_cmd_sbuf() and ata_res_sbuf(), and reimplement the
_string variants on top of this.  This requires a change to the function
signature of ata_res_sbuf().  Its use in the tree seems to be very limited,
and the change makes it more consistent with the rest of the API.

Reviewed by: imp, mav, kenm
Sponsored by: Netflix
Differential Revision: D5940

8 years agoHandle PBA that shares a page with MSI-X table for passthrough devices.
jhb [Wed, 13 Apr 2016 18:39:33 +0000 (18:39 +0000)]
Handle PBA that shares a page with MSI-X table for passthrough devices.

If the PBA shares a page with the MSI-X table, map the shared page via
/dev/mem and emulate accesses to the portion of the PBA in the shared
page by accessing the mapped page.

Reviewed by: grehan
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5919

8 years agoExpose doreti as a global symbol on amd64 and i386.
jhb [Wed, 13 Apr 2016 17:37:31 +0000 (17:37 +0000)]
Expose doreti as a global symbol on amd64 and i386.

doreti provides the common code path for returning from interrupt
andlers on x86.  Exposing doreti as a global symbol allows kernel
modules to include low-level interrupt handlers instead of requiring
all low-level handlers to be statically compiled into the kernel.

Submitted by: Howard Su <howard0su@gmail.com>
Reviewed by: kib

8 years agoUse scsi_cdb_sbuf() inside of scsi_command_string now that the temporary
scottl [Wed, 13 Apr 2016 15:57:13 +0000 (15:57 +0000)]
Use scsi_cdb_sbuf() inside of scsi_command_string now that the temporary
string storage is no longer needed.

MFC after: 3 days
Sponsored by: Netflix

8 years agoAdd scsi_cdb_sbuf() for handling CDB strings. Reimplement scsi_cdb_string()
scottl [Wed, 13 Apr 2016 15:43:11 +0000 (15:43 +0000)]
Add scsi_cdb_sbuf() for handling CDB strings.  Reimplement scsi_cdb_string()
in terms of it.

Reviewed by: imp, mav, ken
MFC after: 3 days
Sponsored by: Netflix
Differential Revision: D5934

8 years agolibvgl: do not initialize static storage.
pfg [Wed, 13 Apr 2016 14:59:50 +0000 (14:59 +0000)]
libvgl: do not initialize static storage.

The pointer value was being initialized to 0. While it would
have been better to use NULL here, it is static storage so
there is no need to do so.

8 years agoreversed commits r297916 r297909 r297898 due to i386 build failures.
davidcs [Wed, 13 Apr 2016 13:14:18 +0000 (13:14 +0000)]
reversed commits r297916 r297909 r297898 due to i386 build failures.

MFC after:5 days

8 years agoAdd hint.ahci.X.quirks tunable for some odd cases.
mav [Wed, 13 Apr 2016 12:32:58 +0000 (12:32 +0000)]
Add hint.ahci.X.quirks tunable for some odd cases.

MFC after: 2 weeks

8 years agoDocument the memory ranges within the kernel region to help with debugging
andrew [Wed, 13 Apr 2016 11:43:03 +0000 (11:43 +0000)]
Document the memory ranges within the kernel region to help with debugging
to track down which region an address is from.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoFix compilation error on i386
davidcs [Wed, 13 Apr 2016 11:24:24 +0000 (11:24 +0000)]
Fix compilation error on i386

8 years agoFilter Port Database Changed notifications.
mav [Wed, 13 Apr 2016 10:35:17 +0000 (10:35 +0000)]
Filter Port Database Changed notifications.

For some reason firmware sends Port Database Changed notifications in case
of explicit login requests from the driver when target port is unavailabe.
Those notifications don't give driver any new information, but only cause
infinite scan loop.

8 years agoIncrease the arm64 kernel address space to 512GB, and the DMAP region to
andrew [Wed, 13 Apr 2016 09:44:32 +0000 (09:44 +0000)]
Increase the arm64 kernel address space to 512GB, and the DMAP region to
2TB. The latter can be increased in 512GB chunks by adjusting the lower
address, however more work will be needed to increase the former.

There is still some work needed to only create a DMAP region for the RAM
address space as on ARM architectures all mappings should have the same
memory attributes, and these will be different for device and normal memory.

Reviewed by: kib
Obtained from: ABT Systems Ltd
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5859

8 years agohyperv: device_get_softc does not return NULL
sephe [Wed, 13 Apr 2016 09:20:29 +0000 (09:20 +0000)]
hyperv: device_get_softc does not return NULL

MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agoRespect NVRAM topology settings on 24xx and above chips.
mav [Wed, 13 Apr 2016 07:04:04 +0000 (07:04 +0000)]
Respect NVRAM topology settings on 24xx and above chips.

8 years agoMultiple fixes in VCHI audio driver:
gonzo [Wed, 13 Apr 2016 05:28:27 +0000 (05:28 +0000)]
Multiple fixes in VCHI audio driver:

- Pre-buffer audio data to VideoCore so there are no audible glitches when
    driver is too late to provide samples
- Start actual playback when there is some prebuffered audio,
    it fixes audible noisy click in the beginning of playback
- Use #defines instead of hardcoded values where appropriate
- Fix copy-pasted comment

PR: 208678

8 years ago[urtwn] use/track the last good RSSI for a given node, rather than no RSSI.
adrian [Wed, 13 Apr 2016 05:19:16 +0000 (05:19 +0000)]
[urtwn] use/track the last good RSSI for a given node, rather than no RSSI.

Now that we're decap'ing A-MPDU frame, the firmware is only giving us
PHY status information for the whole PPDU, rather than duplicatig it
per frame.

So, we fake it by maintaining the RSSI that we saw in the node struct
and reuse it.

This prevents us from getting some pretty garbage looking default RSSI
values, which shows up as RSSI values of like "3" or "4" when doing
active traffic.

Tested:

* RTL8188EU, STA mode

8 years agoFix build failure on i386. Need to typecast a bunch of variables to (uintmax_t)
davidcs [Wed, 13 Apr 2016 04:13:36 +0000 (04:13 +0000)]
Fix build failure on i386. Need to typecast a bunch of variables to (uintmax_t)

MFC after:5 days

8 years agohyperv/vmbus: Merge duplicated version check for events
sephe [Wed, 13 Apr 2016 03:45:39 +0000 (03:45 +0000)]
hyperv/vmbus: Merge duplicated version check for events

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

8 years agoConvert ypldap_addr list to a tailq(queue(3)).
araujo [Wed, 13 Apr 2016 03:36:34 +0000 (03:36 +0000)]
Convert ypldap_addr list to a tailq(queue(3)).

Obtained from: OpenBSD r1.11, r1.17 and r1.36

8 years agofmt(1): for pointers use NULL instead of 0
pfg [Wed, 13 Apr 2016 01:57:06 +0000 (01:57 +0000)]
fmt(1): for pointers use NULL instead of 0

While here clean excessive not lint comment indentation.

8 years agoApply revisions 1.4 and 1.5 from ldapd's ber.c to ypldap's copy, so it can
araujo [Wed, 13 Apr 2016 01:54:33 +0000 (01:54 +0000)]
Apply revisions 1.4 and 1.5 from ldapd's ber.c to ypldap's copy, so it can
deal with messages that haven't been fully read from the server yet.

Obtained from: OpenBSD r1.11

8 years agoTry harder to find svn
swills [Wed, 13 Apr 2016 01:47:04 +0000 (01:47 +0000)]
Try harder to find svn

While here, elliminate last references to CVS_UPDATE and SUP_UPDATE

Reviewed by: gjb
Approved by: gjb

8 years agofmt(1): reformat with indent(1).
pfg [Wed, 13 Apr 2016 01:46:48 +0000 (01:46 +0000)]
fmt(1): reformat with indent(1).

Failed attempt to get nearer to style(9) and the format from the
original OpenBSD code. At least it should be readable now.

No functional change.

8 years ago1. modify fwdump (a.k.a grcdump) memory is allocated and freed on as needed
davidcs [Wed, 13 Apr 2016 00:53:04 +0000 (00:53 +0000)]
1. modify fwdump (a.k.a grcdump) memory is allocated and freed on as needed
   basis.
2. grcdump can be taken at failure points by invoking bxe_grc_dump() when
   trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done
   sysctl flag is set.
3. grcdump_done can be monitored by the user to retrieve the grcdump.

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

8 years agoAdd a small tool, resizewin(1), to query terminal for window size
cem [Wed, 13 Apr 2016 00:30:42 +0000 (00:30 +0000)]
Add a small tool, resizewin(1), to query terminal for window size

Submitted by: Daniel O'Connor
Reviewed by: kan, wblock, cem
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D4438

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