11 years agoImplement Farnsworth mode.
Simon Schubert [Fri, 30 May 2008 21:47:04 +0000 (21:47 +0000)]
Implement Farnsworth mode.

11 years agoFix typo.
Sascha Wildner [Fri, 30 May 2008 18:00:23 +0000 (18:00 +0000)]
Fix typo.

Noticed-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>
11 years agoInclude sys/select.h to conform to SUS.
Simon Schubert [Fri, 30 May 2008 09:39:46 +0000 (09:39 +0000)]
Include sys/select.h to conform to SUS.

Noticed-by: hasso@
11 years agoFix type name as well.
Simon Schubert [Fri, 30 May 2008 08:07:22 +0000 (08:07 +0000)]
Fix type name as well.

Noticed-by: hasso@
11 years agoFix macro name.
Simon Schubert [Fri, 30 May 2008 08:05:49 +0000 (08:05 +0000)]
Fix macro name.

Noticed-by: hasso@
11 years agoAdd brief description about the recently added interrupt moderation sysctl nodes
Sepherosa Ziehau [Thu, 29 May 2008 13:30:15 +0000 (13:30 +0000)]
Add brief description about the recently added interrupt moderation sysctl nodes

11 years ago- Rename bce_init_context() to bce_init_ctx()
Sepherosa Ziehau [Wed, 28 May 2008 13:53:42 +0000 (13:53 +0000)]
- Rename bce_init_context() to bce_init_ctx()
- Clear out all quick context entries.  This fixes the watchdog timeout, which
  usually happens after many tiny packets are transmitted

Obtained-from: FreeBSD if_bce.c rev 1.36

# FreeBSD didn't mention a _single_ word of this change and its effect in the
# commit log.  The description of the fix and the its effect is obtained from
# Linux bnx2 commit log.

11 years ago- ifnet.if_output() should be called without ifnet.if_serializer being
Sepherosa Ziehau [Wed, 28 May 2008 12:11:13 +0000 (12:11 +0000)]
- ifnet.if_output() should be called without ifnet.if_serializer being
  held.  Add assertion about it in ether_output().
- ether_output_frame() should be called without the ifnet.if_serializer
  being held.  Add assertion in it.
- arp_ifinit() will be called with ifnet.if_serializer being held.  To
  prevent serializer from recursion, ifnet.if_serializer is released
  before calling arprequest(), which supposes caller does not hold output
  iface's serializer.
- ifnet.if_serializer can't be held when calling arp_ifinit2().

Reported-by: dillon@
11 years ago- Add tunables and sysctl nodes for interrupt moderation variables.
Sepherosa Ziehau [Wed, 28 May 2008 10:51:56 +0000 (10:51 +0000)]
- Add tunables and sysctl nodes for interrupt moderation variables.
  Settings are committed to device during device initialization or in
  interrupt routine.
- Default interrupt moderation variables' value from Broadcom's driver
  seem to be misconfigiured.  Following changes are made:
  Send max coalesced BD count 20 -> 24
  Send coalescing ticks 80 -> 1000 (~1000HZ)
  Receive max coalesced BD count 6  -> 24
  Receive coalescing ticks 18 -> 125  (~8000Hz)
  Two changes on "Receive" interrupt moderation variables avoid livelock

11 years agoInclude sys/fd_set.h in the BSD_VISIBLE case.
Simon Schubert [Wed, 28 May 2008 10:37:25 +0000 (10:37 +0000)]
Include sys/fd_set.h in the BSD_VISIBLE case.

Seems that a lot of software assumes that fd_set will be defined after
including sys/types.h, so restore this property.

Noted-by: hasso@
11 years agoMove definition of fd_set to sys/fd_set.h.
Simon Schubert [Wed, 28 May 2008 10:35:11 +0000 (10:35 +0000)]
Move definition of fd_set to sys/fd_set.h.

11 years agoGenerate a semi-random MAC address when connecting to a SOCK_SEQPACKET
Matthew Dillon [Tue, 27 May 2008 23:44:46 +0000 (23:44 +0000)]
Generate a semi-random MAC address when connecting to a SOCK_SEQPACKET
socket (ala vknetd's /dev/vknet) instead of a TAP interface.

11 years agoImplement a new utility called vknet. This utility interconnects the
Matthew Dillon [Tue, 27 May 2008 23:26:38 +0000 (23:26 +0000)]
Implement a new utility called vknet.  This utility interconnects the
networks between the local machine and a remote machine, typically by
connecting to a TAP interface or socket supplied by a running vknetd on
each machine.

Update manual pages for vknetd and vkernel to include vknet.

11 years agoOnly test the IP protocol (ip_p) for IP frames.
Matthew Dillon [Tue, 27 May 2008 22:47:16 +0000 (22:47 +0000)]
Only test the IP protocol (ip_p) for IP frames.

11 years agoFix socketvar.h inclusion by userland. This is a temporary hack and,
Matthew Dillon [Tue, 27 May 2008 17:31:12 +0000 (17:31 +0000)]
Fix socketvar.h inclusion by userland.  This is a temporary hack and,
frankly, a lot more of the header file should be made _KERNEL-only.

Reported-by: Hasso Tepper <hasso@estpak.ee>
11 years agoAdd the notty utility, a program I wrote long ago which I should have
Matthew Dillon [Tue, 27 May 2008 17:10:49 +0000 (17:10 +0000)]
Add the notty utility, a program I wrote long ago which I should have
brought into base long ago.  This program provides a convenient shortcut
to detaching a command from the controlling terminal and running it in the

11 years agoUse standard include path
Sepherosa Ziehau [Tue, 27 May 2008 13:27:35 +0000 (13:27 +0000)]
Use standard include path

11 years agoSync zoneinfo database with tzdata2008c from elsie.
Sascha Wildner [Tue, 27 May 2008 12:08:29 +0000 (12:08 +0000)]
Sync zoneinfo database with tzdata2008c from elsie.

africa:         8.10 -> 8.11
asia:           8.18 -> 8.20

africa - Morocco observes DST in 2008

asia   - Choibalsan is now 8 hours off UTC
       - Pakistan observes DST in 2008

11 years agoOnly collect 'count' packets when polling(4) is used. Set softc cached
Sepherosa Ziehau [Tue, 27 May 2008 12:07:01 +0000 (12:07 +0000)]
Only collect 'count' packets when polling(4) is used.  Set softc cached
RX consumer index to the value we have processed before break out of the
loop, so we could come back again upon next poll.

11 years agoAdd a boot loader tunable hw.usb.hack_defer_exploration, which if set
Michael Neumann [Tue, 27 May 2008 12:00:47 +0000 (12:00 +0000)]
Add a boot loader tunable hw.usb.hack_defer_exploration, which if set
to 0 reverts to the old USB behaviour, i.e. USB keyboards should be again
usable early at boot. By default, this is set to 1 which will avoid hanging
the system on qemu and my HP compaq laptop and maybe others.

Note that this is a hack around a shortcoming in the current USB stack and
will go away once the shortcoming has been fixed.

11 years ago- Apply same adjustment to softc cached TX/RX BD index
Sepherosa Ziehau [Tue, 27 May 2008 11:39:42 +0000 (11:39 +0000)]
- Apply same adjustment to softc cached TX/RX BD index
- Clear used_tx_bd in bce_free_tx_chain

Obtained-from: FreeBSD if_bce.c rev 1.{36,37}

11 years agoDo not try to set-up the bridge or tap interfaces when connecting to
Matthew Dillon [Tue, 27 May 2008 07:48:00 +0000 (07:48 +0000)]
Do not try to set-up the bridge or tap interfaces when connecting to
a unix domain socket instead of a tap interface.

11 years agoAdd vknetd to the build.
Matthew Dillon [Tue, 27 May 2008 07:46:57 +0000 (07:46 +0000)]
Add vknetd to the build.

11 years agoGet rid of an old and terrible hack. Local stream sockets enqueue packets
Matthew Dillon [Tue, 27 May 2008 05:25:36 +0000 (05:25 +0000)]
Get rid of an old and terrible hack.  Local stream sockets enqueue packets
directly on the peer's sockbuf, rather then the sender's sockbuf.  That
part of the code is fine, but in order to prevent the sender from queueing
infinite mbufs (because its sockbuf appears to be empty when you do that)
the code dynamically messed around with the sender's high water mark.

This blew up the new SOCK_SEQPACKET.  In particular, it blows up the
use of the PR_ATOMIC on stream sockets and can cause spurious EMSGSIZE
errors to be returned instead of the EWOULDBLOCK that should have been

Also fix, or partially the resource limit code which tries to reduce the
high water mark when a user is using too many mbufs.  This never worked
well and still doesn't, but it is in better shape now.

Get rid of the crufty code and simply add a flag to the signalsockbuf,
SSB_STOP, to stop the sender.

Also adjust the vkernel to increase the default socket buffer when
connecting to vknet instead of if_tap.  VKE currently issues non-blocking
writes to vknet/tap and we do not want to lose packets for no good reason.

11 years agoCreate a new daemon called vknetd. This daemon uses the new SOCK_SEQPACKET
Matthew Dillon [Tue, 27 May 2008 01:58:02 +0000 (01:58 +0000)]
Create a new daemon called vknetd.  This daemon uses the new SOCK_SEQPACKET
feature to create a virtualized packet bridge accessible by userland (in
particular, user-run virtual kernels).

11 years ago* Implement SOCK_SEQPACKET sockets for local communications. These sockets
Matthew Dillon [Tue, 27 May 2008 01:10:47 +0000 (01:10 +0000)]
* Implement SOCK_SEQPACKET sockets for local communications.  These sockets
  operate like SOCK_STREAM but each write() builds a record and each read()
  reads a record.  That is, the data is not aggregated together or allowed
  to be partially read.

  This allows local sockets to have the same packetization characteristics
  as if_tap when desired.

* Add a feature to the vkernel which allows a unix domain socket to be
  specified for the network interface rather then a TAP interface.  The
  vkernel will connect to the socket using SOCK_SEQPACKET and read and
  write packets to it.

* Clean up some libc/kernel namespace collisions related to including

11 years agoAllocate lwkt threads from objcache instead of custom per-cpu cache backed
Nicolas Thery [Mon, 26 May 2008 17:11:09 +0000 (17:11 +0000)]
Allocate lwkt threads from objcache instead of custom per-cpu cache backed
by zone.

Reviewed-by: dillon@
11 years agoAvoid panic upon module unloading
Sepherosa Ziehau [Mon, 26 May 2008 14:23:25 +0000 (14:23 +0000)]
Avoid panic upon module unloading

11 years agoAllow a NULL pointer as argument to usb_get_next_event(), and don't
Michael Neumann [Mon, 26 May 2008 14:00:46 +0000 (14:00 +0000)]
Allow a NULL pointer as argument to usb_get_next_event(), and don't
allocate a "struct usb_event" on stack in usb_add_event().

Obtained-from: NetBSD/usb.c 1.83

11 years agoRemove __HAVE_GENERIC_SOFT_INTERRUPTS ifdefs as we don't support the
Michael Neumann [Mon, 26 May 2008 13:56:08 +0000 (13:56 +0000)]
Remove __HAVE_GENERIC_SOFT_INTERRUPTS ifdefs as we don't support the
softintr_* API of NetBSD.

11 years agoFix following possible bugs for SIOCSIFADDR, if in_ifinit() fails
Sepherosa Ziehau [Mon, 26 May 2008 13:29:33 +0000 (13:29 +0000)]
Fix following possible bugs for SIOCSIFADDR, if in_ifinit() fails
   o  ifaceX has an AF_INET ia
   o  SIOCSIFADDR is used to change address, and new address' hash value is
      different from ia's
   o  ia is currently in hash bucket B1
   o  ia is removed from B1 and installed into hash table using new address
      hash value, assume its new hash bucket is B2, and B1 != B2
1) Dangling ia reference in inaddr hash table
   o  ifnet.if_ioctl fails
   o  ia is reinstalled into hash bucket B1, but without being first removed
      from hash bucket B2
   Hash bucket B2 will have a dangling reference to ia
2) ia is left in wrong hash bucket
   o  rtinit fails
   o  ia's address is restored to oldaddr
   ia itself is left in hash bucket indexed by new address's hash value

- In in_ifinit(), if it fails, unlink ia from inaddr hash table instead of
  delaying the unlinking to in_control_internal().  If necessary reinstall
  ia into inaddr hash table with original address
- After the above fix, in_control_internal() needs to unlink ia from inaddr
  only if cmd is SIOCDIFADDR and ia resides in inaddr hash table.  Whether
  ia is in inaddr hash table or not, is currently indicated by ia address's
  family; add XXX comment that this assumption is not good
- Constfy 'sin' parameter to in_ifinit()

Reviewed-by: dillon@
11 years agoFix typos and cosmetic changes.
Michael Neumann [Mon, 26 May 2008 13:24:59 +0000 (13:24 +0000)]
Fix typos and cosmetic changes.

11 years agoGet completely rid of sc_dev in usb_softc and uhub_softc structures. Instead
Michael Neumann [Mon, 26 May 2008 12:37:44 +0000 (12:37 +0000)]
Get completely rid of sc_dev in usb_softc and uhub_softc structures. Instead
of directly passing around the softc structure, pass the device_t around and
access the softc structure via device_get_softc.

11 years agoExpand delay macro into DELAY.
Michael Neumann [Mon, 26 May 2008 12:02:42 +0000 (12:02 +0000)]
Expand delay macro into DELAY.

11 years agoAdd pthread_atfork() implementation to libc_r. libthread_xu has it already,
Hasso Tepper [Sun, 25 May 2008 21:34:49 +0000 (21:34 +0000)]
Add pthread_atfork() implementation to libc_r. libthread_xu has it already,
but it was unusable due to missing code in libc_r.

Obtained-from: FreeBSD

11 years agoFix warnings (missing casts).
Nicolas Thery [Sun, 25 May 2008 18:47:26 +0000 (18:47 +0000)]
Fix warnings (missing casts).

11 years agoHAMMER 48/Many: finish vop_setattr support, ncreate/nmknod/etc, minor bug fixes.
Matthew Dillon [Sun, 25 May 2008 18:41:33 +0000 (18:41 +0000)]
HAMMER 48/Many: finish vop_setattr support, ncreate/nmknod/etc, minor bug fixes.

* Properly set the initial uid and gid when creating a new filesystem object.

* Finish implementing hammer_vop_setattr().  Use the new VOP helper functions
  to validate the cred for chmod, chown, and chgrp operations, and to clear
  suid/sgid when a file's owner/group is changed.

Reported-by: Francois Tigeot <ftigeot@wolfpond.org>
11 years agoAdd vop_helper_chmod() and vop_helper_chown(). These helper functions
Matthew Dillon [Sun, 25 May 2008 18:34:46 +0000 (18:34 +0000)]
Add vop_helper_chmod() and vop_helper_chown().  These helper functions
implement the guts of a standard unix chmod or chown operation, including
validation based on creds.

11 years agoFix .Er abuse.
Sascha Wildner [Sun, 25 May 2008 18:11:47 +0000 (18:11 +0000)]
Fix .Er abuse.

11 years agoRemove duplicate include of header file "sys/bus.h".
Michael Neumann [Sun, 25 May 2008 17:48:33 +0000 (17:48 +0000)]
Remove duplicate include of header file "sys/bus.h".

11 years agoDefer boot-time exploration of USB busses until all devices in the
Michael Neumann [Sun, 25 May 2008 16:53:41 +0000 (16:53 +0000)]
Defer boot-time exploration of USB busses until all devices in the
system have been attached, but no later. This ensures that we do
not explore ohci or uhci busses before the companion ehci controller
has been initialised, so it should fix the problem of multi-speed
USB devices getting attached as USB 1 devices first and then
re-attached as USB 2.

This fixes issue #946 for qemu and my HP Compaq 6710b laptop.

Obtained-from:  FreeBSD/usb.c 1.104 to 1.106 and NetBSD/usb.c 1.35
Dragonfly-bug:  <http://bugs.dragonflybsd.org/issue947>

11 years agoMake sure to use delay() in usb_delay_ms() while cold booting.
Michael Neumann [Sun, 25 May 2008 16:38:36 +0000 (16:38 +0000)]
Make sure to use delay() in usb_delay_ms() while cold booting.

Obtained-from:  NetBSD/usb_subr.c 1.64

11 years agoPerform some mdoc cleanup.
Sascha Wildner [Sun, 25 May 2008 14:04:32 +0000 (14:04 +0000)]
Perform some mdoc cleanup.

11 years ago- Count and defrag mbuf before setup TX desc
Sepherosa Ziehau [Sun, 25 May 2008 09:44:31 +0000 (09:44 +0000)]
- Count and defrag mbuf before setup TX desc
- Drop excessively fragmented packets
- Set ifnet.if_timer, if TX desc has been setup
- Reset ifnet.if_timer, only if there are no pending TX descs
- Add IFF_OACTIVE and ifnet.if_timer related processing in fxp_tick(),
  which performs TXEOF operation
- Add XXX comment about a possible missing ifnet.if_timer setting in

11 years agoMake c89 work by using 'cc' as execv()'s argv[0] to satisfy objformat.
Sascha Wildner [Sun, 25 May 2008 08:18:26 +0000 (08:18 +0000)]
Make c89 work by using 'cc' as execv()'s argv[0] to satisfy objformat.

11 years agoFix a very old bug where the root mount was not getting a filesystem syncer
Matthew Dillon [Sat, 24 May 2008 19:08:28 +0000 (19:08 +0000)]
Fix a very old bug where the root mount was not getting a filesystem syncer
assigned to it.  This caused the more recent vnode recycling code to fail
to recycle vnodes on the root mount, leading to resource starvation.

Reported-by: Peter Avalos <pavalos@theshell.com>,
     Michael Neumann <mneumann@ntecs.de>

11 years agoBump version to 1.11.
Matthew Dillon [Sat, 24 May 2008 17:22:39 +0000 (17:22 +0000)]
Bump version to 1.11.

11 years agoUse a per-bucket mutex to reduce contention and fix a seg-fault from a
Matthew Dillon [Sat, 24 May 2008 17:21:36 +0000 (17:21 +0000)]
Use a per-bucket mutex to reduce contention and fix a seg-fault from a
race in the transaction hash table.

11 years agoUse "pause" in spin loop.
Sepherosa Ziehau [Sat, 24 May 2008 12:52:49 +0000 (12:52 +0000)]
Use "pause" in spin loop.

Suggested-by: dillon@
11 years agoProperly work with path names which contain a dot.
Simon Schubert [Sat, 24 May 2008 09:15:43 +0000 (09:15 +0000)]
Properly work with path names which contain a dot.

Noticed-by: swildner@
11 years agoFix two cases where device_printf() was used with an empty format.
Sascha Wildner [Sat, 24 May 2008 09:11:09 +0000 (09:11 +0000)]
Fix two cases where device_printf() was used with an empty format.

11 years agoAvoid possible memory leakage.
Sepherosa Ziehau [Sat, 24 May 2008 08:04:42 +0000 (08:04 +0000)]
Avoid possible memory leakage.

11 years ago- Put inaddr hash table alterations in crit section
Sepherosa Ziehau [Sat, 24 May 2008 07:41:25 +0000 (07:41 +0000)]
- Put inaddr hash table alterations in crit section
- Hold ifnet.if_serializer only around ifnet.if_ioctl

11 years ago- Add blank lines between code segments
Sepherosa Ziehau [Sat, 24 May 2008 06:54:54 +0000 (06:54 +0000)]
- Add blank lines between code segments
- Add comment
- Minor style changes

11 years agoNo need to cast
Sepherosa Ziehau [Sat, 24 May 2008 06:03:23 +0000 (06:03 +0000)]
No need to cast

11 years agoHold ifnet.if_serializer around ifnet.if_ioctl; rtinit() does not need
Sepherosa Ziehau [Sat, 24 May 2008 05:22:44 +0000 (05:22 +0000)]
Hold ifnet.if_serializer around ifnet.if_ioctl; rtinit() does not need
ifnet.if_serializer's protection.

11 years agoMinor style change. Add blank line between two 'switch' code blocks.
Sepherosa Ziehau [Sat, 24 May 2008 04:59:14 +0000 (04:59 +0000)]
Minor style change.  Add blank line between two 'switch' code blocks.

11 years agoMinor white space and style changes
Sepherosa Ziehau [Sat, 24 May 2008 04:19:31 +0000 (04:19 +0000)]
Minor white space and style changes

11 years agoAdd comment
Sepherosa Ziehau [Sat, 24 May 2008 03:57:26 +0000 (03:57 +0000)]
Add comment

11 years agoFix a warning and raise WARNS to 6.
Sascha Wildner [Fri, 23 May 2008 23:40:59 +0000 (23:40 +0000)]
Fix a warning and raise WARNS to 6.

11 years agoCalls to DIOCSYNCSLICEINFO were being made with the assumption that
Matthew Dillon [Fri, 23 May 2008 19:46:37 +0000 (19:46 +0000)]
Calls to DIOCSYNCSLICEINFO were being made with the assumption that
CD_FLAG_OPEN indicated an already-open device.  With recent changes this
flag is set prior to the check and the calls were being made without
any slice information, causing a panic.  For now follow what FreeBSD did
and just remove the calls.

Remove redundant setting of CD_FLAG_OPEN.

Reported-by: VOROSKOI Andras <sinknull@crater.dragonflybsd.org>,
     Michael Neumann <mneumann@ntecs.de>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1016>

11 years ago- Print L3 cache (on NorthBridge) information
Sepherosa Ziehau [Fri, 23 May 2008 15:36:59 +0000 (15:36 +0000)]
- Print L3 cache (on NorthBridge) information
- Correct L2 cache associative and register mapping

11 years ago- For 350 chips, don't set various INTR bits in TX control word; turning INTR
Sepherosa Ziehau [Fri, 23 May 2008 15:34:03 +0000 (15:34 +0000)]
- For 350 chips, don't set various INTR bits in TX control word; turning INTR
  bits on seems to confuse hardware TX engine
- For 350 chips, set TX desc's buffer physical address before turning on the
  TX desc valid bit
- In an_start, set IFF_OACTIVE, if there is no free TX desc called; this avoids
  confusing functions which schedule ifnet.if_start
- Minor style and white space changes

Submitted-by: Jost Tobias Springenberg <jspringe@uos.de>
11 years agoFix a pipelining performance issue due to the way reading from the socket
Matthew Dillon [Fri, 23 May 2008 06:55:11 +0000 (06:55 +0000)]
Fix a pipelining performance issue due to the way reading from the socket
was implemented.  Instead of having the threads compete for read-access to
the socket, create a single thread whos responsibility is to read traffic
from the socket and route it to the appropriate transaction.  This greatly
improves parallel threading performance for cpdup's to remote hosts.

11 years agoRemove commented out references to lwkt_* source files as lwkt is no more
Nicolas Thery [Thu, 22 May 2008 20:01:55 +0000 (20:01 +0000)]
Remove commented out references to lwkt_* source files as lwkt is no more
supported userland.

11 years agoAdd support for for the AI_NUMERICSERV getaddrinfo(3) flag. While pulling
Hasso Tepper [Thu, 22 May 2008 06:50:14 +0000 (06:50 +0000)]
Add support for for the AI_NUMERICSERV getaddrinfo(3) flag. While pulling
documentation for it from FreeBSD, add missing info about other flags as

Obtained-from: KAME and FreeBSD

11 years agoHAMMER 47/Many: Stabilization pass
Matthew Dillon [Thu, 22 May 2008 04:14:01 +0000 (04:14 +0000)]
HAMMER 47/Many: Stabilization pass

* Fix a buffer cache deadlock.  Buffers representing pending I/O must be
  thrown away (by calling biodone()'d) when cleaning a deleted inode out on
  the backend.  Otherwise the truncation can deadlock against them.

11 years agoAdd KTR_KERNENTRY to ktr(4) and LINT.
Sascha Wildner [Thu, 22 May 2008 04:00:43 +0000 (04:00 +0000)]
Add KTR_KERNENTRY to ktr(4) and LINT.

11 years agokprintf to device_printf conversion.
Michael Neumann [Wed, 21 May 2008 19:56:46 +0000 (19:56 +0000)]
kprintf to device_printf conversion.

11 years agoBring in fixes for a bug which occurs when the filesystem become fulls.
Matthew Dillon [Wed, 21 May 2008 18:49:49 +0000 (18:49 +0000)]
Bring in fixes for a bug which occurs when the filesystem become fulls.
This bug could result in 'ffs blkfree: freeing free block' panics.

However, this may not fix all such panics.  The jury is still out as of this

Obtained-from:  FreeBSD/ffs_balloc.c 1.52 and 1.53

11 years agotest test
Michael Neumann [Wed, 21 May 2008 14:45:25 +0000 (14:45 +0000)]
test test

11 years agoUpdate blacklists to more thorough versions.
Simon Schubert [Wed, 21 May 2008 14:07:41 +0000 (14:07 +0000)]
Update blacklists to more thorough versions.

Obtained-from:  Debian openssh-blacklist 0.3
Submitted-by: Atte Peltomaki <koston@iki.fi>
11 years agoMerge error fix.
Hasso Tepper [Tue, 20 May 2008 21:13:39 +0000 (21:13 +0000)]
Merge error fix.

Spotted-by: corecode and Rumko.
11 years agoAdd a define for IEEE80211_FC1_PROTECTED.
Matthew Dillon [Tue, 20 May 2008 19:23:25 +0000 (19:23 +0000)]
Add a define for IEEE80211_FC1_PROTECTED.

Taken-From: OpenBSD
Submitted-by: Cristi Magherusan <majeru@gentoo.ro>
11 years agoProperly track the write-open count when updating a msdos mount from RW to RO,
Matthew Dillon [Tue, 20 May 2008 19:14:38 +0000 (19:14 +0000)]
Properly track the write-open count when updating a msdos mount from RW to RO,
or from RO to RW.

Reported-by: Rumko <rumcic@gmail.com>
11 years agoAdd a DELAY(500) during the register init phase to give the device some time
Matthew Dillon [Tue, 20 May 2008 18:23:33 +0000 (18:23 +0000)]
Add a DELAY(500) during the register init phase to give the device some time
to initialize before attempting to read its memory space.

Taken-From: FreeBSD

11 years agoUpdate the traceroute(8) to the newest code from FreeBSD HEAD. Besides many
Hasso Tepper [Tue, 20 May 2008 12:14:10 +0000 (12:14 +0000)]
Update the traceroute(8) to the newest code from FreeBSD HEAD. Besides many
typo, style etc fixes this brings in the ability to specify protocol used
for probes: UDP6, ICMPv6 and NONE (useful for testing firewalls).

Obtained-from: FreeBSD

11 years agoFix an overflow in the time calculation.
Matthew Dillon [Mon, 19 May 2008 16:39:09 +0000 (16:39 +0000)]
Fix an overflow in the time calculation.

11 years agoUse correct date.
Sascha Wildner [Mon, 19 May 2008 11:34:23 +0000 (11:34 +0000)]
Use correct date.

11 years agoEnable MS-style pragma push/pop.
Simon Schubert [Mon, 19 May 2008 10:46:39 +0000 (10:46 +0000)]
Enable MS-style pragma push/pop.

Obtained-from:  FreeBSD
Noticed-by: RussianE3 @ #dragonflybsd
11 years agoFill CPU info for vkernels. This makes KTR use TSC in vkernels.
Simon Schubert [Mon, 19 May 2008 10:29:58 +0000 (10:29 +0000)]
Fill CPU info for vkernels.  This makes KTR use TSC in vkernels.

11 years agoAdd KTR for tracing userland->kernel entries, i.e. faults and syscalls.
Simon Schubert [Mon, 19 May 2008 10:28:06 +0000 (10:28 +0000)]
Add KTR for tracing userland->kernel entries, i.e. faults and syscalls.

11 years agoAdd macros for the linker, which might be different than the compiler.
Simon Schubert [Mon, 19 May 2008 10:26:02 +0000 (10:26 +0000)]
Add macros for the linker, which might be different than the compiler.

11 years agoDon't manually declare select, instead include sys/select.h.
Simon Schubert [Mon, 19 May 2008 10:21:31 +0000 (10:21 +0000)]
Don't manually declare select, instead include sys/select.h.

11 years agoDon't #include <sys/select.h> from sys/types.h, to conform to SUS.
Simon Schubert [Mon, 19 May 2008 10:19:49 +0000 (10:19 +0000)]
Don't #include <sys/select.h> from sys/types.h, to conform to SUS.

Some old BSD programs assume that sys/types.h is basically enough
to get all types and even functions declared, so adjust these.
sys/param.h still works as kitchensink and includes sys/select.h.

11 years agoChange asf defaults and flags to suit Dragonfly more.
Simon Schubert [Mon, 19 May 2008 10:13:08 +0000 (10:13 +0000)]
Change asf defaults and flags to suit Dragonfly more.

11 years agoDeclare lsearch(3)/lfind(3), move them to libc and make them POSIX compliant.
Simon Schubert [Mon, 19 May 2008 10:06:34 +0000 (10:06 +0000)]
Declare lsearch(3)/lfind(3), move them to libc and make them POSIX compliant.

Obtained-from:  FreeBSD

11 years agoDeclare lsearch(3)/lfind(3), move them to libc and make them POSIX compliant.
Simon Schubert [Mon, 19 May 2008 10:05:18 +0000 (10:05 +0000)]
Declare lsearch(3)/lfind(3), move them to libc and make them POSIX compliant.

Obtained-from:  FreeBSD

11 years agoHAMMER 46B/Many: Stabilization pass
Matthew Dillon [Sun, 18 May 2008 21:47:06 +0000 (21:47 +0000)]
HAMMER 46B/Many: Stabilization pass

* Add a feature to vmntvnodescan() to only do one pass on the vnode list.
  Have HAMMER use it.

* Fix a buffer cache leak.  Buffers could wind up disassociated from their
  HAMMER structures while in a B_LOCKED state, preventing the kernel from
  reusing them.

11 years agoRemove obsolete userland lwkt.
Nicolas Thery [Sun, 18 May 2008 20:57:56 +0000 (20:57 +0000)]
Remove obsolete userland lwkt.

Approved-By: dillon@

11 years agoSync CAM with FreeBSD using lockmgr locks instead of mutexes.
Peter Avalos [Sun, 18 May 2008 20:30:23 +0000 (20:30 +0000)]
Sync CAM with FreeBSD using lockmgr locks instead of mutexes.
Note:  This is mostly a code sync with FreeBSD which improves stability
in addition to the items listed below.  This provides a framework for
releasing the mplock, but for now it's still there.

Add an xpt_print function to reduce most of the xpt_print_path/printf
pairs. Convert the core code to use it.

Initial cut at Basic Domain Validation.

Make cam_xpt's pronouncements match camcontrol (Tagged -> Command) Queueing.

Pay attention to return value from xpt_bus_register in xpt_init.

Add an xpt_rescan function and a thread that will field rescan requests.
The purpose of this is to allow a SIM (or other entities) to request a bus
rescan and have it then fielded in a different (process) context from the

Check the return value from cam_periph_acquire.

Drop the periph/sim lock when calling disk_destroy().

Drop the topology lock before calling the periph oninvalidate and dtor

For the XPT_SASYNC_CB operation, only decouple the broadcast to the bus
and device lists instead of decoupling the whole operation.  This avoids
problems with SIMs going away.

Split the camisr into per-SIM done queues.  This optimizes the locking a
little bit and allows for direct dispatch of the doneq from certain
contexts that would otherwise face recursive locking problems.

Zero the CCBs when mallocing them.

Only schedule the xpt_finishconfig_task once.

Eliminate the use of M_TEMP.

Add a helper function for registering async callbacks.

Release the bus reference that is acquired when doing a CAMIOCOMMAND ioctl.

Zero scsi_readcapacity allocations so we can really tell if there has
been data returned.

Remove duplicate includes and fix typos.

Add a bunch of definitions and structures to support newer drivers.

When probing a newly found device, don't automatically assume that the
device supports retrieving a serial number.  Instead, first query the
list of VPD pages it does support, and only query the serial number if
it's supported, else silently move on.  This eliminates a lot of noise
during verbose booting, and will likely eliminate the need for most
NOSERIAL quirks.

Reduce diffs from FreeBSD.

Obtained-from: FreeBSD

11 years agoAllocate struct lwp instances with kmalloc() instead of zalloc() for MP safety.
Nicolas Thery [Sun, 18 May 2008 20:02:02 +0000 (20:02 +0000)]
Allocate struct lwp instances with kmalloc() instead of zalloc() for MP safety.

11 years agoCount if_opackets and if_oerrors.
Sepherosa Ziehau [Sun, 18 May 2008 08:10:03 +0000 (08:10 +0000)]
Count if_opackets and if_oerrors.

11 years agoCount if_opackets.
Sepherosa Ziehau [Sun, 18 May 2008 07:47:14 +0000 (07:47 +0000)]
Count if_opackets.

Reported-by: Xin LI <delphij@delphij.net>
11 years agoFix a number of core kernel issues related to HAMMER operation.
Matthew Dillon [Sun, 18 May 2008 05:54:31 +0000 (05:54 +0000)]
Fix a number of core kernel issues related to HAMMER operation.

* The cluster code was incorrectly using the maximum IO size from
  the filesystem on which /dev is mounted instead of the maximum
  IO size of the block device.  This became evident when HAMMER
  (with 16K blocks) tried to call cluster_read() via /dev/ad6s1h
  (on UFS with 8K blocks).

* Change the way the VNLRU code works to avoid an infinite loop in
  vmntvnodescan().  The vnode LRU recycling code was cycling vnodes
  from the head of mp->mnt_nvnodelist to the tail.  Under certain heavy
  load conditions this could cause a vmntvnodescan() to never finish
  running and eventually hit a count assertion (at 1,000,000 vnodes scanned).

  Instead of cycling the vnodes in the mnt_nvnodelist, use the syncer
  vnode (mount->mnt_syncer) as a placemarker and move *IT* within the
  list to represent the LRU scan.  By not cycling vnodes to the end
  of the list, vmntvnodescan() can no longer get into an infinite loop.

* Change the mount->mnt_syncer logic slightly to avoid races against
  a background sync while unmounting.  The field is no longer cleared
  by the sync_reclaim() call but is instead cleared by the unmount code
  before vrele()ing the special vnode.

11 years ago- Add devq which stores mbuf dequeued from ifnet.if_snd during ifnet.if_sart.
Sepherosa Ziehau [Sun, 18 May 2008 05:12:08 +0000 (05:12 +0000)]
- Add devq which stores mbuf dequeued from ifnet.if_snd during ifnet.if_sart.
  This is mainly used to avoid confusing functions scheduling ifnet.if_start
- Add tapifstop() which drains devq and clear IFF_RUNNING and IFF_OACTIVE.
- In tapopen(), move TAP_OPEN flag testing before announcing ifnet_attach_event
- Remove ifnet.if_serializer holding around ifq operation.
- White space and minor style changes.

11 years agoReturn after calling bridge_ouput_p.
Sepherosa Ziehau [Sun, 18 May 2008 04:38:44 +0000 (04:38 +0000)]
Return after calling bridge_ouput_p.

Reported-by: dillon@
11 years agoIt's "useful" not "usefull".
Peter Avalos [Sun, 18 May 2008 03:02:53 +0000 (03:02 +0000)]
It's "useful" not "usefull".

11 years agoKNOTE still needs mplock, so tapifstart() could be called in MPSAFE theads.
Sepherosa Ziehau [Sun, 18 May 2008 02:40:41 +0000 (02:40 +0000)]
KNOTE still needs mplock, so tapifstart() could be called in MPSAFE theads.

11 years agoHAMMER Utilities: Update for HAMMER changes.
Matthew Dillon [Sun, 18 May 2008 01:49:44 +0000 (01:49 +0000)]
HAMMER Utilities: Update for HAMMER changes.

* Update for localization changes made in the filesystem.

* Make minor feature adjustments.