]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/log
FreeBSD/stable/8.git
13 years agoMFC 213381:
marcel [Sat, 6 Nov 2010 16:09:25 +0000 (16:09 +0000)]
MFC 213381:
Replace an obsolete flag -L in an mkisofs(1) command line with
-allow-leading-dots to fix "make release" for FreeBSD/powerpc.

Author: hrs

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

13 years agoMFC r214250:
bz [Sat, 6 Nov 2010 14:46:24 +0000 (14:46 +0000)]
MFC r214250:

  Make the IPsec SADB embedded route cache a union to be able to hold both the
  legacy and IPv6 route destination address.
  Previously in case of IPv6, there was a memory overwrite due to not enough
  space for the IPv6 address.

PR: kern/122565

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

13 years agoMFC r213913:
lstewart [Sat, 6 Nov 2010 10:31:52 +0000 (10:31 +0000)]
MFC r213913:

Retire the system-wide, per-reassembly queue segment limit. The mechanism is far
too coarse grained to be useful and the default value significantly degrades TCP
performance on moderate to high bandwidth-delay product paths with non-zero loss
(e.g. 5+Mbps connections across the public Internet often suffer).

Replace the outgoing mechanism with an individual per-queue limit based on the
number of MSS segments that fit into the socket's receive buffer.  This should
strike a good balance between performance and the potential for resource
exhaustion when FreeBSD is acting as a TCP receiver. With socket buffer
autotuning (which is enabled by default), the reassembly queue tracks the socket
buffer and benefits too.

As the XXX comment suggests, my testing uncovered some unexpected behaviour
which requires further investigation. By using so->so_rcv.sb_hiwat instead of
sbspace(&so->so_rcv), we allow more segments to be held across both the socket
receive buffer and reassembly queue than we probably should. The tradeoff is
better performance in at least one common scenario, versus a devious sender's
ability to consume more resources on a FreeBSD receiver.

Sponsored by: FreeBSD Foundation
Reviewed by: andre, gnn, rpaulo

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

13 years agoMFC r213912:
lstewart [Sat, 6 Nov 2010 10:26:49 +0000 (10:26 +0000)]
MFC r213912:

- Switch the "net.inet.tcp.reass.cursegments" and
  "net.inet.tcp.reass.maxsegments" sysctl variables to be based on UMA zone
  stats. The value returned by the cursegments sysctl is approximate owing to
  the way in which uma_zone_get_cur is implemented.

- Discontinue use of V_tcp_reass_qsize as a global reassembly segment count
  variable in the reassembly implementation. The variable was used without
  proper synchronisation and was duplicating accounting done by UMA already. The
  lack of synchronisation was particularly problematic on SMP systems
  terminating many TCP sessions, resulting in poor TCP performance for
  connections with non-zero packet loss.

Sponsored by: FreeBSD Foundation
Reviewed by: andre, gnn, rpaulo (as part of a larger patch)

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

13 years agoMFC r213162:
lstewart [Sat, 6 Nov 2010 10:21:46 +0000 (10:21 +0000)]
MFC r213162:

Log the number of segments currently in the reassembly queue.

Sponsored by: FreeBSD Foundation

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

13 years agoMFC r210203:
lstewart [Sat, 6 Nov 2010 10:17:43 +0000 (10:17 +0000)]
MFC r210203:

- Move common code from the hook functions that fills in a packet node struct to
  a separate inline function. This further reduces duplicate code that didn't
  have a good reason to stay as it was.

- Reorder the malloc of a pkt_node struct in the hook functions such that it
  only occurs if we managed to find a usable tcpcb associated with the packet.

- Make the inp_locally_locked variable's type consistent with the prototype of
  siftr_siftdata().

Sponsored by: FreeBSD Foundation

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

13 years agoMFC r213910:
lstewart [Sat, 6 Nov 2010 10:06:58 +0000 (10:06 +0000)]
MFC r213910:

- Simplify implementation of uma_zone_get_max.
- Add uma_zone_get_cur which returns the current approximate occupancy of a
  zone. This is useful for providing stats via sysctl amongst other things.

Sponsored by: FreeBSD Foundation
Reviewed by: gnn, jhb

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

13 years agoMFC r211396 (originally committed by andre):
lstewart [Sat, 6 Nov 2010 09:56:14 +0000 (09:56 +0000)]
MFC r211396 (originally committed by andre):

Add uma_zone_get_max() to obtain the effective limit after a call
to uma_zone_set_max().

The UMA zone limit is not exactly set to the value supplied but rounded up to
completely fill the backing store increment (a page normally).  This can lead to
surprising situations where the number of elements allocated from UMA is higher
than the supplied limit value.  The new get function reads back the effective
value so that the supplied limit value can be adjusted to the real limit.

Reviewed by: jeffr

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

13 years agoMFC r213158:
lstewart [Sat, 6 Nov 2010 09:42:41 +0000 (09:42 +0000)]
MFC r213158:

Internalise reassembly queue related functionality and variables which should
not be used outside of the reassembly queue implementation. Provide a new
function to flush all segments from a reassembly queue and call it from the
appropriate places instead of manipulating the queue directly.

Sponsored by: FreeBSD Foundation
Reviewed by: andre, gnn, rpaulo

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

13 years agoMFC r209662,209665:
lstewart [Sat, 6 Nov 2010 09:34:51 +0000 (09:34 +0000)]
MFC r209662,209665:

Import the Statistical Information For TCP Research (SIFTR) kernel module into
FreeBSD. SIFTR logs a range of statistics on active TCP connections to a log
file, providing the ability to make highly granular measurements of TCP
connection state. The tool is aimed at system administrators, developers and
researchers alike. Please take it for a spin and test it out - the man page
should have all the information required to get you going.

Many thanks go to the Cisco University Research Program Fund at Community
Foundation Silicon Valley and the FreeBSD Foundation. Their support of our work
at the Centre for Advanced Internet Architectures, Swinburne University of
Technology is greatly appreciated.

r209980:

Catch up with the rename of DPCPU_SUM to DPCPU_VARSUM.

r209982:

The SIFTR DPCPU statistics struct was not being zeroed between enable/disable
cycles so the values would accumulate rather than reset for each cycle.

Sponsored by: Cisco URP (r209662), FreeBSD Foundation
Reviewed by: dwmalone, gnn, rpaulo (r209662)
Tested by: Many on freebsd-current@ and elsewhere over the years

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

13 years agoMFC r209050 (originally committed by jhb):
lstewart [Sat, 6 Nov 2010 09:23:49 +0000 (09:23 +0000)]
MFC r209050 (originally committed by jhb):

Add helper macros to iterate over available CPUs in the system.
CPU_FOREACH(i) iterates over the CPU IDs of all available CPUs.  The
CPU_FIRST() and CPU_NEXT(i) macros can also be used to iterate over
available CPU IDs.  CPU_NEXT(i) wraps around to CPU_FIRST() rather than
returning some sort of terminator.

Requested by: rwatson
Reviewed by: attilio

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

13 years agoFix an instance missed in r212892:
marius [Sat, 6 Nov 2010 01:09:00 +0000 (01:09 +0000)]
Fix an instance missed in r212892:

MFC r212413: bus_add_child: change type of order parameter to u_int

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

13 years agoMFC r212505:
jh [Fri, 5 Nov 2010 16:04:10 +0000 (16:04 +0000)]
MFC r212505:

In backup_kernel(), support backing up subdirectories and handle files
with spaces correctly.

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

13 years agoMFC 214673: Fix a few typos and style nits in the example code.
jhb [Fri, 5 Nov 2010 13:45:13 +0000 (13:45 +0000)]
MFC 214673: Fix a few typos and style nits in the example code.

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

13 years agoMFC: r214513
rmacklem [Fri, 5 Nov 2010 02:45:13 +0000 (02:45 +0000)]
MFC: r214513
Modify nfs_open() in the experimental NFS client to be compatible
with the regular NFS client. Also, fix a couple of mutex lock issues.

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

13 years agoMFC: r214511
rmacklem [Fri, 5 Nov 2010 02:33:27 +0000 (02:33 +0000)]
MFC: r214511
Add a call for nfsrpc_close() to ncl_reclaim() in the experimental
NFSv4 client, since the call in ncl_inactive() might be missed
because VOP_INACTIVE() is not guaranteed to be called before
VOP_RECLAIM().

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

13 years agoMFC: r214406
rmacklem [Fri, 5 Nov 2010 02:12:18 +0000 (02:12 +0000)]
MFC: r214406
Add a flag to the experimental NFSv4 client to indicate when
delegations are being returned for reasons other than a Recall.
Also, re-organize nfscl_recalldeleg() slightly, so that it leaves
clearing NMODIFIED to the ncl_flush() call and invalidates the
attribute cache after flushing. It is hoped that these changes
might fix the problem others have seen when using the NFSv4
client with delegations enabled, since I can't reliably reproduce
the problem. These changes only affect the client when doing NFSv4
mounts with delegations enabled.

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

13 years agoUpdate to 9.6-ESV-R2, the latest from ISC.
dougb [Thu, 4 Nov 2010 21:48:39 +0000 (21:48 +0000)]
Update to 9.6-ESV-R2, the latest from ISC.

This version contains bug fixes that are relevant to any
caching/resolving name server; as well as DNSSEC-related
fixes.

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

13 years agoMFC 214585:
dougb [Thu, 4 Nov 2010 21:47:28 +0000 (21:47 +0000)]
MFC 214585:

Prep for the 9.6-ESV-R2 update

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

13 years agoMFC 214625: Correct the abbreviations for general I/O and signal traces.
jhb [Thu, 4 Nov 2010 17:25:31 +0000 (17:25 +0000)]
MFC 214625: Correct the abbreviations for general I/O and signal traces.

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

13 years agoMFC 214449:
jhb [Thu, 4 Nov 2010 17:22:49 +0000 (17:22 +0000)]
MFC 214449:
Set bootverbose directly in mi_startup() rather than via a SYSINIT.  This
ensures 'bootverbose' is in a valid state for all SYSINITs.

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

13 years agoMFC 214448:
jhb [Thu, 4 Nov 2010 17:19:16 +0000 (17:19 +0000)]
MFC 214448:
Use 'PCPU_GET(apic_id)' to determine the BSP's APIC ID on a UP machine
when routing interrupts instead of cpu_apic_ids[0] since cpu_apic_ids[]
is only populated for multiple-CPU machines.  This also matches what the
code does when SMP is not enabled.

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

13 years agoMFC 214203:
jhb [Thu, 4 Nov 2010 17:12:29 +0000 (17:12 +0000)]
MFC 214203:
- Add a new PCI quirk to whitelist an old chipset that doesn't support
  PCI-express or PCI-X capabilities if we are running in a virtual machine.
- Whitelist the Intel 82440 chipset used by QEMU.

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

13 years agoMFC 211820,211821,212292:
jhb [Thu, 4 Nov 2010 17:06:54 +0000 (17:06 +0000)]
MFC 211820,211821,212292:
Intel QPI chipsets actually provide extra "non-core" PCI buses that
provide PCI devices for various hardware such as memory controllers,
etc.  for each socket.  These PCI buses are not enumerated via ACPI
however.  Add qpi(4) psuedo bus and Host-PCI bridge drivers to
enumerate these buses.  Currently the driver uses the CPU ID to
determine the bridges' presence.

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

13 years agoMFC r208028,214491: Sync manpages to -CURRENT
uqs [Thu, 4 Nov 2010 12:33:07 +0000 (12:33 +0000)]
MFC r208028,214491: Sync manpages to -CURRENT

r208028:
mdoc: move remaining sections into consistent order

r214491:
Fix another "string" typo.

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

13 years agoMFC r200626,201289,213764,214272, syncing yacc and flex to -CURRENT
uqs [Thu, 4 Nov 2010 10:53:50 +0000 (10:53 +0000)]
MFC r200626,201289,213764,214272, syncing yacc and flex to -CURRENT

r200626:
remove external reference to not (or at least no longer) existing variable 'myname'

r201289:
Let both yacc and lex generate code that passes -Wold-style-definition.

Both these tools emit code where several functions have no `void'
keyword placed in the arugment list when the function has no arguments.

r213764:
Don't define the input() function ifdef YY_NO_INPUT.
This was previously done for the input() function.

r214272:
flex: add missing ifdef magic to create/hide prototypes
This unbreaks build for some software with higher WARNS flags.

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

13 years agoMFC: r214255
rmacklem [Wed, 3 Nov 2010 22:17:42 +0000 (22:17 +0000)]
MFC: r214255
Modify the experimental NFSv4 server's file handle hash function
to use the generic hash32_buf() function. Although adding the
bytes seemed sufficient for UFS and ZFS, since most of the bytes
are the same for file handles on the same volume, this might not
be sufficient for other file systems. Use of a generic function
also seems preferable to one specific to NFSv4.

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

13 years agoBump __FreeBSD_version for struct sysentvec changes in r214755.
kib [Wed, 3 Nov 2010 21:51:05 +0000 (21:51 +0000)]
Bump __FreeBSD_version for struct sysentvec changes in r214755.

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

13 years agoMFC r209690:
kib [Wed, 3 Nov 2010 21:40:57 +0000 (21:40 +0000)]
MFC r209690:
For "thread signal" command, print some information from siginfo when
available.

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

13 years agoMFC r209689:
kib [Wed, 3 Nov 2010 21:39:11 +0000 (21:39 +0000)]
MFC r209689:
Extend the td_thrinfo_t to include siginfo for the signal that stopped
the target.

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

13 years agoMFC r209873:
kib [Wed, 3 Nov 2010 21:32:31 +0000 (21:32 +0000)]
MFC r209873:
Document pl_siginfo and PT_FLAG_SI for PT_LWPINFO.

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

13 years agoMFC r208513:
kib [Wed, 3 Nov 2010 21:31:03 +0000 (21:31 +0000)]
MFC r208513:
Improve the documentation for PT_LWPINFO. Note that some features are
not implemented on MIPS and ARM.

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

13 years agoMFC r209688:
kib [Wed, 3 Nov 2010 21:24:21 +0000 (21:24 +0000)]
MFC r209688:
Extend ptrace(PT_LWPINFO) to report siginfo for the signal that caused
debugee stop.

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

13 years agoMFC r208453:
kib [Wed, 3 Nov 2010 21:21:12 +0000 (21:21 +0000)]
MFC r208453:
Reorganize syscall entry and leave handling.
Implement ptrace_lwpinfo pl_flags PL_FLAG_SCE, PL_FLAG_SCX and
PL_FLAG_EXEC.

The i386, amd64, sparc64, sun4v, powerpc and ia64 syscall()s are
changed to use syscallenter()/syscallret(). MIPS and arm are not
converted and use the mostly unchanged syscall() implementation.

MFC r208514:
Change ia64' struct syscall_args definition so that args is a pointer to
the arguments array instead of array itself.

MFC r208566:
Allow to use syscallname(9) outside subr_trap.c.

MFC r209258 (by rpaulo):
Make DTrace syscall provider work again by including opt_kdtrace.h here.

MFC r209313:
Only enable kdtrace hook in the LINT on the architectures that implement it.

MFC r209697:
Obey sv_syscallnames bounds in syscallname().

NOTE: The KBI of the struct sysentvec is changed, new required members
sv_set_syscall_retval, sv_fetch_syscall_args and sv_syscallnames are
added. The sv_prepsyscall field is now ignored. Third-party modules
using the struct sysentvec must be modified and recompiled, we believe
that only ABI emulators are affected. No such out-of-tree modules are
known. In-tree modules that are affected by the change were converted
to depend on exact version of the kernel, see r214421.

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

13 years agoMFC 214434:
jamie [Wed, 3 Nov 2010 15:54:50 +0000 (15:54 +0000)]
MFC 214434:

  Find a jail's type as part of jailparam_init rather than waiting until
  it's absolutely necessary.

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

13 years agoMFC r214349:
nwhitehorn [Wed, 3 Nov 2010 15:31:37 +0000 (15:31 +0000)]
MFC r214349:
The EHCI_CAPLENGTH and EHCI_HCIVERSION registers are actually sub-registers
within the first 4 bytes of the EHCI memory space. For controllers that
use big-endian MMIO, reading them with 1- and 2-byte reads would then
return the wrong values. Instead, read the combined register with a
4-byte read and mask out the interesting quantities.

Requested by: marius

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

13 years agoTrim unneeded mergeinfo from a file.
jhb [Wed, 3 Nov 2010 15:31:10 +0000 (15:31 +0000)]
Trim unneeded mergeinfo from a file.

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

13 years agoMFC 213672,213674,214396:
jhb [Wed, 3 Nov 2010 15:25:30 +0000 (15:25 +0000)]
MFC 213672,213674,214396:
- Report subcommand handler errors in mfiutil so that tools that
  invoke the utilities can robustly report errors.
- Fix compile with -DDEBUG by using the correct mfi_pd_ref union definition
  in mfireg.h.
- Save errno values before calling warn(3) so that errors are correctly
  reported.
- Use powerof2() from <sys/param.h> rather than a copy and paste version.

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

13 years agoMFC r214601:
nwhitehorn [Wed, 3 Nov 2010 15:24:25 +0000 (15:24 +0000)]
MFC r214601:
Add some missing parentheses so that moea_bat_mapped() actually works.

Submitted by: alc

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

13 years agoMFC r214105:
ed [Wed, 3 Nov 2010 10:23:06 +0000 (10:23 +0000)]
MFC r214105:

  Remove setpgid() call before executing child process.

  Using a separate process group here is bad, since (for example) job
  control in the TTY layer prevents interaction with the TTY, causing the
  child process to hang.

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

13 years agoMFC of r214002, r214010
edwin [Wed, 3 Nov 2010 10:10:34 +0000 (10:10 +0000)]
MFC of r214002, r214010

- Stylify of uudecode(1)
  Part of PR bin/124739.

- "b64decode -r" did not handle arbitary breaks in base64 encoded
  data. White space should be accepted anywhere in a base64 encoded
  stream, not just after every chunk (4 characters).

  Test-scenario:

  VmVsb2NpdHkgUmV3YXJkcw==

  and

  VmVsb2NpdHkgUmV3YXJkcw
  ==

  should both produce "Velocity Rewards"

PR: bin/124739
Submitted by: Mark Andrews <marka@isc.org>

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

13 years agoMFC r214049:
kib [Wed, 3 Nov 2010 08:34:00 +0000 (08:34 +0000)]
MFC r214049:
When readdirplus() is handled on the exported filesystem that does
not support VFS_VGET, like msdosfs, do not call VOP_LOOKUP() for
dotdot on the root directory. Our filesystems expect that VFS handles
dotdot lookups on root on its own.

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

13 years agoMFC of r214722, tzdata2010o:
edwin [Wed, 3 Nov 2010 01:32:39 +0000 (01:32 +0000)]
MFC of r214722, tzdata2010o:

- Fiji goes into DST three weeks earlier in 2011.

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

13 years agoMFC r214432:
yongari [Wed, 3 Nov 2010 01:28:09 +0000 (01:28 +0000)]
MFC r214432:
  Use shorten model name and add RTL8168, RTL8111 to the list of
  supported device. re(4) had been supported all variants of RTL8168,
  RTL8111 and RTL810x. I think this change will cover all controllers
  supported by re(4).

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

13 years agoMFC r214302:
yongari [Wed, 3 Nov 2010 01:24:33 +0000 (01:24 +0000)]
MFC r214302:
  Add TSO support over VLAN for i82550/i82551. Controller requires
  VLAN hardware tagging to make TSO work over VLAN. So if VLAN
  hardware tagging is disabled explicitly clear TSO over VLAN. While
  I'm here allow disabling VLAN TX checksum offloading.

  Tested by: Liudas < liudasb <> centras dot lt >

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

13 years agoMFC r214087,214219,214251,214292:
yongari [Wed, 3 Nov 2010 00:03:26 +0000 (00:03 +0000)]
MFC r214087,214219,214251,214292:
r214087:
  Add workaround for BCM5906 controller silicon bug. If device
  receive two back-to-back send BDs with less than or equal to 8
  total bytes then the device may hang. The two back-to-back send
  BDs must be in the same frame for this failure to occur.
  Thanks to davidch for detailed errata information.

  Reviewed by: davidch

r214219:
  Add workaround for BCM5906 A1 controller silicon bug. When
  auto-negotiation results in half-duplex operation, excess collision
  on the ethernet link may cause internal chip delays that may result
  in subsequent valid frames being dropped due to insufficient
  receive buffer resources. The workaround is to choose de-pipeline
  method as a flow control decision for SDI. De-pipeline method
  allows only 1 data in TxMbuf at a time such that a request to RDMA
  from SDI is made only when TxMbuf is empty. Thanks for david for
  providing detailed errata information.

r214251:
  Apply the same workaround for SDI flow control used on BCM5906 A1
  to BCM6906 A0/A2. This should fix a long standing BCM5906 A2 lockup
  issues. Data sheet explicitly mentions BCM5906 A0, A1 and A2 use
  de-pipelined mode on these revisions.
  Special thanks to Buganini who tried all combinations of
  experimental patches for more than 10 days.

  Tested by: Buganini <buganini <> gmail dot com >

r214292:
  Use bge_chipid to compare controller ids. r214251 incorrectly used
  bge_chiprev.

  Reported by: Buganini <buganini <> gmail dot com >

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

13 years agoMFC r213747,213808,214216:
yongari [Tue, 2 Nov 2010 23:54:59 +0000 (23:54 +0000)]
MFC r213747,213808,214216:
r213747:
  Protect bge(4) from accessing invalid NIC internal memory regions
  on BCM5906.

  Tested by: Buganini < buganini <> gmail dot com >

r213808:
  Add more checks for resolved link speed in bge_miibus_statchg().
  Link UP state could be reported first before actual completion of
  auto-negotiation. This change makes bge(4) reprogram BGE_MAC_MODE,
  BGE_TX_MODE and BGE_RX_MODE register only after controller got a
  valid link.

r214216:
  Enable TX MAC state machine lockup fix for both BCM5755 or higher
  and BCM5906. Publicly available data sheet just says it may happen
  due to corrupted TxMbuf.

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

13 years agoMFC r213522,213587,213711:
yongari [Tue, 2 Nov 2010 23:48:08 +0000 (23:48 +0000)]
MFC r213522,213587,213711:
r213522:
  Fix a long standing bug which regarded some revisions of controller
  as 5788. This caused BGE_MISC_LOCAL_CTL register is used to
  generate link state change interrupt for non-5788 controllers. The
  interrupt handler may or may not detect link state attention as
  status block wouldn't be updated when an interrupt was generated
  with BGE_MISC_LOCAL_CTL register. All controllers except 5700 and
  5788 should use host coalescing mode register to trigger an
  interrupt.

r213587:
  Do not blindly UP the interface when interface's MTU is changed. If
  driver is not running there is no need to up the interface. While
  I'm here hold driver lock before modifying MTU as it is referenced
  in RX handler.

r213711:
  The IFF_DRV_RUNNING flag is set at the end of bge_init_locked. But
  before setting the flag, interrupt was already enabled such that
  interrupt handler could be run before setting IFF_DRV_RUNNING flag.
  This can lose initial link state change interrupt which in turn
  make bge(4) think that it still does not have valid link. Fix this
  race by protecting the taskqueue with a driver lock.
  While I'm here move reenabling interrupt code after handling of link
  state chage.

  Reviewed by: davidch

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

13 years agoMFC r213495,213742:
yongari [Tue, 2 Nov 2010 23:41:43 +0000 (23:41 +0000)]
MFC r213495,213742:
r213495:
  Add more comments to rings supported by the controller. Different
  versions of controller support different number of ring control
  blocks such that adjust code a bit to access known number of
  send/receive ring control blocks. Previously bge(4) blindly
  accessed 16 send/receive RCBs. Also move initializing standard
  receive producer ring producer index, jumbo receive producer ring
  producer index and mini receive producer ring producer index to
  the end of each receive producer ring initialization.

  Do not assume mini receive producer ring is available only when
  controller has jumbo frame capability, instead explicitly check
  ASIC version BCM5700 to disable mini receive producer ring.

  Additionally always enable send ring 0 regardless of controller
  versions. Previously bge(4) didn't enable send ring 0 if controller
  is BGE_IS_5705_PLUS. Becase bge(4) need 1 send ring to send frames
  at least, I have no idea how it would have worked so far.

  Submitted by: davidch

r213742:
  Fix a regression introduced in r213495. r213495 disabled mini
  receive producer ring only for BCM5700. It was believed that
  BCM5700 with external SSRAM is the only controller that supports
  mini ring but it seems all BCM570[0-4] requires to disable mini
  receive producer ring. Otherwise, it caused unexpected RX DMA
  error or watchdog timeouts.

  Reported by: marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>
  Tested by: marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>

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

13 years agoMFC r213485,213710,213812:
yongari [Tue, 2 Nov 2010 23:35:08 +0000 (23:35 +0000)]
MFC r213485,213710,213812:
r213485:
  Overhaul MII register access routine and remove unnecessary
  BGE_MI_MODE register accesses. Previously bge(4) used to read
  BGE_MI_MODE register to detect whether it needs to disable
  autopolling feature or not. Because we don't touch autopolling in
  other part of driver there is no reason to read BGE_MI_MODE
  register given that we know default value in advance. In order to
  achieve the goal, check whether the controller has CPMU(Central
  Power Mangement Unit) capability. If controller has CPMU feature,
  use 500KHz MII management interface(mdio/mdc) frequency regardless
  core clock frequency. Otherwise use default MII clock. While I'm
  here, add CPMU register definition.

  In bge_miibus_readreg(), rearrange code a bit and remove goto
  statement. In bge_miibus_writereg(), make sure to restore
  autopolling even if MII write failed. The delay time inserted after
  accessing BGE_MI_MODE register increased from 40us to 80us.

  The default PHY address is now stored in softc. All PHYs supported
  by bge(4) currently uses PHY address 1 but it will be changed when
  we add newer controllers. This change will make it easier to change
  default PHY address depending on PHY models.

  Submitted by: davidch

r213710:
  Remove one last reference of BGE_MI_MODE register for auto polling.
  Previously bge(4) always enabled auto polling for non-BGE_FLAG_TBI
  controllers. With this change, auto polling is not used anymore so
  polling through mii(4) was introduced.

  Reviewed by: davidch

r213812:
  Fix a regression introduced in r213710. r213710 removed the use of
  auto polling such that it made all controllers obtain link status
  information from the state of the LNKRDY input signal. Broadcom
  recommends disabling auto polling such that driver should rely on
  PHY interrupts for link status change indications. Unfortunately it
  seems some controllers(BCM5703, BCM5704 and BCM5705) have PHY
  related issues so Linux took other approach to workaround it.
  bge(4) didn't follow that and it used to enable auto polling to
  workaround it. Restore this old behavior for BCM5700 family
  controllers and BCM5705 to use auto polling. For BCM5700 and
  BCM5701, it seems it does not need to enable auto polling but I
  restored it for safety.
  Special thanks to marius who tried lots of patches with patience.

  Reported by: marius
  Tested by: marius

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

13 years agoMFC r213411,213464-213465,213468:
yongari [Tue, 2 Nov 2010 23:23:48 +0000 (23:23 +0000)]
MFC r213411,213464-213465,213468:
r213411:
  Enable fix for read DMA FIFO overruns on controllers that have this
  fix. Note, we still need workaround for controllers that lacks this
  fix and it needs more work in RX BD updating.

  Submitted by: davidch

r213464:
  Separate common flags into controller specific and PHY related
  flags. There should be no functional changes. This change will make
  it easy to add more quirk/flags in future.

  Reviewed by: davidch

r213465:
  Rearrange code a bit to correctly set PHY flags. This change make
  it easy to add more newer ASICs.

  Obtained from: OpenBSD

r213468:
  Fix bge(4) build breakage when BGE_REGISTER_DEBUG is defined.

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

13 years agoMFC r213316,213333-213334:
yongari [Tue, 2 Nov 2010 23:04:23 +0000 (23:04 +0000)]
MFC r213316,213333-213334:
r213316:
  Fix IFCAP_TXCSUM/IFCAP_RXCSUM handling. Previously bge(4) used
  IFCAP_HWCSUM to know which capability should be changed such that
  disabling RX checksun offloading resulted in disabling TX checksum
  offloading.

r213333:
  Allow write DMA to request larger DMA burst size to get better
  performance on BCM5785.

  Obtained from: OpenBSD

r213334:
  Remove extra semicolon.

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

13 years agoMFC r213283,213410:
yongari [Tue, 2 Nov 2010 22:57:20 +0000 (22:57 +0000)]
MFC r213283,213410:
r213283:
  Implement hardware MAC statistics for BCM5705 or newer Broadcom
  controllers. bge(4) exported MAC statistics on controllers that
  maintain the statistics in the NIC's internal memory. Newer
  controllers require register access to fetch these values. These
  counters provide useful information to diagnose driver issues.

r213410:
  Consistently use ifHCOutOctets/ifHCInOctets instead of Octets as
  these names are used in data sheet. Also use UnicastPkts,
  MulticastPkts and BroadcastPkts instead of UcastPkts, McastPkts
  and BcastPkts to clarify its meaning.

  Suggested by: bde

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

13 years agoMFC r214119,r214273,r214274,r214275,r214276,r214282,r214283,r214284,r214692:
pjd [Tue, 2 Nov 2010 22:49:20 +0000 (22:49 +0000)]
MFC r214119,r214273,r214274,r214275,r214276,r214282,r214283,r214284,r214692:

r214119:

Use closefrom(2) instead of close(2) in a loop.

r214273:

Load geom_gate.ko module after parsing arguments.

r214274:

Plug memory leaks.

Found with: valgrind

r214275:

Plug memory leak.

r214276:

Simplify code a bit.

r214282:

Move all NV defines into nv.c, they are not used externally thus there is
no need to make then visible from outside.

r214283:

Implement nv_exists() function that returns true if argument of the given
name exists.

r214284:

Before this change on first connect between primary and secondary we
initialize all the data. This is huge waste of time and resources if
there were no writes yet, as there is no real data to synchronize.

Optimize this by sending "virgin" argument to secondary, which gives it a hint
that synchronization is not needed.

In the common case (where noth nodes are configured at the same time) instead
of synchronizing everything, we don't synchronize at all.

r214692:

Send packets to remote node only via the send thread to avoid possible
races - in this case a keepalive packet was send from wrong thread which
lead to connection dropping, because of corrupted packet.

Fix it by sending keepalive packets directly from the send thread.
As a bonus we now send keepalive packets only when connection is idle.

Submitted by: Mikolaj Golub <to.my.trociny@gmail.com>

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

13 years agoMFC r211855:
pjd [Tue, 2 Nov 2010 22:48:18 +0000 (22:48 +0000)]
MFC r211855:

Update comment now that I finally committed r211854.

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

13 years agoMFC r213081,213225,213280:
yongari [Tue, 2 Nov 2010 22:44:51 +0000 (22:44 +0000)]
MFC r213081,213225,213280:
r213081:
  Always show asic/chip revision in device attach phase. There are
  too many bge(4) controllers there and model name does not
  necessarily match asic/chip revision. Relying on VPD string made
  it hard to identify exact asic/chip revision so the first step to
  debug bge(4) was getting exact asic/chip information with verbose
  boot which may not be available on production server.

r213255:
  Set the number of RX frames to receive after RX MBUF low watermark
  has reached. This reduced number of dropped frames when
  flow-control is enabled. Previously it dropped incoming frames once
  RX MBUF low watermark has reached. The value used in MAC RX MBUF
  low watermark is greater than or equal to 4 so receiving two more
  RX frames should not be a problem.

  Obtained from: OpenBSD

r213280:
  After r207391, brgphy(4) passes resolved flow-control settings to
  parent driver. Use that information to configure flow-control.
  One drawback is there is no way to disable flow-control as we still
  don't have proper way to not advertise RX/TX pause capability to
  link partner. But I don't think it would cause severe problems and
  users can selectively disable flow-control in switch port.

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

13 years agoMFC r211854:
pjd [Tue, 2 Nov 2010 22:30:19 +0000 (22:30 +0000)]
MFC r211854:

- When VFS_VGET() is not supported, switch to VOP_LOOKUP().
- We are fine by only share-locking the vnode.
- Remove assertion that doesn't hold for ZFS where we cross mount points
  boundaries by going into .zfs/snapshot/<name>/.

Reviewed by: rmacklem
Reminded by: kib

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

13 years agoMFC: r214526
marius [Tue, 2 Nov 2010 22:12:06 +0000 (22:12 +0000)]
MFC: r214526

Partially revert r203829 (MFC'ed to stable/7 in r205920); as it turns out
what the PowerPC OFW loader did was incorrect as further down the road
cons_probe() calls malloc() so the former can't be called before init_heap()
has succeed. Instead just exit to the firmware in case init_heap() fails
like OF_init() does when hitting a problem as we're then likely running in
a very broken environment where hardly anything can be trusted to work.

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

13 years agoMFC: r201430
marius [Tue, 2 Nov 2010 21:01:15 +0000 (21:01 +0000)]
MFC: r201430

Fix card/device names, no functional change

The ADMtek AN985 is the cardbus variant of ADMtek AN983
The Netgear FA511 is just a relabled ADMtek AN985

PR: kern/50574

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

13 years agoMFC: r213878
marius [Tue, 2 Nov 2010 20:06:46 +0000 (20:06 +0000)]
MFC: r213878

Add a NetBSD-compatible mii_attach(), which is intended to eventually
replace mii_phy_probe() altogether. Compared to the latter the advantages
of mii_attach() are:
- intended to be called multiple times in order to attach PHYs in multiple
  passes (f.e. in order to only use sub-ranges of the 0 to MII_NPHY - 1
  range)
- being able to pass along the capability mask from the NIC to the PHY
  drivers
- being able to specify at which address (phyloc) to probe for a PHY
  (instead of always probing at all addresses from 0 to MII_NPHY - 1)
- being able to specify which PHY instance (offloc) to attach
- being able to pass along MIIF_* flags from the NIC to the PHY drivers
  (f.e. as required to indicated to the PHY drivers that flow control is
  supported by the NIC driver, which actually is the motivation for this
  change).

While at it, I used the opportunity to get rid of some hacks in mii(4)
like miibus_probe() generally doing work besides sheer probing and the
"EVIL HACK" (which will vanish entirely along with mii_phy_probe()) by
passing the struct ifnet pointer via an argument of mii_attach() as well
as to fix some resource leaks in mii(4) in case something fails.
Commits which will update the PHY drivers to honor the MII flags passed
down from the NIC drivers and take advantage of mii_attach() to get rid
of certain types of hacks in NIC and PHY drivers as well as a conversion
of the remaining uses of mii_phy_probe() will follow shortly.

Reviewed by: jhb, yongari
Obtained from: NetBSD (partially)

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

13 years agoMFC r214016:
mav [Tue, 2 Nov 2010 09:26:12 +0000 (09:26 +0000)]
MFC r214016:
Set of legacy mode SATA enchancements:
- Implement proper combined mode decoding for Intel controllers to properly
identify SATA and PATA channels and associate ATA channels with SATA ports.
This fixes wrong reporting and in some cases hard resets to wrong SATA ports.
- Improve SATA registers support to handle hot-plug events and potentially
interface errors. For ICH5/6300ESB chipsets these registers accessible via
PCI config space. For later ones they may be accessible via PCI BAR(5).
- For controllers not generating interrupts on hot-plug events, implement
periodic status polling. Use it to detect hot-plug on Intel and VIA
controllers. Same probably could also be used for Serverworks and SIS.

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

13 years agoMFC r213301:
mav [Tue, 2 Nov 2010 09:15:27 +0000 (09:15 +0000)]
MFC r213301:
Revert r132291.
Restore setting PIO/WDMA timings for VIA UDMA133 controllers.
Linux disables only AST register writing there, but no all timings.

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

13 years agoMFC r213092:
mav [Tue, 2 Nov 2010 09:14:04 +0000 (09:14 +0000)]
MFC r213092:
Add missing le32toh(), same as recently done in ata-siliconimage.c.

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

13 years agoMFC r213047 by jchandra:
mav [Tue, 2 Nov 2010 09:13:13 +0000 (09:13 +0000)]
MFC r213047 by jchandra:
Add missing byteswap, works on big endian systems now (tested on Netlogic
XLS MIPS processor).

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

13 years agoMFC r214102:
mav [Tue, 2 Nov 2010 09:05:40 +0000 (09:05 +0000)]
MFC r214102:
Workaround strange situation when EDMA_RESQIP register returns zero instead
of proper value. It caused bunch of "EMPTY CRPB" messages and potentially
may cause premature requests completion, which could cause data corruption.
For most cases it seems enough to just reread register to get proper value.
To protect against worse cases - erase processed queue entries with
impossible values and ignore them if problem still happen.

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

13 years agoMFC r214099:
mav [Tue, 2 Nov 2010 09:04:18 +0000 (09:04 +0000)]
MFC r214099:
Some mvs(4) style cleanup:
- remove commented debugging code;
- wrap long lines.

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

13 years agoMFC r214325:
mav [Tue, 2 Nov 2010 09:01:08 +0000 (09:01 +0000)]
MFC r214325:
Add missing mtx_destroy() on channel attach failure.

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

13 years agoMFC r213737: acpi_ec: changes in communication with hardware
avg [Tue, 2 Nov 2010 07:56:20 +0000 (07:56 +0000)]
MFC r213737: acpi_ec: changes in communication with hardware

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

13 years agoMFC r214160,214162,214236
bschmidt [Mon, 1 Nov 2010 19:05:38 +0000 (19:05 +0000)]
MFC r214160,214162,214236

r214236 & r214160:
The firmware does pad notifications to an even number of bytes (at least
the association notification), the included information though always
contains an elem block with an odd number of bytes. We handle the last
byte as if it might contain a whole elem block, this of course is not
true as one byte is not enough to hold a block, we therefore discard the
complete frame. The solution here is to subtract one from the actual
notification length, this is also what the Linux driver does. With this
change the frame ends exactly where the last elem block ends.

r214262:
The firmware always sets bit 14 and 15, to get the real associd we need
to clear those bits.

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

13 years agoMFC r214245:
trasz [Mon, 1 Nov 2010 15:43:42 +0000 (15:43 +0000)]
MFC r214245:

Remove workaround for ZFS bug; fix was committed to the //depot/user/pjd/zfs/...
branch some time ago.

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

13 years agoMFC r212906:
trasz [Mon, 1 Nov 2010 15:36:47 +0000 (15:36 +0000)]
MFC r212906:

First step at adopting FreeBSD to support PSARC/2010/029.  This makes
acl_is_trivial_np(3) properly recognize the new trivial ACLs.  From
the user point of view, that means "ls -l" no longer shows plus signs
for all the files when running ZFS v28.

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

13 years agoMFC r212376:
trasz [Mon, 1 Nov 2010 11:38:04 +0000 (11:38 +0000)]
MFC r212376:

Add minor optimization.  It's less strict than its kernel counterpart
due to upcoming ACL changes required by the new ZFS.

MFC r212379:

Fix previous commit.

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

13 years agoMFC r213323: i386 and amd64 mp_machdep: improve topology detection for Intel CPUs
avg [Mon, 1 Nov 2010 08:20:14 +0000 (08:20 +0000)]
MFC r213323: i386 and amd64 mp_machdep: improve topology detection for Intel CPUs

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

13 years agoMFC r212784: amd64: reduce VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory
avg [Mon, 1 Nov 2010 08:12:28 +0000 (08:12 +0000)]
MFC r212784: amd64: reduce VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory

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

13 years agoMFC r214419: Correct a typo.
jh [Mon, 1 Nov 2010 06:19:44 +0000 (06:19 +0000)]
MFC r214419: Correct a typo.

PR: 151321

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

13 years agoMFC r213668:
jh [Mon, 1 Nov 2010 06:17:02 +0000 (06:17 +0000)]
MFC r213668:

- Print the nmount(2) provided error message only when it is set.
- Ensure that the error message is NUL-terminated before printing it.

PR: bin/147482

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

13 years agoMFC: r214224
rmacklem [Mon, 1 Nov 2010 02:21:35 +0000 (02:21 +0000)]
MFC: r214224
Modify the file handle hash function in the experimental NFS
server so that it will work better for non-UFS file systems.
The new function simply sums the bytes of the fh_fid field
of fhandle_t.

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

13 years agoMFC: r214149
rmacklem [Mon, 1 Nov 2010 01:55:15 +0000 (01:55 +0000)]
MFC: r214149
Modify the experimental NFS server in a manner analagous to
r214049 for the regular NFS server, so that it will not do
a VOP_LOOKUP() of ".." when at the root of a file system
when performing a ReaddirPlus RPC.

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

13 years agoMFC: r214048, r214053
rmacklem [Mon, 1 Nov 2010 01:03:05 +0000 (01:03 +0000)]
MFC: r214048, r214053
Modify the NFS clients and the NLM so that the NLM can be used
by both clients. Since the NLM uses various fields of the
nfsmount structure, those fields were extracted and put in a
separate nfs_mountcommon structure stored in sys/nfs/nfs_mountcommon.h.
This structure also has a function pointer for a function that
extracts the required information from the mount point and nfs vnode
for that particular client. Also, fix the type of the 3rd argument for
this function.

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

13 years agoCorrect a merge issue from r214554, where the field had been deprecated
bz [Sun, 31 Oct 2010 16:54:50 +0000 (16:54 +0000)]
Correct a merge issue from r214554, where the field had been deprecated
and reserved in HEAD but is still there in 8.

Reported by: dhw

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

13 years agoMFC r214387:
bcr [Sun, 31 Oct 2010 12:05:37 +0000 (12:05 +0000)]
MFC r214387:

Add some missing documentation to the man page:

- FILES section ref: ~/nsmb.conf
- use of password in examples section
- use of simple encryption for password in examples section

PR:                 docs/132311
Submitted by:       David Horn (dhorn2000 at gmail dot com)
Patch corrected by: trhodes
Approved by:        trhodes

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

13 years agoMFC: revision 207355
nyan [Sun, 31 Oct 2010 09:05:04 +0000 (09:05 +0000)]
MFC: revision 207355

 - Change printf() calls to uprintf() for sigreturn().
 - Normalize the messages to include both pid and thread name.

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

13 years agoMFC: revision 214258
nyan [Sun, 31 Oct 2010 08:39:42 +0000 (08:39 +0000)]
MFC: revision 214258

 Rewrite the i386 memory probe:
  - Move the base memory setup into a new basemem_setup() routine.

The mergeinfo is already recorded accidentally in the previous commit.

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

13 years agoMFC: revision 208639
nyan [Sun, 31 Oct 2010 08:18:23 +0000 (08:18 +0000)]
MFC: revision 208639

  Use SEL_KPL macro.

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

13 years agoMFC: revision 208638
nyan [Sun, 31 Oct 2010 08:14:52 +0000 (08:14 +0000)]
MFC: revision 208638

  - Add an integer argument to idle to indicate how likely we are to wake
    from idle over the next tick.
  - Add a new MD routine, cpu_wake_idle() to wakeup idle threads who are
    suspended in cpu specific states.  This function can fail and cause the
    scheduler to fall back to another mechanism (ipi).
  - Implement support for mwait in cpu_idle() on i386/amd64 machines that
    support it.  mwait is a higher performance way to synchronize cpus
    as compared to hlt & ipis.
  - Allow selecting the idle routine by name via sysctl machdep.idle.  This
    replaces machdep.cpu_idle_hlt.  Only idle routines supported by the
    current machine are permitted.

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

13 years agoMFC: revision 208634
nyan [Sun, 31 Oct 2010 08:08:18 +0000 (08:08 +0000)]
MFC: revision 208634

  Reduce diffs against i386.

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

13 years agoMFC: revision 208632
nyan [Sun, 31 Oct 2010 08:02:47 +0000 (08:02 +0000)]
MFC: revision 208632

  Clarify a potential issue in get_fpcontext() use.

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

13 years agoMFC: revision 208563
nyan [Sun, 31 Oct 2010 07:57:05 +0000 (07:57 +0000)]
MFC: revision 208563

  Reduce diffs against syscons_isa.c.  No functional changes.

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

13 years agoMFC r214333:
bz [Sun, 31 Oct 2010 00:51:22 +0000 (00:51 +0000)]
MFC r214333:

  Factor out DDB commands from r204145, r204279 into if_debug.c for further
  enhancements (1).  Switch to a standard 2-clause BSD license for this (2).

  Unfortunately we have to un-static the ifindex_table for this but do not
  publicly export it.

  Suggested by: rwatson (1) a while back.
  Approved by:  thompsa (2) for the change from r204279.

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

13 years agoMFC r214447:
bz [Sun, 31 Oct 2010 00:37:00 +0000 (00:37 +0000)]
MFC r214447:

  Correct a typo.

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

13 years agoMFC r214303:
bz [Sat, 30 Oct 2010 12:39:51 +0000 (12:39 +0000)]
MFC r214303:

  Add initial inet DDB support for show in_ifaddr and show sin commands which
  proved to be useful while debugging address list problems.

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

13 years agoMFC r213932:
bz [Sat, 30 Oct 2010 12:05:20 +0000 (12:05 +0000)]
MFC r213932:

  MfP4 CH182763 (original version):

  Make it harder to exploit certain in_control() related races between the
  intiial lookup at the beginning and the time we will remove the entry
  from the lists by re-checking that entry is still in the list before
  trying to remove it.

  Reported by:  Nima Misaghian (nima_misa hotmail.com) on net@ 20100817
  Tested by:    Nima Misaghian (nima_misa hotmail.com) (original version)
  PR:           kern/146250
  Submitted by: Mikolaj Golub (to.my.trociny gmail.com) (different version)

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

13 years agoMFC r213930:
bz [Sat, 30 Oct 2010 11:54:55 +0000 (11:54 +0000)]
MFC r213930:

  Close a race acquiring the IF_ADDR_LOCK() for each entry while iterating
  over all interfaces to make sure the address will neither change nor be
  freed while we are working on it.

  PR: kern/146250
  Submitted by: Mikolaj Golub (to.my.trociny gmail.com)

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

13 years agoMFC r213453: When no protocol entry is found, getproto*_r(3)
ume [Sat, 30 Oct 2010 10:30:49 +0000 (10:30 +0000)]
MFC r213453: When no protocol entry is found, getproto*_r(3)
should return zero.

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

13 years agoMFC r213403: Clear errno for each method dispatch.
ume [Sat, 30 Oct 2010 10:28:33 +0000 (10:28 +0000)]
MFC r213403: Clear errno for each method dispatch.

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

13 years agoMFC r213408
alc [Sat, 30 Oct 2010 04:53:50 +0000 (04:53 +0000)]
MFC r213408
  If vm_map_find() is asked to allocate a superpage-aligned region of
  virtual addresses that is greater than a superpage in size but not a
  multiple of the superpage size, then vm_map_find() is not always
  expanding the kernel pmap to support the last few small pages being
  allocated.  Previously, we grew the kernel page table in
  vm_map_findspace() when we found the first available virtual address.
  Now, instead, we defer the call to pmap_growkernel() until we are
  committed to a range of virtual addresses in vm_map_insert().

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

13 years agoMFC r213917:
kib [Sat, 30 Oct 2010 01:24:26 +0000 (01:24 +0000)]
MFC r213917:
Document vfs.ncsizefactor and vfs.ncnegfactor.

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

13 years agoMFC r213916:
kib [Sat, 30 Oct 2010 01:19:15 +0000 (01:19 +0000)]
MFC r213916:
Provide vfs.ncsizefactor instead of hard-coding namecache ratio.
Move debug.ncnegfactor to vfs.ncnegfactor.
Provide some descriptions for the namecache related sysctls.

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

13 years agoMFC r212897:
tuexen [Thu, 28 Oct 2010 19:18:54 +0000 (19:18 +0000)]
MFC r212897:
Fix a locking issue which resulted in aborted associations
due to a corrupted nr-mapping array.

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

13 years agoMFC r212851:
tuexen [Thu, 28 Oct 2010 19:17:18 +0000 (19:17 +0000)]
MFC r212851:
Allow the initial congestion window to be configure
to one MTU. Improve the description.

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