freebsd.git
8 years agoHandle copyin failures.
bdrewery [Tue, 22 Mar 2016 22:41:14 +0000 (22:41 +0000)]
Handle copyin failures.

Skip the log entry as there is nothing good to write out.  Don't fail
the syscall though since it already succeeded.  There's no reason
filemon's tracing failure should fail the already-succeeded syscall.

Record the error for later to return from close(2) on the filemon devfs
file descriptor.

Discussed with: markj, sjg, kib (briefly with kib)
Reported by: mjg
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove unused done argument to copyinstr(9).
bdrewery [Tue, 22 Mar 2016 22:41:10 +0000 (22:41 +0000)]
Remove unused done argument to copyinstr(9).

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoReturn any log write failure encountered when closing the filemon fd.
bdrewery [Tue, 22 Mar 2016 22:41:07 +0000 (22:41 +0000)]
Return any log write failure encountered when closing the filemon fd.

Discussed with: sjg, markj
Reviewed by: sjg
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoFollow-up r297156: Close the log in filemon_dtr rather than in the last reference.
bdrewery [Tue, 22 Mar 2016 22:41:03 +0000 (22:41 +0000)]
Follow-up r297156: Close the log in filemon_dtr rather than in the last reference.

If the tracer has decided to the close the log then it should be fully
written, not getting more entries, when close(2) returns.  This was
a regression in r297156 in that it allowed a traced process to continue
a traced syscall and add more entries to the log while the tracer had
already closed its fd or exited.  This was only really part of the
daemonized process case which is abnormal.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoFix the resource_list_print_type() calls to use uintmax_t.
jhibbits [Tue, 22 Mar 2016 22:25:08 +0000 (22:25 +0000)]
Fix the resource_list_print_type() calls to use uintmax_t.

Missed a bunch from r297000.

8 years ago[net80211] add missing static declarations.
adrian [Tue, 22 Mar 2016 22:07:14 +0000 (22:07 +0000)]
[net80211] add missing static declarations.

Submitted by: Sascha Wildner <saw@online.de>
Obtained from: dragonflybsd (https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/822aeeabc8c4c074deea46383f36e6d1cdcd19f5)

8 years agoSpell out 'system calls'.
bdrewery [Tue, 22 Mar 2016 19:39:50 +0000 (19:39 +0000)]
Spell out 'system calls'.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agocxgbe(4): Be consistent and call ETHER_BPF_MTAP before writing anything
np [Tue, 22 Mar 2016 18:56:23 +0000 (18:56 +0000)]
cxgbe(4): Be consistent and call ETHER_BPF_MTAP before writing anything
to the descriptor ring no matter what path the frame takes within the
driver's tx.

8 years agoto_flags is currently a 64-bit integer; however, we only use 7 bits.
jtl [Tue, 22 Mar 2016 15:55:17 +0000 (15:55 +0000)]
to_flags is currently a 64-bit integer; however, we only use 7 bits.
Furthermore, there is no reason this needs to be a 64-bit integer
for the forseeable future.

Also, there is an inconsistency between to_flags and the mask in
tcp_addoptions(). Before r195654, to_flags was a u_long and the mask in
tcp_addoptions() was a u_int. r195654 changed to_flags to be a u_int64_t
but left the mask in tcp_addoptions() as a u_int, meaning that these
variables will only be the same width on platforms with 64-bit integers.

Convert both to_flags and the mask in tcp_addoptions() to be explicitly
32-bit variables. This may save a few cycles on 32-bit platforms, and
avoids unnecessarily mixing types.

Differential Revision: https://reviews.freebsd.org/D5584
Reviewed by: hiren
MFC after: 2 weeks
Sponsored by: Juniper Networks

8 years agoMfp4 @180378:
bz [Tue, 22 Mar 2016 15:43:47 +0000 (15:43 +0000)]
Mfp4 @180378:

  Factor out nd6 and in6_attach initialization to their own files.
  Also move destruction into those files though still called from
  the central initialization.

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

8 years agoCorrect comment.
bz [Tue, 22 Mar 2016 14:08:00 +0000 (14:08 +0000)]
Correct comment.

MFC after: 2 weeks

8 years agoWait for root mount tokens before showing the root mount prompt.
trasz [Tue, 22 Mar 2016 13:46:01 +0000 (13:46 +0000)]
Wait for root mount tokens before showing the root mount prompt.
This restores the pre-r290196 behaviour, eliminating the need to manually
press '.' a couple of times to get USB to finish probing.

Note that there's still something wrong with the console (character
echoing doesn't quite work), and there's also a reported problem with
BHyVe, but those two don't seem related to the problem above.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoAdd an mbuf provider to DTrace.
gnn [Tue, 22 Mar 2016 13:16:52 +0000 (13:16 +0000)]
Add an mbuf provider to DTrace.

The mbuf provider is made up of a set of Statically Defined Tracepoints
which help us look into mbufs as they are allocated and freed.  This can be
used to inspect the buffers or for a simplified mbuf leak detector.

New tracepoints are:

mbuf:::m-init
mbuf:::m-gethdr
mbuf:::m-get
mbuf:::m-getcl
mbuf:::m-clget
mbuf:::m-cljget
mbuf:::m-cljset
mbuf:::m-free
mbuf:::m-freem

There is also a translator for mbufs which gives some visibility into the structure,
see mbuf.d for more details.

Reviewed by: bz, markj
MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D5682

8 years agoSupport checksum offloading for TCP/IPV6 and UDP/IPV6.
tuexen [Tue, 22 Mar 2016 12:40:09 +0000 (12:40 +0000)]
Support checksum offloading for TCP/IPV6 and UDP/IPV6.
Support SCTP checksum offloading for SCTP/IPV6.
Support SCTP checksum offloading on all controllers except 82575.

Reviewed by: sbruno@, erj@
MFC after:  4 weeks
Differential Revision: D5193

8 years agoAdding pci_host_generic unconditionally breaks ARM boards with a PCI(e) interface.
bz [Tue, 22 Mar 2016 12:12:01 +0000 (12:12 +0000)]
Adding pci_host_generic unconditionally breaks ARM boards with a PCI(e) interface.
Make it a device option to be included in the kernel configs that request this file.

Reported by: mmel
Suggested by: mmel
Reviewed by: mmel
Differential Revision: https://reviews.freebsd.org/D5699

8 years agoApparently there are some popular programs around which assume that it
kib [Tue, 22 Mar 2016 10:51:42 +0000 (10:51 +0000)]
Apparently there are some popular programs around which assume that it
is safe to call pthread_mutex_init() on the same shared mutex several
times.  POSIX claims that the behaviour in this case is undefined.

Make this working by only allowing one caller to initialize the mutex.
Other callers either see already completed initialization and do
nothing, or busy-loop yielding while designated initializer finishes.
Also make the API requirements loose by initializing mutexes on other
pthread_mutex*() calls if they see uninitialized shared mutex.

Only mutexes provide the hack for now, but it could be also
implemented for other process shared primitives from libthr.

Reported and tested by: "Oleg V. Nauman" <oleg@opentransfer.com>
Sponsored by: The FreeBSD Foundation

8 years agoUse the saved program state register to detect when an exception frame is
andrew [Tue, 22 Mar 2016 08:36:25 +0000 (08:36 +0000)]
Use the saved program state register to detect when an exception frame is
from userpsace. Previously we could have triggered a panic by trying to
jump to a kernel address from userland as the trap handling code thought we
received an ast in kernel mode.

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

8 years agoUse a SKIP testplan instead of bailing out if/when the tester isn't
ngie [Tue, 22 Mar 2016 08:12:45 +0000 (08:12 +0000)]
Use a SKIP testplan instead of bailing out if/when the tester isn't
root, or the geom class can't be loaded cleanly [*]

This makes sure that scenarios that are easy to hit aren't counted
as false positives with kyua test

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

8 years agohyperv/hn: When short of mbufs on the RX path, don't spam the console.
sephe [Tue, 22 Mar 2016 07:08:47 +0000 (07:08 +0000)]
hyperv/hn: When short of mbufs on the RX path, don't spam the console.

Instead, increase the IQDROPS counter.

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

8 years agohyperv/hn: Factor out hn_set_lro_lenlim()
sephe [Tue, 22 Mar 2016 06:42:24 +0000 (06:42 +0000)]
hyperv/hn: Factor out hn_set_lro_lenlim()

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

8 years agohyperv/hn: Reduce TCP segment aggregation limit for multiple RX rings
sephe [Tue, 22 Mar 2016 06:31:39 +0000 (06:31 +0000)]
hyperv/hn: Reduce TCP segment aggregation limit for multiple RX rings

This mainly used to improve ACK timeliness when multiple RX rings
are enabled.

This value gives the best performance in both Azure and Hyper-V
environment, w/ both 10Ge and 40Ge using non-{INVARIANTS,WITNESS}
kernel.

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

8 years agoOptimize IPMI watchdog patting.
mav [Tue, 22 Mar 2016 06:24:52 +0000 (06:24 +0000)]
Optimize IPMI watchdog patting.

Set watchdog timer parameters only when they really need to be changed.
In other cases just restart the timer with single Reset command instead
of two (Set and Reset).

From one side this visually reduces amount of CPU time burned in tight
loop waiting while some slow BMC configures its watchdog hardware, that
seems to be much more complicated task then just resetting the timer.

From another side on some BMCs those slow Set commands sometimes tend to
timeout, that leads to noisy log messages and even more CPU time burned,
so avoiding them can provide even bigger bonuses.

MFC after: 2 weeks

8 years agohyperv/vmbus: Remove NULL check for taskqueue_create_fast(M_WAITOK)
sephe [Tue, 22 Mar 2016 06:23:09 +0000 (06:23 +0000)]
hyperv/vmbus: Remove NULL check for taskqueue_create_fast(M_WAITOK)

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

8 years agohyperv/vmbus: Use taskqueue_fast for non-performance critical messages
sephe [Tue, 22 Mar 2016 06:13:27 +0000 (06:13 +0000)]
hyperv/vmbus: Use taskqueue_fast for non-performance critical messages

This gets rid of the per-cpu SWIs.

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

8 years agohyperv/evttimer: Use an independent message slot so that it can work
sephe [Tue, 22 Mar 2016 05:48:51 +0000 (05:48 +0000)]
hyperv/evttimer: Use an independent message slot so that it can work

Using the same message slot as the other types of the messages has
the side effect that the event timer message could be deferred to
the swi threads to run (lacking of trapframe and the original code
didn't even handle that, so the event timer was actually broken).

As of this commit we use an independent message slot for event timer,
so that we could handle all of event timer messages in the interrupt
handler directly.  Note, the message slot for event timer is still
bind to the same interrupt vector as the other types of messages.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: sephe
Discussed with: Jun Su <junsu microsoft com>, Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5696

8 years ago[urtwn] welcome basic 11n support to urtwn.
adrian [Tue, 22 Mar 2016 01:09:15 +0000 (01:09 +0000)]
[urtwn] welcome basic 11n support to urtwn.

This is a pretty good reference for teaching an almost-11n-capable
driver about 11n.

It enables HT20 operation, A-MPDU/A-MSDU RX, but no aggregate support
for transmit.  That'll come later.  This means that receive throughput
should be higher, but transmit throughput won't have changed much.

* Disable bgscan - for now, bgscan will interfere with AMPDU TX/RX,
  so until we correctly handle it in software driven scans, disable.
* Add null 11n methods for channel width / ampdu_enable.
  the firmware can apparently handle ampdu tx (and hopefully block-ack
  handling and retransmission) so I'll go review the linux code and
  figure it out.
* Set the number of tx/rx streams.  I /hope/ that nchains == nstreams
  here.
* Add 11n channels in the call to ieee80211_init_channels().
* Don't enable HT40 for now - I'll have to verify the channel set command
  and tidy it up a bit first.
* Teach the RX path about M_AMPDU for 11n nodes.  Kinda wonder why
  we aren't just doing this in net80211 already, this is the fourth
  driver I've had to do this to.
* Teach rate2ridx() about MCS rates and what hardware rates to use.
* Teach the urtwn_tx_data() routine about MCS/11ng transmission.
  It doesn't know about short-gi and 40MHz modes yet; that'll come
  later.
* For 8192CU firmware, teach the rate table code about MCS rates.
* Ensure that the fixed rate transmit sets the right transmit flag
  so the firmware obeys the driver transmit path.
* Set the default transmit rate to MCS4 if no rate control is available.
* Add HT protection (RTS-CTS exchange) support.

* Add appropriate XXX TODO entries.

TODO:

* 40MHz, short-gi, etc - channel tuning, TX, RX;
* teach urtwn_tx_raw() about (more) 11n stuff;
* A-MPDU TX would be nice!

Thanks to Andriy (avos@) for reviewing the code and testing it on IRC.

Tested:

* RTL8188EU - STA (me)
* RTL8192CU - STA (me)
* RTL8188EU - hostap (avos)
* RTL8192CU - STA (avos)

Reviewed by: avos

8 years agoBuild the zfs module on armv6, but not on older arm.
ian [Mon, 21 Mar 2016 23:32:13 +0000 (23:32 +0000)]
Build the zfs module on armv6, but not on older arm.

There have been reports in the past that zfs works on armv6, and now people
are wanting to test it again, so let's give them something to work with.

8 years agowpi: remove internal taskqueue
avos [Mon, 21 Mar 2016 23:25:41 +0000 (23:25 +0000)]
wpi: remove internal taskqueue

- Replace sc_reinittask() by ieee80211_restart_all() (mostly the same).
- Revert r282377 (seems to be unneeded now).

Tested with Intel 3945BG, STA mode.

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

8 years agoConsolidate common link(2) logic.
bdrewery [Mon, 21 Mar 2016 23:22:19 +0000 (23:22 +0000)]
Consolidate common link(2) logic.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agorum: add legacy power saving support (STA mode).
avos [Mon, 21 Mar 2016 22:29:24 +0000 (22:29 +0000)]
rum: add legacy power saving support (STA mode).

Tested with WUSB54GC, STA mode + WRT54GC / RTL8188EU in HOSTAP mode.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D5546

8 years agoFix some more long -> rman_res_t
jhibbits [Mon, 21 Mar 2016 22:19:53 +0000 (22:19 +0000)]
Fix some more long -> rman_res_t

Reported by: Michael Butler (siis breakage)

8 years agorum: simplify error handling in rum_newstate().
avos [Mon, 21 Mar 2016 22:14:48 +0000 (22:14 +0000)]
rum: simplify error handling in rum_newstate().

Tested with WUSB54GC, STA mode.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D5544

8 years agoRegen.
jhb [Mon, 21 Mar 2016 21:38:35 +0000 (21:38 +0000)]
Regen.

8 years agoFully handle size_t lengths in AIO requests.
jhb [Mon, 21 Mar 2016 21:37:33 +0000 (21:37 +0000)]
Fully handle size_t lengths in AIO requests.

First, update the return types of aio_return() and aio_waitcomplete() to
ssize_t.

POSIX requires aio_return() to return a ssize_t so that it can represent
all return values from read() and write().  aio_waitcomplete() should use
ssize_t for the same reason.

aio_return() has used ssize_t in <aio.h> since r31620 but the manpage and
system call entry were not updated.  aio_waitcomplete() has always
returned int.

Note that this does not require new system call stubs as this is
effectively only an API change in how the compiler interprets the return
value.

Second, allow aio_nbytes values up to IOSIZE_MAX instead of just INT_MAX.

aio_read/write should now honor the same length limits as normal read/write.

Third, use longs instead of ints in the aio_return() and aio_waitcomplete()
system call functions so that the 64-bit size_t in the in-kernel aiocb
isn't truncated to 32-bits before being copied out to userland or
being returned.

Finally, a simple test has been added to verify the bounds checking on the
maximum read size from a file.

8 years agorum: do not try to restore bssid/TSF synchronization when device
avos [Mon, 21 Mar 2016 21:33:30 +0000 (21:33 +0000)]
rum: do not try to restore bssid/TSF synchronization when device
is not associated.

Tested with WUSB54GC, STA mode.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D5543

8 years agorum: separate some microcontroller vendor-specific requests into
avos [Mon, 21 Mar 2016 21:02:57 +0000 (21:02 +0000)]
rum: separate some microcontroller vendor-specific requests into
rum_do_mcu_request()

This change should be no-op.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D5542

8 years agonet80211: enable software beacon miss timer in SLEEP state
avos [Mon, 21 Mar 2016 20:52:09 +0000 (20:52 +0000)]
net80211: enable software beacon miss timer in SLEEP state

Tested with WUSB54GC, STA mode (w/ power saving enabled)

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D5545

8 years agoRemove tools/vt/setfont
emaste [Mon, 21 Mar 2016 20:51:35 +0000 (20:51 +0000)]
Remove tools/vt/setfont

It is included in vidcontrol as of r266836.

Sponsored by: The FreeBSD Foundation

8 years agonet80211: add missing SLEEP -> AUTH state transition for station mode.
avos [Mon, 21 Mar 2016 20:39:45 +0000 (20:39 +0000)]
net80211: add missing SLEEP -> AUTH state transition for station mode.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D5269

8 years agoAttempt to use the namecache for openat(2) path resolution.
bdrewery [Mon, 21 Mar 2016 20:29:53 +0000 (20:29 +0000)]
Attempt to use the namecache for openat(2) path resolution.

This finishes the work done in D2810.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoDocument openat(2) behavior.
bdrewery [Mon, 21 Mar 2016 20:29:49 +0000 (20:29 +0000)]
Document openat(2) behavior.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoUse curthread for vn_fullpath.
bdrewery [Mon, 21 Mar 2016 20:29:46 +0000 (20:29 +0000)]
Use curthread for vn_fullpath.

No functional change.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoConsolidate open(2) and openat(2) code.
bdrewery [Mon, 21 Mar 2016 20:29:43 +0000 (20:29 +0000)]
Consolidate open(2) and openat(2) code.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoStop tracking stat(2).
bdrewery [Mon, 21 Mar 2016 20:29:39 +0000 (20:29 +0000)]
Stop tracking stat(2).

None of lstat(2), fstat(2), fstatat(2) were tracked either.

The other filemon implementations also do not track stat(2), nor
does bmake utilize it.  The act of opening a file for read should
be enough to decide that a file is a dependency.  There could be
rare cases where just having a file would cause a dependency but it
is unlikely.

MFC after: 2 weeks
Also noted by: sjg
Sponsored by: EMC / Isilon Storage Division

8 years agoTrack filemon usage via a proc.p_filemon pointer rather than its own lists.
bdrewery [Mon, 21 Mar 2016 20:29:27 +0000 (20:29 +0000)]
Track filemon usage via a proc.p_filemon pointer rather than its own lists.

- proc.p_filemon is added which is protected by PROC_LOCK.  This improves
  performance and avoids double-fork issues, taking allproc_lock
  while in syscalls, and walking the process tree in syscalls.  A
  particular proc.p_filemon can only be changed to NULL or another
  filemon, or the filemon inherited, while the filemon->lock is held.
- Filemon are reference counted.  On the last reference the log will be closed.
- When closing the devfs file handle, the filemon will be detached from all
  processes and inheritance prevented.
- Disallow attaching to a process already being traced since filemon is
  typically intended to be used on children only.  This is allowed for
  curproc as bmake relies on this behavior for rare cases when combining
  .MAKE with .META.
- Detach any previously tracked process on ioctl(FILEMON_SET_PID).
- Handle error from devfs_set_cdevpriv() in filemon_open().
- The global filemon lock and lists are removed.
- A free list is no longer kept.  Previously this list was
  forever-expanding and never garbage cleaned.
- No longer loses track of double-forks.  If the process holding the filemon
  handle closes it will close the log rather than wait on a daemonized process,
  but it will log all activity until it closes its handle.  The filemon
  will be removed from the process and not inherited.
- A separate process count is kept only as an optimization for
  forced detachment to avoid taking allproc_lock and walking the entire
  process tree.
- struct filemon access is protected by sx(9) filemon->lock as it was before.
- Add more comments and KASSERTS.

MFC after: 2 weeks
Reviewed by: kib, mjg, markj (all on previous versions)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5520

8 years agoModifications to achieve a common source base from FreeBSD7.x thru 10.x
davidcs [Mon, 21 Mar 2016 18:48:20 +0000 (18:48 +0000)]
Modifications to achieve a common source base from FreeBSD7.x thru 10.x

MFC after:5 days

8 years agoDIRDEPS_BUILD: Update dependencies.
bdrewery [Mon, 21 Mar 2016 18:02:26 +0000 (18:02 +0000)]
DIRDEPS_BUILD: Update dependencies.

Sponsored by: EMC / Isilon Storage Division

8 years agoIf the dhcp server provided an interface-mtu option, transcribe the value
ian [Mon, 21 Mar 2016 15:06:50 +0000 (15:06 +0000)]
If the dhcp server provided an interface-mtu option, transcribe the value
to the boot.netif.mtu env var, which will be picked up by pre-existing code
in nfs_mountroot() and used to configure the interface accordingly.

This should bring the same functionality when the bootp/dhcp work is done
by loader(8) as r297150 does for the in-kernel BOOTP case.

8 years agoIf the dhcp server delivers an interface-mtu option, parse it and store
ian [Mon, 21 Mar 2016 14:58:12 +0000 (14:58 +0000)]
If the dhcp server delivers an interface-mtu option, parse it and store
the value in a new global intf_mtu for use by the application.

These changes were inspired by the patch provided by Robert Blayzor in
PR 187094, and will allow loader(8) to propagate the value to the kernel
along with the other nfs_diskless parms delivered via environment vars.

8 years agoIf the dhcp server provides an interface-mtu option, parse the value and
ian [Mon, 21 Mar 2016 14:51:51 +0000 (14:51 +0000)]
If the dhcp server provides an interface-mtu option, parse the value and
set that mtu on the interface.

These changes are based on the patch submitted by Robert Blayzor in the
PR, but I changed things around a bit, so the blame for any mistakes
belongs to me.

PR: 187094

8 years agoActually garbage collect the unused code, as mentioned in r297147, which
ian [Mon, 21 Mar 2016 14:39:03 +0000 (14:39 +0000)]
Actually garbage collect the unused code, as mentioned in r297147, which
this change should have been part of.

8 years agoGarbage collect the bswap routines from libstand. The declaration was
ian [Mon, 21 Mar 2016 14:21:32 +0000 (14:21 +0000)]
Garbage collect the bswap routines from libstand.  The declaration was
wrapped in an i386 ifdef with a comment questioning their usefulness even
there.  It turns out they aren't referenced anywhere, but their presence
prevents using sys/endian.h in libstand code.

These days, sys/endian.h provides much better support for such things, using
compiler builtins and inline functions (and creating connections between
libstand code and header files from sys/ would not be breaking new ground).

8 years agoUnquote NANO_PACKAGE_LIST so that it actually can be a list and so
phk [Mon, 21 Mar 2016 08:30:58 +0000 (08:30 +0000)]
Unquote NANO_PACKAGE_LIST so that it actually can be a list and so
that the default value of "*" works.

8 years agoo "avaliable" -> "available".
maxim [Mon, 21 Mar 2016 08:03:50 +0000 (08:03 +0000)]
o "avaliable" -> "available".

PR: 208141
Submitted by: Tyler Littlefield

8 years agohyperv/vmbus: Implement bus_child_pnpinfo_str method
sephe [Mon, 21 Mar 2016 07:16:30 +0000 (07:16 +0000)]
hyperv/vmbus: Implement bus_child_pnpinfo_str method

Submitted by: Jun Su <junsu microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5669

8 years agohyperv: Factor out snprinf_hv_guid()
sephe [Mon, 21 Mar 2016 06:54:21 +0000 (06:54 +0000)]
hyperv: Factor out snprinf_hv_guid()

Submitted by: Ju Sun <junsu microsoft com>
Reviewed by: Dexuan Cui <decui microsoft com>, sephe
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5651

8 years agoLock pshared_lock shared around fork, to ensure that the COW snapshot
kib [Mon, 21 Mar 2016 06:52:35 +0000 (06:52 +0000)]
Lock pshared_lock shared around fork, to ensure that the COW snapshot
of the pshared hash in child is consistent and can be safely used.

Reported and tested by: "Oleg V. Nauman" <oleg@opentransfer.com>
Sponsored by: The FreeBSD Foundation

8 years agoProvide more information on failing checks in mutex_assert_is_owned()
kib [Mon, 21 Mar 2016 06:48:11 +0000 (06:48 +0000)]
Provide more information on failing checks in mutex_assert_is_owned()
and mutex_assert_not_owned().  snprintf() use in this context should
be safe.

Sponsored by: The FreeBSD Foundation

8 years agoFrom libthr, remove special and strange code to set up session and
kib [Mon, 21 Mar 2016 06:46:16 +0000 (06:46 +0000)]
From libthr, remove special and strange code to set up session and
control terminal, activated when running with pid 1.  It is
application duty to handle this, and unsuspecting init replacements
which are linked with libthr would be broken by this.

The pre-resolving of getpid() is restored, just in case.

Reviewed by: jilles
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoImplement process-shared spinlocks.
kib [Mon, 21 Mar 2016 06:40:54 +0000 (06:40 +0000)]
Implement process-shared spinlocks.

Sponsored by: The FreeBSD Foundation

8 years agoFix typo.
kib [Mon, 21 Mar 2016 05:59:05 +0000 (05:59 +0000)]
Fix typo.

MFC after: 3 days

8 years agoRemove from NOTES - it's built as a module now.
adrian [Mon, 21 Mar 2016 05:51:21 +0000 (05:51 +0000)]
Remove from NOTES - it's built as a module now.

Noticed by: sephe

8 years agoUse the internal references for ADC, this fixes the ADC readings on uBMC.
loos [Mon, 21 Mar 2016 03:39:38 +0000 (03:39 +0000)]
Use the internal references for ADC, this fixes the ADC readings on uBMC.

Tested on BBB and uBMC.

Sponsored by: Rubicon Communications (Netgate)

8 years agoEnable multicast addresses on vlan ports. Fixes the reception of broadcast
loos [Mon, 21 Mar 2016 03:16:56 +0000 (03:16 +0000)]
Enable multicast addresses on vlan ports.  Fixes the reception of broadcast
packets on vlan aware mode.

Sponsored by: Rubicon Communications (Netgate)

8 years agoRemove urtwn/urtwnfw; it's built as a module now.
adrian [Mon, 21 Mar 2016 02:38:21 +0000 (02:38 +0000)]
Remove urtwn/urtwnfw; it's built as a module now.

8 years agoi915: disable GEN6_MBCTL write in gen6_init_clock_gating
emaste [Mon, 21 Mar 2016 00:59:30 +0000 (00:59 +0000)]
i915: disable GEN6_MBCTL write in gen6_init_clock_gating

This write came from Linux commit b4ae3f22d238 which has been implicated
in Sandy Bridge power consumption issues (albeit under different
conditions on Linux). Disabling it restores normal power consumption on
my Sandy Bridge laptop (Thinkpad X220).

PR: 207889
Reviewed by: cem, dumbbell
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5665

8 years agoFix fallout from r292180 (Dec 2015)... ensure that every driver which has
ian [Mon, 21 Mar 2016 00:52:24 +0000 (00:52 +0000)]
Fix fallout from r292180 (Dec 2015)... ensure that every driver which has
a DRIVER_MODULE() referencing mmc_driver has a MODULE_DEPEND() on mmc.  This
is because the kernel linker only searches for symbols in dependent modules,
so loading sdhci_pci (and other bus-flavors of sdhci) would fail when mmc
was not compiled into the kernel (even if you hand-loaded mmc first).

(Thanks to jilles@ for providing the vital clue about the kernel linker.)

8 years agoiw_cxgbe/libcxgb4: Pull in many applicable fixes from the upstream Linux
np [Mon, 21 Mar 2016 00:29:45 +0000 (00:29 +0000)]
iw_cxgbe/libcxgb4: Pull in many applicable fixes from the upstream Linux
iWARP driver and userspace library to the FreeBSD iw_cxgbe and libcxgb4.

This commit includes internal changesets 6785 8111 8149 8478 8617 8648
8650 9110 9143 9440 9511 9894 10164 10261 10450 10980 10981 10982 11730
11792 12218 12220 12222 12223 12225 12226 12227 12228 12229 12654.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications

8 years agoIt appears nfs_mountroot() will use the env var "boot.netif.mtu" if it
ian [Sun, 20 Mar 2016 21:48:26 +0000 (21:48 +0000)]
It appears nfs_mountroot() will use the env var "boot.netif.mtu" if it
exists, so mention that along with all the other boot.netif vars.

8 years agoCheck bsd_to_linux_statfs() return value. Forgotten in r297070.
dchagin [Sun, 20 Mar 2016 19:06:21 +0000 (19:06 +0000)]
Check bsd_to_linux_statfs() return value. Forgotten in r297070.

MFC after: 1 week

8 years agoReturn EOVERFLOW in case when actual statfs values are large enough and
dchagin [Sun, 20 Mar 2016 18:31:30 +0000 (18:31 +0000)]
Return EOVERFLOW in case when actual statfs values are large enough and
not fit into 32 bit fileds of a Linux struct statfs.

PR: 181012
MFC after: 1 week

8 years agoNow that urtwn is its own device, and it'll get hotplug loaded by
adrian [Sun, 20 Mar 2016 17:53:30 +0000 (17:53 +0000)]
Now that urtwn is its own device, and it'll get hotplug loaded by
devd/ifconfig/etc, don't build it in the kernel.

This should fix the build as well!

Notice by: dchagin

8 years agoRemove FREEBSD_BOOT_LOADER that already exists in std.armv6 config file.
ian [Sun, 20 Mar 2016 16:48:29 +0000 (16:48 +0000)]
Remove FREEBSD_BOOT_LOADER that already exists in std.armv6 config file.

PR: 207728
Submitted by: Jia-Shiun Li <jiashiun@gmail.com>

8 years agoConvert a long to rman_res_t, fixing a sign extension bug.
jhibbits [Sun, 20 Mar 2016 14:21:07 +0000 (14:21 +0000)]
Convert a long to rman_res_t, fixing a sign extension bug.

ahci.c had one signed long, which was passed into rman, rather than u_long.
After the switch of rman_res_t from size u_long to size uintmax_t, the sign
extension caused ranges to get messed up, and ahcich* to not attach.

There may be more signed longs used in this way, which will be fixed as they're
reported.

Reported by: pho

8 years agoWhitespaces, style(9) fixes. No functional changes.
dchagin [Sun, 20 Mar 2016 14:06:27 +0000 (14:06 +0000)]
Whitespaces, style(9) fixes. No functional changes.

MFC after: 1 week

8 years agoRegen for r297061 (fstatfs64 Linux syscall).
dchagin [Sun, 20 Mar 2016 13:23:01 +0000 (13:23 +0000)]
Regen for r297061 (fstatfs64 Linux syscall).

MFC after: 1 week

8 years agoImplement fstatfs64 system call.
dchagin [Sun, 20 Mar 2016 13:21:20 +0000 (13:21 +0000)]
Implement fstatfs64 system call.

PR: 181012
Submitted by: John Wehle
MFC after: 1 week

8 years agoRework r296543:
dchagin [Sun, 20 Mar 2016 11:40:52 +0000 (11:40 +0000)]
Rework r296543:

1. Limit secs to INT32_MAX / 2 to avoid errors from kern_setitimer().
   Assert that kern_setitimer() returns 0.
   Remove bogus cast of secs.
   Fix style(9) issues.

2. Increment the return value if the remaining tv_usec value more than 500000 as a Linux does.

Pointed out by: [1] Bruce Evans

MFC after: 1 week

8 years ago[urtwn] migrate urtwn out into sys/dev/urtwn/ .
adrian [Sun, 20 Mar 2016 03:54:57 +0000 (03:54 +0000)]
[urtwn] migrate urtwn out into sys/dev/urtwn/ .

There's some upcoming work to add new chipset support here and I'd
like to only add 802.11n support to one driver, instead of both
urtwn and rtwn.

There's also missing support for things like 802.11n, some powersave
work, bluetooth integration/coexistence, etc, and also newer parts
(like 8192EU, maybe some 11ac parts, not sure yet.)

So, this is hopefully the first step in a longer set of steps to unify
rtwn/urtwn and extend it with more interesting chipset and functionality
support.

Reviewed by: kevlo

8 years agolocaledef(1): minor sorting to match Illumos.
pfg [Sun, 20 Mar 2016 03:27:06 +0000 (03:27 +0000)]
localedef(1): minor sorting to match Illumos.

Illumos recently included space in 'print' class. We already had
this but the code had slight sorting differences. Move it some
lines up to reduce diffs with Illumos.

No functional change.

Reference:
https://illumos.org/issues/5227

8 years agoUpdate fetch.1 and fetch.3 to reflect libfetch's actual use of CA bundles
grembo [Sat, 19 Mar 2016 11:55:21 +0000 (11:55 +0000)]
Update fetch.1 and fetch.3 to reflect libfetch's actual use of CA bundles

Reviewed by: wblock
Approved by: wblock
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5558

8 years agoFix incorrect (fortunately bigger) malloc size.
mav [Sat, 19 Mar 2016 11:48:06 +0000 (11:48 +0000)]
Fix incorrect (fortunately bigger) malloc size.

Submitted by: pfg
MFC after: 1 week

8 years agoAdd IDs for Intel Wellsburg USB controllers.
mav [Sat, 19 Mar 2016 09:20:18 +0000 (09:20 +0000)]
Add IDs for Intel Wellsburg USB controllers.

MFC after: 1 week

8 years ago[net80211] Add VHT Transmit Power Envelope element - 802.11ac-2013 8.4.2.164
adrian [Sat, 19 Mar 2016 04:37:33 +0000 (04:37 +0000)]
[net80211] Add VHT Transmit Power Envelope element - 802.11ac-2013 8.4.2.164

This .. seems inconsistently transmitted from various vendors.

8 years agoAllow pci_host_generic to be compiled into ARM kernels, used, e.g., in
bz [Fri, 18 Mar 2016 23:55:25 +0000 (23:55 +0000)]
Allow pci_host_generic to be compiled into ARM kernels, used, e.g., in
simulators.

Sponsored by: DARPA/AFRL

8 years agoCount the input and output packets.
loos [Fri, 18 Mar 2016 20:24:31 +0000 (20:24 +0000)]
Count the input and output packets.

Sponsored by: Rubicon Communications (Netgate)

8 years agoIncrease the arbitrary limit of TX segments.
loos [Fri, 18 Mar 2016 20:09:54 +0000 (20:09 +0000)]
Increase the arbitrary limit of TX segments.

Sponsored by: Rubicon Communications (Netgate)

8 years agoSet the destination port in all TX segments.
loos [Fri, 18 Mar 2016 20:04:34 +0000 (20:04 +0000)]
Set the destination port in all TX segments.

Sponsored by: Rubicon Communications (Netgate)

8 years agoUpdate to bmake-20160315
sjg [Fri, 18 Mar 2016 20:03:09 +0000 (20:03 +0000)]
Update to bmake-20160315

Archive member handling works again
meta mode, treat missing reads as for writes.

Update dirdeps.mk - much improved startup time.
Update meta.stage.mk - avoid ln when chmod required.

8 years agoCheck IPI status more frequently when waiting.
jhb [Fri, 18 Mar 2016 19:48:49 +0000 (19:48 +0000)]
Check IPI status more frequently when waiting.

An IPI cannot be sent via the local APIC if a previous IPI is still
being delivered.  Attempts to send an IPI will wait for a pending IPI
to clear.  Prior to r278325 these checks used a spin loop with a
hardcoded maximum count which broke AP startup on some systems.
However, r278325 also enforced a minimum latency of 5 microseconds if an
IPI was still pending which resulted in a measurable performance hit.
This change reduces that minimum latency to 1 microsecond.

Tested by: stas
MFC after: 3 days

8 years agoConvert the printfs here from %lx to %jx as well after r297000 in order
bz [Fri, 18 Mar 2016 19:36:43 +0000 (19:36 +0000)]
Convert the printfs here from %lx to %jx as well after r297000 in order
to be able to compile this into arm kernels.

Sponsored by: DARPA/AFRL

8 years agoaio_qphysio(): Avoid uninitialized pointer read on error.
pfg [Fri, 18 Mar 2016 19:04:01 +0000 (19:04 +0000)]
aio_qphysio(): Avoid uninitialized pointer read on error.

For the !unmap case it may happen that pbuf gets called unreferenced
when vm_fault_quick_hold_pages() fails.
Initialize it so it doesn't cause trouble.

CID: 1352776
Reviewed by: jhb
MFC after: 1 week

8 years agoMove the opt_ files to be included first so their definitions can be used
andrew [Fri, 18 Mar 2016 16:32:22 +0000 (16:32 +0000)]
Move the opt_ files to be included first so their definitions can be used
from within all further included files.

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

8 years agoRename COUNT_IPI to INTR_IPI_COUNT to reduce the diff with intrng.
andrew [Fri, 18 Mar 2016 16:29:58 +0000 (16:29 +0000)]
Rename COUNT_IPI to INTR_IPI_COUNT to reduce the diff with intrng.

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

8 years agoReduce the diff with intrng by renaming similar functions. This is a noop,
andrew [Fri, 18 Mar 2016 16:18:29 +0000 (16:18 +0000)]
Reduce the diff with intrng by renaming similar functions. This is a noop,
but will help move to use the common interrupt handling code later.

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

8 years agoo Restore some good whitespace killed in the previous commit.
maxim [Fri, 18 Mar 2016 15:44:21 +0000 (15:44 +0000)]
o Restore some good whitespace killed in the previous commit.

Spotted by: bjk

8 years agoTEGRA: Connect TEGRA124 to universe build.
mmel [Fri, 18 Mar 2016 15:27:57 +0000 (15:27 +0000)]
TEGRA: Connect TEGRA124 to universe build.

8 years agoo Kill EoL whitespaces.
maxim [Fri, 18 Mar 2016 15:07:43 +0000 (15:07 +0000)]
o Kill EoL whitespaces.

8 years agoo No need to resolve a mask that we get with ICMP_MASKREPLY,
maxim [Fri, 18 Mar 2016 15:06:50 +0000 (15:06 +0000)]
o No need to resolve a mask that we get with ICMP_MASKREPLY,
pass it directly to inet_ntoa(3).

8 years ago Add the ability to print out ht emodule specific information in likely formats.
julian [Fri, 18 Mar 2016 14:49:11 +0000 (14:49 +0000)]
 Add the ability to print out ht emodule specific information in likely formats.
Among other things this gives us the ability to find outthe syscall number of a dynamically loaded syscall that has a dynamicly allocated vector number.

MFC after: 1 week
Sponsored by: Panzura inc.