]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoRemove unused assignment.
jkim [Fri, 11 Jun 2010 19:53:42 +0000 (19:53 +0000)]
Remove unused assignment.

Found by: clang static analyzer
Found by: Coverity Prevent[tm] (CID 4537, 4538, 4539)

14 years agoCache the last result from if_indextoname for printing. This speeds up
mlaier [Fri, 11 Jun 2010 19:35:05 +0000 (19:35 +0000)]
Cache the last result from if_indextoname for printing.  This speeds up
"arp -an" when using a lot of aliases (on a single interface).

A better fix would include a better interface for if_indextoname than
getting the whole address list from the kernel just to find the one
index->name mapping.

Reported & analyzed by: Nick Rogers
MFC after: 3 days

14 years agofix a few cases where a string is passed via format argument instead of
avg [Fri, 11 Jun 2010 19:27:21 +0000 (19:27 +0000)]
fix a few cases where a string is passed via format argument instead of
via %s

Most of the cases looked harmless, but this is done for the sake of
correctness.  In one case it even allowed to drop an intermediate buffer.

Found by: clang
MFC after: 2 week

14 years agoRemove a disable_queue from the beginning of the
jfv [Fri, 11 Jun 2010 19:03:59 +0000 (19:03 +0000)]
Remove a disable_queue from the beginning of the
interrupt handler, automask handles it.
Also, add in msix vector descriptions.

MFC for 8.1 asap

14 years agoUpdate several places that iterate over CPUs to use CPU_FOREACH().
jhb [Fri, 11 Jun 2010 18:46:34 +0000 (18:46 +0000)]
Update several places that iterate over CPUs to use CPU_FOREACH().

14 years agosctp_recvmsg returns the number of bytes received, not sent.
brucec [Fri, 11 Jun 2010 18:43:55 +0000 (18:43 +0000)]
sctp_recvmsg returns the number of bytes received, not sent.

Approved by: rrs (mentor)
MFC after: 1 month

14 years agoffs_softdep: change K&R in function defintions to ANSI prototypes
avg [Fri, 11 Jun 2010 18:26:53 +0000 (18:26 +0000)]
ffs_softdep: change K&R in function defintions to ANSI prototypes

Apparently it's bad when we first have an ANSI prototype in function
declaration, but then use K&R in its defintion.

Complaint from: clang
MFC after: 2 weeks

14 years agovnode.h: expand debug macros to non-empty void statements when
avg [Fri, 11 Jun 2010 18:20:56 +0000 (18:20 +0000)]
vnode.h: expand debug macros to non-empty void statements when
DEBUG_VFS_LOCKS is disabled

MFC after: 2 weeks

14 years agoFix a possible dereference of null pointer.
jkim [Fri, 11 Jun 2010 18:19:23 +0000 (18:19 +0000)]
Fix a possible dereference of null pointer.

Found by: clang static analyzer
Found by: Coverity Prevent[tm] (CID 3423)

14 years agoAdd INVARIANTS checking that numfreebufs values are sane. Also add a
mdf [Fri, 11 Jun 2010 17:03:26 +0000 (17:03 +0000)]
Add INVARIANTS checking that numfreebufs values are sane.  Also add a
per-buf flag to catch if a buf is double-counted in the free count.
This code was useful to debug an instance where a local patch at Isilon
was incorrectly managing numfreebufs for a new buf state.

Reviewed by: jeff
Approved by: zml (mentor)

14 years agoRemove dead variable assignments
uqs [Fri, 11 Jun 2010 17:03:04 +0000 (17:03 +0000)]
Remove dead variable assignments

Found by: clang static analyzer
Verified by: md5(1)

14 years agoInitialize variables before usage.
uqs [Fri, 11 Jun 2010 17:02:57 +0000 (17:02 +0000)]
Initialize variables before usage.

Found by: clang static analyzer
Found by: Coverity Prevent[tm] (CID 7736, 7760)

14 years agoAdd helper macros to iterate over available CPUs in the system.
jhb [Fri, 11 Jun 2010 15:56:18 +0000 (15:56 +0000)]
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

14 years agoRelax one of the new assertions in pmap_enter() a little. Specifically,
alc [Fri, 11 Jun 2010 15:49:39 +0000 (15:49 +0000)]
Relax one of the new assertions in pmap_enter() a little.  Specifically,
allow pmap_enter() to be performed on an unmanaged page that doesn't have
VPO_BUSY set.  Having VPO_BUSY set really only matters for managed pages.
(See, for example, pmap_remove_write().)

14 years agoAdd myself to the committers graph.
ashish [Fri, 11 Jun 2010 12:58:29 +0000 (12:58 +0000)]
Add myself to the committers graph.

Approved by: pgj (mentor)

14 years agoIn another move to join with the age of the Fruitbat, increase SYSV
ivoras [Fri, 11 Jun 2010 09:27:33 +0000 (09:27 +0000)]
In another move to join with the age of the Fruitbat, increase SYSV
shared resources defaults beyond absolute minimums.

The new values are chosen mostly by magic. They are still fairly
small and will need increasing for large installations (especially
SHMMAX). However, they are now enough to e.g. start PostgreSQL
installations with ~~300 users and nearly 512 MB of shared buffers.

Reviewed by: A short discussion on hackers@

14 years agoUse same table markup as in hexdump.1
uqs [Fri, 11 Jun 2010 06:04:14 +0000 (06:04 +0000)]
Use same table markup as in hexdump.1

14 years agoMore mdoc nitpicking to improve compatibility to mdocml
uqs [Fri, 11 Jun 2010 06:04:07 +0000 (06:04 +0000)]
More mdoc nitpicking to improve compatibility to mdocml

- .Nd in section NAME is not optional
- .Ed was missing
- "indent" is not a flag, but a literal argument for -offset
- stop switching font sizes for acronyms
- use .Brq instead of rolling our own

14 years agoRemove Xo/Xc in It, which is not yet supported by mdocml but
uqs [Fri, 11 Jun 2010 06:04:00 +0000 (06:04 +0000)]
Remove Xo/Xc in It, which is not yet supported by mdocml but
can be worked around trivially in this case.

14 years agomdoc: stop abusing -column lists and use .Bl -tag instead
uqs [Fri, 11 Jun 2010 06:03:54 +0000 (06:03 +0000)]
mdoc: stop abusing -column lists and use .Bl -tag instead

14 years agomdoc nitpicking: the title argument shall be uppercase
uqs [Fri, 11 Jun 2010 06:03:47 +0000 (06:03 +0000)]
mdoc nitpicking: the title argument shall be uppercase

14 years agoIn dtrace lexer, do not unput token if it is EOF.
kan [Fri, 11 Jun 2010 04:38:14 +0000 (04:38 +0000)]
In dtrace lexer, do not unput token if it is EOF.

This is harmless with OpenSolaris fex and yacc, but with FreeBSD
causes '\xff' symbol to be physically put into input buffer, causing
subsequent syntax error.

MFC after: 1 week

14 years ago3 Fixes -
rrs [Fri, 11 Jun 2010 03:54:00 +0000 (03:54 +0000)]
3 Fixes -
a) There was a case where a ICMP message could cause
   us to return leaving a stuck lock on an stcb.
b) The iterator needed some tweaks to fix its lock
   ordering.
c) The ITERATOR_LOCK is no longer needed in the freeing
   of a stcb. Now that the timer based one is gone we don't
   have a multiple resume situation. Add to that that there
   was somewhere a path out of the freeing of an assoc that
   did NOT release the iterator_lock.. it was time to clean
   this old code up and in the process fix the lock bug.

MFC after: 1 week

14 years agoBump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4)
marcel [Fri, 11 Jun 2010 03:00:32 +0000 (03:00 +0000)]
Bump MAX_BPAGES from 256 to 1024. It seems that a few drivers, bge(4)
in particular, do not handle deferred DMA map load operations at all.
Any error, and especially EINPROGRESS, is treated as a hard error and
typically abort the current operation. The fact that the busdma code
queues the load operation for when resources (i.e. bounce buffers in
this particular case) are available makes this especially problematic.
Bounce buffering, unlike what the PR synopsis would suggest, works
fine.

While on the subject, properly implement swi_vm().

PR: 147502
MFC after: 1 week

14 years agoMerge from tbemd
imp [Fri, 11 Jun 2010 02:50:53 +0000 (02:50 +0000)]
Merge from tbemd

Enhance Makefile.inc processing, when asked for, to include the most
specific (MACHINE specific) to least specific (MACHINE_CPUARCH).

Reviewed by: arch@ (mostly silence though)

14 years agoMerge from tbemd branch:
imp [Fri, 11 Jun 2010 02:43:36 +0000 (02:43 +0000)]
Merge from tbemd branch:

Introduce MACHINE_CPUARCH.  Many different MACHINE_ARCHs will be built
from one MACHINE_CPUARCH.  This will allow us to move to a more
standard MACHINE_ARCH for mips and arm which exist in many different
endian variants, and for powerpc where both 32 and 64 bit binaries are
generated from the same sources.

Reviewed by: arch@ (mostly silence though)

14 years agosvn merge svn+ssh://svn.freebsd.org/base/head@209022
imp [Fri, 11 Jun 2010 02:09:18 +0000 (02:09 +0000)]
svn merge svn+ssh://svn.freebsd.org/base/head@209022

14 years agoFixing compilation bustage by adding the missing && back.
avatar [Fri, 11 Jun 2010 01:32:42 +0000 (01:32 +0000)]
Fixing compilation bustage by adding the missing && back.

14 years agoSeveral style fixes as prompted by bde@.
delphij [Thu, 10 Jun 2010 20:59:28 +0000 (20:59 +0000)]
Several style fixes as prompted by bde@.

While I'm there, loosen the st_nlink check and fix grammar for 1 extra
links.

14 years agoSome odd APs send beacons on the same TX queue as non-beacons. This breaks
rpaulo [Thu, 10 Jun 2010 20:58:34 +0000 (20:58 +0000)]
Some odd APs send beacons on the same TX queue as non-beacons. This breaks
802.11 duplicate detection. Upon looking at the standard, we discover
that 802.11-2007 says:
"A receiving QoS STA is also required to keep only the most recent
cache entry per<Address 2, TID, sequence-number>  triple, storing only
the most recently received fragment number for that triple. A receiving
STA may omit tuples obtained from broadcast/multicast or ATIM frames
from the cache."

To fix this, we just disable duplicate detection for multicast/broadcast
frames.

Reviewed by: sam
MFC after: 4 weeks
Obtained from: DragonFly

14 years agoAdd missing braces.
rpaulo [Thu, 10 Jun 2010 20:40:38 +0000 (20:40 +0000)]
Add missing braces.

Submitted by: sam
MFC after: 3 days

14 years agosvn merge svn+ssh://svn.freebsd.org/base/head@208996
imp [Thu, 10 Jun 2010 20:15:45 +0000 (20:15 +0000)]
svn merge svn+ssh://svn.freebsd.org/base/head@208996

14 years agoFix uninitialized variables that cause a crash when the network is
randi [Thu, 10 Jun 2010 20:13:10 +0000 (20:13 +0000)]
Fix uninitialized variables that cause a crash when the network is
initialized and sysinstall is not running as init.

Submitted by: Nick Mills
Approved by: cperciva (mentor)
MFC after: 3 days

14 years agoRemove Xcode cmake win32 projects unittests from LLVM and
rdivacky [Thu, 10 Jun 2010 19:59:23 +0000 (19:59 +0000)]
Remove Xcode cmake win32 projects unittests from LLVM and
clang.xcodeproj INPUTS win32 from clang.

Requested by: jkim
Approved by: ed (mentor)

14 years agoDon't pass a buffer directly as a printflike format string.
mjacob [Thu, 10 Jun 2010 19:38:07 +0000 (19:38 +0000)]
Don't pass a buffer directly as a printflike format string.
Found by: clang
MFC after: 1 month

14 years agoDo not require pos parameter to be zero in MAP_ANONYMOUS mmap requests
kan [Thu, 10 Jun 2010 17:59:47 +0000 (17:59 +0000)]
Do not require pos parameter to be zero in MAP_ANONYMOUS mmap requests
in Linux emulation layer. Linux seems to only require that pos is
page-aligned, but otherwise ignores it. Default FreeBSD mmap parameter
checking is too strict to allow some Linux binaries to run. tsMuxeR is
one example of such a binary.

Discussed with: jhb
MFC after: 1 week

14 years agoUntangle g_print_bio(), silencing Coverity.
trasz [Thu, 10 Jun 2010 17:49:36 +0000 (17:49 +0000)]
Untangle g_print_bio(), silencing Coverity.

Found with: Coverity Prevent
CID: 3566, 3567

14 years agoDo not disable edge-triggered interrupts before migration. DELAY() with
mav [Thu, 10 Jun 2010 17:04:01 +0000 (17:04 +0000)]
Do not disable edge-triggered interrupts before migration. DELAY() with
interrupt disabled highly probable causes interrupt loss.

14 years agoReduce the scope of the page queues lock and the number of
alc [Thu, 10 Jun 2010 16:56:35 +0000 (16:56 +0000)]
Reduce the scope of the page queues lock and the number of
PG_REFERENCED changes in vm_pageout_object_deactivate_pages().
Simplify this function's inner loop using TAILQ_FOREACH(), and shorten
some of its overly long lines.  Update a stale comment.

Assert that PG_REFERENCED may be cleared only if the object containing
the page is locked.  Add a comment documenting this.

Assert that a caller to vm_page_requeue() holds the page queues lock,
and assert that the page is on a page queue.

Push down the page queues lock into pmap_ts_referenced() and
pmap_page_exists_quick().  (As of now, there are no longer any pmap
functions that expect to be called with the page queues lock held.)

Neither pmap_ts_referenced() nor pmap_page_exists_quick() should ever
be passed an unmanaged page.  Assert this rather than returning "0"
and "FALSE" respectively.

ARM:

Simplify pmap_page_exists_quick() by switching to TAILQ_FOREACH().

Push down the page queues lock inside of pmap_clearbit(), simplifying
pmap_clear_modify(), pmap_clear_reference(), and pmap_remove_write().
Additionally, this allows for avoiding the acquisition of the page
queues lock in some cases.

PowerPC/AIM:

moea*_page_exits_quick() and moea*_page_wired_mappings() will never be
called before pmap initialization is complete.  Therefore, the check
for moea_initialized can be eliminated.

Push down the page queues lock inside of moea*_clear_bit(),
simplifying moea*_clear_modify() and moea*_clear_reference().

The last parameter to moea*_clear_bit() is never used.  Eliminate it.

PowerPC/BookE:

Simplify mmu_booke_page_exists_quick()'s control flow.

Reviewed by: kib@

14 years agoStyle(9) fixes:
ae [Thu, 10 Jun 2010 16:45:30 +0000 (16:45 +0000)]
Style(9) fixes:
* Sort includes
* Replace #define<SPACE> to #define<TAB>
* Split declarations and initializations
* Split long lines

Requested by: kib
Approved by: kib (mentor)
MFC after: 1 month

14 years agoStore interrupt trap frame into struct thread. It allows interrupt handler
mav [Thu, 10 Jun 2010 16:14:05 +0000 (16:14 +0000)]
Store interrupt trap frame into struct thread. It allows interrupt handler
to obtain both trap frame and opaque argument submitted on registrction.
After kernel and all drivers get used to it, legacy hack can be removed.

Reviewed by: jhb@

14 years agoIntroduce -fformat-extensions. A local FreeBSD extension used
rdivacky [Thu, 10 Jun 2010 16:13:32 +0000 (16:13 +0000)]
Introduce -fformat-extensions. A local FreeBSD extension used
for additional printf modifiers in kernel.

Approved by: ed (mentor)

14 years agoMake the char *n_name member of struct nlist 'const'.
bz [Thu, 10 Jun 2010 14:19:51 +0000 (14:19 +0000)]
Make the char *n_name member of struct nlist 'const'.
This avoids errors or __DECONST() from places with higher WARNS levels.

Adjust a local cache variable in ipcs to const as well
to compile in the new world order.

Suggested by: jhb
Reviewed by: jhb, kib, brueffer (man)

14 years agoDisable usage of __DATE__.
ed [Thu, 10 Jun 2010 12:15:09 +0000 (12:15 +0000)]
Disable usage of __DATE__.

This ensures that the Clang binary doesn't change checksums every time
it's built.

14 years agoBrand our Clang binary.
ed [Thu, 10 Jun 2010 12:06:35 +0000 (12:06 +0000)]
Brand our Clang binary.

That way it's easier for the Clang folks to keep track of what we're
doing.

14 years agoUnconfuse THREAD and SMT flags
ivoras [Thu, 10 Jun 2010 11:48:14 +0000 (11:48 +0000)]
Unconfuse THREAD and SMT flags

14 years agoCosmetic change to XML - less ugly newlines
ivoras [Thu, 10 Jun 2010 11:01:17 +0000 (11:01 +0000)]
Cosmetic change to XML - less ugly newlines

14 years ago- Axe out signal handling code, the shell will take care of this
gabor [Thu, 10 Jun 2010 10:28:38 +0000 (10:28 +0000)]
- Axe out signal handling code, the shell will take care of this

Suggested by: jilles
Approved by: delphij (mentor)

14 years ago- Fix style(9)
gabor [Thu, 10 Jun 2010 10:17:00 +0000 (10:17 +0000)]
- Fix style(9)

Submitted by: ed
Approved by: delphij (mentor)

14 years agoBump __FreeBSD_version to indicate the addition of Clang to HEAD.
ed [Thu, 10 Jun 2010 06:48:09 +0000 (06:48 +0000)]
Bump __FreeBSD_version to indicate the addition of Clang to HEAD.

14 years agoRegenerate.
ed [Thu, 10 Jun 2010 06:22:10 +0000 (06:22 +0000)]
Regenerate.

14 years agoFix typo.
ed [Thu, 10 Jun 2010 06:20:26 +0000 (06:20 +0000)]
Fix typo.

Spotted by: Garrett Cooper

14 years agoFound by Michael. In cases where we run
rrs [Wed, 9 Jun 2010 22:05:29 +0000 (22:05 +0000)]
Found by Michael. In cases where we run
out of memory (no more inp space) we don't
propely NULL the INP on return.

Obtained from: tuexen
MFC after: 3 Days

14 years agoApply driver update from LSI. Many thanks to LSI for continuing to
delphij [Wed, 9 Jun 2010 21:40:38 +0000 (21:40 +0000)]
Apply driver update from LSI.  Many thanks to LSI for continuing to
support FreeBSD.

  1) Timeout ioctl command timeouts.
       Do not reset the controller if ioctl command completed
       successfully.
  2) Remove G66_WORKAROUND code (this bug never shipped).
  3) Remove unnecessary interrupt lock (intr_lock).
  4) Timeout firmware handshake for PChip reset (don't wait forever).
  5) Handle interrupts inline.
  6) Unmask command interrupt ONLY when adding a command to the pending
     queue.
  7) Mask command interrupt ONLY after removing the last command from
     the pending queue.
  8) Remove TW_OSLI_DEFERRED_INTR_USED code.
  9) Replace controller "state" with separate data fields to avoid races:

       TW_CLI_CTLR_STATE_ACTIVE                     ctlr->active
       TW_CLI_CTLR_STATE_INTR_ENABLED               ctlr->interrupts_enabled
       TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY          ctlr->internal_req_busy
       TW_CLI_CTLR_STATE_GET_MORE_AENS              ctlr->get_more_aens
       TW_CLI_CTLR_STATE_RESET_IN_PROGRESS          ctlr->reset_in_progress
       TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS   ctlr->reset_phase1_in_progress

 10) Fix "req" leak in twa_action() when simq is frozen and req is NOT
     null.
 11) Replace softc "state" with separate data fields to avoid races:
       TW_OSLI_CTLR_STATE_OPEN                      sc->open
       TW_OSLI_CTLR_STATE_SIMQ_FROZEN               sc->simq_frozen
 12) Fix reference to TW_OSLI_REQ_FLAGS_IN_PROGRESS in
     tw_osl_complete_passthru()
 13) Use correct CAM status values.
       Change CAM_REQ_CMP_ERR to CAM_REQ_INVALID.
       Remove use of CAM_RELEASE_SIMQ for physical data addresses.
 14) Do not freeze/ release the simq with non I/O commands.
       When it is appropriate to temporarily freeze the simq with an I/O
       command use:
         xpt_freeze_simq(sim, 1);
         ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
       otherwise use:
         xpt_freeze_simq(sim, 1);
         xpt_release_simq(sim, 1);

Submitted by: Tom Couch <tom.couch lsi.com>
PR: kern/147695
MFC after: 3 days

14 years agoRegenerate.
ed [Wed, 9 Jun 2010 20:20:24 +0000 (20:20 +0000)]
Regenerate.

14 years agoThis should be commented out.
ed [Wed, 9 Jun 2010 20:18:18 +0000 (20:18 +0000)]
This should be commented out.

14 years agoRegen src.conf.5
rdivacky [Wed, 9 Jun 2010 20:13:50 +0000 (20:13 +0000)]
Regen src.conf.5

Approved by: ed (mentor)

14 years agoAdd WITHOUT_CLANG file with a description.
rdivacky [Wed, 9 Jun 2010 20:11:35 +0000 (20:11 +0000)]
Add WITHOUT_CLANG file with a description.

Approved by: ed (mentor)

14 years agoHook clang into the build on i386/amd64/powerpc.
rdivacky [Wed, 9 Jun 2010 19:57:20 +0000 (19:57 +0000)]
Hook clang into the build on i386/amd64/powerpc.

Approved by: ed (mentor)

14 years agoImport the build makefiles for clang/LLVM.
rdivacky [Wed, 9 Jun 2010 19:32:20 +0000 (19:32 +0000)]
Import the build makefiles for clang/LLVM.

Approved by: ed (mentor)

14 years agoRemove the commented out piece that slipped as a mismerge.
rdivacky [Wed, 9 Jun 2010 19:15:58 +0000 (19:15 +0000)]
Remove the commented out piece that slipped as a mismerge.

Approved by: ed (mentor)

14 years agoAdjust include paths to FreeBSD. Remove /usr/local/include and
rdivacky [Wed, 9 Jun 2010 19:12:25 +0000 (19:12 +0000)]
Adjust include paths to FreeBSD. Remove /usr/local/include and
add /usr/include/clang/$VERSION (currently VERSION is 2.0).

Approved by: ed (mentor)

14 years agoChange the default CPU to i486 on i386 (architecture).
rdivacky [Wed, 9 Jun 2010 19:09:49 +0000 (19:09 +0000)]
Change the default CPU to i486 on i386 (architecture).

Approved by: ed (mentor)

14 years agoComment out piece of code using __clear_cache() which FreeBSD
rdivacky [Wed, 9 Jun 2010 19:08:17 +0000 (19:08 +0000)]
Comment out piece of code using __clear_cache() which FreeBSD
does not have. This is only used for JIT on ARM so it's harmless.

Approved by: ed (mentor)

14 years agoCheck return value from archive_read_new().
delphij [Wed, 9 Jun 2010 18:59:07 +0000 (18:59 +0000)]
Check return value from archive_read_new().

Found with: Coverity Prevent(tm)
CID: 8462
Reviewed by: des
MFC after: 1 week

14 years agoRemove unneeded directories.
ed [Wed, 9 Jun 2010 18:11:12 +0000 (18:11 +0000)]
Remove unneeded directories.

Even though Roman removed these directories in his working copy, they
weren't removed from the actual repository, also causing his working
copy to be corrupted.

14 years agoImport LLVM/clang from vendor stripped of docs/ test/ website/ www/ examples/
rdivacky [Wed, 9 Jun 2010 17:59:52 +0000 (17:59 +0000)]
Import LLVM/clang from vendor stripped of docs/ test/ website/ www/ examples/
in llvm/ and/or llvm/contrib/clang/ respectively.

Approved by: ed (mentor)
Approved by: core

14 years agoFix serveral bugs all having to do with freeing an
rrs [Wed, 9 Jun 2010 16:42:42 +0000 (16:42 +0000)]
Fix serveral bugs all having to do with freeing an
sctp_inpcb:
1) Make sure not to remove the flag on the PCB until
   after the close() caller is back in control with the
   lock. Otherwise a quickly freeing assoc could kill the
   inpcb and cause a panic.

2) Make sure all calls to log_closing have not released
   the locks before calling the log function, we don't
   want the logging function to crash us due to a freed
   inpcb.

3) Make sure that when we get to the end, we release all
   locks (after removing them from view) and as long as
   we are NOT the inp-kill timer removing the inp, call
   the callout_drain() function so a racing timer won't
   later call in and cause a racing crash.
MFC after: 1 week

14 years agoBUG:Turns out we need to use both bit maps
rrs [Wed, 9 Jun 2010 16:39:18 +0000 (16:39 +0000)]
BUG:Turns out we need to use both bit maps
to calculate the cum-ack (we were not doing
it for the NR-Sack case). With this fix
NR-sack should now work correctly.
MFC after: 1 week

14 years agoAdd a new function devfs_parent_dirent() for resolving devfs parent
jh [Wed, 9 Jun 2010 15:29:12 +0000 (15:29 +0000)]
Add a new function devfs_parent_dirent() for resolving devfs parent
directory entry. Use the new function in devfs_fqpn(), devfs_lookupx()
and devfs_vptocnp() instead of manually resolving the parent entry.

Reviewed by: kib

14 years agoFix typo.
ae [Wed, 9 Jun 2010 12:30:40 +0000 (12:30 +0000)]
Fix typo.

Approved by: mav (mentor)
MFC after: 1 month

14 years agoNew netgraph node ng_patch(4). It performs data modification of packets
ae [Wed, 9 Jun 2010 12:25:57 +0000 (12:25 +0000)]
New netgraph node ng_patch(4). It performs data modification of packets
passing through. Modifications are restricted to a subset of C language
operations on unsigned integers of 8, 16, 32 or 64 bit size.
These are: set to new value (=), addition (+=), subtraction (-=),
multiplication (*=), division (/=), negation (= -), bitwise AND (&=),
bitwise OR (|=), bitwise eXclusive OR (^=), shift left (<<=),
shift right (>>=). Several operations are all applied to a packet
sequentially in order they were specified by user.

Submitted by: Maxim Ignatenko <gelraen.ua at gmail.com>
Vadim Goncharov <vadimnuclight at tpu.ru>
Discussed with: net@
Approved by: mav (mentor)
MFC after: 1 month

14 years agofix memset() calls.
edwin [Wed, 9 Jun 2010 10:36:25 +0000 (10:36 +0000)]
fix memset() calls.

Found with:   Coverity Prevent(tm)
CID:          8531

14 years agoRemove -mdoc macros from -man page
uqs [Wed, 9 Jun 2010 08:53:50 +0000 (08:53 +0000)]
Remove -mdoc macros from -man page

Neither groff nor mandoc render these when in -man mode.
This was introduced in r38083 as a local change, therefore no commit to
the vendor branch.

14 years agomdoc: spell out theta, the Unicode glyph is hard to read for terminal fonts
uqs [Wed, 9 Jun 2010 07:31:32 +0000 (07:31 +0000)]
mdoc: spell out theta, the Unicode glyph is hard to read for terminal fonts

It is referred to as "theta" later in the document anyway,
so stop being fancy.

14 years agoAdd set of codec IDs.
mav [Wed, 9 Jun 2010 05:49:02 +0000 (05:49 +0000)]
Add set of codec IDs.

PR: kern/147466

14 years agoRearrange how things are done to avoid dereferencing stale pointers in
mjacob [Tue, 8 Jun 2010 22:46:44 +0000 (22:46 +0000)]
Rearrange how things are done to avoid dereferencing stale pointers in
the case of immediate unconfigure after configure. Hold the periph an
extra count while we have the task to create sysctl context outstanding
so that the periph doesn't go away unexpectedly.

Sponsored by: Panasas
Reviewed by: scsi@
MFC after: 1 month

14 years agoTry and narrow the gap in which you act on an event that has been canceled.
mjacob [Tue, 8 Jun 2010 22:40:02 +0000 (22:40 +0000)]
Try and narrow the gap in which you act on an event that has been canceled.
Obtained from: Jaako Heinonen
MFC after: 1 month

14 years agoAdd the VHBA package. It is here in tools because it's really a testbed.
mjacob [Tue, 8 Jun 2010 22:26:47 +0000 (22:26 +0000)]
Add the VHBA package. It is here in tools because it's really a testbed.

Sponsored by: Panasas
MFC after: 1 month

14 years agoThe lock associated with the /dev/apm knote is already held, so use
jhb [Tue, 8 Jun 2010 21:27:05 +0000 (21:27 +0000)]
The lock associated with the /dev/apm knote is already held, so use
KNOTE_LOCKED() instead of KNOTE_UNLOCKED().

Reported by: mav
MFC after: 3 days

14 years agoMove the MD support for PCI message signalled interrupts to the x86 tree
jhb [Tue, 8 Jun 2010 18:36:03 +0000 (18:36 +0000)]
Move the MD support for PCI message signalled interrupts to the x86 tree
as it is identical for i386 and amd64.

14 years agoMove the machine check support code to the x86 tree since it is identical
jhb [Tue, 8 Jun 2010 18:04:07 +0000 (18:04 +0000)]
Move the machine check support code to the x86 tree since it is identical
on i386 and amd64.

Requested by: alc

14 years agoReorganize the code in bdwrite() which handles move of dirtiness
kib [Tue, 8 Jun 2010 17:54:28 +0000 (17:54 +0000)]
Reorganize the code in bdwrite() which handles move of dirtiness
from the buffer pages to buffer. Combine the code to set buffer
dirty range (previously in vfs_setdirty()) and to clean the pages
(vfs_clean_pages()) into new function vfs_clean_pages_dirty_buf(). Now
the vm object lock is acquired only once.

Drain the VPO_BUSY bit of the buffer pages before setting valid
and clean bits in vfs_clean_pages_dirty_buf() with new helper
vfs_drain_busy_pages(). pmap_clear_modify() asserts that page is not
busy.

In vfs_busy_pages(), move the wait for draining of VPO_BUSY before
the dirtyness handling, to follow the structure of
vfs_clean_pages_dirty_buf().

Reported and tested by: pho
Suggested and reviewed by: alc
MFC after: 2 weeks

14 years agoMove the I/O APIC code to the x86 tree since it is identical on i386 and
jhb [Tue, 8 Jun 2010 17:51:21 +0000 (17:51 +0000)]
Move the I/O APIC code to the x86 tree since it is identical on i386 and
amd64.

14 years agoOne byte off for scsi_target_group cdb.
mjacob [Tue, 8 Jun 2010 17:44:49 +0000 (17:44 +0000)]
One byte off for scsi_target_group cdb.

MFC after: 2 weeks

14 years agoRemove unused macros.
yongari [Tue, 8 Jun 2010 17:28:28 +0000 (17:28 +0000)]
Remove unused macros.

Reviewed by: bde

14 years ago- Use a bit more care when moving I/O APIC interrupts between CPUs. Mask
jhb [Tue, 8 Jun 2010 17:08:13 +0000 (17:08 +0000)]
- Use a bit more care when moving I/O APIC interrupts between CPUs.  Mask
  the interrupt followed by a brief delay if it is not currently masked
  before moving the interrupt.
- Move the icu_lock out of ioapic_program_intpin() and into callers.  This
  closes a race where ioapic_program_intpin() could use a stale value of
  the masked state to compute the masked bit in the register.

Reviewed by: mav
MFC after: 2 weeks

14 years agomdoc: remove literal tabs where they don't belong
uqs [Tue, 8 Jun 2010 16:48:59 +0000 (16:48 +0000)]
mdoc: remove literal tabs where they don't belong

14 years agomdoc: replace troff macros with -mdoc equivalents
uqs [Tue, 8 Jun 2010 16:48:49 +0000 (16:48 +0000)]
mdoc: replace troff macros with -mdoc equivalents

14 years agoFix a sign bug that caused adaptive spinning in sx_xlock() to not work
jhb [Tue, 8 Jun 2010 16:17:47 +0000 (16:17 +0000)]
Fix a sign bug that caused adaptive spinning in sx_xlock() to not work
properly.  Among other things it did not drop Giant while spinning
leading to livelocks.

Reviewed by: rookie, kib, jmallett
MFC after: 3 days

14 years agoImplement the usage of Report Luns as part of SCSI probing for SCP3 or
mjacob [Tue, 8 Jun 2010 16:17:25 +0000 (16:17 +0000)]
Implement the usage of Report Luns as part of SCSI probing for SCP3 or
better devices. This can be disabled on a per-device basis using quirks as
well.

This also handles the case where there is actually no connected LUN 0
(which can definitely be the case for storage arrays).

Reviewed by: scsi@
MFC after: 1 month

14 years agoDisable NCQ and PMP support for VIA VT8251 AHCI. It was reported to be
mav [Tue, 8 Jun 2010 10:03:08 +0000 (10:03 +0000)]
Disable NCQ and PMP support for VIA VT8251 AHCI. It was reported to be
unreliable under load. Linux does the same.

14 years agoMake additional definitions up to and including SPC-4. Add in definitions
mjacob [Tue, 8 Jun 2010 05:14:18 +0000 (05:14 +0000)]
Make additional definitions up to and including SPC-4. Add in definitions
for REPORT and SET TARGET PORT GROUP commands (foundations for future work).

Regularize opcodes to be upper case hex.

Pick *one* of tab or space after #define (tab) and stick with that.

MFC after: 2 weeks

14 years ago2 Bugs:
rrs [Tue, 8 Jun 2010 03:39:31 +0000 (03:39 +0000)]
2 Bugs:

1) Only use both mapping arrays when NR sack is off. This
   way we can hold off moving the cumack (not the best but
   workable) when NR-sack is on.

2) We must make sure to just return on the move of the
   bit to the NR array if the cum-ack as already went
   past the TSN. This prevents marking a bit behind the
   array and hitting the invariant code that panic's us.

MFC after: 1 week

14 years agoA number of netfront fixes and stability improvements:
ken [Tue, 8 Jun 2010 03:13:26 +0000 (03:13 +0000)]
A number of netfront fixes and stability improvements:

 - Re-enable TSO.  This was broken previously due to CSUM_TSO clearing the
   CSUM_TCP flag, so our checksum flags were incorrectly set going to the
   netback driver.  That was fixed in r206844 in tcp_output.c, so we can
   turn TSO back on here.

 - Fix the way transmit slots are calculated, so that we can't overfill
   the ring.

 - Avoid sending packets with more fragments/segments than netback can
   handle.  The Linux netback code can only handle packets of
   MAX_SKB_FRAGS, which turns out to be 18 on machines with 4K pages.  We
   can easily generate packets with 32 or so fragments with TSO turned on.
   Right now the solution is just to drop the packets (since netback
   doesn't seem to handle it gracefully), but we should come up with a way
   to allow a driver to tell the TCP stack the maximum number of fragments
   it can handle in a single packet.

 - Fix the way the consumer is tracked in the receive path.  It could get
   out of sync fairly easily.

 - Use standard Xen ring macros to make it clearer how netfront is using
   the rings.

 - Get rid of Linux-ish negative errno return values.

 - Added more documentation to the driver.

 - Refactored code to make it easier to read.

 - Some other minor fixes.

Reviewed by: gibbs

Reviewed by: gibbs
Sponsored by: Spectra Logic
MFC after: 7 days

14 years agoredfacedly noting a missing part of a patch.
mjacob [Mon, 7 Jun 2010 22:43:37 +0000 (22:43 +0000)]
redfacedly noting a missing part of a patch.

Pointy Hat To: Me
MFC after: 2 Week
X-MFC: 208896

14 years agoCall BUS_PROBE_NOMATCH() when device detached due to driver unload.
mav [Mon, 7 Jun 2010 18:47:53 +0000 (18:47 +0000)]
Call BUS_PROBE_NOMATCH() when device detached due to driver unload.
This allows bus to power-down device when driver unloaded on-flight.

14 years agoThis fixes a BUG in the handling of the cum-ack calculation.
rrs [Mon, 7 Jun 2010 18:29:10 +0000 (18:29 +0000)]
This fixes a BUG in the handling of the cum-ack calculation.
We were only paying attention to the nr-mapping-array. Which
seems to make sense on the surface, by definition things
up to the cum-ack should be deliverable thus in the nr-mapping-array.
However (there is always a gotcha) thats not true when it
comes to large messages. The stack may hold the message
while re-assembling it not not deliver it based on several
thresholds. If that happens (which it would for smaller
large messages) then the cum-ack is figured wrong. We
now properly use both arrays in the cum-ack calculation.

MFC after: 1 week.

14 years agoDo a minor amount of stylifying. Also, get a Fibre Channel WWPN if one exists
mjacob [Mon, 7 Jun 2010 17:41:34 +0000 (17:41 +0000)]
Do a minor amount of stylifying. Also, get a Fibre Channel WWPN if one exists
for a da unit and create a sysctl OID for it.

14 years agoFix XPT_GET_TRAN_SETTING for FC which has been broken for while so that
mjacob [Mon, 7 Jun 2010 17:39:36 +0000 (17:39 +0000)]
Fix XPT_GET_TRAN_SETTING for FC which has been broken for while so that
it will figure out the correct target to handle index and be able to find
things like WWPN, etc.

MFC after: 2 weeks