]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agomerge WIP multi-board support; tested on Avila and Cambria, still
sam [Sat, 13 Dec 2008 02:56:08 +0000 (02:56 +0000)]
merge WIP multi-board support; tested on Avila and Cambria, still
needs Proghorn testing

15 years agonanobsd glue for building Avila and Cambria CF images
sam [Sat, 13 Dec 2008 02:53:12 +0000 (02:53 +0000)]
nanobsd glue for building Avila and Cambria CF images

15 years agoMerge WIP from p4:
sam [Sat, 13 Dec 2008 01:21:37 +0000 (01:21 +0000)]
Merge WIP from p4:
o recognize ixp435 cpu
o change memory layout for for ixp4xx to not assume memory is aliases
  to 0x10000000 (Cambria/ixp435 memory starts at zero)
o handle 64 irqs for ixp435
o dual EHCI USB 2.0 controller integral to ixp435
o overhaul NPE code for ixp435 and better MAC+MII naming
o updated NPE firmware (including NPE-A image for ixp435/ixp465)
o Gateworks Cambria board support:
  - IDE compact flash
  - MCU
  - front panel LED on i2c bus
  - Octal LED latch

Sanity-tested with NFS-root on Avila and Cambria boards.  Requires
pending boot2 mods for CF-boot on Cambria.

15 years agoIt seems usb2 needs the devtable regenerated after editing usbdevs.
thompsa [Fri, 12 Dec 2008 21:57:16 +0000 (21:57 +0000)]
It seems usb2 needs the devtable regenerated after editing usbdevs.

15 years agoSort the PCI device's and make the catch-all for new Dell
ambrisko [Fri, 12 Dec 2008 20:29:34 +0000 (20:29 +0000)]
Sort the PCI device's and make the catch-all for new Dell
cards only apply to Dell.  This gets rid of the duplicate
catch-all that I introduced that jkim caught.

Prompted by: jkim
Reviewed by: jkim

15 years agoThe TWINKLECAM entry is under CHICONY2, remove MICRODIA.
thompsa [Fri, 12 Dec 2008 18:34:27 +0000 (18:34 +0000)]
The TWINKLECAM entry is under CHICONY2, remove MICRODIA.

Obtained from: NetBSD

15 years agoUse correct AIPTEK2 name for vendor 0x04fc, now that the PENCAM_MEGA_1_3
thompsa [Fri, 12 Dec 2008 18:26:08 +0000 (18:26 +0000)]
Use correct AIPTEK2 name for vendor 0x04fc, now that the PENCAM_MEGA_1_3
product is paired with it.

Obtained from: NetBSD

15 years agoReviewed by: (Dieter)freebsd@sopwith.solgatos.com
sbruno [Fri, 12 Dec 2008 18:17:23 +0000 (18:17 +0000)]
Reviewed by: (Dieter)freebsd@sopwith.solgatos.com
Approved by: slong scottl@samsco.org
MFC after: 2 weeks

Final cleanup of fwcontrol.
  NetBSD compatibility
  Cleanup errors in usage() display
  Finish up error handling via errx/warnx
  Generate error on unparsed command line syntax
  Change device(devbase) to open into the form /dev/fwX.X

15 years agoAdd in some more device ID's and a generic catch-all.
ambrisko [Fri, 12 Dec 2008 16:41:12 +0000 (16:41 +0000)]
Add in some more device ID's and a generic catch-all.

Submitted by: LSI

15 years agoExpose symbol `PMC_FN_USER_CALLCHAIN' to assembler code.
jkoshy [Fri, 12 Dec 2008 16:09:34 +0000 (16:09 +0000)]
Expose symbol `PMC_FN_USER_CALLCHAIN' to assembler code.

15 years agoMove the check for the ending char in the partition name where
luigi [Fri, 12 Dec 2008 15:56:38 +0000 (15:56 +0000)]
Move the check for the ending char in the partition name where
it was before -- the check is only made when getdisklabel()
returns valid info.
On passing, use MAXPARTITIONS to identify the max partition number,
instead of the hardwired 'h'

MFC after: 4 weeks

15 years agoAdd a field to disambiguate between multiple threads awaiting
jkoshy [Fri, 12 Dec 2008 14:57:25 +0000 (14:57 +0000)]
Add a field to disambiguate between multiple threads awaiting
callchain capture.

15 years agoUio_yield() already does DROP_GIANT/PICKUP_GIANT, no need to repeat this
kib [Fri, 12 Dec 2008 14:03:04 +0000 (14:03 +0000)]
Uio_yield() already does DROP_GIANT/PICKUP_GIANT, no need to repeat this
around the call.

Noted by:  bde

15 years agoReference the vmspace of the process being inspected by procfs, linprocfs
kib [Fri, 12 Dec 2008 12:12:36 +0000 (12:12 +0000)]
Reference the vmspace of the process being inspected by procfs, linprocfs
and sysctl kern_proc_vmmap handlers.

Reported and tested by: pho
Reviewed by: rwatson, des
MFC after: 1 week

15 years agoThe userland_sysctl() function retries sysctl_root() until returned
kib [Fri, 12 Dec 2008 12:06:28 +0000 (12:06 +0000)]
The userland_sysctl() function retries sysctl_root() until returned
error is not EAGAIN. Several sysctls that inspect another process use
p_candebug() for checking access right for the curproc. p_candebug()
returns EAGAIN for some reasons, in particular, for the process doing
exec() now. If execing process tries to lock Giant, we get a livelock,
because sysctl handlers are covered by Giant, and often do not sleep.

Break the livelock by dropping Giant and allowing other threads to
execute in the EAGAIN loop.

Also, do not return EAGAIN from p_candebug() when process is executing,
use more appropriate EBUSY error [1].

Reported and tested by: pho
Suggested by: rwatson [1]
Reviewed by: rwatson, des
MFC after: 1 week

15 years agoRemove the offer to install Linux compatibility on i386 in the mainline
kensmith [Fri, 12 Dec 2008 11:58:27 +0000 (11:58 +0000)]
Remove the offer to install Linux compatibility on i386 in the mainline
portion of sysinstall.  Leave it to be treated as a regular package
along with all the other packages...

15 years agoBegin the sysinstall cleanup. Remove the support for configuring OSF
kensmith [Fri, 12 Dec 2008 11:43:48 +0000 (11:43 +0000)]
Begin the sysinstall cleanup.  Remove the support for configuring OSF
binary compatibility.

15 years agoDo not leak defs_de_interlock on error.
kib [Fri, 12 Dec 2008 11:10:10 +0000 (11:10 +0000)]
Do not leak defs_de_interlock on error.

Another pointy hat for my collection.

15 years agofix support and capabilities
kmacy [Fri, 12 Dec 2008 05:45:39 +0000 (05:45 +0000)]
fix support and capabilities

MFC after: 3 days

15 years ago- Drop a reference to an older 'kdb' debugger that FreeBSD never had.
jhb [Fri, 12 Dec 2008 05:42:57 +0000 (05:42 +0000)]
- Drop a reference to an older 'kdb' debugger that FreeBSD never had.
- Tweak a word choice.
- Drop a reference to Alpha.

15 years agoBump __FreeBSD_version for the new VOP_VPTOCNP addition.
marcus [Fri, 12 Dec 2008 04:29:47 +0000 (04:29 +0000)]
Bump __FreeBSD_version for the new VOP_VPTOCNP addition.

Approved by: kib (implicit)

15 years agoRTF_RNH_LOCKED needs to be passed in the flags arg not report,
kmacy [Fri, 12 Dec 2008 02:07:45 +0000 (02:07 +0000)]
RTF_RNH_LOCKED needs to be passed in the flags arg not report,
apologies to thompsa

15 years agoPass RTF_RNH_LOCKED to rtalloc1 sunce the node head is locked, this avoids a
thompsa [Fri, 12 Dec 2008 01:46:59 +0000 (01:46 +0000)]
Pass RTF_RNH_LOCKED to rtalloc1 sunce the node head is locked, this avoids a
recursive lock panic on inet6 detach.

Reviewed by: kmacy

15 years agoConsider processes attaching/detaching from tun(4) devices as being link
csjp [Fri, 12 Dec 2008 01:36:50 +0000 (01:36 +0000)]
Consider processes attaching/detaching from tun(4) devices as being link
state changes.  This change modifies tunopen and tunclose to call the
if_link_state_change() function.  Among other things, this will result in
devd(8) receiving events from devctl(4) for linkup/link down.  This allows
us to do several useful things, including initializing tunnel parameters
and adding routes.

Discussed on: freebsd-net@
MFC after: 2 weeks

15 years agoIt seems there are still issues on multicast perfect filtering.
yongari [Fri, 12 Dec 2008 01:26:11 +0000 (01:26 +0000)]
It seems there are still issues on multicast perfect filtering.
Disable it until I find spare time to analyze the issue.

Reported by: Goran Lowkrantz <glz <> hidden-powers DOT com>
MFC after: 3 days

15 years agoAdd a man page for VOP_VPTOCNP.
marcus [Fri, 12 Dec 2008 01:08:28 +0000 (01:08 +0000)]
Add a man page for VOP_VPTOCNP.

Reviewed by: arch
Approved by: kib

15 years agoImplement VOP_VPTOCNP for devfs. Directory and character device vnodes are
marcus [Fri, 12 Dec 2008 01:00:38 +0000 (01:00 +0000)]
Implement VOP_VPTOCNP for devfs.  Directory and character device vnodes are
properly translated to their component names.

Reviewed by: arch
Approved by: kib

15 years agoAdd a simple VOP_VPTOCNP implementation for deadfs which returns EBADF.
marcus [Fri, 12 Dec 2008 00:59:36 +0000 (00:59 +0000)]
Add a simple VOP_VPTOCNP implementation for deadfs which returns EBADF.

Reviewed by: arch
Approved by: kib

15 years agoAdd a new error VOP, VOP_ENOENT. This function will simply return ENOENT.
marcus [Fri, 12 Dec 2008 00:58:52 +0000 (00:58 +0000)]
Add a new error VOP, VOP_ENOENT.  This function will simply return ENOENT.

Reviewed by: arch
Approved by: kib

15 years agoAdd a new VOP, VOP_VPTOCNP, which translates a vnode to its component name
marcus [Fri, 12 Dec 2008 00:57:38 +0000 (00:57 +0000)]
Add a new VOP, VOP_VPTOCNP, which translates a vnode to its component name
on a best-effort basis.  Teach vn_fullpath to use this new VOP if a
regular VFS cache lookup fails.  This VOP is designed to supplement the
VFS cache to provide a better chance that a vnode-to-name lookup will
succeed.

Currently, an implementation for devfs is being committed.  The default
implementation is to return ENOENT.

A big thanks to kib for the mentorship on this, and to pho for running it
through his stress test suite.

Reviewed by: arch
Approved by: kib

15 years agoRemove superfluous return statements from the end of void functions.
thompsa [Thu, 11 Dec 2008 23:17:48 +0000 (23:17 +0000)]
Remove superfluous return statements from the end of void functions.

15 years agoFormat and wrap function declarations.
thompsa [Thu, 11 Dec 2008 23:13:02 +0000 (23:13 +0000)]
Format and wrap function declarations.

15 years agoAdd entry for if_transmit and if_qflush
kmacy [Thu, 11 Dec 2008 22:51:11 +0000 (22:51 +0000)]
Add entry for if_transmit and if_qflush

15 years agoAdd kqueue()-support to pseudo-terminal master devices.
ed [Thu, 11 Dec 2008 21:44:02 +0000 (21:44 +0000)]
Add kqueue()-support to pseudo-terminal master devices.

One thing I didn't expect many applications to use, was kqueue() on
pseudo-terminal master devices. There are applications that use kqueue()
on the TTY itself (rtorrent, etc). That doesn't mean we shouldn't
implement this. Libraries like libevent use kqueue() by default, which
means they wouldn't be able to use kqueue().

The old TTY layer implements a very broken version of kqueue() by
performing the actual polling on the TTY device.

Discussed with: peter

15 years agoAdd entries for some Option, Sierra and Stelera 3G cards.
thompsa [Thu, 11 Dec 2008 21:08:14 +0000 (21:08 +0000)]
Add entries for some Option, Sierra and Stelera 3G cards.

15 years agoDon't forget to add "npts" to rlimit_ident[] as well.
ed [Thu, 11 Dec 2008 18:32:05 +0000 (18:32 +0000)]
Don't forget to add "npts" to rlimit_ident[] as well.

When I added RLIMIT_NPTS, I forgot to add it to rlimit_ident[]. Make
sure the rlimit_ident[] array is always RLIM_NLIMITS elements big. So if
we ever forget to add new rlimits to this list again. it will contain a
null pointer, instead of random data.

Spotted by: rwatson

15 years agoFix a leak introduced in r185902. We should free the devspec if
ps [Thu, 11 Dec 2008 16:48:35 +0000 (16:48 +0000)]
Fix a leak introduced in r185902.  We should free the devspec if
we've successfully found a zfs pool.

15 years agoPut a global variables, which were virtualized but formerly
bz [Thu, 11 Dec 2008 16:26:38 +0000 (16:26 +0000)]
Put a global variables, which were virtualized but formerly
missed under VIMAGE_GLOBAL.

Start putting the extern declarations of the  virtualized globals
under VIMAGE_GLOBAL as the globals themsevles are already.
This will help by the time when we are going to remove the globals
entirely.

While there garbage collect a few dead externs from ip6_var.h.

Sponsored by: The FreeBSD Foundation

15 years agoPut the VIMAGE options together in one place.
bz [Thu, 11 Dec 2008 16:13:17 +0000 (16:13 +0000)]
Put the VIMAGE options together in one place.

Sponsored by: The FreeBSD Foundation

15 years agoOrder #includes - also to reduce diffs with vimage branches in p4.
bz [Thu, 11 Dec 2008 16:09:31 +0000 (16:09 +0000)]
Order #includes - also to reduce diffs with vimage branches in p4.

Sponsored by: The FreeBSD Foundation

15 years agoUse the correct INIT_VNET_INET() as the virtualized variable here
bz [Thu, 11 Dec 2008 16:05:07 +0000 (16:05 +0000)]
Use the correct INIT_VNET_INET() as the virtualized variable here
are in vinet.h not in vinet6.h

Sponsored by: The FreeBSD Foundation

15 years agoAdd constants for fields in the local APIC error status register and a
jhb [Thu, 11 Dec 2008 15:56:30 +0000 (15:56 +0000)]
Add constants for fields in the local APIC error status register and a
routine to read it.

15 years agoError in case anyone tried to compile with both options VIMAGE and
bz [Thu, 11 Dec 2008 15:44:53 +0000 (15:44 +0000)]
Error in case anyone tried to compile with both options VIMAGE and
the (temporary) option VIMAGE_GLOBALS.

Sponsored by: The FreeBSD Foundation:

15 years agoWhitespace changes only - tabs must have been converted to spaces
bz [Thu, 11 Dec 2008 15:42:59 +0000 (15:42 +0000)]
Whitespace changes only - tabs must have been converted to spaces
somehow, when moving the code from p4 to svn.

Sponsored by: The FreeBSD Foundation

15 years agoAdd missing "goto set_head" for SO_IPX_CHECKSUM; otherwise we fall through
rwatson [Thu, 11 Dec 2008 10:29:35 +0000 (10:29 +0000)]
Add missing "goto set_head" for SO_IPX_CHECKSUM; otherwise we fall through
to the SO_HEADERS_ON_OUTPUT case and set that instead.

MFC after: 1 week
Found with: Coverity Prevent(tm)
Coverity ID: 3988

15 years agoPush mips support into the tree.
imp [Thu, 11 Dec 2008 08:22:20 +0000 (08:22 +0000)]
Push mips support into the tree.

15 years agoPush mips support into the tree.
imp [Thu, 11 Dec 2008 08:20:34 +0000 (08:20 +0000)]
Push mips support into the tree.

15 years agoPush mips support for ld into the tree.
imp [Thu, 11 Dec 2008 08:18:45 +0000 (08:18 +0000)]
Push mips support for ld into the tree.

15 years agoPush mips support for as into the tree.
imp [Thu, 11 Dec 2008 08:15:14 +0000 (08:15 +0000)]
Push mips support for as into the tree.

15 years agoRemove redundant assignment.
imp [Thu, 11 Dec 2008 07:00:23 +0000 (07:00 +0000)]
Remove redundant assignment.

15 years agoApply the same defaults to https as to http.
des [Thu, 11 Dec 2008 06:54:36 +0000 (06:54 +0000)]
Apply the same defaults to https as to http.

Submitted by: Mike Tancsa <mike@sentex.net>
MFC after: 1 week

15 years agoUpdate to the interrupt handling code:
imp [Thu, 11 Dec 2008 06:27:18 +0000 (06:27 +0000)]
Update to the interrupt handling code:

o Try to be smarter about reading the ExCA CSC register.  Now, we only
  do it for 16-bit cards.  Add some experimental code to treat it like
  a power interrupt, but I'm not 100% sure that I like it.  It may be
  removed upon further testing.  It seemed to help in one test case, but
  the evidence may be inconclusive.  This may be beneficial for cleaning up
  exca_reset and exca_wait_ready.
o Check for CSTS events on the socket event register.  We ask for it when
  we're powering up a card, but I don't think we're otherwise using
  it.  Just ACK the interrupt for now.  In theory, we can use it
  instead of the busy wait we do in cbb_cardbus_reset.  More research
  is necessary to see if we can optimize things there when we're
  waiting for the DEVVENDOR register to become valid.
o Rework the comments a bit.  Minor tidying up.  Etc.

15 years agoadd missing break
sam [Thu, 11 Dec 2008 04:03:50 +0000 (04:03 +0000)]
add missing break

Coverity ID: 4159

15 years agoadd missing break
sam [Thu, 11 Dec 2008 04:03:13 +0000 (04:03 +0000)]
add missing break

Coverity ID: 4151

15 years agoConsolidate some variable initializations. No substantive change.
das [Thu, 11 Dec 2008 02:39:27 +0000 (02:39 +0000)]
Consolidate some variable initializations. No substantive change.

15 years agoMake WOL work on RTL8168B. This controller seems to require
yongari [Thu, 11 Dec 2008 02:24:11 +0000 (02:24 +0000)]
Make WOL work on RTL8168B. This controller seems to require
explicit command to enable Rx MAC prior to entering D3.

Tested by: Cyrus Rahman <crahman <> gmail DOT com>

15 years agoAvoid a double free in devopen by not freeing the device structure
ps [Thu, 11 Dec 2008 02:23:49 +0000 (02:23 +0000)]
Avoid a double free in devopen by not freeing the device structure
in zfs_dev_open.  This stops a panic in the loader when trying to
read from a zfs device and no zfs devices exist.

15 years agoDon't access undocumented register 0x82 on controllers that
yongari [Thu, 11 Dec 2008 01:41:38 +0000 (01:41 +0000)]
Don't access undocumented register 0x82 on controllers that
have no such register. While here clear undocumented PHY
register 0x0B for RTL8110S.

Obtained from: RealTek FreeBSD driver

15 years agoNewer RealTek controllers requires setting stop request bit to
yongari [Thu, 11 Dec 2008 01:26:18 +0000 (01:26 +0000)]
Newer RealTek controllers requires setting stop request bit to
terminate active Tx/Rx operation.

15 years agoCorrectly check the number of prison states to not access anything
bz [Thu, 11 Dec 2008 01:04:25 +0000 (01:04 +0000)]
Correctly check the number of prison states to not access anything
outside the prison_states array.
When checking if there is a name configured for the prison, check the
first character to not be '\0' instead of checking if the char array
is present, which it always is. Note, that this is different for the
*jailname in the syscall.

Found with: Coverity Prevent(tm)
CID: 4156, 4155
MFC after: 4 weeks (just that I get the mail)

15 years agoAdd 32-bit compat support for AIO.
bz [Thu, 11 Dec 2008 00:58:05 +0000 (00:58 +0000)]
Add 32-bit compat support for AIO.

jhb probably forgot to commit this file with r185878 and will want to
review this. It unbreaks the build here.

Obtained from: p4 //depot/user/jhb/lock/compat/freebsd32/freebsd32_signal.h#2

15 years agoAlways put controller into known state before device intialization.
yongari [Thu, 11 Dec 2008 00:46:07 +0000 (00:46 +0000)]
Always put controller into known state before device intialization.
While here remove re_reset calls invoked in system error case as
controller reset is always done in device initialization.

15 years agoPartly revert r185756. RTL8169SC doesn't like reduced delays in
yongari [Thu, 11 Dec 2008 00:30:26 +0000 (00:30 +0000)]
Partly revert r185756. RTL8169SC doesn't like reduced delays in
GMII access while Tx/Rx is in progress.

Reported by: Jaakko Heinonen <jh <> saunalahti DOT fi>,
Anton Yuzhaninov <citrin <> citrin DOT ru>
Tested by: Jaakko Heinonen <jh <> saunalahti DOT fi>

15 years agoConditionally compile out V_ globals while instantiating the appropriate
zec [Wed, 10 Dec 2008 23:12:39 +0000 (23:12 +0000)]
Conditionally compile out V_ globals while instantiating the appropriate
container structures, depending on VIMAGE_GLOBALS compile time option.

Make VIMAGE_GLOBALS a new compile-time option, which by default will not
be defined, resulting in instatiations of global variables selected for
V_irtualization (enclosed in #ifdef VIMAGE_GLOBALS blocks) to be
effectively compiled out.  Instantiate new global container structures
to hold V_irtualized variables: vnet_net_0, vnet_inet_0, vnet_inet6_0,
vnet_ipsec_0, vnet_netgraph_0, and vnet_gif_0.

Update the VSYM() macro so that depending on VIMAGE_GLOBALS the V_
macros resolve either to the original globals, or to fields inside
container structures, i.e. effectively

#ifdef VIMAGE_GLOBALS
#define V_rt_tables rt_tables
#else
#define V_rt_tables vnet_net_0._rt_tables
#endif

Update SYSCTL_V_*() macros to operate either on globals or on fields
inside container structs.

Extend the internal kldsym() lookups with the ability to resolve
selected fields inside the virtualization container structs.  This
applies only to the fields which are explicitly registered for kldsym()
visibility via VNET_MOD_DECLARE() and vnet_mod_register(), currently
this is done only in sys/net/if.c.

Fix a few broken instances of MODULE_GLOBAL() macro use in SCTP code,
and modify the MODULE_GLOBAL() macro to resolve to V_ macros, which in
turn result in proper code being generated depending on VIMAGE_GLOBALS.

De-virtualize local static variables in sys/contrib/pf/net/pf_subr.c
which were prematurely V_irtualized by automated V_ prepending scripts
during earlier merging steps.  PF virtualization will be done
separately, most probably after next PF import.

Convert a few variable initializations at instantiation to
initialization in init functions, most notably in ipfw.  Also convert
TUNABLE_INT() initializers for V_ variables to TUNABLE_FETCH_INT() in
initializer functions.

Discussed at: devsummit Strassburg
Reviewed by: bz, julian
Approved by: julian (mentor)
Obtained from: //depot/projects/vimage-commit2/...
X-MFC after: never
Sponsored by: NLnet Foundation, The FreeBSD Foundation

15 years agoMake sure nmbclusters are initialized before maxsockets
bz [Wed, 10 Dec 2008 22:17:09 +0000 (22:17 +0000)]
Make sure nmbclusters are initialized before maxsockets
by running the tunable_mbinit() SYSINIT at SI_ORDER_MIDDLE
before the init_maxsockets() SYSINT at SI_ORDER_ANY.

Reviewed by: rwatson, zec
Sponsored by: The FreeBSD Foundation
MFC after: 4 weeks

15 years agoStyle changes only. Put the return type on an extra line[1] and
bz [Wed, 10 Dec 2008 22:10:37 +0000 (22:10 +0000)]
Style changes only. Put the return type on an extra line[1] and
add an empty line at the beginning as we do not have any local
variables.

Submitted by: rwatson [1]
Reviewed by: rwatson
MFC after: 4 weeks

15 years agoRemove added newlines from logged messages written to /dev/console.
ed [Wed, 10 Dec 2008 21:48:05 +0000 (21:48 +0000)]
Remove added newlines from logged messages written to /dev/console.

The /dev/console device node logs all strings that are written to it.
When the string does not contain a trailing newline, it appends one. I
can imagine this was useful a long time ago, but with our current
rc-scripts, it generates a whole bunch of messages that look like:

| Configuring syscons:
|  blanktime
| .

By not appending the newlines, the output of `dmesg -a' is now (almost?)
exactly the same as what the user will see on the console device
(syscons, uart).

15 years agoRegen.
jhb [Wed, 10 Dec 2008 20:57:16 +0000 (20:57 +0000)]
Regen.

15 years ago- Add 32-bit compat system calls for VFS_AIO. The system calls live in the
jhb [Wed, 10 Dec 2008 20:56:19 +0000 (20:56 +0000)]
- Add 32-bit compat system calls for VFS_AIO.  The system calls live in the
  aio code and are registered via the recently added SYSCALL32_*() helpers.
- Since the aio code likes to invoke fuword and suword a lot down in the
  "bowels" of system calls, add a structure holding a set of operations for
  things like storing errors, copying in the aiocb structure, storing
  status, etc.  The 32-bit system calls use a separate operations vector to
  handle fuword32 vs fuword, etc.  Also, the oldsigevent handling is now
  done by having seperate operation vectors with different aiocb copyin
  routines.
- Split out kern_foo() functions for the various AIO system calls so the
  32-bit front ends can manage things like copying in and converting
  timespec structures, etc.
- For both the native and 32-bit aio_suspend() and lio_listio() calls,
  just use copyin() to read the array of aiocb pointers instead of using
  a for loop that iterated over fuword/fuword32.  The error handling in
  the old case was incomplete (lio_listio() just ignored any aiocb's that
  it got an EFAULT trying to read rather than reporting an error), and
  possibly slower.

MFC after: 1 month

15 years agoRather than using a char array with explicit assumptions about the layout
jhb [Wed, 10 Dec 2008 19:45:58 +0000 (19:45 +0000)]
Rather than using a char array with explicit assumptions about the layout
of 'struct osigevent' in 'struct aiocb', use int and void pointer spare
members that are identical to 'struct osigevent'.

MFC after: 1 month

15 years agoRelock user map earlier, to have the lock held when break leaves the
kib [Wed, 10 Dec 2008 16:11:09 +0000 (16:11 +0000)]
Relock user map earlier, to have the lock held when break leaves the
loop earlier due to sbuf error.

Pointy hat to: me
Submitted by: dchagin

15 years agoWe need to pass a structure with enough space for an NFSv2 filehandle to
dfr [Wed, 10 Dec 2008 14:49:54 +0000 (14:49 +0000)]
We need to pass a structure with enough space for an NFSv2 filehandle to
nfs_srvmtofh_xx otherwise bad things happen when an NFSv2 client tries to
make a request.

15 years agoRemove inconsistent white space from in_pcballoc().
rwatson [Wed, 10 Dec 2008 13:24:38 +0000 (13:24 +0000)]
Remove inconsistent white space from in_pcballoc().

MFC after: pretty soon

15 years agoMove syncache flag definitions below data structure, compress some vertical
rwatson [Wed, 10 Dec 2008 11:11:43 +0000 (11:11 +0000)]
Move syncache flag definitions below data structure, compress some vertical
whitespace.

MFC after: pretty soon

15 years agoMove flag definitions for t_flags and t_oobflags below the definition of
rwatson [Wed, 10 Dec 2008 11:03:16 +0000 (11:03 +0000)]
Move flag definitions for t_flags and t_oobflags below the definition of
struct tcpcb so that the structure definition is a bit more vertically
compact.  Can't yet fit it on one printed page, though.

MFC after: pretty soon

15 years agoDon't get confused if we encounter a device which is part of a raidz or raidz2
dfr [Wed, 10 Dec 2008 10:46:34 +0000 (10:46 +0000)]
Don't get confused if we encounter a device which is part of a raidz or raidz2
pool while probing for vdevs.

PR: 129539
Submitted by: Paul Wootton (paul at fletchermoorland dot co dot uk)

15 years agofix a reported panic when adding a route and one hit here when deleting a route
kmacy [Wed, 10 Dec 2008 09:21:52 +0000 (09:21 +0000)]
fix a reported panic when adding a route and one hit here when deleting a route

- pass RTF_RNH_LOCKED to rtalloc1_fib in 2 cases where the lock is held
- make sure the rnh lock is held across rt_setgate and rt_getifa_fib

15 years agounlock when done
kmacy [Wed, 10 Dec 2008 08:23:47 +0000 (08:23 +0000)]
unlock when done

15 years agodon't reference if_addr_mtx directly
kmacy [Wed, 10 Dec 2008 08:22:51 +0000 (08:22 +0000)]
don't reference if_addr_mtx directly

15 years agoMove the xprintf hook to where it belongs; it shouldn't be in the
das [Wed, 10 Dec 2008 02:32:06 +0000 (02:32 +0000)]
Move the xprintf hook to where it belongs; it shouldn't be in the
middle of vfprintf's variable declarations.

15 years agoUpdate comment on INP_TIMEWAIT to say what it's about, as we caution
rwatson [Tue, 9 Dec 2008 23:57:09 +0000 (23:57 +0000)]
Update comment on INP_TIMEWAIT to say what it's about, as we caution
regarding the misplacement of flags in inp_vflag in an earlier comment.

MFC after: pretty soon

15 years ago- Limit BCM5701 B5 to 32-bit mode as a workaround for a bug which
marius [Tue, 9 Dec 2008 21:34:22 +0000 (21:34 +0000)]
- Limit BCM5701 B5 to 32-bit mode as a workaround for a bug which
  causes data corruption in combination with certain bridges.
  Information about this problem was kindly provided by davidch. [1]
- As BGE_FLAG_PCIX is meant to indicate that the controller is in
  PCI-X mode, revert to the pre __FreeBSD_version 602101 method of
  reading the bus mode register rather than checking the mere
  existence of a PCI-X capability, which is also there when the
  NIC f.e. is put into a 32-bit slot causing it not to be in PCI-X
  mode. Setting BGE_FLAG_PCIX inappropriately could cause the NIC
  to be tuned incorrectly.

PR: 128833 [1]
Reviewed by: jhb
MFC after: 3 days

15 years agoIt does not make much sense to include net/route.h twice.
bz [Tue, 9 Dec 2008 21:09:05 +0000 (21:09 +0000)]
It does not make much sense to include net/route.h twice.
Remove one #include.

15 years agoAdd rwlock.h (and lock.h for that) to keep no-INET kernels compiling
bz [Tue, 9 Dec 2008 20:05:58 +0000 (20:05 +0000)]
Add rwlock.h (and lock.h for that) to keep no-INET kernels compiling
after RADIX_NODE_HEAD_{,UN}LOCK() were added.  Must have been "learned"
by pollution before (most likely: route.h -> radix.h -> rwlock.h)

15 years agoFix a bug introduced in r185747: rather than dereferencing an uninitialized
bz [Tue, 9 Dec 2008 19:44:53 +0000 (19:44 +0000)]
Fix a bug introduced in r185747: rather than dereferencing an uninitialized
*rt to something undefined, use the fibnum that came in as function argument.

Found with: Coverity Prevent(tm)
CID: 4168

15 years agoEnhance one comment relating to recent TCP locking changes, and fix a
rwatson [Tue, 9 Dec 2008 15:49:02 +0000 (15:49 +0000)]
Enhance one comment relating to recent TCP locking changes, and fix a
typo in another.

MFC after: 6 weeks

15 years agoMove macros defining flags and shortcus to nested structure fields in
rwatson [Tue, 9 Dec 2008 10:21:38 +0000 (10:21 +0000)]
Move macros defining flags and shortcus to nested structure fields in
inpcbinfo below the structure definition in order to make inpcbinfo
fit on a single printed page; related style tweaks.

MFC after: pretty soon

15 years agoFix a cornercase during search
phk [Tue, 9 Dec 2008 09:25:03 +0000 (09:25 +0000)]
Fix a cornercase during search

15 years agoo Use full month name in .Dd macro.
maxim [Tue, 9 Dec 2008 09:24:25 +0000 (09:24 +0000)]
o Use full month name in .Dd macro.

15 years agoFix a long standing VLAN tagged frame handling bug.
yongari [Tue, 9 Dec 2008 04:30:47 +0000 (04:30 +0000)]
Fix a long standing VLAN tagged frame handling bug.
When VLAN tagged frame is received the hardware sets 'LONG' bit of
Rx status word. It is always set when the size of received frame
exceeded 1518 bytes, including CRC. This VLAN tagged frame clears
'OK' bit of Rx status word such that driver should not rely on 'OK'
bit of Rx status word to pass the VLAN tagged frame to upper stack.

To fix the bug, don't use SIS_CMDSTS_PKT_OK for Rx error check and
introduce SIS_RXSTAT_ERROR macro that checks Rx errors. If we are
configured to accept VLAN tagged frames and the received frame size
is less than or equal to maximum allowed length of VLAN tagged
frame, clear 'LONG' bit of Rx status word before checking Rx
errors.

Reported by: Vladimir Ermako < samflanker <> gmail DOT com >
Tested by: Vladimir Ermako < samflanker <> gmail DOT com >

15 years agoAdd the ability to control the sleep LED with led(4). Adding this fairly
nwhitehorn [Tue, 9 Dec 2008 01:01:02 +0000 (01:01 +0000)]
Add the ability to control the sleep LED with led(4). Adding this fairly
useless feature gives us a reasonably complete PMU implementation.

15 years agoRemove now unused label.
sobomax [Tue, 9 Dec 2008 00:25:57 +0000 (00:25 +0000)]
Remove now unused label.

Submitted by: Christoph Mallon
MFC after: 4 weeks
(along with r185779 and r185780)

15 years agoOptimiza assembly in the previous r185779, to save whooping 16 bytes.
sobomax [Mon, 8 Dec 2008 23:45:41 +0000 (23:45 +0000)]
Optimiza assembly in the previous r185779, to save whooping 16 bytes.

Submitted by: Christoph Mallon
MFC after: 4 weeks
(including r185779)

15 years agoRespect RBX_MUTE flag from boot[012].
sobomax [Mon, 8 Dec 2008 21:52:06 +0000 (21:52 +0000)]
Respect RBX_MUTE flag from boot[012].

MFC after: 4 weeks

15 years agoadd RW_SYSINIT_FLAGS macro and rw_sysinit_flags initialization function
kmacy [Mon, 8 Dec 2008 21:46:55 +0000 (21:46 +0000)]
add RW_SYSINIT_FLAGS macro and rw_sysinit_flags initialization function

15 years agoAdd strndup(3) prototype to string.h.
kib [Mon, 8 Dec 2008 21:04:24 +0000 (21:04 +0000)]
Add strndup(3) prototype to string.h.

This change was erronously ommitted from the r185690, and attempt
to simply add the prototype to string.h has revealed that several
contributed programs defined local prototypes for strndup(), controlled
by autoconfed config.h. So, manually change #undef HAVE_STRNDUP to
#define HAVE_STRNDUP 1. Next import of the corresponding program would
regenerate config.h, overriding the changes in this commit.

No objections from: kan

15 years agoFix typo in the comment %is -> %si.
sobomax [Mon, 8 Dec 2008 20:53:27 +0000 (20:53 +0000)]
Fix typo in the comment %is -> %si.

15 years agoMove from solely write-locking the global tcbinfo in tcp_input()
rwatson [Mon, 8 Dec 2008 20:27:00 +0000 (20:27 +0000)]
Move from solely write-locking the global tcbinfo in tcp_input()
to read-locking in the TCP input path, allowing greater TCP
input parallelism where multiple ithreads or ithread and netisr
are able to run in parallel.  Previously, most TCP input paths
held a write lock on the global tcbinfo lock, effectively
serializing TCP input.

Before looking up the connection, acquire a write lock if a
potentially state-changing flag is set on the TCP segment header
(FIN, RST, SYN), and otherwise a read lock.  We may later have
to upgrade to a write lock in certain cases (ACKs received by the
syncache or during TIMEWAIT) in order to support global state
transitions, but this is never required for steady-state packets.

Upgrading from a write lock to a read lock must be done as a
trylock operation to avoid deadlocks, and actually violates the
lock order as the tcbinfo lock preceeds the inpcb lock held at
the time of upgrade.  If the trylock fails, we bump the refcount
on the inpcb, drop both locks, and re-acquire in-order.  If
another thread has freed the connection while the locks are
dropped, we free the inpcb and repeat the lookup (this should
hardly ever or never happen in practice).

For now, maintain a number of new counters measuring how many
times various cases execute, and in particular whether various
optimistic assumptions about when read locks can be used, whether
upgrades are done using the fast path, and whether connections
close in practice in the above-described race, actually occur.

MFC after: 6 weeks
Discussed with: kmacy
Reviewed by: bz, gnn, kmacy
Tested by: kmacy

15 years ago- avoid recursively locking the radix node head lock
kmacy [Mon, 8 Dec 2008 20:21:57 +0000 (20:21 +0000)]
- avoid recursively locking the radix node head lock
- assert that it is held if RTF_RNH_LOCKED is not passed

15 years agoAdd a reference count to struct inpcb, which may be explicitly
rwatson [Mon, 8 Dec 2008 20:18:50 +0000 (20:18 +0000)]
Add a reference count to struct inpcb, which may be explicitly
incremented using in_pcbref(), and decremented using in_pcbfree()
or inpcbrele().  Protocols using only current in_pcballoc() and
in_pcbfree() calls will see the same semantics, but it is now
possible for TCP to call in_pcbref() and in_pcbrele() to prevent
an inpcb from being freed when both tcbinfo and per-inpcb locks
are released.  This makes it possible to safely transition from
holding only the inpcb lock to both tcbinfo and inpcb lock
without re-looking up a connection in the input path, timer
path, etc.

Notice that in_pcbrele() does not unlock the connection after
decrementing the refcount, if the connection remains, so that
the caller can continue to use it; in_pcbrele() returns a flag
indicating whether or not the inpcb pointer is still valid, and
in_pcbfee() is now a simple wrapper around in_pcbrele().

MFC after: 1 month
Discussed with: bz, kmacy
Reviewed by: bz, gnn, kmacy
Tested by: kmacy