freebsd.git
10 years agounits(1): Add v option: verbose
eadler [Mon, 14 Apr 2014 20:51:04 +0000 (20:51 +0000)]
units(1): Add v option: verbose

For increased compatibility with GNU units: support a -v option which
produces more verbose output when spitting out the answer.
GNU -v does additional work in the version, information, and check output which
we do not (yet?) replicate.

10 years agoLagg did not set the value of if_hw_tsomax, so when lagg
rmacklem [Mon, 14 Apr 2014 20:34:48 +0000 (20:34 +0000)]
Lagg did not set the value of if_hw_tsomax, so when lagg
was stacked on top of network interfaces that set if_hw_tsomax,
tcp_output() would see the default value instead of the value
set by the network interface(s). This patch modifies lagg so that
it sets if_hw_tsomax to the minimum of the value(s) for the
underlying network interfaces.

Reviewed by: glebius
MFC after: 2 weeks

10 years agoAdd support for emulating the slave PIC.
tychon [Mon, 14 Apr 2014 19:00:20 +0000 (19:00 +0000)]
Add support for emulating the slave PIC.

Reviewed by: grehan, jhb
Approved by: grehan (co-mentor)

10 years agoTake into account when zpool history block grows exceeding 128KB in zpool(8)
delphij [Mon, 14 Apr 2014 18:38:14 +0000 (18:38 +0000)]
Take into account when zpool history block grows exceeding 128KB in zpool(8)
and zdb(8) by growing the buffer on demand with a cap of 1GB (specified in
spa_history_create_obj()).

PR: bin/186574
Submitted by: Andrew Childs <lorne cons org nz> (with changes)
MFC after: 2 weeks

10 years agoFix err() usage in libcapsicum(3) example.
gjb [Mon, 14 Apr 2014 18:14:09 +0000 (18:14 +0000)]
Fix err() usage in libcapsicum(3) example.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

10 years agoPrefer /etc/login.conf for some of these environment values.
bdrewery [Mon, 14 Apr 2014 18:07:00 +0000 (18:07 +0000)]
Prefer /etc/login.conf for some of these environment values.

PR: conf/186085
Reported by: Glen Neff <glen.neff@emc.com>
MFC after: 2 weeks
Sponsored by: EMC

10 years agounits(1): Add U option
eadler [Mon, 14 Apr 2014 16:55:09 +0000 (16:55 +0000)]
units(1): Add U option

For increased compatibility with GNU units: support a -U option which tests for the
existence of the default units file and prints it to the screen.

10 years agounits(1): support reading multiple units files
eadler [Mon, 14 Apr 2014 16:43:36 +0000 (16:43 +0000)]
units(1): support reading multiple units files

GNU units(1) supports reading up to 25 -f options.  We support an arbitrary
number.

10 years agoCommit various fixes for the SolarFlare drivers, in particular
gnn [Mon, 14 Apr 2014 16:31:56 +0000 (16:31 +0000)]
Commit various fixes for the SolarFlare drivers, in particular
this set of patches fixes support for systems with > 32 cores.

Details include

sfxge: RXQ index (not label) comes from FW in flush done/failed events

Change the second argument name of the efx_rxq_flush_done_ev_t and
efx_rxq_flush_failed_ev_t prototypes to highlight that RXQ index (not label)
comes from FW in flush done and failed events.

sfxge: TXQ index (not label) comes from FW in flush done event

Change the second argument name of the efx_txq_flush_done_ev_t prototype to
highlight that TXQ index (not label) comes from FW in flush done event.

sfxge: use TXQ type as label to support more than 32 TXQs

There are 3 TXQs in event queue 0 and 1 TXQ (with TCP/UDP checksum offload)
in all other event queues.

Submitted by: Andrew Rybchenko <Andrew.Rybchenko at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.

10 years agoDocument the xdev* targets.
brueffer [Mon, 14 Apr 2014 16:15:11 +0000 (16:15 +0000)]
Document the xdev* targets.

PR: 188519
Submitted by: Idwer Vollering <vidwer at gmail.com>
Reviewed by: bapt
MFC after: 1 week

10 years agounits(1): parse config file after setting defaults
eadler [Mon, 14 Apr 2014 14:40:12 +0000 (14:40 +0000)]
units(1): parse config file after setting defaults

Parse the config file after setting the defaults to permit the user to change
things (e.g., editing mode)

10 years agounits(1): add libedit support
eadler [Mon, 14 Apr 2014 14:04:59 +0000 (14:04 +0000)]
units(1): add libedit support

Add line editing and history support to units(1) via libedit.

Reviewed by: bdrewery

10 years agoCorrect geli parameter.
brueffer [Mon, 14 Apr 2014 06:59:49 +0000 (06:59 +0000)]
Correct geli parameter.

PR: 188582
Submitted by: Michael Hall
MFC after: 3 days

10 years ago- Move davidxu to the alumni section
pgj [Mon, 14 Apr 2014 06:34:08 +0000 (06:34 +0000)]
- Move davidxu to the alumni section

Approved by: core (implicit)

10 years agoFix typo in debug/log statement.
dteske [Mon, 14 Apr 2014 05:35:01 +0000 (05:35 +0000)]
Fix typo in debug/log statement.

Submitted by: Rick Miller <vmiller@hostileadmin.com>

10 years agoFix some off-by-one errors. The kve_end and rdl_eaddr fields contain the
markj [Mon, 14 Apr 2014 00:24:04 +0000 (00:24 +0000)]
Fix some off-by-one errors. The kve_end and rdl_eaddr fields contain the
first address after the end of the map entry and should therefore be
excluded.

MFC after: 2 weeks

10 years agoEnsure that all eight syscall arguments are available to dtrace_probe(),
markj [Mon, 14 Apr 2014 00:23:18 +0000 (00:23 +0000)]
Ensure that all eight syscall arguments are available to dtrace_probe(),
rather than just the first five. This is done by calling dtrace_probe()
through a function pointer, as in illumos.

MFC after: 3 weeks

10 years agoDTrace's pid provider works by inserting breakpoint instructions at probe
markj [Mon, 14 Apr 2014 00:22:42 +0000 (00:22 +0000)]
DTrace's pid provider works by inserting breakpoint instructions at probe
sites and installing a hook at the kernel's trap handler. The fasttrap code
will emulate the overwritten instruction in some common cases, but otherwise
copies it out into some scratch space in the traced process' address space
and ensures that it's executed after returning from the trap.

In Solaris and illumos, this (per-thread) scratch space comes from some
reserved space in TLS, accessible via the fs segment register. This
approach is somewhat unappealing on FreeBSD since it would require some
modifications to rtld and jemalloc (for static TLS) to ensure that TLS is
executable, and would thus introduce dependencies on their implementation
details. I think it would also be impossible to safely trace static binaries
compiled without these modifications.

This change implements the functionality in a different way, by having
fasttrap map pages into the target process' address space on demand. Each
page is divided into 64-byte chunks for use by individual threads, and
fasttrap's process descriptor struct has been extended to keep track of
any scratch space allocated for the corresponding process.

With this change it's possible to trace all libc functions in a program,
e.g. with

  pid$target:libc.so.*::entry {@[probefunc] = count();}

Previously this would generally cause the victim process to crash, as
tracing memcpy on amd64 requires the functionality described above.

Tested by: Prashanth Kumar <pra_udupi@yahoo.co.in> (earlier version)
MFC after: 6 weeks

10 years agoImprove the i.MX53 / Digi DTS:
rpaulo [Sun, 13 Apr 2014 22:35:39 +0000 (22:35 +0000)]
Improve the i.MX53 / Digi DTS:

* Fix the IPU address.
* Fix the PATA definition.
* Add another I2C.
* Add more UARTs.
* Add SATA.

10 years agor264402 builds fine, but turns out there are problems with
imp [Sun, 13 Apr 2014 21:52:27 +0000 (21:52 +0000)]
r264402 builds fine, but turns out there are problems with
install. Back it out until they can be tracked down.

10 years agoFree buf after usage.
brueffer [Sun, 13 Apr 2014 21:23:15 +0000 (21:23 +0000)]
Free buf after usage.

CID: 1199377
Found with: Coverity Prevent(tm)
MFC after: 1 week

10 years agoFree resources and error cases; re-indent a curly brace while here.
brueffer [Sun, 13 Apr 2014 21:13:33 +0000 (21:13 +0000)]
Free resources and error cases; re-indent a curly brace while here.

CID: 1199366
Found with: Coverity Prevent(tm)
MFC after: 1 week

10 years agoAlways install pkg.conf. Don't depend on MK_PKGBOOTSTRAP.
bdrewery [Sun, 13 Apr 2014 20:21:56 +0000 (20:21 +0000)]
Always install pkg.conf. Don't depend on MK_PKGBOOTSTRAP.

This file is used by pkg(8) from ports as well. Someone may
choose to not install pkg(7) but still want to consume
official packages by building or installing pkg(8) manually.

Discussed with: bapt
MFC after: 1 day (Working on EN)

10 years agoAvoid double close() of a file descriptor.
brueffer [Sun, 13 Apr 2014 20:12:21 +0000 (20:12 +0000)]
Avoid double close() of a file descriptor.

CID: 1006089
Found with: Coverity Prevent(tm)
MFC after: 1 week

10 years agoAvoid double free in f_acl().
brueffer [Sun, 13 Apr 2014 19:48:51 +0000 (19:48 +0000)]
Avoid double free in f_acl().

CID: 1018508
Found with: Coverity Prevent(tm)
MFC after: 1 week

10 years agorealpath(): Properly fail "." or ".." components after non-directories.
jilles [Sun, 13 Apr 2014 19:48:28 +0000 (19:48 +0000)]
realpath(): Properly fail "." or ".." components after non-directories.

If realpath() is called on pathnames like "/dev/null/." or "/dev/null/..",
it should fail with [ENOTDIR]. Pathnames like "/dev/null/" already failed as
they should.

Also, put the check for non-directories after lstatting the previous
component instead of when the empty component (consecutive or trailing
slashes) is detected, saving an lstat() call and some lines of code.

PR: kern/82980
MFC after: 2 weeks

10 years agoAdd a missing comma between error message definitions.
brueffer [Sun, 13 Apr 2014 18:51:39 +0000 (18:51 +0000)]
Add a missing comma between error message definitions.

CID: 1199266
Found with: Coverity Prevent(tm)
MFC after: 1 week

10 years agoBump Dd for r264384.
brueffer [Sun, 13 Apr 2014 18:21:53 +0000 (18:21 +0000)]
Bump Dd for r264384.

Requested by: gjb

10 years agoApparently some of the i386 boot blocks are so close to full that adding
nwhitehorn [Sun, 13 Apr 2014 14:50:52 +0000 (14:50 +0000)]
Apparently some of the i386 boot blocks are so close to full that adding
single lines to ufsread.c spills them over. Duplicate a whole bunch of
code to get file sizes into boot1.efi/boot1.c rather than modifying
ufsread.c.

10 years agoMiscellaneous fixes to tests(7).
jmmv [Sun, 13 Apr 2014 11:59:42 +0000 (11:59 +0000)]
Miscellaneous fixes to tests(7).

- Properly capitalize "FreeBSD Test Suite".
- At this point, the test suite first appeared in 10.1, not in 11.0.
- Use my FreeBSD.org address.

10 years agoAdd FreeBSD 10.1 to the list of recognized releases for Fx.
jmmv [Sun, 13 Apr 2014 11:57:51 +0000 (11:57 +0000)]
Add FreeBSD 10.1 to the list of recognized releases for Fx.

This version is already mentioned by 4 manual pages.

10 years agofind: Return normal exit status from -quit.
jilles [Sun, 13 Apr 2014 11:47:17 +0000 (11:47 +0000)]
find: Return normal exit status from -quit.

If there was an error, make the exit status reflect this even if -quit
caused the exit. Formerly, -quit always caused exit(0).

GNU find does the same.

10 years agoDocument how to install the test suite.
jmmv [Sun, 13 Apr 2014 11:35:42 +0000 (11:35 +0000)]
Document how to install the test suite.

As part of this, install the tests(7) manual page unconditionally (not only
when WITH_TESTS=yes) so that users that have not yet enabled the build of
the test suite can read details on how to do so.

10 years agoRegen after rewording of WITH_TESTS.
jmmv [Sun, 13 Apr 2014 11:31:41 +0000 (11:31 +0000)]
Regen after rewording of WITH_TESTS.

10 years agoFix test suite name in src.conf(5).
jmmv [Sun, 13 Apr 2014 11:29:52 +0000 (11:29 +0000)]
Fix test suite name in src.conf(5).

There is no such thing as the "Kyua test suite"; it is the "FreeBSD Test
Suite".

While doing this, point readers to tests(7).

10 years agoJoin CTL worker threads into one process for convenience.
mav [Sun, 13 Apr 2014 11:10:36 +0000 (11:10 +0000)]
Join CTL worker threads into one process for convenience.
Report their idle state as "-".

10 years agoReport more readable state "-" for idle CAM scan thread.
mav [Sun, 13 Apr 2014 11:08:57 +0000 (11:08 +0000)]
Report more readable state "-" for idle CAM scan thread.

10 years agoFix periph listing when IOCTL buffer border hits result for wanted bus.
mav [Sun, 13 Apr 2014 09:31:22 +0000 (09:31 +0000)]
Fix periph listing when IOCTL buffer border hits result for wanted bus.

10 years agoAdd my copyright here. Most of this is unmodified from the original sparc64
nwhitehorn [Sun, 13 Apr 2014 06:30:02 +0000 (06:30 +0000)]
Add my copyright here. Most of this is unmodified from the original sparc64
version, but at least some indication of changes that postdate the actual
invention of EFI is probably a good idea.

10 years agoFix buildworld. I had some local bits in my build tree that caused this
nwhitehorn [Sun, 13 Apr 2014 06:24:01 +0000 (06:24 +0000)]
Fix buildworld. I had some local bits in my build tree that caused this
to work by accident.

10 years agoConvert NO_MANCOMPRESS to normal convention.
imp [Sun, 13 Apr 2014 05:22:26 +0000 (05:22 +0000)]
Convert NO_MANCOMPRESS to normal convention.

10 years agoIn tree makefile shouldn't be setting policy piecemeal. Don't set
imp [Sun, 13 Apr 2014 05:22:22 +0000 (05:22 +0000)]
In tree makefile shouldn't be setting policy piecemeal. Don't set
NO_MANCOMPRESS here.

10 years agoNO_MAN= has been deprecated in favor of MAN= for some time, go ahead
imp [Sun, 13 Apr 2014 05:21:56 +0000 (05:21 +0000)]
NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
and finish the job. ncurses is now the only Makefile in the tree that
uses it since it wasn't a simple mechanical change, and will be
addressed in a future commit.

10 years agoDon't apply ctf conversions in POSIX mode. These can't happen there
imp [Sun, 13 Apr 2014 05:21:48 +0000 (05:21 +0000)]
Don't apply ctf conversions in POSIX mode. These can't happen there
because they pollute the POSIX environment, which doens't allow
for these extentions. ctf conversions are really only relevant when
used in coordination with the rest of the bsd*.mk system anyway.
Leave them in place for the normal, non-posix enviornment since
they are quite useful there.

10 years agoCheck the right file for pwcache_groupdb.
imp [Sun, 13 Apr 2014 05:21:43 +0000 (05:21 +0000)]
Check the right file for pwcache_groupdb.

10 years agoWe no longer support upgrading from FreeBSD 4, so we don't need the
imp [Sun, 13 Apr 2014 05:21:35 +0000 (05:21 +0000)]
We no longer support upgrading from FreeBSD 4, so we don't need the
NOMAN and NOSHARED defines here. They have been obsolete for almost a
decade anyway.

10 years agoUp the minimum system to build FreeBSD current to 8.0-RELEASE. The
imp [Sun, 13 Apr 2014 05:21:30 +0000 (05:21 +0000)]
Up the minimum system to build FreeBSD current to 8.0-RELEASE. The
issues with vendors that needed 7.x support have been resolved. Many
vendors are still using 8.x build platforms, however, so bumping this
up to 9.0 will have to wait until that is resolved. Actual support for
building from 8.x still relies on those vendors fixing bugs that are
present as most developers have moved onto 9.x or newer platforms.

Reviewed by: marcel@

10 years agoDetermine whether to build clang and its bootstrap tools the same
imp [Sun, 13 Apr 2014 05:21:22 +0000 (05:21 +0000)]
Determine whether to build clang and its bootstrap tools the same
way. This allows a clang bootstrap to happen, even when WITHOUT_CLANG
is defined. This is a minimal version of a more extensive change which
can be MFC'd more easily. However, we have to also test to see if
we're building clang as not cc, since the bootstrap for that needs
these cross tools and it is easier to build them in just one place.

MFC after: 1 week

10 years agoClean trailing whitespace.
gjb [Sun, 13 Apr 2014 02:03:14 +0000 (02:03 +0000)]
Clean trailing whitespace.
Add missing .El to fix formatting.

Found with: mandoc(1)
Sponsored by: The FreeBSD Foundation

10 years agoBump Dd, missed as part of r264098 and related commits.
gjb [Sun, 13 Apr 2014 01:47:15 +0000 (01:47 +0000)]
Bump Dd, missed as part of r264098 and related commits.

Sponsored by: The FreeBSD Foundation

10 years agoFix a panic in zfs_rename().
davide [Sun, 13 Apr 2014 01:15:37 +0000 (01:15 +0000)]
Fix a panic in zfs_rename().
this is due to a wrong dereference of a vnode when it's not locked and
can be (potentially) recycled. 'sdvp' cannot be locked on zfs_rename()
entry point because the VFS can't be sure that this scenario is
LOR-free (it might violate the parent->child lock acquisition rule).
Dereference 'tdvp' instead, which is already locked on entry, and access
'sdvp' fields only when it's safe, i.e. under ZFS_ENTER scope.

While at it, remove the usage of VOP_REALVP, as long as this is a NOP
on FreeBSD.

Discussed with: avg
Reviewed by: pjd

10 years agoAdd a simple EFI stub loader. This is a quick and dirty of boot1.chrp from
nwhitehorn [Sun, 13 Apr 2014 01:14:25 +0000 (01:14 +0000)]
Add a simple EFI stub loader. This is a quick and dirty of boot1.chrp from
the PowerPC port with all the Open Firmware bits removed and replaced by
their EFI counterparts. On the whole, I think I prefer Open Firmware.

This code is supposed to be an immutable shim that sits on the EFI system
partition, loads /boot/loader.efi from UFS and tells the real loader what
disk/partition to look at. It finds the UFS root partition by the somewhat
braindead approach of picking the first UFS partition it can find. Better
approaches are called for, but this works for now. This shim loader will
also be useful for secure boot in the future, which will require some
rearchitecture.

10 years agoFix the style of ata_interrupt_locked().
rpaulo [Sat, 12 Apr 2014 23:40:54 +0000 (23:40 +0000)]
Fix the style of ata_interrupt_locked().

10 years agoHide internal details of sbintime_t implementation wrapping INT64_MAX into
davide [Sat, 12 Apr 2014 23:29:29 +0000 (23:29 +0000)]
Hide internal details of sbintime_t implementation wrapping INT64_MAX into
SBT_MAX, to make it more robust in case internal type representation will
change in the future. All the consumers were migrated to SBT_MAX and
every new consumer (if any) should from now use this interface.

Requested by: bapt, jmg, Ryan Lortie (implictly)
Reviewed by: mav, bde

10 years agofind: Correctly propagate -exec/-execdir ... {} + exit status.
jilles [Sat, 12 Apr 2014 22:36:26 +0000 (22:36 +0000)]
find: Correctly propagate -exec/-execdir ... {} + exit status.

As per POSIX, the -exec ... {} + primary always returns true, but a non-zero
exit status causes find to return a non-zero exit status itself. GNU does
the same, and also for -execdir ... {} +.

It does not make much sense to return false from the primary only when the
child process happens to be run.

The behaviour for -exec/-execdir ... ; remains unchanged: the primary
returns true or false depending on the exit status, and find's exit status
is unaffected.

10 years agoImprove markup and remove contractions.
brueffer [Sat, 12 Apr 2014 22:05:03 +0000 (22:05 +0000)]
Improve markup and remove contractions.

MFC after: 1 week

10 years agoUse proper MFSNAMELEN for fs type.
bdrewery [Sat, 12 Apr 2014 21:39:17 +0000 (21:39 +0000)]
Use proper MFSNAMELEN for fs type.

MFC after: 2 weeks
Reviewed by: rodrigc
Also spotted by:ambrisko

10 years agomdoc and language improvements.
brueffer [Sat, 12 Apr 2014 21:04:53 +0000 (21:04 +0000)]
mdoc and language improvements.

MFC after: 1 week

10 years agoAlign and round the partitionable disk space to 4K by default.
marcel [Sat, 12 Apr 2014 20:28:39 +0000 (20:28 +0000)]
Align and round the partitionable disk space to 4K by default.
Since this would also apply when recovering, make sure not to
align or round when that would have a partition fall outside
the partitionable area.

10 years agoRemove the names of the build host and user and the build date. This
des [Sat, 12 Apr 2014 18:01:25 +0000 (18:01 +0000)]
Remove the names of the build host and user and the build date.  This
still leaves the host OS and version, but these are harder to remove.

MFC after: 3 weeks

10 years agoIntroduce RANLIBFLAGS to mirror ARFLAGS and add -D to both. This sets
des [Sat, 12 Apr 2014 12:44:09 +0000 (12:44 +0000)]
Introduce RANLIBFLAGS to mirror ARFLAGS and add -D to both.  This sets
all timestamps in static libraries to 0 so that consecutive builds
from the same source, even on different machines, produce identical
libraries.

MFC after: 3 weeks

10 years agoProperly release the in6_multi lock.
ae [Sat, 12 Apr 2014 02:05:31 +0000 (02:05 +0000)]
Properly release the in6_multi lock.

MFC after: 1 week
Sponsored by: Yandex LLC

10 years agoUpdate the SDT(9) examples to reflect the removal of the sname parameter
markj [Fri, 11 Apr 2014 22:45:12 +0000 (22:45 +0000)]
Update the SDT(9) examples to reflect the removal of the sname parameter
in r258622.

MFC after: 3 days

10 years agoRemove stray .Nm macro.
brueffer [Fri, 11 Apr 2014 22:34:00 +0000 (22:34 +0000)]
Remove stray .Nm macro.

MFC after: 3 days

10 years agoMFV r258194-264360: nc(1) from OpenBSD 5.5.
delphij [Fri, 11 Apr 2014 22:12:31 +0000 (22:12 +0000)]
MFV r258194-264360: nc(1) from OpenBSD 5.5.

MFC after: 2 weeks

10 years agoSome whitespace and style fixes.
jhb [Fri, 11 Apr 2014 21:00:59 +0000 (21:00 +0000)]
Some whitespace and style fixes.

Submitted by: bde

10 years agoRemove unused val argument value from SYSCTL_INT() calls.
mav [Fri, 11 Apr 2014 20:44:09 +0000 (20:44 +0000)]
Remove unused val argument value from SYSCTL_INT() calls.

10 years agoFix insta-panic on assert of unlocked periph mtx in ciss(4) when
sbruno [Fri, 11 Apr 2014 20:19:01 +0000 (20:19 +0000)]
Fix insta-panic on assert of unlocked periph mtx in ciss(4) when
logical volume state changes.

Currently, I view this as a critical fix for users and will MFC this rapidly as
my testing has shown data loss when the disk is failed by removing it when
under some amount of write activity and this code panics the box.

Reviewed by: mav@ scottl@
MFC after: 3 days
Sponsored by: Yahoo! Inc.

10 years agoThere is no need to save and restore the host's return address in the
neel [Fri, 11 Apr 2014 20:15:53 +0000 (20:15 +0000)]
There is no need to save and restore the host's return address in the
'struct vmxctx'. It is preserved on the host stack across a guest entry
and exit and just restoring the host's '%rsp' is sufficient.

Pointed out by: grehan@

10 years agoThe tw_pcbrele() function does not need the global timewait lock.
jhb [Fri, 11 Apr 2014 19:17:45 +0000 (19:17 +0000)]
The tw_pcbrele() function does not need the global timewait lock.

Submitted by: Julien Charbon
Suggested by: glebius

10 years agoUpdate the llvm/clang patch for r264345.
dim [Fri, 11 Apr 2014 18:40:29 +0000 (18:40 +0000)]
Update the llvm/clang patch for r264345.

10 years agomdoc and spelling cleanup.
brueffer [Fri, 11 Apr 2014 18:37:24 +0000 (18:37 +0000)]
mdoc and spelling cleanup.

MFC after: 3 days

10 years agoImprove use of socket buffer upcalls.
mav [Fri, 11 Apr 2014 18:26:08 +0000 (18:26 +0000)]
Improve use of socket buffer upcalls.

Use soreadable()/sowriteable() in socket upcalls to avoid extra wakeups
until we have enough data to read or space to write.

Increase partial receive len from 1K to 128K to not wake up on every
received packet.

This significantly reduces locks congestion and CPU usage and improves
throughput for large I/Os on NICs without TSO and LRO.

Reviewed by: trasz
Sponsored by: iXsystems, Inc.

10 years agoAccount for the "plus 1" encoding of the CPUID Function 4 reported
tychon [Fri, 11 Apr 2014 18:19:21 +0000 (18:19 +0000)]
Account for the "plus 1" encoding of the CPUID Function 4 reported
core per package and cache sharing values.

Approved by: grehan (co-mentor)

10 years agoBefore calling mmap() on a shared library's text and data sections, rtld
alc [Fri, 11 Apr 2014 16:55:25 +0000 (16:55 +0000)]
Before calling mmap() on a shared library's text and data sections, rtld
first calls mmap() with the arguments PROT_NONE and MAP_ANON to reserve a
single, contiguous range of virtual addresses for the entire shared library.
Later, rtld calls mmap() with the the shared library's file descriptor
and the argument MAP_FIXED to place the text and data sections within the
reserved range.  The rationale for mapping shared libraries in this way is
explained in the commit message for Revision 190885.  However, this approach
does have an unintended, negative consequence.  Since the first call to
mmap() specifies MAP_ANON and not the shared library's file descriptor, the
kernel has no idea what alignment the vm object backing the file prefers.
As a result, the reserved range's alignment is unlikely to be the same as
the vm object's, and so mapping with superpages becomes impossible.  To
address this problem, this revision adds the argument MAP_ALIGNED_SUPER to
the first call to mmap() if the text section is larger than the smallest
superpage size.

To determine if the text section is larger than the smallest superpage
size, rtld must always fetch the page size information.  As a result, the
private code for fetching the base page size in rtld's builtin malloc is
redundant.  Eliminate it.  Requested by: kib

Tested by: zbb (on arm)
Reviewed by: kib (an earlier version)
Discussed with: jhb

10 years agoAmend r263891, by making clang default to DWARF2 debug info format for
dim [Fri, 11 Apr 2014 16:51:35 +0000 (16:51 +0000)]
Amend r263891, by making clang default to DWARF2 debug info format for
all FreeBSD versions, not just 10.x and earlier.  Apparently too many
people seem to have trouble with post-1993 formats.

Also remove the related notes about messing with kernel configuration
files from UPDATING, which are now superfluous.

Requested by: many
MFC after: 3 days

10 years agoTune buffer sizes for SuperSpeed USB when using LibUSB v0.1 and v1.0
hselasky [Fri, 11 Apr 2014 14:11:55 +0000 (14:11 +0000)]
Tune buffer sizes for SuperSpeed USB when using LibUSB v0.1 and v1.0
APIs to increase the maximum bandwidth limit.

MFC after: 1 week

10 years agoAdd SRC_UPDATE_SKIP, DOC_UPDATE_SKIP, and PORTS_UPDATE_SKIP
gjb [Fri, 11 Apr 2014 13:48:45 +0000 (13:48 +0000)]
Add SRC_UPDATE_SKIP, DOC_UPDATE_SKIP, and PORTS_UPDATE_SKIP
variables.  These are intended to allow bypassing the
'svn co /usr/{src,doc,ports}' step in the chroot when the
tree exists from external means.

The use case here is that /usr/src, /usr/doc, and /usr/ports
in the chroot exist as result of zfs dataset clones, so it
is possible (and happens quite often) that the included
distributions may not be consistent.  (This is not the case
for -RELEASE builds, but does happen for snapshot builds.)

Tested on: stable/9@r264319
MFC After: 3 days
Sponsored by: The FreeBSD Foundation

10 years agoDon't leak the TCP pcbinfo lock if a time wait connection is closed
jhb [Fri, 11 Apr 2014 13:11:43 +0000 (13:11 +0000)]
Don't leak the TCP pcbinfo lock if a time wait connection is closed
in between grabbing a reference on the connection structure and obtaining
the pcbinfo lock.

Reviewed by: Julien Charbon

10 years agoCreate zvol devices on zfs clone.
mav [Fri, 11 Apr 2014 11:56:16 +0000 (11:56 +0000)]
Create zvol devices on zfs clone.

While big and shiny patch is not ready, it is better to have something.

PR: kern/178999
MFC after: 1 week

10 years agoCorrect IMOD default value according to comment.
hselasky [Fri, 11 Apr 2014 08:25:54 +0000 (08:25 +0000)]
Correct IMOD default value according to comment.

Reported by: Daniel O'Connor <doconnor@gsoft.com.au>
MFC after: 1 week

10 years agoSmall performance optimization. Clobber only cr0, rather than the entire CR.
jhibbits [Fri, 11 Apr 2014 06:17:44 +0000 (06:17 +0000)]
Small performance optimization.  Clobber only cr0, rather than the entire CR.

Discussed with: rdivacky,nwhitehorn
MFC after: 3 weeks

10 years agoRefine r264257; given that I later on decided to nuke the wildcard for
marius [Thu, 10 Apr 2014 21:03:46 +0000 (21:03 +0000)]
Refine r264257; given that I later on decided to nuke the wildcard for
the Sunix 0x1999 line of chips there actually is no need to explicitly
keep puc(4) from attaching to the single port version anymore.

10 years agoRework r264179.
grehan [Thu, 10 Apr 2014 19:15:58 +0000 (19:15 +0000)]
Rework r264179.

- remove redundant code
- remove erroneous setting of the error return
  in vmmdev_ioctl()
- use style(9) initialization
- in vmx_inject_pir(), document the race condition
  that the final conditional statement was detecting,

Tested with both gcc and clang builds.

Reviewed by: neel

10 years agoIn if_freemulti(), relax the paranoid KASSERT() on ifma->ifma_protospec.
bms [Thu, 10 Apr 2014 18:43:02 +0000 (18:43 +0000)]
In if_freemulti(), relax the paranoid KASSERT() on ifma->ifma_protospec.

This KASSERT() existed as a sanity check that upper layers in the network
stack (e.g. inet, inet6) had released their reference to the underlying
driver's multicast memberships (ifmultiaddr{}). However it assumes the
lifecycle of the driver membership corresponds to the lifecycle of the
network layer membership.

In the submitter's case, ieee80211_ioctl_updatemulti() attempts to
reprogram the (parent, physical) ifnet{} memberships in response
to a change in membership on the (child, virtual) VAP ifnet, using
a batched update mechanism. These updates happen independently from
the network layer, causing a "false negative" assertion failure.

There are possibly other use cases where this KASSERT() may be triggered
by other networking stack activity (e.g. where a nesting relationship
exists between multiple ifnet{} instances). This suggests that further
review of FreeBSD's approach to nested ifnet relationships is needed.

MFC after: 6 weeks
Submitted by: adrian@

10 years ago- Adding myself to the committers-ports.dot
xmj [Thu, 10 Apr 2014 18:34:26 +0000 (18:34 +0000)]
- Adding myself to the committers-ports.dot
- Adding myself to the freebsd calendar

Approved by: swills (mentor)

10 years agoCurrently, the TCP slow timer can starve TCP input processing while it
jhb [Thu, 10 Apr 2014 18:15:35 +0000 (18:15 +0000)]
Currently, the TCP slow timer can starve TCP input processing while it
walks the list of connections in TIME_WAIT closing expired connections
due to contention on the global TCP pcbinfo lock.

To remediate, introduce a new global lock to protect the list of
connections in TIME_WAIT.  Only acquire the TCP pcbinfo lock when
closing an expired connection.  This limits the window of time when
TCP input processing is stopped to the amount of time needed to close
a single connection.

Submitted by: Julien Charbon <jcharbon@verisign.com>
Reviewed by: rwatson, rrs, adrian
MFC after: 2 months

10 years agoFix spelling error in g_trace() call.
bdrewery [Thu, 10 Apr 2014 17:00:44 +0000 (17:00 +0000)]
Fix spelling error in g_trace() call.

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

10 years agoFix EFI loader object tree creation on 9.x build hosts
emaste [Thu, 10 Apr 2014 16:53:21 +0000 (16:53 +0000)]
Fix EFI loader object tree creation on 9.x build hosts

Previously ${COMPILER_TYPE} was checked in sys/boot/amd64, and the efi
subdirectory was skipped altogether for gcc (since GCC does not support
a required attribute).  However, during the early buildworld stages
${COMPILER_TYPE} is the existing system compiler (i.e., gcc on 9.x build
hosts), not the compiler that will eventually be used.  This caused
"make obj" to skip the efi subdirectory.  In later build stages
${COMPILER_TYPE} is "clang", and then the efi loader would attempt to
build in the source directory.

Sponsored by: The FreeBSD Foundation

10 years agoFix wrong sizes used to access PD_Type and PD_State DDF metadata fields.
mav [Thu, 10 Apr 2014 16:00:33 +0000 (16:00 +0000)]
Fix wrong sizes used to access PD_Type and PD_State DDF metadata fields.

This caused incorrect behavior of arrays with big-endian DDF metadata.
Little-endian (like used by Adaptec controllers) should not be harmed.
Add workaround should be enough to manage compatibility.

MFC after: 2 weeks

10 years agoAdd the Asus USB-N10 NANO.
kevlo [Thu, 10 Apr 2014 14:37:37 +0000 (14:37 +0000)]
Add the Asus USB-N10 NANO.

Tested by: Kuan-Chung Chiu <buganini@gmail.com>

10 years agoFix stray "." left over from previous commit.
brueffer [Thu, 10 Apr 2014 10:56:11 +0000 (10:56 +0000)]
Fix stray "." left over from previous commit.

MFC after: 1 week

10 years agoFix Xref order in SEE ALSO.
brueffer [Thu, 10 Apr 2014 10:54:06 +0000 (10:54 +0000)]
Fix Xref order in SEE ALSO.

MFC after: 1 week

10 years agoMore mdoc/spelling/grammar cleanup.
brueffer [Thu, 10 Apr 2014 10:18:30 +0000 (10:18 +0000)]
More mdoc/spelling/grammar cleanup.

10 years agoDo not increment bio_data in case of BIO_DELETE.
mav [Thu, 10 Apr 2014 10:12:56 +0000 (10:12 +0000)]
Do not increment bio_data in case of BIO_DELETE.

This fixes KASSERT() panic in g_io_request().

10 years agoFix build breakage caused by r264295
smh [Thu, 10 Apr 2014 05:04:23 +0000 (05:04 +0000)]
Fix build breakage caused by r264295

X-MFC-With: r264295
MFC after: 1 week

10 years agoAdd kqueue support for devctl.
davidxu [Thu, 10 Apr 2014 02:30:51 +0000 (02:30 +0000)]
Add kqueue support for devctl.

Reviewed by: kib,mjg

10 years agoRestore the pX part to the version number printed in debugging mode.
des [Wed, 9 Apr 2014 20:42:00 +0000 (20:42 +0000)]
Restore the pX part to the version number printed in debugging mode.

10 years agoFix three refcounter leaks and lock recursion they covered.
mav [Wed, 9 Apr 2014 19:16:40 +0000 (19:16 +0000)]
Fix three refcounter leaks and lock recursion they covered.

MFC after: 1 week

10 years agoReally, really, really only allow this option for amd64/i386 builds.
sbruno [Wed, 9 Apr 2014 18:44:54 +0000 (18:44 +0000)]
Really, really, really only allow this option for amd64/i386 builds.

Submitted by: imp@ and tinderbox