]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoCleanup comparison of interface names.
tuexen [Fri, 18 Nov 2011 09:01:08 +0000 (09:01 +0000)]
Cleanup comparison of interface names.

MFC after: 1 month.

12 years agoMake some XHCI command timeouts less strict.
hselasky [Fri, 18 Nov 2011 08:31:24 +0000 (08:31 +0000)]
Make some XHCI command timeouts less strict.

Reported by: Jan Henrik Sylvester
MFC after: 1 week

12 years agoImport virtio base, PCI front-end, and net/block/balloon drivers.
grehan [Fri, 18 Nov 2011 05:43:43 +0000 (05:43 +0000)]
Import virtio base, PCI front-end, and net/block/balloon drivers.
Tested on Qemu/KVM, VirtualBox, and BHyVe.

Currently built as modules-only on i386/amd64. Man pages not yet hooked
up, pending review.

Submitted by: Bryan Venteicher  bryanv at daemoninthecloset dot org
Reviewed by: bz
MFC after: 4 weeks or so

12 years agoFlesh out some slightly dirty reset/channel change serialisation code
adrian [Fri, 18 Nov 2011 05:06:30 +0000 (05:06 +0000)]
Flesh out some slightly dirty reset/channel change serialisation code
for the ath(4) driver.

Currently, there's nothing stopping reset, channel change and general
TX/RX from overlapping with each other. This wasn't a big deal with
pre-11n traffic as it just results in some dropped frames.
It's possible this may have also caused some inconsistencies and
badly-setup hardware.

Since locks can't be held across all of this (the Linux solution)
due to LORs with the network stack locks, some state counter
variables are used to track what parts of the code the driver is
currently in.

When the hardware is being reset, it disables the taskqueue and
waits for pending interrupts, tx, rx and tx completion before
it begins the reset or channel change.

TX and RX both abort if called during an active reset or channel
change.

Finally, the reset path now doesn't flush frames if ATH_RESET_NOLOSS
is set. Instead, completed TX and RX frames are passed back up to
net80211 before the reset occurs.

This is not without problems:

* Raw frame xmit are just dropped, rather than placed on a queue.
  The net80211 stack should be the one which queues these frames
  rather than the driver.

* It's all very messy. It'd be better if these hardware operations
  were serialised on some kind of work queue, rather than hoping
  they can be run in parallel.

* The taskqueue block/unblock may occur in parallel with the
  newstate() function - which shuts down the taskqueue and restarts
  it once the new state is known. It's likely these operations should
  be refcounted so the taskqueue is restored once no other areas
  in the code wish to suspend operations.

* .. interrupt disable/enable should likely be refcounted as well.

With this work, the driver does not drop frames during stuck beacon
or fatal errors and thus 11n traffic continues to run correctly.
Default and full resets however do still drop frames and it's possible
this may occur, causing traffic loss and session stalls.

Sponsored by: Hobnob, Inc.

12 years agoAdd unicode support to msdosfs and smbfs; original pathes from imura,
kevlo [Fri, 18 Nov 2011 03:05:20 +0000 (03:05 +0000)]
Add unicode support to msdosfs and smbfs; original pathes from imura,
bug fixes by Kuan-Chung Chiu <buganini at gmail dot com>.

Tested by me in production for several days at work.

12 years agoMore zfs(8) manpage fixes:
mm [Fri, 18 Nov 2011 02:25:54 +0000 (02:25 +0000)]
More zfs(8) manpage fixes:
- remove shareiscsi property
- mark casesensitivity property as unsupported
- remove reference to Solaris Administration Guide

MFC after: 1 week

12 years agoFix reference to fsync(2).
mm [Fri, 18 Nov 2011 02:06:09 +0000 (02:06 +0000)]
Fix reference to fsync(2).
Add more references to SEE ALSO section.

MFC after: 1 week

12 years agoUpdate and desolarization of zfs(8) and zpool(8) manual pages:
mm [Fri, 18 Nov 2011 01:28:52 +0000 (01:28 +0000)]
Update and desolarization of zfs(8) and zpool(8) manual pages:
- synchronized to match new vendor code (Illumos rev. 13513) [1]
- removed references to sun commands (replaced with FreeBSD commands)
- removed ATTRIBUTES sections
- updated SEE ALSO sections
- properly updated copyright information (required by CDDL)
- remove empty lines via MANFILTER

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

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

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

12 years ago- be more precise about the unit of measurement
eadler [Thu, 17 Nov 2011 23:04:43 +0000 (23:04 +0000)]
- be more precise about the unit of measurement

Approved by: jhb
MFC after: 3 days

12 years agoImplement prefetch_read_{many,once}() for sparc64 and fix compilation on
marius [Thu, 17 Nov 2011 22:59:16 +0000 (22:59 +0000)]
Implement prefetch_read_{many,once}() for sparc64 and fix compilation on
other !x86 architectures.

12 years agoFix compilation on ILP32.
marius [Thu, 17 Nov 2011 22:56:40 +0000 (22:56 +0000)]
Fix compilation on ILP32.

12 years agoAdd preliminary support for RTL8168/8111F PCIe Gigabit ethernet.
yongari [Thu, 17 Nov 2011 22:07:50 +0000 (22:07 +0000)]
Add preliminary support for RTL8168/8111F PCIe Gigabit ethernet.

H/W donated by: RealTek Semiconductor Corp.

12 years agoAdd preliminary support for second generation RTL8105E PCIe
yongari [Thu, 17 Nov 2011 21:24:56 +0000 (21:24 +0000)]
Add preliminary support for second generation RTL8105E PCIe
FastEthernet.

H/W donated by: RealTek Semiconductor Corp.

12 years agoIntroduce CAM_SIM_POLLED SIM flag, indicating that it works in polling mode.
mav [Thu, 17 Nov 2011 21:07:56 +0000 (21:07 +0000)]
Introduce CAM_SIM_POLLED SIM flag, indicating that it works in polling mode.
It blocks CAM SWI usage on requests completion, unneeded because of polling
and denied during kernel dumping because of blocked scheduler.

Before r198899 there was periph flag CAM_PERIPH_POLLED, but that was wrong,
because there is whole SIM is polled or handled by SWI, not a single periph.

Tested by: kib
MFC after: 1 month

12 years agoRevert r227538, since it doesn't compile with clang at all (it doesn't
dim [Thu, 17 Nov 2011 21:06:53 +0000 (21:06 +0000)]
Revert r227538, since it doesn't compile with clang at all (it doesn't
allow the built-in operations to be redefined, at least not without
excessive force).

Instead, just disable LLVM's support for atomic operations for now.
Nothing in either clang or the tablegen tools currently depends on it.

This still allows users of head built before r198344 to upgrade to
top-of-head seamlessly.

12 years agoChange the way how "not implemented" AHCI channels handled. Instead of
mav [Thu, 17 Nov 2011 20:46:51 +0000 (20:46 +0000)]
Change the way how "not implemented" AHCI channels handled. Instead of
completely skipping them, create ahcich devices for them to allocate unit
numbers, but mark them as disabled to prevent driver probe and attach.

Last time some BIOSes tend to report unused channels as "not implemented".
This change makes ahcichX devices numbering consistent, independently of
connected disks. It makes per-channel driver hints usable and CAM devices
wiring possible on such systems.

12 years agoSome cleanup:
brueffer [Thu, 17 Nov 2011 17:57:35 +0000 (17:57 +0000)]
Some cleanup:
- Start sentences on new lines
- Mark up sysctl variables
- Use %d in sysctl variables to denote the index, as we do in other manpages

12 years agoWire the kernel text RWX, rather than RX. We're not quite ready
marcel [Thu, 17 Nov 2011 15:51:03 +0000 (15:51 +0000)]
Wire the kernel text RWX, rather than RX. We're not quite ready
for having kernel text non-writable, because we still need to
apply relocations. On top of that, the PBVM page table has all
pages marked as RWX, so it's an inconsistency to begin with.

12 years agoUse a global __pure2 function instead of a global register variable for
nwhitehorn [Thu, 17 Nov 2011 15:49:42 +0000 (15:49 +0000)]
Use a global __pure2 function instead of a global register variable for
curthread, like on x86 and sparc64. This makes the kernel somewhat more
clang friendly, which doesn't support global register variables.

12 years agoAdd an extra invariant here which was useful on 64-bit CPUs.
nwhitehorn [Thu, 17 Nov 2011 15:48:12 +0000 (15:48 +0000)]
Add an extra invariant here which was useful on 64-bit CPUs.

12 years ago- be more precise about the unit of measurement
eadler [Thu, 17 Nov 2011 15:46:37 +0000 (15:46 +0000)]
- be more precise about the unit of measurement

Submitted by: Oliver Pinter <oliver.pntr@gmail.com>
Approved by: jhb
MFC after: 3 days

12 years agoDo pmap update only on active CPUs.
jchandra [Thu, 17 Nov 2011 13:14:59 +0000 (13:14 +0000)]
Do pmap update only on active CPUs.

The pmap update_page/invalidate_page/invalidate_all operations has to be
done only on active cpus. In the simplest case, if the process is not
active on any other CPUs, we can just do the operation on the current CPU.

This change replaces the call to smp_rendezvous() for these operations with
smp_rendezvous_cpus() in case there more than one active CPU, or with a direct
function call if there is just one active CPU.

This change give significant performance increase in fork/exec benchmarks
on XLR/XLS/XLP with 32 cpus.

Reviewed by: alc

12 years agoFix typo.
kib [Thu, 17 Nov 2011 13:14:07 +0000 (13:14 +0000)]
Fix typo.

Submitted by: arundel
MFC after: 3 days

12 years agoBring in support for netmap, a framework for very efficient packet
luigi [Thu, 17 Nov 2011 12:17:39 +0000 (12:17 +0000)]
Bring in support for netmap, a framework for very efficient packet
I/O from userspace, capable of line rate at 10G, see

http://info.iet.unipi.it/~luigi/netmap/

At this time I am bringing in only the generic code (sys/dev/netmap/
plus two headers under sys/net/), and some sample applications in
tools/tools/netmap. There is also a manpage in share/man/man4 [1]

In order to make use of the framework you need to build a kernel
with "device netmap", and patch individual drivers with the code
that you can find in

sys/dev/netmap/head.diff

The file will go away as the relevant pieces are committed to
the various device drivers, which should happen in a few days
after talking to the driver maintainers.

Netmap support is available at the moment for Intel 10G and 1G
cards (ixgbe, em/lem/igb), and for the Realtek 1G card ("re").
I have partial patches for "bge" and am starting to work on "cxgbe".
Hopefully changes are trivial enough so interested third parties
can submit their patches. Interested people can contact me
for advice on how to add netmap support to specific devices.

CREDITS:
    Netmap has been developed by Luigi Rizzo and other collaborators
    at the Universita` di Pisa, and supported by EU project CHANGE
    (http://www.change-project.eu/)
    The code is distributed under a BSD Copyright.

[1] In my opinion is a bad idea to have all manpage in one directory.
  We should place kernel documentation in the same dir that contains
  the code, which would make it much simpler to keep doc and code
  in sync, reduce the clutter in share/man/ and incidentally is
  the policy used for all of userspace code.
  Makefiles and doc tools can be trivially adjusted to find the
  manpages in the relevant subdirs.

12 years agoAdd DTS for the Freescale P2020DS.
raj [Thu, 17 Nov 2011 12:08:12 +0000 (12:08 +0000)]
Add DTS for the Freescale P2020DS.

Obtained from: Freescale

12 years agoQuirk all of ALCOR's mass storage devices instead of
hselasky [Thu, 17 Nov 2011 10:46:51 +0000 (10:46 +0000)]
Quirk all of ALCOR's mass storage devices instead of
quirking individual devices.

Submitted by: Dmitry Luhtionov
MFC after: 1 week

12 years agoEliminate end-of-line white space.
alc [Thu, 17 Nov 2011 06:54:49 +0000 (06:54 +0000)]
Eliminate end-of-line white space.

12 years agoPass CVWAIT flags to kernel, this should handle
davidxu [Thu, 17 Nov 2011 01:43:50 +0000 (01:43 +0000)]
Pass CVWAIT flags to kernel, this should handle
timeout correctly for pthread_cond_timedwait when
it uses kernel-based condition variable.

PR: 162403
Submitted by: jilles
MFC after: 3 days

12 years agoUpgrade to BIND 9.8.1-P1 to address the following DDOS bug:
dougb [Thu, 17 Nov 2011 00:25:35 +0000 (00:25 +0000)]
Upgrade to BIND 9.8.1-P1 to address the following DDOS bug:

Recursive name servers are failing with an assertion:
INSIST(! dns_rdataset_isassociated(sigrdataset))

At this time it is not thought that authoritative-only servers
are affected, but information about this bug is evolving rapidly.

Because it may be possible to trigger this bug even on networks
that do not allow untrusted users to access the recursive name
servers (perhaps via specially crafted e-mail messages, and/or
malicious web sites) it is recommended that ALL operators of
recursive name servers upgrade immediately.

For more information see:
https://www.isc.org/software/bind/advisories/cve-2011-tbd
which will be updated as more information becomes available.

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4313

12 years agoDisable PCIe ASPM (Active State Power Management) for all
yongari [Wed, 16 Nov 2011 23:29:27 +0000 (23:29 +0000)]
Disable PCIe ASPM (Active State Power Management) for all
controllers.
More and more RealTek controllers started to implement EEE feature.
Vendor driver seems to load a kind of firmware for EEE with
additional PHY fixups.  It is known that the EEE feature may need
ASPM support.  Unfortunately there is no documentation for EEE of
the controller so enabling ASPM may cause more problems.

12 years agoAdd missing driver lock in SIOCSIFCAP handler.
yongari [Wed, 16 Nov 2011 22:09:14 +0000 (22:09 +0000)]
Add missing driver lock in SIOCSIFCAP handler.

12 years agoAdd preliminary support for RTL8411 PCIe Gigabit ethernet with
yongari [Wed, 16 Nov 2011 22:05:38 +0000 (22:05 +0000)]
Add preliminary support for RTL8411 PCIe Gigabit ethernet with
integrated card reader.

H/W donated by: RealTek Semiconductor Corp.

12 years agoAdd helpful clarification text. While not strictly necessary, these
imp [Wed, 16 Nov 2011 22:02:59 +0000 (22:02 +0000)]
Add helpful clarification text.  While not strictly necessary, these
few words make this man page much easier to understand without
re-reading prior parts of the man page.

12 years agoConstify arguments for locking KPIs where possible.
pjd [Wed, 16 Nov 2011 21:51:17 +0000 (21:51 +0000)]
Constify arguments for locking KPIs where possible.

This enables locking consumers to pass their own structures around as const and
be able to assert locks embedded into those structures.

Reviewed by: ed, kib, jhb

12 years agoAdd preliminary support for RTL8402 PCIe FastEthernet with
yongari [Wed, 16 Nov 2011 21:37:45 +0000 (21:37 +0000)]
Add preliminary support for RTL8402 PCIe FastEthernet with
integrated card reader.

H/W donated by: RealTek Semiconductor Corp.

12 years agoCopy over the ASM_DECLARE_FUNCTION_SIZE macro from linux64.h. This macro
andreast [Wed, 16 Nov 2011 21:22:51 +0000 (21:22 +0000)]
Copy over the ASM_DECLARE_FUNCTION_SIZE macro from linux64.h. This macro
declares the proper size of a function. Without this macro recent GNU as will
complain about with:
'Error: .size expression for main does not evaluate to a constant.'

Up to now we produce this:

.L.main:
  ....
.size   main, .-main

With the macro defined the output is this:

.L.main:
  ....
.size   main,.-.L.main

This affects only the 64-bit compiler.
Tested with world and kernel on both, 32 and 64-bit powerpc.

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

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

Tested by: das

12 years agoConstify stack argument for functions that don't modify it.
pjd [Wed, 16 Nov 2011 19:06:55 +0000 (19:06 +0000)]
Constify stack argument for functions that don't modify it.

Reviewed by: ed, kib, jhb

12 years agoFix make universe.
pjd [Wed, 16 Nov 2011 18:42:43 +0000 (18:42 +0000)]
Fix make universe.

12 years agoThe sys/sysctl.h header is needed when MFI_DEBUG is defined.
kib [Wed, 16 Nov 2011 18:42:39 +0000 (18:42 +0000)]
The sys/sysctl.h header is needed when MFI_DEBUG is defined.

Nod from: jhb

12 years agoFix build, use %d for int value formatting.
kib [Wed, 16 Nov 2011 18:41:59 +0000 (18:41 +0000)]
Fix build, use %d for int value formatting.

12 years agoAdd the sfxge(4) device driver, providing support for 10Gb Ethernet adapters
philip [Wed, 16 Nov 2011 17:11:13 +0000 (17:11 +0000)]
Add the sfxge(4) device driver, providing support for 10Gb Ethernet adapters
based on Solarflare SFC9000 family controllers.  The driver supports jumbo
frames, transmit/receive checksum offload, TCP Segmentation Offload (TSO),
Large Receive Offload (LRO), VLAN checksum offload, VLAN TSO, and Receive Side
Scaling (RSS) using MSI-X interrupts.

This work was sponsored by Solarflare Communications, Inc.

My sincere thanks to Ben Hutchings for doing a lot of the hard work!

Sponsored by: Solarflare Communications, Inc.
MFC after: 3 weeks

12 years agoRefactor the code that performs physically contiguous memory allocation,
alc [Wed, 16 Nov 2011 16:46:09 +0000 (16:46 +0000)]
Refactor the code that performs physically contiguous memory allocation,
yielding a new public interface, vm_page_alloc_contig().  This new function
addresses some of the limitations of the current interfaces, contigmalloc()
and kmem_alloc_contig().  For example, the physically contiguous memory that
is allocated with those interfaces can only be allocated to the kernel vm
object and must be mapped into the kernel virtual address space.  It also
provides functionality that vm_phys_alloc_contig() doesn't, such as wiring
the returned pages.  Moreover, unlike that function, it respects the low
water marks on the paging queues and wakes up the page daemon when
necessary.  That said, at present, this new function can't be applied to all
types of vm objects.  However, that restriction will be eliminated in the
coming weeks.

From a design standpoint, this change also addresses an inconsistency
between vm_phys_alloc_contig() and the other vm_phys_alloc*() functions.
Specifically, vm_phys_alloc_contig() manipulated vm_page fields that other
functions in vm/vm_phys.c didn't.  Moreover, vm_phys_alloc_contig() knew
about vnodes and reservations.  Now, vm_page_alloc_contig() is responsible
for these things.

Reviewed by: kib
Discussed with: jhb

12 years agoAdd single-message MSI support to mfi(4). It is disabled by default but
jhb [Wed, 16 Nov 2011 15:39:27 +0000 (15:39 +0000)]
Add single-message MSI support to mfi(4).  It is disabled by default but
can be enabled via the hw.mfi.msi tunable.  Many mfi(4) controllers also
support MSI-X, but in testing it seems that many adapters do not work with
MSI-X but do work with MSI.

MFC after: 2 weeks

12 years agoHandle invalid large values for getdirentries(2) data buffer size.
pho [Wed, 16 Nov 2011 10:11:55 +0000 (10:11 +0000)]
Handle invalid large values for getdirentries(2) data buffer size.

In collaboration with: kib
Reviewed by: des
Reported by: The iknowthis syscall fuzzer.
MFC after: 1 week

12 years agoWas chasing down a failure to load f/w on a 2400. It turns out that the card
mjacob [Wed, 16 Nov 2011 02:52:24 +0000 (02:52 +0000)]
Was chasing down a failure to load f/w on a 2400. It turns out that the card
is actually broken, or needs a BIOS upgrade for 64 bit loads, but this uncovered
a couple of misplaced opcode definitions and some missing continual mbox command
cases, so might as well update them here.

12 years agoThe maximum TSO frame size should be:
bz [Wed, 16 Nov 2011 02:00:55 +0000 (02:00 +0000)]
The maximum TSO frame size should be:
maximum IP datagram size (65535 bytes) +
Ethernet header size (14 bytes) +
2 * VLAN tag size (4 bytes) [1].

[1] We need to multiply by 2 to account for the double VLAN tag
    provision added in IEEE 802.1ad.

Submitted by: David Somayajulu (david.somayajulu qlogic.com)
MFC after: 4 days

12 years agoModify the new NFS client so that nfs_fsync() only calls ncl_flush()
rmacklem [Tue, 15 Nov 2011 23:35:43 +0000 (23:35 +0000)]
Modify the new NFS client so that nfs_fsync() only calls ncl_flush()
for regular files. Since other file types don't write into the
buffer cache, calling ncl_flush() is almost a no-op. However, it does
clear the NMODIFIED flag and this shouldn't be done by nfs_fsync() for
directories.

MFC after: 2 weeks

12 years agoSome brands of XHCI controllers needs more time to reset.
hselasky [Tue, 15 Nov 2011 20:48:57 +0000 (20:48 +0000)]
Some brands of XHCI controllers needs more time to reset.

Reported by: Jan Henrik Sylvester
MFC after: 1 week

12 years agoSet the MTU of an path to an approriate value if the interface MTU
tuexen [Tue, 15 Nov 2011 20:41:50 +0000 (20:41 +0000)]
Set the MTU of an path to an approriate value if the interface MTU
can't be determined.

MFC after: 3 days.

12 years agoDefine curthread as an inline function that loads the thread pointer
marius [Tue, 15 Nov 2011 20:17:18 +0000 (20:17 +0000)]
Define curthread as an inline function that loads the thread pointer
directly from g7, the pcpu pointer. This guarantees correct behavior
when the thread migrates to a different CPU.
Commit message stolen from r205431. Additional testing by Peter Jeremy.

MFC after: 3 days

12 years agoLLVM uses atomic operations, which are not supported on i386 and GCC
dim [Tue, 15 Nov 2011 20:15:58 +0000 (20:15 +0000)]
LLVM uses atomic operations, which are not supported on i386 and GCC
emits calls for them, rather than expanding them inline.  Older FreeBSD
versions compile for i386 by default and as such we end up with
unresolved symbols when we build LLVM's TableGen utility as a build
tool on them.  Add the functions that GCC emits here, but don't bother
to make them atomic. Such is not needed.

Submitted by: marcel
MFC after: 1 week

12 years agoAs it turns out, r186347 actually is insufficient to avoid the use of the
marius [Tue, 15 Nov 2011 20:11:03 +0000 (20:11 +0000)]
As it turns out, r186347 actually is insufficient to avoid the use of the
curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style
curthread implementation on sparc64, crashing the kernel in its early
cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the
things we need for that, which leads to a chicken-and-egg problem). What
happens is that due to the fact that the idea of r210623 actually is to
allow the compiler to cache invocations of curthread, it factors out
obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to
before the branch based on kobj_mutex_inited when compiling the kernel
without the debugging options. So change kobj_class_compile_static(9)
to just never acquire kobj_mtx, effectively restricting it to its
documented use, and add a kobj_init_static(9) for initializing objects
using a class compiled with the former and that also avoids using mutex(9)
(and malloc(9)). Also assert in both of these functions that they are
used in their intended way only.
While at it, inline kobj_register_method() and kobj_unregister_method()
as there wasn't much point for factoring them out in the first place
and so that a reader of the code has to figure out the locking for
fewer functions missing a KOBJ_ASSERT.
Tested on powerpc{,64} by andreast.

Reviewed by: nwhitehorn (earlier version), jhb
MFC after: 3 days

12 years agoFurther automate production release generation by naming files the right
nwhitehorn [Tue, 15 Nov 2011 18:49:27 +0000 (18:49 +0000)]
Further automate production release generation by naming files the right
things and generating checksums.

MFC after: 1 week

12 years ago- add support for Titan VScom PCIex-800H
eadler [Tue, 15 Nov 2011 17:53:29 +0000 (17:53 +0000)]
- add support for Titan VScom PCIex-800H

PR: kern/124128
Submitted by: Maxim Frolov <maxim.frolov.07@gmail.com> (original)
Approved by: jhb
MFC after: 1 week

12 years ago- add support for Broadcom 802.11bg/EDGE/GPRS CardBus (Serial)
eadler [Tue, 15 Nov 2011 17:15:09 +0000 (17:15 +0000)]
- add support for Broadcom 802.11bg/EDGE/GPRS CardBus (Serial)
- correct mislabeling of 0x432214e4 device

PR: kern/119606
Submitted by: Joe Greco <jgreco@ns.sol.net>
Approved by: jhb
MFC after: 1 week

12 years agoAdd netcat (nc) to /rescue.
des [Tue, 15 Nov 2011 16:20:39 +0000 (16:20 +0000)]
Add netcat (nc) to /rescue.

MFC after: 3 weeks

12 years agoUpdate the device pager interface, while keeping the compatibility
kib [Tue, 15 Nov 2011 14:40:00 +0000 (14:40 +0000)]
Update the device pager interface, while keeping the compatibility
layer for old KPI and KBI.  New interface should be used together with
d_mmap_single cdevsw method.

Device pager can be allocated with the cdev_pager_allocate(9)
function, which takes struct cdev_pager_ops, containing
constructor/destructor and page fault handler methods supplied by
driver.

Constructor and destructor, called at the pager allocation and
deallocation time, allow the driver to handle per-object private data.

The pager handler is called to handle page fault on the vm map entry
backed by the driver pager. Driver shall return either the vm_page_t
which should be mapped, or error code (which does not cause kernel
panic anymore). The page handler interface has a placeholder to
specify the access mode causing the fault, but currently PROT_READ is
always passed there.

Sponsored by: The FreeBSD Foundation
Reviewed by: alc
MFC after: 1 month

12 years agoRemove the condition that is always true.
kib [Tue, 15 Nov 2011 14:09:53 +0000 (14:09 +0000)]
Remove the condition that is always true.

Submitted by: alc
MFC after: 1 week

12 years agoOn some laptops it is important to re-open /dev/psm after resume. moused(8)
glebius [Tue, 15 Nov 2011 12:59:07 +0000 (12:59 +0000)]
On some laptops it is important to re-open /dev/psm after resume. moused(8)
was capable to do this upon SIGHUP for more than a decade. Automate this
via rc.resume in default installation.

12 years agoRemoved extra PRELE() call.
pho [Tue, 15 Nov 2011 09:23:21 +0000 (09:23 +0000)]
Removed extra PRELE() call.

MFC after: 1 week

12 years agoKNF
obrien [Tue, 15 Nov 2011 06:50:10 +0000 (06:50 +0000)]
KNF

12 years agoImprove the chances of matching an outputted string with the line of code.
obrien [Tue, 15 Nov 2011 06:44:07 +0000 (06:44 +0000)]
Improve the chances of matching an outputted string with the line of code.

12 years agoA regression test to ensure that arc4random returns different sequences
das [Tue, 15 Nov 2011 05:55:15 +0000 (05:55 +0000)]
A regression test to ensure that arc4random returns different sequences
in parent and child processes after a fork.

12 years agoFurther reduce diffs with OpenBSD's arc4random. The main functional
das [Tue, 15 Nov 2011 05:49:24 +0000 (05:49 +0000)]
Further reduce diffs with OpenBSD's arc4random.  The main functional
change here is to ensure that when a process forks after arc4random
is seeded, the parent and child don't observe the same random sequence.
OpenBSD's fix introduces some additional overhead in the form of a
getpid() call.  This could be improved upon, e.g., by setting a flag
in fork(), if it proves to be a problem.

This was discussed with secteam (simon, csjp, rwatson) in 2008, shortly
prior to my going out of town and forgetting all about it.  The conclusion
was that the problem with forks is worrisome, but it doesn't appear to
have introduced an actual vulnerability for any known programs.

The only significant remaining difference between our arc4random and
OpenBSD's is in how we seed the generator in arc4_stir().

12 years agoSync the style, comments, and variable names of arc4random.c with
das [Tue, 15 Nov 2011 05:45:46 +0000 (05:45 +0000)]
Sync the style, comments, and variable names of arc4random.c with
OpenBSD's version (r1.22).  While some of our style changes were
indeed small improvements, being able to easily track functionality
changes in OpenBSD seems more useful.

Also fix style bugs in the FreeBSD-specific parts of this file.

No functional changes, as verified with md5.

12 years agoReformat comment to be more readable in standard Xterm.
obrien [Tue, 15 Nov 2011 01:48:53 +0000 (01:48 +0000)]
Reformat comment to be more readable in standard Xterm.
(while I'm here, wrap other long lines)

12 years agoMove the setting of the default value for nm_wcommitsize to
rmacklem [Tue, 15 Nov 2011 01:39:02 +0000 (01:39 +0000)]
Move the setting of the default value for nm_wcommitsize to
before the nfs_decode_args() call in the new NFS client, so
that a specfied command line value won't be overwritten.
Also, modify the calculation for small values of desiredvnodes
to avoid an unusually large value or a divide by zero crash.
It seems that the default value for nm_wcommitsize is very
conservative and may need to change at some time.

PR: kern/159351
Submitted by: onwahe at gmail.com (earlier version)
Reviewed by: jhb
MFC after: 2 weeks

12 years agoRe-apply r227466 to generate hardware notes for mps(4) and mvs(4), the issues
brueffer [Mon, 14 Nov 2011 23:01:08 +0000 (23:01 +0000)]
Re-apply r227466 to generate hardware notes for mps(4) and mvs(4), the issues
were fixes.

Thanks to: gjb, manolis
Pointy hat ++: brueffer
MFC after: 3 days

12 years agoRemove list nesting in the hardware notes section, thus making it compatible with
brueffer [Mon, 14 Nov 2011 22:57:47 +0000 (22:57 +0000)]
Remove list nesting in the hardware notes section, thus making it compatible with
the hardware notes generation script.

MFC after: 3 days

12 years agoClarify hw.ti.%d.dac tunable.
yongari [Mon, 14 Nov 2011 22:16:12 +0000 (22:16 +0000)]
Clarify hw.ti.%d.dac tunable.

12 years agoDocument newly introduced a loader tunable and sysctl variables.
yongari [Mon, 14 Nov 2011 21:59:49 +0000 (21:59 +0000)]
Document newly introduced a loader tunable and sysctl variables.

12 years agoOverhaul bus_dma(9) usage in driver:
yongari [Mon, 14 Nov 2011 20:38:14 +0000 (20:38 +0000)]
Overhaul bus_dma(9) usage in driver:
 - Don't use a single big DMA block for all rings. Create separate
   DMA area for each ring instead.  Currently the following DMA
   areas are created:
Event ring, standard RX ring, jumbo RX ring, RX return ring,
hardware MAC statistics and producer/consumer status area.
   For Tigon II, mini RX ring and TX ring are additionally created.
 - Added missing bus_dmamap_sync(9) in various TX/RX paths.
 - TX ring is no longer created for Tigon 1 such that it saves more
   resources on Tigon 1.
 - Data sheet is not clear about alignment requirement of each ring
   so use 32 bytes alignment for normal DMA area but use 64 bytes
   alignment for jumbo RX ring where the extended RX descriptor
   size is 64 bytes.
 - For each TX/RX buffers use separate DMA tag(e.g. the size of a
   DMA segment, total size of DMA segments etc).
 - Tigon allows separate DMA area for event producer, RX return
   producer and TX consumer which is really cool feature.  This
   means TX and RX path could be independently run in parallel.
   However ti(4) uses a single driver lock so it's meaningless
   to have separate DMA area for these producer/consumer such that
   this change creates a single status DMA area.
 - It seems Tigon has no limits on DMA address space and I also
   don't see any problem with that but old comments in driver
   indicates there could be issues on descriptors being located in
   64bit region.  Introduce a tunable, dev.ti.%d.dac, to disable
   using 64bit DMA in driver. The default is 0 which means it would
   use full 64bit DMA.  If there are DMA issues, users can disable
   it by setting the tunable to 0.
 - Do not increase watchdog timer in ti_txeof(). Previously driver
   increased the watchdog timer whenever there are queued TX frames.
 - When stat ticks is set to 0, skip processing ti_stats_update(),
   avoiding bus_dmamap_sync(9) and updating if_collisions counter.
 - MTU does not include FCS bytes, replace it with
   ETHER_VLAN_ENCAP_LEN.

With these changes, ti(4) should work on PAE environments.
Many thanks to Jay Borkenhagen for remote hardware access.

12 years ago- add my co-mentors
rm [Mon, 14 Nov 2011 20:32:39 +0000 (20:32 +0000)]
- add my co-mentors

Approved by: novel (mentor)

12 years agoTemporary revert r227009 to fix freeze on UP systems without PREEMPTION.
mav [Mon, 14 Nov 2011 19:32:05 +0000 (19:32 +0000)]
Temporary revert r227009 to fix freeze on UP systems without PREEMPTION.

Before r215687, if some withered geom or provider could not be destroyed,
g_event thread went to sleep for 0.1s before retrying. After that change
it is just restarting immediately. r227009 made orphaned (withered) provider
to not detach immediately, but only after context switch. That made loop
inside g_event thread infinite on UP systems without PREEMPTION.

To address original problem with possible dead lock addressed by r227009
we have to fix r215687 change first, that needs some time to think and test.

12 years agoExport sysctl node for various interrupt moderation parameters and
yongari [Mon, 14 Nov 2011 19:10:20 +0000 (19:10 +0000)]
Export sysctl node for various interrupt moderation parameters and
have administrators control them.  ti(4) provides a character
device to control various other features of driver via ioctls but
users had to write their own code to manipulate these parameters.
It seems some default values for these parameters are not optimal
on today's system but leave it as it was and let administrators
change them.  The following parameters could be changed:

dev.ti.%d.rx_coal_ticks
dev.ti.%d.rx_max_coal_bds
dev.ti.%d.tx_coal_ticks
dev.ti.%d.tx_max_coal_bds
dev.ti.%d.tx_buf_ratio
dev.ti.%d.stat_ticks

The interface has to be brought down and up again before a change
takes effect.

ti(4) controller supports hardware MAC counters with additional
DMA statistics.  So it's doable to export these counters via
sysctl interface.  Unfortunately, these counters are cumulative
such that driver have to either send an explicit clear command to
controller after extracting them or have to maintain internal
counters to get actual changes.  Neither look good to me so
counters were not exported via sysctl.

12 years agoAdd DTS for the Freescale P1020RDB.
marcel [Mon, 14 Nov 2011 19:06:28 +0000 (19:06 +0000)]
Add DTS for the Freescale P1020RDB.

12 years agoFinish making 'wcommitsize' an NFS client mount option.
jhb [Mon, 14 Nov 2011 18:52:07 +0000 (18:52 +0000)]
Finish making 'wcommitsize' an NFS client mount option.

Reviewed by: rmacklem
MFC after: 1 week

12 years agoAdd DTS for the Freescale P3041DS.
marcel [Mon, 14 Nov 2011 18:51:39 +0000 (18:51 +0000)]
Add DTS for the Freescale P3041DS.

12 years agoIt's bad idea to allocate large memory, 4KB, from stack.
yongari [Mon, 14 Nov 2011 18:40:04 +0000 (18:40 +0000)]
It's bad idea to allocate large memory, 4KB, from stack.
Pre-allocate the memory in device attach time. While I'm here
remove unnecessary reassignment of error variable as it was already
initialized. Also added a missing driver lock in TIIOCSETTRACE
handler.

12 years agoSync with the old NFS client: Remove an obsolete comment.
jhb [Mon, 14 Nov 2011 18:23:50 +0000 (18:23 +0000)]
Sync with the old NFS client: Remove an obsolete comment.

12 years agoRemove a few bits of FreeBSD 2.x compatibility code.
rmh [Mon, 14 Nov 2011 18:21:27 +0000 (18:21 +0000)]
Remove a few bits of FreeBSD 2.x compatibility code.

Approved by: kib (mentor)

12 years ago- Split out a kern_posix_fadvise() from the posix_fadvise() system call so
jhb [Mon, 14 Nov 2011 18:00:15 +0000 (18:00 +0000)]
- Split out a kern_posix_fadvise() from the posix_fadvise() system call so
  it can be used by in-kernel consumers.
- Make kern_posix_fallocate() public.
- Use kern_posix_fadvise() and kern_posix_fallocate() to implement the
  freebsd32 wrappers for the two system calls.

12 years agomdoc fix for r227499.
andre [Mon, 14 Nov 2011 15:57:03 +0000 (15:57 +0000)]
mdoc fix for r227499.

Reported by: brueffer

12 years agoRemove mention of ss_fltsz and ss_fltsz_local which were retired in r226447.
andre [Mon, 14 Nov 2011 15:14:42 +0000 (15:14 +0000)]
Remove mention of ss_fltsz and ss_fltsz_local which were retired in r226447.

12 years agoNote the ip_len bug fixed in r226105 in the BUGS section.
andre [Mon, 14 Nov 2011 15:10:42 +0000 (15:10 +0000)]
Note the ip_len bug fixed in r226105 in the BUGS section.

12 years agoImport upstream changesets for the output of the "zpool" command:
mm [Mon, 14 Nov 2011 08:29:49 +0000 (08:29 +0000)]
Import upstream changesets for the output of the "zpool" command:

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

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

Obtained from: Illumos (issues 952, 1337; changesets 13384, 13432)
MFC after: 1 week

12 years agoConstify args to copyiniov and copyinuio.
alfred [Mon, 14 Nov 2011 07:12:10 +0000 (07:12 +0000)]
Constify args to copyiniov and copyinuio.

12 years agoSince NFSv4 byte range locking only works for regular files,
rmacklem [Mon, 14 Nov 2011 00:10:11 +0000 (00:10 +0000)]
Since NFSv4 byte range locking only works for regular files,
add a sanity check for the vnode type to the NFSv4 client.

MFC after: 2 weeks

12 years agoMove the assignment of default values for some mount options
rmacklem [Sun, 13 Nov 2011 23:09:26 +0000 (23:09 +0000)]
Move the assignment of default values for some mount options
to before the nfs_decode_args() call in the new NFS client,
so they don't overwrite the value specified on the command line.

MFC after: 2 weeks

12 years ago- new sentence should start on new line.
eadler [Sun, 13 Nov 2011 17:07:43 +0000 (17:07 +0000)]
-  new sentence should start on new line.

PR: bin/146541
Submitted by: bjk
Approved by: bjk

12 years agoHide some more macros that will break C++ when compiling in C++ mode.
theraven [Sun, 13 Nov 2011 17:07:26 +0000 (17:07 +0000)]
Hide some more macros that will break C++ when compiling in C++ mode.

Approved by: dim (mentor)

12 years ago- fix duplicate "a a" in some comments
eadler [Sun, 13 Nov 2011 17:06:33 +0000 (17:06 +0000)]
- fix duplicate "a a" in some comments

Submitted by: eadler
Approved by: simon
MFC after: 3 days

12 years ago- add "check" option to MD5 and friends to compare files against known hash.
eadler [Sun, 13 Nov 2011 16:35:47 +0000 (16:35 +0000)]
- add "check" option to MD5 and friends to compare files against known hash.

PR: bin/146541
Submitted by: eadler
Reviewed by: jhell@dataix.net
Approved by: secteam (cperciva)
Approved by: cperciva
MFC after: 3 weeks

12 years agoThe spec says that FILE must be defined in wchar.h, but it wasn't. It
theraven [Sun, 13 Nov 2011 16:18:48 +0000 (16:18 +0000)]
The spec says that FILE must be defined in wchar.h, but it wasn't.  It
is now.  Also hide some macros in C++ mode that will break C++
namespaced calls.

Approved by: dim (mentor)

12 years agoDon't copy uninitialized memory. Also simplify the comparison
tuexen [Sun, 13 Nov 2011 11:53:18 +0000 (11:53 +0000)]
Don't copy uninitialized memory. Also simplify the comparison
of interface names.

MFC after: 3 days.

12 years agoTo limit amount of the kernel memory allocated, and to optimize the
kib [Sun, 13 Nov 2011 10:28:01 +0000 (10:28 +0000)]
To limit amount of the kernel memory allocated, and to optimize the
iteration over the fdsets, kern_select() limits the length of the
fdsets copied in by the last valid file descriptor index. If any bit
is set in a mask above the limit, current implementation ignores the
filedescriptor, instead of returning EBADF.

Fix the issue by scanning the tails of fdset before entering the
select loop and returning EBADF if any bit above last valid
filedescriptor index is set. The performance impact of the additional
check is only imposed on the (somewhat) buggy applications that pass
bad file descriptors to select(2) or pselect(2).

PR: kern/155606, kern/162379
Discussed with: cognet, glebius
Tested by: andreast (powerpc, all 64/32bit ABI combinations, big-endian),
       marius (sparc64, big-endian)
MFC after:    2 weeks

12 years agoFix spelling of extract.
alfred [Sun, 13 Nov 2011 06:39:49 +0000 (06:39 +0000)]
Fix spelling of extract.

Pointed out by: gcooper

12 years agoUtilize shell's IFS instead of forking ~6 processes to
alfred [Sun, 13 Nov 2011 03:18:57 +0000 (03:18 +0000)]
Utilize shell's IFS instead of forking ~6 processes to
handle splitting input files on a '|'.  This greatly
reduces the time taken to process several databases
during the update process.

Additionally add some more debug logging.

12 years agoThe default setting, daily_accounting_compress="NO", was causing
dougb [Sun, 13 Nov 2011 03:01:58 +0000 (03:01 +0000)]
The default setting, daily_accounting_compress="NO", was causing
only 1 old file to be saved, so fix this. Problem raised in the PR,
but actually required a different solution.

While I'm here, fix a very old off-by-one error causing 1 more file
than specified in daily_accounting_save to be saved because acct.0
was not taken into account (pun intended). Change that, and use a more
thorough method of finding old files to delete. Partly just because this
is the right thing to do, but also to silently fix the extra log that
would have been left behind forever with the previous method.

PR: conf/160848
Submitted by: Andrey Zonov <andrey@zonov.org>