]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/log
FreeBSD/stable/8.git
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

12 years agoMFC r228291-228293,228297-228298:
yongari [Fri, 6 Jan 2012 18:16:57 +0000 (18:16 +0000)]
MFC r228291-228293,228297-228298:
r228291:
  Remove NetBSD license. r199548 removed all bit macros that were
  derived from NetBSD.

r228292:
  Implement suspend/resume methods.  Driver has no issue with
  suspend/resume.

r228293:
  Fix alt(4) support.  Also add check for number of available TX
  descriptors before trying to send frames.  If we're not able to
  send a frame, make sure to prepend it to if_snd queue such that
  alt(4) should work.

  While I'm here prefer ETHER_BPF_MTAP to BPF_MTAP.  ETHER_BPF_MTAP
  should be used for controllers that support VLAN hardware tag
  insertion.  The controller supports VLAN tag insertion but lacks
  VLAN tag stripping in RX path though.

r228297:
  et(4) supports VLAN oversized frame so correctly set header length.
  While I'm here remove initializing if_mtu, it is set by
  ether_ifattach(9).  Also move callout_init_mtx(9) to the right below
  driver lock initialization.

r228298:
  Make et_probe() return BUS_PROBE_DEFAULT such that allow other
  driver that has high precedence for the controller override et(4).
  Add missing callout_drain(9) in device detach and rework detach
  routine.  While I'm here use rman_get_rid(9) instead of using
  cached resource id because bus methods are free to change the
  id.

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

12 years agoMFC 228967:
jhb [Fri, 6 Jan 2012 16:57:29 +0000 (16:57 +0000)]
MFC 228967:
Update if_obytes and if_omcast after successful transmit.
While I'm here update if_oerrors if parent interface of vlan is not
up and running.  Previously it updated collision counter and it was
confusing to interprete it.

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

12 years agoMFC r227954:
trociny [Fri, 6 Jan 2012 16:46:52 +0000 (16:46 +0000)]
MFC r227954:

Add const qualifier to rlimit_ident.

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

12 years agoMFC r228838:
kib [Fri, 6 Jan 2012 11:06:48 +0000 (11:06 +0000)]
MFC r228838:
Optimize the common case of msyncing the whole file mapping with
MS_SYNC flag.

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

12 years agoMFC r227488:
eadler [Fri, 6 Jan 2012 02:27:43 +0000 (02:27 +0000)]
MFC r227488:

- add "check" option to MD5 and friends to compare files against known hash.

Approved by: cperciva

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

12 years agoMFC: r227796
rmacklem [Fri, 6 Jan 2012 02:23:33 +0000 (02:23 +0000)]
MFC: r227796
Clean up some cruft in the NFSv4 client left over from the
OpenBSD port, so that it is more readable. No logic change
is made by this commit.

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

12 years agoMFC: r227760
rmacklem [Fri, 6 Jan 2012 01:20:48 +0000 (01:20 +0000)]
MFC: r227760
Add two arguments to the nfsrpc_rellockown() function in the NFSv4
client. This does not change the client's behaviour, but prepares
the code so that nfsrpc_rellockown() can be called elsewhere in a
future commit.

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

12 years agoMFC r226617 (pjd):
mm [Thu, 5 Jan 2012 22:31:25 +0000 (22:31 +0000)]
MFC r226617 (pjd):

zfs vdev_file_io_start: validate vdev before using vdev_tsd

vdev_tsd can be NULL for certain vdev states.
At least in userland testing with ztest.

Submitted by: avg

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

12 years agoMFC ZFS userland to reduce diff with stable/9:
mm [Thu, 5 Jan 2012 22:28:40 +0000 (22:28 +0000)]
MFC ZFS userland to reduce diff with stable/9:
r224170, r224526, r226583, r226613, r226615, r226616

MFC r224170 (gibbs):
Correct reporting of missing leaf vdevs so that the GUID required to
perform pool actions is always displayed.

cddl/contrib/opensolaris/cmd/zpool/zpool_main.c:
The "zpool status" command reports the "last seen at"
device node path when the vdev name is being reported
by GUID.  Augment this code to assume a GUID is reported
when a device goes missing after initial boot in addition
to the previous behavior of doing this for devices that
aren't seen at boot.

cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c:
In zpool_vdev_name(), report recently missing devices
by GUID.  There is no guarantee they will return at
their previous location.

MFC r224526 (mm, userland part only):
Fix serious bug in ZIL that can lead to pool corruption
in the case of a held dataset during remount.

Detailed description is available at:
https://www.illumos.org/issues/883

illumos-gate revision: 13380:161b964a0e10

MFC r226583 (pjd):
Make all the lines align properly.

MFC r226613 (pjd) [1]:
libzpool task_alloc: pass only valid flags to kmem_alloc

tqflags may contain other flags besided those that are suitable for
kmem_alloc == umem_alloc

MFC r226615 (pjd) [1]:
thr_create: new_thread_ID may be NULL

MFC r226616 (pjd) [1]:
zdb: access dp_free_bpobj only if pool version is >= SPA_VERSION_DEADLISTS

Submitted by: avg [1]

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

12 years agoMFC 227577: The sys/sysctl.h header is needed when MFI_DEBUG is defined.
jhb [Thu, 5 Jan 2012 22:14:49 +0000 (22:14 +0000)]
MFC 227577: The sys/sysctl.h header is needed when MFI_DEBUG is defined.

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

12 years agoMFC r228286:
yongari [Thu, 5 Jan 2012 21:17:06 +0000 (21:17 +0000)]
MFC r228286:
  Fix off by one error in mbuf access.  Previously it caused panic.
  While I'm here use NULL to compare mbuf pointer and add additional
  check for zero length mbuf before accessing the mbuf.

  PR: kern/162932

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

12 years agoMFC 224169 (gibbs):
jhb [Thu, 5 Jan 2012 20:41:40 +0000 (20:41 +0000)]
MFC 224169 (gibbs):
cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h:
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c:
o Add zpool_pool_state_to_name() API to libzfs which converts a
  pool_state_t into a user consumable string.
o While here, correct constness of make zpool_state_to_name()
  and zpool_label_disk().

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

12 years agoMFC r228205:
yongari [Thu, 5 Jan 2012 20:37:28 +0000 (20:37 +0000)]
MFC r228205:
  Add more controllers that support jumbo frame.

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

12 years agoMFC r228086:
yongari [Thu, 5 Jan 2012 20:31:58 +0000 (20:31 +0000)]
MFC r228086:
  Announce flow control capability to PHY drivers and enable flow
  control for all vr(4) controllers that support it.  It's known that
  old vr(4) controllers(Rhine II) does not support TX pause but Rhine
  III supports both TX and RX pause.
  Make TX pause really work on Rhine III by letting controller know
  available RX buffers.
  While here, adjust XON/XOFF parameters to get better performance
  with flow control.

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

12 years agoMFC 228866:
jhb [Thu, 5 Jan 2012 19:56:54 +0000 (19:56 +0000)]
MFC 228866:
Fix a bug where TAILQ_FIRST(&V_ifnet) was accessed without holding the
proper lock.

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

12 years agoMFC 228593:
jhb [Thu, 5 Jan 2012 19:53:17 +0000 (19:53 +0000)]
MFC 228593:
Fire a kevent if necessary after seeking on a regular file.  This fixes a
case where a kevent would not fire on a regular file if an application read
to EOF and then seeked backwards into the file.

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

12 years agoMFC 228089:
jhb [Thu, 5 Jan 2012 19:50:47 +0000 (19:50 +0000)]
MFC 228089:
Change the if_vlan driver to use if_transmit for forwarding packets to the
parent interface.  This avoids the overhead of queueing a packet to an IFQ
only to immediately dequeue it again.

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

12 years agoMFC 228361:
jhb [Thu, 5 Jan 2012 19:36:38 +0000 (19:36 +0000)]
MFC 228361:
Explicitly use curthread while manipulating td_fpop during last close
of a devfs file descriptor in devfs_close_f().  The passed in td argument
may be NULL if the close was invoked by garbage collection of open
file descriptors in pending control messages in the socket buffer of a
UNIX domain socket after it was closed.

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

12 years agoMFC 228496:
jhb [Thu, 5 Jan 2012 19:18:41 +0000 (19:18 +0000)]
MFC 228496:
Implement BUS_ADD_CHILD() for the isab(4) driver.  It already calls
bus_generic_probe() and bus_generic_attach() to handle drivers that add
new children via identify methods.

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

12 years agoMFC 228278:
jhb [Thu, 5 Jan 2012 19:14:11 +0000 (19:14 +0000)]
MFC 228278:
Use the correct volume identifier field when parsing MR_EVT_ARG_LD_STRIP
arguments.

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

12 years agoMFC 228207:
jhb [Thu, 5 Jan 2012 18:56:23 +0000 (18:56 +0000)]
MFC 228207:
When changing the user priority of a thread, change the real priority
in addition to the user priority for threads whose current real priority
is equal to the previous user priority or if the new priority is a
real-time priority.  This allows priority changes of other threads to
have an immediate effect.

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

12 years agoMFC 228185:
jhb [Thu, 5 Jan 2012 18:50:37 +0000 (18:50 +0000)]
MFC 228185:
Enhance the sequential access heuristic used to perform readahead in the
NFS server and reuse it for writes as well to allow writes to the backing
store to be clustered.

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

12 years agoMFC 228181:
jhb [Thu, 5 Jan 2012 18:38:23 +0000 (18:38 +0000)]
MFC 228181:
If the -d flag is specified, ignore any new values specified and only
display the descriptions of specified nodes.

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

12 years agoMFC 227562:
jhb [Thu, 5 Jan 2012 18:31:08 +0000 (18:31 +0000)]
MFC 227562:
Add single-message MSI support to mfi(4).  It is disabled by default but
can be enabled via the hw.mfi.msi tunable.  Many mfi(4) controllers also
support MSI-X, but in testing it seems that many adapters do not work with
MSI-X but do work with MSI.

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

12 years agoMFC 227507: Finish making 'wcommitsize' an NFS client mount option.
jhb [Thu, 5 Jan 2012 18:26:44 +0000 (18:26 +0000)]
MFC 227507: Finish making 'wcommitsize' an NFS client mount option.

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

12 years agoMFC r228084:
yongari [Thu, 5 Jan 2012 18:22:48 +0000 (18:22 +0000)]
MFC r228084:
  Reuse flag variable to represent driver internal states rather than
  using member variables in softc.
  While I'm here change media after setting IFF_DRV_RUNNING. This
  will remove unnecessary link state handling in vr_tick() if
  controller established a link immediately.

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

12 years agoMFC: r227744
rmacklem [Thu, 5 Jan 2012 17:20:03 +0000 (17:20 +0000)]
MFC: r227744
Since the nfscl_cleanup() function isn't used by the FreeBSD NFSv4 client,
delete the code and fix up the related comments. This should not have
any functional effect on the client.

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

12 years agoMFC r228797:
mm [Thu, 5 Jan 2012 12:57:14 +0000 (12:57 +0000)]
MFC r228797:
Use contrib sources for building libarchive, tar and cpio.
Make "make test" fully operational.

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

12 years agoMFC contrib/libarchive:
mm [Thu, 5 Jan 2012 12:07:42 +0000 (12:07 +0000)]
MFC contrib/libarchive:
r228761-r228764, r228770-r228777, r228835, r228911:

MFC r228761:
Copy libarchive from vendor branch to contrib

MFC r228762:
Add FREEBSD-Xlist and FREEBSD-upgrade to contrib/libarchive

MFC r228763:
Set svn:keywords to FreeBSD=%H for contrib/libarchive

MFC r228764:
Strip unnecessary files and directories from contrib/libarchive
according to FREEBSD-Xlist

MFC r228770:
Remove libarchive/archive_entry_copy_bhfi.c and libarchive/mtree.5
Add these files to FREEBSD-Xlist

MFC r228771:
Partial merge of r224691 from lib/libarchive:

Add compatibility for ISO images created with unfixed makefs that
violated ECMA-119 (ISO9660): allow reserved4 to be 0x20 in PVD.
This allows tar to read FreeBSD distribution ISO images created
with makefs prior to NetBSD bin/45217 bugfix (up to 9.0-BETA1).

MFC r228772:
Add missing integer casts to comparsions in libarchive read.

MFC r228773:
Merge FreeBSD changes from lib/libarchive to contrib/libarchive:

r204111 (uqs):
Fix common misspelling of hierarchy

r208027 (uqs):
mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

r208291 (uqs):
mdoc: consistently spell our email addresses <foo@FreeBSD.org>

r209031 (uqs):
mdoc nitpicking: the title argument shall be uppercase

r214822 (kientzle):
Clarify the naming:  Methods that free an object should
be called "free".  Retain the old "finish" names to preserve
source compatibility for now.

r214905 (kientzle):
If the Zip reader doesn't see a PK signature block
because there's inter-entry garbage, just scan forward
to find the next one.  This allows us to handle a lot
of Zip archives that have been modified in-place.

Thanks to: Gleb Kurtsou for sending me a sample archive

r216258 (kientzle):
Don't write data into an empty "file."

In particular, this check avoids a warning when
extracting directory entries from certain GNU tar
archives that store directory contents.

r225525 (kientzle):
Fix cpio on ARM.

MFC r228774:
Add $FreeBSD$ to libarchive_fe headers where missing.

MFC r228775:
Merge FreeBSD changes from usr.bin/tar to contrib/libarchive/libarchive_fe:

r213469:
Recognize both ! and ^ as markers for negated character classes.

MFC r228776:
Merge FreeBSD changes from usr.bin/tar to contrib/libarchive/tar:

r204111 (uqs):
Fix common misspelling of hierarchy

r207786 (kientzle):
Various manpage updates, including many long-option synonyms that were
previously undocumented.

r208028 (uqs):
mdoc: move remaining sections into consistent order

This pertains mostly to FILES, HISTORY, EXIT STATUS and AUTHORS sections.

r209152 (kientzle):
If the compressed data is larger than the uncompressed,
report the compression ratio as 0% instead of displaying
nonsense triggered by numeric overflow.  This is common
when dealing with uncompressed files when the I/O blocking
causes there to be small transient differences in the
accounting.

r210720 (joel):
Fix typos.

r223541 (kientzle):
If there is a read error reading Y/N confirmation from the keyboard,
exit immediately with an error.

If there is an error opening or reading a file to put into the archive,
set the return value for a deferred error exit.

r223573 (kientzle):
The --newer-than test should descend into old
directories to look for new files.

r226636 (kientzle):
Typo from previous commit. Urgh.

r224153 (mm, partial):
Update bsdtar.1 manpage

MFC r228777:
Merge FreeBSD changes from usr.bin/cpio to contrib/libarchive/cpio:

r204111 (uqs):
Fix common misspelling of hierarchy

r211054 (kientzle);
Fix -R when used with -p.  Previously, the
uname and gname weren't overwritten, so the
disk restore would use those to lookup the
original uid/gid again.  Clearing the uname
and gname prevents this.

r212263 (gjb):
Fix typo in bsdcpio manual:
s/libarchive_formats/libarchive-formats

MFC r228835:
Fix typo s/xz/libarchive/

Reported by: Emil Mikulic (private e-mail)

MFC r228911:
Update to vendor revision 4016.

Vendor has integrated most of our local changes in revisions 3976-3979 so
future updates are going to be easier.
Thanks to Tim Kientzle <kientzle@FreeBSD.org>.

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

12 years agoMFC r228744, r228745, r228748:
mm [Thu, 5 Jan 2012 11:45:22 +0000 (11:45 +0000)]
MFC r228744, r228745, r228748:

MFC r228744 [1]:
Merge vendor revision 3723:
Fixes extraction of Zip entries that use length-at-end without specifying
either the compressed or uncompressed length.  In particular, fixes bsdtar
extraction of such files.

Reported by: Patrick Lamaiziere <patfbsd@davenulle.org> (freebsd-stable@)

MFC r228745:
Update libarchive, tar and cpio to version 2.8.5

The following additional vendor revisions are applied:

Revision 3740:
Use archive_clear_error() to clear the error markers.

Obtained from: http://code.google.com/p/libarchive

MFC r228748:
Sync libarchive with vendor branch release/2.8:

3730:
Fix issue 174 (Windows path names, not relevant for FreeBSD)

3734:
Merge r1989: archive_clear_error should set errno to 0.

3735:
Merge r3247 from trunk: Clear errors before returning
from archive_read_support_format_all()

3799:
Check the position before dereferencing the pointer.
This avoids dereferencing one byte past the end of a string

3824:
Merge r3823 from trunk for issue 199 (hang in iso9660 reading)

Obtained from: http://code.google.com/p/libarchive

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

12 years agoMFC r200257 (by mav):
kib [Thu, 5 Jan 2012 11:14:54 +0000 (11:14 +0000)]
MFC r200257 (by mav):
Add ID for NetMos NM9820 Serial Port chip, found on CardBus serial adapter.

MFC r228947:
Add PCI Id for the Intel AMT serial interface as found on my DQ67OW.

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

12 years agoMFC r228206, r228353:
mm [Thu, 5 Jan 2012 11:12:02 +0000 (11:12 +0000)]
MFC r228206, r228353:

MFC r228206:
Remove unnecesary "Ns" macros and add missing command example to zpool(8).

MFC r228353:
Some mdoc(7) style and typo fixes to zfs(8).

Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>

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

12 years agoMFC r228103, r228104:
mm [Thu, 5 Jan 2012 11:07:07 +0000 (11:07 +0000)]
MFC r228103, r228104:

MFC r228103:
Merge new ZFS features from illumos:

1644 add ZFS "clones" property
https://www.illumos.org/issues/1644

1645 add ZFS "written" and "written@..." properties
https://www.illumos.org/issues/1645

1646 "zfs send" should estimate size of stream
https://www.illumos.org/issues/1646

1647 "zfs destroy" should determine space reclaimed by destroying multiple
snapshots
https://www.illumos.org/issues/1647

1693 persistent 'comment' field for a zpool
https://www.illumos.org/issues/1693

1708 adjust size of zpool history data
https://www.illumos.org/issues/1708

1748 desire support for reguid in zfs
https://www.illumos.org/issues/1748

MFC r228104:
Fix typo in copyright notice.

Obtained from: illumos (changesets 13514, 13524, 13525)

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

12 years agoMFC zfs manpage update
mm [Thu, 5 Jan 2012 10:55:55 +0000 (10:55 +0000)]
MFC zfs manpage update
(r227646, r227648, r227649, r227752, r228019, r228045, r228054, r228055)

MFC r227646 (partial):
Update and desolarization of zfs(8) and zpool(8) manual pages:
- synchronized to match new vendor code (Illumos rev. 13513) [1]
- removed references to sun commands (replaced with FreeBSD commands)
- removed ATTRIBUTES sections
- updated SEE ALSO sections
- properly updated copyright information (required by CDDL)

zfs(8) only:
- replaced "Zones" section with new "Jails" section
- removed misleading "ZFS Volumes as Swap or Dump Devices" section
- updated shareiscsi and sharesmb option information (not supported on FreeBSD)
- replace zoned property with jailed property

zpool(8) only:
- updated device names in examples

MFC r227648:
Fix reference to fsync(2).
Add more references to SEE ALSO section.

MFC r227649:
More zfs(8) manpage fixes:
- remove shareiscsi property
- mark casesensitivity property as unsupported
- remove reference to Solaris Administration Guide

MFC r227752 (partial):
Update and desolarization of zdb(8) and zstreamdump(1) manual pages:
- synchronized to match new vendor code [1]
- removed ATTRIBUTES sections
- updated SEE ALSO sections
- properly updated copyright information (required by CDDL)

MFC r228019:
Update ZFS manual pages to a mdoc(7) reimplementation.

The zfs(8) and zpool(8) manual pages now match the state of the ZFS module
and have been customized for FreeBSD.

The new texts of the "Deduplication" subsection in zfs(8), the zpool "split"
command, the zfs "dedup" property and several other missing parts have been
added from illumos or OpenSolaris snv_134 (CDDL-licensed).

The mdoc(7) reimplementation of whole manual pages, the descriptions of the
zpool "readonly" property, "zfs diff" command and descriptions of several
other missing command flags and/or options were authored by myself.

MFC r228045:
Add missing -n flag to "zpool import" description.

MFC r228054:
Add missing warning to zfs(8) for using "zfs destroy" with -r and -R flags.

MFC r228055:
Use singular form for zfs destroy snapshot in zfs(8).

Obtained from: Illumos (as of rev. 13513:f84d4672fdbd) [1]

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

12 years agoMFC r224171 (gibbs):
mm [Thu, 5 Jan 2012 10:24:06 +0000 (10:24 +0000)]
MFC r224171 (gibbs):
Add the "zpool labelclear" command.  This command can be
used to wipe the label data from a drive that is not
active in a pool.  The optional "-f" argument can be
used to treat an exported or foreign vdev as "inactive"
thus allowing its label information to be cleared.

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

12 years agoMFC r226620, r228392:
mm [Thu, 5 Jan 2012 10:09:22 +0000 (10:09 +0000)]
MFC r226620, r228392:

MFC r226620 (pjd):
Update per-thread I/O statistics collection in ZFS.
This allows to see processes I/O activity in 'top -m io' output.

MFC r228392 (pjd):
Move ru_inblock increment into arc_read_nolock() so we don't account for
cached reads.

PR: kern/156218
Reported by: Marcus Reid <marcus@blazingdot.com>
Patch by: avg
Approved by: pjd

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

12 years agoMFC r227110, r227111:
mm [Thu, 5 Jan 2012 09:50:47 +0000 (09:50 +0000)]
MFC r227110, r227111:

MFC r227110 (pjd) [1]:
In zvol_open() if the spa_namespace_lock is already held, it means that
ZFS is trying to open and taste ZVOL as its VDEV. This is not supported,
so return an error instead of panicing on spa_namespace_lock recursion.

MFC r227111 (pjd) [2]:
Correct typo in comment.

PR: kern/162008
Reported by: Robert Millan <rmh@debian.org> [1]
Fabian Keil <fk@fabiankeil.de> [2]

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

12 years agoMFC r226676, r226678, r226700, r226705, r226706, r226707:
mm [Thu, 5 Jan 2012 09:39:29 +0000 (09:39 +0000)]
MFC r226676, r226678, r226700, r226705, r226706, r226707:

MFC r226676 (pjd):
Allow to rename file systems without remounting if it is possible.
It is possible for file systems with 'mountpoint' preperty set to 'legacy'
or 'none' - we don't have to change mount directory for them.
Currently such file systems are unmounted on rename and not even mounted back.

This introduces layering violation, as we need to update 'f_mntfromname'
field in statfs structure related to mountpoint (for the dataset we are
renaming and all its children).

In my opinion it is worth it, as it allow to update FreeBSD in even cleaner
way - in ZFS-only configuration root file system is ZFS file system with
'mountpoint' property set to 'legacy'. If root dataset is named system/rootfs,
we can snapshot it (system/rootfs@upgrade), clone it (system/oldrootfs),
update FreeBSD and if it doesn't boot we can boot back from system/oldrootfs
and rename it back to system/rootfs while it is mounted as /. Before it was
not possible, because unmounting / was not possible.

MFC r227768 (pjd):
Include <sys/zfs_vfsops.h> only when compiling kernel module.

MFC r226700 (pjd):
Don't forget to rename mounted snapshots of the file system being renamed.

MFC r226705 (pjd):
Extend r226676 to allow rename without unmount even for file systems with
non-legacy mountpoints. It is better to be able to rename such file systems and
let them be mounted in old places until next reboot than using live CD, etc. to
rename with remount.

This is implemented by adding -u option to 'zfs rename'. If file system's
mountpoint property is set to 'legacy' or 'none', there is no need to specify -u.

Update zfs(8) manual page to reflect this addition.

MFC r226706 (pjd):
Update copyright to include myself.

MFC r226707 (pjd):
- Use better naming now that we allow to rename any mounted file system (not
  only legacy).
- Update copyright to include myself.

Approved by: pjd

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

12 years agoMFC r227497, r228020:
mm [Thu, 5 Jan 2012 08:54:15 +0000 (08:54 +0000)]
MFC r227497, r228020:

MFC r227497 [1]:
Import upstream changesets for the output of the "zpool" command:

952 separate intent logs should be obvious in 'zpool iostat' output
1337 `zpool status -D' should tell if there are no DDT entries

References:
https://www.illumos.org/issues/952
https://www.illumos.org/issues/1337

MFC r228020:
Fix zfs(8) and zpool(8) context help to repport supported flags.

Obtained from: Illumos (issues 952, 1337; changesets 13384, 13432) [1]

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

12 years agoMFC r227458, r226436:
eadler [Thu, 5 Jan 2012 04:50:28 +0000 (04:50 +0000)]
MFC r227458, r226436:

- change "is is" to "is" or "it is"
- change "the the" to "the"
- other typo fixes

Approved by: lstewart

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

12 years agoMFC: r227743
rmacklem [Thu, 5 Jan 2012 02:05:15 +0000 (02:05 +0000)]
MFC: r227743
Post r223774 the NFSv4 client never uses the linked list with the
head nfsc_defunctlockowner. This patch simply removes the code that
loops through this always empty list, since the code no longer does
anything useful. It should not have any effect on the client's
behaviour.

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

12 years agoMFC r227842:
yongari [Thu, 5 Jan 2012 00:09:49 +0000 (00:09 +0000)]
MFC r227842:
  For IP1001 PHY, do not set multi-port device(MASTER).  Ideally this
  bit should not affect link establishment process of auto-negotiation
  if manual configuration is not used, which is true in auto-negotiation.
  However it seems setting this bit interfere with IP1001 PHY's
  down-shifting feature such that establishing a 10/100Mbps link failed
  when 1000baseT link is not available during auto-negotiation process.

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

12 years agoMFC r227828,227835,227837:
yongari [Thu, 5 Jan 2012 00:00:30 +0000 (00:00 +0000)]
MFC r227828,227835,227837:
r227828:
  Always start MII auto polling before accessing any MII registers.

r227835:
  Rework link establishment and link state detection logic.
   - Remove MIIBUS statchg callback and program VGE_DIAGCTL before
     initiating link establishment.  Previously driver used to
     program VGE_DIAGCTL after getting a link in statchg callback.
     It seems the VGE_DIAGCTL register works like a kind of MII
     register such that it requires setting a 'to be' mode in advance
     rather than relying on resolved speed/duplex of established link.
     This means the statchg callback is not needed in driver.  In
     addition, if there was no link at the time of media change, this
     was not called at all.
   - Introduce vge_ifmedia_upd_locked() to change current media to
     configured one.  Actual media change is performed only after PHY
     reset and VGE_DIAGCTL setup.
   - In WOL configuration, make sure to clear forced mode such that
     controller can rely on auto-negotiation.
   - Unlike most other drivers that use miibus(4), vge(4) used
     controller's auto-polling feature for link state tracking via
     interrupt.  This came from controller's inefficient mechanism to
     access MII registers.  On link state change interrupt, vge(4)
     used to get current link state with series of MII register
     accesses.  Because vge(4) already enabled auto polling, read PHY
     status register to resolved speed/duplex/flow control parameters.

  vge(4) still does not drive MII_TICK to reduce number of MII
  register accesses which in turn means the driver does not know the
  status of auto-negotiation.  This was a one of long standing
  issue of vge(4).  Probably driver may be able to implement a timer
  that keeps track of auto-negotiation state and restart
  auto-negotiation when driver couldn't establish a link within a
  specified period.  However the controller does not provide a
  reliable way to detect auto-negotiation failure so I'm not sure
  whether it's worth to implement it in driver.

  Alternatively driver can completely disable MII auto-polling and
  let miibus(4) poll link state by driving MII_TICK.  This may reduce
  unnecessary overhead of stopping/restarting MII auto-polling of
  controller.  Unfortunately it was known that some variants of
  controller does not work correctly if MII auto-polling is disabled.

r227837:
  Announce flow control capability to underlying PHY driver.
  Pause timer value is initialized to 0xFFFF. Controller allows just
  4 different TX pause thresholds. The lowest possible threshold
  value looks too aggressive so use next available threshold value.

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

12 years agoMFC r227850-227851,227854,227914,227916:
yongari [Wed, 4 Jan 2012 23:31:43 +0000 (23:31 +0000)]
MFC r227850-227851,227854,227914,227916:
r227850:
  Writing access to RL_CFG5 register also requires EEPROM write
  access.
  While I'm here, enable WOL through magic packet but disable waking
  up system via unicast, multicast and broadcast frames.  Otherwise,
  multicast or unicast frame(e.g. ICMP echo request) can wake up
  system which is not probably wanted behavior on most environments.
  This was not known as problem because RL_CFG5 register access had
  not effect until this change.
  The capability to wake up system with unicast/multicast frames
  are still set in driver, default off, so users who need that
  feature can still activate it with ifconfig(8).

r227851:
  Perform media change after setting IFF_DRV_RUNNING flag. Without it,
  driver would ignore the first link state update if controller
  already established a link such that it would have to take
  additional link state handling in re_tick().

r227854:
  Disable accepting frames in re_stop() to put RX MAC into idle state.
  Because there is no reliable way to know whether RX MAC is in
  stopped state, rejecting all frames would be the only way to
  minimize possible races.
  Otherwise it's possible to receive frames while stop command
  execution is in progress and controller can DMA the frame to freed
  RX buffer during that period.
  This was observed on recent PCIe controllers(i.e. RTL8111F).

  While this change may not be required on old controllers it
  wouldn't make negative effects on old controllers.  One side effect
  of this change is disabling receive so driver reprograms RL_RXCFG
  to receive WOL frames when it is put into suspend or shutdown.

  This should address occasional 'memory modified free' errors seen
  on recent RealTek controllers.

r227914:
  Make sure to stop TX MAC before freeing queued TX frames.
  For RTL8111DP, check if the TX MAC is active by reading RL_GTXSTART
  register.  For RTL8402/8168E-VL/8168F/8411, wait until TX queue is
  empty.

r227916:
  To save more power, switch to 10/100Mbps link when controller is
  put into suspend/shutdown.  Old PCI controllers performed that
  operation in firmware but for RTL8111C or newer controllers, it's
  responsibility of driver.  It's not clear whether the firmware of
  RTL8111B still downgrades its speed to 10/100Mbps so leave it as it
  was.

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

12 years agoMFC r227587,227590-227591,227593,227638-227639:
yongari [Wed, 4 Jan 2012 22:55:15 +0000 (22:55 +0000)]
MFC r227587,227590-227591,227593,227638-227639:
r227587:
  Add preliminary support for RTL8402 PCIe FastEthernet with
  integrated card reader.

r227590:
  Add preliminary support for RTL8411 PCIe Gigabit ethernet with
  integrated card reader.

r227591:
  Add missing driver lock in SIOCSIFCAP handler.

r227593:
  Disable PCIe ASPM (Active State Power Management) for all
  controllers.
  More and more RealTek controllers started to implement EEE feature.
  Vendor driver seems to load a kind of firmware for EEE with
  additional PHY fixups.  It is known that the EEE feature may need
  ASPM support.  Unfortunately there is no documentation for EEE of
  the controller so enabling ASPM may cause more problems.

r227638:
  Add preliminary support for second generation RTL8105E PCIe
  FastEthernet.

r227639:
  Add preliminary support for RTL8168/8111F PCIe Gigabit ethernet.

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

12 years agoMFC: r228898
brueffer [Wed, 4 Jan 2012 21:57:11 +0000 (21:57 +0000)]
MFC: r228898

Add missing -l flag to usage().

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

12 years agoMFC r227582:
yongari [Wed, 4 Jan 2012 21:52:56 +0000 (21:52 +0000)]
MFC r227582:
  Enable 64bit DMA addressing support for all msk(4) controllers.
  Unnecessarily complex LE format used on Marvell controller was
  main reason not to enable 64bit DMA addressing in driver.  If high
  32bit address of DMA address of TX/RX buffer is changed, driver has
  to generate a new LE.  In TX path, driver will keep track of lastly
  used high 32bit address of DMA address and generate a new LE
  whenever it sees high address change in the DMA address. In RX path,
  driver will always use two LEs to specify 64bit DMA address of RX
  buffer.  If the high 32bit address of DMA address of RX buffer is
  the same as previous DMA address of RX buffer, driver does not have
  to use two LEs but driver will use two LEs for simplicity in RX
  ring management.

  One of draw back for switching to 64bit DMA addressing is that the
  large amount of LEs are used to specify 64bit DMA address such that
  number of available LEs for TX/RX buffers are considerably reduced.
  To mitigate the issue, increase number of available LEs from 256 to
  384 for TX and from 256 to 512 for RX. For 32bit architectures,
  msk(4) does not use 64bit DMA addressing to save resources.

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

12 years agoMFC r227452:
yongari [Wed, 4 Jan 2012 21:27:03 +0000 (21:27 +0000)]
MFC r227452:
  To send a frame, controller requires a prepended TX header and
  the length of frame should be treated as multiple of 4. Actual
  frame length is set in the TX header. The TX header position
  should be aligned on 4 byte boundary and actual frame start
  position should be aligned on 4 byte boundary as well. This means
  we need 4(TX header length) + 3(frame length fixup) additional free
  space in TX buffer in addition to actual frame length.
  Make sure TX handler check these additional bytes.
  ae_tx_avail_size() returns actual free space in TX buffer to ease
  the calculation of available TX buffer space in caller. While I'm
  here, replace magic number to appropriate sizeof operator to
  enhance readability.

  This change should fix controller lockup issue happened under
  certain conditions but it still does not fix watchdog timeout. It
  seems the watchdog timeout is side-effect of TxS and TxD
  mismatches. The root cause of TxD/TxD mismatch is not known yet but
  it looks like silicon bug. I guess driver may have to reinitialize
  controller whenever it sees TxS and TxD mismatches but leave it as
  it was at this moment.

  PR: kern/145918

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

12 years agoRegen src.conf(5) after merge of WITHOUT_INET{,_SUPPORT} in r229514.
bz [Wed, 4 Jan 2012 19:53:32 +0000 (19:53 +0000)]
Regen src.conf(5) after merge of WITHOUT_INET{,_SUPPORT} in r229514.

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

12 years agoMFC r221266:
bz [Wed, 4 Jan 2012 19:50:10 +0000 (19:50 +0000)]
MFC r221266:

 Introduce two new options MK_INET and MK_INET_SUPPORT analogically
 with INET6 equivalents.

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

12 years agoMFC r219843, r225773, r225781, r225782, r225783, r225784, 225785, r225786,
trociny [Wed, 4 Jan 2012 17:25:41 +0000 (17:25 +0000)]
MFC r219843, r225773, r225781, r225782, r225783, r225784, 225785, r225786,
  r225787, r225830, r225831, r225832, r225835, r226461, r226462, r226463,
  r226842, r226851, r226852, r226854, r226855, r226856, r226857, r226859,
  r226861, r228542, r228542, r228543, r228544, r228695, r228696:

r219843 (pjd):

Fix typo.

r225773 (pjd):

Ensure that pjdlog functions don't modify errno.

r225781 (pjd):

No need to use KEEP_ERRNO() macro around pjdlog functions, as they don't
modify errno.

r225782 (pjd):

Prefer PJDLOG_ASSERT() and PJDLOG_ABORT() over assert() and abort().
pjdlog versions will log problem to syslog when application is running in
background.

r225783 (pjd):

Correct two mistakes when converting asserts to PJDLOG_ASSERT()/PJDLOG_ABORT().

r225784 (pjd):

- Convert some impossible conditions into assertions.
- Add missing 'if' in comment.

r225785 (pjd):

Prefer PJDLOG_ASSERT()/PJDLOG_ABORT() over assert().

r225786 (pjd):

No need to wrap pjdlog functions around with KEEP_ERRNO() macro.

r225787 (pjd):

Use PJDLOG_ASSERT() and PJDLOG_ABORT() everywhere instead of assert().

r225830 (pjd):

After every activemap change flush disk's write cache, so that write
reordering won't make the actual write to be committed before marking
the coresponding extent as dirty.

It can be disabled in configuration file.

If BIO_FLUSH is not supported by the underlying file system we log a warning
and never send BIO_FLUSH again to that GEOM provider.

r225831 (pjd):

Break a bit earlier.

r225832 (pjd):

If the underlying provider doesn't support BIO_FLUSH, log it only once
and don't bother trying in the future.

r225835 (pjd):

Correct typo.

r226461 (pjd):

When path to the configuration file is relative, obtain full path,
so we can always find the file, even after daemonizing and changing
working directory to /.

r226462 (pjd):

Remove redundant space.

r226463 (pjd):

Allow to specify pidfile in HAST configuration file.

r226842 (pjd):

Correct comments.

r226851 (pjd):

Delay resuid generation until first connection to secondary, not until first
write. This way on first connection we will synchronize only the extents that
were modified during the lifetime of primary node, not entire GEOM provider.

r226852 (pjd):

Minor cleanups.

r226854 (pjd):

- Eliminate the need for hio_nv.
- Introduce hio_clear() function for clearing hio before returning it
  onto free queue.

r226855 (pjd):

Improve comment so it doesn't suggest race is possible, but that we handle
the race.

r226856 (pjd):

Reduce indentation.

r226857 (pjd):

Minor cleanups.

r226859 (pjd):

Implement 'async' mode for HAST.

r226861 (pjd):

Remove redundant space.

r228542 (pjd):

Remove redundant setting of the error variable.

Found by:       Clang Static Analyzer

r228543 (pjd):

Simplify code by changing functions types from int to avoid, as the functions
always return 0.

Found by:       Clang Static Analyzer

r228544 (pjd):

Remove redundant assignment.

Found by:       Clang Static Analyzer

r228695 (pjd):

Don't use function name as format string.

Detected by:    clang

r228696 (pjd):

Use lex's standard way of not generating unused function.

Inspired by:    r228555

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

12 years agoMFC 227069:
jhb [Wed, 4 Jan 2012 16:51:04 +0000 (16:51 +0000)]
MFC 227069:
Move the cleanup of f_cdevpriv when the reference count of a devfs
file descriptor drops to zero out of _fdrop() and into devfs_close_f()
as it is only relevant for devfs file descriptors.

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

12 years agoMFC 226748:
jhb [Wed, 4 Jan 2012 16:45:12 +0000 (16:45 +0000)]
MFC 226748:
- Add a new header for the x86 boot code that defines various structures
  and constants related to the BIOS Enhanced Disk Drive Specification.
- Use this header instead of magic numbers and various duplicate structure
  definitions for doing I/O.
- Use an actual structure for the request to fetch drive parameters in
  drvsize() rather than a gross hack of a char array with some magic
  size.  While here, change drvsize() to only pass the 1.1 version of
  the structure and not request device path information.  If we want
  device path information you have to set the length of the device
  path information as an input (along with probably checking the actual
  EDD version to see which size one should use as the device path
  information is variable-length).  This fixes data smashing problems
  from passing an EDD 3 structure to BIOSes supporting EDD 4.

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