]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoCorrect syntax errors that only show up when compiled with INVARIANTS.
Ian Lepore [Sat, 9 Jul 2016 18:43:15 +0000 (18:43 +0000)]
Correct syntax errors that only show up when compiled with INVARIANTS.

8 years agodd(1): Enable access to SIZE_T_MAX character devices
Conrad Meyer [Sat, 9 Jul 2016 17:11:54 +0000 (17:11 +0000)]
dd(1): Enable access to SIZE_T_MAX character devices

On machines where SIZE_T_MAX exceeds OFF_MAX (signed 64-bit), permit seeking
character devices to negative off_t values.  This enables dd(1) to interact
with kernel KVA in /dev/kmem on amd64, for example.

Sponsored by: EMC / Isilon Storage Division

8 years agoImprove checksum "offload" support.
Alexander Motin [Sat, 9 Jul 2016 14:59:16 +0000 (14:59 +0000)]
Improve checksum "offload" support.

For compatibility reasons make driver not report any checksum offload by
default, since there is indeed none.  But if administrator knows that
interface is used only for local traffic, he can enable fake checksum
offload manually on both sides to save some CPU cycles, since the data
are already protected by CRC32 of PCIe link.

Sponsored by: iXsystems, Inc.

8 years agoRemove an unneeded call to fdt_get_unit, the return value is unused.
Andrew Turner [Sat, 9 Jul 2016 13:27:14 +0000 (13:27 +0000)]
Remove an unneeded call to fdt_get_unit, the return value is unused.

MFC after: 1 month
Sponsored by: ABT Systems Ltd

8 years agopf: Map hook returns onto the correct error values
Kristof Provost [Sat, 9 Jul 2016 12:17:01 +0000 (12:17 +0000)]
pf: Map hook returns onto the correct error values

pf returns PF_PASS, PF_DROP, ... in the netpfil hooks, but the hook callers
expect to get E<foo> error codes.
Map the returns values. A pass is 0 (everything is OK), anything else means
pf ate the packet, so return EACCES, which tells the stack not to emit an ICMP
error message.

PR: 207598

8 years agoRewrite if_ntb to use modern interface KPIs and features.
Alexander Motin [Sat, 9 Jul 2016 12:10:08 +0000 (12:10 +0000)]
Rewrite if_ntb to use modern interface KPIs and features.

It includes: link state, if_transmit, buf_ring, multiple queues, bpf, etc.

Sponsored by: iXsystems, Inc.

8 years agoImprove memory allocation errors handling on receive.
Alexander Motin [Sat, 9 Jul 2016 12:00:04 +0000 (12:00 +0000)]
Improve memory allocation errors handling on receive.

8 years agoSynchronize MTU code with Linux.
Alexander Motin [Sat, 9 Jul 2016 11:58:59 +0000 (11:58 +0000)]
Synchronize MTU code with Linux.

It is mandatory for transport compatibility.

8 years agoReimplement doorbell register emulation for NTB_SB01BASE_LOCKUP.
Alexander Motin [Sat, 9 Jul 2016 11:57:21 +0000 (11:57 +0000)]
Reimplement doorbell register emulation for NTB_SB01BASE_LOCKUP.

This allows at least first three doorbells to work very close to normal
hardware, properly signaling events to upper layers without spurious or
lost events.  Doorbells above the first three may still report spurious
events due to lack of reliable information, but they are rarely used.

8 years agoBring some more order into link and qp state handling.
Alexander Motin [Sat, 9 Jul 2016 11:48:57 +0000 (11:48 +0000)]
Bring some more order into link and qp state handling.

Do not touch scratchpad registers until link is reported up.
Mask and do not handle doorbell events until respective qp is up.

8 years agoSwitch ctx_lock from mutex to rmlock.
Alexander Motin [Sat, 9 Jul 2016 11:47:52 +0000 (11:47 +0000)]
Switch ctx_lock from mutex to rmlock.

It is odd idea to serialize different MSI-X vectors.  Use of rmlocks
here allows them to execute in parallel, but still protects ctx.
If upper layers require any additional serialization -- they can
do it by themselves.

8 years agoCreate separate RX taskqueue for each qp.
Alexander Motin [Sat, 9 Jul 2016 11:46:32 +0000 (11:46 +0000)]
Create separate RX taskqueue for each qp.

8 years agoRemove rx_completion_task taskqueue.
Alexander Motin [Sat, 9 Jul 2016 11:45:18 +0000 (11:45 +0000)]
Remove rx_completion_task taskqueue.

It is not needed after RX lock removed in previous commit.

8 years agoRemove unneeded RX lock, and make TX lock per-qp.
Alexander Motin [Sat, 9 Jul 2016 11:43:51 +0000 (11:43 +0000)]
Remove unneeded RX lock, and make TX lock per-qp.

8 years agoReduce code divergence from Linux, preparing for DMA support.
Alexander Motin [Sat, 9 Jul 2016 11:40:59 +0000 (11:40 +0000)]
Reduce code divergence from Linux, preparing for DMA support.

8 years agoFix operation with multiple qps.
Alexander Motin [Sat, 9 Jul 2016 11:36:09 +0000 (11:36 +0000)]
Fix operation with multiple qps.

8 years agoAdd myself (tcberner) as ports committer, and update mentor/mentee relationships.
Tobias C. Berner [Sat, 9 Jul 2016 11:22:11 +0000 (11:22 +0000)]
Add myself (tcberner) as ports committer, and update mentor/mentee relationships.

Approved by: rakuco (mentor)

8 years agoNewBus'ify NTB subsystem.
Alexander Motin [Sat, 9 Jul 2016 11:20:42 +0000 (11:20 +0000)]
NewBus'ify NTB subsystem.

This follows NTB subsystem modularization in Linux, tuning it to FreeBSD
native NewBus interfaces.  This change allows to support different types
of hardware with different drivers, support multiple NTB instances in a
system, ntb_transport module use for needs other then if_ntb, etc.

Sponsored by: iXsystems, Inc.

8 years agoRemove some dead code found by Clang static analyzer.
Alexander Motin [Sat, 9 Jul 2016 09:47:11 +0000 (09:47 +0000)]
Remove some dead code found by Clang static analyzer.

8 years agoFix NTB_SDOORBELL_LOCKUP workaround.
Alexander Motin [Sat, 9 Jul 2016 09:34:24 +0000 (09:34 +0000)]
Fix NTB_SDOORBELL_LOCKUP workaround.

Since SBARxSZ register can be write-once, it can be unusable for disabling
the SBAR.  For such case also set SBARxBASE to zero to not intersect with
config BAR.

8 years agoRevert the change from errx/strerror to errc to appease gcc 4.2
Baptiste Daroussin [Sat, 9 Jul 2016 06:52:55 +0000 (06:52 +0000)]
Revert the change from errx/strerror to errc to appease gcc 4.2

8 years agoAdd -P to pathchk usage
Eitan Adler [Sat, 9 Jul 2016 04:56:28 +0000 (04:56 +0000)]
Add -P to pathchk usage

8 years agong_mppc(4):: basic readability cleanups.
Pedro F. Giffuni [Sat, 9 Jul 2016 02:33:45 +0000 (02:33 +0000)]
ng_mppc(4):: basic readability cleanups.

In particular use __unreachable() to appease static analyzers.
No functional change.

CID: 1356591
MFC after: 3 days

8 years agolibunwind: limit stack usage in unwind cursor
Ed Maste [Sat, 9 Jul 2016 00:35:20 +0000 (00:35 +0000)]
libunwind: limit stack usage in unwind cursor

This may be reworked upstream but in the interim should address the
stack usage issue reported in the PR.

PR: 206384
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoOn FreeBSD there is a setsockopt option SO_USER_COOKIE which allows
George V. Neville-Neil [Fri, 8 Jul 2016 23:44:09 +0000 (23:44 +0000)]
On FreeBSD there is a setsockopt option SO_USER_COOKIE which allows
setting a 32 bit value on each socket. This can be used by applications
and DTrace as a rendezvous point so that an applicaton's data can
more easily be captured at run time. Expose the user cookie via
DTrace by updating the translator in tcp.d and add a quick test
program, a TCP server, that sets the cookie on each connection
accepted.

Reviewed by: hiren
MFC after: 1 week
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D7152

8 years agoSync usage between program and man page. Increase column width. [1]
Baptiste Daroussin [Fri, 8 Jul 2016 23:40:25 +0000 (23:40 +0000)]
Sync usage between program and man page. Increase column width. [1]
Simplifay the usage() function
Replace errx/strerror with errc

Submitted by: wiz@NetBSD.org [1]
Obtained from: NetBSD

8 years agoAdd support for Allwinner A13.
Emmanuel Vadot [Fri, 8 Jul 2016 23:38:25 +0000 (23:38 +0000)]
Add support for Allwinner A13.

Reviewed by: jmcneill
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D6809

8 years agoAdd RCS Id. Sort options in SYNOPSIS. Fix macro usage. Fix Dd.
Baptiste Daroussin [Fri, 8 Jul 2016 23:10:55 +0000 (23:10 +0000)]
Add RCS Id. Sort options in SYNOPSIS. Fix macro usage. Fix Dd.

Submitted by: wiz@NetBSD.org
Obtained from: NetBSD

8 years agoCheck that the pin function exists before setting it.
Emmanuel Vadot [Fri, 8 Jul 2016 23:08:59 +0000 (23:08 +0000)]
Check that the pin function exists before setting it.
This is needed for Allwinner A13 which has gpio pins with only "out" function.

8 years agoAllow to install various components of the locales independantly
Baptiste Daroussin [Fri, 8 Jul 2016 23:07:48 +0000 (23:07 +0000)]
Allow to install various components of the locales independantly

8 years ago[ath_hal] add in locationing timer support and capabilities.
Adrian Chadd [Fri, 8 Jul 2016 22:59:15 +0000 (22:59 +0000)]
[ath_hal] add in locationing timer support and capabilities.

* add support to read the timer and capability
* add support to enable/disable the location timer.

On AR9380 at least, enabling the location timer is required to make
the timer tick, otherwise location packets return a timestamp of 0.
However, it then makes /all/ RX packets use the RX location timestamp
instead of the TSF timestamp.

So, unless I find another magical way to do location timestamping,
we will have to dynamically switch things on/off and ensure the
TX/RX path handles the "different" timestamps correctly.

Tested:

* AR9380, STA mode

8 years ago[ath_hal] add locationing / tx-beamforming RX status descriptor decoding.
Adrian Chadd [Fri, 8 Jul 2016 22:39:37 +0000 (22:39 +0000)]
[ath_hal] add locationing / tx-beamforming RX status descriptor decoding.

* LOC_INFO is mostly just "did this packet come with a locationing
  timestamp instead of TSF";
* Decode not-sounding, uploaded-data, data-valid, data type and
  number of extension spatial streams.

8 years ago[ath_hal] Add setting positioning bit and clear sounding-disable bit.
Adrian Chadd [Fri, 8 Jul 2016 22:37:52 +0000 (22:37 +0000)]
[ath_hal] Add setting positioning bit and clear sounding-disable bit.

* If fast_ts is set then the TX timestamp is the fast timestamp, not
  normal TSF.
* If the TX descriptor has the position bit set then request locationing
  and clear sounding-disable.  This way we (a) get the response with
  the TX timestamp from the location side of things, and (b) we get
  a CSI dump of the response ACK, which we will eventually use in the
  locationing path.

8 years agoRemove extra 0x before %p format strings introduced by r296182
Oleksandr Tymoshenko [Fri, 8 Jul 2016 22:32:03 +0000 (22:32 +0000)]
Remove extra 0x before %p format strings introduced by r296182

8 years ago[ath] add a new buf flag, marking a buffer as involved with ToA/ToD positioning.
Adrian Chadd [Fri, 8 Jul 2016 22:20:35 +0000 (22:20 +0000)]
[ath] add a new buf flag, marking a buffer as involved with ToA/ToD positioning.

8 years ago[ath_hal] add capability bit for querying/controlling the ToA/ToD positioning code.
Adrian Chadd [Fri, 8 Jul 2016 21:37:04 +0000 (21:37 +0000)]
[ath_hal] add capability bit for querying/controlling the ToA/ToD positioning code.

8 years ago[ath] include ath_hal accessor macro changes.
Adrian Chadd [Fri, 8 Jul 2016 21:35:44 +0000 (21:35 +0000)]
[ath] include ath_hal accessor macro changes.

I missed this in the previous commit.

8 years ago[ath_hal] retire a "long RX desc" flag, store/use the TX/RX timestamp length.
Adrian Chadd [Fri, 8 Jul 2016 21:34:39 +0000 (21:34 +0000)]
[ath_hal] retire a "long RX desc" flag, store/use the TX/RX timestamp length.

* the code already stored the length of the RX desc, which I never used.
  So, use that and retire the new flag I introduced a while ago.
* Introduce a TX timestamp length field and capability.

8 years agoAdd emulation for multiple (up to 16) MSI vectors for AHCI.
Alexander Motin [Fri, 8 Jul 2016 21:30:18 +0000 (21:30 +0000)]
Add emulation for multiple (up to 16) MSI vectors for AHCI.

It was useless before, but may improve performance now if multiple devices
are configured and guest supports this feature.

Sponsored by: iXsystems, Inc.

8 years agoAllow AHCI controller to support up to 32 arbitrary devices.
Alexander Motin [Fri, 8 Jul 2016 21:25:37 +0000 (21:25 +0000)]
Allow AHCI controller to support up to 32 arbitrary devices.

While old syntax is still supported, new syntax looks like this:

-s 3,ahci,hd:/dev/zvol/XXX,hd:/dev/zvol/YYY,cd:/storage/ZZZ.iso

Sponsored by: iXsystems, Inc.

8 years agolibunwind: enable only the native unwinder by default
Ed Maste [Fri, 8 Jul 2016 21:17:24 +0000 (21:17 +0000)]
libunwind: enable only the native unwinder by default

This significantly reduces stack space requirements, and runtimes
require only native unwinding.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoAdd missing PORTS_OPTS to two make commands
Poul-Henning Kamp [Fri, 8 Jul 2016 20:33:20 +0000 (20:33 +0000)]
Add missing PORTS_OPTS to two make commands

8 years agolibunwind: update to upstream snapshot r272680
Ed Maste [Fri, 8 Jul 2016 20:20:46 +0000 (20:20 +0000)]
libunwind: update to upstream snapshot r272680

The key improvement is that it may be built without cross-unwinding
support, which significantly reduces the stack space requirement.

MFC after: 1 week
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7123

8 years agoUse TARGET here to fix check/delete-old after r302391.
Bryan Drewery [Fri, 8 Jul 2016 20:15:58 +0000 (20:15 +0000)]
Use TARGET here to fix check/delete-old after r302391.

usr.bin/Makefie.arm is used to install ofwdump so TARGET=arm should cover
all of the cases.

MFC after: now
Sponsored by: EMC / Isilon Storage Division

8 years agoDon't forget to set sa->narg for CloudABI system calls.
Ed Schouten [Fri, 8 Jul 2016 20:09:21 +0000 (20:09 +0000)]
Don't forget to set sa->narg for CloudABI system calls.

It turns out that this value is not used within the system call code
under normal conditions, except when using tracing tools like ktrace.
If we forget to set this value, it is set to random garbage. This may
cause ktrace to hang indefinitely, making it impossible to kill.

Reported by: Michael Plass
PR: 210800
MFC before: 11.0-RELEASE

8 years ago[ath_hal] extend the TX/RX descriptor layout to include location/beamforming fields.
Adrian Chadd [Fri, 8 Jul 2016 19:16:50 +0000 (19:16 +0000)]
[ath_hal] extend the TX/RX descriptor layout to include location/beamforming fields.

* extend the TX timestamp to 32 bits, as the AR5416 and later does a full
  32 bit TX timestamp instead of 15 or 16 bits.
* add RX descriptor fields for PHY uploaded information (coming soon)
* add flags for RX/TX fast timestamp, hardware upload, etc
* add a flag for TX to request ToD/ToA location information.

8 years agocxgbe(4): Add sysctl to display the RSS indirection table size for an
Navdeep Parhar [Fri, 8 Jul 2016 18:13:23 +0000 (18:13 +0000)]
cxgbe(4): Add sysctl to display the RSS indirection table size for an
interface.

dev.cxl.<n>.rss_size
dev.vcxl.<n>.rss_size

MFC after: 3 days

8 years agoiflib: Fix typo in 'iflib_rx_miss_bufs' sysctl name
Conrad Meyer [Fri, 8 Jul 2016 17:04:21 +0000 (17:04 +0000)]
iflib: Fix typo in 'iflib_rx_miss_bufs' sysctl name

It looks like these sysctls were copy-pasted from netmap.  Most were changed
from 'ixl_' prefix to 'iflib_', but this one was missed.

Fix the "can't re-use a leaf (ixl_rx_miss_bufs)!" warning.

Reported by: dim@ and others
Sponsored by: EMC / Isilon Storage Division

8 years agoRevert r302403
Enji Cooper [Fri, 8 Jul 2016 16:29:45 +0000 (16:29 +0000)]
Revert r302403

lang/gcc{48,49,5} lacks -fformat-extensions support (causing build errors, which
is what prompted r302403 to be committed). devel/amd64-gcc on the other hand
(which is used by Jenkins), has the support.

This fixes the Jenkins failure emails due to excessive warnings being produced
with "make buildkernel".

Discussed with: lwhsu
Reported by: Jenkins (FreeBSD_HEAD_amd64_gcc job)
Sponsored by: EMC / Isilon Storage Division

8 years agoDocument 300291, Enable NEW_PCIB on arm64.
Steven Kreuzer [Fri, 8 Jul 2016 13:29:47 +0000 (13:29 +0000)]
Document 300291, Enable NEW_PCIB on arm64.

Approved by: re (gjb, implicit, relnotes)

8 years agoDocument 301973, Add bsdconfig `wifi' (aka `wireless' or `wlan') module
Steven Kreuzer [Fri, 8 Jul 2016 13:26:17 +0000 (13:26 +0000)]
Document 301973, Add bsdconfig `wifi' (aka `wireless' or `wlan') module

Approved by: re (gjb, implicit, relnotes)

8 years agoDocument 300436, bsdinstall/zfsboot GPT+BIOS+GELI installs make use of GELIBOOT
Steven Kreuzer [Fri, 8 Jul 2016 13:21:51 +0000 (13:21 +0000)]
Document 300436, bsdinstall/zfsboot GPT+BIOS+GELI installs make use of GELIBOOT

Approved by: re (gjb, implicit, relnotes)

8 years agoDocument 293190, Update less to v481
Steven Kreuzer [Fri, 8 Jul 2016 13:12:24 +0000 (13:12 +0000)]
Document 293190, Update less to v481

Approved by: re (gjb, implicit, relnotes)

8 years agoDocument 289549, Update hostapd/wpa_supplicant to version 2.5.
Steven Kreuzer [Fri, 8 Jul 2016 13:09:55 +0000 (13:09 +0000)]
Document 289549, Update hostapd/wpa_supplicant to version 2.5.

Approved by: re (gjb, implicit, relnotes)

8 years agoDocument 302110, Merge netmap support from ncxgbe/ncxl to vcxgbe/vcxl
Steven Kreuzer [Fri, 8 Jul 2016 13:08:26 +0000 (13:08 +0000)]
Document 302110, Merge netmap support from ncxgbe/ncxl to vcxgbe/vcxl

Approved by: re (gjb, implicit, relnotes)

8 years agoSpell '12.x' correctly in UPDATING.
Glen Barber [Fri, 8 Jul 2016 02:19:09 +0000 (02:19 +0000)]
Spell '12.x' correctly in UPDATING.

Submitted by: lidl
Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

8 years agoSpell 10.2, 10.3, 12.0 correctly in various places.
Glen Barber [Fri, 8 Jul 2016 02:03:42 +0000 (02:03 +0000)]
Spell 10.2, 10.3, 12.0 correctly in various places.

Submitted by: markj
Approved by: re (implicit)
Pointyhat: gjb (myself)
Sponsored by: The FreeBSD Foundation

8 years agoAdd freebsd12 to contrib/gcc/config.gcc.
Glen Barber [Fri, 8 Jul 2016 01:56:52 +0000 (01:56 +0000)]
Add freebsd12 to contrib/gcc/config.gcc.

Submitted by: bdrewery
Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

8 years agoBump FREEBSD_CC_VERSION in lib/clang/freebsd_cc_version.h
Glen Barber [Fri, 8 Jul 2016 01:47:01 +0000 (01:47 +0000)]
Bump FREEBSD_CC_VERSION in lib/clang/freebsd_cc_version.h

Submitted by: bdrewery
Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

8 years agoDefault manual pages to 12.0 in head, and add missing 10.x
Glen Barber [Fri, 8 Jul 2016 00:54:21 +0000 (00:54 +0000)]
Default manual pages to 12.0 in head, and add missing 10.x
releases.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

8 years agoSpell 1200000 correctly.
Glen Barber [Fri, 8 Jul 2016 00:52:53 +0000 (00:52 +0000)]
Spell 1200000 correctly.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

8 years agoReflect head is now 12.0-CURRENT.
Glen Barber [Fri, 8 Jul 2016 00:12:29 +0000 (00:12 +0000)]
Reflect head is now 12.0-CURRENT.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

8 years agoDo not use -fformat-extensions with non-base versions of gcc
Enji Cooper [Thu, 7 Jul 2016 22:44:23 +0000 (22:44 +0000)]
Do not use -fformat-extensions with non-base versions of gcc

Ports versions of gcc do not have -fformat-extensions support.

This unbreaks compiling the kernel/modules with non-base gcc (4.8,
5.0, etc) if MK_FORMAT_EXTENSIONS=yes (the default).

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7150
Reviewed by: bdrewery
Sponsored by: EMC / Isilon Storage Division

8 years agoFix ahci(4) driver attach to controller with 32 ports.
Alexander Motin [Thu, 7 Jul 2016 22:10:10 +0000 (22:10 +0000)]
Fix ahci(4) driver attach to controller with 32 ports.

Incorrect sign expansion in variables that supposed to be a bit fields
caused infinite loop.  Fixing this allows system properly detect maximal
possible 32 devices configured on AHCI HBA of BHyVe.  That case did not
happen in a wild before due to lack of hardware AHCI HBAs with 32 ports.

Approved by: re (gjb@)
MFC after: 1 week

8 years agofcntl(2): Document interrupt/restart for file locks.
Jilles Tjoelker [Thu, 7 Jul 2016 21:44:59 +0000 (21:44 +0000)]
fcntl(2): Document interrupt/restart for file locks.

Since r302216, thread suspension causes advisory file locks to restart
(instead of continuing to wait) and for a long time SA_RESTART has
affected advisory file locks. These are both not compliant to POSIX.1.

To clarify that restarting means something, add a paragraph about fair
queuing. Note that the network lock manager does not implement fair
queuing.

Reviewed by: kib (previous version)
Approved by: re (gjb)

8 years agoWITH_SYSTEM_COMPILER: Don't enable for xdev or native-xtools.
Bryan Drewery [Thu, 7 Jul 2016 21:03:50 +0000 (21:03 +0000)]
WITH_SYSTEM_COMPILER: Don't enable for xdev or native-xtools.

Otherwise they get no compiler.

Reported by: swills
Tested by: swills
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

8 years agoChange the type of the map entry's next_read field from a vm_pindex_t to a
Alan Cox [Thu, 7 Jul 2016 20:58:16 +0000 (20:58 +0000)]
Change the type of the map entry's next_read field from a vm_pindex_t to a
vm_offset_t.  (This field is used to detect sequential access to the virtual
address range represented by the map entry.)  There are three reasons to
make this change.  First, a vm_offset_t is smaller on 32-bit architectures.
Consequently, a struct vm_map_entry is now smaller on 32-bit architectures.
Second, a vm_offset_t can be written atomically, whereas it may not be
possible to write a vm_pindex_t atomically on a 32-bit architecture.  Third,
using a vm_pindex_t makes the next_read field dependent on which object in
the shadow chain is being read from.

Replace an "XXX" comment.

Reviewed by: kib
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

8 years agolorder: produce locale-independent symbol ordering
Ed Maste [Thu, 7 Jul 2016 20:50:59 +0000 (20:50 +0000)]
lorder: produce locale-independent symbol ordering

Found by the Debian reproducible builds effort -- Debian bug 830259.

Reported by: Reiner Herrmann <reiner@reiner-h.de>
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

8 years agoTidy up loose ends from Netflix I/O sched rename to dynamic I/O sched.
Warner Losh [Thu, 7 Jul 2016 20:31:35 +0000 (20:31 +0000)]
Tidy up loose ends from Netflix I/O sched rename to dynamic I/O sched.
Rename kern.cam.do_netflix_iosched sysctl to
kern.cam.do_dynamic_iosched.

Approved by: re (kib@)

8 years agoFix a lockup in tx path for cspw.
Luiz Otavio O Souza [Thu, 7 Jul 2016 20:01:03 +0000 (20:01 +0000)]
Fix a lockup in tx path for cspw.

Sometimes the software loses the race when appending more descriptors to
the tx ring and the tx queue stops.

This commit detects this condition and restart the tx queue whenever it stall.

Tested by: sobomax@, Keith White <kwhite@site.uottawa.ca>,
Paul Mather <paul@gromit.dlib.vt.edu>
Sponsored by: Rubicon Communications (Netgate)
Approved by: re (kib)

8 years agoAutotune the number of pages set aside for UMA startup based on the number
Colin Percival [Thu, 7 Jul 2016 18:37:12 +0000 (18:37 +0000)]
Autotune the number of pages set aside for UMA startup based on the number
of CPUs present.  On amd64 this unbreaks the boot for systems with 92 or
more CPUs; the limit will vary on other systems depending on the size of
their uma_zone and uma_cache structures.

The major consumer of pages during UMA startup is the 19 zone structures
which are set up before UMA has bootstrapped itself sufficiently to use
the rest of the available memory:  UMA Slabs, UMA Hash, 4 / 6 / 8 / 12 /
16 / 32 / 64 / 128 / 256 Bucket, vmem btag, VM OBJECT, RADIX NODE, MAP,
KMAP ENTRY, MAP ENTRY, VMSPACE, and fakepg.  If the zone structures occupy
more than one page, they will not share pages and the number of pages
currently needed for startup is 19 * pages_per_zone + N, where N is the
number of pages used for allocating other structures; on amd64 N = 3 at
present (2 pages are allocated for UMA Kegs, and one page for UMA Hash).

This patch adds a new definition UMA_BOOT_PAGES_ZONES, currently set to 32,
and if a zone structure does not fit into a single page sets boot_pages to
UMA_BOOT_PAGES_ZONES * pages_per_zone instead of UMA_BOOT_PAGES (which
remains at 64).  Consequently this patch has no effect on systems where the
zone structure fits into 2 or fewer pages (on amd64, 59 or fewer CPUs), but
increases boot_pages sufficiently on systems where the large number of CPUs
makes this structure larger.  It seems safe to assume that systems with 60+
CPUs can afford to set aside an additional 128kB of memory per 32 CPUs.

The vm.boot_pages tunable continues to override this computation, but is
unlikely to be necessary in the future.

Tested on: EC2 x1.32xlarge
Relnotes: FreeBSD can now boot on 92+ CPU systems without requiring
vm.boot_pages to be manually adjusted.
Reviewed by: jeff, alc, adrian
Approved by: re (kib)

8 years ago[ath] obey the short-GI vap config flag when transmitting.
Adrian Chadd [Thu, 7 Jul 2016 17:22:13 +0000 (17:22 +0000)]
[ath] obey the short-GI vap config flag when transmitting.

This makes 'ifconfig wlanX -shortgi' work correctly.

Tested:

* AR9380, STA mode

Approved by: re (gjb)

8 years agoStop deleting ofwdump.8.gz on arm and arm64 when running make delete-old,
Andrew Turner [Thu, 7 Jul 2016 15:25:14 +0000 (15:25 +0000)]
Stop deleting ofwdump.8.gz on arm and arm64 when running make delete-old,
it is installed on these architectures.

Approved by: re (kib)
Sponsored by: ABT Systems Ltd

8 years agoDocument 299786, Support for X-Powers AXP813 and AXP818 PMIC
Steven Kreuzer [Thu, 7 Jul 2016 14:29:23 +0000 (14:29 +0000)]
Document 299786, Support for X-Powers AXP813 and AXP818 PMIC

Approved by: re (gjb, implicit, relnotes)

8 years agoAdd new unmount(2) flag, MNT_NONBUSY, to check whether there are
Edward Tomasz Napierala [Thu, 7 Jul 2016 09:03:57 +0000 (09:03 +0000)]
Add new unmount(2) flag, MNT_NONBUSY, to check whether there are
any open vnodes before proceeding. Make autounmound(8) use this flag.
Without it, even an unsuccessfull unmount causes filesystem flush,
which interferes with normal operation.

Reviewed by: kib@
Approved by: re (gjb@)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7047

8 years agoARM64: move to GPT scheme in sysinstall
Wojciech Macek [Thu, 7 Jul 2016 05:47:42 +0000 (05:47 +0000)]
ARM64: move to GPT scheme in sysinstall

     It's time to abandon MBR installations on
     ARM64 platforms.

     Obtained from:         Semihalf
     Submitted by:          Dominik Ermel <der@semihalf.com>
     Sponsored by:          Cavium
     Reviewed by:           gjb, emaste, marcel
     Approved by:           re (gjb)
     Differential Revision: https://reviews.freebsd.org/D6798

8 years agoDo not initialize the adapter on MTU change when adapter status is down.
Sean Bruno [Thu, 7 Jul 2016 03:39:18 +0000 (03:39 +0000)]
Do not initialize the adapter on MTU change when adapter status is down.
This fixes long-standing problems when changing settings of the adapter.

Discussed in:
https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html

Submitted by: arnaud.ysmal@stormshield.eu
Reviewed by: erj@freebsd.org
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7030

8 years agoFix ZFS ARC min / max tunable
Steven Hartland [Wed, 6 Jul 2016 23:49:19 +0000 (23:49 +0000)]
Fix ZFS ARC min / max tunable

Due to ARC initial configuration not being done and kmem information
not being available we need to blindly set zfs_arc_max and zfs_arc_min
when configured via the tunable.

This fixes vfs.zfs.arc_(min|max) configuration via loader.conf broken by
r302265.

Approved by: re(gjb)
MFC after: 1 week

8 years agoHandle IOC_VOID special case of passing an integer IOCTL argument through CUSE.
Hans Petter Selasky [Wed, 6 Jul 2016 22:21:22 +0000 (22:21 +0000)]
Handle IOC_VOID special case of passing an integer IOCTL argument through CUSE.

Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru>
Approved by: re (gjb)

8 years agoisci: fix ATA PASSTHROUGH fixed sense data format
Jim Harris [Wed, 6 Jul 2016 20:48:42 +0000 (20:48 +0000)]
isci: fix ATA PASSTHROUGH fixed sense data format

PR: kern/191717
Submitted by: martin@lispworks.com
Approved by: re (gjb)
MFC after: 3 days

8 years agoCorrect locking annotation for p_comm.
John Baldwin [Wed, 6 Jul 2016 18:55:46 +0000 (18:55 +0000)]
Correct locking annotation for p_comm.

p_comm is changed during exec, it is not read-only after fork.

Pointed out by: rwatson
Approved by: re (gjb, kib)
MFC after: 1 week

8 years agoAdd variable declaration missing in r302372.
Nathan Whitehorn [Wed, 6 Jul 2016 17:46:49 +0000 (17:46 +0000)]
Add variable declaration missing in r302372.

Submitted by: andrew
Approved by: re (gjb, kib)

8 years agoRemove the old pre-INTRNG arm64 interrupt framework. GENERIC was switched
Andrew Turner [Wed, 6 Jul 2016 16:20:10 +0000 (16:20 +0000)]
Remove the old pre-INTRNG arm64 interrupt framework. GENERIC was switched
to INTRNG in r301565 with the old code no longer being built by default with
no reports of issues on any supported hardware.

Approved by: re (gjb)
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoThe TCPPCAP debugging feature caches recently-used mbufs for use in
Jonathan T. Looney [Wed, 6 Jul 2016 16:17:13 +0000 (16:17 +0000)]
The TCPPCAP debugging feature caches recently-used mbufs for use in
debugging TCP connections. This commit provides a mechanism to free those
mbufs when the system is under memory pressure.

Because this will result in lost debugging information, the behavior is
controllable by a sysctl. The default setting is to free the mbufs.

Reviewed by: gnn
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6931
Input from: novice_techie.com

8 years agoFix CTASSERT issue in a more clean way
Enji Cooper [Wed, 6 Jul 2016 16:02:15 +0000 (16:02 +0000)]
Fix CTASSERT issue in a more clean way

- Replace all CTASSERT macro instances with static_assert's.
- Remove the WRAPPED_CTASSERT macro; it's now an unnecessary obfuscation.
- Localize all static_assert's to the structures being tested.
- Sort some headers per-style(9).

Approved by: re (hrs)
Differential Revision: https://reviews.freebsd.org/D7130
MFC after: 1 week
X-MFC with: r302364
Reviewed by: ed, grehan (maintainer)
Submitted by: ed
Sponsored by: EMC / Isilon Storage Division

8 years agoReplace a number of conflations of mp_ncpus and mp_maxid with either
Nathan Whitehorn [Wed, 6 Jul 2016 14:09:49 +0000 (14:09 +0000)]
Replace a number of conflations of mp_ncpus and mp_maxid with either
mp_maxid or CPU_FOREACH() as appropriate. This fixes a number of places in
the kernel that assumed CPU IDs are dense in [0, mp_ncpus) and would try,
for example, to run tasks on CPUs that did not exist or to allocate too
few buffers on systems with sparse CPU IDs in which there are holes in the
range and mp_maxid > mp_ncpus. Such circumstances generally occur on
systems with SMT, but on which SMT is disabled. This patch restores system
operation at least on POWER8 systems configured in this way.

There are a number of other places in the kernel with potential problems
in these situations, but where sparse CPU IDs are not currently known
to occur, mostly in the ARM machine-dependent code. These will be fixed
in a follow-up commit after the stable/11 branch.

PR: kern/210106
Reviewed by: jhb
Approved by: re (glebius)

8 years agoFix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure
Hans Petter Selasky [Wed, 6 Jul 2016 10:57:04 +0000 (10:57 +0000)]
Fix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure
"struct xhci_dev_ctx_addr" fits into a single 4K page until further.

Approved by: re (hrs)
MFC after: 1 week

8 years agoOnly set the ipfilter running state to 'not running' if we are
Bjoern A. Zeeb [Wed, 6 Jul 2016 10:29:29 +0000 (10:29 +0000)]
Only set the ipfilter running state to 'not running' if we are
doing the teardown.  ipf_destroy_all() may free ipfmain in case
of ipf_dynamic_softc being true, thus we are avoiding a possible
memory modified after free as well.

Reported by: Coverity
Coverity CID: 1357320
Approved by: re (hrs)
MFC after: 10 days

8 years agoFix gcc warning
Enji Cooper [Wed, 6 Jul 2016 05:17:56 +0000 (05:17 +0000)]
Fix gcc warning

Remove -Wunused-but-set-variable (`mopt`).

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
X-MFC with: r302332
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

8 years agoFix gcc build errors with SSE 4.2 detection and gcc warnings
Enji Cooper [Wed, 6 Jul 2016 05:17:07 +0000 (05:17 +0000)]
Fix gcc build errors with SSE 4.2 detection and gcc warnings

- Remove -Wunused-but-set-variable's (`len`, etc).
- Replace clang-specific tests in sse42_supported(..) with generic,
  FreeBSD-supported CPU feature tests, using macros and functions
  from machine/cpufunc.h and machine/specialreg.h . The previous method
  for determining SSE4.2 availability was only compatible with clang.
- Sort #includes per style(9).

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
X-MFC with: r302332
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

8 years agoFix gcc warnings
Enji Cooper [Wed, 6 Jul 2016 05:11:39 +0000 (05:11 +0000)]
Fix gcc warnings

Remove unused function (`fifo_available`)

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
X-MFC with: r302332
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

8 years agoFix gcc warnings
Enji Cooper [Wed, 6 Jul 2016 05:09:13 +0000 (05:09 +0000)]
Fix gcc warnings

- Put parentheses around bitwise OR'ed values in the `FIELD_COPY(..)` and
  `FIELD_REPLACE(..)` macros to mute warning from gcc 4.2.1.
- Remove -Wunused-but-set-variable's (`setup_addr`, `status_addr`).

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
X-MFC with: r302332
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

8 years agoFix gcc warnings
Enji Cooper [Wed, 6 Jul 2016 05:05:03 +0000 (05:05 +0000)]
Fix gcc warnings

Remove -Wunused-but-set-variable (`error`). Cast calls with
`(void)` to note that the return value is explicitly ignored.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

8 years agoFix gcc warnings
Enji Cooper [Wed, 6 Jul 2016 05:02:59 +0000 (05:02 +0000)]
Fix gcc warnings

Add `WRAPPED_CTASSERT` macro by annotating CTASSERTs with __unused
to deal with -Wunused-local-typedefs warnings from gcc 4.8+.
All other compilers (clang, etc) use CTASSERT as-is. A more generic
solution for this issue will be proposed after ^/stable/11 is forked.

Consolidate all CTASSERTs under one block instead of inlining them in
functions.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

8 years agoFix gcc warnings
Enji Cooper [Wed, 6 Jul 2016 04:58:42 +0000 (04:58 +0000)]
Fix gcc warnings

Put cfl/prdt under AHCI_DEBUG #defines as they are only used in
those cases.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

8 years agoFix gcc warnings
Enji Cooper [Wed, 6 Jul 2016 04:56:45 +0000 (04:56 +0000)]
Fix gcc warnings

- Remove -Wunused-but-set-variable (newcpu)
- Always return VMEXIT_CONTINUE as the code always set retval to that value.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd myself to the src committers graph.
Eric Badger [Wed, 6 Jul 2016 03:23:07 +0000 (03:23 +0000)]
Add myself to the src committers graph.

Approved by: re (gjb), kib (mentor)

8 years agoCorrect a manual page reference.
Glen Barber [Tue, 5 Jul 2016 23:03:57 +0000 (23:03 +0000)]
Correct a manual page reference.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

8 years agoRemove incorrect attributes from posix_memalign(3) declaration.
Pedro F. Giffuni [Tue, 5 Jul 2016 22:30:29 +0000 (22:30 +0000)]
Remove incorrect attributes from posix_memalign(3) declaration.

Both __alloc_align and __alloc_size can't be used when the function
returns a pointer to memory. This fixes breakage when building with
clang 3.4:

In file included from /usr/src/svn/usr.sbin/bhyve/atkbdc.c:40:
/usr/include/stdlib.h:176:6: error: '__alloc_size__' attribute only
applies to functions that return a pointer [-Werror,-Wignored-attributes]

Pointed out by: ngie, cem
Approved by: re (gjb)

8 years agoDocument r302221, file has been updated to version 5.28
Steven Kreuzer [Tue, 5 Jul 2016 22:07:41 +0000 (22:07 +0000)]
Document r302221, file has been updated to version 5.28

Approved by: re (gjb, implicit, relnotes)