dragonfly.git
15 years agoGrab some changes from FreeBSD:
Peter Avalos [Tue, 11 Nov 2008 18:06:12 +0000 (18:06 +0000)]
Grab some changes from FreeBSD:

-Use getopt.
-Use err/warn.

While I'm here, fix some whitespace, spelling, and unneeded (void) casts.

15 years agoRecord number of valid ifaddr containers in ifaddr, so we could use
Sepherosa Ziehau [Tue, 11 Nov 2008 13:48:01 +0000 (13:48 +0000)]
Record number of valid ifaddr containers in ifaddr, so we could use
atomic_fetchadd_int() to avoid N->0 race instead of using thread based
serialization.  Remove the netmsg embedded in ifaddr_container; it is
no longer needed/used.

15 years ago- Use priority message to carry out ipfw callout.
Sepherosa Ziehau [Tue, 11 Nov 2008 12:59:11 +0000 (12:59 +0000)]
- Use priority message to carry out ipfw callout.
- Mark the callout message with DROPABLE flag, so we don't need to
  do additional netmsg_service_sync() in module event function and
  the callout function itself could much straightforward.

15 years ago- If we receive redirect or host dead ICMP message due to packets sent on
Sepherosa Ziehau [Tue, 11 Nov 2008 10:46:58 +0000 (10:46 +0000)]
- If we receive redirect or host dead ICMP message due to packets sent on
  TCP sockets, we need to go through all CPUs to check per-cpu TCP inpcbs.
- If we receive redirect ICMP message due to packets sent on UDP sockets,
  we need to go through all CPUs to free UDP inpcbs' cached route entry.

Reported-by: pavalos@
Tested-by: pavalos@
15 years agoAdd -f and -v options to chflags.
Peter Avalos [Tue, 11 Nov 2008 06:56:47 +0000 (06:56 +0000)]
Add -f and -v options to chflags.

-f ignores failures if chflags can't modify the flags.
-v prints file names as they are processed.  -vv prints the flags changes.

Obtained-from: FreeBSD

15 years agoFix a copy/paste from chmod(1). We're changing file flags, not modes.
Peter Avalos [Tue, 11 Nov 2008 06:28:19 +0000 (06:28 +0000)]
Fix a copy/paste from chmod(1).  We're changing file flags, not modes.

While I'm here, bring in some markup fixes from FreeBSD.
-List some available octects.
-Mention securelevel could affect the ability to change flags.
-Add info on utilities that may or may not be aware of file flags.
-Group equivalent flags together and delete the `aliases' section.

Obtained-from: FreeBSD

15 years agoConditionalize the lchflags() call since chflags(1) is a bootstrap tool.
Peter Avalos [Tue, 11 Nov 2008 05:53:07 +0000 (05:53 +0000)]
Conditionalize the lchflags() call since chflags(1) is a bootstrap tool.

15 years ago* Change hc_remove() to return a -errno if an error occurs instead of -1.
Matthew Dillon [Tue, 11 Nov 2008 04:36:00 +0000 (04:36 +0000)]
* Change hc_remove() to return a -errno if an error occurs instead of -1.

* Adjust most hc_remove() calls to xremove(), which calls hc_remove() and
  retries with a chflags/remove sequence if the initial removal fails with
  EPERM.  This should help when there are hardlinks to a file marked schg.

15 years agoAdd an interface to the lchflags(2) syscall. The new -h option will
Peter Avalos [Tue, 11 Nov 2008 02:55:13 +0000 (02:55 +0000)]
Add an interface to the lchflags(2) syscall.  The new -h option will
change the flags on the symlink.

Obtained-from: FreeBSD

15 years agoFix flags handling for the install program. Properly set and clear flags
Matthew Dillon [Tue, 11 Nov 2008 01:51:24 +0000 (01:51 +0000)]
Fix flags handling for the install program.  Properly set and clear flags
as requested on the command line, retaining any unspecified flags on the
source when creating the target.

The dump and history flags are special-cased.  The dump flag is not set
unless explicitly specified (as per previous behavior), and the user-history
flag is not transfered to the target and is left as the system desired
when the target was created.

15 years agoFix typo in comment.
Peter Avalos [Tue, 11 Nov 2008 01:02:40 +0000 (01:02 +0000)]
Fix typo in comment.
Use warn instead of perror.
Close file after opening to prevent leaks.

Obtained-from: FreeBSD

15 years agoAdd the lchflags() syscall.
Peter Avalos [Tue, 11 Nov 2008 00:55:49 +0000 (00:55 +0000)]
Add the lchflags() syscall.

This is essentially the same as chflags(), but it operates on the symlink,
not on the underlying file.

Documentation-from: FreeBSD
Reviewed-by: dillon
15 years agoSome small fixes.
Sascha Wildner [Mon, 10 Nov 2008 23:47:31 +0000 (23:47 +0000)]
Some small fixes.

15 years agoAdjust uio(9) a bit more to reality.
Sascha Wildner [Mon, 10 Nov 2008 22:59:00 +0000 (22:59 +0000)]
Adjust uio(9) a bit more to reality.

15 years agoAdd an entry for lchflags using the same number as FreeBSD.
Peter Avalos [Mon, 10 Nov 2008 22:11:45 +0000 (22:11 +0000)]
Add an entry for lchflags using the same number as FreeBSD.

15 years agoFollow symbolic links named as command line arguments if run without -R.
Peter Avalos [Mon, 10 Nov 2008 21:37:25 +0000 (21:37 +0000)]
Follow symbolic links named as command line arguments if run without -R.

Obtained-from: FreeBSD

15 years agoAdd required range checks prior to kmalloc()ing socket option buffer space.
Matthew Dillon [Mon, 10 Nov 2008 18:16:52 +0000 (18:16 +0000)]
Add required range checks prior to kmalloc()ing socket option buffer space.

15 years agoFix 64-bit warning.
Sascha Wildner [Mon, 10 Nov 2008 16:10:34 +0000 (16:10 +0000)]
Fix 64-bit warning.

15 years agoFix warnings.
Sascha Wildner [Mon, 10 Nov 2008 15:58:20 +0000 (15:58 +0000)]
Fix warnings.

15 years agoFix a 64-bit warning. While here, also fix a gcc34 warning.
Sascha Wildner [Mon, 10 Nov 2008 15:28:13 +0000 (15:28 +0000)]
Fix a 64-bit warning. While here, also fix a gcc34 warning.

15 years agoFix 64-bit warnings.
Sascha Wildner [Mon, 10 Nov 2008 14:56:33 +0000 (14:56 +0000)]
Fix 64-bit warnings.

15 years agoFix 64-bit warnings.
Sascha Wildner [Mon, 10 Nov 2008 14:30:02 +0000 (14:30 +0000)]
Fix 64-bit warnings.

Slightly modified from the patches which were attached to the bug report.

Submitted-by: Michel Salim <salimma@fedoraproject.org>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1028>

15 years agoReconfigure default interrupt moderation parameters:
Sepherosa Ziehau [Mon, 10 Nov 2008 14:05:03 +0000 (14:05 +0000)]
Reconfigure default interrupt moderation parameters:
- Adjust TX ticks and TX bds.  Add a note in comment that setting TX ticks
  to 1023 will have _unexpected_ effect.  With this TX ticks/bds setting:
  1472bytes UDP payload will cause ~1200HZ interrupt (ticks controls TX HC)
  1bytes UDP payload will cause ~5100HZ interrupt (bds controls TX HC)
- Restore Broadcom's default RX ticks settings (18).  Set RX bds to 12.
  This should be able to restore TCP stream RX performance.  Add a note
  in comment that setting RX ticks to any value above 13 will make RX bds
  control RX HC.  It is found out by using following method:
  Assume for bulk data RX, RX ticks should always control RX HC if RX bds is
  relative large.  So RX bds is set to 128, which should be large enough but
  less than the limit (255).  Other side of this test TXes 1472bytes payload
  UDP datagrams.  The result:
      RX ticks    Interrupt rate
         12          livelock
         13           47800
         14            1270
         15            1270
         16            1270
         17            1270
         18            1270
         19            1270
         20            1270
         30            1270
  Linux bnx2 says the RX ticks unit is microsecond, while it looks incorrect.
  FreeBSD bce(4) does not have any comment about the RX ticks setting.
  We probably need to find a dynamic RX bds tuning mechanism to prevent system
  from being livelocked if full speed tiny packets are injected.

15 years agoFix amd64 warnings.
Sascha Wildner [Mon, 10 Nov 2008 05:00:12 +0000 (05:00 +0000)]
Fix amd64 warnings.

15 years agoRaise WARNS to 6 and fix all resulting warnings.
Sascha Wildner [Mon, 10 Nov 2008 04:59:45 +0000 (04:59 +0000)]
Raise WARNS to 6 and fix all resulting warnings.

15 years ago* Raise WARNS to 6 and fix all resulting warnings.
Sascha Wildner [Mon, 10 Nov 2008 02:05:31 +0000 (02:05 +0000)]
* Raise WARNS to 6 and fix all resulting warnings.

* Fix amd64 warnings.

* Sync usage() and manual page with getopt() optstring.

* Clean up the manual page a bit.

15 years agoMove the HAMMER option around a little and add ALTQ to the default VKERNEL
Matthew Dillon [Sun, 9 Nov 2008 18:57:17 +0000 (18:57 +0000)]
Move the HAMMER option around a little and add ALTQ to the default VKERNEL
config.

15 years agoUpdate physio(9) for physread()/physwrite() separation.
Sascha Wildner [Sun, 9 Nov 2008 10:59:14 +0000 (10:59 +0000)]
Update physio(9) for physread()/physwrite() separation.

15 years agoWe don't need to register route threads for netmsg_service_sync() anymore;
Sepherosa Ziehau [Sun, 9 Nov 2008 10:50:15 +0000 (10:50 +0000)]
We don't need to register route threads for netmsg_service_sync() anymore;
route threads no longer do network output.

15 years agoUse priority messages to carry out syncache callout function.
Sepherosa Ziehau [Sun, 9 Nov 2008 10:32:16 +0000 (10:32 +0000)]
Use priority messages to carry out syncache callout function.

Reviewed-by: dillon@
15 years agothen -> than
Sascha Wildner [Sun, 9 Nov 2008 10:27:47 +0000 (10:27 +0000)]
then -> than

15 years ago- During ARP resolving, current thread msgport or current CPU's netisr msgport
Sepherosa Ziehau [Sun, 9 Nov 2008 10:18:42 +0000 (10:18 +0000)]
- During ARP resolving, current thread msgport or current CPU's netisr msgport
  (if current is not TDF_NETWORK) is recorded in addition to the mbuf.
- When ARP resolving is finished, the recorded mbuf is dispatched to the
  recorded msgport to do network output using priority message.

This eliminates the last network output in route threads.

Reviewed-by: dillon@
15 years agoAdd a bus_get_resource(9) manual page (based on bus_set_resource(9)).
Sascha Wildner [Sun, 9 Nov 2008 09:48:41 +0000 (09:48 +0000)]
Add a bus_get_resource(9) manual page (based on bus_set_resource(9)).

15 years ago- Add priority message queue to msgport. Send a message with MSGF_PRIORITY
Sepherosa Ziehau [Sun, 9 Nov 2008 09:20:09 +0000 (09:20 +0000)]
- Add priority message queue to msgport.  Send a message with MSGF_PRIORITY
  flag will queue the message into the priority message queue of the target
  port.  The priority message queue takes precendence over normal message
  queue, so the messages with MSGF_PRIORITY flag will be processed before
  other messages on the same target port.  This could be used by defering
  callout or operation that should not be delayed too long on the target
  port.
- Add dropmsg function to msgport.  Message must be marked with MSGF_DROPABLE,
  else dropmsg operation is not allowed.  Message marked with MSGF_DROPABLE
  is not waitable, i.e. you could not call domsg on this kind of message.
  Currently only thread msgport supports this operation and this operation
  must be performed in the same thread of the msgport's owner thread.

Discussed-with: dillon@

15 years agoAdd a new feature to mirror-copy and mirror-write. If the target PFS does
Matthew Dillon [Sun, 9 Nov 2008 05:22:56 +0000 (05:22 +0000)]
Add a new feature to mirror-copy and mirror-write.  If the target PFS does
not exist these directives will now ask you whether you want to create it
or not, providing a VERY convenient method for creating a new slave PFS.

WARNING! This adds another packet to the protocol to make the initial
handshake symmetrical, allowing the target to get information on the
originator's shared-uuid before the operation is initiated.  If running
to or from a remote host both sides must be running the same version of
the hammer utility.

Submitted-by: Michael Neumann <mneumann@ntecs.de>
15 years agoThe workaround is no longer needed after netinet/tcp_subr.c rev1.62
Sepherosa Ziehau [Sat, 8 Nov 2008 03:38:23 +0000 (03:38 +0000)]
The workaround is no longer needed after netinet/tcp_subr.c rev1.62

15 years agoOur raw socket expects ip.{ip_len,ip_off} in host byte order.
Sepherosa Ziehau [Wed, 5 Nov 2008 14:08:41 +0000 (14:08 +0000)]
Our raw socket expects ip.{ip_len,ip_off} in host byte order.

Reported-by: hasso@
Tested-by: hasso@
15 years agocrc32()/crc32_ext() prototypes are for userland.
Sascha Wildner [Mon, 3 Nov 2008 08:41:31 +0000 (08:41 +0000)]
crc32()/crc32_ext() prototypes are for userland.

15 years agoBring in some changes to bsd.sys.mk from FreeBSD.
Peter Avalos [Mon, 3 Nov 2008 00:25:45 +0000 (00:25 +0000)]
Bring in some changes to bsd.sys.mk from FreeBSD.

-Werror is turned on for i386/gcc41 builds (can be overridden with
 NO_WERROR.
-Use CWARNFLAGS so they can be overridden easily.
-Introduce CSTD which allows a Makefile to specify the precise
 dialect of C.

Reviewed-by: swildner
15 years agoUse %z for printing size_t/ssize_t.
Sascha Wildner [Sun, 2 Nov 2008 21:52:46 +0000 (21:52 +0000)]
Use %z for printing size_t/ssize_t.

15 years agoClean up a bit.
Sascha Wildner [Sun, 2 Nov 2008 18:56:47 +0000 (18:56 +0000)]
Clean up a bit.

* Improve wording and shuffle some paragraphs.

* Reference ffs(5).

* Mention 'hammer cleanup'.

* Use uppercase names for labels like share/examples/rconfig/hammer.sh does.

* Add URL for the HAMMER paper and add reference to NYCBSDCon slides.

15 years agoBump .Dd to when it was updated in DragonFly.
Sascha Wildner [Sun, 2 Nov 2008 18:29:07 +0000 (18:29 +0000)]
Bump .Dd to when it was updated in DragonFly.

15 years agoRegenerate the pciconf(8) database from the following files:
Sascha Wildner [Sun, 2 Nov 2008 17:59:37 +0000 (17:59 +0000)]
Regenerate the pciconf(8) database from the following files:

Hart:    Jan 22, 2008 (version 671)
Boemler: Nov  1, 2008
Mares:   Oct 27, 2008

15 years agoThe priority mask used to compartmentalize the comparison to determine
Matthew Dillon [Sat, 1 Nov 2008 23:31:19 +0000 (23:31 +0000)]
The priority mask used to compartmentalize the comparison to determine
whether a preemption is needed was covering the entire process priority
space instead of just one bucket.

Reported-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
15 years agoFix comment.
Sascha Wildner [Sat, 1 Nov 2008 23:19:08 +0000 (23:19 +0000)]
Fix comment.

15 years agoFactor out _lwkt_pushmsg() and _lwkt_enqueue_reply(); these put message
Sepherosa Ziehau [Sat, 1 Nov 2008 12:30:23 +0000 (12:30 +0000)]
Factor out _lwkt_pushmsg() and _lwkt_enqueue_reply(); these put message
enqueuing and flags' adjusting into common place.

15 years agoAll of the thread port backend functions are static.
Sepherosa Ziehau [Sat, 1 Nov 2008 11:43:40 +0000 (11:43 +0000)]
All of the thread port backend functions are static.

15 years ago- Add comment for lwkt_initport_serialize()
Sepherosa Ziehau [Sat, 1 Nov 2008 11:17:52 +0000 (11:17 +0000)]
- Add comment for lwkt_initport_serialize()
- Adjust the comment of lwkt_getport() a little bit and put it to the
  proper place.

15 years agoUse the same indentation as the rest of the functions in this file.
Sepherosa Ziehau [Sat, 1 Nov 2008 10:38:21 +0000 (10:38 +0000)]
Use the same indentation as the rest of the functions in this file.

15 years agoUse the same indentation as the rest of the functions in this file.
Sepherosa Ziehau [Sat, 1 Nov 2008 10:29:31 +0000 (10:29 +0000)]
Use the same indentation as the rest of the functions in this file.

15 years agoInstall pr_ctlport for the rest of the protocols.
Sepherosa Ziehau [Sat, 1 Nov 2008 04:22:16 +0000 (04:22 +0000)]
Install pr_ctlport for the rest of the protocols.

Reported-by: tomas@
15 years agoSync with FreeBSD:
Peter Avalos [Sat, 1 Nov 2008 02:49:15 +0000 (02:49 +0000)]
Sync with FreeBSD:

Sync program's usage() with manpage's SYNOPSIS.

Added the EXIT STATUS section where appropriate.

Fixed handling of manpage subdirectories.

Fixed one memory leak.

Look into machine-specific manpage subdirectories too.

Obtained-from: FreeBSD

15 years agoPut unknown hardware ids print back into bootverbose, mainly to suppress it
Sepherosa Ziehau [Thu, 30 Oct 2008 11:27:40 +0000 (11:27 +0000)]
Put unknown hardware ids print back into bootverbose, mainly to suppress it
on a box with rl(4).

15 years agoUse atomic_fetchadd_int() to avoid N->0 race when freeing sfbuf. The
Sepherosa Ziehau [Thu, 30 Oct 2008 11:03:29 +0000 (11:03 +0000)]
Use atomic_fetchadd_int() to avoid N->0 race when freeing sfbuf.  The
serializer field is no longer needed.

Hint-from: dillon@
Reported-by: pavalos@
Tested-by: pavalos@
15 years agoDon't use listen socket's route cache, it is not MPSAFE currently. This could
Sepherosa Ziehau [Thu, 30 Oct 2008 10:50:18 +0000 (10:50 +0000)]
Don't use listen socket's route cache, it is not MPSAFE currently.  This could
happen if a listen socket received TCP segment with invalid flags combination.

15 years agoFix gcc34 warnings.
Sascha Wildner [Wed, 29 Oct 2008 22:14:25 +0000 (22:14 +0000)]
Fix gcc34 warnings.

15 years agoFix warnings which cropped up in the gcc34 build. While here, update
Sascha Wildner [Wed, 29 Oct 2008 22:03:12 +0000 (22:03 +0000)]
Fix warnings which cropped up in the gcc34 build. While here, update
the login_times(3) manual page.

Taken-from: FreeBSD

15 years agoRemove warning flags and raise WARNS where possible.
Sascha Wildner [Wed, 29 Oct 2008 18:18:05 +0000 (18:18 +0000)]
Remove warning flags and raise WARNS where possible.

15 years agoRemove remaining LIBC_SCCS related stuff.
Sascha Wildner [Tue, 28 Oct 2008 17:23:46 +0000 (17:23 +0000)]
Remove remaining LIBC_SCCS related stuff.

15 years agoWARNS= -> WARNS?=
Sascha Wildner [Tue, 28 Oct 2008 16:56:56 +0000 (16:56 +0000)]
WARNS= -> WARNS?=

15 years agoRemove some warning flags and raise WARNS where possible.
Sascha Wildner [Tue, 28 Oct 2008 16:54:09 +0000 (16:54 +0000)]
Remove some warning flags and raise WARNS where possible.

15 years agoRecollect TX/RX descriptors if we are going to switch back to TX/RX interrupts,
Sepherosa Ziehau [Tue, 28 Oct 2008 07:30:49 +0000 (07:30 +0000)]
Recollect TX/RX descriptors if we are going to switch back to TX/RX interrupts,
mainly to avoid the _possible_ race between turning on TX/RX interrupts and
asserting TX/RX interrupt by hardware.  Though nfe(4) does not seem to suffer
the problem, which I have seen on re(4), we still apply the same fix here;
better safe than sorry.

15 years agoTry recollecting RX/TX descriptors if we are going to switch back to TX/RX
Sepherosa Ziehau [Tue, 28 Oct 2008 07:23:28 +0000 (07:23 +0000)]
Try recollecting RX/TX descriptors if we are going to switch back to TX/RX
interrupts.  There seems to be a race between turning on TX/RX interrupt and
asserting TX/RX interrupt by the hardware.  This fixes the poor performance
that I have seen when using single threaded remote cpdup.

15 years agoIn ip_lengthcheck(), make sure that pkthdr.len is not less than "IP total
Sepherosa Ziehau [Tue, 28 Oct 2008 07:09:26 +0000 (07:09 +0000)]
In ip_lengthcheck(), make sure that pkthdr.len is not less than "IP total
length" in IP header.  Change the related testing in ip_input() and
ipflow_fastforward() into assertion.

15 years agoAdd comment about ip_lengthcheck()
Sepherosa Ziehau [Tue, 28 Oct 2008 04:35:12 +0000 (04:35 +0000)]
Add comment about ip_lengthcheck()

15 years ago- The assertion in ip_input, should test sizeof(struct ip) instead of sizeof(ip)
Sepherosa Ziehau [Tue, 28 Oct 2008 03:07:28 +0000 (03:07 +0000)]
- The assertion in ip_input, should test sizeof(struct ip) instead of sizeof(ip)
- Make sure that ip_input's precondition meets in ip_localforward
- Don't allow raw ip socket to send ip packet whose header length is less than
  the minimum
- Nuke unused code and minor style changes

Reviewed-by: nth@
15 years agoSync zoneinfo database with tzdata2008i from elsie.
Sascha Wildner [Mon, 27 Oct 2008 13:53:24 +0000 (13:53 +0000)]
Sync zoneinfo database with tzdata2008i from elsie.

southamerica:   8.30 -> 8.33
zone.tab:       8.19 -> 8.21

* Adjust for recent changes in Argentina (DST from Oct 19, 2008 to
  Mar 15, 2009, but several provinces are not participating).

* Reordering and new comments for several zones in zone.tab.

15 years agoMonir style and white space changes
Sepherosa Ziehau [Mon, 27 Oct 2008 10:51:09 +0000 (10:51 +0000)]
Monir style and white space changes

15 years ago- Move unlinking ipflow from table/list out of ipflow_free().
Sepherosa Ziehau [Mon, 27 Oct 2008 09:57:11 +0000 (09:57 +0000)]
- Move unlinking ipflow from table/list out of ipflow_free().
- Factor out ipflow_reset() to clear statistics of ipflow to be reused.
- Add flags field in ipflow.  Currently only one flag is defined to make
  sure that the state of the ipflow is correct (on/off the table/list).
- Reference count ipflow, so the ipflow used to do the ifnet.if_output()
  will not be reaped or changed behind our back.  Add commet about it.
- Don't change or reuse an ipflow if it is being actively used,
  i.e. ipf_refcnt > 1
- Fortify ipflow code by putting assertion in proper places.
- Pad ipflow structure explicitly.

15 years ago- All of the ipflow table/list read/write operations happen in protocol
Sepherosa Ziehau [Mon, 27 Oct 2008 04:38:29 +0000 (04:38 +0000)]
- All of the ipflow table/list read/write operations happen in protocol
  threads, so there is no need to use critical section.  We only need to
  protect per-cpu static timeout netmsgs with critical section, whose
  MSGF_DONE is checked in ipi.
- Mark per-cpu static timeout netmsgs MPSAFE.
- smp_active_mask should be taken into consideration, when broadcasting ipi.

15 years agoWe obviously do not want protocol threads to be block; blocking the current
Sepherosa Ziehau [Mon, 27 Oct 2008 04:16:25 +0000 (04:16 +0000)]
We obviously do not want protocol threads to be block; blocking the current
protocol thread may cause exact same ipflow being installed.

15 years agoBreak long line
Sepherosa Ziehau [Mon, 27 Oct 2008 04:03:53 +0000 (04:03 +0000)]
Break long line

15 years ago- In addition to the IP flow hash table, put the flows on a list. The table
Sepherosa Ziehau [Mon, 27 Oct 2008 03:55:29 +0000 (03:55 +0000)]
- In addition to the IP flow hash table, put the flows on a list.  The table
  is used for fast lookup, the list for traversal of all flows.
  Obtained-from: NetBSD ip_flow.c rev 1.5
- Use LIST_FOREACH macros.

15 years agoFix CVE-2008-3831. Affects the Intel G33 series and newer only.
Hasso Tepper [Mon, 27 Oct 2008 03:42:33 +0000 (03:42 +0000)]
Fix CVE-2008-3831. Affects the Intel G33 series and newer only.

Obtained-from: DRM git

15 years agopr_ctlinput is usually called when certains types of ICMP packets are received.
Sepherosa Ziehau [Mon, 27 Oct 2008 02:56:30 +0000 (02:56 +0000)]
pr_ctlinput is usually called when certains types of ICMP packets are received.
However, the processing of ICMP packets happens in netisr0, which means the
thread context, in which pr_ctlinput is called, is not correct.  To handle this
following two fixes are applied:
- Add pr_ctlport to protosw and ip6protosw, which could be used to locate
  correct msgport to call pr_ctlinput for specific protocol
- All necessary information needed by pr_ctlinput are gather into one netmsg,
  and this netmsg is delivered synchronously (some information is on the stack)

Note for new protocol implementation:
pr_ctlinput and pr_ctlport should be both NULL or both non-NULL.

Obtained-from: dillon@
Tested-by: pavalos@
15 years agoRemove stale header file.
Sascha Wildner [Sun, 26 Oct 2008 17:17:44 +0000 (17:17 +0000)]
Remove stale header file.

15 years agoUpdate ips_total
Sepherosa Ziehau [Sun, 26 Oct 2008 09:50:15 +0000 (09:50 +0000)]
Update ips_total

Obtained-from: NetBSD ip_flow.c rev 1.34

15 years ago- If a packet came in as link-level broadcast or link-level multicast, don't
Sepherosa Ziehau [Sun, 26 Oct 2008 09:37:50 +0000 (09:37 +0000)]
- If a packet came in as link-level broadcast or link-level multicast, don't
  attempt to fast-forward it out.
  Obtained-from: NetBSD ip_flow.c rev 1.14
- Fix comment

15 years ago- ip_mport() will make sure following things for us:
Sepherosa Ziehau [Sun, 26 Oct 2008 09:15:33 +0000 (09:15 +0000)]
- ip_mport() will make sure following things for us:
  o  IP header is in one mbuf
  o  IP length is not less then IP header length
- Truncate mbufs to the correct length before forwarding
  Obtained-from: NetBSD ip_flow.c rev 1.6

15 years agoPerform ipflow timeout, only if the CPU has active ipflows; saves us some
Sepherosa Ziehau [Sun, 26 Oct 2008 08:32:10 +0000 (08:32 +0000)]
Perform ipflow timeout, only if the CPU has active ipflows; saves us some
physical ipi sending time.

Inspired-by: NetBSD ipflow.c rev 1.2
15 years agoBring in following changes from NetBSD ip_flow.c
Sepherosa Ziehau [Sun, 26 Oct 2008 08:02:43 +0000 (08:02 +0000)]
Bring in following changes from NetBSD ip_flow.c
rev 1.2(part), 1.8, 1.9, 1.10, 1.11, 1.12, 1.18(w/ mod)

- IP checksum fix/twist
- Hardware checksum off loading fix

15 years ago- Move ipflow definition from ip_flow.h to ip_flow.c; it's implementation
Sepherosa Ziehau [Sun, 26 Oct 2008 07:11:28 +0000 (07:11 +0000)]
- Move ipflow definition from ip_flow.h to ip_flow.c; it's implementation
  detail.
- Move ipflow function declarations from in_var.h to ip_flow.h, include
  ip_flow.h in files which uses ipflow functions.

15 years ago- Return the real cluster limit used by the objcache
Sepherosa Ziehau [Sun, 26 Oct 2008 04:29:20 +0000 (04:29 +0000)]
- Return the real cluster limit used by the objcache
- For mbuf objcaches, raise backing kmalloc pools' limit according to the
  cluster limits.
Suggested-by: dillon@
Reviewed-by: aggelos@, nth@
15 years agoit's -> its
Sascha Wildner [Sun, 26 Oct 2008 00:05:24 +0000 (00:05 +0000)]
it's -> its

15 years ago- RX/TX coal parameters could be set at any time.
Sepherosa Ziehau [Sat, 25 Oct 2008 10:46:55 +0000 (10:46 +0000)]
- RX/TX coal parameters could be set at any time.
- Set default RX coal packets to 64, so RX coal timeout takes control during
  bulk data operations.  This greately reduces the interrupt rate while keeps
  bulk data performance.
- Set default TX coal packets to 64 and TX coal timeout to 65535us (maximum
  allowable value).  This greately reduce the interrupt rate while greately
  increases (almost doubles) small packet TX performance.
- Remove unused field in jme_softc

15 years agoUse atomic_fetchadd_int() to simplify the reference counting logic.
Sepherosa Ziehau [Fri, 24 Oct 2008 11:15:07 +0000 (11:15 +0000)]
Use atomic_fetchadd_int() to simplify the reference counting logic.

Reviewed-by: dillon@
15 years agoRemove more stuff: ports/, root_skels/ (which we maintain in nrelease/),
Sascha Wildner [Thu, 23 Oct 2008 16:56:23 +0000 (16:56 +0000)]
Remove more stuff: ports/, root_skels/ (which we maintain in nrelease/),
scripts/ and src/lib/lua.

15 years agoReduce differences with root_skels in contrib.
Sascha Wildner [Thu, 23 Oct 2008 16:45:37 +0000 (16:45 +0000)]
Reduce differences with root_skels in contrib.

15 years agoAdd a periodic(8) script to run 'hammer cleanup' (snapshot, prune
Sascha Wildner [Wed, 22 Oct 2008 20:15:55 +0000 (20:15 +0000)]
Add a periodic(8) script to run 'hammer cleanup' (snapshot, prune
and reblock all HAMMER filesystems) on a nightly basis. The exact
behavior (period, retention and run time) can be configured by
tweaking <filesystem>/snapshots/config as described in hammer(5).

15 years agoAdd 5906/5906M support. Based on my old patch with some additional work from
Sepherosa Ziehau [Wed, 22 Oct 2008 14:24:24 +0000 (14:24 +0000)]
Add 5906/5906M support.  Based on my old patch with some additional work from
FreeBSD.

Tested-by: Petr Janda <elekktretterr@exemail.com.au>
15 years agoRaise the kmalloc limit for the M_HAMMER_INO pool based on desiredvnodes
Matthew Dillon [Wed, 22 Oct 2008 01:43:51 +0000 (01:43 +0000)]
Raise the kmalloc limit for the M_HAMMER_INO pool based on desiredvnodes
to try to avoid kernel memory exhaustion panics.

Reported-by: Matthias Schmidt <matthias@dragonflybsd.org>, and others.
15 years agoAdd kmalloc_raise_limit() - allow a subsystem to raise the allocation
Matthew Dillon [Wed, 22 Oct 2008 01:42:17 +0000 (01:42 +0000)]
Add kmalloc_raise_limit() - allow a subsystem to raise the allocation
limit for a kmalloc pool.

15 years agoRemove trailing whitespace.
Sascha Wildner [Tue, 21 Oct 2008 14:35:33 +0000 (14:35 +0000)]
Remove trailing whitespace.

15 years ago* Remove 'exit 1' so the script continues running.
Sascha Wildner [Tue, 21 Oct 2008 14:02:48 +0000 (14:02 +0000)]
* Remove 'exit 1' so the script continues running.

* Add swap to fstab.

* Remove dntpd setup because the same stuff is in our default dntpd.conf
  already.

15 years agoAdd tunable net.inet.ip.mpsafe to register IP as MPSAFE netisr.
Sepherosa Ziehau [Tue, 21 Oct 2008 13:51:01 +0000 (13:51 +0000)]
Add tunable net.inet.ip.mpsafe to register IP as MPSAFE netisr.
Multicast/IPSEC still need BGL.

15 years ago- Move RX filter configuration from re_init() into re_setmulti()
Sepherosa Ziehau [Tue, 21 Oct 2008 12:31:01 +0000 (12:31 +0000)]
- Move RX filter configuration from re_init() into re_setmulti()
- IFF_BROADCAST will never be set/cleared
- Fix SIOCSIFFLAGS support; it was really annoying that each time when I ran
  tcpdump, the NIC reinitialized itself.

15 years agoUnbreak UP building
Sepherosa Ziehau [Mon, 20 Oct 2008 13:16:58 +0000 (13:16 +0000)]
Unbreak UP building

15 years agoIn route_init(), call netmsg_service_port_init(); mainly to register route
Sepherosa Ziehau [Mon, 20 Oct 2008 12:22:24 +0000 (12:22 +0000)]
In route_init(), call netmsg_service_port_init(); mainly to register route
thread's msgport for netmsg_service_sync(), since route threads also do
network output during arp input processing.

15 years agoFix typo.
Sascha Wildner [Mon, 20 Oct 2008 07:35:08 +0000 (07:35 +0000)]
Fix typo.

15 years agoSync libc/stdtime and zdump(8)/zic(8) with tzcode2008h from elsie.
Sascha Wildner [Sun, 19 Oct 2008 20:15:58 +0000 (20:15 +0000)]
Sync libc/stdtime and zdump(8)/zic(8) with tzcode2008h from elsie.

There shouldn't be any user visible changes. Some bugs are fixed, among
them an issue with Python's mktime() when TZ wasn't set (reported by
Aran Cox).

Another thing is that this code should behave nicely on architectures with
a 64 bits wide time_t.