]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/log
FreeBSD/stable/8.git
12 years agoMFC r227123: lint: Fix lseek() argument order.
jilles [Fri, 20 Jan 2012 15:44:39 +0000 (15:44 +0000)]
MFC r227123: lint: Fix lseek() argument order.

Because SEEK_SET is 0, this seems to have no effect on the generated code.

PR: bin/160806
Submitted by: Henning Petersen <henning dot petersen at t-online dot de>
Obtained from: NetBSD

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

12 years agoMFC r216269:
emaste [Fri, 20 Jan 2012 00:20:00 +0000 (00:20 +0000)]
MFC r216269:

  Don't warn if a partition appears not to be aligned on a track boundary.
  Modern disks use LBA and create a fake CHS geometry that doesn't have any
  relation to the on-disk layout of data.

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

12 years agoMFC: 229965
gnn [Thu, 19 Jan 2012 19:39:41 +0000 (19:39 +0000)]
MFC: 229965

Fix for PR 138526.

Add the ability for /dev/null and /dev/zero to accept
being set into non blocking mode via fcntl().  This
brings the code into compliance with IEEE Std 1003.1-2001
as referenced in another PR, 94729.

Reviewed by: jhb

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

12 years agoMFC: r229977
brueffer [Wed, 18 Jan 2012 22:08:26 +0000 (22:08 +0000)]
MFC: r229977

Add hpt27xx to the hardware notes,

While here, add the 2012 copyright.

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

12 years agoMFC: r229984
truckman [Wed, 18 Jan 2012 21:50:59 +0000 (21:50 +0000)]
MFC: r229984

Pass the arguments to mtx_init() in the correct order.  There should be
no change to the binary because the value of MTX_DEF is zero and there
is a visible function prototype.

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

12 years agoMFC r226430:
stefanf [Wed, 18 Jan 2012 18:22:25 +0000 (18:22 +0000)]
MFC r226430:
Adjust posix_memalign() prototype to match what we define in stdlib.h for
C++ compilation.

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

12 years agoMFC r230032, r230050, r230090, r230091 and r228493.
hselasky [Wed, 18 Jan 2012 07:56:13 +0000 (07:56 +0000)]
MFC r230032, r230050, r230090, r230091 and r228493.
- Various XHCI and USB 3.0 related issues.
- USB 3.0 HUBs should work after this change.

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

12 years agoMFC r229971:
kib [Wed, 18 Jan 2012 05:38:43 +0000 (05:38 +0000)]
MFC r229971:
Add PCI Id for the AMT SOL UART on 5 series Intel chipsets.

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

12 years agoMFC r225048:
bz [Tue, 17 Jan 2012 22:08:58 +0000 (22:08 +0000)]
MFC r225048:

 In this branch when doing no further checkes there is no reason use
 the temporary variable and check with if as TUNABLE_*_FETCH do not
 alter values unless successfully found the tunable.

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

12 years agoMFC r224516:
bz [Tue, 17 Jan 2012 22:02:11 +0000 (22:02 +0000)]
MFC r224516:

 Introduce a tunable to disable the time consuming parts of bootup
 memtesting, which can easily save seconds to minutes of boot time.
 The tunable name is kept general to allow reusing the code in
 alternate frameworks.

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

12 years agoMFC r201402 (by ed):
pluknet [Tue, 17 Jan 2012 18:54:50 +0000 (18:54 +0000)]
MFC r201402 (by ed):
 Don't forget to clean up the file copied from the kernel sources.

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

12 years agoMFhead r226367:
glebius [Tue, 17 Jan 2012 18:05:13 +0000 (18:05 +0000)]
MFhead r226367:

  Never switch directly from INIT to MASTER, since this produces
  nasty status flaps.

  PR: kern/161123
  Submitted by: Damien Fleuriot <dam my.gd>
  OpenBSD: ip_carp.c, rev. 1.115

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

12 years agoMFC 229416 + 223200:
delphij [Tue, 17 Jan 2012 01:28:43 +0000 (01:28 +0000)]
MFC 229416 + 223200:

Don't forget to release queue lock when allocation of memory failed.

Submitted by: Sascha Wildner <saw online de>
Obtained from: DragonFly

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

12 years agoMFC r229886:
jimharris [Tue, 17 Jan 2012 00:02:45 +0000 (00:02 +0000)]
MFC r229886:

 Add support for >2TB disks in GEOM RAID for Intel metadata format.

Sponsored by: Intel
Approved by: sbruno

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

12 years agoRevert r229671 mergeinfo property from root directory. This was mistakenly
jimharris [Mon, 16 Jan 2012 23:02:37 +0000 (23:02 +0000)]
Revert r229671 mergeinfo property from root directory.  This was mistakenly
added as part of r230224 MFC commit.

Reviewed by: avg
Approved by: sbruno

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

12 years agoMFC r228060, r228068, r228060
bapt [Mon, 16 Jan 2012 22:26:45 +0000 (22:26 +0000)]
MFC r228060, r228068, r228060

Upgrade gperf to 3.0.3 latest GPLv2 version

Approved by:    des (mentor)

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

12 years agoMFC r229671:
jimharris [Mon, 16 Jan 2012 17:31:26 +0000 (17:31 +0000)]
MFC r229671:

 Add 0x2826 device ID for C600 (Patsburg) SATA controller in RAID mode.

Sponsored by: Intel
Approved by: sbruno

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

12 years agoFix build breakage by adding missing mb_put_padbyte()
kevlo [Mon, 16 Jan 2012 14:40:22 +0000 (14:40 +0000)]
Fix build breakage by adding missing mb_put_padbyte()

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

12 years agoMFC r228864:
kevlo [Mon, 16 Jan 2012 08:31:32 +0000 (08:31 +0000)]
MFC r228864:
Discard local array based on return values.

Pointed out by: uqs
Found with: Coverity Prevent(tm)
CID: 10089

MFC 228023:
Add unicode support to ntfs

Obtained from: imura

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

12 years agoMFC r228796:
kevlo [Mon, 16 Jan 2012 08:29:52 +0000 (08:29 +0000)]
MFC r228796:
Discarding local array based on return values.

MFC r227650:
Add unicode support to msdosfs and smbfs; original pathes from imura,
bug fixes by Kuan-Chung Chiu <buganini at gmail dot com>.

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

12 years agoMFC r228718: ule: ensure that batch timeshare threads are scheduled
avg [Sun, 15 Jan 2012 22:47:49 +0000 (22:47 +0000)]
MFC r228718: ule: ensure that batch timeshare threads are scheduled
fairly

Second take.

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

12 years agoRevert r230174, a botched MFC
avg [Sun, 15 Jan 2012 22:43:34 +0000 (22:43 +0000)]
Revert r230174, a botched MFC

This is a direct commit to the branch for obvious reasons.

Pointyhat to: avg

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

12 years agoMFC r228265: critical_exit: ignore td_owepreempt if kdb_active is set
avg [Sun, 15 Jan 2012 22:23:41 +0000 (22:23 +0000)]
MFC r228265: critical_exit: ignore td_owepreempt if kdb_active is set

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

12 years agoMFC r228718: ule: ensure that batch timeshare threads are scheduled
avg [Sun, 15 Jan 2012 22:18:54 +0000 (22:18 +0000)]
MFC r228718: ule: ensure that batch timeshare threads are scheduled
fairly

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

12 years agoMFC r228710: opensolaris compat: fix vcmn_err so that panic(9) produces
avg [Sun, 15 Jan 2012 22:08:44 +0000 (22:08 +0000)]
MFC r228710: opensolaris compat: fix vcmn_err so that panic(9) produces
a proper message

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

12 years agoMFC r228426: syscons: make sc_puts static as it is used only privately
avg [Sun, 15 Jan 2012 22:05:15 +0000 (22:05 +0000)]
MFC r228426: syscons: make sc_puts static as it is used only privately

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

12 years agoMFC r228433: put sys/systm.h at its proper place or add it if missing
avg [Sun, 15 Jan 2012 22:02:35 +0000 (22:02 +0000)]
MFC r228433: put sys/systm.h at its proper place or add it if missing

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

12 years agoMFC r228267: zfsboot: print boot.config contents before parsing it
avg [Sun, 15 Jan 2012 21:52:45 +0000 (21:52 +0000)]
MFC r228267: zfsboot: print boot.config contents before parsing it

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

12 years agoMFC r228266: zfs boot: allow file vdevs to be used in testing (e.g. with zfsboottest)
avg [Sun, 15 Jan 2012 21:50:17 +0000 (21:50 +0000)]
MFC r228266: zfs boot: allow file vdevs to be used in testing (e.g. with zfsboottest)

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

12 years agoMFC r225530: gpt/zfs boot blocks: reduce optimizing CFLAGS to -O1
avg [Sun, 15 Jan 2012 21:43:24 +0000 (21:43 +0000)]
MFC r225530: gpt/zfs boot blocks: reduce optimizing CFLAGS to -O1

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

12 years agoMFC r228343:
eadler [Sun, 15 Jan 2012 20:52:31 +0000 (20:52 +0000)]
MFC r228343:
 - Fix ktrace leakage if error is set

PR: kern/163098
Approved by: sbruno

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

12 years agoMFC r229766:
ume [Sat, 14 Jan 2012 19:22:45 +0000 (19:22 +0000)]
MFC r229766:
  Handle the internal scope address representation of the KAME IPv6
  stack for the node-local multicast address.

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

12 years agoMerge r228463, that explicily uses 255.0.0.0 mask for the temporary prefix.
glebius [Fri, 13 Jan 2012 23:25:58 +0000 (23:25 +0000)]
Merge r228463, that explicily uses 255.0.0.0 mask for the temporary prefix.
This change isn't actually needed in the stable/8, but let it be here, in
case if anyone tries to run stable/8 world on a head/ kernel.

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

12 years agoMFC 221891,229665,229672,229700:
jhb [Fri, 13 Jan 2012 20:35:43 +0000 (20:35 +0000)]
MFC 221891,229665,229672,229700:
Remove the assertion from tcp_input() that rcv_nxt is always greater
than or equal to rcv_adv and fix tcp_twstart() to handle this case by
assuming the last window was zero rather than a negative value.

The code in tcp_input() already safely handled this case.  It can happen
due to delayed ACKs along with a remote sender that sends data beyond
the window we previously advertised.  If we have room in our socket buffer
for the extra data beyond the advertised window, we will accept it.
However, if the ACK for that segment is delayed, then we will not
effectively fixup rcv_adv to account for that extra data until the
next segment arrives and forces out an ACK.  When that next segment
arrives, rcv_nxt will be beyond rcv_adv.

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

12 years agoMFC 228960:
jhb [Fri, 13 Jan 2012 20:25:56 +0000 (20:25 +0000)]
MFC 228960:
Cap the priority calculated from the current thread's running tick count
at SCHED_PRI_RANGE to prevent overflows in the priority value.  This can
happen due to irregularities with clock interrupts under certain
virtualization environments.

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

12 years agoMFC 229519:
jhb [Fri, 13 Jan 2012 20:23:18 +0000 (20:23 +0000)]
MFC 229519:
Fix 'make clean' for this module so it cleans up the generated gssd.h.

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

12 years agoMFC 229429:
jhb [Fri, 13 Jan 2012 20:15:49 +0000 (20:15 +0000)]
MFC 229429:
Some small fixes to CPU accounting for threads:
- Only initialize the per-cpu switchticks and switchtime in sched_throw()
  for the very first context switch on APs during boot.  This avoids a
  small gap between the middle of thread_exit() and sched_throw() where
  time is not accounted to any thread.
- In thread_exit(), update the timestamp bookkeeping to track the changes
  to mi_switch() introduced by td_rux so that the code once again matches
  the comment claiming it is mimicing mi_switch().  Specifically, only
  update the per-thread stats directly and depend on ruxagg() to update
  p_rux rather than adjusting p_rux directly.  While here, move the
  timestamp bookkeeping as late in the function as possible.

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

12 years agoMFC 229390,229420,229479:
jhb [Fri, 13 Jan 2012 19:51:15 +0000 (19:51 +0000)]
MFC 229390,229420,229479:
Fix some races in the multicast code by removing places where we would
drop the IF_ADDR_LOCK while walking an interface's multicast address list:
- Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops that
  do not modify the queues they iterate over.
- When cancelling multicast timers on an interface, don't release the
  reference on a group in the leaving state while iterating over the loop.
  Instead, use the same approach used in igmp_ifdetach() and mld_ifdetach()
  of placing the groups to free on a pending release list and then releasing
  the references after dropping the IF_ADDR_LOCK.
- Use the mli_relinmhead list normally used to defer calls to
  in6m_release_locked() to defer calls to mld_v1_transmit_report() until
  after the IF_ADDR_LOCK is dropped.

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

12 years agoMFC 229414,229476,229477:
jhb [Fri, 13 Jan 2012 19:20:33 +0000 (19:20 +0000)]
MFC 229414,229476,229477:
Various fixes to the SIOC[DG]LIFADDR ioctl handlers:
- Grab a reference on any matching interface address (ifa) before dropping
  the IF_ADDR_LOCK() and release the reference after using it to prevent a
  potential use-after-free.
- Fix the IPv4 ioctl handlers in in_lifaddr_ioctl() to work with IPv4
  interface addresses rather than IPv6.
- Add missing interface address list locking in the IPv4 handlers.

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

12 years agoMFC 215605,215606,222952,229400:
jhb [Fri, 13 Jan 2012 19:13:43 +0000 (19:13 +0000)]
MFC 215605,215606,222952,229400:
Various improvements to the 'cscope' target:
- Add x86 to ALL_ARCH.
- Add lex and yacc sources to things cscope'd.
- Include sys/xen in cscope tag file generation.
- Improve the cscope target's handling of MD directories.  Automatically
  include the MACHINE_ARCH directory if it differs from MACHINE when
  building an index for a single machine.  Also, include the 'x86'
  directory when building an index for i386, pc98, or amd64.

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

12 years agoMFC 229622:
jhb [Fri, 13 Jan 2012 18:58:31 +0000 (18:58 +0000)]
MFC 229622:
Fix a logic bug in change 228207 in the check for a thread's new user
priority being a realtime priority.

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

12 years agoMFC 228849, 229727:
jhb [Fri, 13 Jan 2012 18:54:10 +0000 (18:54 +0000)]
MFC 228849, 229727:
Add post-VOP hooks for VOP_DELETEEXTATTR() and VOP_SETEXTATTR() and use
these to trigger a NOTE_ATTRIB EVFILT_VNODE kevent when the extended
attributes of a vnode are changed.

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

12 years agoMFC 228738:
jhb [Fri, 13 Jan 2012 18:49:28 +0000 (18:49 +0000)]
MFC 228738:
Allow boot0cfg to force a PXE boot via boot0 on the next boot.
- Fix boot0 to check for PXE when using the pre-set setting for the
  preferred slice.
- Update boot0cfg to use slice 6 to select PXE.  Accept a 'pxe' argument
  instead of a number for the 's' option as a way to select PXE as well.

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

12 years agoMFC r228359:
jh [Fri, 13 Jan 2012 11:10:17 +0000 (11:10 +0000)]
MFC r228359:

sbuf_data() hasn't returned NULL for overflowed buffers since r71721.

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

12 years agoPartially MFC r228358: Fix markup.
jh [Fri, 13 Jan 2012 11:06:31 +0000 (11:06 +0000)]
Partially MFC r228358: Fix markup.

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

12 years agoMFC: 226520
mckusick [Fri, 13 Jan 2012 07:10:52 +0000 (07:10 +0000)]
MFC: 226520

The current /etc/dumpdates file restricts device names to 32 characters.
With the addition of various GEOM layers some device names now exceed
this length, for example /dev/mirror/encrypted.elig.journal. This
change expands the field to 53 bytes which brings the /etc/dumpdates
lines to 80 characters. Exceeding 80 characters makes the /etc/dumpdates
file much less human readable. A test is added to dump so that it
verifies that the device name will fit in the 53 character field
failing the dump if it is too long.

This change has been checked to verify that its /etc/dumpdates file
is compatible with older versions of dump.

Reported by: Martin Sugioarto <martin@sugioarto.com>
PR:          kern/160678

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

12 years agoMFC r228470:
eadler [Fri, 13 Jan 2012 00:38:00 +0000 (00:38 +0000)]
MFC r228470:
- Add a sysctl to allow non-root users the ability to set idle
  priorities.
- While here fix up some style nits.

Approved by: jhb

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

12 years agoMFC: r229585
brueffer [Thu, 12 Jan 2012 20:45:56 +0000 (20:45 +0000)]
MFC: r229585

Fix typo.

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

12 years agoMFC r228461:
mav [Thu, 12 Jan 2012 15:57:03 +0000 (15:57 +0000)]
MFC r228461:
Fix few bugs in isp(4) target mode support:
 - in destroy_lun_state() assert hold == 1 instead of 0, as it should
receive hold taken by the create_lun_state() or get_lun_statep() before;
 - fix hold count leak inside rls_lun_statep() that also fired above assert;
 - in destroy_lun_state() use SIM bus number instead of SIM path id for
ISP_GET_PC_ADDR(), as it was before r196008;
 - make isp_disable_lun() to set status in CCB;
 - make isp_target_mark_aborted() set status into the proper CCB.

Reviewed by: mjacob
Sponsored by: iXsystems, inc.

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

12 years agoMFC r228462:
mav [Thu, 12 Jan 2012 15:50:21 +0000 (15:50 +0000)]
MFC r228462:
 - Fix different variable types use in different files after r121184,
  causing problems on amd64.
 - s/%lud/%lu/.

Sponsored by:   iXsystems, Inc.

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

12 years agoMFC r228808, r228847, 229395:
mav [Thu, 12 Jan 2012 15:02:51 +0000 (15:02 +0000)]
MFC r228808, r228847, 229395:

r228808, r228847:
Make cd driver to handle Audio CDs, reporting their 2352 bytes sectors to
GEOM and using READ CD command for reading data, same as acd driver does.
Audio CDs identified by checking respective bit of the control field of
the first track in TOC.

229395:
Add support for CDRIOCGETBLOCKSIZE and CDRIOCSETBLOCKSIZE IOCTLs to control
sector size same as acd driver does. Together with r228808 and r228847 this
allows existing multimedia/vlc to play Audio CDs via CAM cd driver.

PR: ports/162190
Sponsored by: iXsystems, Inc.

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

12 years agoMFC 228715:
jhb [Thu, 12 Jan 2012 14:44:14 +0000 (14:44 +0000)]
MFC 228715:
Add a TASK_INITIALIZER() macro that can be used to statically
initialize a task structure.

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

12 years agoMFC r228445:
eadler [Thu, 12 Jan 2012 00:03:50 +0000 (00:03 +0000)]
MFC r228445:
 - Add support for ASCII art splash screens in TheDraw format

PR: kern/143370
Approved by: ed

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

12 years agoMFC r228669: du: Allow multiple -HLP options, the last one wins.
jilles [Thu, 12 Jan 2012 00:01:11 +0000 (00:01 +0000)]
MFC r228669: du: Allow multiple -HLP options, the last one wins.

This matches 4.4BSD tradition and other utilities with these options and is
required by POSIX (POSIX does not specify -P, only -HL).

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

12 years agoMFC r227981:
wblock [Wed, 11 Jan 2012 23:11:27 +0000 (23:11 +0000)]
MFC r227981:
Point out that @reboot runs at every cron startup, not just system
startup.

Approved by: gjb (mentor)

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

12 years agoMFC: 226265
mckusick [Wed, 11 Jan 2012 19:12:29 +0000 (19:12 +0000)]
MFC: 226265

When unmounting a filesystem always wait for the vfs_busy lock to clear
so that if no vnodes in the filesystem are actively in use the unmount
will succeed rather than failing with EBUSY.

Reported by: Garrett Cooper
Reviewed by: Attilio Rao and Kostik Belousov
Tested by:   Garrett Cooper
PR:          kern/161016

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

12 years agoMFC r228940:
delphij [Wed, 11 Jan 2012 18:18:37 +0000 (18:18 +0000)]
MFC r228940:

Import the first release of HighPoint RocketRAID 27xx SAS 6Gb/s HBA card
driver.  This driver works for FreeBSD/i386 and FreeBSD/amd64 platforms.

Many thanks to HighPoint for providing this driver.

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

12 years agoMFC r228726, r228727:
mav [Wed, 11 Jan 2012 18:14:22 +0000 (18:14 +0000)]
MFC r228726, r228727:
Cast some vendor-specific spell on VIA VT1708S codecs to:
 - make analog input loopback work;
 - get access to the mics boost controls.

Sponsored by:   iXsystems, Inc.

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

12 years agoMFC: revision 229462
nyan [Wed, 11 Jan 2012 13:56:31 +0000 (13:56 +0000)]
MFC: revision 229462

  Fix 230MB MO support.

  Submitted by: Kaho Toshikazu

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

12 years agoMFC: r228827
rmacklem [Wed, 11 Jan 2012 01:58:49 +0000 (01:58 +0000)]
MFC: r228827
During investigation of an NFSv4 client crash reported by glebius@,
jhb@ spotted that nfscl_getstateid() might modify credentials when
called from nfsrpc_read() for the case where p != NULL, whereas
nfsrpc_read() only did a crdup() to get new credentials for p == NULL.
This bug was introduced by r195510, since pre-r195510 nfscl_getstateid()
only modified credentials for the p == NULL case. This patch modifies
nfsrpc_read()/nfsrpc_write() so that they do crdup() for the p != NULL case.
It is conceivable that this bug caused the crash reported by glebius@, but
that will not be determined for some time, since the crash occurred after
about 1month of operation.

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

12 years agoMFC r228431, r228502, r228802:
fabient [Tue, 10 Jan 2012 08:41:10 +0000 (08:41 +0000)]
MFC r228431, r228502, r228802:
Add watchdog support for VIA south bridge chipset.
Tested on VT8251, VX900 but CX700, VX800, VX855 should works.

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

12 years agoMFC: r228757
rmacklem [Tue, 10 Jan 2012 02:55:43 +0000 (02:55 +0000)]
MFC: r228757
jwd@ reported a problem via email where the old NFS client would
get a reply of EEXIST from an NFS server when a Mkdir RPC was retried,
for an NFS over UDP mount.
Upon investigation, it was found that the client was retransmitting
the Mkdir RPC request over UDP, but with a different xid. As such,
the retransmitted message would miss the Duplicate Request Cache
in the server, causing it to reply EEXIST. The kernel client side
UDP rpc code has two timers. The first one causes a retransmit using
the same xid and socket and was set to a fixed value of 3seconds.
(The default can be overridden via CLSET_RETRY_TIMEOUT.)
The second one creates a new socket and xid and should be larger
than the first. However, both NFS clients were setting the second
timer to nm_timeo ("timeout=<value>" mount argument), which defaulted to
1second, so the first timer would never time out.
This patch fixes both NFS clients so that they set the first timer
using nm_timeo and makes the second timer larger than the first one.

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

12 years ago- Remove extraneous null ptr deref checks
eadler [Tue, 10 Jan 2012 01:02:19 +0000 (01:02 +0000)]
- Remove extraneous null ptr deref checks
- Fix memory leak

Approved by: jhb

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

12 years agoMFC r227535:
eadler [Tue, 10 Jan 2012 00:35:01 +0000 (00:35 +0000)]
MFC r227535:
- add support for Titan VScom PCIex-800H

PR: kern/124128
Approved by: jhb

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

12 years agoMFC r227532:
eadler [Tue, 10 Jan 2012 00:27:16 +0000 (00:27 +0000)]
MFC r227532:
- add support for Broadcom 802.11bg/EDGE/GPRS CardBus (Serial)
- correct mislabeling of 0x432214e4 device

PR: kern/119606
Approved by: jhb

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

12 years agoMFC 226404:
eadler [Tue, 10 Jan 2012 00:19:18 +0000 (00:19 +0000)]
MFC 226404:
 - add support for I-O DATA RSA-PCI2/R

PR: kern/142999
Approved by: jhb

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

12 years agoMFC 227489:
eadler [Tue, 10 Jan 2012 00:03:30 +0000 (00:03 +0000)]
MFC 227489:
 - fix duplicate "a a" in some comments

Approved by: simon

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

12 years agoMFC r198999:
yongari [Mon, 9 Jan 2012 20:14:52 +0000 (20:14 +0000)]
MFC r198999:
  Take a step towards removing if_watchdog/if_timer.  Don't explicitly set
  if_watchdog/if_timer to NULL/0 when initializing an ifnet.  if_alloc()
  sets those members to NULL/0 already.

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

12 years agoMFC r212378:
yongari [Mon, 9 Jan 2012 20:07:38 +0000 (20:07 +0000)]
MFC r212378:
  Catch up to rename of the constant for the Master Data Parity Error bit in
  the PCI status register.

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

12 years agoMFC r228717:
yongari [Mon, 9 Jan 2012 19:58:41 +0000 (19:58 +0000)]
MFC r228717:
  Increase wait time for OP_TCPSTART command processing.  It seems
  100us is not enough to ensure prefetch unit work.

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

12 years agoMFC r228716:
yongari [Mon, 9 Jan 2012 19:30:23 +0000 (19:30 +0000)]
MFC r228716:
  TCP header size is represented by number of 32bits words.
  Fix the TCP header size calculation such that makes TSO engine
  cache all header(ethernet/IP/TCP) bytes to its internal buffer.
  While here, remove extra pull up for TCP payload.  Unlike some
  em(4) controllers, fxp(4) does not require such work around for
  TSO.
  The two limitations are ethernet/IP/TCP header size should be less
  than or equal to the size of controller's internal buffer(80 bytes)
  and these header information should be found in the first fragment
  of a TSO frame.

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

12 years agoMFC r228479-228480:
yongari [Mon, 9 Jan 2012 19:20:46 +0000 (19:20 +0000)]
MFC r228479-228480:
r228479:
  BCM5720 performance tweak from Broadcom.
   o Allow multiple outstanding read requests from non-LSO read DMA engine.
   o Allow 4KB burst length reads for non-LSO frames.
   o Enable 512B burst length reads for buffer descriptors.

r228480:
  Destroy DMA tag for jumbo RX buffer in device detach.

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

12 years agoMFC r228476:
yongari [Mon, 9 Jan 2012 19:08:52 +0000 (19:08 +0000)]
MFC r228476:
  Rework link state tracking and remove superfluous link UP/DOWN
  messages.
   o Add check for actually resolved speed in miibus_statchg callback
     instead of blindly reprogramming BCE_EMAC_MODE register.  The
     callback may be called multiple times(e.g. link UP, link
     transition, auto-negotiate complete etc) while auto-negotiation
     is in progress.  All unresolved link state changes are ignored
     now and setting BCE_EMAC_MODE after link establishment is done
     once.
   o bce(4) is careful enough not to drive MII_TICK if driver got a
     valid link.  To detect lost link, bce(4) relied on link state
     change interrupt and if driver see the interrupt, it forced to
     drive MII_TICK by calling bce_tick() in interrupt handler.
     Because bce(4) generates multiple link state change interrupts
     while auto-negotiation is in progress, bce_tick() would be
     called multiple times and this resulted in generating multiple
     link UP/DOWN messages.
     With this change, bce_tick() is not called in interrupt handler
     anymore such that miibus_statchg callback handles link state
     changes with consistent manner.

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

12 years agoMFC r218529:
yongari [Mon, 9 Jan 2012 18:52:47 +0000 (18:52 +0000)]
MFC r218529:
  - Updated firmware which improves small packet performance.

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

12 years agoThe sysctls for the new NFS server on stable/8 live under vfs.newnfs
jhb [Mon, 9 Jan 2012 18:46:03 +0000 (18:46 +0000)]
The sysctls for the new NFS server on stable/8 live under vfs.newnfs
rather than vfs.nfsd.

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

12 years agoMFC r210522,213489,218423,218527:
yongari [Mon, 9 Jan 2012 18:32:45 +0000 (18:32 +0000)]
MFC r210522,213489,218423,218527:
r210522:
  Fix an apparent typo.

r213489:
  Add the capability to read the complete contents of the NVRAM via sysctl
        dev.bce.<unit>.nvram_dump
  Add the capability to write the complete contents of the NVRAM via sysctl
        dev.bce.<unit>.nvram_write
  These are only available if the kernel option BCE_DEBUG is enabled.
  The nvram_write sysctl also requires the kernel option
  BCE_NVRAM_WRITE_SUPPORT to be enabled.  These are to be used at your
  own caution.  Since the MAC addresses are stored in the NVRAM, if you
  dump one NIC and restore it on another NIC the destination NIC's
  MAC addresses will not be preserved.  A tool can be made using these
  sysctl's to manage the on-chip firmware.

r218423:
  - Added systcls for header splitting, RX/TX buffer count, interrupt
    coalescing, strict RX MTU, verbose output, and shared memory debug.
  - Added additional debug counters (VLAN tags and split header frames).
  - Updated debug counters to 64 bit definitions.
  - Updated l2fhdr bit definitions.
  - Combined RX buffer sizing into a single function.
  - Added buffer size and interrupt coalescing settings to adapter info
    printout.

r218527:
  - Added error checking to nvram read functions.
  - Minor style updates.

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

12 years agoMFC r226604:
das [Mon, 9 Jan 2012 04:59:47 +0000 (04:59 +0000)]
MFC r226604:
  Add support for the 'x' mode option in fopen() as specified in the C1X
  draft standard.  The option is equivalent to O_EXCL.

Also merge doc improvements r197045 and r207942.

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

12 years agoMFC r226595:
das [Mon, 9 Jan 2012 04:58:02 +0000 (04:58 +0000)]
MFC r226595:
  Per IEEE754r, pow(1, y) is 1 even if y is NaN, and pow(-1, +-Inf) is 1.

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

12 years agoMFC r226594:
das [Mon, 9 Jan 2012 04:57:09 +0000 (04:57 +0000)]
MFC r226594:
  Bugfix: feenableexcept() and fedisableexcept() should just return the
  old exception mask, not mask | ~FE_ALL_EXCEPT.

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

12 years agoMFC various fma{,f,l} improvements:
das [Mon, 9 Jan 2012 04:55:55 +0000 (04:55 +0000)]
MFC various fma{,f,l} improvements:

r226245 - refactoring
r226371 - fix double-rounding bug
r226373 - new math_private.h macros
r226601 - fix nit in r226371

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

12 years agoMFC r228233:
eadler [Mon, 9 Jan 2012 03:03:43 +0000 (03:03 +0000)]
MFC r228233:
- Fix typos s/(more|less) then|\1 than/

Approved by: brucec

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

12 years agoMFC r229353:
gjb [Mon, 9 Jan 2012 01:59:50 +0000 (01:59 +0000)]
MFC r229353:

 - Trivial standardization to a few comments in kern.pre.mk.

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

12 years agoMFC: r228560
rmacklem [Sun, 8 Jan 2012 23:30:23 +0000 (23:30 +0000)]
MFC: r228560
Patch the new NFS server in a manner analagous to r228520 for the
old NFS server, so that it correctly handles a count == 0 argument
for Commit.

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

12 years agoMFC r228754:
eadler [Sun, 8 Jan 2012 21:01:21 +0000 (21:01 +0000)]
MFC r228754:
 - Add restrict keyword to glob(3)

PR: kern/161958
Approved by: jilles

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

12 years agoMFC r229185:
kib [Sun, 8 Jan 2012 16:47:37 +0000 (16:47 +0000)]
MFC r229185:
Avoid double-unlock or double unreference for ndp->ni_dvp when the vnode dp
lock upgrade right after the 'success' label fails.

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

12 years agoMFC: r228260
rmacklem [Sun, 8 Jan 2012 01:09:00 +0000 (01:09 +0000)]
MFC: r228260
This patch adds a sysctl to the NFSv4 server which optionally disables the
check for a UTF-8 compliant file name. Enabling this sysctl results in
an NFSv4 server that is non-RFC3530 compliant, therefore it is not enabled
by default. However, enabling this sysctl results in NFSv3 compatible
behaviour and fixes the problem reported by "dan at sunsaturn.com"
to freebsd-current@ on Nov. 14, 2011 under the subject "NFSV4 readlink_stat".

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

12 years agoMFC r227871:
kevlo [Sat, 7 Jan 2012 16:16:13 +0000 (16:16 +0000)]
MFC r227871:
Remove unused variable mii.
This variable is initialized but not used.

Reviewed by: yongari

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

12 years agoMFC r227491:
eadler [Sat, 7 Jan 2012 03:32:24 +0000 (03:32 +0000)]
MFC r227491:

-  new sentence should start on new line.

Approved by: gjb

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

12 years agoMFC zfsboottest:
mm [Sat, 7 Jan 2012 02:35:00 +0000 (02:35 +0000)]
MFC zfsboottest:
r225608 (partial), r225609, r226611, r226612

MFC r225608 (avg, tools/ part):
zfstest: rename to zfsboottest and move to tools

MFC r225609 (avg):
zfsboottest: some additional enhancements

- redirect diagnostics printfs in the boot code to stderr
- do not read trailing garbage from a trailing block of a file

Also add my copyright to the file after making so many changes.

MFC r226611 (pjd):
- Allow to specify multiple files to check, eg.

zfsboottest gpt/system0 gpt/system1 - /boot/kernel/kernel /boot/zfsloader

- Instead of printing file's content calculate MD5 hash of the file,
  so it can be easly compared to the hash calculated via file system.
- Some other minor improvements.

MFC r226612 (pjd):
Because ZFS boot code was very fragile in the past and real PITA to debug,
introduce zfsboottest.sh script that will verify if it will be possible to boot
from the given pool.

# zfsboottest.sh system

Where "system" is pool name of the pool we want to boot from.

What is being verified by the script:
- Does the pool exist?
- Does it have bootfs property configured?
- Is mountpoint property of the boot dataset set to 'legacy'?

Dataset configured in bootfs property has to be mounted to perform more
checks:
- Does the /boot directory in boot dataset exist?
- Is this dataset configured as root file system in /etc/fstab or set
  in vfs.root.mountfrom variable in /boot/loader.conf?

By using zfsboottest tool the script will read all the files in /boot
directory using ZFS boot code and calculate their checksums.
Then, it will walk /boot directory using find(1) though regular file sytem
and also read all the files in /boot directory and calculate their checksums.
If any of the files cannot be looked up, read or checksum is invalid it will
be reported and booting off of this pool is probably not possible.

Some additional checks may be interesting as well. For example if the disks
contain proper pmbr and gptzfsboot code or if all expected files in /boot/
are present.

When upgrading FreeBSD, one should snapshot datasets that contain operating
system, upgrade (install new world and kernel) and use zfsboottest.sh to verify
if it will be possible to boot from new configuration. If all is good one
should upgrade boot blocks, by eg.:

# gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1

If something is wrong, one should rollback datasets and report the problems.

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

12 years agoMFC r226549,r226550,r226551,r226552,r226553,r226568
mm [Sat, 7 Jan 2012 02:23:58 +0000 (02:23 +0000)]
MFC r226549,r226550,r226551,r226552,r226553,r226568

MFC r226549 (pjd):
Remove redundant size calculation.

MFC r226550 (pjd):
Initialize 'rc' properly before using it. This error could lead to infinite
loop when data reconstruction was needed.

MFC r226551 (pjd):
Don't mark vdev as healthy too soon, so we won't try to use invalid vdevs.

MFC r226552 (pjd):
Never pass NULL block pointer when reading. This is neither expected nor
handled by lower layers like vdev_raidz, which uses bp for checksum
verification. This bug could lead to NULL pointer reference and resets
during boot.

MFC r226553 (pjd):
Always pass data size for checksum verification function, as using
physical block size declared in bp may not always be what we want.
For example in case of gang block header physical block size declared
in bp is much larger than SPA_GANGBLOCKSIZE (512 bytes) and checksum
calculation failed. This bug could lead to accessing unallocated
memory and resets/failures during boot.

MFC r226568 (pjd) [1]:
- Correctly read gang header from raidz.
- Decompress assembled gang block data if compressed.
- Verify checksum of a gang header.
- Verify checksum of assembled gang block data.
- Verify checksum of uber block.

Submitted by: avg [1]

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

12 years agoMFC: r228217
rmacklem [Sat, 7 Jan 2012 02:09:49 +0000 (02:09 +0000)]
MFC: r228217
Post r223774, the NFSv4 client no longer has multiple instances
of the same lock_owner4 string. As such, the handling of cleanup
of lock_owners could be simplified. This simplification permitted
the client to do a ReleaseLockOwner operation when the process that
the lock_owner4 string represents, has exited. This permits the
server to release any storage related to the lock_owner4 string
before the associated open is closed. Without this change, it
is possible to exhaust a server's storage when a long running
process opens a file and then many child processes do locking
on the file, because the open doesn't get closed. A similar patch
was applied to the Linux NFSv4 client recently so that it wouldn't
exhaust a server's storage.

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

12 years agoMFC r228355:
gjb [Sat, 7 Jan 2012 02:03:42 +0000 (02:03 +0000)]
MFC r228355:

- As of r226865, daily_scrub_zfs_default_threshold is 35 days.

PR: 162890

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

12 years agoMFC r207761:
yongari [Sat, 7 Jan 2012 01:08:17 +0000 (01:08 +0000)]
MFC r207761:
  Belatedly merge r207761.  For unknown reason r207761 was not
  fully merged (r208073) to stable/8 but mergeinfo was recorded.

  Add a fastpath to allocate from packet zone when using m_getjcl.
  This will add support for packet zone for at least igb and ixgbe
  and will avoid to check for that in bce and mxge.

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

12 years agoMFC r215835,228370:
yongari [Fri, 6 Jan 2012 23:59:25 +0000 (23:59 +0000)]
MFC r215835,228370:
r215835:
  Add a HARDWARE section.

r228370:
  After r228293, et(4) supports altq(4).

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

12 years agoFix build of ehci_mbus.c by applying patches similar
hselasky [Fri, 6 Jan 2012 22:54:03 +0000 (22:54 +0000)]
Fix build of ehci_mbus.c by applying patches similar
to ones in r228483. This file was missed by a recent
MFC because the file is named differently in 10-current.

Pointy hat: hselasky @
Reported by: jhb

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

12 years agoMFC r228333,228335-228336,228362,228368-228369,228381:
yongari [Fri, 6 Jan 2012 21:45:08 +0000 (21:45 +0000)]
MFC r228333,228335-228336,228362,228368-228369,228381:
r228333:
  Protect SIOCSIFMTU ioctl handler with driver lock.
  Don't blindly re-initialize controller whenever MTU is changed.
  Now, reinitializing is done only when driver is running.

  While here, remove unnecessary assignment of error value since it
  was already initialized to 0.

r228335:
  Consistently use a tab character instead of using either a space or
  tab after #define.
  While I'm here consistently use capital letters when it uses
  hexadecimal notation.

  No functional changes.

r228336:
  Disable all clocks and put PHY into COMA before entering into
  suspend state.  This will save more power.
  On resume, make sure to enable all clocks.  While I'm here, if
  controller is not fast ethernet, enable gigabit PHY.

r228362:
  Do not disable interrupt without knowing whether the raised
  interrupt is ours.  Note, interrupts are automatically ACKed when
  the status register is read.
  Add RX/TX DMA error to interrupt handler and do full controller
  reset if driver happen to encounter these errors.  There is no way
  to recover from these DMA errors without controller reset.
  Rename local variable name intrs with status to enhance
  readability.

  While I'm here, rename ET_INTR_TXEOF and ET_INTR_RXEOF to
  ET_INTR_TXDMA and ET_INTR_RXDMA respectively.  These interrupts
  indicate that a frame is successfully DMAed to controller's
  internal FIFO and they have nothing to do with EOF(end of frame).
  Driver does not need to wait actual end of TX/RX of a frame(e.g.
  no need to wait the end signal of TX which is generated when a
  frame in TX FIFO is emptied by MAC).  Previous names were somewhat
  confusing.

r228368:
  Remove unnecessary definition of ET_PCIR_BAR.  Controller support
  I/O memory only.
  While here, use pci_set_max_read_req(9) rather than directly
  manipulating PCIe device control register.

r228369:
  Announce flow control ability to PHY driver and enable RX flow
  control.  Controller does not automatically generate pause frames
  based on number of available RX buffers so it's very hard to
  know when driver should generate XON frame in time.  The only
  mechanism driver can detect low number of RX buffer condition is
  ET_INTR_RXRING0_LOW or ET_INTR_RXRING1_LOW interrupt.  This
  interrupt is generated whenever controller notices the number of
  available RX buffers are lower than pre-programmed value(
  ET_RX_RING0_MINCNT and ET_RX_RING1_MINCNT register).  This scheme
  does not provide a way to detect when controller sees enough number
  of RX buffers again such that efficient generation of XON/XOFF
  frame is not easy.

  While here, add more flow control related register definition.

r228381:
  FreeBSD driver does not require arpcom structure in softc.

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

12 years agoRegen.
jhb [Fri, 6 Jan 2012 19:33:27 +0000 (19:33 +0000)]
Regen.

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

12 years agoMFC 226217,227070,227341,227502:
jhb [Fri, 6 Jan 2012 19:32:39 +0000 (19:32 +0000)]
MFC 226217,227070,227341,227502:
Add the posix_fadvise(2) system call.  It is somewhat similar to
madvise(2) except that it operates on a file descriptor instead of a
memory region.  It is currently only supported on regular files.

Note that this adds a new VOP, so all filesystem modules must be
recompiled.

Approved by: re (kib)

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

12 years agoMFC r228326-228327,228331-228332:
yongari [Fri, 6 Jan 2012 19:26:31 +0000 (19:26 +0000)]
MFC r228326-228327,228331-228332:
r228326:
  Controller does not require TX start command for every frame.  So
  send a single TX command after setting up all TX frames.  This
  removes unnecessary register accesses and bus_dmamap_sync(9) calls.
  et(4) uses TX interrupt moderation so it's possible to have TX
  buffers that were already transmitted but waiting for TX completion
  interrupt.  If the number of available TX descriptor is less then
  1/3 of total TX descriptor, try reclaiming first to get enough free
  TX descriptors before setting up TX descriptors.
  After r228325, et_txeof() no longer tries to send frames after
  reclaiming TX buffers.  That change was made to give more chance
  to transmit frames in main interrupt handler since we can still
  send frames in interrupt handler with RX interrupt.  So right
  before exiting interrupt hander, after enabling interrupt, try to
  send more frames.  This gives slightly better performance numbers.

  While I'm here reduce number of spare TX descriptors from 8 to 4.
  Controller does not require reserved TX descriptors, it was just to
  reduce TX overhead.  After r228325, driver has much lower TX
  overhead so it does not make sense to reserve 8 TX descriptors.

r228327:
  Remove et_enable_intrs(), et_disable_intrs() functions and
  manipulation of interrupt register access is done through
  CSR_WRITE_4 macro.  Also add disabling interrupt into et_reset()
  because we want interrupt disabled state after controller reset.
  While I'm here slightly change interrupt handler to be more
  readable one.

r228331:
  Rework link state tracking and TX/RX MAC configuration.
   o Do not report link status if driver is not running.
   o TX/RX MAC configuration should be done with resolved speed,
     duplex and flow control after establishing a link so it can't
     be done in driver initialization routine.
     Move the configuration to miibus_statchg callback which will be
     called whenever any link state change is detected.
     At this moment, flow-control is not enabled yet mainly because
     I was not able to set correct flow control parameters to
     generate TX pause frames.
   o Now TX/RX MAC is enabled only when a valid link is detected.
     Rearragnge hardware initialization routine a bit to leave
     enabling MAC to miibus_statchg callback.  In order to that,
     TX/RX DMA engine is enabled in et_init_locked().
   o Introduce ET_FLAG_LINK flag to track current link state.
   o Introduce ET_FLAG_FASTETHER flag to mark whether controller is
     fast ethernet.  This flag is checked in miibus_statchg callback
     to know whether PHY established a valid link.
   o In et_stop(), TX/RX MAC is explicitly disabled instead of
     relying on et_reset().  And move et_reset() from et_stop() to
     controller initialization.  Controler reset is not required here
     and it would also clear critial registers(i.e station address,
     RX filter configuration, WOL etc) that are required to make WOL
     work.
   o Switching to current media is done in et_init_locked() after
     setting IFF_DRV_RUNNING flag.  This should ensure reliable
     auto-negotiation/manual link establishment.
   o In et_start_locked(), check whether driver got a valid link
     before trying to send frames.
   o Remove checking a link in et_tick() as this is done by
     miibus_statchg callback.

r228332:
  Implement hardware MAC statistics counter.  Counters could be
  queried with dev.et.%d.stats sysctl node where %d is an instance of
  device.

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

12 years agoMFC r228325:
yongari [Fri, 6 Jan 2012 19:11:20 +0000 (19:11 +0000)]
MFC r228325:
  Overhaul bus_dma(9) usage in et(4) and clean up TX/RX path.  This
  change should make et(4) work on any architectures.
   o Remove m_getl inline function and replace it with stanard mbuf
     interfaces.  Previous code tried to minimize code duplication
     but this came from incorrect use of common DMA tag.
     Driver may be still use a common RX allocation handler with
     additional structure changes but I don't see much point to do
     that it would make it hard to understand the code.
   o Remove DragonflyBSD specific constant EVL_ENCAPLEN, use
     ETHER_VLAN_ENCAP_LEN instead.
   o Add bunch of new RX status definition.  It seems controller
     supports RX checksum offloading but I was not able to make the
     feature work yet.  Currently driver checks whether recevied
     frame is good one or not.
   o Avoid a typedef ending in '_t' as style(9) says.
   o Controller has no restriction on DMA address space, so there
     is no reason to limit the DMA address to 32bit.  Descriptor
     rings,  status blocks and TX/RX buffers now use full 64bit DMA
     addressing.
   o Allocate DMA memory shared between host and controller as
     coherent.
   o Create 3 separate DMA tags to be used as TX, mini RX ring and
     stanard RX ring.  Previously it created a single DMA tag and it
     was used to all three rings.
   o et(4) does not support jumbo frame at this moment and I still
     don't quite understand how jumbo frame works on this controller
     so use two RX rings to handle small sized frame and normal sized
     frame respectively.  The mini RX ring will be used to receive
     frames that are less than or equal to 127 bytes.  The second RX
     ring is used to receive frames that are not handled by the first
     RX ring.
     If jumbo frame support is implemented, driver may have to choose
     better RX scheme by letting the second RX ring handle jumbo
     frames.  This scheme will mimic Broadcom's efficient jumbo frame
     handling feature.  However RAM buffer size(16KB) of the
     controller is too small to hold 2 jumbo frames, if 9KB
     jumbo frame is used, I'm not sure how good performance would it
     have.
   o In et_rxeof(), make sure to check whether controller received
     good frame or not.  Passing corrupted frame to upper layer is
     bad idea.
   o If driver receives a bad frame or driver fails to allocate RX
     buffer due to resource shortage condition, reuse previously
     loaded DMA map for RX buffer instead of unloading/loading RX
     buffer again.
   o et_init_tx_ring() never fails so change return type to void.
   o In watchdog handler, show TX DMA write back status of errored
     frame which could be used as a clue to debug watchdog timeout.
   o Add missing bus_dmamap_sync() in various places such that et(4)
     should work with bounce buffers(e.g. PAE).
   o TX side bus_dmamap_load_mbuf_sg(9) support.
   o RX side bus_dmamap_load_mbuf_sg(9) support.
   o Controller has no DMA alignment limit in RX buffer so use
     m_adj(9) in RX buffer allocation to make IP header align on 2
     bytes boundary.  Otherwise it would trigger unaligned access
     error in upper layer on strict alignment architectures.
     One of down side of controller is it provides limited set of RX
     buffer length like most Intel controllers.  This is not problem
     at this moment because driver does not support jumbo frame yet
     but it may require alignment fixup code to support jumbo frame
     on strict alignment architectures.
   o In et_txeof(), don't zero TX descriptors for transmitted frames.
     TX descriptors don't need write access after transmission.
     Driver sets IFF_DRV_OACTIVE when the number of available TX
     descriptors are less than or equal to ET_NSEG_SPARE.  Make sure
     to clear IFF_DRV_OACTIVE only when the number of available TX
     descriptor is greater than ET_NSEG_SPARE.

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