Add INET6.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252432 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix issues with zeroing and fetching the counters, on x86 and ppc64.
Issues were noted by Bruce Evans and are present on all architectures.

On i386, a counter fetch should use atomic read of 64bit value,
otherwise carry from the increment on other CPU could be lost for the
given fetch, making error of 2^32.  If 64bit read (cmpxchg8b) is not
available on the machine, it cannot be SMP and it is enough to disable
preemption around read to avoid the split read.

On x86 the counter increment is not atomic on purpose, which makes it
possible for the store of the incremented result to override just
zeroed per-cpu slot.  The effect would be a counter going off by
arbitrary value after zeroing.  Perform the counter zeroing on the
same processor which does the increments, making the operations
mutually exclusive.  On i386, same as for the fetching, if the
cmpxchg8b is not available, machine is not SMP and we disable
preemption for zeroing.

PowerPC64 is treated the same as amd64.

For other architectures, the changes made to allow the compilation to
succeed, without fixing the issues with zeroing or fetching.  It
should be possible to handle them by using the 64bit loads and stores
atomic WRT preemption (assuming the architectures also converted from
using critical sections to proper asm).  If architecture does not
provide the facility, using global (spin) mutex would be non-optimal
but working solution.

Noted by:  bde
Sponsored by:	The FreeBSD Foundation


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252434 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Change i_gen in UFS to an unsigned type.

In UFS, i_gen is a random generated value and there is not way for
it to be negative. Actually, the value of i_gen is just used to
match bit patterns and it is of not consequence if the values are
signed or not.

Following other filesystems, set it to unsigned and use it as such,

Discussed by:	mckusick
Reviewed by:	mckusick (previous version)
MFC after:	4 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252435 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Plug up the lock lock leakage when exporting to a short buffer.

Reported by:	Alexander Leidinger
Submitted by:	mjg
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252436 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Change i_gen in UFS to an unsigned type.

Missed format specifier.

Reported by:	mdf
MFC after:	4 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252437 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Don't assume that UFS on-disk format of a directory is the same as
defined by <sys/dirent.h>

Always start parsing at DIRBLKSIZ aligned offset, skip first entries if
uio_offset is not DIRBLKSIZ aligned. Return EINVAL if buffer is too
small for single entry.

Preallocate buffer for cookies. Cookies will be replaced with d_off
field in struct dirent at later point.

Skip entries with zero inode number.

Stop mangling dirent in ufs_extattr_iterate_directory().

Reviewed by:	kib
Sponsored by:	Google Summer Of Code 2011


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252438 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Split bcm2835-rpi-b.dts into bcm2835.dtsi and rpi.dts. This DTS actually works
on all R-Pi models because VideoCore binary patches it during boot.

Reviewed by:	gonzo


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252439 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use the new FDT_FILE rpi.dts.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252440 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Disable debugging.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252449 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The mbox driver is actually MP safe, so set the right flag in
bus_setup_intr().


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252450 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Update to current configuration.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252454 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
If you've compiled your base system with WITH_ICONV, then use it for svn
alongside the other consumers (bsdtar, csh etc).

The svnlite build gets upset when it hits non-ascii characters in
inconvenient places.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252457 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
__weak_alias() doesn't exist on FreeBSD.  Use __weak_reference();

Expose iconv functions as weak symbols as well as their internal
remapped #define names.  This is necessary for autoconf compatability -
on Linux it appears that #include <iconv.h> isn't a link time
prerequisite for their version that's built into glibc.

Initialize the pthread rwlock.  Note that upstream has three
separate locks.  The file-local static lock appears intentional.

I'm using this as a ports-compatible compile-time substitute for
converters/libiconv on one of my personal machines.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252458 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
If strdup failed, don't try and free the wrong thing.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252464 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Change i_gen in UFS to an unsigned type.

Further simplify the i_gen calculation for older disks.
Having a zero here is not really a problem and this is more
similar to what is done in newfs_random().

Reported by:	Xin Li
MFC after:	4 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252467 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Move pos++ out of the complicated equation, introduced at r240780.
There is an oppinion that result of that equation is compiler-specific.

Submitted by:	dt71@gmx.com, kientzle
Reviewed by:	rmacklem
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252468 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a sysctl to get the number of filters available.

sysctl dev.t4nex.<N>.nfilters
sysctl dev.t5nex.<N>.nfilters

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252469 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Count the number of hits for a filter by default.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252470 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove forced timeout of in-flight commands from mfi_timeout.

While this prevents commands getting stuck forever there is no way to guarantee
that data from the command hasn't been committed to the device.

In addition older mfi firmware has a bug that would cause the controller to
frequently stall IO for over our timeout value, which when combined with
a forced timeout often resulted in panics in UFS; which would otherwise be
avoided when the command eventually completed if left alone.

For reference this timeout issue is resolved in Dell FW package 21.2.1-0000.
Fixed FW package version for none Dell controller will likely vary.

MFC after:	2 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252471 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make hastctl(1) ('list' command) output a worker pid.

Reviewed by:	pjd
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@252472 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f