]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
11 years agoMFC r243562:
pfg [Sat, 1 Dec 2012 02:02:19 +0000 (02:02 +0000)]
MFC r243562:
Update some definitions or make them match NetBSD's headers.

Bring several definitions required for newer ext4 features.

Rename EXT2F_COMPAT_HTREE to EXT2F_COMPAT_DIRHASHINDEX since it
is not being used yet and the new name is more compatible with
NetBSD and Linux.

This change is purely cosmetic.

Obtained from: NetBSD

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

11 years agoMFC: r241569
rmacklem [Sat, 1 Dec 2012 01:16:40 +0000 (01:16 +0000)]
MFC: r241569
Document the -S option added by r241568.

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

11 years agoMFC: r241568
rmacklem [Sat, 1 Dec 2012 01:11:59 +0000 (01:11 +0000)]
MFC: r241568
Add a new '-S' option to mountd, which tells it to suspend
execution of the nfsd threads while it is reloading the exports.
This avoids clients from getting intermittent access errors
when the exports are being reloaded non-atomically.
It is not an ideal solution, since requests will back up while
the nfsd threads are suspended. Also, when this option is used,
if mountd crashes while reloading exports, mountd will have to
be restarted to get the nfsd threads to resume execution.
This has been tested by Vincent Hoffman (vince at unsane.co.uk)
and John Hickey (jh at deterlab.net).
The nfse patch offers a more comprehensive solution for this issue.

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

11 years agoMFC: r241561
rmacklem [Sat, 1 Dec 2012 01:07:51 +0000 (01:07 +0000)]
MFC: r241561
Add two new options to the nfssvc(2) syscall that allow
processes running as root to suspend/resume execution
of the kernel nfsd threads. An earlier version of this
patch was tested by Vincent Hoffman (vince at unsane.co.uk)
and John Hickey (jh at deterlab.net).

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

11 years agoGuess when we'll be ready to announce 9.1-RELEASE.
kensmith [Fri, 30 Nov 2012 19:27:31 +0000 (19:27 +0000)]
Guess when we'll be ready to announce 9.1-RELEASE.

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

11 years agoMFC r243599:
davidxu [Fri, 30 Nov 2012 05:30:31 +0000 (05:30 +0000)]
MFC r243599:
Take first active vnode correctly.

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

11 years agoMFC r243082:
eadler [Fri, 30 Nov 2012 03:48:45 +0000 (03:48 +0000)]
MFC r243082:
Fix memory leak in umount.c

PR: bin/172553
Approved by: cperciva (implicit)

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

11 years agoMFC r243078:
eadler [Fri, 30 Nov 2012 03:38:02 +0000 (03:38 +0000)]
MFC r243078:
Add deviceid to the disk output on boot to help debugging.

PR: kern/173290
Approved by: cperciva (implicit)

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

11 years agoMFC r242945 (by theraven):
dim [Thu, 29 Nov 2012 21:26:57 +0000 (21:26 +0000)]
MFC r242945 (by theraven):

  Import new version of libc++ into base.

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

11 years agoMFC r242323, r242328:
mav [Thu, 29 Nov 2012 18:08:36 +0000 (18:08 +0000)]
MFC r242323, r242328:
Add basic BIO_DELETE support to GEOM RAID class for all RAID levels.

If at least one subdisk in the volume supports it, BIO_DELETE requests
will be propagated down.  Unfortunatelly, for RAID levels with redundancy
unmapped blocks will be mapped back during first rebuild/resync process.

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

11 years agoMFC r243336:
ae [Thu, 29 Nov 2012 17:35:57 +0000 (17:35 +0000)]
MFC r243336:
  Remove opt_inet.h, it isn't required here.

MFC r243337:
  Connect ip6_mroute kernel module to the build.

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

11 years agoMerge ZFS feature flags support and related bugfixes:
mm [Thu, 29 Nov 2012 14:05:04 +0000 (14:05 +0000)]
Merge ZFS feature flags support and related bugfixes:
236884, 237001, 237119, 237458, 237972, 238113, 238391, 238422, 238926,
238950, 238951, 239389, 239394, 239620, 239774, 239953, 239958, 239967,
239968, 240063, 240133, 240153, 240303, 240345, 240415, 240955, 241655,
243014, 243505, 243506

MFC r236884:
Introduce "feature flags" for ZFS pools (bump SPA version to 5000).
Add first feature "com.delphix:async_destroy" (asynchronous destroy
of ZFS datasets).
Implement features support in ZFS boot code.

Illumos revisions merged:
13700:2889e2596bd6
13701:1949b688d5fb
2619 asynchronous destruction of ZFS file systems
2747 SPA versioning with zfs feature flags

References:
  https://www.illumos.org/issues/2619
  https://www.illumos.org/issues/2747

MFC r237001:
Fix ZFS boot with pre-features pools (version <= 28) broken in r236884

MFC r237119 [1]:
Do not remount ZFS dataset if changing canmount property to "on" and
dataset is already mounted.

MFC r237458:
Import Illumos revision 13736:9f1d48e1681f
2901 ZFS receive fails for exabyte sparse files

References:
  https://www.illumos.org/issues/2901

MFC r237972:
Expose scrub and resilver tunables.
This allows the user to tune the priority trade-off between scrub/resilver
and other ZFS I/O.

MFC r238113 (pjd):
vdev_io_done stage is not used for ioctls.

MFC r238391:
Change behavior introduced in r237119 to vendor solution

References:
  https://www.illumos.org/issues/2883

MFC r238422:
Merge illumos commit 13749:df4cd82e2b60

1796 "ZFS HOLD" should not be used when doing "ZFS SEND" froma read-only pool
2871 support for __ZFS_POOL_RESTRICT used by ZFS test suite
2903 zfs destroy -d does not work
2957 zfs destroy -R/r sometimes fails when removing defer-destroyed snapshot

References:
  https://www.illumos.org/issues/1796
  https://www.illumos.org/issues/2871
  https://www.illumos.org/issues/2903
  https://www.illumos.org/issues/2957

MFC r238926:
Partial MFV (illumos-gate 13753:2aba784c276b)
2762 zpool command should have better support for feature flags

References:
  https://www.illumos.org/issues/2762

MFC r238950:
Fix reporting of root pool upgrade notice.

MFC r238951:
Fix wrong indent according to style(9)

MFC r239389:
Backport fix for vendor issue #3085
3085 zfs diff panics, then panics in a loop on booting

References:
  https://www.illumos.org/issues/3085

MFC r239394:
Update zfs(8) manpage with illumos version of "zfs diff"

Illumos issue:
  2399 zfs manual page does not document use of "zfs diff"

References:
  https://www.illumos.org/issues/2399

MFC r239620 [2]:
Merge recent vendor changes:
3086 unnecessarily setting DS_FLAG_INCONSISTENT on async destroyed datasets
3090 vdev_reopen() during reguid causes vdev to be treated as corrupt
3102 vdev_uberblock_load() and vdev_validate() may read the wrong label

Referenes:
  https://www.illumos.org/issues/3086
  https://www.illumos.org/issues/3090
  https://www.illumos.org/issues/3102

MFC r239774:
Merge recent vendor changes:
3100 zvol rename fails with EBUSY when dirty
3104 eliminate empty bpobjs
3120 zinject hangs in zfsdev_ioctl() due to uninitialized zc

References:
  https://www.illumos.org/issues/3100
  https://www.illumos.org/issues/3104
  https://www.illumos.org/issues/3120

MFC r239953 (joel):
Mdoc fixes.

MFC r239958 (joel):
Minor mdoc fixes.

MFC r239967 (joel):
Mdoc fixes.

MFC r239968 (joel):
Remove trailing whitespace.

MFC r240063 (gjb):
Add myself to copyright sections, per CDDL license.

MFC r240133:
Merge recent vendor changes and sync code:
1862 incremental zfs receive fails for sparse file > 8PB
3112 ztest does not honor ZFS_DEBUG
3122 zfs destroy filesystem should prefetch blocks
3129 'zpool reopen' restarts resilvers
3130 ztest failure: Assertion failed:
       0 == dmu_objset_destroy(name, B_FALSE) (0x0 == 0x10)

References:
  https://www.illumos.org/issues/1862
  https://www.illumos.org/issues/3112
  https://www.illumos.org/issues/3122
  https://www.illumos.org/issues/3129
  https://www.illumos.org/issues/3130

MFC r240153 (gjb) [3]:
Typo fix and minor word swap.

MFC r240303:
Add assfail() and assfail3() to the opensolaris module.
Remove obsoleted intermediate cddl/compat/opensolaris/sys/debug.h.

MFC r240345 (avg):
zfs: fix sa_modify_attrs handling of variable-sized attributes

- skip length_idx index for a replaced variable-sized attribute
- skip length_idx index for a removed variable-sized attribute
- also re-arranged code to make sure that length_idx is always
  incremented for variable-sized attributes
- additionally add an assertion that the number of actually produced
  attributes is the same as the expected number of resulting
  attributes

MFC r240415:
Merge recent zfs vendor changes, sync code and adjust userland DEBUG.

Illumos issued covered:
1884 Empty "used" field for zfs *space commands
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument
     is zero
3028 zfs {group,user}space -n prints (null) instead of numeric GID/UID
3048 zfs {user,group}space [-s|-S] is broken
3049 zfs {user,group}space -t doesn't really filter the results
3060 zfs {user,group}space -H output isn't tab-delimited
3061 zfs {user,group}space -o doesn't use specified fields order
3064 usr/src/cmd/zpool/zpool_main.c misspells "successful"
3093 zfs {user,group}space's -i is noop
3098 zfs userspace/groupspace fail without saying why when run as non-root

References:
  https://www.illumos.org/issues/ + [issue_id]

MFC r240955 (partial):
Merge recent vendor changes in ZFS.

Illumos issued covered:
3139 zdb dies when it tries to determine path of unlinked file
3189 kernel panic in ZFS test suite during hotspare_onoffline_004_neg
3208 moving zpool cross-endian results in incorrect user/group accounting

References:
  https://www.illumos.org/issues/ + [issue_id]

MFC r241655:
Add missing initialization for do_prefix.
Corrects porting error in r238391

Vendor issue and changeset reference:
2883 changing "canmount" property to "on" should not always remount dataset
https://www.illumos.org/issues/2883
Changeset 13743:95aba6e49b9f

MFC r243014:
Move zpool-features manual page from section 5 to section 7
and fix references

Reported by: pluknet

MFC r243505:
Illumos 13886:e3261d03efbf

3349 zpool upgrade -V bumps the on disk version number, but leaves
     the in core version

References:
  https://www.illumos.org/issues/3349

MFC r243506:
zfs sha256 checksum is missing in zfs.8 manpage

PR: kern/167905 [1], kern/170912 [2], kern/170914 [2], doc/171356 [3]

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

11 years agoMFC r243380:
hselasky [Wed, 28 Nov 2012 18:13:35 +0000 (18:13 +0000)]
MFC r243380:
Fix uplcom clear stall logic for PL2303HX.

Submitted by: Mark Johnston

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

11 years agoMFC r242619, r242695, r242702 and r242703:
hselasky [Wed, 28 Nov 2012 18:10:05 +0000 (18:10 +0000)]
MFC r242619, r242695, r242702 and r242703:
Implement support for RTS (flow control).
Improve USB serial console support.
Implement a USB serial jitter buffer in receive direction.

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

11 years agoAdd new USB IDs.
hselasky [Wed, 28 Nov 2012 17:43:41 +0000 (17:43 +0000)]
Add new USB IDs.

PR: usb/173503

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

11 years agoMFC r241708: Explicitly specify 'np' so that getty(8) does not
peterj [Tue, 27 Nov 2012 19:23:54 +0000 (19:23 +0000)]
MFC r241708:  Explicitly specify 'np' so that getty(8) does not
simulate even parity on local.9600.

PR: 76226
Approved by: jhb (mentor)

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

11 years agoMFC r243387: Use %u for unsigned serial number
emaste [Tue, 27 Nov 2012 16:20:44 +0000 (16:20 +0000)]
MFC r243387: Use %u for unsigned serial number

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

11 years agoMFC r243110:
np [Tue, 27 Nov 2012 08:32:12 +0000 (08:32 +0000)]
MFC r243110:

cxgbe/tom: Plug mbuf leak.

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

11 years agoMFC r242079:
ae [Tue, 27 Nov 2012 01:59:51 +0000 (01:59 +0000)]
MFC r242079:
  Remove the IPFIREWALL_FORWARD kernel option and make possible to turn
  on the related functionality in the runtime via the sysctl variable
  net.pfil.forward. It is turned off by default.

MFC r242082:
  Note the removal of the IPFIREWALL_FORWARD kernel option.

MFC r242463:
  Remove the recently added sysctl variable net.pfil.forward.
  Instead, add protocol specific mbuf flags M_IP_NEXTHOP and
  M_IP6_NEXTHOP. Use them to indicate that the mbuf's chain
  contains the PACKET_TAG_IPFORWARD tag. And do a tag lookup
  only when this flag is set.

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

11 years agoMFC r243234:
mjg [Tue, 27 Nov 2012 01:33:23 +0000 (01:33 +0000)]
MFC r243234:

Fix possible fp reference leak in posix_openpt

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

11 years agoMFC r243007:
mjg [Tue, 27 Nov 2012 01:28:35 +0000 (01:28 +0000)]
MFC r243007:
enterpgrp: get rid of pgrp2 variable and use KASSERT directly on pgfind result.

pgrp2 was used only for debugging, but pgrp2 = pgfind(..) was present in compiled code

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

11 years agoMFC r242546:
wblock [Mon, 26 Nov 2012 18:10:15 +0000 (18:10 +0000)]
MFC r242546:

Add an example showing the use of gnop(8) to skip over header data.

PR: kern/145999
Reviewed by: mjg

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

11 years agoMFC r238943:
mav [Mon, 26 Nov 2012 15:34:28 +0000 (15:34 +0000)]
MFC r238943:
Add several performance optimizations to acpi_cpu_idle().

For C1 and C2 states use cpu_ticks() to measure sleep time instead of much
slower ACPI timer. We can't do it for C3, as TSC may stop there. But it is
less important there as wake up latency is high any way.

For C1 and C2 states do not check/clear bus mastering activity status, as
it is important only for C3. As side effect it can make CPU enter C2 instead
of C3 if last BM activity was two sleeps back (unlike one before), but
that may be even good because of collecting more statistics. Premature BM
wakeup from C3, entered because of overestimation, can easily be worse then
entering C2 from both performance and power consumption points of view.

Together on dual Xeon E5645 system on sequential 512 bytes read test this
change makes cpu_idle_acpi() as fast as simplest cpu_idle_hlt() and only
few percents slower then cpu_idle_mwait(), while deeper states are still
actively used during idle periods.

To help with diagnostics, add C-state type into dev.cpu.X.cx_supported.

PR: kern/170021

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

11 years agoMFC r243072:
eadler [Mon, 26 Nov 2012 05:13:57 +0000 (05:13 +0000)]
MFC r243072:
Follow the behavior as specified in POSIX:

if (exists AND (NOT f_option) AND
((not_writable AND input_is_terminal) OR i_option))
prompt

in particular, add the test for input_is_terminal

PR: bin/173039
Approved by: cperciva (implicit)

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

11 years agoMFC r242426:
yongari [Mon, 26 Nov 2012 04:39:41 +0000 (04:39 +0000)]
MFC r242426:
  TCP/UDP checksum offloading feature for IP fragmented datagram was
  removed in r99417.  bge(4) controllers can do TCP checksum offload
  for IP fragmented datagrams but unlike ti(4), it lacks UDP checksum
  offloading for IP fragmented datagrams. The problem was bge(4)
  blindly requested TCP/UDP checksum for IP fragmented datagrams such
  that it resulted in corrupted UDP datagrams before r99417.
  Remove remaining code for TCP checksum offloading for IP fragmented
  datagrams which should have been removed in r99417.

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

11 years agoMFC r241983-241985:
yongari [Mon, 26 Nov 2012 04:34:05 +0000 (04:34 +0000)]
MFC r241983-241985:
r241983:
  Do not hardcode phy address. Multi-port controllers use different phy
  address.

r241984:
  Ethernet@WireSpeed is defined for 1000baseT adapter to establish a
  link at a lower speed so enabling it for fiber adapters is wrong.
  Fix the issue by setting BGE_PHY_NO_WIRESPEED such that brgphy(4)
  wouldn't enable the feature.
  While I'm here move PHY specific feature/bug configuration to new
  location(just before mii attach) for readability.

r241985:
  For fast ethernet controllers, Ethernet@WireSpeed is not defined so
  explicitly set BGE_PHY_NO_WIRESPEED flag.

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

11 years agoMFC r241438:
yongari [Mon, 26 Nov 2012 04:25:41 +0000 (04:25 +0000)]
MFC r241438:
  Add APE firmware support and improve firmware handshake procedure.
  This change will enable IPMI access on 5717/5718/5719/5720 and 5761
  controllers. Because ASF is not available when APE firmware is
  present, bge_allow_asf tunable is ignored when driver detects APE
  firmware.  Also bge(4) no longer performs two resets(one blind
  reset and the other reset with firmware in mind) in device attach.
  Now bge(4) performs a reset with enough information in bge_reset().
  The APE firmware also needs special handling to make suspend/resume
  work but it was not implemented yet.

  With this change, bge(4) should work on any 5717/5718/5719/5720
  controllers. Special thanks to Mike Hibler at Emulab who setup
  remote debugging on Dell R820. Without his help I couldn't be able
  to address several issues happened on Dell Rx20 systems. And many
  thanks to Broadcom for continuing to support FreeBSD!

  Submitted by: davidch (initial version)
  H/W donated by: Broadcom
  Tested by: many
  Tested on: Del R820/R720/R620/R420/R320 and HP Proliant DL 360 G8

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

11 years agoMFC r241437:
yongari [Mon, 26 Nov 2012 04:20:11 +0000 (04:20 +0000)]
MFC r241437:
  For 5717C/5719C/5720C and 57765 PHYs, do not perform any special
  handling(jumbo, wire speed etc) in brgphy_reset().  Touching
  BRGPHY_MII_AUXCTL register seems to confuse APE firmware such that
  it couldn't establish a link.

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

11 years agoMFC r241436:
yongari [Mon, 26 Nov 2012 04:10:27 +0000 (04:10 +0000)]
MFC r241436:
  Rework controller reset procedure. Previously driver saved
  BGE_PCI_PCISTATE register before issuing global reset. After
  issuing reset, it reads BGE_PCI_PCISTATE register again and
  compares the saved register value and current value. It was used to
  know whether the global reset operation was completed or not.
  Unfortunately, this logic caused several issues on recent BCM5717/
  5718/5719 and BCM5720 controllers. It seems APE firmware accesses
  some registers while global reset is in progress such that reading
  BGE_PCI_PCISTATE register after reset does not yield old pre-reset
  state value. This resulted in consuming too much time in global
  reset and sometimes it couldn't successfully complete reset.

  The BGE_MISCCFG_RESET_CORE_CLOCKS of BGE_MISC_CFG register is
  self-clearing bit so driver is able to know the reset completion.
  But the core-lock reset will disable indirect/flat/standard access
  modes such that driver cannot poll BGE_MISCCFG_RESET_CORE_CLOCKS
  bit of BGE_MISC_CFG register. So just wait enough time for
  core-clock reset to complete.
  Data sheet says driver should wait 100us for PCI/PCI-X devices and
  100ms for PCIe devices. I chose 1ms for PCI/PCI-X since this value
  was used for many years in bge(4). For PCIe devices, use 100ms as
  recommended by data sheet.

  bge_chipinit() also cleared BGE_MAC_MODE register which shall clear
  firmware configured mode information. I think this will result in
  losing ASF/IPMI link in device attachment. Let bge_reset() honor
  firmware configured BGE_MAC_MODE register and don't announce driver
  is UP in bge_reset(). Firmware should have control over driver until
  it's fully initialized by driver.

  While I'm here, enable workaround for PCI-X BCM5704 A0 in
  bge_reset(). This will prevent internal arbitration logic from
  switching to the other DMA engine after a retry cycle.

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

11 years agoMFC r243280:
eadler [Mon, 26 Nov 2012 02:48:56 +0000 (02:48 +0000)]
MFC r243280:
Use .Nm instead of a self xref

Approved by: cperciva (implicit)

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

11 years agoMFC r241388-241393:
yongari [Mon, 26 Nov 2012 02:41:30 +0000 (02:41 +0000)]
MFC r241388-241393:
r241388:
  If the maximum payload size is 256 bytes or more, set the DMA write
  water mark to 256 bytes.  Otherwise controller will encounter DMA
  write under run errors and would result in RX DMA hang. If the
  maximum payload size is 128 bytes, the water mark is set to 128
  bytes as usual.
  While here, set maximum read request size to 2048 for BCM5719/BCM5720.
  For other PCIe devices, use 4096. And reprogram the maximum read
  request size whenever device reset is performed.

r241389:
 On PHY write error use hex number to show the value.
 Add more comments.

r241390:
  Honor PHY type fiber for BCM5717/BCM5718/BCM5719/BCM5720.

r241391:
  Do not force PCIe 1.0a mode in device reset on BCM5717 and newer
  controllers. BCM5785 does not require PCI 1.0a mode as well during
  reset.

r241392:
  Fix a long standing VCPU reset sequence bug on BCM5906.
  The VCPU(Virtual CPU) of BCM5906 is used to provide a mechanism to
  control the bootcode execution and to pick up configuration data
  stored inside the EEPROM.
  The bootcode of BCM5906 will check the BGE_VCPU_STATUS_DRV_RESET
  bit to decide which booting procedure to choose.
  Data sheet indicates the VCPU of BCM5906 should set
  BGE_VCPU_STATUS_DRV_RESET bit *before* VCPU reset or global reset.

r241393:
  Remove unnecessary delay. I don't see any comments in data sheet
  that requires 10ms delay after device reset.  Because that code was
  there from day 1, I guess it was added to give enough settlement
  time after updating BGE_MAC_MODE register.
  The recommended delay time for BGE_MAC_MODE after updating is 40us
  and it was already done in r241219.

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

11 years agoMFC r241215-241216,241219-241220,241341,241343:
yongari [Mon, 26 Nov 2012 02:31:28 +0000 (02:31 +0000)]
MFC r241215-241216,241219-241220,241341,241343:
r241215:
  Don't touch EMAC Mode and TX/RX MAC Mode register when driver is
  not running.

r241216:
  APE firmware touches EMAC Mode and TX/RX MAC Mode registers to keep
  the MAC connected to the outside world.  So keep the accesses
  atomic.

r241219:
  Add 40 microseconds delay after updating EMAC Mode register as
  recommended by Broadcom data sheet.

r241220:
  Follow Broadcom datasheet:
   Delay 100 microseconds after enabling transmit MAC.
   Delay 10 microseconds after enabling receive MAC.

r241341:
  Limit applying TX data corruption and FIFO workaround to BCM5719
  A0. It's believed BCM5720 does not have the issue.

r241343:
  Rework device detach. While here, move driver lock/callout
  initialization to the beginning of device attach for readability.

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

11 years agoMFC 242922
sbruno [Mon, 26 Nov 2012 01:57:22 +0000 (01:57 +0000)]
MFC 242922

Update MAX_TASKS to scale a bit based on MAXCPU

This alleviates issues on newer Sandy/Ivy Bridge gear that seems to require
boatloads more ACPI resources than before.

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

11 years agoMFC r243348:
dim [Sun, 25 Nov 2012 12:27:19 +0000 (12:27 +0000)]
MFC r243348:

Do not expose LIBCXXRT and LIBCPLUSPLUS in bsd.libnames.mk, if
WITHOUT_LIBCPLUSPLUS is specified.

Submitted by: Garrett Cooper <yanegomi@gmail.com>

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

11 years agoMFC r242574: zfsctl_snapdir_lookup: obtain a snapname in the remount case
avg [Sat, 24 Nov 2012 13:00:41 +0000 (13:00 +0000)]
MFC r242574: zfsctl_snapdir_lookup: obtain a snapname in the remount case

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

11 years agoMFC r242573: zfs: set MNTK_EXTENDED_SHARED flag
avg [Sat, 24 Nov 2012 12:58:51 +0000 (12:58 +0000)]
MFC r242573: zfs: set MNTK_EXTENDED_SHARED flag

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

11 years agoMFC r242572: opensolaris compat: clear VI_MOUNT before returning if
avg [Sat, 24 Nov 2012 12:56:07 +0000 (12:56 +0000)]
MFC r242572: opensolaris compat: clear VI_MOUNT before returning if
mount_snapshot fails

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

11 years agoMFC r242571: zfs_vnode_forget: dispose of larvae vnode using public vfs
avg [Sat, 24 Nov 2012 12:46:07 +0000 (12:46 +0000)]
MFC r242571: zfs_vnode_forget: dispose of larvae vnode using public vfs
api (mostly)

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

11 years agoMFC r242570: zfs_umount: no need to set MNTK_UNMOUNTF here, dounmount
avg [Sat, 24 Nov 2012 12:44:13 +0000 (12:44 +0000)]
MFC r242570: zfs_umount: no need to set MNTK_UNMOUNTF here, dounmount
handles that

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

11 years agoMFC r242569: opensolaris_lookup: use vfs_busy in traverse before calling VFS_ROOT
avg [Sat, 24 Nov 2012 12:42:29 +0000 (12:42 +0000)]
MFC r242569: opensolaris_lookup: use vfs_busy in traverse before calling VFS_ROOT

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

11 years agoMFC r242568: zfs_vnode_lock: no need to double-guess caller's intentions here
avg [Sat, 24 Nov 2012 12:40:23 +0000 (12:40 +0000)]
MFC r242568: zfs_vnode_lock: no need to double-guess caller's intentions here

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

11 years agoMFC r243213: spa_import_rootpool: fall back to use configuration from zpool.cache
avg [Sat, 24 Nov 2012 12:37:37 +0000 (12:37 +0000)]
MFC r243213: spa_import_rootpool: fall back to use configuration from zpool.cache

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

11 years agoMFC r242862: zfs_ioc_destroy_snaps_nvl: remove disk device entries for
avg [Sat, 24 Nov 2012 12:34:44 +0000 (12:34 +0000)]
MFC r242862: zfs_ioc_destroy_snaps_nvl: remove disk device entries for
zvol snapshots

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

11 years agoMFC: r240855, r242867, r242868, r242869
nyan [Fri, 23 Nov 2012 15:42:25 +0000 (15:42 +0000)]
MFC: r240855, r242867, r242868, r242869

  MFi386: r237445

    Commit changes missed from r237435.  Properly calculate the signal
    trampoline addresses after the shared page is enabled.  Handle FreeBSD
    ABIs without shared page support too.

  MFi386: r238792

    Introduce curpcb magic variable.

  MFi386: r211924

    Register an interrupt vector for DTrace return probes.

  Fix some KASSERTs.
  They are missing changes from r208833, r227394 and r227442.

  Reduce diffs against i386.

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

11 years agoMFC: r242866, r242871
nyan [Fri, 23 Nov 2012 14:16:55 +0000 (14:16 +0000)]
MFC: r242866, r242871

  Use ANSI prototype to fix build with clang.

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

11 years agoMFC: r242870
nyan [Fri, 23 Nov 2012 13:55:38 +0000 (13:55 +0000)]
MFC: r242870

  Fix build mpboot.s with clang.

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

11 years agoMFC: r239063, r239064, r239069, r240852, r240854
nyan [Fri, 23 Nov 2012 13:35:17 +0000 (13:35 +0000)]
MFC: r239063, r239064, r239069, r240852, r240854

  - boot2: bunch of variables are turned into uint8_t.
  - boot2: Remove unnecessary initializations.
  - loader: replace ugly inb/outb re-implementations with cpufunc.h.
  - Reduce diffs against i386.

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

11 years agoMFC: r242855, r242865
nyan [Fri, 23 Nov 2012 13:17:18 +0000 (13:17 +0000)]
MFC: r242855, r242865

  - use -march=i386 for both i386 and amd64 builds.
  - cosmetic changes to reduce diffs against i386.

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

11 years agoMFC: r242863
nyan [Fri, 23 Nov 2012 13:09:20 +0000 (13:09 +0000)]
MFC: r242863

  add detection of serial console presence to btx and boot2-like blocks.

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

11 years agoMFC: r242864
nyan [Fri, 23 Nov 2012 13:04:38 +0000 (13:04 +0000)]
MFC: r242864

  i386 comconsole: don't loop forever if hardware doesn't respond.

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

11 years agoMerge r242467 from head:
glebius [Fri, 23 Nov 2012 11:23:15 +0000 (11:23 +0000)]
Merge r242467 from head:
  - If DRM_DEBUG_DEFAULT_ON is defined, then initialize drm_debug_flagi to
    all supported debugging bits.
  - If DRM_DEBUG_DEFAULT_ON isn't defined, then initialize drm_debug_flag
    to zero.

  DRM_DEBUG_DEFAULT_ON is defined when module is build with -DDEBUG_DRM
  or if kernel config has 'options DEBUG_DRM'.

  Reviewed by:  kib

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

11 years agoMerge r241037 from head:
glebius [Fri, 23 Nov 2012 11:19:43 +0000 (11:19 +0000)]
Merge r241037 from head:
  The drbr(9) API appeared to be so unclear, that most drivers in
  tree used it incorrectly, which lead to inaccurate overrated
  if_obytes accounting. The drbr(9) used to update ifnet stats on
  drbr_enqueue(), which is not accurate since enqueuing doesn't
  imply successful processing by driver. Dequeuing neither mean
  that. Most drivers also called drbr_stats_update() which did
  accounting again, leading to doubled if_obytes statistics. And
  in case of severe transmitting, when a packet could be several
  times enqueued and dequeued it could have been accounted several
  times.

  o Thus, make drbr(9) API thinner. Now drbr(9) merely chooses between
    ALTQ queueing or buf_ring(9) queueing.
    - It doesn't touch the buf_ring stats any more.
    - It doesn't touch ifnet stats anymore.
    - drbr_stats_update() no longer exists.

  o buf_ring(9) handles its stats itself:
    - It handles br_drops itself.
    - br_prod_bytes stats are dropped. Rationale: no one ever
      reads them but update of a common counter on every packet
      negatively affects performance due to excessive cache
      invalidation.
    - buf_ring_enqueue_bytes() reduced to buf_ring_enqueue(), since
      we no longer account bytes.

  o Drivers handle their stats theirselves: if_obytes, if_omcasts.

  o mlx4(4), igb(4), em(4), vxge(4), oce(4) and  ixv(4) no longer
    use drbr_stats_update(), and update ifnet stats theirselves.

  o bxe(4) was the most correct driver, it didn't call
    drbr_stats_update(), thus it was the only driver accurate under
    moderate load. Now it also maintains stats itself.

  o ixgbe(4) had already taken stats from hardware, so just
    - drop software stats updating.
    - take multicast packet count from hardware as well.

  o mxge(4) just no longer needs NO_SLOW_STATS define.

  o cxgb(4), cxgbe(4) need no change, since they obtain stats
    from hardware.

  Reviewed by:  jfv, gnn

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

11 years agoSync lagg(4) with head, merging r240742, r241619:
glebius [Fri, 23 Nov 2012 08:23:53 +0000 (08:23 +0000)]
Sync lagg(4) with head, merging r240742, r241619:

  r240742 | glebius | 2012-09-20 14:05:10 +0400 (чт, 20 сен 2012) | 4 lines

  Convert lagg(4) to use if_transmit instead of if_start.

  In collaboration with:  thompsa, sbruno, fabient

  r241619 | emax | 2012-10-17 02:43:14 +0400 (ср, 17 окт 2012) | 5 lines

  report total number of ports for each lagg(4) interface
  via net.link.lagg.X.count sysctl

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

11 years agoFix multiple Denial of Service vulnerabilities with named(8).
simon [Thu, 22 Nov 2012 22:52:15 +0000 (22:52 +0000)]
Fix multiple Denial of Service vulnerabilities with named(8).

Fix insufficient message length validation for EAP-TLS messages.

Fix Linux compatibility layer input validation error.

Security: FreeBSD-SA-12:06.bind
Security: FreeBSD-SA-12:07.hostapd
Security: FreeBSD-SA-12:08.linux
Security: CVE-2012-4244, CVE-2012-5166, CVE-2012-4445, CVE-2012-4576
Approved by: re
Approved by: security-officer

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

11 years agoMFC r242744:
kib [Thu, 22 Nov 2012 16:20:08 +0000 (16:20 +0000)]
MFC r242744:
Zero the newly allocated md(4) swap-backed page to prevent random
kernel memory leakage to userspace.

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

11 years agoMFC r229848:
ed [Thu, 22 Nov 2012 15:19:53 +0000 (15:19 +0000)]
MFC r229848:

  Add aligned_alloc(3).

  The C11 folks reinvented the wheel by introducing an aligned version of
  malloc(3) called aligned_alloc(3), instead of posix_memalign(3). Instead
  of returning the allocation by reference, it returns the address, just
  like malloc(3).

I'm MFCing this now, as it seems aligned_alloc(3) is needed to make the
new version of libc++ work, which was merged back to FreeBSD 9 in r243376.

Requested by: dim

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

11 years agoMFC r242767,r243252: sh: Add tests for modifying an alias (r242766/r243402).
jilles [Thu, 22 Nov 2012 13:51:58 +0000 (13:51 +0000)]
MFC r242767,r243252: sh: Add tests for modifying an alias (r242766/r243402).

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

11 years agoMFC r242766: sh: Fix two issues when an alias is redefined:
jilles [Thu, 22 Nov 2012 13:50:51 +0000 (13:50 +0000)]
MFC r242766: sh: Fix two issues when an alias is redefined:

 * The last character is not displayed.
 * If the alias ends with itself (as a word), an infinite memory-eating loop
   occurs.

If an alias is defined initially, a space is appended to avoid recursion but
this did not happen when an alias was later modified.

PR: bin/173418
Submitted by: Daniel F.

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

11 years ago Partially merge r240494, which moved netinet/ipfw to netpfil/ipfw,
glebius [Thu, 22 Nov 2012 12:11:32 +0000 (12:11 +0000)]
  Partially merge r240494, which moved netinet/ipfw to netpfil/ipfw,
to make it easier to merge ipfw commits back to stable/9.

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

11 years agoMFC r243028:
ae [Thu, 22 Nov 2012 00:22:54 +0000 (00:22 +0000)]
MFC r243028:
  zoneid has unsigned type.

MFC r243029:
  SCOPE6_LOCK protects V_sid_default, no need to acquire it without
  any access to V_sid_default.

MFC r243031:
  if_afdata lock was converted from mutex to rwlock a long ago, so we can
  replace IF_AFDATA_LOCK() macro depending to the access type.

MFC r243148:
  Reduce the overhead of locking, use IF_AFDATA_RLOCK() when we are doing
  simple lookups.

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

11 years agoMFC r241903:
dim [Wed, 21 Nov 2012 18:38:56 +0000 (18:38 +0000)]
MFC r241903:

  Import libc++ trunk r165949.  Among other improvements and bug fixes,
  this has many visibility problems fixed, which should help with
  compiling certain ports that exercise C++11 mode (i.e. Firefox).

  Also, belatedly add the LICENSE.TXT and accompanying CREDITS.TXT files,
  which are referred to in all the source files.

MFC r241907:

  Fix two -Wsystem-header warnings in libc++ that were exposed by the new
  ATF import.  These have also been sent upstream.

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

11 years agoMFC r242933:
dim [Wed, 21 Nov 2012 18:27:02 +0000 (18:27 +0000)]
MFC r242933:

Redo r242842, now actually fixing the warnings, as follows:
- In sys/ofed/drivers/infiniband/core/cma.c, an enum struct member is
  interpreted as an int, so cast it to an int.
- In sys/ofed/drivers/infiniband/core/ud_header.c, initialize the
  packet_length variable in ib_ud_header_init(), to prevent undefined
  behaviour.
- In sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c, call rdma_notify()
  with the correct enum type and value.
- In sys/ofed/include/linux/pci.h, change the PCI_DEVICE and PCI_VDEVICE
  macros to use C99 struct initializers, so additional members can be
  overridden.

Reviewed by: delphij, Garrett Cooper <yanegomi@gmail.com>

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

11 years agoMFC r243000:
eadler [Wed, 21 Nov 2012 01:01:17 +0000 (01:01 +0000)]
MFC r243000:
Add support for CIR1000 - Cirrus Logic V34 to the uart driver

Approved by: cperciva (implicit)

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

11 years agoMFC r243241:
eadler [Wed, 21 Nov 2012 00:40:27 +0000 (00:40 +0000)]
MFC r243241:
Modernize parts of the ports.7 manual page.

Approved by: cperciva (implicit)

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

11 years agoMFC r243240:
eadler [Wed, 21 Nov 2012 00:31:56 +0000 (00:31 +0000)]
MFC r243240:
Use the macro for standard error return values.

.Dd not bumped because there is no important content change.

Obtained from: DragonflyBSD
Approved by: cperciva (implicit)

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

11 years agoMFC r243032:
demon [Tue, 20 Nov 2012 11:47:22 +0000 (11:47 +0000)]
MFC r243032:

Use defined() to test macro definitions.

Approved by: theraven

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

11 years agoMFC r240997:
trociny [Mon, 19 Nov 2012 21:10:52 +0000 (21:10 +0000)]
MFC r240997:

Kernel and modules have "set_vnet" linker set, where virtualized
global variables are placed. When a module is loaded by link_elf
linker its variables from "set_vnet" linker set are copied to the
kernel "set_vnet" ("modspace") and all references to these variables
inside the module are relocated accordingly.

The issue is when a module is loaded that has references to global
variables from another, previously loaded module: these references are
not relocated so an invalid address is used when the module tries to
access the variable. The example is V_layer3_chain, defined in ipfw
module and accessed from ipfw_nat.

The same issue is with DPCPU variables, which use "set_pcpu" linker
set.

Fix this making the link_elf linker on a module load recognize
"external" DPCPU/VNET variables defined in the previously loaded
modules and relocate them accordingly. For this set_pcpu_list and
set_vnet_list are used, where the addresses of modules' "set_pcpu" and
"set_vnet" linker sets are stored.

Note, archs that use link_elf_obj (amd64) were not affected by this
issue.

Reviewed by: jhb, julian, zec (initial version)

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

11 years agoMFC r239242: Reword comment to try to improve clarity, and fix a typo.
emaste [Mon, 19 Nov 2012 19:31:55 +0000 (19:31 +0000)]
MFC r239242: Reword comment to try to improve clarity, and fix a typo.

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

11 years agoMFC r241643: Avoid panic when a netmap instance cannot obtain memory.
emaste [Mon, 19 Nov 2012 19:30:30 +0000 (19:30 +0000)]
MFC r241643: Avoid panic when a netmap instance cannot obtain memory.

  A uint32_t is always >= 0.

Sponsored by: ADARA Networks

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

11 years agoMFC r239234: Use array notation for consistency.
emaste [Mon, 19 Nov 2012 19:26:59 +0000 (19:26 +0000)]
MFC r239234: Use array notation for consistency.

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

11 years agoMFC r239140: Clarify comments about number of tx / rx rings
emaste [Mon, 19 Nov 2012 19:24:48 +0000 (19:24 +0000)]
MFC r239140: Clarify comments about number of tx / rx rings

MFC r239141: Fix whitespace (missing newline)

Sponsored by: ADARA Networks

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

11 years agoSync netmap pkt-gen with HEAD.
emaste [Mon, 19 Nov 2012 19:14:25 +0000 (19:14 +0000)]
Sync netmap pkt-gen with HEAD.

MFC r238081, r238165, r238170, r238175, r239139, r239145, r240103,
    r238081:

r238165: Allow threads to finish up when terminated by user

  Set a flag and allow worker threads to finish upon ^C, instead of
  immediately cancelling them, so that final packet count and rate
  stats can be displayed.

r238170: Also report tx bandwidth with Ethernet overhead

r238175: Allow continuous packet transmission (via -t 0)

  Also add a missing check for the cancel flag while waiting for the first
  packet in receive mode.

r239139: Round displayed pps (instead of truncating)

r239145: Be more descriptive about poll error / timeout when transmitting.

r240103: Failure to open netmap device is unrecoverable.

  There's no reason to "fail later" since there's nothing this tool can do
  in netmap mode without /dev/netmap open.

Sponsored by: ADARA Networks

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

11 years agoMFC r232678: Inbound TCP-MD5 digest validation is now supported
emaste [Mon, 19 Nov 2012 18:54:37 +0000 (18:54 +0000)]
MFC r232678: Inbound TCP-MD5 digest validation is now supported

MFC r232695: Correct markup, use proper reference for sysctl(3)

  Submitted by:        brueffer@

MFC r232725: Remove undesired sysctl(3) xref

  Submitted by:        bde

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

11 years agoMFC r232297: Grammar: tzsetup now has more than one option.
emaste [Mon, 19 Nov 2012 18:43:13 +0000 (18:43 +0000)]
MFC r232297: Grammar: tzsetup now has more than one option.

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

11 years agoMFC (part of) r229778 (uqs):
emaste [Mon, 19 Nov 2012 18:26:08 +0000 (18:26 +0000)]
MFC (part of) r229778 (uqs):

  Spelling fixes for sbin

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

11 years agoMFC (part of) r227081 (ed):
emaste [Mon, 19 Nov 2012 18:25:03 +0000 (18:25 +0000)]
MFC (part of) r227081 (ed):

  Add missing static keywords for global variables to tools in sbin/.

  These tools declare global variables without using the static keyword,
  even though their use is limited to a single C-file, or without placing
  an extern declaration of them in the proper header file.

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

11 years agoMFC (part of) r241737 (ed):
emaste [Mon, 19 Nov 2012 18:20:27 +0000 (18:20 +0000)]
MFC (part of) r241737 (ed):

  More -Wmissing-variable-declarations fixes.

  In addition to adding `static' where possible:

  ...
  - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
  ...

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

11 years agoMFC r241484: Use CLOCK_UPTIME to get the uptime.
emaste [Mon, 19 Nov 2012 18:18:24 +0000 (18:18 +0000)]
MFC r241484: Use CLOCK_UPTIME to get the uptime.

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

11 years agoMFC r236625 (joel): Minor spelling fixes.
emaste [Mon, 19 Nov 2012 17:33:45 +0000 (17:33 +0000)]
MFC r236625 (joel): Minor spelling fixes.

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

11 years agoMFC r238298: Restore error handling lost in r191603
emaste [Mon, 19 Nov 2012 17:06:21 +0000 (17:06 +0000)]
MFC r238298: Restore error handling lost in r191603

  This was missed in the change from IFQ_ENQUEUE to if_transmit.

MFC r238346: Plug potential mbuf leak when bridging fragments

  If an error occurs when transmitting one mbuf in a chain of fragments,
  free the subsequent fragments instead of leaking them.

MFC r238355: Simplify error case

  Submitted by:        thompsa@

Sponsored by: ADARA Networks

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

11 years agoMFC r232680: Remove unactionable message about label geometry
emaste [Mon, 19 Nov 2012 16:52:58 +0000 (16:52 +0000)]
MFC r232680: Remove unactionable message about label geometry

It's not clear to a user what they should do after seeing the "geometry
does not match label" kernel message, and it does not appear to present
a problem in practice.  Thus, just remove the messages.

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

11 years agoMFC r231589: Add a sysctl to report the firmware build number.
emaste [Mon, 19 Nov 2012 16:16:34 +0000 (16:16 +0000)]
MFC r231589: Add a sysctl to report the firmware build number.

  Some older firmware versions have issues that can be worked around by
  avoiding certain operations.  Add a sysctl dev.aac.#.firmware_build to
  make it easy for scripts or userland tools to detect the firmware
  version.

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

11 years agoMFC r231129: Add BSD copyright notice.
emaste [Mon, 19 Nov 2012 16:02:04 +0000 (16:02 +0000)]
MFC r231129: Add BSD copyright notice.

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

11 years agoMFC r230990: Correct typo in comment (numbver)
emaste [Mon, 19 Nov 2012 15:57:55 +0000 (15:57 +0000)]
MFC r230990: Correct typo in comment (numbver)

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

11 years agoMFC r240945: Correct misspelling in debug output.
emaste [Mon, 19 Nov 2012 15:31:07 +0000 (15:31 +0000)]
MFC r240945: Correct misspelling in debug output.

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

11 years agoMFC r241648: Avoid potential bad pointer dereference.
emaste [Mon, 19 Nov 2012 15:26:03 +0000 (15:26 +0000)]
MFC r241648: Avoid potential bad pointer dereference.

  Previously RuleAdd would leave entry->la unset for the first entry in
  the proxyList.

Sponsored by: ADARA Networks

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

11 years agoMFC r237729: Fix ioctl type for compiling with clang
emaste [Mon, 19 Nov 2012 15:24:19 +0000 (15:24 +0000)]
MFC r237729: Fix ioctl type for compiling with clang

MFC r241169: Clean up compiler warnings.

MFC r241464: Make local function static.

Sponsored by: ADARA Networks

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

11 years agoMFC r230812: Add -e to set arbitrary kernel environment variables.
emaste [Mon, 19 Nov 2012 15:03:19 +0000 (15:03 +0000)]
MFC r230812: Add -e to set arbitrary kernel environment variables.

  Nextboot(8) can now set any combination of kernel name (-k), kernel
  options (-o), and environment strings (-e).  As a result of this change
  -k also becomes optional.

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

11 years agoMerge r227468: Don't fondle this particular CCA register from extension channel.
adrian [Mon, 19 Nov 2012 05:52:23 +0000 (05:52 +0000)]
Merge r227468: Don't fondle this particular CCA register from extension channel.

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

11 years agoMFC r243073:
eadler [Mon, 19 Nov 2012 04:10:23 +0000 (04:10 +0000)]
MFC r243073:
Some software, notably dialog(1), can understand back-tab, which is
typically bound to Shift-Tab. syscons produces ^]]Z for Shift-Tab, like
many VT100-like terminal (emulators). The plain xterm does not produce
this sequence, but ^I for both Tab and Shift-Tab.

PR: conf/162787
PR: bin/151229
Approved by: cperciva (implicit)

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

11 years agoMFC r243081:
eadler [Mon, 19 Nov 2012 04:07:43 +0000 (04:07 +0000)]
MFC r243081:
Avoid possible null deref if ypclnt_new returns null

PR: bin/172979
Approved by: cperciva (implicit)

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

11 years agoMFC r239070:
ae [Sun, 18 Nov 2012 17:27:10 +0000 (17:27 +0000)]
MFC r239070:
  Add simple test program that uses the partition tables handling code.
  It is useful to test and debug how boot loader handles partition tables
  metadata.

MFC r239087:
  Add to the debug output the offset from the parent partitioning scheme.

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

11 years agoMFC 239054,239057,239058,239060,239066,239067,239068,239070,239073,
ae [Sun, 18 Nov 2012 17:09:29 +0000 (17:09 +0000)]
MFC 239054,239057,239058,239060,239066,239067,239068,239070,239073,
    239087,239088,239127,239210,239211,239230,239231,239232,239243,
    239292,239293,239294,239325,240272,240273,240274,240275,240276,
    240277,240335,240481,241023,241047,241053,241065,241068,241069,
    241070,241164,241809,241876

239054:
  Create the interface to work with various partition tables from the
  loader(8). The following partition tables are supported: BSD label, GPT,
  MBR, EBR and VTOC8.
239057:
  Remove unused variables.
239058:
  Introduce new API to work with disks from the loader's drivers.
  It uses new API from the part.c to work with partition tables.
239060:
  When GPT signature is invalid in the primary GPT header, then try to
  read backup GPT header.
239066:
  Add offset field to the i386_devdesc structure to be compatible with
  disk_devdesc structure. Update biosdisk driver to the new disk API.
239067:
  Remove unneeded flag.
239068:
  Teach the ZFS use new partitions API when probing.
  Note: now ZFS does probe only for partitions with type "freebsd-zfs"
  and "freebsd".
239070:
  Add simple test program that uses the partition tables handling code.
  It is useful to test and debug how boot loader handles partition tables
  metadata.
239073:
  Bump USERBOOT_VERSION.
239087:
  Add to the debug output the offset from the parent partitioning scheme.
239088:
  Fix start offset calculation for the EBR partitions.
239127:
  As it turned out, there are some installations, where BSD label
  contains partitions with type zero. And it has worked.
  So, allow detect these partitions.
239210:
  Add more debug messages.
239211:
  Add another debug message.
239230:
  Unbreak booting from the true dedicated disks.
  When we open the disk, check the type of partition table, that has
  been detected. If this is BSD label, then we assume this is DD mode.
239231:
  Remove colons from the debug message, device name returned by the
  disk_fmtdev() already has the colons.
239232:
  Restore the old behaviour. If requested partition is a BSD slice,
  but d_partition isn't explicitly set, then try to open BSD label and its
  first partition.
239243:
  After r239066, reinitialize v86.ctl and v86.addr for int 13 EDD probing
  in sys/boot/i386/libi386/biosdisk.c.  Otherwise, when DISK_DEBUG is
  enabled, the DEBUG() macros will clobber those fields, and cause the
  probing to always fail mysteriously when debugging is enabled.
239292:
  Explicitly terminate the string after strncpy(3).
239293:
  Rework r239232 to unbreak ZFS detection on MBR slices.
239294:
  Some BIOSes return incorrect number of sectors, make checks less
  strictly, to do not lost some partitions.
239325:
  Add comment why the code has been disabled.
240272:
  Make struct uboot_devdesc compatible with struct disk_devdesc.
240273:
  Use disk_fmtdev() and disk_parsedev() functions from the new DISK API.
240274:
  Update uboot's disk driver to use new DISK API.
240275:
  Build disk.c only when DISK_SUPPORT is enabled.
240276:
  Update according to the change of struct uboot_devdesc.
240277:
  Handle LOADER_NO_DISK_SUPPORT knob in the arm and powerpc ubldr.
240335:
  Slightly reduce an overhead for the open() call in the zfsloader.
  libstand(3) tries to detect file system in the predefined order,
  but zfsloader usually is used for the booting from ZFS, and there is
  no need to try detect several file system types for each open() call.
240481:
  The MBR data is not necessarily aligned.  This is a problem on ARM.
241023:
  Make the loader a bit smarter, when it tries to open disk and the slice
  number is not exactly specified. When the disk has MBR, also try to read
  BSD label after ptable_getpart() call. When the disk has GPT, also set
  d_partition to 255.  Mostly, this is how it worked before.
241047:
  Disable splitfs support, since we aren't support floppies for a long
  time. This slightly reduces an overhead, when loader tries to open
  file that doesn't exist.
241053:
  Almost each time when loader opens a file, this leads to calling
  disk_open(). Very often this is called several times for one file.
  This leads to reading partition table metadata for each call. To
  reduce the number of disk I/O we have a simple block cache, but it
  is very dumb and more than half of I/O operations related to reading
  metadata, misses this cache.

  Introduce new cache layer to resolve this problem. It is independent
  and doesn't need initialization like bcache, and will work by default
  for all loaders which use the new DISK API. A successful disk_open()
  call to each new disk or partition produces new entry in the cache.
  Even more, when disk was already open, now opening of any nested
  partitions does not require reading top level partition table.
  So, if without this cache, partition table metadata was read around
  20-50 times during boot, now it reads only once. This affects the booting
  from GPT and MBR from the UFS.
241065:
  Fix disk_cleanup() to work without DISK_DEBUG too.
241068:
  Reduce the number of attempts to detect proper kld format for the amd64
  loader.
241069:
  Remember the file format of the last loaded module and try to use it for
  next files.
241070:
  Fix the style.
241164:
  Replace all references to loader_callbacks_v1 with loader_callbacks.
241809:
  Add the flags parameter to the disk_open() function and DISK_F_NOCACHE
  flag, that disables the caching of partition tables metadata.
  Use this flag for floppies in the libi386/biosdisk driver.
241876:
  When loader tries to open GPT partition, but partition table is not GPT,
  then try automatically detect an appropriate partition type.

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

11 years agoMFC r236023 (by marcel):
ae [Sun, 18 Nov 2012 16:13:36 +0000 (16:13 +0000)]
MFC r236023 (by marcel):
  Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes.
  The gpart alias for these partition types is "freebsd-nandfs".

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

11 years agoMFC r234860 (by kientzle):
ae [Sun, 18 Nov 2012 16:07:53 +0000 (16:07 +0000)]
MFC r234860 (by kientzle):
  Teach ubldr(8) about simple MBR partitioning.

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

11 years agoMFC r241785: boot: use -march=i386 for both i386 and amd64 builds
avg [Sun, 18 Nov 2012 12:28:29 +0000 (12:28 +0000)]
MFC r241785: boot: use -march=i386 for both i386 and amd64 builds

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

11 years agoMFC r243025: boot: use packed attribute for edd_params* structures
avg [Sun, 18 Nov 2012 12:20:11 +0000 (12:20 +0000)]
MFC r243025: boot: use packed attribute for edd_params* structures

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

11 years agoMFC r242566: zfs_freebsd_close: call zfs_close with count=1 instead of count=0
avg [Sun, 18 Nov 2012 12:16:50 +0000 (12:16 +0000)]
MFC r242566: zfs_freebsd_close: call zfs_close with count=1 instead of count=0

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

11 years agoMFC r243075:
eadler [Sun, 18 Nov 2012 06:25:37 +0000 (06:25 +0000)]
MFC r243075:
Make definition match declaration

Approved by: cperciva (implicit)

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

11 years agoMFC r243074:
eadler [Sun, 18 Nov 2012 06:21:45 +0000 (06:21 +0000)]
MFC r243074:
Add a missing check for fread

Approved by: cperciva (implicit)

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