11 years agoHow buggy this little piece of code could be? Repair strnvis() buffersize
Hasso Tepper [Sat, 4 Oct 2008 09:57:14 +0000 (09:57 +0000)]
How buggy this little piece of code could be? Repair strnvis() buffersize
of 4*n+1, with termination gauranteed by the function.

Obtained-from: OpenBSD

11 years ago - adjust boot command description for booting from
Thomas Nikolajsen [Fri, 3 Oct 2008 21:26:28 +0000 (21:26 +0000)]
 - adjust boot command description for booting from
   root of boot-only file system
 - improve markup
 - fix exmaple of dummy s0 partition to use enough space for disklabel

11 years agoStart sentence on new line.
Thomas Nikolajsen [Fri, 3 Oct 2008 20:09:12 +0000 (20:09 +0000)]
Start sentence on new line.

11 years agoSilence remaining "'packed' attribute ignored for field of type..." warnings.
Sascha Wildner [Fri, 3 Oct 2008 19:56:11 +0000 (19:56 +0000)]
Silence remaining "'packed' attribute ignored for field of type..." warnings.

Verified-with: md5

11 years ago - fix description of time (cleanup): suffix is mandantory
Thomas Nikolajsen [Fri, 3 Oct 2008 18:55:57 +0000 (18:55 +0000)]
 - fix description of time (cleanup): suffix is mandantory
 - describe period use (cleanup)
 - use `cyclefile' everywhere, not cycle file

11 years agoFree sysctl tree during detach
Sepherosa Ziehau [Fri, 3 Oct 2008 14:14:10 +0000 (14:14 +0000)]
Free sysctl tree during detach

11 years agoTransmit csum offload does not work at all on certain hardware revision
Sepherosa Ziehau [Fri, 3 Oct 2008 14:07:02 +0000 (14:07 +0000)]
Transmit csum offload does not work at all on certain hardware revision
once frame length exceeds certain threshold (different parts seems to
have different thresholds).  Borrow code from ip_output to do software
csum, if transmit csum offloading is enabled and frame length exceeds
hardware's threshold.

8169, 8169S, 8169SB and 8168B are tested, while 8169S and 8169SB does not
seem to have this bug.

11 years agoDon't allocate space for empty banners. Makes me able to connect various
Hasso Tepper [Fri, 3 Oct 2008 12:30:07 +0000 (12:30 +0000)]
Don't allocate space for empty banners. Makes me able to connect various
network equipment again.

Obtained-from: OpenBSD CVS

11 years agoPrint hardware revision during attach
Sepherosa Ziehau [Fri, 3 Oct 2008 11:35:25 +0000 (11:35 +0000)]
Print hardware revision during attach

11 years agoether_demux() is now ether_demux_oncpu().
Sascha Wildner [Fri, 3 Oct 2008 10:46:41 +0000 (10:46 +0000)]
ether_demux() is now ether_demux_oncpu().

11 years agoRe-add some previously removed docs about devd(8) notifies.
Sascha Wildner [Fri, 3 Oct 2008 10:33:49 +0000 (10:33 +0000)]
Re-add some previously removed docs about devd(8) notifies.

11 years agoRemove extra comma and bump .Dd
Sascha Wildner [Fri, 3 Oct 2008 10:32:10 +0000 (10:32 +0000)]
Remove extra comma and bump .Dd

11 years agoBump .Dd
Sascha Wildner [Fri, 3 Oct 2008 10:30:43 +0000 (10:30 +0000)]
Bump .Dd

11 years agoAdjust for recent devd(8) import.
Sascha Wildner [Fri, 3 Oct 2008 10:27:42 +0000 (10:27 +0000)]
Adjust for recent devd(8) import.

11 years ago- Don't substract ETHER_ALIGN from the fragment length, we don't do
Sepherosa Ziehau [Fri, 3 Oct 2008 10:12:35 +0000 (10:12 +0000)]
- Don't substract ETHER_ALIGN from the fragment length, we don't do
  m_adj(ETHET_ALIGN) in re_newbuf()
- If one fragment of a multi-fragment packet recolletion fails, we
  drop will consecutive fragments of this packet.
- All of the TX descs in TX ring could be used; there is no need to
  reserve RE_TXDESC_SPARE TX descs

11 years agoPrefix hex numbers with '0x' in debug messages.
Sascha Wildner [Fri, 3 Oct 2008 09:25:18 +0000 (09:25 +0000)]
Prefix hex numbers with '0x' in debug messages.

11 years agoCorrectly handle Intel g33 chips and add support for g45 chips.
Hasso Tepper [Fri, 3 Oct 2008 08:56:58 +0000 (08:56 +0000)]
Correctly handle Intel g33 chips and add support for g45 chips.

Obtained-from: FreeBSD

11 years agoFactor out re_free_rxchain()
Sepherosa Ziehau [Fri, 3 Oct 2008 08:00:06 +0000 (08:00 +0000)]
Factor out re_free_rxchain()

11 years agoIf a neighbor solictation or neighbor advertisement isn't from the
Hasso Tepper [Fri, 3 Oct 2008 07:59:20 +0000 (07:59 +0000)]
If a neighbor solictation or neighbor advertisement isn't from the
unspecified address, make sure that the source address matches one of the
interfaces address prefixes.


Obtained-from: NetBSD with modifications

11 years agoRework DMA stuffs' allocation/free
Sepherosa Ziehau [Fri, 3 Oct 2008 07:52:26 +0000 (07:52 +0000)]
Rework DMA stuffs' allocation/free

11 years agoIf RX/TX ring initialization failed, then stop re(4) and return
Sepherosa Ziehau [Fri, 3 Oct 2008 05:47:07 +0000 (05:47 +0000)]
If RX/TX ring initialization failed, then stop re(4) and return

11 years agoRework re_newbuf() and re_encap()
Sepherosa Ziehau [Fri, 3 Oct 2008 05:09:18 +0000 (05:09 +0000)]
Rework re_newbuf() and re_encap()

11 years agodevctl(4)/devd(8) support in acpi_thinkpad(4).
Hasso Tepper [Fri, 3 Oct 2008 00:47:36 +0000 (00:47 +0000)]
devctl(4)/devd(8) support in acpi_thinkpad(4).

11 years agoWelcome devctl(4) and devd(8).
Hasso Tepper [Fri, 3 Oct 2008 00:26:21 +0000 (00:26 +0000)]
Welcome devctl(4) and devd(8).

Obtained-from: FreeBSD

11 years agoRegenerate the pciconf(8) database from the following files:
Sascha Wildner [Thu, 2 Oct 2008 07:51:51 +0000 (07:51 +0000)]
Regenerate the pciconf(8) database from the following files:

Hart:    Jan 22, 2008 (version 671)
Boemler: Oct  1, 2008
Mares:   Sep 16, 2008

11 years ago- Instead of using magic number 4 define it as RE_TXDESC_SPARE
Sepherosa Ziehau [Thu, 2 Oct 2008 04:14:13 +0000 (04:14 +0000)]
- Instead of using magic number 4 define it as RE_TXDESC_SPARE
- Clear if_timer only if all TX descs are free
- Clear IFF_OACTIVE only if more than RE_TXDESC_SPARE TX descs ar free

11 years agoDon't use .Fn for getcap. Reference it with .Xr instead.
Sascha Wildner [Wed, 1 Oct 2008 11:01:02 +0000 (11:01 +0000)]
Don't use .Fn for getcap. Reference it with .Xr instead.

11 years agoAdd KTR_ETHERNET.
Sascha Wildner [Wed, 1 Oct 2008 10:53:48 +0000 (10:53 +0000)]

11 years agoSplit arprequest() into two parts, arpreq_alloc() and arpreq_send().
Sepherosa Ziehau [Wed, 1 Oct 2008 09:16:18 +0000 (09:16 +0000)]
Split arprequest() into two parts, arpreq_alloc() and arpreq_send().
arprequest() simply calls these two functions sequencially.

Add arprequest_async(), which allocates the arp request using arpreq_alloc()
and then dispatch the real sending (arpreq_send()) to current CPU's netisr.
Callers of arprequest_async() do not need to worry about the ifp's serializer
state.  This function also makes sure that the network output happens in
TDF_NETWORK kernel thread.

Let arp_ifinit(), arp_ifinit2() and arp_rtrequest() call arprequest_async().

11 years ago- Constify 'enaddr'
Sepherosa Ziehau [Wed, 1 Oct 2008 07:29:16 +0000 (07:29 +0000)]
- Constify 'enaddr'
- Minor style change

11 years agoHAMMER Utilities: Adjust 'show' defaults.
Matthew Dillon [Tue, 30 Sep 2008 23:13:08 +0000 (23:13 +0000)]
HAMMER Utilities: Adjust 'show' defaults.

* 'hammer show' now defaults to full verboseness.

* -q may now be used to reduce verboseness.

11 years agoFix HISTORY.
Sascha Wildner [Tue, 30 Sep 2008 21:08:10 +0000 (21:08 +0000)]

11 years agoSilence warnings.
Sascha Wildner [Tue, 30 Sep 2008 17:47:21 +0000 (17:47 +0000)]
Silence warnings.

11 years agoRaise WARNS to 6.
Sascha Wildner [Tue, 30 Sep 2008 17:11:16 +0000 (17:11 +0000)]
Raise WARNS to 6.

11 years agoAnsify (i.e., silence -Wold-style-definition) the rest of lib/
Sascha Wildner [Tue, 30 Sep 2008 16:57:06 +0000 (16:57 +0000)]
Ansify (i.e., silence -Wold-style-definition) the rest of lib/
(minus contrib/). Also remove a couple of "register" keywords.

11 years agoUse spaces instead of tabs like everywhere else.
Sascha Wildner [Tue, 30 Sep 2008 13:26:17 +0000 (13:26 +0000)]
Use spaces instead of tabs like everywhere else.

11 years agoAdd MLINKS.
Sascha Wildner [Tue, 30 Sep 2008 13:13:11 +0000 (13:13 +0000)]

11 years agoThe devinfo(3) library provides userspace access to the internal device
Hasso Tepper [Tue, 30 Sep 2008 12:20:29 +0000 (12:20 +0000)]
The devinfo(3) library provides userspace access to the internal device
hierarchy. The devinfo(8) utility can be used to view that information.
Ported by Sascha Wildner.

Obtained-from: FreeBSD

11 years agoRemove trailing whitespace.
Sascha Wildner [Tue, 30 Sep 2008 08:28:59 +0000 (08:28 +0000)]
Remove trailing whitespace.

11 years agoUse .In for include files.
Sascha Wildner [Tue, 30 Sep 2008 08:28:36 +0000 (08:28 +0000)]
Use .In for include files.

11 years agoDo not return an EINVAL error for certain abort and disconnect cases.
Matthew Dillon [Mon, 29 Sep 2008 20:52:23 +0000 (20:52 +0000)]
Do not return an EINVAL error for certain abort and disconnect cases.
Otherwise an async close() by the other end can cause our close() to
return EINVAL.

11 years agoAdd support for "RealTek 8102EL PCIe 10/100baseTX". Checksum support
Matthew Dillon [Mon, 29 Sep 2008 20:27:38 +0000 (20:27 +0000)]
Add support for "RealTek 8102EL PCIe 10/100baseTX".  Checksum support
doesn't work yet for this card so disable hardware checksumming.

Submitted-by: "Mitja Horvat" <pinkfluid@gmail.com>
11 years agoUpdate acpi_battery(4) related code to the latest one from FreeBSD HEAD.
Hasso Tepper [Mon, 29 Sep 2008 06:59:45 +0000 (06:59 +0000)]
Update acpi_battery(4) related code to the latest one from FreeBSD HEAD.

Obtained-from: FreeBSD

11 years ago * Fix `cleanup' usage to match program
Thomas Nikolajsen [Sun, 28 Sep 2008 21:27:56 +0000 (21:27 +0000)]
 * Fix `cleanup' usage to match program
 * Expand `cleanup' description
 * Add note that `snapshot' is a per PFS operation
 * Sync recommended path for slave PFS snapshots to program
 * Add `-offset indent' to .Bd where missing
 * Break too long line

11 years ago * Add note on HAMMER use for NFS exporting PFSs
Thomas Nikolajsen [Sun, 28 Sep 2008 21:19:58 +0000 (21:19 +0000)]
 * Add note on HAMMER use for NFS exporting PFSs
 * Add note that UFS for lower layer is assumed in example
 * Improve markup

11 years agoAdd:
Thomas Nikolajsen [Sun, 28 Sep 2008 21:15:46 +0000 (21:15 +0000)]
 * description of NFS exports, including handling of PFSs;
also remove BUGS section, which said PFSs couldn't be NFS exported.
 * note that null mounts of PFSs are recommended
 * note on `hammer cleanup'
 * note that reblocking is needed for nohistory mounts
 * description of data integrity checking from HAMMER article
 * `-offset indent' to .Bd missing it

11 years agoThis file is an amd64 config file, not i386
Victor Balada Diaz [Sun, 28 Sep 2008 20:58:11 +0000 (20:58 +0000)]
This file is an amd64 config file, not i386

11 years agoRevert part of my previous commit which was removing too much.
Sascha Wildner [Sun, 28 Sep 2008 18:05:26 +0000 (18:05 +0000)]
Revert part of my previous commit which was removing too much.

11 years agoRemove checks for other BSDs.
Sascha Wildner [Sun, 28 Sep 2008 17:43:32 +0000 (17:43 +0000)]
Remove checks for other BSDs.

11 years agoRemove Lua backend and add README.DELETED.
Sascha Wildner [Sun, 28 Sep 2008 17:33:35 +0000 (17:33 +0000)]
Remove Lua backend and add README.DELETED.

11 years agoInstall a moduli(5) manual page.
Peter Avalos [Sun, 28 Sep 2008 17:18:02 +0000 (17:18 +0000)]
Install a moduli(5) manual page.

11 years agoAdd .Lb
Sascha Wildner [Sun, 28 Sep 2008 16:40:05 +0000 (16:40 +0000)]
Add .Lb

11 years agoAdd documentation for the statvfs, fstatvfs and fhstatvfs system calls.
Sascha Wildner [Sun, 28 Sep 2008 16:33:35 +0000 (16:33 +0000)]
Add documentation for the statvfs, fstatvfs and fhstatvfs system calls.

Adapted-from: OpenBSD and NetBSD

11 years agoWe no longer specify block and fragment sizes using disklabel(8).
Sascha Wildner [Sun, 28 Sep 2008 15:11:34 +0000 (15:11 +0000)]
We no longer specify block and fragment sizes using disklabel(8).
Make the installer pass them to newfs(8) instead.

11 years agoLinux emulation adjustments.
Matthew Dillon [Sun, 28 Sep 2008 05:08:16 +0000 (05:08 +0000)]
Linux emulation adjustments.

* Change the special case value for the compat option to getdents,
  newer versions of linux were using the value to probe availability
  of the 64 bit getdents.

* Change the cookie sequencing a bit for getdents.  It still isn't quite

* Generate a hashed 32 bit inode number from our 64 bit inode number.

11 years agoUse the new vop_stdpathconf() instead of rolling our own.
Matthew Dillon [Sun, 28 Sep 2008 05:04:22 +0000 (05:04 +0000)]
Use the new vop_stdpathconf() instead of rolling our own.

11 years agoAdd vop_stdpathconf and default it so filesystems do not need to declare
Matthew Dillon [Sun, 28 Sep 2008 04:31:50 +0000 (04:31 +0000)]
Add vop_stdpathconf and default it so filesystems do not need to declare

11 years agoUpgrade build for OpenSSH 5.1p1.
Peter Avalos [Sun, 28 Sep 2008 03:19:46 +0000 (03:19 +0000)]
Upgrade build for OpenSSH 5.1p1.

11 years agoMerge from vendor branch OPENSSH:
Peter Avalos [Sat, 27 Sep 2008 22:32:45 +0000 (22:32 +0000)]
Merge from vendor branch OPENSSH:
Import OpenSSH-5.1p1.

11 years agoImport OpenSSH-5.1p1.
Peter Avalos [Sat, 27 Sep 2008 22:32:45 +0000 (22:32 +0000)]
Import OpenSSH-5.1p1.

11 years agoUpgrade to OpenSSL 0.9.8i.
Peter Avalos [Sat, 27 Sep 2008 21:04:49 +0000 (21:04 +0000)]
Upgrade to OpenSSL 0.9.8i.

11 years agoMerge from vendor branch OPENSSL:
Peter Avalos [Sat, 27 Sep 2008 20:51:29 +0000 (20:51 +0000)]
Merge from vendor branch OPENSSL:
Import OpenSSL-0.9.8i.

11 years agoImport OpenSSL-0.9.8i.
Peter Avalos [Sat, 27 Sep 2008 20:51:29 +0000 (20:51 +0000)]
Import OpenSSL-0.9.8i.

11 years agoDo not loop forever if narg becomes negative. This can happen when asked
Matthew Dillon [Sat, 27 Sep 2008 20:29:52 +0000 (20:29 +0000)]
Do not loop forever if narg becomes negative.  This can happen when asked
to kdump trace output created by emulated system calls.

11 years agoRevoke the INTR_MPSAFE flag; nata is not MPSAFE yet.
Sepherosa Ziehau [Sat, 27 Sep 2008 11:45:30 +0000 (11:45 +0000)]
Revoke the INTR_MPSAFE flag; nata is not MPSAFE yet.

11 years agoFor SMP kernel
Sepherosa Ziehau [Sat, 27 Sep 2008 11:29:47 +0000 (11:29 +0000)]
For SMP kernel
- Don't call arp_update_oncpu() again in in_arpinput()
- Pass dologging to arp_update_oncpu(), only if the current cpu is CPU0,
  remove the redundant cpu==0 checks

Reviewed-by: dillon@
11 years agoSchedule ipfw_tick() to IPFW_CFGPORT to run, this function is too time
Sepherosa Ziehau [Fri, 26 Sep 2008 12:12:36 +0000 (12:12 +0000)]
Schedule ipfw_tick() to IPFW_CFGPORT to run, this function is too time
consuming and complex to run in callout thread.

Use MPSAFE callout after above change.

11 years agoAttempt to fix the crash if accessing usb device(s) after unloading usb.ko.
Hasso Tepper [Fri, 26 Sep 2008 08:21:22 +0000 (08:21 +0000)]
Attempt to fix the crash if accessing usb device(s) after unloading usb.ko.

11 years ago- Minor style and white space changes
Sepherosa Ziehau [Thu, 25 Sep 2008 14:08:06 +0000 (14:08 +0000)]
- Minor style and white space changes
- Break long line

11 years agoIf not in debugger, output kernel debug information to both the console and
Sepherosa Ziehau [Thu, 25 Sep 2008 13:30:15 +0000 (13:30 +0000)]
If not in debugger, output kernel debug information to both the console and
kernel message buffer via printf.

Obtained-from: FreeBSD

11 years agoAdd NETISR_TO_MSGF() to convert netisr.ni_flags to lwkt_msg.ms_flags to
Sepherosa Ziehau [Thu, 25 Sep 2008 12:08:51 +0000 (12:08 +0000)]
Add NETISR_TO_MSGF() to convert netisr.ni_flags to lwkt_msg.ms_flags to
avoid potential tranlation bugs

Pointed-out-by: hsu@
11 years agoRemove the untrue example section of the man page. We have the -S option to
Matthias Schmidt [Thu, 25 Sep 2008 09:09:06 +0000 (09:09 +0000)]
Remove the untrue example section of the man page.  We have the -S option to
sort entries by size.

11 years agoFix function name.
Sascha Wildner [Wed, 24 Sep 2008 19:48:40 +0000 (19:48 +0000)]
Fix function name.

11 years agoIf the current thread is not a network thread then rejecting the packet back
Sepherosa Ziehau [Wed, 24 Sep 2008 15:06:45 +0000 (15:06 +0000)]
If the current thread is not a network thread then rejecting the packet back
into netisrX when it becomes eligible.  Add comment about possible situation
that the current thread is not a network thread.

11 years agoAdd NETISR_FLAG_NOTMPSAFE, which could be used as the last parameter to
Sepherosa Ziehau [Wed, 24 Sep 2008 14:26:39 +0000 (14:26 +0000)]
Add NETISR_FLAG_NOTMPSAFE, which could be used as the last parameter to
netisr_register(), more expressive and less error-prone than 0.

Suggested-by: hsu@
11 years agoMark all msgs used by polling(4) as MPSAFE ones
Sepherosa Ziehau [Wed, 24 Sep 2008 12:07:19 +0000 (12:07 +0000)]
Mark all msgs used by polling(4) as MPSAFE ones

11 years agoInclude necessary head file for {get,rel}_mplock() to unbreak UP kernel build
Sepherosa Ziehau [Wed, 24 Sep 2008 11:14:43 +0000 (11:14 +0000)]
Include necessary head file for {get,rel}_mplock() to unbreak UP kernel build

Pointed-out-by: y0netan1@
11 years agoAdditions to 'hammer pfs-*':
Matthew Dillon [Wed, 24 Sep 2008 01:42:50 +0000 (01:42 +0000)]
Additions to 'hammer pfs-*':

    * Add 'snapshots=dir' and 'snapshots-clear' options

      This allows you to specify the snapshots directory for any PFS, master
      or slave.  The option will override the default "snapshots"
      sub-directory used by the 'hammer cleanup' directive for PFS masters.

      This option is required for PFS slaves since the hammer cleanup
      directive cannot use a directory in the slave PFS as a working
      directory (because its a slave).

Additions to 'hammer cleanup':

    * Implement the snapshot limit found the config file.  e.g. if the
      <fs>/snapshots/config file contains: 'snapshots 1d 60d' then
      the filesystem is snapshotted once a day and snapshot softlinks over
      60 days old will be deleted.

    * This directive now checks the snapshots path configured in the PFS
      and uses it if it is not empty.  The snapshots path must be configured
      for slaves.

11 years agosleep for a shorter period of time when an excessive number of inodes are
Matthew Dillon [Wed, 24 Sep 2008 00:53:51 +0000 (00:53 +0000)]
sleep for a shorter period of time when an excessive number of inodes are
being recycled.

11 years agoRename the PFSD structure's prune_path[64] to snapshots[64].
Matthew Dillon [Wed, 24 Sep 2008 00:53:16 +0000 (00:53 +0000)]
Rename the PFSD structure's prune_path[64] to snapshots[64].

11 years agoFix a double-flush which was occuring for every unlinked inode, resulting
Matthew Dillon [Tue, 23 Sep 2008 22:28:56 +0000 (22:28 +0000)]
Fix a double-flush which was occuring for every unlinked inode, resulting
in very inefficient flushing operations which also prevented any inode from
being reclaimed until the entire flush batch (which could be upwards of 40,000
inodes) completed.

The double-flush was caused by the HAMMER_INODE_DELETING flag being
improperly set twice.

Clear the HAMMER_INODE_REFLUSH flag if a reflush was queued but the
modmask is cleared by the prior flush.

Adjust the directory mtime before flushing an underlying inode, avoiding
a double flush of the directory inode.

Reported-by: Hasso Tepper <hasso@estpak.ee>
11 years agoChange the autoflush code to autoflush when a flush group reaches a
Matthew Dillon [Tue, 23 Sep 2008 21:03:52 +0000 (21:03 +0000)]
Change the autoflush code to autoflush when a flush group reaches a
certain point rather then trying to do it from the reclaim code.  This
smooths out the flush sequences.  The default is 2000, adjustable via
the vfs.hammer.autoflush sysctl.

Move hammer_inode_waitreclaims() calls.  In particular, remove the calls
in the VOP_CLOSE() path.  The problem with waiting for excessive reclaims to
drop in these paths is that the inode/vnode operation in question is probably
cached.  Thus unrelated programs, even those just opening /dev/null (if /dev
is on a HAMMER filesystem), can wind up blocking in hmrrcm for no good reason.

Instead defer the hammer_inode_waitreclaims() call to the end of the
transaction code if a new inode had to be created during the transaction.
Thus we tend to block on operations that did not have previously cached
vnodes to work with instead of operations on cached vnodes.

Reported-by: Hasso Tepper <hasso@estpak.ee>
11 years agoMake two more changes to the ata request queue sorting code.
Matthew Dillon [Tue, 23 Sep 2008 17:43:41 +0000 (17:43 +0000)]
Make two more changes to the ata request queue sorting code.

* Do not try to sort write requests.  There's no point, the hard drive
  has a write cache and a much better understanding of the media topology
  and will sort the requests for us.

* Move the freeze point every 16 requests instead of every 128 to further
  reduce the amount of reordering we allow to prevent older requests from
  being delayed indefinitely by newer requests.

  Note: the original ata code didn't code any limits at all, causing insanely
  long latencies during heavy disk I/O for no good reason.

Reported-by: Hasso Tepper <hasso@estpak.ee>
11 years agopolling(4)'s poll/pollmore netmsg handler will not be changed, so initialize
Sepherosa Ziehau [Tue, 23 Sep 2008 14:14:20 +0000 (14:14 +0000)]
polling(4)'s poll/pollmore netmsg handler will not be changed, so initialize
them once.

11 years agoOn ethernet input path:
Sepherosa Ziehau [Tue, 23 Sep 2008 13:12:06 +0000 (13:12 +0000)]
On ethernet input path:
- Put netgraph(4), carp(4) and IPX (mainly ef_inputp) under BGL explicitly
- Set MSGF_MPSAFE on the msg sent to the network protocols threads

11 years agoUse netmsg_service_sync() to protect vlan_input_p
Sepherosa Ziehau [Tue, 23 Sep 2008 11:50:11 +0000 (11:50 +0000)]
Use netmsg_service_sync() to protect vlan_input_p

11 years agoAdd following three network protocol threads running mode:
Sepherosa Ziehau [Tue, 23 Sep 2008 11:28:50 +0000 (11:28 +0000)]
Add following three network protocol threads running mode:
1) BGL (default)
2) Adaptive BGL.  Protocol threads run without BGL by default.  BGL will be
   held if the received msg does not have MSGF_MPSAFE turned on the ms_flags
3) No BGL (experimental)

The code on the main path is done by dillon@

Following three sysctls and tunables are added to adjust the "mode":

They have same set of values,
0 (default) -- BGL
1      -- Adaptive BGL
2      -- No BGL

NETISR_FLAG_MPSAFE is added (netisr.ni_flags), so that:
- netisr_queue() and schednetisr() could set MSGF_MPSAFE during msg
- netisr_run() (called by ether_input_oncpu()) could hold BGL based on this flag
  before calling netisr's handler

PR_MPSAFE is added (protosw.pr_flags), so that tranport_processing_oncpu() could
hold BGL before calling protocol's input handler

Kernel API changes:
- The thread parameter to netmsg_service_loop() must be supplied (running mode)
  and it must have the type of "int *"
- netisr_register() takes additional flags parameter to indicate whether its
  handler is MPSAFE (NETISR_FLAG_MPSAFE) or not

Reviewed-by: dillon@
11 years agoAdd _SC_PAGE_SIZE as alias to _SC_PAGESIZE to make modern software pieces
Hasso Tepper [Mon, 22 Sep 2008 09:13:21 +0000 (09:13 +0000)]
Add _SC_PAGE_SIZE as alias to _SC_PAGESIZE to make modern software pieces

11 years agoHAMMER: Fix a couple of minor non-corrupting bugs in HAMMER.
Matthew Dillon [Sun, 21 Sep 2008 02:58:31 +0000 (02:58 +0000)]
HAMMER: Fix a couple of minor non-corrupting bugs in HAMMER.

* Fix a few cases where the kmalloc space for hammer inodes can become
  exhausted.  Add calls to hammer_inode_waitreclaims() in several places
  where modified inodes can build up without the related vnodes
  necessarily being VOP_OPEN()'d or VOP_CLOSE()'d.

* Fix a deadlock which can occur in fsync().  fsync() was holding the vnode
  lock while waiting for the inode to sync.  The inode sync can be held up
  indefinitely by dependancies on other vnodes, so holding the lock can
  result in a deadlock.

* Fix a bug where ap->a_ctllen test results were being ignored.  This
  path is only used by mountd.

Reported-by: Francois Tigeot <ftigeot@wolfpond.org>,
Damian Lubosch <dl@pless.xiqit.de>

11 years ago- Add KTR of ethernet operations
Sepherosa Ziehau [Sat, 20 Sep 2008 10:53:16 +0000 (10:53 +0000)]
- Add KTR of ethernet operations
- Measure the cost of ether_input_chain
- Measure the cost of ether_input_dispatch

11 years ago* Fix a bug in runcmd() - the argv[] list was not NULL terminated.
Matthew Dillon [Sat, 20 Sep 2008 07:08:06 +0000 (07:08 +0000)]
* Fix a bug in runcmd() - the argv[] list was not NULL terminated.

* Record PFS's by their unique_uuid instead of their pfs_id, allowing
  the clean operation to cover multiple PFSs on multiple HAMMER mounts.

11 years agoIf snapshots are disabled and the snapshots directory contains no
Matthew Dillon [Sat, 20 Sep 2008 06:46:22 +0000 (06:46 +0000)]
If snapshots are disabled and the snapshots directory contains no
snapshot softlinks, prune using 'prune-everything' instead of 'prune'.

11 years agoAdd PFIL_MPSAFE flag to give hint to pfil(9) that the underlying firewall
Sepherosa Ziehau [Sat, 20 Sep 2008 06:08:13 +0000 (06:08 +0000)]
Add PFIL_MPSAFE flag to give hint to pfil(9) that the underlying firewall
code is MPSAFE.  Set this flag for ipfw(4).

11 years agoInstead of rejecting the eligible packet back into the correct cpu,
Sepherosa Ziehau [Sat, 20 Sep 2008 04:36:51 +0000 (04:36 +0000)]
Instead of rejecting the eligible packet back into the correct cpu,
dummynet(4) now reinjects the eligible packet back into correct
network thread.

11 years agoAdd TDF_NETWORK lwkt flag, so various assertion could be performed to make sure
Sepherosa Ziehau [Sat, 20 Sep 2008 04:31:02 +0000 (04:31 +0000)]
Add TDF_NETWORK lwkt flag, so various assertion could be performed to make sure
that packets are processed in network threads (i.e. controlled enviroment)

11 years agoAdd the 'hammer cleanup' command. This is a meta-command which will
Matthew Dillon [Sat, 20 Sep 2008 04:23:21 +0000 (04:23 +0000)]
Add the 'hammer cleanup' command.  This is a meta-command which will
process specified HAMMER filesystem or, if none specified, locate all
mounted HAMMER filesystems and run snapshot, pruning, and reblocking
commands a appropriate.

If the <fs>/snapshots directory or <fs>/snapshots/config file does not
exist, they will be created.

11 years agoRemove dereference of uninitialized 'i'.
Sascha Wildner [Fri, 19 Sep 2008 18:48:33 +0000 (18:48 +0000)]
Remove dereference of uninitialized 'i'.

Found-by: LLVM/Clang Static Analyzer
11 years agoRemove dereference of 'i' which is never set. getopt() will take care of
Sascha Wildner [Fri, 19 Sep 2008 17:49:31 +0000 (17:49 +0000)]
Remove dereference of 'i' which is never set. getopt() will take care of
printing an "illegal option" message anyway.

Found-by: LLVM/Clang Static Analyzer
11 years agoUpdate comment
Sepherosa Ziehau [Fri, 19 Sep 2008 12:23:56 +0000 (12:23 +0000)]
Update comment

11 years agoCheck ipfw static rules generation after get the BGL
Sepherosa Ziehau [Fri, 19 Sep 2008 12:04:09 +0000 (12:04 +0000)]
Check ipfw static rules generation after get the BGL