]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agosfxge: fix bug in TSO when a DMA segment has both header and data
arybchik [Sun, 29 Mar 2015 15:18:04 +0000 (15:18 +0000)]
sfxge: fix bug in TSO when a DMA segment has both header and data

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2163

9 years agoAdd four new DDB commands to display vmem(9) statistics.
mav [Sun, 29 Mar 2015 10:02:29 +0000 (10:02 +0000)]
Add four new DDB commands to display vmem(9) statistics.

In particular, such DDB commands were added:
        show vmem <addr>
        show all vmem
        show vmemdump <addr>
        show all vmemdump

As possible usage, that allows to see KVA usage and fragmentation.

9 years agoFix a long-standing bug with the early MAC address initialisation path,
adrian [Sun, 29 Mar 2015 06:05:00 +0000 (06:05 +0000)]
Fix a long-standing bug with the early MAC address initialisation path,
which showed up after I started changing addresses this early.

It turns out that there's some other malarky going on behind the scenes
in the HAL and merely setting the net80211/ifp mac address this early
isn't enough.  If the MAC is set from kenv at attach time, the HAL
also needs to be programmed early.

Without this, the VAP wouldn't work enough for finishing association -
probe requests would be fine as they're broadcast, but association
request would fail.

9 years agocdefs.h: Fix macros for pre-C99 compilers.
pfg [Sun, 29 Mar 2015 03:16:52 +0000 (03:16 +0000)]
cdefs.h: Fix macros for pre-C99 compilers.

Older compilers, and compatibility modes, may not support variadic macros.
I normally wouldn't go out of my way to support those old compilers but
there is a prescendent in other system headers for using the same macro
multiple times, and the solution (although non-elegant IMHO) works.

Requested by: bde
Solution by: tijl

9 years agoAdd hints to set the board MAC address and derived values for each interface.
adrian [Sat, 28 Mar 2015 23:42:59 +0000 (23:42 +0000)]
Add hints to set the board MAC address and derived values for each interface.

This allows the TL-WDR3600 to use the correct MAC address for ath0, ath1
and arge0.  arge1 isn't used; until I disable it entirely it'll just
show up with a randomly generated MAC.

9 years agoUpdate if_ath(4) to check for "hint.ath.X.macaddr" for an override MAC address.
adrian [Sat, 28 Mar 2015 23:41:23 +0000 (23:41 +0000)]
Update if_ath(4) to check for "hint.ath.X.macaddr" for an override MAC address.

This is used by the AR71xx platform code to choose a local MAC based on
the "board MAC address", versus whatever potentially invalid/garbage
values are stored in the Atheros calibration data.

9 years agoBegin moving support for board MAC addresses over to being explicitly defined.
adrian [Sat, 28 Mar 2015 23:40:29 +0000 (23:40 +0000)]
Begin moving support for board MAC addresses over to being explicitly defined.

A lot of these dinky atheros based MIPS boards don't have a nice, well,
anything consistent defining their MAC addresses for things.

The Atheros reference design boards will happily put MAC addresses
into the wifi module calibration data like they should, and individual
ethernet MAC addresses into the calibration area in flash.
That makes my life easy - "hint.arge.X.eeprommac=<addr>" reads from
that flash address to extract a MAC, and everything works fine.

However, aside from some very well behaved vendors (eg the Carambola 2
board), everyone else does something odd.

eg:

* a MAC address in the environment (eg ubiquiti routerstation/RSPRO)
   that you derive arge0/arge1 MAC addresses from.
* a MAC address in flash that you derive arge0/arge1 MAC addresses from.
* The wifi devices having their own MAC addresses in calibration data,
  like normal.
* The wifi devices having a fixed, default or garbage value for a MAC
  address in calibration data, and it has to be derived from the
  system MAC.

So to support this complete nonsense of a situation, there needs to be
a few hacks:

* The "board" MAC address needs to be derived from somewhere and squirreled
  away.  For now it's either redboot or a MAC address stored in calibration
  flash.

* Then, a "map" set of hints to populate kenv with some MAC addresses
  that are derived/local, based on the board address.  Each board has
  a totally different idea of what you do to derive things, so each
  map entry has an "offset" (+ve or -ve) that's added to the board
  MAC address.

* Then if_arge (and later, if_ath) should check kenv for said hint and
  if it's found, use that rather than the EEPROM MAC address - which may
  be totally garbage and not actually work right.

In order to do this, I've undone some of the custom redboot expecting
hacks in if_arge and the stuff that magically adds one to the MAC
address supplied by the board - instead, as I continue to test this
out on more hardware, I'll update the hints file with a map explaining
(a) where the board MAC should come from, and (b) what offsets to use
for each device.

The aim is to have all of the tplink, dlink and other random hardware
we run on have valid MAC addresses at boot, so (a) people don't get
random B:S:D:x:x:x ethernet MACs, and (b) the wifi MAC is valid
so it works rather than trying to use an invalid address that
actually upsets systems (think: multicast bit set in BSSID.)

Tested:

* TP-Link TL_WDR3600 - subsequent commits will add the hints map
  and the if_ath support.

TODO:

* Since this is -HEAD, and I'm all for debugging, there's a lot of
  printf()s in here.  They'll eventually go under bootverbose.
* I'd like to turn the macaddr routines into something available
  to all drivers - too many places hand-roll random MAC addresses
  and parser stuff.  I'd rather it just be shared code.
  However, that'll require more formal review.
* More boards.

9 years agoMake debug.vmem_check a tunable. It is useful to set it early.
kib [Sat, 28 Mar 2015 23:30:51 +0000 (23:30 +0000)]
Make debug.vmem_check a tunable.  It is useful to set it early.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoTurns out the AR933x looks like the AR7240/AR7241 switch as far as VLAN
adrian [Sat, 28 Mar 2015 23:20:46 +0000 (23:20 +0000)]
Turns out the AR933x looks like the AR7240/AR7241 switch as far as VLAN
configuration is concerned.

So, remove the now-erroneous comment.

Tested:

* AR9331 - Carambola2, with transmitting dot1q tagged packets around.

9 years agoRemove the second MODULES_OVERRIDE; add if_vlan to the list.
adrian [Sat, 28 Mar 2015 23:01:59 +0000 (23:01 +0000)]
Remove the second MODULES_OVERRIDE; add if_vlan to the list.

9 years agoWrap #ifdef guards around pmap_bootstrap ap. It's only used in SMP, and
jhibbits [Sat, 28 Mar 2015 21:39:42 +0000 (21:39 +0000)]
Wrap #ifdef guards around pmap_bootstrap ap.  It's only used in SMP, and
building without SMP causes a build failure.

MFC after: 1 month

9 years agopmcstat.8: fix -a flag description; improve -m flag to match
vangyzen [Sat, 28 Mar 2015 21:28:22 +0000 (21:28 +0000)]
pmcstat.8: fix -a flag description; improve -m flag to match

The -a flag reads a file saved by -O, not -o.

The -m flag requires the -R flag.  Copy that paragraph from -a.

Reviewed by: adrian
Approved by: kib (mentor)
MFC after: 1 week
Sponsored by: Dell Inc

9 years agoClean up some cosmetic nits in kern_umtx.c, found during recent work
vangyzen [Sat, 28 Mar 2015 21:21:40 +0000 (21:21 +0000)]
Clean up some cosmetic nits in kern_umtx.c, found during recent work
in this area and by the Clang static analyzer.

Remove some dead assignments.

Fix a typo in a panic string.

Use umtx_pi_disown() instead of duplicate code.

Use an existing variable instead of curthread.

Approved by: kib (mentor)
MFC after: 3 days
Sponsored by: Dell Inc

9 years agoAdd the MAC address hints for arge0/arge1 on the CARAMBOLA2.
adrian [Sat, 28 Mar 2015 19:59:33 +0000 (19:59 +0000)]
Add the MAC address hints for arge0/arge1 on the CARAMBOLA2.

Obtained from: Linux OpenWRT

9 years agoRemove all the handcrafted assembly in hwpmc_armv7.c and use the
bz [Sat, 28 Mar 2015 18:57:13 +0000 (18:57 +0000)]
Remove all the handcrafted assembly in hwpmc_armv7.c and use the
common (autogenerated) versions.   Removes extra vertical space,
and makes it easier to grep for usage throughout the tree.
Conditionally compile only for arm6 [1] (yes sounds odd but is right).

Submitted by: andrew [1]
Reviewed by: gnn, andrew (ian earlier version I think)
Differential Revision: https://reviews.freebsd.org/D2159
Obtained from: Cambridge/L41
Sponsored by: DARPA, AFRL

9 years agoImport lldb r233478: Fix build failure on Freebsd with gcc 4.9.
emaste [Sat, 28 Mar 2015 18:29:13 +0000 (18:29 +0000)]
Import lldb r233478: Fix build failure on Freebsd with gcc 4.9.

llvm.org/pr23051

Submitted by: rodrigc

9 years agoVNETalize random IP ID engine.
glebius [Sat, 28 Mar 2015 16:59:57 +0000 (16:59 +0000)]
VNETalize random IP ID engine.

Sponsored by: Nginx, Inc.

9 years agoInitialize random IP ID engine via SYSINIT() instead of doing that on
glebius [Sat, 28 Mar 2015 16:06:46 +0000 (16:06 +0000)]
Initialize random IP ID engine via SYSINIT() instead of doing that on
first packet.  This allow to use M_WAITOK and cut down some error handling.

Sponsored by: Nginx, Inc.

9 years agoTry to unbreak !SMP kernels broken in r280785 by using the proper macros
bz [Sat, 28 Mar 2015 15:07:19 +0000 (15:07 +0000)]
Try to unbreak !SMP kernels  broken in r280785 by using the proper macros
to access cc_cpu.

9 years agoChange the callout to supply -1 to indicate we are not changing
rrs [Sat, 28 Mar 2015 12:50:24 +0000 (12:50 +0000)]
Change the callout to supply -1 to indicate we are not changing
CPU, also add protection against invalid CPU's as well as
split c_flags and c_iflags so that if a user plays with the active
flag (the one expected to be played with by callers in MPSAFE) without
a lock, it won't adversely affect the callout system by causing a corrupt
list. This also means that all callers need to use the macros and *not*
play with the falgs directly (like netgraph used to).

Differential Revision: htts://reviews.freebsd.org/D1894
Reviewed by: .. timed out but looked at by jhb, imp, adrian hselasky
             tested by hiren and netflix.
Sponsored by: Netflix Inc.

9 years agoRe-enable using -mllvm -enable-load-pre=false in CLANG_OPT_SMALL for
dim [Sat, 28 Mar 2015 12:23:15 +0000 (12:23 +0000)]
Re-enable using -mllvm -enable-load-pre=false in CLANG_OPT_SMALL for
clang versions before 3.5.0.  This should enable building head's version
of sys/boot/i386/boot2 on 9.x and 10.x again.

Reported by: bz

9 years agosfxge: set correct RSS hash type instead of opaque
arybchik [Sat, 28 Mar 2015 10:20:20 +0000 (10:20 +0000)]
sfxge: set correct RSS hash type instead of opaque

Reviewed by:    adrian, gnn
Sponsored by:   Solarflare Communications, Inc.
Differential Revision: https://reviews.freebsd.org/D2124

9 years agoAdd an SCTP symbol which was missed in
tuexen [Sat, 28 Mar 2015 09:08:57 +0000 (09:08 +0000)]
Add an SCTP symbol which was missed in
https://svnweb.freebsd.org/base?view=revision&revision=169622
This fixes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197783
Thanks to Jukka Ukkonen for reporting the bug and providing a fix.

MFC after: 3 days

9 years agoMake it possible for the signal handler to act on #ss. Load the
kib [Sat, 28 Mar 2015 09:03:54 +0000 (09:03 +0000)]
Make it possible for the signal handler to act on #ss.  Load the
canonical user data segment' selector into %ss when calling the
handler.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoThe #ss fault handler erronously does not check for the fault
kib [Sat, 28 Mar 2015 09:02:19 +0000 (09:02 +0000)]
The #ss fault handler erronously does not check for the fault
originated from the return to usermode. #ss must be handled same as
#np.

Reported by: Andrew Lutomirski through secteam
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

9 years agoSet VM_KMEM_SIZE_SCALE=1 for the AR91xx SoCs.
adrian [Sat, 28 Mar 2015 06:54:18 +0000 (06:54 +0000)]
Set VM_KMEM_SIZE_SCALE=1 for the AR91xx SoCs.

Without this the autotuning fails for small amounts of RAM (32mb),
which all the AR91xx shipping products seemed to have.

Thanks to gjb for reminding me to re-test this stuff.

Tested:

* AR91xx, TP-Link TL-WR1043nd v1

9 years agoFix the RTC device model to operate correctly in 12-hour mode. The following
neel [Sat, 28 Mar 2015 02:55:16 +0000 (02:55 +0000)]
Fix the RTC device model to operate correctly in 12-hour mode. The following
table documents the values in the RTC 'hour' field in the two modes:

Hour-of-the-day 12-hour mode 24-hour mode
12 AM 12 0
[1-11] AM [1-11] [1-11]
12 PM 0x80 | 12 12
[1-11] PM 0x80 | [1-11] [13-23]

Reported by: Julian Hsiao (madoka@nyanisore.net)
MFC after: 1 week

9 years ago - Eliminate pagequeue locking in the dirty code in vm_pageout_scan().
jeff [Sat, 28 Mar 2015 02:36:49 +0000 (02:36 +0000)]
 - Eliminate pagequeue locking in the dirty code in vm_pageout_scan().
 - Use a more precise series of tests to see if the page changed while we
   were locking the vnode.

Reviewed by: alc
Sponsored by: EMC / Isilon

9 years agotcp provider tests: sleep for a bit after closing the socket so that
markj [Sat, 28 Mar 2015 01:11:18 +0000 (01:11 +0000)]
tcp provider tests: sleep for a bit after closing the socket so that
libdtrace has a chance to capture the traced data.

MFC after: 1 week

9 years agoMake simplebus a base class of ofwbus. This allows the elimination of
ian [Fri, 27 Mar 2015 23:10:15 +0000 (23:10 +0000)]
Make simplebus a base class of ofwbus.  This allows the elimination of
duplicated code in the two classes, and also allows devices in FDT-based
systems to declare simplebus as their parent and still work correctly
when the FDT data describes the device at the root of the tree rather
than as a child of a simplebus (which is common for interrupt, clock,
and power controllers).

Differential Revision: https://reviews.freebsd.org/D1990
Submitted by: Michal Meloun

9 years agoRevert the __ALWAYS_NO stuff. It had already been committed as BROKEN.
imp [Fri, 27 Mar 2015 21:47:15 +0000 (21:47 +0000)]
Revert the __ALWAYS_NO stuff. It had already been committed as BROKEN.

9 years agolldb: Move debug register output into __amd64__
emaste [Fri, 27 Mar 2015 19:42:38 +0000 (19:42 +0000)]
lldb: Move debug register output into __amd64__

This debug register diagnostic is really only applicable to amd64 at
present.

Sponsored by: The FreeBSD Foundation

9 years agocrunchide: arm64 support
emaste [Fri, 27 Mar 2015 19:34:24 +0000 (19:34 +0000)]
crunchide: arm64 support

Submitted by: andrew@
Sponsored by: The FreeBSD Foundation

9 years agoFix variable casting:
hselasky [Fri, 27 Mar 2015 19:08:11 +0000 (19:08 +0000)]
Fix variable casting:
- Jiffies or ticks in FreeBSD have integer type and are not long.

MFC after: 1 week
Sponsored by: Mellanox Technologies

9 years agoFix remaining warnings.
delphij [Fri, 27 Mar 2015 18:23:06 +0000 (18:23 +0000)]
Fix remaining warnings.

MFC after: 2 weeks

9 years agoAdd a note of clarification. MK_* variables only control what modules
imp [Fri, 27 Mar 2015 17:36:22 +0000 (17:36 +0000)]
Add a note of clarification. MK_* variables only control what modules
are built by default. You can still override that with MODULES_EXTRA
for experimental features like ZFS and dtrace on some
architectures. Also note that kernel config files are not affected by
MK_ options listed, though some targets might be.

9 years agoMention support for 16h family processors, added in r263169.
brueffer [Fri, 27 Mar 2015 17:15:17 +0000 (17:15 +0000)]
Mention support for 16h family processors, added in r263169.

PR: 198933
Submitted by: isoa@kapsi.fi
MFC after: 1 week

9 years agoFixes for the LinuxAPI completion wrappers:
hselasky [Fri, 27 Mar 2015 16:16:23 +0000 (16:16 +0000)]
Fixes for the LinuxAPI completion wrappers:
- make sure the timeout computations are always above zero by using
the existing "linux_timer_jiffies_until()" function. Negative timeouts
can result in undefined behaviour.
- declare all completion functions like external symbols and move the
code to the LinuxAPI kernel module.
- add a proper prefix to all LinuxAPI kernel functions to avoid
namespace collision with other parts of the FreeBSD kernel.
- clean up header file inclusions in the linux/completion.h, linux/in.h
and linux/fs.h header files.

MFC after: 1 week
Sponsored by: Mellanox Technologies

9 years agoFix build (with gcc).
kib [Fri, 27 Mar 2015 15:49:21 +0000 (15:49 +0000)]
Fix build (with gcc).

Reported by: bz, ian
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoRemove ALPHA leftover
emaste [Fri, 27 Mar 2015 14:40:58 +0000 (14:40 +0000)]
Remove ALPHA leftover

9 years agoFix the hand after the immediate reboot when the following command
kib [Fri, 27 Mar 2015 13:55:56 +0000 (13:55 +0000)]
Fix the hand after the immediate reboot when the following command
sequence is performed on UFS SU+J rootfs:
cp -Rp /sbin/init /sbin/init.old
mv -f /sbin/init.old /sbin/init

Hang occurs on the rootfs unmount.  There are two issues:

1. Removed init binary, which is still mapped, creates a reference to
the removed vnode. The inodeblock for such vnode must have active
inodedep, which is (eventually) linked through the unlinked list. This
means that ffs_sync(MNT_SUSPEND) cannot succeed, because number of
softdep workitems for the mp is always > 0.  FFS is suspended during
unmount, so unmount just hangs.

2. As noted above, the inodedep is linked eventually.  It is not
linked until the superblock is written.  But at the vfs_unmountall()
time, when the rootfs is unmounted, the call is made to
ffs_unmount()->ffs_sync() before vflush(), and ffs_sync() only calls
ffs_sbupdate() after all workitems are flushed.  It is masked for
normal system operations, because syncer works in parallel and
eventually flushes superblock.  Syncer is stopped when rootfs
unmounted, so ffs_sync() must do sb update on its own.

Correct the issues listed above. For MNT_SUSPEND, count the number of
linked unlinked inodedeps (this is not a typo) and substract the count
of such workitems from the total. For the second issue, the
ffs_sbupdate() is called right after device sync in ffs_sync() loop.

There is third problem, occuring with both SU and SU+J. The
softdep_waitidle() loop, which waits for softdep_flush() thread to
clear the worklist, only waits 20ms max. It seems that the 1 tick,
specified for msleep(9), was a typo.

Add fsync(devvp, MNT_WAIT) call to softdep_waitidle(), which seems to
significantly help the softdep thread, and change the MNT_LAZY update
at the reboot time to MNT_WAIT for similar reasons.  Note that
userspace cannot create more work while devvp is flushed, since the
mount point is always suspended before the call to softdep_waitidle()
in unmount or remount path.

PR: 195458
In collaboration with: gjb, pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoOn multi CPU systems, we may emit successive packets with the same id.
fabient [Fri, 27 Mar 2015 13:26:59 +0000 (13:26 +0000)]
On multi CPU systems, we may emit successive packets with the same id.
Fix the race by using an atomic operation.

Differential Revision: https://reviews.freebsd.org/D2141
Obtained from: emeric.poupon@stormshield.eu
MFC after: 1 week
Sponsored by: Stormshield

9 years agoRemove extra semicolon.
mav [Fri, 27 Mar 2015 12:45:20 +0000 (12:45 +0000)]
Remove extra semicolon.

MFC after: 1 week

9 years agoRemove request sorting from GEOM_MIRROR and GEOM_RAID.
mav [Fri, 27 Mar 2015 12:44:28 +0000 (12:44 +0000)]
Remove request sorting from GEOM_MIRROR and GEOM_RAID.

When CPU is not busy, those queues are typically empty.  When CPU is busy,
then one more extra sorting is the last thing it needs.  If specific device
(HDD) really needs sorting, then it will be done later by CAM.

This supposed to fix livelock reported for mirror of two SSDs, when UFS
fires zillion of BIO_DELETE requests, that totally blocks I/O subsystem by
pointless sorting of requests and responses under single mutex lock.

MFC after: 2 weeks

9 years agoFix bug on memory allocation error in split method.
mav [Fri, 27 Mar 2015 11:14:12 +0000 (11:14 +0000)]
Fix bug on memory allocation error in split method.

While there, use bioq_takefirst() in place where it is convenient.

MFC after: 1 week

9 years agoRather than defining our own magic checks here use INKERNEL() for
bz [Fri, 27 Mar 2015 08:47:16 +0000 (08:47 +0000)]
Rather than defining our own magic checks here use INKERNEL() for
the PMC_IN_KERNEL() macro definition.

Add missing macros to extract the return address (LR) from the trapframe.

Discussed with: andrew
Obtained from: Cambridge/L41
Sponsored by: DARPA, AFRL
MFC after: 2 weeks

9 years agosym and cxgb build on arm, add them to the build.
imp [Fri, 27 Mar 2015 02:35:33 +0000 (02:35 +0000)]
sym and cxgb build on arm, add them to the build.

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

9 years agoCategorize certain kernel builds as being broken in certain places.
imp [Fri, 27 Mar 2015 02:35:25 +0000 (02:35 +0000)]
Categorize certain kernel builds as being broken in certain places.

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

9 years agoAdd support for specifying unsupported / broken options that override
imp [Fri, 27 Mar 2015 02:35:11 +0000 (02:35 +0000)]
Add support for specifying unsupported / broken options that override
any defaults or user specified actions on the command line. This would
be useful for specifying features that are always broken or that
cannot make sense on a specific architecture, like ACPI on pc98 or
EISA on !i386 (!x86 usage of EISA is broken and there's no supported
hardware that could have it in any event). Any items in
__ALWAYS_NO_OPTIONS are forced to "no" regardless of other settings.

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

9 years agoFix __size_alloc()
pfg [Fri, 27 Mar 2015 02:01:22 +0000 (02:01 +0000)]
Fix __size_alloc()

Use underscore for the attributes name: this should fix the use of the
attributes in macros for lint(1).

Suggested by: bde

X-MFC with: r280700

9 years agoMove legacy interrupt allocation for virtio devices to common code.
grehan [Fri, 27 Mar 2015 01:58:44 +0000 (01:58 +0000)]
Move legacy interrupt allocation for virtio devices to common code.
There are a number of assumptions about legacy interrupts always
being available in virtio so don't allow back-ends to make the
decision to support them.

This fixes the issue seen with virtio-rnd on OpenBSD. MSI-x vectors
were not being used, and the virtio-rnd backend wasn't allocating a
legacy interrupt resulting in a bhyve assert and guest exit.

Reported by: Julian Hsiao, madoka at nyanisore dot net
Reviewed by: neel
MFC after: 1 week

9 years agoAllow additional flags to be passed to netstat -i in the daily status check.
jhb [Fri, 27 Mar 2015 00:37:41 +0000 (00:37 +0000)]
Allow additional flags to be passed to netstat -i in the daily status check.
In particular, this allows an administrator to specify "-h" for human
readable output if that is preferred.

The default setting passes "-d", so that can be excluded by using a custom
setting.

Differential Revision: https://reviews.freebsd.org/D2034
Submitted by: Lystopad Aleksandr <laa@laa.zp.ua>
(patch to add option for -h)
Reviewed by: bz
MFC after: 1 week

9 years agoFix a possible mbuf leak on interface departure.
ae [Thu, 26 Mar 2015 23:40:22 +0000 (23:40 +0000)]
Fix a possible mbuf leak on interface departure.

Reported by: Alexandre Martins

9 years agoAdd --sysroot to the compiler flags for clang or gcc external toolchains
rodrigc [Thu, 26 Mar 2015 23:37:03 +0000 (23:37 +0000)]
Add --sysroot to the compiler flags for clang or gcc external toolchains

Before this fix, --sysroot was only added to the compiler flags if a clang
external toolchain was used.

Reviewed by:   imp

9 years ago - Correct type for checkAgainst.
delphij [Thu, 26 Mar 2015 22:34:27 +0000 (22:34 +0000)]
 - Correct type for checkAgainst.
 - Staticify flags that are not used outside the file scope.

PR: bin/193471
Submitted by: Robert Sprowson <webpages sprow.co.uk>
MFC after: 2 weeks

9 years agoImprove the selection of the destination address of SACK chunks.
tuexen [Thu, 26 Mar 2015 22:05:31 +0000 (22:05 +0000)]
Improve the selection of the destination address of SACK chunks.
This fixes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196755
and is joint work with rrs@.

MFC after: 1 week

9 years agosetmode(): Use sysctl kern.proc.umask instead of umask() if possible.
jilles [Thu, 26 Mar 2015 21:58:06 +0000 (21:58 +0000)]
setmode(): Use sysctl kern.proc.umask instead of umask() if possible.

The kern.proc.umask.<pid> sysctl allows querying the umask without
temporarily modifying it.

9 years agoNew pmap code for armv6. Disabled by default, option ARM_NEW_PMAP enables it.
ian [Thu, 26 Mar 2015 21:13:53 +0000 (21:13 +0000)]
New pmap code for armv6. Disabled by default, option ARM_NEW_PMAP enables it.

This is pretty much a complete rewrite based on the existing i386 code.  The
patches have been circulating for a couple years and have been looked at by
plenty of people, but I'm not putting anybody on the hook as having reviewed
this in any formal sense except myself.

After this has gotten wider testing from the user community, ARM_NEW_PMAP
will become the default and various dregs of the old pmap code will be
removed.

Submitted by: Svatopluk Kraus <onwahe@gmail.com>,
   Michal Meloun <meloun@miracle.cz>

9 years agoAdd more arm64 machine dependent headers. With this we now have the minimum
andrew [Thu, 26 Mar 2015 21:10:42 +0000 (21:10 +0000)]
Add more arm64 machine dependent headers. With this we now have the minimum
set of machine headers needed to build the userland toolchain.

Differential Revision: https://reviews.freebsd.org/D2148
Reviewed by: imp
Sponsored by: The FreeBSD Foundation

9 years agoPer Gleb, add the pmcstudy.1.gz which was moved to pmcstudy.8.gz
rrs [Thu, 26 Mar 2015 20:08:25 +0000 (20:08 +0000)]
Per Gleb, add the pmcstudy.1.gz which was moved to pmcstudy.8.gz

9 years agoUse pmap_mapdev()/unmapdev() to temporarily map on-chip sram while copying
ian [Thu, 26 Mar 2015 19:33:07 +0000 (19:33 +0000)]
Use pmap_mapdev()/unmapdev() to temporarily map on-chip sram while copying
the startup trampoline code.  The old code allocated a kva page, mapped it
using using pmap_kenter_nocache(), then freed the kva without destroying
the mapping.  This is the only use of pmap_kenter_nocache() in the system,
so redoing this one use of allows it to be garbage collected in the
near future.

9 years agocxgbe(4): provide the exact RSS hash type instead of a catch-all value
np [Thu, 26 Mar 2015 18:45:51 +0000 (18:45 +0000)]
cxgbe(4): provide the exact RSS hash type instead of a catch-all value
to the upper layers.

9 years agoAlso define DWARF_FRAME_REGISTERS. This is used to size arrays, without
andrew [Thu, 26 Mar 2015 18:25:53 +0000 (18:25 +0000)]
Also define DWARF_FRAME_REGISTERS. This is used to size arrays, without
this exceptions could write over the stack.

Sponsored by: The FreeBSD Foundation

9 years agoMake swapper release orphaned (lost) GEOM provider.
mav [Thu, 26 Mar 2015 17:21:12 +0000 (17:21 +0000)]
Make swapper release orphaned (lost) GEOM provider.

Swap device is still reported as enabled, and system still may crash later
if some swapped-out kernel pages were lost with the device, but at least
GEOM and CAM can now release the lost disk, allowing it to be reconnected.

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

9 years agoClarify the ministat default width
kp [Thu, 26 Mar 2015 17:13:11 +0000 (17:13 +0000)]
Clarify the ministat default width

The man page states that:
'-w width    Width of ASCII-art plot in characters, default is 74.'

This is not entirely correct. The mini-help is more accurate:
'-w : width of graph/test output (default 74 or terminal width)'

In other words: the man page fails to explain that ministat will default
to the terminal width, not 74. It will only fall back to 74 if stdout is
not a TTY.

Submitted by: Ben Hutchings <ben@decadent.org.uk>
Approved by: philip (mentor)

9 years agoIntroduce some allocation function attributes.
pfg [Thu, 26 Mar 2015 16:00:35 +0000 (16:00 +0000)]
Introduce some allocation function attributes.

Bring support for two gcc function attributes that are likely to be used
in our system headers:

__alloc_size
The alloc_size attribute is used to tell the compiler that the function
return value points to memory, where the size is given by one or two of
the functions parameters.

__result_use_check
Causes a warning to be emitted if a caller of the function with this
attribute does not use its return value. This is known in gcc as
"warn_unused_result" but we considered the original naming unsuitable
for an attribute.

The __alloc_size attribute required some workarounds for lint(1).
Both attributes are supported by clang.

Also see: D2107

MFC after: 3 days

9 years agoRough first mdoc, spelling and grammar cleanup pass.
brueffer [Thu, 26 Mar 2015 15:54:54 +0000 (15:54 +0000)]
Rough first mdoc, spelling and grammar cleanup pass.

9 years agoOpps its section 8 not 1 silly.
rrs [Thu, 26 Mar 2015 15:43:57 +0000 (15:43 +0000)]
Opps its section 8 not 1 silly.
MFC after: 3 days
Sponsored by: Netflix

9 years agoUpdate the manual page to be a bit more sane. It still
rrs [Thu, 26 Mar 2015 15:40:47 +0000 (15:40 +0000)]
Update the manual page to be a bit more sane. It still
may need some work, but at least now it will read properly.
(gnn you are still on the hook to help out with this
like you committed).

Sponsored by: Netflix.

9 years agoAdd myself (kp) to committers-src.dot
kp [Thu, 26 Mar 2015 15:27:38 +0000 (15:27 +0000)]
Add myself (kp) to committers-src.dot

Approved by: philip (mentor)

9 years agoMake several modules unconditionally built, there's no need for them to be
jhibbits [Thu, 26 Mar 2015 14:55:22 +0000 (14:55 +0000)]
Make several modules unconditionally built, there's no need for them to be
hidden.

These modules pass a tinderbox build.
Discussed with: ian and others
MFC after: 1 month

9 years agoAdd 64 byte linesize cache flushing routines for L1 instruction, L1 data
br [Thu, 26 Mar 2015 14:51:24 +0000 (14:51 +0000)]
Add 64 byte linesize cache flushing routines for L1 instruction, L1 data
and L2 data caches.

Sponsored by: HEIF5

9 years agoStatic'ize pf_fillup_fragment body to match its declaration.
pluknet [Thu, 26 Mar 2015 13:31:04 +0000 (13:31 +0000)]
Static'ize pf_fillup_fragment body to match its declaration.

Missed in 278925.

9 years agoRemove duplicate AH_DEBUG_ALQ option.
gjb [Thu, 26 Mar 2015 12:58:30 +0000 (12:58 +0000)]
Remove duplicate AH_DEBUG_ALQ option.

Sponsored by: The FreeBSD Foundation

9 years agoCorrected descriptions of net.inet.icmp.icmplim and icmplim_output.
ru [Thu, 26 Mar 2015 12:52:21 +0000 (12:52 +0000)]
Corrected descriptions of net.inet.icmp.icmplim and icmplim_output.

Reviewed by: pluknet

9 years agoMake GEOM_PART work in presence of previous withered self.
mav [Thu, 26 Mar 2015 12:17:47 +0000 (12:17 +0000)]
Make GEOM_PART work in presence of previous withered self.

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

9 years agoReport withered providers as such alike to GEOMs.
mav [Thu, 26 Mar 2015 11:19:24 +0000 (11:19 +0000)]
Report withered providers as such alike to GEOMs.

MFC after: 2 weeks

9 years agoWhen searching for provider by name, prefer non-withered one.
mav [Thu, 26 Mar 2015 11:02:29 +0000 (11:02 +0000)]
When searching for provider by name, prefer non-withered one.

MFC after: 2 weeks

9 years agoPrint size_t's with %zu rather than "%zd.
kevlo [Thu, 26 Mar 2015 09:13:16 +0000 (09:13 +0000)]
Print size_t's with %zu rather than "%zd.

Reviewed by: bde

9 years agoAdd comments about CTLFLAG_RDTUN vs. TUNABLE_INT_FETCH.
rpaulo [Thu, 26 Mar 2015 05:20:18 +0000 (05:20 +0000)]
Add comments about CTLFLAG_RDTUN vs. TUNABLE_INT_FETCH.

Requested by: julian

9 years agoMake sure that we don't free an SCTP shared key too early.
tuexen [Wed, 25 Mar 2015 22:45:54 +0000 (22:45 +0000)]
Make sure that we don't free an SCTP shared key too early.
Thanks to Pouyan Sepehrdad from Qualcomm Product Security Initiative
for reporting the issue.
MFC after: 3 days

9 years agoCrochet sources moved to a new home; update accordingly.
gjb [Wed, 25 Mar 2015 22:08:02 +0000 (22:08 +0000)]
Crochet sources moved to a new home; update accordingly.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

9 years agoAdd some more explanation to the different phases of the build.
imp [Wed, 25 Mar 2015 21:59:36 +0000 (21:59 +0000)]
Add some more explanation to the different phases of the build.

9 years agoTemporarily revert 280458.
pfg [Wed, 25 Mar 2015 21:53:17 +0000 (21:53 +0000)]
Temporarily revert 280458.

GCC is still carries an old version of cdefs.h which doesn't
accept multiple parameters for the nonnull attribute.

Since this issue probably affects many ports in the tree
we will revert it for now until gcc gets fixed.

9 years agoUse the reference count of the right SCTP inp.
tuexen [Wed, 25 Mar 2015 21:41:20 +0000 (21:41 +0000)]
Use the reference count of the right SCTP inp.
Joint work with rrs@

MFC after: 3 days

9 years agoForce MK_INCLUDES for the legacy stage
emaste [Wed, 25 Mar 2015 20:57:08 +0000 (20:57 +0000)]
Force MK_INCLUDES for the legacy stage

As legacy executes "make installincludes" we don't want it to be
disabled by a src.conf setting.

Reviewed by: imp
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2143

9 years agoRemove defunct SSLv2 support from fetch(1) and fetch(3).
jkim [Wed, 25 Mar 2015 18:56:36 +0000 (18:56 +0000)]
Remove defunct SSLv2 support from fetch(1) and fetch(3).

9 years agoUpdate the portmgr members list
culot [Wed, 25 Mar 2015 18:02:06 +0000 (18:02 +0000)]
Update the portmgr members list

9 years agoClean sparse spaces.
pfg [Wed, 25 Mar 2015 16:54:37 +0000 (16:54 +0000)]
Clean sparse spaces.

9 years agoFix couple of fallouts from r280280. The first one is a simple typo,
glebius [Wed, 25 Mar 2015 16:01:46 +0000 (16:01 +0000)]
Fix couple of fallouts from r280280. The first one is a simple typo,
where counter was incremented on parent, instead of vlan(4) interface.

The second is more complicated. Historically, in our stack the incoming
packets are accounted in drivers, while incoming bytes for Ethernet
drivers are accounted in ether_input_internal(). Thus, it should be
removed from vlan(4) driver.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoApply r276208 to non-amd64 NOTES files as well to fix tinderbox builds
jhb [Wed, 25 Mar 2015 15:51:41 +0000 (15:51 +0000)]
Apply r276208 to non-amd64 NOTES files as well to fix tinderbox builds
run under a system using vt(4) instead of syscons(4):

Use compiled in default keymaps which are available both in syscons and vt.

9 years agoAdd definition of the ISOCHRONOUS endpoint usage bits.
hselasky [Wed, 25 Mar 2015 13:32:27 +0000 (13:32 +0000)]
Add definition of the ISOCHRONOUS endpoint usage bits.
Refer to the USB v2.0 specification for more information.

MFC after: 1 week

9 years agoAdd DA_Q_NO_RC16 quirk for USB mass storage device.
hselasky [Wed, 25 Mar 2015 13:28:13 +0000 (13:28 +0000)]
Add DA_Q_NO_RC16 quirk for USB mass storage device.

PR: 198647
MFC after: 1 week

9 years agomdoc cleanup; fix spelling; Xref ixlv.4
brueffer [Wed, 25 Mar 2015 12:46:19 +0000 (12:46 +0000)]
mdoc cleanup; fix spelling; Xref ixlv.4

9 years agoFix a typo and EOL whitespace missed in the previous commit.
brueffer [Wed, 25 Mar 2015 12:45:29 +0000 (12:45 +0000)]
Fix a typo and EOL whitespace missed in the previous commit.

9 years agomdoc cleanup; fix spelling.
brueffer [Wed, 25 Mar 2015 12:14:34 +0000 (12:14 +0000)]
mdoc cleanup; fix spelling.

9 years agoRemove a debug #error from the bcm2835 sdhci driver.
andrew [Wed, 25 Mar 2015 11:53:52 +0000 (11:53 +0000)]
Remove a debug #error from the bcm2835 sdhci driver.

9 years agoAdd support for the Raspberry Pi 2. As the chip is based on the bcm2835 in
andrew [Wed, 25 Mar 2015 10:59:42 +0000 (10:59 +0000)]
Add support for the Raspberry Pi 2. As the chip is based on the bcm2835 in
the Raspberry Pi B we support most of the devices are already supported,
however the base address has changed.

A few items are not working, or missing. The main ones are:
 * DMA doesn't work in the sdhci driver.
 * Enabling vchiq halts the boot, may be interrupt related.
 * There is no U-Boot port yet so the DTB is embedded in the kernel.

The last point will make it difficult to boot FreeBSD, however there is
support for the Raspberry Pi 2 in the U-Boot git repo. As I have not tested
this it is left as an open task to create a port to build.

X-MFC: When the above issues are fixed
Sponsored by: ABT Systems Ltd

9 years agoAdd the Raspberry Pi 2 dtb, based on the existing rpi.dts, but with a
andrew [Wed, 25 Mar 2015 10:26:07 +0000 (10:26 +0000)]
Add the Raspberry Pi 2 dtb, based on the existing rpi.dts, but with a
different base address for the devces.

MFC after: 1 week

9 years agoImplement a simple OID number garbage collector. Given the increasing
hselasky [Wed, 25 Mar 2015 08:55:34 +0000 (08:55 +0000)]
Implement a simple OID number garbage collector. Given the increasing
number of dynamically created and destroyed SYSCTLs during runtime it
is very likely that the current new OID number limit of 0x7fffffff can
be reached. Especially if dynamic OID creation and destruction results
from automatic tests. Additional changes:

- Optimize the typical use case by decrementing the next automatic OID
sequence number instead of incrementing it. This saves searching time
when inserting new OIDs into a fresh parent OID node.

- Add simple check for duplicate non-automatic OID numbers.

MFC after:  1 week