]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoRemove a redundant check.
hrs [Fri, 2 Mar 2012 07:22:04 +0000 (07:22 +0000)]
Remove a redundant check.

12 years agoKill EoL whitespaces, and minor lint.
pluknet [Fri, 2 Mar 2012 05:55:45 +0000 (05:55 +0000)]
Kill EoL whitespaces, and minor lint.

12 years agoAdd ahci(4) and siis(4) to the hardware notes.
mav [Fri, 2 Mar 2012 05:16:53 +0000 (05:16 +0000)]
Add ahci(4) and siis(4) to the hardware notes.

MFC after: 1 week

12 years agoWrap another ATH_LOCK around the scanning flag.
adrian [Fri, 2 Mar 2012 03:11:53 +0000 (03:11 +0000)]
Wrap another ATH_LOCK around the scanning flag.

PR: kern/163318

12 years agoWrap the scan code state change stuff behind ATH_LOCK and the PCU fiddling
adrian [Fri, 2 Mar 2012 02:57:10 +0000 (02:57 +0000)]
Wrap the scan code state change stuff behind ATH_LOCK and the PCU fiddling
behind the PCU lock.

sc_scanning is being checked without ATH_LOCK behind held and could
in theory run from multiple threads.

12 years agoAttempt to catch scan cancellations at exactly the wrong time from occuring.
adrian [Fri, 2 Mar 2012 02:53:43 +0000 (02:53 +0000)]
Attempt to catch scan cancellations at exactly the wrong time from occuring.

The scan code unlocks the comlock and calls into the driver.  It then
assumes the state hasn't changed from underneath it.

Although I haven't seen this particular condition trigger, I'd like to
be informed if I or anyone else sees it.

What I'm thinking may occur:

* A cancellation comes in during the scan_end call;
* the cancel flag is set;
* but it's never checked, so scandone isn't updated;
* .. and the interface stays in the STA power save mode.

It's a subtle race, if it even exists.

PR: kern/163318

12 years agoProperly handle failures in igb_setup_msix() by returning 0 if MSI or MSI-X
jhb [Thu, 1 Mar 2012 22:13:10 +0000 (22:13 +0000)]
Properly handle failures in igb_setup_msix() by returning 0 if MSI or MSI-X
allocation fails.

Reviewed by: jfv
MFC after: 2 weeks

12 years ago- Add support for the Intel Sandy Bridge microarchitecture (both core and uncore...
davide [Thu, 1 Mar 2012 21:23:26 +0000 (21:23 +0000)]
- Add support for the Intel Sandy Bridge microarchitecture (both core and uncore counting events)
- New manpages with event lists.
- Add MSRs for the Intel Sandy Bridge microarchitecture

Reviewed by: attilio, brueffer, fabient
Approved by: gnn (mentor)
MFC after: 3 weeks

12 years agoProvide pre/post transfer method callbacks for icbbb
kan [Thu, 1 Mar 2012 20:58:20 +0000 (20:58 +0000)]
Provide pre/post transfer method callbacks for icbbb
clients.

These are helful when making certain drivers work on both Linux
and FreeBSD without changing the code flow too much.

Reviewed by: kib, wlosh
MFC after: 1 month

12 years agoAdd regression test for USB enumeration.
hselasky [Thu, 1 Mar 2012 20:45:17 +0000 (20:45 +0000)]
Add regression test for USB enumeration.

MFC after: 1 week

12 years agoUpdate the documentation on pci_get/set_powerstate(). These methods are
jhb [Thu, 1 Mar 2012 20:36:50 +0000 (20:36 +0000)]
Update the documentation on pci_get/set_powerstate().  These methods are
not ACPI-specific at all, but deal with PCI power states.  Also,
pci_set_powerstate() fails with EOPNOTSUPP if a request is made that the
underlying device does not support rather than falling back to somehow
setting D0.

12 years agoSort function prototypes.
jhb [Thu, 1 Mar 2012 20:32:02 +0000 (20:32 +0000)]
Sort function prototypes.

12 years agoStyle change: Expand redundant #if's. Remove a couple of empty lines.
hselasky [Thu, 1 Mar 2012 20:25:17 +0000 (20:25 +0000)]
Style change: Expand redundant #if's. Remove a couple of empty lines.

MFC after: 1 week

12 years agoAdd pci_save_state() and pci_restore_state() wrappers around
jhb [Thu, 1 Mar 2012 20:20:55 +0000 (20:20 +0000)]
Add pci_save_state() and pci_restore_state() wrappers around
pci_cfg_save() and pci_cfg_restore() for device drivers to use when
saving and restoring state (e.g. to handle device-specific resets).

Reviewed by: imp
MFC after: 2 weeks

12 years agoUpdate for adjusted types for boundary arguments in 232356.
jhb [Thu, 1 Mar 2012 20:19:21 +0000 (20:19 +0000)]
Update for adjusted types for boundary arguments in 232356.

12 years agoClose a detach race. Make sure all pending
hselasky [Thu, 1 Mar 2012 20:10:54 +0000 (20:10 +0000)]
Close a detach race. Make sure all pending
CCB's get canceled at device detach.

MFC after: 1 week

12 years agoAdd myself
ak [Thu, 1 Mar 2012 20:03:44 +0000 (20:03 +0000)]
Add myself

Approved by: itetcu (mentor)

12 years ago- Change contigmalloc() to use the vm_paddr_t type instead of an unsigned
jhb [Thu, 1 Mar 2012 19:58:34 +0000 (19:58 +0000)]
- Change contigmalloc() to use the vm_paddr_t type instead of an unsigned
  long for specifying a boundary constraint.
- Change bus_dma tags to use bus_addr_t instead of bus_size_t for boundary
  constraints.

These allow boundary constraints to be fully expressed for cases where
sizeof(bus_addr_t) != sizeof(bus_size_t).  Specifically, it allows a
driver to properly specify a 4GB boundary in a PAE kernel.

Note that this cannot be safely MFC'd without a lot of compat shims due
to KBI changes, so I do not intend to merge it.

Reviewed by: scottl

12 years agoAdd snd_hdspe(4) to the hardware notes.
brueffer [Thu, 1 Mar 2012 19:54:35 +0000 (19:54 +0000)]
Add snd_hdspe(4) to the hardware notes.

12 years agoReplace the three spaces with one tag.
davide [Thu, 1 Mar 2012 19:17:56 +0000 (19:17 +0000)]
Replace the three spaces with one tag.

Reported by: pjd
Approved by: gnn (mentor)

12 years agoThis change avoids a kernel deadlock on "snaplk" when using
mckusick [Thu, 1 Mar 2012 18:45:25 +0000 (18:45 +0000)]
This change avoids a kernel deadlock on "snaplk" when using
snapshots on UFS filesystems running with journaled soft updates.
This is the first of several bugs that need to be fixed before
removing the restriction added in -r230250 to prevent the use
of snapshots on filesystems running with journaled soft updates.

The deadlock occurs when holding the snapshot lock (snaplk)
and then trying to flush an inode via ffs_update(). We become
blocked by another process trying to flush a different inode
contained in the same inode block that we need. It holds the
inode block for which we are waiting locked. When it tries to
write the inode block, it gets blocked waiting for the our
snaplk when it calls ffs_copyonwrite() to see if the inode
block needs to be copied in our snapshot.

The most obvious place that this deadlock arises is in the
ffs_copyonwrite() routine when it updates critical metadata
in a snapshot and tries to write it out before proceeding.
The fix here is to write the data and indirect block pointer
for the snapshot, but to skip the call to ffs_update() to
write the snapshot inode. To ensure that we will never have
to update a pointer in the inode itself, the ffs_snapshot()
routine that creates the snapshot has to ensure that all the
direct blocks are allocated as part of the creation of the
snapshot.

A less obvious place that this deadlock occurs is when we hold
the snaplk because we are deleting a snapshot. In the course of
doing the deletion, we need to allocate various soft update
dependency structures and allocate some journal space. If we
hit a resource limit while doing this we decrease the resources
in use by flushing out an existing dirty file to get it to give
up the soft dependency resources that it holds. The flush can
cause an ffs_update() to be done on the inode for the file that
we have selected to flush resulting in the same deadlock as
described above when the inode that we have chosen to flush
resides in the same inode block as the snapshot inode that we hold.
The fix is to defer cleaning up any time that the inode on which
we are operating is a snapshot.

Help and review by:    Jeff Roberson
Tested by:             Peter Holm
MFC (to 9 only) after: 2 weeks

12 years agoSince r199137 namei() returns EINVAL for DELETE and RENAME operations if
jh [Thu, 1 Mar 2012 18:17:45 +0000 (18:17 +0000)]
Since r199137 namei() returns EINVAL for DELETE and RENAME operations if
the last component of the pathname is ".".

Reviewed by: kib
MFC after: 1 week

12 years agoremove some write-only variables.
luigi [Thu, 1 Mar 2012 17:35:16 +0000 (17:35 +0000)]
remove some write-only variables.
There is another block of code that is now useless as the computation
is done in the kernel.

12 years agoHandle the case where a boolean parameter is also a node.
jamie [Thu, 1 Mar 2012 15:09:41 +0000 (15:09 +0000)]
Handle the case where a boolean parameter is also a node.

PR: bin/165515
MFC after: 2 weeks

12 years agoNote that memory should be freed after uuid_to_string(3) call.
ae [Thu, 1 Mar 2012 14:39:01 +0000 (14:39 +0000)]
Note that memory should be freed after uuid_to_string(3) call.

MFC after: 1 week

12 years agoAdd driver for the RME HDSPe AIO/RayDAT sound cards -- snd_hdspe(4).
mav [Thu, 1 Mar 2012 13:10:18 +0000 (13:10 +0000)]
Add driver for the RME HDSPe AIO/RayDAT sound cards -- snd_hdspe(4).
Cards are expensive and so rare, so leave the driver as module.

Submitted by: Ruslan Bukin <br@bsdpad.com>
MFC after: 2 weeks

12 years agoChanges in ifaddr refcounting: ifa_refcnt IFAREF/IFAFREE macros
pluknet [Thu, 1 Mar 2012 12:52:14 +0000 (12:52 +0000)]
Changes in ifaddr refcounting: ifa_refcnt IFAREF/IFAFREE macros
moved to ifa_ref()/ifa_free() refcounting functions.

MFC after: 1 week

12 years agoRefine r232333 [1] and put note about ifnet refcount caller responsibility.
pluknet [Thu, 1 Mar 2012 12:30:57 +0000 (12:30 +0000)]
Refine r232333 [1] and put note about ifnet refcount caller responsibility.

Spotted by: gavin [1]
MFC after: 1 week

12 years agoReflect that ifa_ifwithnet() gained ignore_ptp argument.
pluknet [Thu, 1 Mar 2012 12:16:00 +0000 (12:16 +0000)]
Reflect that ifa_ifwithnet() gained ignore_ptp argument.

MFC after: 1 week

12 years agoDocument ifunit_ref function.
pluknet [Thu, 1 Mar 2012 12:03:52 +0000 (12:03 +0000)]
Document ifunit_ref function.

MFC after: 1 week

12 years agoDocument ifnet refcount.
pluknet [Thu, 1 Mar 2012 11:03:39 +0000 (11:03 +0000)]
Document ifnet refcount.

MFC after: 1 week

12 years agoUse proper "maxproc" name, not "nproc".
trasz [Thu, 1 Mar 2012 10:21:10 +0000 (10:21 +0000)]
Use proper "maxproc" name, not "nproc".

PR: docs/162172

12 years agoFix the NFS clients so that they use copyin() instead of bcopy(),
rmacklem [Thu, 1 Mar 2012 03:53:07 +0000 (03:53 +0000)]
Fix the NFS clients so that they use copyin() instead of bcopy(),
when doing direct I/O. This direct I/O code is not enabled by default.

Submitted by: kib (earlier version)
Reviewed by: kib
MFC after: 1 week

12 years agoRegenerate src.conf(5) after r232322.
dim [Wed, 29 Feb 2012 23:06:48 +0000 (23:06 +0000)]
Regenerate src.conf(5) after r232322.

MFC after: 2 weeks

12 years agoAdd a WITH_CLANG_IS_CC option for src.conf(5), disabled by default, that
dim [Wed, 29 Feb 2012 22:58:51 +0000 (22:58 +0000)]
Add a WITH_CLANG_IS_CC option for src.conf(5), disabled by default, that
installs clang as /usr/bin/cc, /usr/bin/c++ and /usr/bin/cpp.

Note this does *not* disable building and installing gcc, which will
still be available as /usr/bin/gcc, /usr/bin/g++ and /usr/bin/gcpp.  If
you want to disable gcc completely, you must use WITHOUT_GCC.

MFC after: 2 weeks

12 years agoCorrect the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a
thompsa [Wed, 29 Feb 2012 22:41:40 +0000 (22:41 +0000)]
Correct the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a
system tunable has never been implemented. This flag is only used by sysctl(8)
to provide a helpful error message.

Discussed with: dwhite, kan

12 years agoUse srandom() to init the PRNG, not srand(), since we use random().
cognet [Wed, 29 Feb 2012 22:35:09 +0000 (22:35 +0000)]
Use srandom() to init the PRNG, not srand(), since we use random().
This is harmless because srandom() is called somewhere else, with time(NULL)
as a seed, but this is more correct.

Obtained from: https://bitbucket.org/mux/csup
Pointyhat to: not mux, somebody else

MFC after: 1 week

12 years agoUse pci_printf() instead of a home-rolled version in the VPD parsing code.
jhb [Wed, 29 Feb 2012 22:06:44 +0000 (22:06 +0000)]
Use pci_printf() instead of a home-rolled version in the VPD parsing code.

12 years agoIntroduce VOP_UNP_BIND(), VOP_UNP_CONNECT(), and VOP_UNP_DETACH()
trociny [Wed, 29 Feb 2012 21:38:31 +0000 (21:38 +0000)]
Introduce VOP_UNP_BIND(), VOP_UNP_CONNECT(), and VOP_UNP_DETACH()
operations for setting and accessing vnode's v_socket field.

The operations are necessary to implement proper unix socket handling
on layered file systems like nullfs(5).

This change fixes the long standing issue with nullfs(5) being in that
unix sockets did not work between lower and upper layers: if we bound
to a socket on the lower layer we could connect only to the lower
path; if we bound to the upper layer we could connect only to the
upper path. The new behavior is one can connect to both the lower and
the upper paths regardless what layer path one binds to.

PR: kern/51583, kern/159663
Suggested by: kib
Reviewed by: arch
MFC after: 2 weeks

12 years agoUpdate bridge(4) default values.
brueffer [Wed, 29 Feb 2012 21:11:02 +0000 (21:11 +0000)]
Update bridge(4) default values.

PR: 164564
Submitted by: "Rudy (bulk)" <crapsh@monkeybrains.net>
MFC after: 2 weeks

12 years agoUse a more appropriate default for the maximum number of addresses in the
thompsa [Wed, 29 Feb 2012 20:58:21 +0000 (20:58 +0000)]
Use a more appropriate default for the maximum number of addresses in the
bridge forwarding table.

PR: docs/164564
Discussed with: brueffer

12 years agoAdd myself, and show marck@ as my mentor.
pluknet [Wed, 29 Feb 2012 20:13:53 +0000 (20:13 +0000)]
Add myself, and show marck@ as my mentor.

Approved by: marck (mentor)

12 years agoFix order of arguments to lseek().
brueffer [Wed, 29 Feb 2012 19:50:49 +0000 (19:50 +0000)]
Fix order of arguments to lseek().

PR: 160867
Submitted by: Henning Petersen <henning.petersen@t-online.de>
MFC after: 1 week

12 years agoRegenerate src.conf(5) after r231530 (and to correct a little screwup
dim [Wed, 29 Feb 2012 19:18:32 +0000 (19:18 +0000)]
Regenerate src.conf(5) after r231530 (and to correct a little screwup
with the WITH_CLANG_EXTRAS fragment I added).

12 years agoFix a long standing bug. The caller expects a non-zero value for success.
jkim [Wed, 29 Feb 2012 18:11:33 +0000 (18:11 +0000)]
Fix a long standing bug.  The caller expects a non-zero value for success.
Luckily keyboard probing was turned off by default from the first revision.

Submitted by: Alexander Sack (asack at niksun dot com)
MFC after: 3 days

12 years agoblkif interface comment cleanups. No functional changes
gibbs [Wed, 29 Feb 2012 17:47:01 +0000 (17:47 +0000)]
blkif interface comment cleanups.  No functional changes

sys/xen/interface/io/blkif.h:
 o Insert space in "Red Hat".
 o Fix typo "discard-aligment" -> "discard-alignment"
 o Fix typo "unamp" -> "unmap"
 o Fix typo "formated" -> "formatted"
 o Clarify the text for "params".
 o Clarify the text for "sector-size".
 o Clarify the text for "max-requests" in the backend section.

12 years agoAdd "export" to devfs_opts[] and return EOPNOTSUPP if called with it.
mm [Wed, 29 Feb 2012 16:16:36 +0000 (16:16 +0000)]
Add "export" to devfs_opts[] and return EOPNOTSUPP if called with it.
Fixes mountd warnings.

Reported by: kib
MFC after: 1 week

12 years agoAllow shared locks for reads when lower filesystem accept shared locking.
kib [Wed, 29 Feb 2012 15:18:53 +0000 (15:18 +0000)]
Allow shared locks for reads when lower filesystem accept shared locking.

Tested by: pho
MFC after: 1 week

12 years agoDocument that null_nodeget() cannot take shared-locked lowervp due to
kib [Wed, 29 Feb 2012 15:18:04 +0000 (15:18 +0000)]
Document that null_nodeget() cannot take shared-locked lowervp due to
insmntque() requirements.

Tested by: pho
MFC after: 1 week

12 years agoIn null_reclaim(), assert that reclaimed vnode is fully constructed,
kib [Wed, 29 Feb 2012 15:15:36 +0000 (15:15 +0000)]
In null_reclaim(), assert that reclaimed vnode is fully constructed,
instead of accepting half-constructed vnode. Previous code cannot decide
what to do with such vnode anyway, and although processing it for hash
removal, paniced later when getting rid of nullfs reference on lowervp.

While there, remove initializations from the declaration block.

Tested by: pho
MFC after: 1 week

12 years agoAlways request exclusive lock for the lower vnode in nullfs_vget().
kib [Wed, 29 Feb 2012 15:09:20 +0000 (15:09 +0000)]
Always request exclusive lock for the lower vnode in nullfs_vget().
The null_nodeget() requires exclusive lock on lowervp to be able to
insmntque() new vnode.

Reported by: rea
Tested by: pho
MFC after: 1 week

12 years agoUpdate the description for -s flag after r232182.
pluknet [Wed, 29 Feb 2012 15:06:40 +0000 (15:06 +0000)]
Update the description for -s flag after r232182.
When displaying security credential information show also process umask.

X-MFC-with: r232182

12 years agoMove the code to destroy half-contructed nullfs vnode into helper
kib [Wed, 29 Feb 2012 15:06:00 +0000 (15:06 +0000)]
Move the code to destroy half-contructed nullfs vnode into helper
function null_destroy_proto() from null_insmntque_dtr(). Also
apply null_destroy_proto() in null_nodeget() when we raced and a vnode
is found in the hash, so the currently allocated protonode shall be
destroyed.

Lock the vnode interlock around reassigning the v_vnlock.

In fact, this path will not be exercised after several later commits,
since null_nodeget() cannot take shared-locked lowervp at all due to
insmntque() requirements.

Reported by: rea
Tested by: pho
MFC after: 1 week

12 years agoGrammar: tzsetup now has more than one option.
emaste [Wed, 29 Feb 2012 14:44:42 +0000 (14:44 +0000)]
Grammar: tzsetup now has more than one option.

12 years agoMerge a split multi-line comment.
kib [Wed, 29 Feb 2012 14:43:27 +0000 (14:43 +0000)]
Merge a split multi-line comment.

MFC after: 1 week

12 years agoMake sure we do not provide the page 0 to the VM. It can't handle it properly,
cognet [Wed, 29 Feb 2012 12:44:34 +0000 (12:44 +0000)]
Make sure we do not provide the page 0 to the VM. It can't handle it properly,
because pmap_extract() returns 0 when there's no mapping.

PR: arm/154227
MFC after: 1 week

12 years agoBump .Dd to reflect latest update
mm [Wed, 29 Feb 2012 07:33:07 +0000 (07:33 +0000)]
Bump .Dd to reflect latest update

Reported by: bz
MFC after: 1 week

12 years agoRevert part of old logic of assigning MAC addressess:
gonzo [Wed, 29 Feb 2012 05:48:29 +0000 (05:48 +0000)]
Revert part of old logic of assigning MAC addressess:

- Reserver respective number of addresses for managment port
- octm uses base address directly
- other drivers get MACs on "first come first served" basis

Reviewed by: juli

12 years agoSimplify kmem_alloc() by eliminating code that existed on account of
alc [Wed, 29 Feb 2012 05:41:29 +0000 (05:41 +0000)]
Simplify kmem_alloc() by eliminating code that existed on account of
external pagers in Mach.  FreeBSD doesn't implement external pagers.
Moreover, it don't pageout the kernel object.  So, the reasons for
having code don't hold.

Reviewed by: kib
MFC after: 6 weeks

12 years agoinitialize clock ID and flags only when copying timespec, a _umtx_time
davidxu [Wed, 29 Feb 2012 02:01:48 +0000 (02:01 +0000)]
initialize clock ID and flags only when copying timespec, a _umtx_time
copy already contains these fields.

12 years agoAdd procfs to jail-mountable filesystems.
mm [Wed, 29 Feb 2012 00:30:18 +0000 (00:30 +0000)]
Add procfs to jail-mountable filesystems.

Reviewed by: jamie
MFC after: 1 week

12 years agoCopy amd64 stdarg.h to x86 and replace amd64/i386/pc98 stdarg.h with stubs.
tijl [Tue, 28 Feb 2012 22:30:58 +0000 (22:30 +0000)]
Copy amd64 stdarg.h to x86 and replace amd64/i386/pc98 stdarg.h with stubs.

12 years agoCopy amd64 setjmp.h to x86 and replace amd64/i386/pc98 setjmp.h with stubs.
tijl [Tue, 28 Feb 2012 22:17:52 +0000 (22:17 +0000)]
Copy amd64 setjmp.h to x86 and replace amd64/i386/pc98 setjmp.h with stubs.

12 years agoDocument the 'URL' argument.
obrien [Tue, 28 Feb 2012 22:15:46 +0000 (22:15 +0000)]
Document the 'URL' argument.

12 years ago- Refresh dynamic tcp rule only if both sides answered keepalive packets.
oleg [Tue, 28 Feb 2012 22:00:41 +0000 (22:00 +0000)]
- Refresh dynamic tcp rule only if both sides answered keepalive packets.
- Remove some useless assignments.

MFC after: 1 month

12 years agolookup_dyn_rule_locked(): style(9) cleanup
oleg [Tue, 28 Feb 2012 21:53:39 +0000 (21:53 +0000)]
lookup_dyn_rule_locked(): style(9) cleanup

MFC after: 1 month

12 years agoChange definition of pipe_chmod() from K&R to C99, to avoid the
dim [Tue, 28 Feb 2012 21:45:21 +0000 (21:45 +0000)]
Change definition of pipe_chmod() from K&R to C99, to avoid the
following clang warning:

sys/kern/sys_pipe.c:1556:10: error: promoted type 'int' of K&R function parameter is not compatible with the parameter type 'mode_t'
      (aka 'unsigned short') declared in a previous prototype [-Werror]
        mode_t mode;
               ^
sys/kern/sys_pipe.c:155:19: note: previous declaration is here
static fo_chmod_t       pipe_chmod;
                        ^

12 years agoOnly increment is_beacon_bad if we're not scanning.
adrian [Tue, 28 Feb 2012 21:43:29 +0000 (21:43 +0000)]
Only increment is_beacon_bad if we're not scanning.

Otherwise things such as off-channel probe responses and beacons are also
silently discarded and logged against this error counter.

12 years agoPrint out the bogus beacon interval.
adrian [Tue, 28 Feb 2012 21:41:47 +0000 (21:41 +0000)]
Print out the bogus beacon interval.

12 years agoRevert r232260.
emaste [Tue, 28 Feb 2012 19:50:14 +0000 (19:50 +0000)]
Revert r232260.

The problem is now fixed by a general workaround in r232267.

12 years agoWorkaround for PCIe 4GB boundary issue
emaste [Tue, 28 Feb 2012 19:42:40 +0000 (19:42 +0000)]
Workaround for PCIe 4GB boundary issue

Enforce a boundary of no more than 4GB - transfers crossing a 4GB
boundary can lead to data corruption due to PCIe limitations.  This
change is a less-intrusive workaround that can be quickly merged back
to older branches; a cleaner implementation will arrive in HEAD later
but may require KPI changes.

This change is based on a suggestion by jhb@.

Reviewed by:    scottl, jhb
Sponsored by:   Sandvine Incorporated
MFC after:      3 days

12 years agoCopy amd64 endian.h to x86 and merge with i386 endian.h. Replace
tijl [Tue, 28 Feb 2012 19:39:54 +0000 (19:39 +0000)]
Copy amd64 endian.h to x86 and merge with i386 endian.h. Replace
amd64/i386/pc98 endian.h with stubs.

In __bswap64_const(x) the conflict between 0xffUL and 0xffULL has been
resolved by reimplementing the macro in terms of __bswap32(x). As a side
effect __bswap64_var(x) is now implemented using two bswap instructions on
i386 and should be much faster. __bswap32_const(x) has been reimplemented
in terms of __bswap16(x) for consistency.

12 years agoProperly clear a device's devclass if DEVICE_ATTACH() fails if the device
jhb [Tue, 28 Feb 2012 19:16:02 +0000 (19:16 +0000)]
Properly clear a device's devclass if DEVICE_ATTACH() fails if the device
does not have a fixed devclass.

Reviewed by: imp
MFC after: 2 weeks

12 years agoCopy amd64 _stdint.h to x86 and merge with i386 _stdint.h. Replace
tijl [Tue, 28 Feb 2012 18:38:33 +0000 (18:38 +0000)]
Copy amd64 _stdint.h to x86 and merge with i386 _stdint.h. Replace
amd64/i386/pc98 _stdint.h with stubs.

12 years agoDefine several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to
dim [Tue, 28 Feb 2012 18:30:18 +0000 (18:30 +0000)]
Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to
get rid of testing explicitly for clang (using ${CC:T:Mclang}) in
individual Makefiles.

Instead, use the following extra macros, for use with clang:
- NO_WERROR.clang       (disables -Werror)
- NO_WCAST_ALIGN.clang  (disables -Wcast-align)
- NO_WFORMAT.clang (disables -Wformat and friends)
- CLANG_NO_IAS (disables integrated assembler)
- CLANG_OPT_SMALL (adds flags for extra small size optimizations)

As a side effect, this enables setting CC/CXX/CPP in src.conf instead of
make.conf!  For clang, use the following:

CC=clang
CXX=clang++
CPP=clang-cpp

MFC after: 2 weeks

12 years agoCopy amd64 _limits.h to x86 and merge with i386 _limits.h. Replace
tijl [Tue, 28 Feb 2012 18:24:28 +0000 (18:24 +0000)]
Copy amd64 _limits.h to x86 and merge with i386 _limits.h. Replace
amd64/i386/pc98 _limits.h with stubs.

12 years agoCopy amd64 _types.h to x86 and merge with i386 _types.h. Replace existing
tijl [Tue, 28 Feb 2012 18:15:28 +0000 (18:15 +0000)]
Copy amd64 _types.h to x86 and merge with i386 _types.h. Replace existing
amd64/i386/pc98 _types.h with stubs.

12 years agoAvoid transfers crossing a 4GB boundary, which can lead to data
emaste [Tue, 28 Feb 2012 17:29:31 +0000 (17:29 +0000)]
Avoid transfers crossing a 4GB boundary, which can lead to data
corruption.  Thanks to scottl@ for the suggestion.

This change will likely be revised after consideration of a general
method to address this type of issue for other drivers.

Sponsored by:   Sandvine Incorporated
MFC after:      3 days

12 years agoMention mos(4)
kevlo [Tue, 28 Feb 2012 15:47:39 +0000 (15:47 +0000)]
Mention mos(4)

12 years agoAdd support for the MCS7832
kevlo [Tue, 28 Feb 2012 15:45:42 +0000 (15:45 +0000)]
Add support for the MCS7832

Obtained from: OpenBSD

12 years agoAdd missing MODULE_DEPEND() so that acpi.ko and aibs.ko can be
kevlo [Tue, 28 Feb 2012 15:12:26 +0000 (15:12 +0000)]
Add missing MODULE_DEPEND() so that acpi.ko and aibs.ko can be
loaded dynamically.

12 years agoFix checks for error return from amr_sglist_map() and amr_ccb_map()
kevlo [Tue, 28 Feb 2012 15:09:56 +0000 (15:09 +0000)]
Fix checks for error return from amr_sglist_map() and amr_ccb_map()

12 years agoFix typos
kevlo [Tue, 28 Feb 2012 15:07:05 +0000 (15:07 +0000)]
Fix typos

12 years agoCorrect pathname for manpages after libarchive 3.0.3 update.
pluknet [Tue, 28 Feb 2012 14:35:36 +0000 (14:35 +0000)]
Correct pathname for manpages after libarchive 3.0.3 update.

12 years agoCorrect capitalization of "Hz" in user-visible text (manpages, printf(),
gavin [Tue, 28 Feb 2012 13:19:34 +0000 (13:19 +0000)]
Correct capitalization of "Hz" in user-visible text (manpages, printf(),
etc).

MFC after: 3 days

12 years agoAdd lib32 part after libarchive 3.0.3 update.
pluknet [Tue, 28 Feb 2012 11:06:52 +0000 (11:06 +0000)]
Add lib32 part after libarchive 3.0.3 update.

12 years agomdoc(7) stype - start new sentences on new line
mm [Tue, 28 Feb 2012 07:35:07 +0000 (07:35 +0000)]
mdoc(7) stype - start new sentences on new line

MFC after: 1 week

12 years agoPrefer RL_GMEDIASTAT register to RGEPHY_MII_SSR register to
yongari [Tue, 28 Feb 2012 05:23:29 +0000 (05:23 +0000)]
Prefer RL_GMEDIASTAT register to RGEPHY_MII_SSR register to
extract a link status of PHY when parent driver is re(4).
RGEPHY_MII_SSR register does not seem to report correct PHY status
on some integrated PHYs used with re(4).
Unfortunately, RealTek PHYs have no additional information to
differentiate integrated PHYs from external ones so relying on PHY
model number is not enough to know that.  However, it seems
RGEPHY_MII_SSR register exists for external RealTek PHYs so
checking parent driver would be good indication to know which PHY
was used. In other words, for non-re(4) controllers, the PHY is
external one and its revision number is greater than or equal to 2.
This change fixes intermittent link UP/DOWN messages reported on
RTL8169 controller.

Also, mii_attach(9) is tried after setting interface name since
rgephy(4) have to know parent driver name.

PR: kern/165509

12 years agoAdd is_beacon_bad.
adrian [Tue, 28 Feb 2012 04:06:42 +0000 (04:06 +0000)]
Add is_beacon_bad.

PR: kern/165517

12 years agoTrack the number of bad beacons received.
adrian [Tue, 28 Feb 2012 04:05:35 +0000 (04:05 +0000)]
Track the number of bad beacons received.

PR: kern/165517

12 years agoFix a few rendering nits in rc.conf(5) with regards to mentioning
gjb [Tue, 28 Feb 2012 03:11:02 +0000 (03:11 +0000)]
Fix a few rendering nits in rc.conf(5) with regards to mentioning
jail_parallel_enable.

12 years agoCurrently, the debugger attached to the process executing vfork() does
kib [Mon, 27 Feb 2012 21:10:10 +0000 (21:10 +0000)]
Currently, the debugger attached to the process executing vfork() does
not get syscall exit notification until the child performed exec of
exit.  Swap the order of doing ptracestop() and waiting for P_PPWAIT
clearing, by postponing the wait into syscallret after ptracestop()
notification is done.

Reported, tested and reviewed by: Dmitry Mikulin <dmitrym juniper net>
MFC after:  2 weeks

12 years agoFix a race in top non-interactive mode. Use plain sleep(3) call instead
kib [Mon, 27 Feb 2012 20:52:20 +0000 (20:52 +0000)]
Fix a race in top non-interactive mode.  Use plain sleep(3) call instead
of arming timer and then pausing.  If SIGALRM is delivered before pause(3)
is entered, top hangs.

Submitted by: Andrey Zonov <andrey zonov org>
MFC after: 1 week

12 years agoA bunch of netmap fixes:
luigi [Mon, 27 Feb 2012 19:05:01 +0000 (19:05 +0000)]
A bunch of netmap fixes:

USERSPACE:
1. add support for devices with different number of rx and tx queues;

2. add better support for zero-copy operation, adding an extra field
   to the netmap ring to indicate how many buffers we have already processed
   but not yet released (with help from Eddie Kohler);

3. The two changes above unfortunately require an API change, so while
   at it add a version field and some spares to the ioctl() argument
   to help detect mismatches.

4. update the manual page for the two changes above;

5. update sample applications in tools/tools/netmap

KERNEL:

1. simplify the internal structures moving the global wait queues
   to the 'struct netmap_adapter';

2. simplify the functions that map kring<->nic ring indexes

3. normalize device-specific code, helps mainteinance;

4. start exploring the impact of micro-optimizations (prefetch etc.)
   in the ixgbe driver.
   Use 'legacy' descriptors on the tx ring and prefetch slots gives
   about 20% speedup at 900 MHz. Another 7-10% would come from removing
   the explict calls to bus_dmamap* in the core (they are effectively
   NOPs in this case, but it takes expensive load of the per-buffer
   dma maps to figure out that they are all NULL.

   Rx performance not investigated.

I am postponing the MFC so i can import a few more improvements
before merging.

12 years agoTypo.
jhb [Mon, 27 Feb 2012 18:28:31 +0000 (18:28 +0000)]
Typo.

12 years agoBackout r230934 which didn't work with unix sockets and
pluknet [Mon, 27 Feb 2012 17:39:34 +0000 (17:39 +0000)]
Backout r230934 which didn't work with unix sockets and
several filesystem layers mounted at the specified path.

Pointy hat to: pluknet

12 years ago- Panic up front if a kernel does not include 'device atpic' and an
jhb [Mon, 27 Feb 2012 17:33:16 +0000 (17:33 +0000)]
- Panic up front if a kernel does not include 'device atpic' and an
  APIC is not found.
- Don't panic if lapic_enable_cmc() is called and the APIC is not enabled.
  This can happen due to booting a kernel with APIC disabled on a CPU that
  supports CMCI.
- Wrap a long line.

12 years agoMFamd64: Don't whine about interrupts being disabled for an NMI.
jhb [Mon, 27 Feb 2012 17:31:38 +0000 (17:31 +0000)]
MFamd64: Don't whine about interrupts being disabled for an NMI.

12 years agoRemove completely duplicate '#ifdef XEN' section.
jhb [Mon, 27 Feb 2012 17:30:21 +0000 (17:30 +0000)]
Remove completely duplicate '#ifdef XEN' section.

12 years agoResort the IDT_DTRACE_RET constant after it was changed to be less than
jhb [Mon, 27 Feb 2012 17:29:37 +0000 (17:29 +0000)]
Resort the IDT_DTRACE_RET constant after it was changed to be less than
IDT_SYSCALL.