]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoioat(4): Fix 'bogus completion_pending' KASSERT
cem [Wed, 30 Nov 2016 21:59:52 +0000 (21:59 +0000)]
ioat(4): Fix 'bogus completion_pending' KASSERT

Fix ioat_release to only set is_completion_pending if DMAs were actually
queued.  Otherwise, the spurious flag could trigger an assert in the
reset path on INVARIANTS kernels.

Reviewed by: bdrewery, Suraj Raju @ Isilon
Sponsored by: Dell EMC Isilon

7 years agoCleanup old debug dirs in delete-old-dirs target
dim [Wed, 30 Nov 2016 19:06:47 +0000 (19:06 +0000)]
Cleanup old debug dirs in delete-old-dirs target

Any .debug or .symbols files under /usr/lib/debug which correspond to
OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up
by the delete-old target.  Make this also apply to any OLD_DIRS entries.

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D8683

7 years agoInclude limits.h for CHAR_MAX
vangyzen [Wed, 30 Nov 2016 18:34:40 +0000 (18:34 +0000)]
Include limits.h for CHAR_MAX

This was needed on stable/10.  Apparently, sys/param.h supplies CHAR_MAX
on head.  Include limits.h anyway, for consistency, and because C says so.

Sponsored by: Dell EMC

7 years agoFix the PCI host generic FDT driver to call into the common code and not
andrew [Wed, 30 Nov 2016 14:18:52 +0000 (14:18 +0000)]
Fix the PCI host generic FDT driver to call into the common code and not
recurse into itself.

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

7 years agoFix the alloc function the ThunderX PCIe driver calls, the previous
andrew [Wed, 30 Nov 2016 14:17:06 +0000 (14:17 +0000)]
Fix the alloc function the ThunderX PCIe driver calls, the previous
function may not exist when FDT is removed from the kernel.

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

7 years agoClarify warning message when failing to configure audit on user login:
rwatson [Wed, 30 Nov 2016 14:02:36 +0000 (14:02 +0000)]
Clarify warning message when failing to configure audit on user login:
when au_user_mask() fails, it's not a failure to set the audit mask,
but to calculate the audit mask -- and hence a condfiguration-file
issue (of some sort).

MFC after: 3 days
Sponsored by: DARPA, AFRL

7 years agoMark the Alpine ethernet driver as FDT only. It calls
andrew [Wed, 30 Nov 2016 10:17:03 +0000 (10:17 +0000)]
Mark the Alpine ethernet driver as FDT only. It calls
alpine_serdes_resource_get which is defined in an FDT only file.

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

7 years agoMove the FDT specific parts of the GIC diver softc to the FDT attachment.
andrew [Wed, 30 Nov 2016 09:47:29 +0000 (09:47 +0000)]
Move the FDT specific parts of the GIC diver softc to the FDT attachment.
This allows the driver to be built in a kernel with no FDT support, e.g.
on arm64 with just ACPI.

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

7 years agoOnly include FDT headders when building for FDT.
andrew [Wed, 30 Nov 2016 09:45:18 +0000 (09:45 +0000)]
Only include FDT headders when building for FDT.

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

7 years agoAdd `gmirror create` subcommand, alike to gstripe, gconcat, etc.
mav [Wed, 30 Nov 2016 09:27:08 +0000 (09:27 +0000)]
Add `gmirror create` subcommand, alike to gstripe, gconcat, etc.

It is quite specific mode of operation without storing on-disk metadata.
It can be useful in some cases in combination with some external control
tools handling mirror creation and disks hot-plug.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

7 years agohyperv/storvsc: Don't use timedwait.
sephe [Wed, 30 Nov 2016 08:21:15 +0000 (08:21 +0000)]
hyperv/storvsc: Don't use timedwait.

The timeout is unnecessary.

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

7 years agohypver/vmbus: Remove extra assertion.
sephe [Wed, 30 Nov 2016 08:10:49 +0000 (08:10 +0000)]
hypver/vmbus: Remove extra assertion.

It is asserted by vmbus_chan_gpadl_connect() now.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8660

7 years agohyperv/hn: Allow TX to share event taskqueues.
sephe [Wed, 30 Nov 2016 07:54:28 +0000 (07:54 +0000)]
hyperv/hn: Allow TX to share event taskqueues.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8659

7 years agohyperv/vmbus: Add DEVMETHOD to map cpu to event taskq.
sephe [Wed, 30 Nov 2016 07:45:05 +0000 (07:45 +0000)]
hyperv/vmbus: Add DEVMETHOD to map cpu to event taskq.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8658

7 years agoAllow a user-overridable setting 'PKG_CMD' to control the command used
matthew [Wed, 30 Nov 2016 07:16:29 +0000 (07:16 +0000)]
Allow a user-overridable setting 'PKG_CMD' to control the command used
to create a repo during 'make packages'

This would have been useful for a situation I found myself in where
pkg(8) had been upgraded to a version that wanted the FBSD_1.5 ABI
version but libc.so.7 had not been upgraded, and only provided
FBSD_1.4. I found I needed to update libc in order to run pkg, and I
also needed to use pkg to update libc... Which is why pkg-static
exists, but there's currently no way to tell the build system to use
pkg-static instead of pkg.

This creates a variable PKG_CMD, default value 'pkg', that can be
overridden from the command line.

Reviewed by: gjb
Approved by: gjb
Differential Revision: https://reviews.freebsd.org/D8120

7 years agohyperv/hn: Allow multiple TX taskqueues.
sephe [Wed, 30 Nov 2016 05:28:39 +0000 (05:28 +0000)]
hyperv/hn: Allow multiple TX taskqueues.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8655

7 years agohyperv/hn: Nuke the unused TX taskqueue CPU binding tunable.
sephe [Wed, 30 Nov 2016 05:11:59 +0000 (05:11 +0000)]
hyperv/hn: Nuke the unused TX taskqueue CPU binding tunable.

It was an experimental tunable, and is now deemed to be road blocker
for further changes.  Time to retire it.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8654

7 years agoBring the powerpc DDB disassembler into the 21st century
jhibbits [Wed, 30 Nov 2016 02:35:51 +0000 (02:35 +0000)]
Bring the powerpc DDB disassembler into the 21st century

Bring in the most recent copy of NetBSD's db_disasm, to fix bugs and add more
instructions.

* Fix several bugs in the disassembler, most notably the disassembly of the
  rlwi* instructions, the original reason for bringing in this change.
* Add more registers to the SPR list
* Add more instructions to the opcode table

Obtained from: NetBSD
MFC after: 2 weeks

7 years agovfs: fix a whitespace nit in r309307
mjg [Wed, 30 Nov 2016 02:17:03 +0000 (02:17 +0000)]
vfs: fix a whitespace nit in r309307

7 years agovfs: avoid VOP_ISLOCKED in the common case in lookup
mjg [Wed, 30 Nov 2016 02:14:53 +0000 (02:14 +0000)]
vfs: avoid VOP_ISLOCKED in the common case in lookup

7 years agonetmap: add cast to fix powerpc64 LINT kernel
emaste [Wed, 30 Nov 2016 02:00:30 +0000 (02:00 +0000)]
netmap: add cast to fix powerpc64 LINT kernel

Attempt to fix powerpc64 LINT kernel broken by r308000. Netmap's use of
a uint64_t wchan seems odd, but in the interest of minimizing this
change just cast through uintptr_t to silence the compiler warning.

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

7 years agocxgbe(4): Include firmware for T6 cards in the driver. Update all
np [Wed, 30 Nov 2016 00:26:35 +0000 (00:26 +0000)]
cxgbe(4): Include firmware for T6 cards in the driver.  Update all
firmwares to 1.16.12.0.

Obtained from: Chelsio Communications
MFC after: 3 days
Sponsored by: Chelsio Communications

7 years agoMFV r309299:
mm [Tue, 29 Nov 2016 22:14:42 +0000 (22:14 +0000)]
MFV r309299:
Sync libarchive with vendor.

Important vendor bugfixes (relevant to FreeBSD):
#821: tar -P cannot extract hardlinks through symlinks
#825: Add sanity check of tar "uid, "gid" and "mtime" fields

PR: 213255
Reported by: Tijl Coosemans <tilj@FreeBSD.org>
MFC after: 1 week

7 years agoUpdate vendor/libarchive to git 256e52f073765a4ddad1e86fd4d0eda2a18147bf
mm [Tue, 29 Nov 2016 21:53:16 +0000 (21:53 +0000)]
Update vendor/libarchive to git 256e52f073765a4ddad1e86fd4d0eda2a18147bf

Important vendor bugfixes (relevant to FreeBSD):
#821: tar -P cannot extract hardlinks through symlinks
#825: Add sanity check of tar "uid, "gid" and "mtime" fields

7 years agolibm: remove duplicate version script entries
emaste [Tue, 29 Nov 2016 18:40:24 +0000 (18:40 +0000)]
libm: remove duplicate version script entries

These symbols already appear in the common lib/msun/Symbol.map.
Duplicate entries produce an error with LLVM's LLD linker.

Reviewed by: br
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8627

7 years agoMake SES status updates more aggressive.
mav [Tue, 29 Nov 2016 13:48:36 +0000 (13:48 +0000)]
Make SES status updates more aggressive.

 - On control request update all status pages, since they may also be
affected if user enables/disables enclosure slots.
 - Periodically update element descriptors too, since there is some
hardware where they are changed dynamically.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

7 years agoWe only use the cpu0 variable in the FDT code.
andrew [Tue, 29 Nov 2016 13:32:23 +0000 (13:32 +0000)]
We only use the cpu0 variable in the FDT code.

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

7 years agobhyve: stability and performance improvement for dbgport
avg [Tue, 29 Nov 2016 13:11:00 +0000 (13:11 +0000)]
bhyve: stability and performance improvement for dbgport

The TCP server implementation in dbgport does not track clients, so it
may try to write to a disconected socket resulting in SIGPIPE.
Avoid that by setting SO_NOSIGPIPE socket option.

Because dbgport emulates an I/O port to guest, the communication is done
byte by byte.  Reduce latency of the TCP/IP transfers by using
TCP_NODELAY option.  In my tests that change improves performance of
kgdb commands with lots of output (e.g. info threads) by two orders of
magnitude.

A general note.  Since we have a uart emulation in bhyve, that can be
used for the console and gdb access to guests.  So, bvmconsole and bvmdebug
could be de-orbited now.  But there are many existing deployments that
still dependend on those.

Discussed with: julian, jhb
MFC after: 2 weeks
Sponsored by: Panzura

7 years agoThis patch upgrades driver version to 06.712.04.00-fbsd
kadesai [Tue, 29 Nov 2016 13:05:43 +0000 (13:05 +0000)]
This patch upgrades driver version to 06.712.04.00-fbsd

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoThis patch will add code to refire IOCTL commands after OCR.
kadesai [Tue, 29 Nov 2016 13:04:40 +0000 (13:04 +0000)]
This patch will add code to refire IOCTL commands after OCR.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoThis patch will unblock SYNCHRONIZE_CACHE command to firmware, i.e. don't block the...
kadesai [Tue, 29 Nov 2016 13:03:43 +0000 (13:03 +0000)]
This patch will unblock SYNCHRONIZE_CACHE command to firmware, i.e. don't block the SYNCHRONIZE_CACHE command at driver instead of
passing it to firmware for all Gen3 controllers.
For Thunderbolt controller, keep the legacy behavior i.e. return the SYNCHRONIZE_CACHE command with success status from driver itself.

There is Sysctl parameter 'block_sync_cache' is provided to enable customers either to block/unblock these commands to facilitate
legacy behavior if there is a compatibility issue. Default value for module parameter is to unblock this command.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoWait for AEN task to be completed(if in queue) before resetting the controller
kadesai [Tue, 29 Nov 2016 13:02:48 +0000 (13:02 +0000)]
Wait for AEN task to be completed(if in queue) before resetting the controller
and return without processing event in AEN thread, if controller reset is in progress.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoThis patch will add task management support in driver. Below is high level description:
kadesai [Tue, 29 Nov 2016 13:01:31 +0000 (13:01 +0000)]
This patch will add task management support in driver. Below is high level description:
If a SCSI IO times out, then before initiating OCR, now the driver will try to send a
target reset to the particular target for which the IO is timed out. If that also fails,
then the driver will initiate OCR.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoProcess outstanding reply descriptors from all the reply descriptor post queues befor...
kadesai [Tue, 29 Nov 2016 12:59:38 +0000 (12:59 +0000)]
Process outstanding reply descriptors from all the reply descriptor post queues before initiating OCR.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoClean up reference to AEN command if abort AEN is succesful as the command is aborted.
kadesai [Tue, 29 Nov 2016 12:58:28 +0000 (12:58 +0000)]
Clean up reference to AEN command if abort AEN is succesful as the command is aborted.
Did the same by setting sc->aen_cmd = NULL when aborting AEN is successful.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoUpdate controller properties(read OCR capability bit) when MR_EVT_CTRL_PROP_CHANGED...
kadesai [Tue, 29 Nov 2016 12:56:53 +0000 (12:56 +0000)]
Update controller properties(read OCR capability bit) when MR_EVT_CTRL_PROP_CHANGED recieved.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoAdd sanity check in IO and IOCTL path not to process command further if controller...
kadesai [Tue, 29 Nov 2016 12:55:01 +0000 (12:55 +0000)]
Add sanity check in IO and IOCTL path not to process command further if controller is in
HW_CRITICAL_ERROR.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoUse a variable to indicate Gen3 controllers and remove all PCI ids based
kadesai [Tue, 29 Nov 2016 12:53:05 +0000 (12:53 +0000)]
Use a variable to indicate Gen3 controllers and remove all PCI ids based
checks used for gen3 controllers.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoProblem statement:
kadesai [Tue, 29 Nov 2016 12:49:20 +0000 (12:49 +0000)]
Problem statement:
MFI linked list in megaraid_sas driver is used for mfi-mpt pass-through commands.
This list can be corrupted due to many possible race conditions in driver and
eventually we may see kernel panic.

One example -
MFI frame is freed from calling process as driver send command via polling method and interrupt
for that command comes after driver free mfi frame (actually even after some other context reuse
the mfi frame). When driver receive MPT frame in ISR, driver will be using the index of MFI and
access that MFI frame and finally in-used MFI frames list will be corrupted.

High level description of new solution -
Free MFI and MPT command from same context.
Free both the command either from process (from where mfi-mpt pass-through was called) or from
ISR context. Do not split freeing of MFI and MPT, because it creates the race condition which
will do MFI/MPT list.

Submitted by:   Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed by:    Kashyap Desai <Kashyap.Desai@broadcom.com>
MFC after:  3 days
Sponsored by:   Broadcom Limited/AVAGO Technologies

7 years agoMark the Broadcom code as FDT only, there is no ACPI support for the
andrew [Tue, 29 Nov 2016 12:46:42 +0000 (12:46 +0000)]
Mark the Broadcom code as FDT only, there is no ACPI support for the
Raspberry Pi 3.

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

7 years agoExplicitly initialize cdai.flags.
mav [Tue, 29 Nov 2016 11:13:43 +0000 (11:13 +0000)]
Explicitly initialize cdai.flags.

In SES driver uninitialized value caused unreliable physpath reporting.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

7 years agoFix 'ipfw delete set N':
oleg [Tue, 29 Nov 2016 10:43:58 +0000 (10:43 +0000)]
Fix 'ipfw delete set N':
do not emit meaningless 'rule 0 not found' warning if set was already empty.

MFC after: 1 week

7 years agoFix interrupt clear in pl011 uart receive function
jchandra [Tue, 29 Nov 2016 04:32:14 +0000 (04:32 +0000)]
Fix interrupt clear in pl011 uart receive function

Clear the interrupt state before reading the input char from the
input FIFO. In the current code there is a window between the read
to the data register and the write to the the ICR, during which an
input char will not cause an interrupt.

This fixes the issue by which the serial port input on QEMU freezes
when using the emulated pl011 serial port.

7 years agoUse the correct name for the GCC macro indicating max_align_t is defined.
jhb [Tue, 29 Nov 2016 00:16:19 +0000 (00:16 +0000)]
Use the correct name for the GCC macro indicating max_align_t is defined.

MFC after: 3 days

7 years agoTrying to autodetect legacy setups lead to problems when people
imp [Mon, 28 Nov 2016 21:29:01 +0000 (21:29 +0000)]
Trying to autodetect legacy setups lead to problems when people
overrode the disk image creation routine. For now, just always bring
in the legecy defines / routines.

7 years agoAdd a FREEBSD-Xlist file for CK.
cognet [Mon, 28 Nov 2016 21:16:03 +0000 (21:16 +0000)]
Add a FREEBSD-Xlist file for CK.

7 years agoUse malloc()ed buffers instead of stack buffers in gr_copy() and pw_copy().
des [Mon, 28 Nov 2016 21:00:19 +0000 (21:00 +0000)]
Use malloc()ed buffers instead of stack buffers in gr_copy() and pw_copy().
This allows pw(8) to operate on passwd and group files with longer lines
than could be accomodated by a stack buffer.  It doesn't take more than a
few hundred users to exceed 8192 bytes in /etc/group.

MFC after: 3 weeks
Sponsored by: The University of Oslo

7 years agoHook CK to the kernel build.
cognet [Mon, 28 Nov 2016 20:44:12 +0000 (20:44 +0000)]
Hook CK to the kernel build.

7 years agoAdd FreeBSD-specific files.
cognet [Mon, 28 Nov 2016 20:33:30 +0000 (20:33 +0000)]
Add FreeBSD-specific files.

7 years agoImport Concurrency Kit in the kernel.
cognet [Mon, 28 Nov 2016 20:27:58 +0000 (20:27 +0000)]
Import Concurrency Kit in the kernel.
CK is a toolkit providing different lockfree algorithms/data structures.
More information can be found here : www.concurrencykit.org

7 years agoRemove files that won't be used during FreeBSD build.
cognet [Mon, 28 Nov 2016 20:22:32 +0000 (20:22 +0000)]
Remove files that won't be used during FreeBSD build.

7 years agoFix packaging for clang, lldb and lld 3.9.0
dim [Mon, 28 Nov 2016 20:13:56 +0000 (20:13 +0000)]
Fix packaging for clang, lldb and lld 3.9.0

During the upgrade of clang/llvm etc to 3.9.0 in r309124, the PACKAGE
directive in the usr.bin/clang/*.mk files got dropped accidentally.

Restore it, with a few minor changes and additions:
* Correct license in clang.ucl to NCSA
* Add PACKAGE=clang for clang and most of the "ll" tools
* Put lldb in its own package
* Put lld in its own package

Reviewed by: gjb, jmallett
X-MFC-With: 309124
Differential Revision: https://reviews.freebsd.org/D8666

7 years agoImport concurrencykit as of commit 566bb28dba963a1904e0889b74fe7005a5bc5eb8
cognet [Mon, 28 Nov 2016 20:08:52 +0000 (20:08 +0000)]
Import concurrencykit as of commit 566bb28dba963a1904e0889b74fe7005a5bc5eb8

7 years agoRework ip_tryforward() to use FIB4 KPI.
ae [Mon, 28 Nov 2016 17:55:32 +0000 (17:55 +0000)]
Rework ip_tryforward() to use FIB4 KPI.

Tested by: olivier
Obtained from: Yandex LLC
MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D8526

7 years ago[ath] force wake the hardware if we see a missed beacon.
adrian [Mon, 28 Nov 2016 17:54:29 +0000 (17:54 +0000)]
[ath] force wake the hardware if we see a missed beacon.

This adds a workaround to incorrectly behaving APs (ie, FreeBSD APs) which
don't beacon out exactly when they should (at TBTT multiples of beacon
intervals.)

It forces the hardware awake (but leaves it in network-sleep so self
generated frames still state that the hardware is asleep!) and will
remain awake until the next sleep transition driven by net80211.

That way if the beacons are just at the wrong interval, we get a much
better chance of hearing more consecutive beacons before we go to sleep,
thus not constantly disconnecting.

Tested:

* AR9485, STA mode, against a misbehaving FreeBSD AP.

7 years ago[ath] revert the previous commit, after reading the 802.11-2012 spec a bit more.
adrian [Mon, 28 Nov 2016 17:06:35 +0000 (17:06 +0000)]
[ath] revert the previous commit, after reading the 802.11-2012 spec a bit more.

The 802.11-2012 spec talks about this - section 10.1.3.2 - Beacon Generation
in Infrastructure Networks.  So yes, we should be expecting beacons to be
going out in multiples of intval.

Silly adrian.

So:

* fix the FreeBSD APs that are sending beacons at incorrect TBTTs (target
  beacon transmit time); and
* yes indeed we will have to wake up out of network sleep until we sync
  a beacon.

7 years agoAdd more ASMedia PCI IDs from different sources.
mav [Mon, 28 Nov 2016 16:25:05 +0000 (16:25 +0000)]
Add more ASMedia PCI IDs from different sources.

Exact device names are not clear, but its better then nothing at all.

MFC after: 1 month

7 years agoProcess port interrupt even is PxIS register is zero.
mav [Mon, 28 Nov 2016 16:23:32 +0000 (16:23 +0000)]
Process port interrupt even is PxIS register is zero.

ASMedia ASM1062 AHCI chips with some fancy firmware handling PMP inside
seems sometimes forgeting to set bits in PxIS, causing command timeouts.
Removal of this check fixes the issue by the theoretical cost of slightly
higher CPU usage in some odd cases, but this is what Linux does too.

MFC after: 1 month

7 years agoMFV r309249: 3821 Race in rollback, zil close, and zil flush
avg [Mon, 28 Nov 2016 15:14:31 +0000 (15:14 +0000)]
MFV r309249: 3821 Race in rollback, zil close, and zil flush

Note: there was a merge conflict resolved by me.

illumos/illumos-gate@43297f973a3543e7403ac27076490ab958a94b15
https://github.com/illumos/illumos-gate/commit/43297f973a3543e7403ac27076490ab958a94b15

https://www.illumos.org/issues/3821
  We recently had nodes with some of the latest zfs bits panic on us in a
  rollback-heavy environment. The following is from my preliminary analysis:
  Let's look at where we died:
  > $C
  ffffff01ea6b9a10 taskq_dispatch+0x3a(0, fffffffff7d20450ffffff5551dea920, 1)
  ffffff01ea6b9a60 zil_clean+0xce(ffffff4b7106c080, 7e0f1)
  ffffff01ea6b9aa0 dsl_pool_sync_done+0x47(ffffff4313065680, 7e0f1)
  ffffff01ea6b9b70 spa_sync+0x55f(ffffff4310c1d040, 7e0f1)
  ffffff01ea6b9c20 txg_sync_thread+0x20f(ffffff4313065680)
  ffffff01ea6b9c30 thread_start+8()
  If we dig in we can find that this dataset corresponds to a zone:
  > ffffff4b7106c080::print zilog_t zl_os->os_dsl_dataset->ds_dir->dd_myname
  zl_os->os_dsl_dataset->ds_dir->dd_myname = [ "8ffce16a-13c2-4efa-a233-
  9e378e89877b" ]
  Okay so we have a null taskq pointer. That only happens during the calls to
  zil_open and zil_close. If we poke around we can see that we're actually in
  midst of a rollback:
  > ::pgrep zfs | ::printf "0x%x %s\\n" proc_t . p_user.u_psargs
  0xffffff43262800a0 zfs rollback zones/15714eb6-f5ea-469f-ac6d-
  4b8ab06213c2@marlin_init
  0xffffff54e22a1028 zfs rollback zones/8ffce16a-13c2-4efa-a233-
  9e378e89877b@marlin_init
  0xffffff4362f3a058 zfs rollback zones/0ddb8e49-ca7e-42e1-8fdc-
  4ac4ba8fe9f8@marlin_init
  0xffffff5748e8d020 zfs rollback zones/426357b5-832d-4430-953e-
  10cd45ff8e9f@marlin_init
  0xffffff436b867008 zfs rollback zones/8f36bf37-8a9c-4a44-995c-
  6d1b2751e6f5@marlin_init
  0xffffff4381ad4090 zfs rollback zones/6c8eca18-fbd6-46dd-ac24-
  2ed45cd0da70@marlin_init

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: George Wilson <george.wilson@delphix.com>

MFC after: 3 weeks

7 years agoFix ISS_DATA_DFSC_MASK, it should include all bits in the field.
andrew [Mon, 28 Nov 2016 14:24:07 +0000 (14:24 +0000)]
Fix ISS_DATA_DFSC_MASK, it should include all bits in the field.

7 years ago[ath] wake up the hardware from power-save before doing transmit completion checking.
adrian [Mon, 28 Nov 2016 08:13:20 +0000 (08:13 +0000)]
[ath] wake up the hardware from power-save before doing transmit completion checking.

This was being done in the pre-AR9380 case, but not for AR9380 and later.
When powersave in STA mode is enabled, this may have lead to the transmit
completion code doing this:

* call the task, which doesn't wake up the hardware
* complete the frames, which doesn't touch the hardware
* schedule pending frames on the hardware queue, which DOES touch the
  hardware, and this will be ignored

This would show up in the logs like this:

(with debugging enabled):
Nov 27 23:03:56 lovelace kernel: Q1[  0] (nseg=1) (DS.V:0xfffffe011bd57300 DS.P:0x49b57300) I: 168cc117 L:00000000 F:0005
...
(in general, doesn't require debugging enabled):
Nov 27 23:03:56 lovelace kernel: ath_hal_reg_write: reg=0x00000804, val=0x49b57300, pm=2

That register is a EDMA TX FIFO register (queue 1), and the val is the descriptor
being written.

Whilst here, make sure the software queue gets kicked here.

Tested;

* AR9485, STA mode + powersave

7 years agohyperv/vmbus: Use poll/cancel APIs to wait for the CHOPEN response.
sephe [Mon, 28 Nov 2016 07:56:03 +0000 (07:56 +0000)]
hyperv/vmbus: Use poll/cancel APIs to wait for the CHOPEN response.

Since hypervisor does not respond CHOPEN to a revoked channel.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8636

7 years agohyperv/vmbus: Add exec cancel support for message Hypercall API.
sephe [Mon, 28 Nov 2016 07:44:50 +0000 (07:44 +0000)]
hyperv/vmbus: Add exec cancel support for message Hypercall API.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8635

7 years agoPlug another leak with malformed IPv6 address.
delphij [Mon, 28 Nov 2016 07:41:01 +0000 (07:41 +0000)]
Plug another leak with malformed IPv6 address.

MFC after: 2 weeks

7 years agohyperv/vmbus: Add result polling support for message Hypercall API.
sephe [Mon, 28 Nov 2016 07:36:51 +0000 (07:36 +0000)]
hyperv/vmbus: Add result polling support for message Hypercall API.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8634

7 years agoDon't leak 'str' when we see a malformed IPv6 address.
delphij [Mon, 28 Nov 2016 07:33:26 +0000 (07:33 +0000)]
Don't leak 'str' when we see a malformed IPv6 address.

MFC after: 2 weeks

7 years agohyperv/vmbus: Add result polling support for xact API.
sephe [Mon, 28 Nov 2016 07:27:08 +0000 (07:27 +0000)]
hyperv/vmbus: Add result polling support for xact API.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8633

7 years agostyle(9).
delphij [Mon, 28 Nov 2016 07:21:09 +0000 (07:21 +0000)]
style(9).

MFC after: 2 weeks

7 years agoPlug a potential memory leak.
delphij [Mon, 28 Nov 2016 07:19:45 +0000 (07:19 +0000)]
Plug a potential memory leak.

MFC after: 2 weeks

7 years agohyperv/vmbus: Stringent GPADL parameter assertion.
sephe [Mon, 28 Nov 2016 07:04:32 +0000 (07:04 +0000)]
hyperv/vmbus: Stringent GPADL parameter assertion.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8632

7 years agohyperv/vmbus: Make sure that the allocated GPADL is not zero.
sephe [Mon, 28 Nov 2016 06:53:00 +0000 (06:53 +0000)]
hyperv/vmbus: Make sure that the allocated GPADL is not zero.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8631

7 years agohyperv/hn: Simplify RSS indirect table fixup API
sephe [Mon, 28 Nov 2016 06:40:26 +0000 (06:40 +0000)]
hyperv/hn: Simplify RSS indirect table fixup API

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8630

7 years agopages and psize are always assigned, so there is no need to initialize
delphij [Mon, 28 Nov 2016 06:38:41 +0000 (06:38 +0000)]
pages and psize are always assigned, so there is no need to initialize
them as zero.

MFC after: 2 weeks

7 years agoEliminate variables that are computed, assigned but never
delphij [Mon, 28 Nov 2016 06:36:10 +0000 (06:36 +0000)]
Eliminate variables that are computed, assigned but never
used.

MFC after: 2 weeks

7 years agoFix an obvious typo.
delphij [Mon, 28 Nov 2016 06:32:05 +0000 (06:32 +0000)]
Fix an obvious typo.

MFC after: 2 weeks

7 years agohyperv/hn: Fix vmbus_chan_subidx usage.
sephe [Mon, 28 Nov 2016 06:10:41 +0000 (06:10 +0000)]
hyperv/hn: Fix vmbus_chan_subidx usage.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8629

7 years agohyperv/hn: Enable multi-packet RNDIS message support by default.
sephe [Mon, 28 Nov 2016 05:54:20 +0000 (05:54 +0000)]
hyperv/hn: Enable multi-packet RNDIS message support by default.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8621

7 years agohyperv/hn: Fix attach error handling
sephe [Mon, 28 Nov 2016 05:46:00 +0000 (05:46 +0000)]
hyperv/hn: Fix attach error handling

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8620

7 years agohyperv/hn: Fix multi-packet RNDIS message aggregation size setting.
sephe [Mon, 28 Nov 2016 05:31:36 +0000 (05:31 +0000)]
hyperv/hn: Fix multi-packet RNDIS message aggregation size setting.

Just in case that no chimney sending buffer can be used.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8619

7 years agohyperv/hn: Fix detach error handling.
sephe [Mon, 28 Nov 2016 05:23:57 +0000 (05:23 +0000)]
hyperv/hn: Fix detach error handling.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8613

7 years agohyperv/hn: Utilize vmbus_chan_xact_wait
sephe [Mon, 28 Nov 2016 05:15:28 +0000 (05:15 +0000)]
hyperv/hn: Utilize vmbus_chan_xact_wait

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8612

7 years agohyperv/vmbus: Add supportive transaction wait function.
sephe [Mon, 28 Nov 2016 05:07:48 +0000 (05:07 +0000)]
hyperv/vmbus: Add supportive transaction wait function.

This function supports channel revocation properly.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8611

7 years agohyperv/vmbus: Zero out GPADL if error happens.
sephe [Mon, 28 Nov 2016 04:53:36 +0000 (04:53 +0000)]
hyperv/vmbus: Zero out GPADL if error happens.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8601

7 years ago[ath] fix target beacon interval programming for STA mode when in powersave.
adrian [Mon, 28 Nov 2016 02:59:33 +0000 (02:59 +0000)]
[ath] fix target beacon interval programming for STA mode when in powersave.

This bug has been bugging me for quite some time.  I finally sat down
with enough coffee to figure it out.

The short of it - rounding up to the next intval multiple of the TSF value
only works if the AP is transmitting all its beacons on an interval of
the TSF.  If it isn't - for example, doing staggered beacons on a multi-VAP
setup with a single hardware TSF - then weird things occur.

The long of it -

When powersave is enabled, the MAC and PHY are partially powered off.
They can't receive any packets (or transmit, for that matter.)
The target beacon timer programming will wake up the MAC/PHY just before
the beacon is supposed to be received (well, strictly speaking, at DTIM
so it can see the TIM - traffic information map - telling the STA whether
any traffic is there for it) and it happens automatically.

However, this relies on the target beacon time being programmed correctly.
If it isn't then the hardware will wake up and not hear any beacons -
and then it'll be asleep for said beacons.  After enough of this, net80211
will give up and assume the AP went away.

This should fix both TSFOOR interrupts and disconnects from APs with powersave
enabled.

The annoying bit is that it only happens if APs stagger things or start
on a non-zero TSF.  So, this would sometimes be fine and sometimes not be
fine.

What:

* I don't know (yet) why the code rounds up to the next intval.
  For now, just disable rounding it and trust the value we get.

TODO:

* If we do see a beacon miss in STA mode then we should transition
  out of sleep for a while so we can hear beacons to resync against.
  I'd love a patch from someone to enable that particular behaviour.
  Note - that doesn't require that net80211 brings the chip out of
  sleep state - only that we wake the chip up through to full-on and
  then let it go to sleep again when we've seen a beacon.  The wifi
  stack and AP can still completely just stay believing we're in sleep
  mode.

Tested:

* AR9485, STA mode, powersave enabled

MFC after: 1 week
Relnotes: Yes

7 years ago[ath] include logging of TU versions of the TSF values.
adrian [Mon, 28 Nov 2016 02:51:55 +0000 (02:51 +0000)]
[ath] include logging of TU versions of the TSF values.

The beacon programming side of things deals in TUs and 1/8th TUs, so
it's good to se the TU value here when debugging beaconing issues.

7 years agoindent(1): Properly handle the wide string literal and wide char constant L.
pfg [Sun, 27 Nov 2016 20:38:14 +0000 (20:38 +0000)]
indent(1): Properly handle the wide string literal and wide char constant L.

indent(1) treated the "L" in "L'a'" as if it were an identifier and forced
a space character after it, breaking valid code.

PR: 143090
MFC after: 2 weeks

7 years agoindent(1): fix regression introduced in r303596.
pfg [Sun, 27 Nov 2016 20:30:09 +0000 (20:30 +0000)]
indent(1): fix regression introduced in r303596.

Multi-line comments are always block comments in KNF. Restore properly,
handling the case when a long one-liner gets wrapped and becomes a
multi-line comment.

Obtained from: Piotr Stefaniak

7 years agoindent(1): minor off-by-one error.
pfg [Sun, 27 Nov 2016 20:11:55 +0000 (20:11 +0000)]
indent(1): minor off-by-one error.

This was introduced in r303571.

Obtianed from: Piotr Stefaniak

7 years agoProperly initialize nextp
bapt [Sun, 27 Nov 2016 19:27:13 +0000 (19:27 +0000)]
Properly initialize nextp

MFC after: 1 day

7 years ago[ath] Begin to lay the groundwork for btcoex related ioctl controls.
adrian [Sun, 27 Nov 2016 18:34:29 +0000 (18:34 +0000)]
[ath] Begin to lay the groundwork for btcoex related ioctl controls.

7 years agorsu: add support for hardware multicast filter setup.
avos [Sun, 27 Nov 2016 18:06:03 +0000 (18:06 +0000)]
rsu: add support for hardware multicast filter setup.

The algorithm is the same as in rtwn(4).

Tested with Asus USB-N10 (STA) + RTL8188CUS (AP).

7 years agoAdd a few missed clang 3.9.0 files to OptionalObsoleteFiles.
dim [Sun, 27 Nov 2016 14:19:19 +0000 (14:19 +0000)]
Add a few missed clang 3.9.0 files to OptionalObsoleteFiles.

X-MFC-With: 309149

7 years agoFix spelling.
hselasky [Sun, 27 Nov 2016 12:04:54 +0000 (12:04 +0000)]
Fix spelling.

7 years agorsu: various scanning fixes.
avos [Sun, 27 Nov 2016 12:03:34 +0000 (12:03 +0000)]
rsu: various scanning fixes.

- Set IEEE80211_FEXT_SCAN_OFFLOAD flag; firmware can send null data
frames when associated.
- Check IEEE80211_SCAN_ACTIVE scan flag instead of IEEE80211_F_ASCAN
ic flag; the last is never set since r170530.
- Eliminate software scan (net80211) <-> site_survey (driver) race:
 * override ic_scan_curchan and ic_scan_mindwell pointers so net80211
will not try to finish scanning automatically;
 * inform net80211 about current status via ieee80211_cancel_scan()
and ieee80211_scan_done();
 * remove corresponding workaround from rsu_join_bss().

Now the driver can associate to an AP with hidden SSID.

Tested with Asus USB-N10.

7 years agoNFSv4 client tracks opens, and the track records are only dropped when
kib [Sun, 27 Nov 2016 09:20:58 +0000 (09:20 +0000)]
NFSv4 client tracks opens, and the track records are only dropped when
the vnode is inactivated.  This contradicts with the nullfs caching
which keeps upper vnode around, as consequence keeping the use
reference to lower vnode.

Add a filesystem flag to request nullfs to not cache when mounted over
that filesystem, and set the flag for nfs v4 mounts.

Reported by: asomers
Reviewed by: rmacklem
Tested by: asomers, rmacklem
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoThe function vm_page_cache() no longer exists. Remove its man page.
alc [Sun, 27 Nov 2016 01:44:31 +0000 (01:44 +0000)]
The function vm_page_cache() no longer exists.  Remove its man page.

7 years agoRecursion on the free page queue mutex occurred when UMA needed to allocate
alc [Sun, 27 Nov 2016 01:42:53 +0000 (01:42 +0000)]
Recursion on the free page queue mutex occurred when UMA needed to allocate
a new page of radix trie nodes to complete a vm_radix_insert() operation
that was requested by vm_page_cache().  Specifically, vm_page_cache()
already held the free page queue lock when UMA tried to acquire it through
a call to vm_page_alloc().  This code path no longer exists, so there is no
longer any reason to allow recursion on the free page queue mutex.

Improve nearby comments.

Reviewed by: kib, markj
Tested by: pho
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8628

7 years agobhnd(4): Unify NVRAM/SPROM parsing, implement compact SPROM layout encoding.
landonf [Sat, 26 Nov 2016 23:22:32 +0000 (23:22 +0000)]
bhnd(4): Unify NVRAM/SPROM parsing, implement compact SPROM layout encoding.

- Defined an abstract NVRAM I/O API (bhnd_nvram_io), decoupling NVRAM/SPROM
  parsing from the actual underlying NVRAM data provider (e.g. CFE firmware
  devices).
- Defined an abstract NVRAM data API (bhnd_nvram_data), decoupling
  higher-level NVRAM operations (indexed lookup, data conversion, etc) from
  the underlying NVRAM file format parsing/serialization.
- Implemented a new high-level bhnd_nvram_store API, providing indexed
  variable lookup, pending write tracking, etc on top of an arbitrary
  bhnd_nvram_data instance.
- Migrated all bhnd(4) NVRAM device drivers to the common bhnd_nvram_store
  API.
- Implemented a common bhnd_nvram_val API for parsing/encoding NVRAM
  variable values, including applying format-specific behavior when
  converting to/from the NVRAM string representations.
- Dropped the now unnecessary bhnd_nvram driver, and moved the
  broadcom/mips-specific CFE NVRAM driver out into sys/mips/broadcom.
- Implemented a new nvram_map file format:
        - Variable definitions are now defined separately from the SPROM
          layout. This will also allow us to define CIS tuple NVRAM
          mappings referencing the common NVRAM variable definitions.
        - Variables can now be defined within arbitrary named groups.
        - Textual descriptions and help information can be defined inline
          for both variables and variable groups.
        - Implemented a new, compact encoding of SPROM image layout
          offsets.
- Source-level (but not build system) support for building the NVRAM file
  format APIs (bhnd_nvram_io, bhnd_nvram_data, bhnd_nvram_store) as a
  userspace library.

The new compact SPROM image layout encoding is loosely modeled on Apple
dyld compressed LINKEDIT symbol binding opcodes; it provides a compact
state-machine encoding of the mapping between NVRAM variables and the SPROM
image offset, mask, and shift instructions necessary to decode or encode
the SPROM variable data.

The compact encoding reduces the size of the generated SPROM layout data
from roughly 60KB to 3KB. The sequential nature SPROM layout opcode tables
also simplify iteration of the SPROM variables, as it's no longer
neccessary to iterate the full NVRAM variable definition table, but
instead simply scan the SPROM revision's layout opcode table.

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

7 years agoAdd a missing header
scottl [Sat, 26 Nov 2016 23:15:11 +0000 (23:15 +0000)]
Add a missing header

7 years agoLaunder VPO_NOSYNC pages upon vnode deactivation.
markj [Sat, 26 Nov 2016 21:00:27 +0000 (21:00 +0000)]
Launder VPO_NOSYNC pages upon vnode deactivation.

As of r234483, vnode deactivation causes non-VPO_NOSYNC pages to be
laundered. This behaviour has two problems:

1. Dirty VPO_NOSYNC pages must be laundered before the vnode can be
   reclaimed, and this work may be unfairly deferred to the vnlru process
   or an unrelated application when the system is under vnode pressure.
2. Deactivation of a vnode with dirty VPO_NOSYNC pages requires a scan of
   the corresponding VM object's memq for non-VPO_NOSYNC dirty pages; if
   the laundry thread needs to launder pages from an unreferenced such
   vnode, it will reactivate and deactivate the vnode with each laundering,
   potentially resulting in a large number of expensive scans.

Therefore, ensure that all dirty pages are laundered upon deactivation,
i.e., when all maps of the vnode are removed and all references are
released.

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