dragonfly.git
11 years agoUse absolute inclusion path
Sepherosa Ziehau [Wed, 17 Sep 2008 09:56:49 +0000 (09:56 +0000)]
Use absolute inclusion path

11 years ago'func' has the type of pfil_func_t
Sepherosa Ziehau [Wed, 17 Sep 2008 08:58:33 +0000 (08:58 +0000)]
'func' has the type of pfil_func_t

11 years agoAlways enable ETHER_INPUT_CHAIN support
Sepherosa Ziehau [Wed, 17 Sep 2008 08:51:30 +0000 (08:51 +0000)]
Always enable ETHER_INPUT_CHAIN support

11 years agoRemove the '2' suffix from ether_input_chain and vlan_input; their counterparts
Sepherosa Ziehau [Wed, 17 Sep 2008 07:51:59 +0000 (07:51 +0000)]
Remove the '2' suffix from ether_input_chain and vlan_input; their counterparts
have gone for a long time.

11 years agoNuke unused function
Sepherosa Ziehau [Wed, 17 Sep 2008 07:24:18 +0000 (07:24 +0000)]
Nuke unused function

11 years ago- Remove unnecessary crit sections
Sepherosa Ziehau [Wed, 17 Sep 2008 03:08:27 +0000 (03:08 +0000)]
- Remove unnecessary crit sections
- Remove no longer applied comment

11 years agoFactor out ipfw_match_uid(), put it under BGL explicitly
Sepherosa Ziehau [Wed, 17 Sep 2008 02:53:51 +0000 (02:53 +0000)]
Factor out ipfw_match_uid(), put it under BGL explicitly

11 years ago * fix markup of `auto' argument
Thomas Nikolajsen [Tue, 16 Sep 2008 20:45:36 +0000 (20:45 +0000)]
 * fix markup of `auto' argument
 * add `auto' where missing
 * delete extra synopsis
 * fix wrong single character quoting

11 years agoCommit the remainder of Max's dma work (with minor modifications).
Matthias Schmidt [Tue, 16 Sep 2008 17:57:23 +0000 (17:57 +0000)]
Commit the remainder of Max's dma work (with minor modifications).
See Max mail on kernel@ [1] for further details.

* Support of .forward files (Note: dma is now setuid root)
* Send multiple mails at once
* Fix some style(9) issues (mostly return())

Some style(9) issues are still in the code.  I take care if I have some
spare time :)  Please test!

Submitted-by: Max Lindner <gisanka@gmail.com>
Sponsored-by: Google Summer of Code 2008
[1] http://leaf.dragonflybsd.org/mailarchive/kernel/2008-08/msg00045.html

11 years agoAdd note that NFS exporting PFSs isn't supported yet.
Thomas Nikolajsen [Tue, 16 Sep 2008 15:26:17 +0000 (15:26 +0000)]
Add note that NFS exporting PFSs isn't supported yet.

11 years agoSilence warnings about unhandled enum values.
Sascha Wildner [Tue, 16 Sep 2008 14:08:48 +0000 (14:08 +0000)]
Silence warnings about unhandled enum values.

11 years agoFix stack variable names inheritted from ip_{input,output}()
Sepherosa Ziehau [Tue, 16 Sep 2008 13:36:12 +0000 (13:36 +0000)]
Fix stack variable names inheritted from ip_{input,output}()

11 years agoIf ae is NULL, just print that the controller is unsupported and return,
Sascha Wildner [Tue, 16 Sep 2008 12:39:15 +0000 (12:39 +0000)]
If ae is NULL, just print that the controller is unsupported and return,
instead of continuing and dereferencing it later.

Found-by: LLVM/Clang Static Analyzer
11 years agoAdd DUMMYNET_DEBUG option
Sepherosa Ziehau [Tue, 16 Sep 2008 12:30:57 +0000 (12:30 +0000)]
Add DUMMYNET_DEBUG option

11 years ago- Rework ipfw(4) debug print macro
Sepherosa Ziehau [Tue, 16 Sep 2008 12:16:08 +0000 (12:16 +0000)]
- Rework ipfw(4) debug print macro
- Add IPFIREWALL_DEBUG option

11 years agoSave flags pass by caller
Sepherosa Ziehau [Tue, 16 Sep 2008 11:57:30 +0000 (11:57 +0000)]
Save flags pass by caller

11 years agostruct packet_filter_hook is actually implementation detail; hide it
Sepherosa Ziehau [Tue, 16 Sep 2008 11:53:33 +0000 (11:53 +0000)]
struct packet_filter_hook is actually implementation detail; hide it

11 years agoip_dn_stop() and ip_dn_stop_dispatch() is used only if dummynet(4) is compiled
Sepherosa Ziehau [Tue, 16 Sep 2008 11:48:01 +0000 (11:48 +0000)]
ip_dn_stop() and ip_dn_stop_dispatch() is used only if dummynet(4) is compiled
as module.

11 years agoHeader inclusion
Sepherosa Ziehau [Tue, 16 Sep 2008 11:40:38 +0000 (11:40 +0000)]
Header inclusion

11 years agomycpu->gd_cpuid -> mycpuid
Sepherosa Ziehau [Tue, 16 Sep 2008 11:32:02 +0000 (11:32 +0000)]
mycpu->gd_cpuid -> mycpuid

11 years agoSYSCTL_NODE is always defined
Sepherosa Ziehau [Tue, 16 Sep 2008 11:28:31 +0000 (11:28 +0000)]
SYSCTL_NODE is always defined

11 years agoBump ipfw static rules generation when set/clear IPFW_FULE_F_STATE to avoid
Sepherosa Ziehau [Tue, 16 Sep 2008 11:24:57 +0000 (11:24 +0000)]
Bump ipfw static rules generation when set/clear IPFW_FULE_F_STATE to avoid
possible races if network thread slept on dyn_lock (e.g. to install state)

11 years agoRemove the -1 option from the installer.
Matthias Schmidt [Tue, 16 Sep 2008 11:16:36 +0000 (11:16 +0000)]
Remove the -1 option from the installer.

This option is specific to the old, now removed, ISC dhcp client.  The new
OpenBSD dhcp client does not support this option.  If a user wants to set an
IP address with the installer prior to this commit, it fails and the user sees
an error message.

The meaning of the -1 option was: "Try to get a lease only once.  If it fails,
quit."  Due to this commit, this behaviour changes.  I think its better to have
an installer which tries to get a lease more than once that having an installer
which does not try to get a lease at all.

11 years agoIf a NULL pointer was passed, panic like everywhere else.
Sascha Wildner [Tue, 16 Sep 2008 09:25:45 +0000 (09:25 +0000)]
If a NULL pointer was passed, panic like everywhere else.

Found-by: LLVM/Clang Static Analyzer
11 years ago * Move description of hw.usb.hack_defer_exploration
Thomas Nikolajsen [Mon, 15 Sep 2008 21:23:44 +0000 (21:23 +0000)]
 * Move description of hw.usb.hack_defer_exploration
and vfs.root.mountfrom from loader.conf.5 to loader.8,
as this is where other tunables are described.

11 years ago * Break line at end of sentence
Thomas Nikolajsen [Mon, 15 Sep 2008 20:41:59 +0000 (20:41 +0000)]
 * Break line at end of sentence
 * Add mark up
 * Use <module> instead of `*' for module operations

11 years agoFix old ATA driver name.
Thomas Nikolajsen [Mon, 15 Sep 2008 20:32:53 +0000 (20:32 +0000)]
Fix old ATA driver name.

11 years ago * /loader is loaded if /boot/loader fails
Thomas Nikolajsen [Mon, 15 Sep 2008 20:28:56 +0000 (20:28 +0000)]
 * /loader is loaded if /boot/loader fails
 * fix out of sync occurence of flags

11 years agoFix markup:
Thomas Nikolajsen [Mon, 15 Sep 2008 20:24:41 +0000 (20:24 +0000)]
Fix markup:
 * Add missing escape (\&) to mdoc(7) punctuation characters
 * Consistently use single (vs double) quotes for one character strings

11 years agoWhite space fix: wrong TAB in usage.
Thomas Nikolajsen [Mon, 15 Sep 2008 20:13:16 +0000 (20:13 +0000)]
White space fix: wrong TAB in usage.

11 years agoChange how DESTKERNNAME is handled:
Thomas Nikolajsen [Mon, 15 Sep 2008 20:09:03 +0000 (20:09 +0000)]
Change how DESTKERNNAME is handled:
don't prepend `boot/' to DESTKERNNAME definition,
but prepend it on use.

11 years agoAdd note on move of kernel and modules to boot directory.
Thomas Nikolajsen [Mon, 15 Sep 2008 20:03:36 +0000 (20:03 +0000)]
Add note on move of kernel and modules to boot directory.

11 years agoSmall fix.
Sascha Wildner [Mon, 15 Sep 2008 18:22:48 +0000 (18:22 +0000)]
Small fix.

11 years agoSync zoneinfo database with tzdata2008f from elsie.
Sascha Wildner [Mon, 15 Sep 2008 17:25:39 +0000 (17:25 +0000)]
Sync zoneinfo database with tzdata2008f from elsie.

africa:         8.15 -> 8.16
asia:           8.22 -> 8.23
europe:         8.17 -> 8.18
southamerica:   8.26 -> 8.27

From Arthur David Olson's comments:

* africa
        - Mauritius
                DST 2008 ff. from last Sun Oct to last Sun Mar
                (per Riad M. Hossen Ally)
        - Morocco
                End of DST 2008 ff. changed from Sep 28 to Sep 1
                (per Steffen Thorsen)

* asia
        - Gaza
                End of DST 2008 ff. changed from second Thu in Sep to
                last Thu in Aug (per Alexander Krivenyshev)
        - Pakistan
                End of DST 2008 only changed from Sep 1 to Nov 1
                (per Alexander Krivenyshev)

* europe
        - Turkey
                Add comments about proposed changes in 2011
                (per Sue Williams)

* southamerica
        - Argentina
                Start of DST 2008 ff. changed from first to third Sun
                (per Alexander Krivenyshev)
        - Brazil
                Start of DST 2008 ff. changed from second to third Sun
                (per Steffen Thorsen)

11 years agoFix an invalidation case that tends to occur under load on NFS servers or
Matthew Dillon [Mon, 15 Sep 2008 17:02:49 +0000 (17:02 +0000)]
Fix an invalidation case that tends to occur under load on NFS servers or
on machines with low amounts of main memory.  The buf was being recursively
locked and a ref count assertion was wrong.

The code-path was previously untested and would dependably panic the
machine every time prior to the fix.

Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>
11 years agoUpdate pfil manpage:
Sepherosa Ziehau [Mon, 15 Sep 2008 05:12:56 +0000 (05:12 +0000)]
Update pfil manpage:
- MPSAFE
- PFIL_WAITOK is gone
- Addition of pfil_func_t
- pfil(4) is standard part of kernel

11 years agoWe always wait during pfil hook's adding and removing; we could not afford
Sepherosa Ziehau [Mon, 15 Sep 2008 05:11:02 +0000 (05:11 +0000)]
We always wait during pfil hook's adding and removing; we could not afford
to fail upon these operations.

11 years agoAvoid conflict with <paths.h>.
Sascha Wildner [Sun, 14 Sep 2008 22:04:36 +0000 (22:04 +0000)]
Avoid conflict with <paths.h>.

11 years agoFix bug in normalization.
Sascha Wildner [Sun, 14 Sep 2008 21:08:29 +0000 (21:08 +0000)]
Fix bug in normalization.

Found-by: LLVM/Clang Static Analyzer
11 years agoAdd MLINK for dehumanize_number(3).
Sascha Wildner [Sun, 14 Sep 2008 20:18:17 +0000 (20:18 +0000)]
Add MLINK for dehumanize_number(3).

11 years agoAdd dehumanize_number(3).
Sascha Wildner [Sun, 14 Sep 2008 20:04:59 +0000 (20:04 +0000)]
Add dehumanize_number(3).

Taken-from: NetBSD

11 years agoAdd NetBSD 5.0
Sascha Wildner [Sun, 14 Sep 2008 20:03:06 +0000 (20:03 +0000)]
Add NetBSD 5.0

11 years agoCount only partitions where the size was specified and use 1M as
Sascha Wildner [Sun, 14 Sep 2008 19:15:04 +0000 (19:15 +0000)]
Count only partitions where the size was specified and use 1M as
the theoretical low limit for the '*' partition.

This simplifies the last commit and catches the case where a '*'
partition was specified but the rest of the partitions already
exceeded the slice size.

11 years agoFix calculation of total_capacity in case the user requested a partition
Sascha Wildner [Sun, 14 Sep 2008 13:49:41 +0000 (13:49 +0000)]
Fix calculation of total_capacity in case the user requested a partition
to span the remainder of the disk. This makes creating only a single '/'
partition with size '*' work.

11 years agoMake pfil(4) MPSAFE using following way:
Sepherosa Ziehau [Sun, 14 Sep 2008 11:13:00 +0000 (11:13 +0000)]
Make pfil(4) MPSAFE using following way:
- The pfil hook lists alteration is serialized by netisr0 (rev 1.10)
- Duplicate the pfil hook lists to be altered.
- Alter the pfil hook lists' duplication
- Save the original pfil hook lists, install the altered pfil hook lists
- Sync all network msgports to make sure that no one sees the original
  lists after this syncing
- Free the original pfil hook lists

11 years agoSerialize pfil hooks' adding/removing by netisr0
Sepherosa Ziehau [Sun, 14 Sep 2008 08:58:55 +0000 (08:58 +0000)]
Serialize pfil hooks' adding/removing by netisr0

11 years agoPut IPV6_RTHDR_TYPE_0 define back until the world fixes itself.
Hasso Tepper [Sun, 14 Sep 2008 08:58:33 +0000 (08:58 +0000)]
Put IPV6_RTHDR_TYPE_0 define back until the world fixes itself.

11 years agotypedef pfil_func_t
Sepherosa Ziehau [Sun, 14 Sep 2008 05:22:44 +0000 (05:22 +0000)]
typedef pfil_func_t

11 years agopfil_get_hook() is gone
Sepherosa Ziehau [Sun, 14 Sep 2008 04:48:31 +0000 (04:48 +0000)]
pfil_get_hook() is gone

11 years agoMerge pfil_hook_get() into pfil_run_hooks(), use TAILQ_FOREACH afterwards.
Sepherosa Ziehau [Sun, 14 Sep 2008 04:34:26 +0000 (04:34 +0000)]
Merge pfil_hook_get() into pfil_run_hooks(), use TAILQ_FOREACH afterwards.

11 years ago- Use {TAILQ,LIST}_FOREACH
Sepherosa Ziehau [Sun, 14 Sep 2008 04:11:10 +0000 (04:11 +0000)]
- Use {TAILQ,LIST}_FOREACH
- Minor style changes

11 years agopfil_hook_get() is only used in pfil.c, so hide it
Sepherosa Ziehau [Sun, 14 Sep 2008 02:05:07 +0000 (02:05 +0000)]
pfil_hook_get() is only used in pfil.c, so hide it

11 years agoAdd line width calculations for 15/16 and 24/32 bit modes in case
Sascha Wildner [Sat, 13 Sep 2008 19:08:05 +0000 (19:08 +0000)]
Add line width calculations for 15/16 and 24/32 bit modes in case
the "Get Scan Line Length" function fails, as it does in Parallels
(in Version 2.2, Build 2112 at least).

11 years agoMove ipfw(4) code for ip_{input,output}() into ip_fw2.c to create in/out
Sepherosa Ziehau [Sat, 13 Sep 2008 12:57:07 +0000 (12:57 +0000)]
Move ipfw(4) code for ip_{input,output}() into ip_fw2.c to create in/out
pfil hooks for AF_INET pfil head.

During ipfw(4) module loading, ipfw(4) pfil hooks will be added to AF_INET
pfil head, only if fw_enable is 1.  ipfw(4) pfil hooks could be added and
deleted from AF_INET pfil head dynamicly by setting net.inet.ip.fw.enable
(1 to add, 0 to delete)

11 years agoConsolidate moved variables.
Simon Schubert [Sat, 13 Sep 2008 11:46:28 +0000 (11:46 +0000)]
Consolidate moved variables.

11 years agoEnable hammer read support in boot2.
Simon Schubert [Sat, 13 Sep 2008 11:45:45 +0000 (11:45 +0000)]
Enable hammer read support in boot2.

11 years agoAdd hammer read support for loader.
Simon Schubert [Sat, 13 Sep 2008 11:38:58 +0000 (11:38 +0000)]
Add hammer read support for loader.

11 years agoAdd a place holder sysctl function to enable and disable ipfw(4)
Sepherosa Ziehau [Sat, 13 Sep 2008 10:47:23 +0000 (10:47 +0000)]
Add a place holder sysctl function to enable and disable ipfw(4)

11 years agoMove ipfw(4) related bits into ip_fw2_glue.c
Sepherosa Ziehau [Sat, 13 Sep 2008 10:23:39 +0000 (10:23 +0000)]
Move ipfw(4) related bits into ip_fw2_glue.c

11 years agopf(4) may reassemble ip fragments, so we probably should recalculate hlen
Sepherosa Ziehau [Sat, 13 Sep 2008 09:07:31 +0000 (09:07 +0000)]
pf(4) may reassemble ip fragments, so we probably should recalculate hlen

11 years ago- Move IPDIVERT related bits into netinet/ip_divert.c
Sepherosa Ziehau [Sat, 13 Sep 2008 08:48:42 +0000 (08:48 +0000)]
- Move IPDIVERT related bits into netinet/ip_divert.c
- Expose ip_reass(), which is used by ip_divert_in()
- Add function ptr ip_divert_p, which will be set to ip_divert(), if IPDIVERT
  support is compiled into kernel.  ip_divert() dispatches real work to either
  ip_divert_in() or ip_divert_out() based on the third parameter
- Hide divert_packet() after above change

11 years agoAdd FW_MBUF_REDISPATCH, which should be set by various firewall code,
Sepherosa Ziehau [Sat, 13 Sep 2008 07:15:14 +0000 (07:15 +0000)]
Add FW_MBUF_REDISPATCH, which should be set by various firewall code,
if ip fragments get reassembled.

11 years ago- Let caller of ip_fw_dn_io_ptr call ip_dn_queue(), so that callers have the
Sepherosa Ziehau [Sat, 13 Sep 2008 05:49:08 +0000 (05:49 +0000)]
- Let caller of ip_fw_dn_io_ptr call ip_dn_queue(), so that callers have the
  chance to save additional information to dummynet tag (e.g. ip_output)
- In ip_{input,output}(), call ip_dn_queue() outside of ipfw(4) processing
  code block
- Move saving dst, ro and flags from ipfw_dummynet_io() to ip_output()
- Remove unused fields in ip_fw_args
- Update comment

11 years agoUse extended interface FIFO depth to workaround CRC errors emitted by
Sepherosa Ziehau [Sat, 13 Sep 2008 04:04:39 +0000 (04:04 +0000)]
Use extended interface FIFO depth to workaround CRC errors emitted by
JMC250 chips before rev.B

Information provided by Ethan <ethanhsiao@jmicron.com>

11 years ago- Save device caps in device id array
Sepherosa Ziehau [Sat, 13 Sep 2008 03:12:23 +0000 (03:12 +0000)]
- Save device caps in device id array
- CAP_NOJUMBO -> CAP_JUMBO

11 years agoSplit capabilities and flags
Sepherosa Ziehau [Sat, 13 Sep 2008 03:04:17 +0000 (03:04 +0000)]
Split capabilities and flags

11 years ago- Clean up header inclusion
Sepherosa Ziehau [Sat, 13 Sep 2008 02:47:03 +0000 (02:47 +0000)]
- Clean up header inclusion
- Add revid for JMC250

11 years agoUse IDs from pcidevs.h
Sepherosa Ziehau [Sat, 13 Sep 2008 02:30:37 +0000 (02:30 +0000)]
Use IDs from pcidevs.h

11 years agoregen
Sepherosa Ziehau [Sat, 13 Sep 2008 02:22:40 +0000 (02:22 +0000)]
regen

11 years agoAdd IDs for JMicron and its JMC250/JMC260
Sepherosa Ziehau [Sat, 13 Sep 2008 02:21:56 +0000 (02:21 +0000)]
Add IDs for JMicron and its JMC250/JMC260

11 years ago- Fix function parameters order bug:
Sepherosa Ziehau [Fri, 12 Sep 2008 11:37:41 +0000 (11:37 +0000)]
- Fix function parameters order bug:
  udp_addrcpu() expects faddr,fport,laddr,lport not faddr,laddr,fport,lport
- Add IP_DEBUGROUTE flag to let ip_output() know that we have confidence in
  the inp's route cache.  Currently UDP output sets this flag, since after
  the above fix, UDP inp's route cache would only be used on its owner CPU
- Rename remote_free_panic to route_assert_owner_access, and expose it as
  global variable.  Keep net.route.remote_free_panic as an alias to
  net.route.assert_owner_access

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1134>

11 years agoSync libmd with FreeBSD:
Sascha Wildner [Thu, 11 Sep 2008 20:25:34 +0000 (20:25 +0000)]
Sync libmd with FreeBSD:

* Some bugfixes

* Addition of *_FileChunk()

* Minor changes/cleanup

11 years ago- Add rtfree_remote(), which send rtentry to its owner CPU to be freed.
Sepherosa Ziehau [Thu, 11 Sep 2008 11:23:29 +0000 (11:23 +0000)]
- Add rtfree_remote(), which send rtentry to its owner CPU to be freed.
  Print backtrace, if net.route.remote_free_panic is 0.  This function
  only serves as _temporary_ workaround.
- In ip_output(), if passed rtentry cache's owner CPU is not the current,
  then keep it untouched and use the stack variable to relocate the route.
  Add comment about it.  This at least could happen in the following
  callgraph on a TCP socket, on which listen(2) has been called:
  ip_input() -> tcp_input() -> tcp_respond() -> ip_output()

Related to Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1134>

11 years ago#ifdef DDB without including "opt_ddb.h"
YONETANI Tomokazu [Thu, 11 Sep 2008 01:11:42 +0000 (01:11 +0000)]
#ifdef DDB without including "opt_ddb.h"

11 years agoImprove code flow for KASSERT and KKASSERT using __predict_false().
Matthew Dillon [Thu, 11 Sep 2008 00:35:49 +0000 (00:35 +0000)]
Improve code flow for KASSERT and KKASSERT using __predict_false().

Fix a bug in KKASSERT related to the use of an else clause after
the KKASSERT.

11 years agoAugment loader.conf's manual page to describe hw.usb.hack_defer_exploration
Matthew Dillon [Wed, 10 Sep 2008 18:17:01 +0000 (18:17 +0000)]
Augment loader.conf's manual page to describe hw.usb.hack_defer_exploration
and vfs.root.mountfrom.

11 years agoFix spurious printing of the "got link" message.
Matthias Schmidt [Wed, 10 Sep 2008 10:01:18 +0000 (10:01 +0000)]
Fix spurious printing of the "got link" message.

11 years agomissing crit_exit()
YONETANI Tomokazu [Wed, 10 Sep 2008 09:50:09 +0000 (09:50 +0000)]
missing crit_exit()

11 years agoFix bug in hammer mirror command when used with a remote source
Matthew Dillon [Tue, 9 Sep 2008 23:34:21 +0000 (23:34 +0000)]
Fix bug in hammer mirror command when used with a remote source
specification.

Reported-by: Michael Neumann <mneumann@ntecs.de>
11 years agoAdd example crontab line to the prune section.
Matthias Schmidt [Tue, 9 Sep 2008 11:38:43 +0000 (11:38 +0000)]
Add example crontab line to the prune section.

11 years ago- ipfw(4) does not need opt_ipdn.h and opt_ipdivert.h
Sepherosa Ziehau [Tue, 9 Sep 2008 11:37:08 +0000 (11:37 +0000)]
- ipfw(4) does not need opt_ipdn.h and opt_ipdivert.h
- Use BUILDING_WITH_KERNEL in module Makefile
- Make ipfw(4) building depends on opt_inet.h and opt_ipfw.h

11 years agoAdd a MSGF_NORESCHED feature for lwkt thread-based message ports. The
Matthew Dillon [Tue, 9 Sep 2008 07:21:57 +0000 (07:21 +0000)]
Add a MSGF_NORESCHED feature for lwkt thread-based message ports.  The
idea is to use it to allow certain async messages to be queued to higher
priority system threads and schedule those threads without forcing an
immediate reschedule.

The feature will be used by the new socket code to prevent cavitation
between a user process and system protocol thread when the user process
is write()ing a lot of data over the network.

11 years agoFix issues with the scheduler that were causing unnecessary reschedules
Matthew Dillon [Tue, 9 Sep 2008 04:06:20 +0000 (04:06 +0000)]
Fix issues with the scheduler that were causing unnecessary reschedules
between tightly coupled processes as well as inefficient reschedules under
heavy loads.

The basic problem is that a process entering the kernel is 'passively
released', meaning its thread priority is left at TDPRI_USER_NORM.  The
thread priority is only raised to TDPRI_KERN_USER if the thread switches
out.  This has the side effect of forcing a LWKT reschedule when any other
user process woke up from a blocked condition in the kernel, regardless of
its user priority, because it's LWKT thread was at the higher
TDPRI_KERN_USER priority.   This resulted in some significant switching
cavitation under load.

There is a twist here because we do not want to starve threads running in
the kernel acting on behalf of a very low priority user process, because
doing so can deadlock the namecache or other kernel elements that sleep with
lockmgr locks held.  In addition, the 'other' LWKT thread might be associated
with a much higher priority user process that we *DO* in fact want to give
cpu to.

The solution is elegant.  First, do not force a LWKT reschedule for the
above case.  Second, force a LWKT reschedule on every hard clock.  Remove
all the old hacks.  That's it!

The result is that the current thread is allowed to return to user
mode and run until the next hard clock even if other LWKT threads (running
on behalf of a user process) are runnable.  Pure kernel LWKT threads still
get absolute priority, of course.  When the hard clock occurs the other LWKT
threads get the cpu and at the end of that whole mess most of those
LWKT threads will be trying to return to user mode and the user scheduler
will be able to select the best one.  Doing this on a hardclock boundary
prevents cavitation from occuring at the syscall enter and return boundary.

With this change the TDF_NORESCHED and PNORESCHED flags and their associated
code hacks have also been removed, along with lwkt_checkpri_self() which
is no longer needed.

11 years ago- Factor out ip_localforward()
Sepherosa Ziehau [Mon, 8 Sep 2008 12:41:39 +0000 (12:41 +0000)]
- Factor out ip_localforward()
- Reroute the packet using the route variable on the stack, if it could not
  be forwarded locally
- Move next_hop (transparent forwarding) processing out of ipfw code block

11 years agoTurn power off for detached (module unloaded) PCI devices. No power down is
Hasso Tepper [Mon, 8 Sep 2008 10:16:23 +0000 (10:16 +0000)]
Turn power off for detached (module unloaded) PCI devices. No power down is
done by default, you have to use hw.pci.do_power_nodriver sysctl.

11 years agoMove next_hop (tranparent forwarding) testing and extraction out of ipfw
Sepherosa Ziehau [Sun, 7 Sep 2008 11:12:15 +0000 (11:12 +0000)]
Move next_hop (tranparent forwarding) testing and extraction out of ipfw
processing code block

11 years agoLet ipfw_chk() return IP_FW_{PASS,DENY,DUMMYNET,TEE,DIVERT} and the caller
Sepherosa Ziehau [Sun, 7 Sep 2008 10:03:45 +0000 (10:03 +0000)]
Let ipfw_chk() return IP_FW_{PASS,DENY,DUMMYNET,TEE,DIVERT} and the caller
proceeds according to the return value in well strutured switch block.  The
additional information related to the return value (e.g. pipe/queue number
of IP_FW_DUMMYNET) is saved in ip_fw_args.cookie.

Idea-from: FreeBSD

11 years agoAdd missing .Nm
Sascha Wildner [Sun, 7 Sep 2008 08:36:54 +0000 (08:36 +0000)]
Add missing .Nm

11 years agoMinor wording improvement.
Sascha Wildner [Sun, 7 Sep 2008 08:24:40 +0000 (08:24 +0000)]
Minor wording improvement.

11 years agoAdd missing .Nm's
Sascha Wildner [Sun, 7 Sep 2008 08:21:57 +0000 (08:21 +0000)]
Add missing .Nm's

11 years agoUse FILES section for referencing files etc.
Sascha Wildner [Sun, 7 Sep 2008 08:18:54 +0000 (08:18 +0000)]
Use FILES section for referencing files etc.

11 years agoCheck the mbuf returned by ip_fw_chk_ptr against NULL before accessing the mbuf
Sepherosa Ziehau [Sun, 7 Sep 2008 08:15:25 +0000 (08:15 +0000)]
Check the mbuf returned by ip_fw_chk_ptr against NULL before accessing the mbuf

11 years agoRemove unused variables.
Sascha Wildner [Sun, 7 Sep 2008 08:09:39 +0000 (08:09 +0000)]
Remove unused variables.

Found-by: LLVM/Clang Static Analyzer
11 years agoUse standard section for examples.
Sascha Wildner [Sun, 7 Sep 2008 07:54:48 +0000 (07:54 +0000)]
Use standard section for examples.

11 years agoUse .Dq
Sascha Wildner [Sun, 7 Sep 2008 07:51:39 +0000 (07:51 +0000)]
Use .Dq

11 years agoRemove unused variable.
Sascha Wildner [Sun, 7 Sep 2008 07:48:29 +0000 (07:48 +0000)]
Remove unused variable.

Found-by: LLVM/Clang Static Analyzer
11 years agoRemove obsolete sentence about ports & improve wording.
Sascha Wildner [Sat, 6 Sep 2008 21:31:21 +0000 (21:31 +0000)]
Remove obsolete sentence about ports & improve wording.

11 years agoMake acpi support modules depend on acpi module.
Hasso Tepper [Sat, 6 Sep 2008 21:21:31 +0000 (21:21 +0000)]
Make acpi support modules depend on acpi module.

11 years agoSync pci_[gs]et_powerstate_method with FreeBSD which makes things a little
Hasso Tepper [Sat, 6 Sep 2008 21:18:39 +0000 (21:18 +0000)]
Sync pci_[gs]et_powerstate_method with FreeBSD which makes things a little
bit more friendly to devices.

Obtained-from: FreeBSD

11 years agoUpgrade to OpenSSL 0.9.8h.
Peter Avalos [Sat, 6 Sep 2008 20:43:02 +0000 (20:43 +0000)]
Upgrade to OpenSSL 0.9.8h.

Submitted-by: "VOROSKOI Andras" <voroskoi@gmail.com>