]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
10 years agoMFC r251629: 3741 zfs needs better comments
delphij [Fri, 5 Jul 2013 03:01:35 +0000 (03:01 +0000)]
MFC r251629: 3741 zfs needs better comments

Embellish the comments in various components of ZFS.  Move some comments
around closer to what they describe.  Specifically, answer the questions:

- What are some of the edge cases of the dbuf state machine?
- What does a txg quiesce do?
- When does the DMU notify threads waiting on txg's that they may
  proceed?
- How do the calculations for RAIDZ map allocations work?
- What process do the RAIDZ I/O start and done callbacks follow?

While here, adjust the function prototype of dmu_zfetch.c:dmu_zfetch_colinear()
to match its comment which describes its return as a boolean.

Submitted by: asomers, gibbs, will
Reviewed by: Matthew Ahrens <mahrens@delphix.com>,
Eric Schrock <eric.schrock@delphix.com>,
Christopher Siden <christopher.siden@delphix.com>
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/9@252749 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMerge r252230:
rpaulo [Fri, 5 Jul 2013 02:06:59 +0000 (02:06 +0000)]
Merge r252230:

  Implement ifconfig_wlanX="HOSTAP".

  Not only this is a bit cleaner, it allows multiple instances of hostapd to be
  running on the system host, useful for simultaneous dual-band WiFi.
  This is similar to ifconfig_wlanX="WPA" but it uses /etc/hostapd-wlanX.conf.
  Compatibility with hostapd_enable=YES/NO was kept.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252748 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r252067
rmacklem [Fri, 5 Jul 2013 01:22:37 +0000 (01:22 +0000)]
MFC: r252067
Since some NFSv4 servers enforce the requirement for a reserved port#,
enable use of the (no)resvport mount option for NFSv4. I had thought
that the RFC required that non-reserved port #s be allowed, but I couldn't
find it in the RFC.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252739 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252387:
dim [Thu, 4 Jul 2013 22:09:14 +0000 (22:09 +0000)]
MFC r252387:

Make libsupc++'s __cxa_call_terminate() prototype consistent with the
definition.

Submitted by: dt71@gmx.com

git-svn-id: svn://svn.freebsd.org/base/stable/9@252731 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r249940:
smh [Thu, 4 Jul 2013 21:57:09 +0000 (21:57 +0000)]
MFC r249940:
Teach GEOM and CAM about the difference between the max "size" of r/w and delete
requests.

MFC r252657:
Bump disk(9) ABI version to signify the addition of d_delmaxsize.

Make the addition of the d_delmaxsize binary compatible.  This allows storage
drivers compiled for 9.0 and 9.1 to work by preserving the ABI for disks.

Reviewed by: mav

git-svn-id: svn://svn.freebsd.org/base/stable/9@252730 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMerge clang 3.3 release and various fixes: r241214, r246705, r248548,
dim [Thu, 4 Jul 2013 20:17:04 +0000 (20:17 +0000)]
Merge clang 3.3 release and various fixes: r241214, r246705, r248548,
r249423, r249817, r250217, r250593, r250616, r250997, r251216, r251662,
r251761, r251785, r251790, r252039.

MFC r241214 (by jkim):
  Do not install incomplete unwind.h from clang.  This header file was meant
  to be a wrapper for the canonical system header file.  Unfortunately, we do
  not have one (yet) and some times it is causing weird failures when clang
  is used for building ports.  More complete and correct file will come from
  libcxxrt in the future.

  Discussed with: dim, kib, theraven

MFC r246705 (by andrew):
  Allow us to build clang for ARM EABI. Clang and llvm use the
  arm-gnueabi-freebsd10.0 triple for EABI. Use this when we are on arm or
  armv6 and are building for EABI.

  Reviewed by: dim

MFC r248548 (by andrew):
  Pull in r177252 from upstream clang trunk:

   Make sure to use same EABI version for external assembler as for
   integrated as.

  This allows us to use gcc on a world built with clang on ARM.

MFC r249423:
  Upgrade our copy of llvm/clang to trunk r178860, in preparation of the
  upcoming 3.3 release (branching and freezing expected in a few weeks).

  Preliminary release notes can be found at the usual location:
  <http://llvm.org/docs/ReleaseNotes.html>

  An MFC is planned once the actual 3.3 release is finished.

MFC r249817:
  Pull in r180121 from upstream llvm trunk:

    LoopVectorizer: Fix 15830. When scalarizing and unrolling stores make
    sure that the order in which the elements are scalarized is the same
    as the original order.
    This fixes a miscompilation in FreeBSD's regex library.

  This should fix lib/libc/regex/regcomp.c at -O3 with clang 3.3 r178860
  on CPUs with SSE.  Before this change, the vectorizer could incorrectly
  rearrange the second loop in computejumps(), leading to possibly invalid
  entries in the re_gets::charjump table.

  The net result was that for example "sed s/@CC@/foo/" failed to work
  correctly, leading to trouble with many configure scripts.

MFC r250217:
  Allow building clang on older FreeBSD releases, where log2() does not
  exist yet.  With this change, I have verified that building head on
  8.1-RELEASE works.

  Noticed by: Ryan Stone <rysto32@gmail.com>

MFC r250593:
  Pull in r181286 from upstream llvm trunk:

    LoopVectorize: getConsecutiveVector must respect signed arithmetic

    We were passing an i32 to ConstantInt::get where an i64 was needed and we must
    also pass the sign if we pass negatives numbers. The start index passed to
    getConsecutiveVector must also be signed.

    Should fix PR15882.

  This should fix Firefox crashes some people have been reporting, when it
  is compiled with -O3.

MFC r250616:
  Use an ugly hack to get around bootstrapping problems when building
  clang on head between r239347 and r245428.

  The former revision introduced CLOCK_PROCESS_CPUTIME_ID as a clock id
  for the clock_gettime() function and friends, but it was only added in
  <sys/time.h>, not in <time.h>.  Any program including <time.h> would
  therefore not be able to use CLOCK_PROCESS_CPUTIME_ID, even though the
  value of _POSIX_CPUTIME indicates its existence.  The latter revision
  synchronized the defines again.

  Work around this problem by defining the id on the command line for the
  particular .cpp file that needs it.  If the id ever changes value, this
  hack will need to be updated.

MFC r250997:
  Pull in r182656 from upstream llvm trunk:

    LoopVectorize: LoopSimplify can't canonicalize loops with an
    indirectbr in it, don't assert on those cases.

    Fixes PR16139.

  This should fix clang assertion failures when optimizing at -O3, similar
  to:

    Assertion failed: (TheLoop->getLoopPreheader() && "No preheader!!"),
    function canVectorize, file
    contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp, line 2171.

  Reported by: O. Hartmann <ohartman@zedat.fu-berlin.de>
  PR: ports/178332, ports/178977

MFC r251216 (by ed):
  Pull in r183033 and r183036 from LLVM trunk:

    Add support for optimized (non-generic) atomic libcalls.

    For integer types of sizes 1, 2, 4 and 8, libcompiler-rt (and libgcc)
    provide atomic functions that pass parameters by value and return
    results directly.

    libgcc and libcompiler-rt only provide optimized libcalls for
    __atomic_fetch_*, as generic libcalls on non-integer types would make
    little sense. This means that we can finally make __atomic_fetch_*
    work
    on architectures for which we don't provide these operations as
    builtins
    (e.g. ARM).

    This should fix the dreaded "cannot compile this atomic library call
    yet" error that would pop up once every while.

  This should make it possible for me to get C11 atomics working on all of
  our platforms.

MFC r251662:
  Upgrade our copy of llvm/clang to 3.3 release.

  Release notes are still in the works, these will follow soon.

MFC r251761:
  Pull in r181620 from llvm trunk:

    [ms-inline asm] Fix a crasher when we fail on a direct match.

    The issue was that the MatchingInlineAsm and VariantID args to the
    MatchInstructionImpl function weren't being set properly.  Specifically, when
    parsing intel syntax, the parser thought it was parsing inline assembly in the
    at&t dialect; that will never be the case.

    The crash was caused when the emitter tried to emit the instruction, but the
    operands weren't set.  When parsing inline assembly we only set the opcode, not
    the operands, which is used to lookup the instruction descriptor.
    rdar://13854391 and PR15945

    Also, this commit reverts r176036.  Now that we're correctly parsing the intel
    syntax the pushad/popad don't match properly.  I've reimplemented that fix using
    a MnemonicAlias.

  Pull in r183907 from llvm trunk:

    X86: Make the cmov aliases work with intel syntax too.

  These commits make a number of Intel-style inline assembly mnemonics
  aliases (occurring in several ports) work properly, which could cause
  assertions otherwise.

  Reported by: kwm, bapt

MFC r251785 (by ed)
  Pull in r184040 from upstream clang trunk:

    Emit native implementations of atomic operations on FreeBSD/armv6.

    Just like on Linux, FreeBSD/armv6 assumes the system supports
    ldrex/strex unconditionally. It is also used by the kernel. We can
    therefore enable support for it, like we do on Linux.

    While there, change one of the unit tests to explicitly test against
    armv5 instead of armv7, as it actually tests whether libcalls are
    emitted.

MFC r251790 (by andrew):
  Pull in r183926 from LLVM trunk:

    Allow clang to build __clear_cache on ARM.

    __clear_cache is special. It needs no signature, but is a real function in
    compiler_rt or libgcc.

    Patch by Andrew Turner.

  This allows us to build the __clear_cache function in compiler-rt.

MFC r252039:
  Pull in r183984 from llvm trunk:

    Make PrologEpilogInserter save/restore all callee saved registers in
    functions which call __builtin_unwind_init()

    __builtin_unwind_init() is an undocumented gcc intrinsic which has
    this effect, and is used in libgcc_eh.

    Goes part of the way toward fixing PR8541.

  This obsoletes the ugly hack to libgcc's unwind code from r245272, and
  should also work for other arches, so revert the hack too.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252723 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r240780, r252468:
mav [Thu, 4 Jul 2013 15:21:27 +0000 (15:21 +0000)]
MFC  r240780, r252468:
Make nfs_readdir() more careful about using response data, cached in global
buffer. For now it fixes bug when following `ls` command will return data
from previous one aborted by pager. Also it should allow to read several
directories same time, for example, for recursive tracerse.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252701 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r240774:
mav [Thu, 4 Jul 2013 15:19:45 +0000 (15:19 +0000)]
MFC r240774:
Don't use global nfs_root_node variable as per-file storage. There are
fields that should be file-specific.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252700 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoProtect the #define MALLOC_PRODUCTION directive in case it was also
des [Thu, 4 Jul 2013 14:26:42 +0000 (14:26 +0000)]
Protect the #define MALLOC_PRODUCTION directive in case it was also
defined on the command line (due to MALLOC_PRODUCTION=yes in src.conf).

git-svn-id: svn://svn.freebsd.org/base/stable/9@252699 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252028:
ae [Thu, 4 Jul 2013 08:59:34 +0000 (08:59 +0000)]
MFC r252028:
  Use corresponding macros to update statistics for AH, ESP, IPIP, IPCOMP,
  PFKEY.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252693 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252026:
ae [Thu, 4 Jul 2013 08:57:13 +0000 (08:57 +0000)]
MFC r252026:
  Use IPSECSTAT_INC() and IPSEC6STAT_INC() macros for ipsec statistics
  accounting.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252692 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252364:
pfg [Thu, 4 Jul 2013 01:40:32 +0000 (01:40 +0000)]
MFC r252364:

Bring some updates from ufs/ufs_lookup to ext2fs.

Don't set IN_CHANGE and IN_UPDATE on inodes for potentially suspended
file systems.

Only set i_offset in the parent directory's i-node during a lookup for
non-LOOKUP operations.
Relax a VOP assertion for a DELETE lookup.

Move the code from ufs_lookup.c used to do dotdot lookup, into
the helper function. It is supposed to be useful for any filesystem
that has to unlock dvp to walk to the ".." entry in lookup routine.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252677 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r252483
rmacklem [Thu, 4 Jul 2013 01:22:52 +0000 (01:22 +0000)]
MFC: r252483
Document that NFSv4 mounts won't work if hostid_enable="NO" is set
in /etc/rc.conf because the host uuid is used to uniquely identify
the client to the server.
This is a content change.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252676 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r252139
rmacklem [Thu, 4 Jul 2013 01:18:38 +0000 (01:18 +0000)]
MFC: r252139
Document the "-o" option added by r252138.
This is a content change.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252675 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r252138
rmacklem [Thu, 4 Jul 2013 01:15:44 +0000 (01:15 +0000)]
MFC: r252138
Add a new "-o" option to the gssd which forces gss_init_sec_context()
to use DES and the associated old style GSS initialization token.
This appears to be required for some non-FreeBSD servers to
get a kerberized NFS mount to work. Also, ignore some signals when daemonized,
which might fix the gssd from "disappearing" without leaving a core dump.
Given the tight timeframe for the FreeBSD9.2 release, I have
committed this while waiting for code review. I will commit
changes recommended by the review in a separate commit.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252674 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252278:
jimharris [Thu, 4 Jul 2013 00:16:43 +0000 (00:16 +0000)]
MFC r252278:

  Add firmware replacement and activation support to nvmecontrol(8) through
  a new firmware command.

  NVMe controllers may support up to 7 firmware slots for storing of
  different firmware revisions.  This new firmware command supports
  firmware replacement (i.e. firmware download) with or without immediate
  activation, or activation of a previously stored firmware image.  It
  also supports selection of the firmware slot during replacement
  operations, using IDENTIFY information from the controller to
  check that the specified slot is valid.

  Newly activated firmware does not take effect until the new controller
  reset, either via a reboot or separate 'nvmecontrol reset' command to the
  same controller.

Submitted by: Joe Golio <joseph.golio@emc.com>
Obtained from: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/9@252671 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252277:
jimharris [Thu, 4 Jul 2013 00:06:11 +0000 (00:06 +0000)]
MFC r252277:

  Add log page support to nvmecontrol(8) through a new logpage command.

  This includes pretty printers for all of the standard NVMe log pages
  (Error, SMART/Health, Firmware), as well as hex output for non-standard
  or vendor-specific log pages.

Also add missing static keyword that glebius@ fixed as part of r252302.

Submitted by: Joe Golio <joseph.golio@emc.com>
Obtained from: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/9@252670 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252275:
jimharris [Thu, 4 Jul 2013 00:03:30 +0000 (00:03 +0000)]
MFC r252275:

  Add generalized helper functions for printing hex data as part of
  nvmecontrol commands.

Submitted by: Joe Golio <joseph.golio@emc.com>
Obtained from: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/9@252669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252274:
jimharris [Thu, 4 Jul 2013 00:00:59 +0000 (00:00 +0000)]
MFC r252274:

  Ensure that a device node is specified when invoking the identify or reset
  commands.

  Also improve the checking of device node names, so that better error
  messages are displayed when incorrect names are specified.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252667 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252273:
jimharris [Wed, 3 Jul 2013 23:59:08 +0000 (23:59 +0000)]
MFC r252273:

  Remove remaining uio-related code.

  The nvme_physio() function was removed quite a while ago, which was the
  only user of this uio-related code.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252666 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252272:
jimharris [Wed, 3 Jul 2013 23:58:09 +0000 (23:58 +0000)]
MFC r252272:

  Fail any passthrough command whose transfer size exceeds the controller's
  max transfer size.  This guards against rogue commands coming in from
  userspace.

  Also add KASSERTS for the virtual address and unmapped bio cases, if the
  transfer size exceeds the controller's max transfer size.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252665 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252271:
jimharris [Wed, 3 Jul 2013 23:56:41 +0000 (23:56 +0000)]
MFC r252271:

  Use MAXPHYS to specify the maximum I/O size for nvme(4).

  Also allow admin commands to transfer up to this maximum I/O size, rather
  than the artificial limit previously imposed.  The larger I/O size is very
  beneficial for upcoming firmware download support.  This has the added
  benefit of simplifying the code since both admin and I/O commands now use
  the same maximum I/O size.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252664 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252270:
jimharris [Wed, 3 Jul 2013 23:54:36 +0000 (23:54 +0000)]
MFC r252270:

  Create #defines for NVME_CTRLR_PREFIX and NVME_NS_PREFIX for the "nvme"
  and "ns" strings, rather than hardcoding the string values throughout the
  nvmecontrol code base.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252663 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252269:
jimharris [Wed, 3 Jul 2013 23:53:28 +0000 (23:53 +0000)]
MFC r252269:

  Add an nvme_function structure array, defining the name, C function and
  usage message for each nvmecontrol command.  This helps reduce some code
  clutter both now and for future commits which will add logpage and
  firmware support to nvmecontrol(8).

  Also move helper function prototypes to the end of the header file, after
  the per-command functions.

Also add missing static keyword that glebius@ fixed as part of r252302.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252662 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252268:
jimharris [Wed, 3 Jul 2013 23:51:03 +0000 (23:51 +0000)]
MFC r252268:

  Break out code related to the reset command into a separate source file.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252660 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252267:
jimharris [Wed, 3 Jul 2013 23:48:58 +0000 (23:48 +0000)]
MFC r252267:

  Break out code related to the perftest command into a separate file.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252659 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252266:
jimharris [Wed, 3 Jul 2013 23:47:23 +0000 (23:47 +0000)]
MFC r252266:

  Break out code related to the identify command into a separate source file.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252658 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252265:
jimharris [Wed, 3 Jul 2013 23:45:58 +0000 (23:45 +0000)]
MFC r252265:

  Break out code related to the devlist command into a separate source file.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252656 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252264:
jimharris [Wed, 3 Jul 2013 23:42:12 +0000 (23:42 +0000)]
MFC r252264:

  Add separate *_usage() functions for each nvmecontrol command.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252655 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252263:
jimharris [Wed, 3 Jul 2013 23:40:43 +0000 (23:40 +0000)]
MFC r252263:

  Add an open_dev() helper function to be used in the various places
  where nvmecontrol needs to open a handle to a controller or namespace
  device node.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252654 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252262:
jimharris [Wed, 3 Jul 2013 23:29:40 +0000 (23:29 +0000)]
MFC r252262:

  For ATA_PASSTHROUGH commands, pretend isci(4) supports multiword DMA
  by treating it as UDMA.

  This fixes a problem introduced in r249933/r249939, where CAM sends
  ATA_DSM_TRIM to SATA devices using ATA_PASSTHROUGH_16.  scsi_ata_trim()
  sets protocol as DMA (not UDMA) which is for multi-word DMA, even
  though no such mode is selected for the device.  isci(4) would fail
  these commands which is the correct behavior but not consistent with
  other HBAs, namely LSI's.

  smh@ did some further testing on an LSI controller, which rejected
  ATA_PASSTHROUGH_16 commands with mode=UDMA_OUT, even though only
  a UDMA mode was selected on the device.  So this precludes adding
  any kind of mode detection in CAM to determine which mode to use on
  a per-device basis.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/9@252651 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r242726 (ambrisko):
markj [Wed, 3 Jul 2013 23:15:30 +0000 (23:15 +0000)]
MFC r242726 (ambrisko):
Add support for SCSI pass through devices to be attached and detached.

MFC r251172 (sbruno):
xpt_create_path() requires mfi_io_lock to be held, so do it.

mfi(4) doesn't panic on host startup now.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252643 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoReally MFC r252363 (sysconf(3) returns a long, not an int).
obrien [Wed, 3 Jul 2013 22:57:20 +0000 (22:57 +0000)]
Really MFC r252363 (sysconf(3) returns a long, not an int).

git-svn-id: svn://svn.freebsd.org/base/stable/9@252638 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r252348, r252363: sysconf(3) returns a long, not an int.
obrien [Wed, 3 Jul 2013 22:25:00 +0000 (22:25 +0000)]
MFC: r252348, r252363: sysconf(3) returns a long, not an int.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252635 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251181: fork(2): #include <sys/types.h> is not needed.
jilles [Wed, 3 Jul 2013 22:14:12 +0000 (22:14 +0000)]
MFC r251181: fork(2): #include <sys/types.h> is not needed.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252627 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r248774: accept(2): Mention inheritance of O_ASYNC and signal
jilles [Wed, 3 Jul 2013 22:04:35 +0000 (22:04 +0000)]
MFC r248774: accept(2): Mention inheritance of O_ASYNC and signal
destination.

While almost nobody uses O_ASYNC, and rightly so, the inheritance of the
related properties across accept() is a portability issue like the
inheritance of O_NONBLOCK.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252622 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r248349: sh: Recognize "--" and explicitly reject options in wait
jilles [Wed, 3 Jul 2013 21:56:25 +0000 (21:56 +0000)]
MFC r248349: sh: Recognize "--" and explicitly reject options in wait
builtin.

If syntactically invalid job identifiers are to be taken as jobs that exited
with status 127, this should not apply to options, so that we can add
options later if need be.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252617 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r245383,245392,247190,249220,251180,251797: New sh testcases.
jilles [Wed, 3 Jul 2013 21:43:41 +0000 (21:43 +0000)]
MFC r245383,245392,247190,249220,251180,251797: New sh testcases.

These already work on stable/9.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252613 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251763: sh(1): A subshell environment has its own rlimits (ulimit).
jilles [Wed, 3 Jul 2013 21:31:13 +0000 (21:31 +0000)]
MFC r251763: sh(1): A subshell environment has its own rlimits (ulimit).

This has always been the case and is intended (just like cd).

This matches Austin group issue #706.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252611 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r248870 by joel: Minor mdoc fix in previous commit.
jilles [Wed, 3 Jul 2013 21:25:46 +0000 (21:25 +0000)]
MFC r248870 by joel: Minor mdoc fix in previous commit.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252610 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r248692: sh(1): Mention possible ambiguities with $(( and ((.
jilles [Wed, 3 Jul 2013 21:22:47 +0000 (21:22 +0000)]
MFC r248692: sh(1): Mention possible ambiguities with $(( and ((.

In some other shells, things like $((a);(b)) are command substitutions.

Also, there are shells that have an extension ((ARITH)) that evaluates an
arithmetic expression and returns status 1 if the result is zero, 0
otherwise. This extension may lead to ambiguity with two subshells starting
in sequence.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252609 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251209: test(1): List non-standard primaries.
jilles [Wed, 3 Jul 2013 21:14:57 +0000 (21:14 +0000)]
MFC r251209: test(1): List non-standard primaries.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252607 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251078,r251433: sleep: Improve nanosleep() error handling:
jilles [Wed, 3 Jul 2013 21:11:56 +0000 (21:11 +0000)]
MFC r251078,r251433: sleep: Improve nanosleep() error handling:

 * Work around kernel bugs that cause a spurious [EINTR] return if a
   debugger (such as truss(1)) is attached.

 * Write an error message if an error other than [EINTR] occurs.

PR: bin/178664

git-svn-id: svn://svn.freebsd.org/base/stable/9@252606 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r250982: sigreturn(2): Remove ancient compatibility warning about 4.2BSD
jilles [Wed, 3 Jul 2013 21:05:35 +0000 (21:05 +0000)]
MFC r250982: sigreturn(2): Remove ancient compatibility warning about 4.2BSD

The HISTORY subsection still says that sigreturn() was added in 4.3BSD.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252604 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoFix grammar in a comment.
dteske [Wed, 3 Jul 2013 20:54:25 +0000 (20:54 +0000)]
Fix grammar in a comment.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252600 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252414:
mjg [Wed, 3 Jul 2013 20:24:37 +0000 (20:24 +0000)]
MFC r252414:
truss: recognize O_DIRECTORY, O_EXEC, O_TTY_INIT and O_CLOEXEC

git-svn-id: svn://svn.freebsd.org/base/stable/9@252595 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r238051:
obrien [Wed, 3 Jul 2013 19:12:35 +0000 (19:12 +0000)]
MFC: r238051:
     Add "hier" as an alternate spelling of "hierarchy" to match hier(9).

git-svn-id: svn://svn.freebsd.org/base/stable/9@252588 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252009:
ae [Wed, 3 Jul 2013 13:03:09 +0000 (13:03 +0000)]
MFC r252009:
  Use PIM6STAT_INC() and MRT6STAT_INC() macros for IPv6 multicast
  statistics accounting.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252566 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252007:
ae [Wed, 3 Jul 2013 13:00:35 +0000 (13:00 +0000)]
MFC r252007:
  Use RIP6STAT_INC() macro for raw ip6 statistics accounting.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252565 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251995:
ae [Wed, 3 Jul 2013 12:58:17 +0000 (12:58 +0000)]
MFC r251995:
  Use ICMP6STAT_INC() macro for ICMPv6 errors accounting.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252563 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC/backport core kernel and userspace parts of r237263 (TCP_OFFLOAD
np [Wed, 3 Jul 2013 09:25:29 +0000 (09:25 +0000)]
MFC/backport core kernel and userspace parts of r237263 (TCP_OFFLOAD
rework).  MFC r237563, r239511, r243603, r245915, r245916, r245919,
r245921, r245922, r245924, r245925, r245932, r245934 too.

Build tested with make universe.

r237263:
- Updated TOE support in the kernel.
...

r237563:
Fix clang warning when compiling iw_cxgb.

r239511:
Correctly handle the case where an inp has already been dropped by the time
the TOE driver reports that an active open failed.  toe_connect_failed is
supposed to handle this but it should be provided the inpcb instead of the
tcpcb which may no longer be around.

r243603:
Make sure that tcp_timer_activate() correctly sees TCP_OFFLOAD (or not).

r245915:
Heed SO_NO_OFFLOAD.

r245916:
Teach toe_4tuple_check() to deal with IPv6 4-tuples too.

r245919:
Add TCP_OFFLOAD hook in syncache_respond for IPv6 too, just like the one
that exists for IPv4.

r245921:
There is no need to call into the TOE driver twice in pru_rcvd (tod_rcvd
and then tod_output right after that).

r245922:
Avoid NULL dereference in nd6_storelladdr when no mbuf is provided.  It
is called this way from a couple of places in the OFED code.  (toecore
calls it too but that's going to change shortly).

r245924:
Move lle_event to if_llatbl.h

lle_event replaced arp_update_event after the ARP rewrite and ended up
in if_ether.h simply because arp_update_event used to be there too.
IPv6 neighbor discovery is going to grow lle_event support and this is a
good time to move it to if_llatbl.h.

The two in-tree consumers of this event - OFED and toecore - are not
affected.

r245925:
Generate lle_event in the IPv6 neighbor discovery code too.

r245932:
Teach toe_l2_resolve to resolve IPv6 destinations too.

r245934:
Add checks for SO_NO_OFFLOAD in a couple of places that I missed earlier
in r245915.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252555 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252471:
smh [Wed, 3 Jul 2013 08:39:18 +0000 (08:39 +0000)]
MFC r252471:
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.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252554 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252052:
lstewart [Wed, 3 Jul 2013 08:20:40 +0000 (08:20 +0000)]
MFC r252052:

Non-virtualised hhook points are supported as of r251732.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252551 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251789:
lstewart [Wed, 3 Jul 2013 07:57:22 +0000 (07:57 +0000)]
MFC r251789:

Now that the necessary infrastructure is in place to ensure hhook points which
register after a khelp module will get hooked, move khelp module initialisation
to the earlier SI_SUB_KLD stage.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252549 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251787:
lstewart [Wed, 3 Jul 2013 06:20:47 +0000 (06:20 +0000)]
MFC r251787:

Move hhook's per-vnet initialisation to an earlier SYSINIT SI_SUB stage to
ensure all per-vnet related hhook initialisation is completed prior to any
virtualised hhook points attempting registration.

vnet_register_sysinit() requires that a stage later than SI_SUB_VNET be chosen.
There are no per-vnet initialisors in the source tree at this time which run
earlier than SI_SUB_INIT_IF. A quick audit of non-virtualised SYSINITs indicates
there are no subsystems pre SI_SUB_MBUF that would likely be interested in
registering a virtualised hhook point.

Settle on SI_SUB_MBUF as hhook's per-vnet initialisation stage as it's the first
overtly network-related initilisation stage to run after SI_SUB_VNET. If a
subsystem that initialises earlier than SI_SUB_MBUF ends up wanting to register
virtualised hhook points in future, hhook's use of SI_SUB_MBUF will need to be
revisited and would probably warrant creating a dedicated SI_SUB_HHOOK which
runs immediately after SI_SUB_VNET.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252543 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251778:
lstewart [Wed, 3 Jul 2013 05:58:51 +0000 (05:58 +0000)]
MFC r251778:

Cleanup and simplification in khelp_{register|deregister}_helper(). No
functional changes.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252541 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251774:
lstewart [Wed, 3 Jul 2013 05:48:46 +0000 (05:48 +0000)]
MFC r251774:

Add a private KPI between hhook and khelp that allows khelp modules to insert
hook functions into hhook points which register after the modules were loaded -
potentially useful during boot or if hhook points are dynamically registered.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252539 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251770:
lstewart [Wed, 3 Jul 2013 05:28:22 +0000 (05:28 +0000)]
MFC r251770:

Internalise handling of virtualised hook points inside
hhook_{add|remove}_hook_lookup() so that khelp (and other potential API
consumers) do not have to care when they attempt to (un)hook a particular hook
point identified by id and type.

Reviewed by: scottl

git-svn-id: svn://svn.freebsd.org/base/stable/9@252536 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251732,251752:
lstewart [Wed, 3 Jul 2013 04:20:36 +0000 (04:20 +0000)]
MFC r251732,251752:

Add support for non-virtualised hhook points, which are uniquely identified by
type and id, as compared to virtualised hook points which are now uniquely
identified by type, id and a vid (which for vimage is the pointer to the vnet
that the hhook resides in).

All hhook_head structs for both virtualised and non-virtualised hook points
coexist in hhook_head_list, and a separate list is maintained for hhook points
within each vnet to simplify some vimage-related housekeeping.

Reviewed by: scottl

git-svn-id: svn://svn.freebsd.org/base/stable/9@252534 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoWhen a previous call to sbsndptr() leaves sb->sb_sndptroff at the start of an
lstewart [Wed, 3 Jul 2013 03:36:36 +0000 (03:36 +0000)]
When a previous call to sbsndptr() leaves sb->sb_sndptroff at the start of an
mbuf that was fully consumed by the previous call, the mbuf ptr returned by the
current call ends up being the previous mbuf in the sb chain to the one that
contains the data we want.

This does not cause any observable issues because the mbuf copy routines happily
walk the mbuf chain to get to the data at the moff offset, which in this case
means they effectively skip over the mbuf returned by sbsndptr().

We can't adjust sb->sb_sndptr during the previous call for this case because the
next mbuf in the chain may not exist yet. We therefore need to detect the
condition and make the adjustment during the current call.

Fix by detecting the special case of moff being at the start of the next mbuf in
the chain and adjust the required accounting variables accordingly.

Reviewed by: andre

git-svn-id: svn://svn.freebsd.org/base/stable/9@252532 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252380:
mm [Tue, 2 Jul 2013 19:44:02 +0000 (19:44 +0000)]
MFC r252380:
Unbreak "zfs jail" and "zfs unjail" (broken in stable/9 since r249643)

I missed to register zfs_ioc_jail and zfs_ioc_unjail as legacy ioctl's
with the new zfs_ioctl_register_legacy() function.

These operations do not modify pools or datasets so there is no need to
log them to pool history.

Reported by: Alexander Leidinger <netchild@FreeBSD.org> on current@

git-svn-id: svn://svn.freebsd.org/base/stable/9@252524 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r248286 (pjd):
trociny [Tue, 2 Jul 2013 19:29:00 +0000 (19:29 +0000)]
MFC r248286 (pjd):

Removed redundant includes.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252519 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r248294, r248296:
trociny [Tue, 2 Jul 2013 19:27:07 +0000 (19:27 +0000)]
MFC r248294, r248296:

r248294 (pjd):

Delete requests can be larger than MAXPHYS.

r248296 (pjd):

Minor corrections.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252517 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251961:
kib [Tue, 2 Jul 2013 04:45:51 +0000 (04:45 +0000)]
MFC r251961:
Disable wait for the retrace if KMS is activated.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252497 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251960:
kib [Tue, 2 Jul 2013 04:42:32 +0000 (04:42 +0000)]
MFC r251960:
Since the gem pagefault handler relocks the vm object lock, other
thread might fault on the same GTT offset meantime and instantiate the
mapping.  Recheck that the mgt device object still does not have a
page at the current offset after relocking, and return a possibly
installed page.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252496 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC all cxgbe(4) changes missing from stable/9:
np [Tue, 2 Jul 2013 04:27:16 +0000 (04:27 +0000)]
MFC all cxgbe(4) changes missing from stable/9:
r248925, r249368, r249370, r249376, r249382, r249383, r249385, r249391,
r249392, r249393, r249627, r249629, r250090, r250092, r250093, r250117,
r250218, r250221, r250614, r251213, r251317, r251358, r251434, r251518,
r251638, r252312, r252469, r252470, r250697(kib).

r248925:
Support for Chelsio's 40G Terminator 5 (aka T5) ASIC.
...

r249368:
Set and display the IP fragment bit correctly when dealing with
the filter mode.

r249370:
cxgbe(4): Ensure that the MOD_LOAD handler runs before either t4nex or
t5nex attach to their devices.

r249376:
- Explain clearly why a different firmware is being installed (if/when
  it is being installed).  Improve other error messages while here.

- Select special FPGA specific configuration profile when appropriate.

r249382:
There is no need for elaborate queries and error checking when trying to
set FW4MSG_ENCAP.

r249383:
Get rid of a couple of stray \n's.

r249385:
cxgbe/tom: Slight simplification of code that calculates options2.

r249391:
Auto-reduce the holdoff timers that are greater than the maximum value
allowed by the hardware.

r249392:
Cosmetic change (s/wrwc/wcwr/;s/WRWC/WCWR/).

r249393:
Add pciids of the T5 based cards.  The ones that I haven't tested with
cxgbe(4) are disabled for now.  This will change.

r249627:
cxgbe/tom: Update the CLIP table on the chip when there are changes
to the list of IPv6 addresses on the system.  The table is used for
TOE+IPv6 only.

r249629:
cxgbe(4): Refuse to install T5 firmwares on a T4 card (and vice versa).

r250090:
cxgbe(4): Some updates to shared code.

r250092:
- Provide accurate ifmedia information so that 40G ports/transceivers are
  displayed properly in ifconfig, etc.

- Use the same number of tx and rx queues for a 40G port as for a 10G port.

r250093:
Attach to the T580 (2 x 40G) card.

r250117:
Fix DDP breakage introduced in r248925.  Bitwise OR has higher
precedence than ternary conditional.

r250218:
cxgbe/tom: Do not use M_PROTO1 to mark rx zero-copy mbufs as special.
All the M_PROTOn flags are clobbered when an mbuf is appended to the
socket buffer.

r250221:
cxgbe: Switch to a better way to install firmware.

r250614:
Deal correctly with 40G ports that don't have any transceiver plugged
in.  Do not claim that they have unknown tranceivers.

r251213:
cxgbe(4): Some more debug sysctls.  These work on both T4 and T5 based
cards.

r251317:
cxgbe(4): t4fw_cfg must be explicitly loaded if the driver is being
loaded via loader.conf.

r251358:
cxgbe(4): Provide accurate hit count for filters on T5 cards.  The
location within the TCB and the size have both changed.

r251434:
cxgbe(4): Never install a firmware if hw.cxgbe.fw_install is 0.

r251518:
cxgbe/tom: Fix bad signed/unsigned mixup in the stid allocator.  This
fixes a panic when allocating a mixture of IPv6 and IPv4 stids.

r251638:
cxgbe/tom: Allow caller to select the queue (control or data) used to
send the CPL_SET_TCB_FIELD request in t4_set_tcb_field().

r252312:
Update T5 register ranges.  This is so that regdump skips over registers
with read side-effects.

r252469:
Add a sysctl to get the number of filters available.

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

r252470:
Count the number of hits for a filter by default.

r250697:
Add dependencies on the firmware, which allows the loading of the cxgb
and cxgbe modules.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252495 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251859:
delphij [Mon, 1 Jul 2013 22:05:43 +0000 (22:05 +0000)]
MFC r251859:

Return ENETDOWN instead of ENOENT when all lagg(4) links are
inactive when upper layer tries to transmit packet.  This
gives better feedback and meaningful errors for applications.

Reviewed by: thompsa

git-svn-id: svn://svn.freebsd.org/base/stable/9@252489 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251825,252486:
delphij [Mon, 1 Jul 2013 21:59:17 +0000 (21:59 +0000)]
MFC r251825,252486:

Remove vfs_mount(9), it have been died since 2004.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252487 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252062:
delphij [Mon, 1 Jul 2013 20:45:55 +0000 (20:45 +0000)]
MFC r252062:

Call sshd_precmd instead of sshd_configtest when the operator
requests reload or restart, which, in addition of testing the
configuration, will also generate host keys when they are not
present (previous behavior).

Obtained from: FreeNAS
Ok'ed by: bdrewery, des

git-svn-id: svn://svn.freebsd.org/base/stable/9@252477 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252392:
smh [Mon, 1 Jul 2013 08:24:14 +0000 (08:24 +0000)]
MFC r252392:
style(9) fixes

git-svn-id: svn://svn.freebsd.org/base/stable/9@252460 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252390:
smh [Mon, 1 Jul 2013 08:21:06 +0000 (08:21 +0000)]
MFC r252390:
Remove invalid ASSERT

git-svn-id: svn://svn.freebsd.org/base/stable/9@252459 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251482,251733:
yongari [Mon, 1 Jul 2013 07:02:44 +0000 (07:02 +0000)]
MFC r251482,251733:
r251482:
  Correct setting TX random backoff register. This register is
  implemented as a 10 bits linear feedback shift register so only
  lower 10 bits are valid.
  Because this register is used to initialize random backoff interval
  register only when resolved duplex is half-duplex, it wouldn't have
  caused issues in these days.

r251733:
  Fix a typo introduced in r213280. IFM_OPTIONS macro should see
  current media word.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252455 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251481:
yongari [Mon, 1 Jul 2013 06:58:05 +0000 (06:58 +0000)]
MFC r251481:
  Do not report current link status if driver is not running.
  Reporting link status in driver has a side-effect that makes mii(4)
  check current link status.  mii(4) will call link status change
  callback when it sees link state change.  Normally this wouldn't
  have problems. However, ASF/IPMI firmware can actively access PHY
  regardless of driver's running state such that reporting link
  status for not-running interface can generate meaningless link
  UP/DOWN messages.

  This change also makes dhclient think driver got a valid link
  regardless of link establishment so it will bypass dhclient's
  initial link status check. I think that wouldn't be issue
  though.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252452 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252186:
yongari [Mon, 1 Jul 2013 05:33:01 +0000 (05:33 +0000)]
MFC r252186:
  Add Lenovo USB 2.0 Ethernet adapter to the list of supported
  devices.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252446 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252185:
yongari [Mon, 1 Jul 2013 05:29:42 +0000 (05:29 +0000)]
MFC r252185:
  Add Lenovo USB 2.0 Ethernet adapter.

  PR: usb/179920

git-svn-id: svn://svn.freebsd.org/base/stable/9@252444 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252143:
yongari [Mon, 1 Jul 2013 05:24:58 +0000 (05:24 +0000)]
MFC r252143:
  When RX checksum offloading is active, AX88772B will prepend a
  checksum header.  The header contains a received frame length but
  the defined length for AX88772B is different with other ASIX
  controllers.  When the RX checksum is off, AX88772B controller does
  not prepend a checksum header so driver has to use normal header
  length mask.
  This change should fix RX errors when RX checksum offloading is
  off.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252442 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252259:
pfg [Sun, 30 Jun 2013 16:02:42 +0000 (16:02 +0000)]
MFC r252259:

Minor sort.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252420 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r250378:
trociny [Sun, 30 Jun 2013 08:36:19 +0000 (08:36 +0000)]
MFC r250378:

Make errbuf optional, so if a caller is not interested in an error
message she can pass NULL (procstat(1) already does this).

git-svn-id: svn://svn.freebsd.org/base/stable/9@252410 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251887:
lstewart [Sat, 29 Jun 2013 04:25:40 +0000 (04:25 +0000)]
MFC r251887:

Add new FOREACH_FROM variants of the queue(3) FOREACH macros which can
optionally start the traversal from a previously found element by passing the
element in as "var". Passing a NULL "var" retains the same semantics as the
regular FOREACH macros.

Reviewed by: jhb (previous version), rpaulo

git-svn-id: svn://svn.freebsd.org/base/stable/9@252365 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 252205:
jhb [Fri, 28 Jun 2013 18:25:04 +0000 (18:25 +0000)]
MFC 252205:
If daily_status_security_inline is set, the rc value needs to be
forced to 3 so that the output of this script is always displayed.
In fact, setting this flag is identical to setting
daily_status_security_output to an empty string.  To make the logic
less confusing, change the behavior of daily_status_security_inline
such that it just forces daily_status_security_output to an empty
string and then applies the normal logic.

PR: conf/178611

git-svn-id: svn://svn.freebsd.org/base/stable/9@252350 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 246120,246148,246206,246587,247411,247415:
jhb [Fri, 28 Jun 2013 16:07:20 +0000 (16:07 +0000)]
MFC 246120,246148,246206,246587,247411,247415:
Add fmemopen(3), open_memstream(3), and open_wmemstream(3) which provide
stdio FILE objects for memory buffers.

port exprun by:    bdrewery

git-svn-id: svn://svn.freebsd.org/base/stable/9@252343 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoInsta-MFH (r252338): update docs to reflect correct default privsep setting
des [Fri, 28 Jun 2013 09:55:00 +0000 (09:55 +0000)]
Insta-MFH (r252338): update docs to reflect correct default privsep setting

git-svn-id: svn://svn.freebsd.org/base/stable/9@252339 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251725:
lstewart [Fri, 28 Jun 2013 03:39:54 +0000 (03:39 +0000)]
MFC r251725:

Fix a potential NULL-pointer dereference that would trigger if the hhook
registration site did not provide storage for a copy of the hhook_head struct.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252328 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251682:
lstewart [Fri, 28 Jun 2013 03:22:43 +0000 (03:22 +0000)]
MFC r251682:

Remove some duplicate code by making KHELP_DECLARE_MOD() a wrapper around
KHELP_DECLARE_MOD_UMA().

git-svn-id: svn://svn.freebsd.org/base/stable/9@252326 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r250951,251838:
lstewart [Fri, 28 Jun 2013 02:38:33 +0000 (02:38 +0000)]
MFC r250951,251838:

Ensure alq's shutdown_pre_sync event handler is deregistered on module unload to
avoid a dangling pointer and eventual panic on system shutdown.

Reported by: Ali <comnetboy at gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/9@252323 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 250418,252166:
jhb [Thu, 27 Jun 2013 20:35:39 +0000 (20:35 +0000)]
MFC 250418,252166:
Revision 233677 broke certain machines.  Specifically, if the firmware/BIOS
assigned conflicting ranges to BARs then leaving the BARs alone could
result in one device stealing mmio accesses intended to go to a second
device.  Prior to 233677 the PCI bus driver attempted to handle this case
by clearing the BAR to 0 depending on BARs based at 0 not decoding (which
is not guaranteed to be true).  Now when a conflicting BAR is detected the
following steps are taken:

 1) If hw.pci.realloc_bars (a new tunable) is enabled (default is disabled),
    then ignore the current BAR setting from the firmware and attempt to
    allocate a fresh resource range for the BAR.

 2) If 1) failed (or was disabled), disable decoding for the relevant
    BAR type (e.g. disable mem decoding for a memory BAR) and emit a
    warning if booting verbose.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252317 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252056:
smh [Thu, 27 Jun 2013 18:20:19 +0000 (18:20 +0000)]
MFC r252056:
Fix destroyed ZFS pools failing to import

MFC r252059:
Fix ZFS zpool freeze (debug command) not processing due to invalid ioctl call syntax.

MFC r252060:
Fix intermittent ZFS lock panic

MFC r252061:
Switch ZFS mutex_owner macro to use sx_xholder as its now exported via sx.h

git-svn-id: svn://svn.freebsd.org/base/stable/9@252308 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoFix build: in a recent pf refactor (head@240233), pf_var.h was modified
delphij [Thu, 27 Jun 2013 17:33:04 +0000 (17:33 +0000)]
Fix build: in a recent pf refactor (head@240233), pf_var.h was modified
to not include netinet/tcp_fsm.h, and HEAD tcpdump rely on this change
as the tcp_fsm.h will only be processed once.

Solve this by defining TCPSTATES earlier.  This wouldn't cause breakage
should pf be merged in the future.

Noticed by: tinderbox via many
Pointy hat to: delphij

git-svn-id: svn://svn.freebsd.org/base/stable/9@252307 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r230786, r246283, r251084, r251085, r251086:
gjb [Thu, 27 Jun 2013 13:03:19 +0000 (13:03 +0000)]
MFC r230786, r246283, r251084, r251085, r251086:

r230786 (imp):
- Allow specification of build shell for the buildenv target.

r246283 (hrs) (partial):
- Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE.

r251084:
- r245757 introduced warning output if update method is set to
  CVS_UPDATE or SUP_UPDATE.
- CVS exporter for stable/9/ is turned off for nearly one month
  now.
- It is finally time to swing the ax at these update methods.

r251085:
- Fix typo introduced in r251084.

r251086:
- Remove references to CVS_UPDATE and SUP_UPDATE to catch up
  with r251084.

Approved by: kib (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@252305 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252045:
smh [Thu, 27 Jun 2013 10:55:35 +0000 (10:55 +0000)]
MFC r252045:
Corrected ATA Passthrough defines from decimal to hex

git-svn-id: svn://svn.freebsd.org/base/stable/9@252303 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r252180
marius [Thu, 27 Jun 2013 09:30:09 +0000 (09:30 +0000)]
MFC: r252180

Flag mpt(4) as supporting unmapped I/O; all necessary conversion actually
already has been done as part of r246713 (MFCed to stable/9 in r251874)
except for a comment update.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252301 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r251715
marius [Thu, 27 Jun 2013 09:23:53 +0000 (09:23 +0000)]
MFC: r251715

All of Oxford/PLX OX16PCI954, OXm16PCI954 and OXu16PCI954 share the
exact same (subsystem) device and vendor IDs. However, the reference
design for the OXu16PCI954 uses a 14.7456 MHz clock (as does the EXSYS
EX-41098-2 equipped with these), while at least the OX16PCI954 defaults
to a 1.8432 MHz one. According to the datasheets of these chips, the
only difference in PCI configuration space is that OXu16PCI954 have
a revision ID of 1 while the other two are at 0. So employ the latter
for determining the default clock rates of this family.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252300 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r251713
marius [Thu, 27 Jun 2013 09:22:36 +0000 (09:22 +0000)]
MFC: r251713

Fix whitespace and normalize some entries.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252299 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r248472
marius [Thu, 27 Jun 2013 09:21:22 +0000 (09:21 +0000)]
MFC: r248472

Correct the definition for Exar XR17V258IV: we must use a config_function
to specify the offset into the PCI memory spare at which each serial port
will find its registers.  This was already done for other Exar PCI serial
devices; it was accidentally omitted for this specific device.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252298 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r248340
marius [Thu, 27 Jun 2013 09:20:22 +0000 (09:20 +0000)]
MFC: r248340

Add support for Exar XR17V358 8-port serial device to puc(4)

git-svn-id: svn://svn.freebsd.org/base/stable/9@252297 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r251589
marius [Thu, 27 Jun 2013 09:14:50 +0000 (09:14 +0000)]
MFC: r251589

- The method introduced as part of r234898 (MFCed to stable/9 in r236076)
  for not altering the boot path when booting from ZFS turned out to also
  cause the boot path not being adjusted if booting from CD-ROM with firmware
  versions that do not employ the "cdrom" alias in that case. So shuffle the
  code around instead in order to achieve the original intent. Ideally, we
  shouldn't fiddle with the boot path when booting from UFS on a disk either;
  unfortunately, there doesn't seem to be an universal way of telling disks
  and CD-ROMs apart, though. [1]
- Use NULL instead of 0 for pointers.

PR: 179289 [1]

git-svn-id: svn://svn.freebsd.org/base/stable/9@252296 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251684:
kib [Thu, 27 Jun 2013 07:27:08 +0000 (07:27 +0000)]
MFC r251684:
Fix two issues with the spin loops in the umtx(2) implementation.
- When looping, check for the pending suspension.
- Add missed checks for the faults from casuword*().

git-svn-id: svn://svn.freebsd.org/base/stable/9@252292 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 230423, 230612, 232964, 252033, 252036, 252051:
hrs [Thu, 27 Jun 2013 06:57:09 +0000 (06:57 +0000)]
MFC 230423, 230612, 232964, 252033, 252036, 252051:

- Replace the beerware license on mdconfig(8) with standard 2-clause BSD.
- Rewrite option parsing in mdconfig(8).  This makes it more user-friendly
  by removing the ordering requirements and adding more descriptive error
  messages; it also makes it more readable and maintainable.
- Add "-f file" support to listing mode (-l).  When a -f option is
  specified, only md(4) devices which have the specified file as backing
  store are displayed.
- Use MD_NAME instead of "md".
- Use _PATH_DEV instead of "/dev/".
- Return -1 when the specified backing store file is not found in the md
  device list.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252291 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r249480:
mjg [Thu, 27 Jun 2013 02:27:13 +0000 (02:27 +0000)]
MFC r249480:
Add fdallocn function and use it when passing fds over unix socket.

This gets rid of "unp_externalize fdalloc failed" panic.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252288 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r250613:
jimharris [Thu, 27 Jun 2013 00:50:22 +0000 (00:50 +0000)]
MFC r250613:

Fix typo in net.inet.tcp.minmss sysctl description.

git-svn-id: svn://svn.freebsd.org/base/stable/9@252285 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f