17 months agomkinitrd.8: Create a mkinitrd.conf.5 link.
Sascha Wildner [Mon, 12 Dec 2011 18:45:41 +0000]
mkinitrd.8: Create a mkinitrd.conf.5 link.

17 months agomkinitrd(8): Move the defaults to /etc/defaults/mkinitrd.conf.
Sascha Wildner [Mon, 12 Dec 2011 18:40:37 +0000]
mkinitrd(8): Move the defaults to /etc/defaults/mkinitrd.conf.

Provide this file by default and if the user has to change anything,
they can use /etc/mkinitrd.conf, just like for rc.conf, etc.

While here, change -e to -r for the test of /etc/mkinitrd.conf's
existence.

17 months agoRevert "x86_64: isa/clock.c is clean enough to enable -Werror"
Sascha Wildner [Mon, 12 Dec 2011 18:16:11 +0000]
Revert "x86_64: isa/clock.c is clean enough to enable -Werror"

This reverts commit f2c6c11c130f9aaf10429503f3111c333e0253f1.

It breaks gcc41 buildkernel.

17 months agobsd.kern.mk: -Wold-style-declaration is unknown to gcc41.
Sascha Wildner [Mon, 12 Dec 2011 18:11:48 +0000]
bsd.kern.mk: -Wold-style-declaration is unknown to gcc41.

17 months agondis_events(8): Handle the "no event matched" case (fixes a gcc41 warning).
Sascha Wildner [Mon, 12 Dec 2011 18:11:01 +0000]
ndis_events(8): Handle the "no event matched" case (fixes a gcc41 warning).

17 months agokernel - Misc fixes and debugging
Matthew Dillon [Mon, 12 Dec 2011 17:37:20 +0000]
kernel - Misc fixes and debugging

* Add required CLDs in the exception paths.  The interrupt paths already
  CLD in PUSH_FRAME.

* Note that the fast_syscall (SYSENTER) path has an implied CLD due to the
  hardware mask applied to rflags.

* Add the IOPL bits to the set of bits set to 0 during a fast_syscall.

* When creating a dummy interrupt frame we don't have to push the
  actual %cs.  Just push $0 so the frame isn't misinterpreted as coming
  from userland.

* Additional debug verbosity for freeze_on_seg_fault.

* Reserve two void * fields for LWP debugging (for a later commit)

17 months agoKernel - Fix double-unlock in nlookupdotdot
Matthew Dillon [Mon, 12 Dec 2011 17:24:38 +0000]
Kernel - Fix double-unlock in nlookupdotdot

* Fix double-unlock assertion in the compat nlookupdotdot code

* This code is basically only triggered when a machine is acting as a NFS
  server when serving out a UFS mount (since HAMMER has its own).  Only
  NFS servers can access directories not connected through to the root
  via the namecache hierarchy and those are the only situations where
  nlookupdotdot is actually used.  ".." is normally handled directly by
  the namecache.

17 months agokernel - Dynamically size lwkt_cache_threads free cache
Matthew Dillon [Mon, 12 Dec 2011 17:22:43 +0000]
kernel - Dynamically size lwkt_cache_threads free cache

* Change the default # of free LWKT threads from 32 to 4*ncpus, with
  a minimum of 32.

* Improves performance on systems with more than 8 cores.

* NULL-out some fields on thread free as a safety.

17 months agoMerge git://git.dragonflybsd.org/dragonfly
Venkatesh Srinivas [Mon, 12 Dec 2011 01:21:35 +0000]
Merge git://git.dragonflybsd.org/dragonfly

17 months agoVFS accounting: list enabled filesystems
Francois Tigeot [Sun, 14 Aug 2011 15:24:55 +0000]
VFS accounting: list enabled filesystems

Use a new flag, MNT_ACCOUNTING for that

17 months agokernel/vfs_quota: Put the 'accounting enabled' message under bootverbose.
Sascha Wildner [Sun, 11 Dec 2011 15:51:47 +0000]
kernel/vfs_quota: Put the 'accounting enabled' message under bootverbose.

17 months agoi386/ioapic_abi: Disable interrupt load balance by default
Sepherosa Ziehau [Sun, 11 Dec 2011 13:48:15 +0000]
i386/ioapic_abi: Disable interrupt load balance by default

This merges 2b195d6a566cb8441f5d6d66363235683bbd92af

17 months agoi386/ioapic_abi: Per-cpu irqmap array
Sepherosa Ziehau [Sun, 11 Dec 2011 13:36:03 +0000]
i386/ioapic_abi: Per-cpu irqmap array

This merges 6f072945c912b376b55e396d8b81918c3cbd25c6

17 months agoi386/MachIntrABI: Remove unnecessary setidt in intr_setup/teardown
Sepherosa Ziehau [Sun, 11 Dec 2011 11:49:10 +0000]
i386/MachIntrABI: Remove unnecessary setidt in intr_setup/teardown

This merges c7d947d54787629833f1dd46789543ac77c3d7e1

17 months agoi386/ioapic: Add missing imen_lock/unlock
Sepherosa Ziehau [Sun, 11 Dec 2011 11:41:11 +0000]
i386/ioapic: Add missing imen_lock/unlock

This merges b551073687d461dc8b9e6d3a34dd285de40a26a6

17 months agoi386/ioapic_abi: Optimize the GSI search a little bit
Sepherosa Ziehau [Sun, 11 Dec 2011 11:33:33 +0000]
i386/ioapic_abi: Optimize the GSI search a little bit

This merges dc844205199e9b290c8298fcc826b3c770542be1

17 months agoi386/ioapic_abi: Record the max line based IRQ
Sepherosa Ziehau [Sun, 11 Dec 2011 11:26:45 +0000]
i386/ioapic_abi: Record the max line based IRQ

This merges bf2e6ffbfe8055e65631c27b698eec10557cb61b

17 months agoi386/ioapic_abi: Rework debug messages
Sepherosa Ziehau [Sun, 11 Dec 2011 11:19:55 +0000]
i386/ioapic_abi: Rework debug messages

This merges 621d2ccf74a7c3c6069377fe217d778a3ad0d414

17 months agoi386/nexus: Per-cpu IRQ rman
Sepherosa Ziehau [Sun, 11 Dec 2011 11:11:17 +0000]
i386/nexus: Per-cpu IRQ rman

This merges 7e370202e053de3ef8357ef02e8b6f1e97694f97

17 months agoi386/ioapic: Allow GSI's target CPU to be configured
Sepherosa Ziehau [Sun, 11 Dec 2011 11:02:25 +0000]
i386/ioapic: Allow GSI's target CPU to be configured

This merges 95874ffdec65823430464b7869d8f0acf75cc226

17 months agoFix the panic on atkbdc_configure() failure
YONETANI Tomokazu [Sat, 10 Dec 2011 11:43:42 +0000]
Fix the panic on atkbdc_configure() failure

kbd_unregister() expects the caller to hold kb_lock because it's mainly
called by kbd_term_t routine.

17 months agoVFS accounting: add in-memory storage counters
Francois Tigeot [Sat, 13 Aug 2011 09:34:39 +0000]
VFS accounting: add in-memory storage counters

* Use a red-black tree of small arrays to store uid and gid accounting
  information.
  User and group ids often come in small groups of consecutive numbers;
  small arrays have a high probability of having more than one element
  used at the same time, reducing pointer chasing in the binary tree.

* Also use a global per mount-point counter

* Only enable data collection for volumes which have been properly
  initialized

* Protect the counters by a per mount-point spinlock

17 months agoinstaller: Remove some unused variables and code.
Sascha Wildner [Sat, 10 Dec 2011 17:02:52 +0000]
installer: Remove some unused variables and code.

All that remains is checking if the user tries to make / tmpfs backed.

17 months agokernel/netgraph7: Replace usage of MALLOC/FREE with kmalloc/kfree here too.
Sascha Wildner [Sat, 10 Dec 2011 15:34:30 +0000]
kernel/netgraph7: Replace usage of MALLOC/FREE with kmalloc/kfree here too.

Requested-by: Nuno Antunes

17 months agovquota(8): Silence 'has more than one link' messages.
Sascha Wildner [Sat, 10 Dec 2011 14:47:00 +0000]
vquota(8): Silence 'has more than one link' messages.

Also, print the usage if an unknown command is given.

In the manual page, note that the output size is in bytes.

17 months agobsd.kern.mk: Add a missing space.
Sascha Wildner [Sat, 10 Dec 2011 13:52:14 +0000]
bsd.kern.mk: Add a missing space.

17 months agoAdd -Wold-style-declaration to the kernel's warning flags.
Sascha Wildner [Sat, 10 Dec 2011 13:45:37 +0000]
Add -Wold-style-declaration to the kernel's warning flags.

While here, clean up the comments a bit. -Wextra cleanness is not
something we're aiming for. What we want are warnings that help
catching bugs and/or keeping the code nice, but at the same time
don't get on anyone's nerves.

17 months agoAdd vknetd to etc/rc.d/Makefile.
Sascha Wildner [Sat, 10 Dec 2011 10:35:36 +0000]
Add vknetd to etc/rc.d/Makefile.

17 months agokernel -- Remove references to obsolete i586 optimized bcopy.
Venkatesh Srinivas [Sat, 10 Dec 2011 06:50:15 +0000]
kernel -- Remove references to obsolete i586 optimized bcopy.

The code had been disabled for some time; GC it.

17 months agokernel -- Remove i686_pagezero.
Venkatesh Srinivas [Sat, 10 Dec 2011 06:32:10 +0000]
kernel -- Remove i686_pagezero.

i686_pagezero spent read bandwidth to search for the first non-zero word
in a page and zeroed from there. This was silly; the contents of the page
didn't matter and reading it was a waste of time. bzero() is used directly.

17 months ago<sys/ktr.h>: Move static to the first place in declarations.
Sascha Wildner [Sat, 10 Dec 2011 00:56:11 +0000]
<sys/ktr.h>: Move static to the first place in declarations.

The C standard discourages placing storage-class specifiers (typedef,
extern, static, auto, register) other than first in a declaration since
C90.

17 months agokernel: Add acpi_if.h to the ACPI module Makefiles.
Sascha Wildner [Sat, 10 Dec 2011 00:53:08 +0000]
kernel: Add acpi_if.h to the ACPI module Makefiles.

17 months agobuildkernel: Disable building of acpi_hp.ko. It will not load.
Sascha Wildner [Fri, 9 Dec 2011 23:46:43 +0000]
buildkernel: Disable building of acpi_hp.ko. It will not load.

17 months agoFix various whitespace and indent issues (no functional change).
Sascha Wildner [Fri, 9 Dec 2011 19:12:15 +0000]
Fix various whitespace and indent issues (no functional change).

17 months agopfctl(8): Add missing braces.
Sascha Wildner [Fri, 9 Dec 2011 18:53:53 +0000]
pfctl(8): Add missing braces.

17 months agopw(8): Add missing braces.
Sascha Wildner [Fri, 9 Dec 2011 18:42:00 +0000]
pw(8): Add missing braces.

17 months agodfregress(8): Add some missing braces.
Sascha Wildner [Fri, 9 Dec 2011 18:05:33 +0000]
dfregress(8): Add some missing braces.

17 months agolib: Fix various whitespace and indent issues (no functional change).
Sascha Wildner [Fri, 9 Dec 2011 16:55:19 +0000]
lib: Fix various whitespace and indent issues (no functional change).

17 months agoSome cosmetics: #if(0) -> #if 0
Sascha Wildner [Fri, 9 Dec 2011 12:21:31 +0000]
Some cosmetics: #if(0) -> #if 0

17 months agokernel/nfs: Fix a bug due to missing braces.
Sascha Wildner [Fri, 9 Dec 2011 11:38:39 +0000]
kernel/nfs: Fix a bug due to missing braces.

The lwkt_reltoken() was added in c6b43e93a6cf0a70bde32cd141057a0df9860e13
but it was forgotten to put braces around the if's body (now having
lwkt_reltoken() and the return()).

17 months agokernel: Fix various whitespace and indent issues (no functional change).
Sascha Wildner [Fri, 9 Dec 2011 10:47:25 +0000]
kernel: Fix various whitespace and indent issues (no functional change).

17 months agosf(4): Remove a duplicated flag in a header.
Sascha Wildner [Thu, 8 Dec 2011 19:01:48 +0000]
sf(4): Remove a duplicated flag in a header.

17 months agorc.conf.5: Start a sentence in upper case.
Sascha Wildner [Thu, 8 Dec 2011 09:33:39 +0000]
rc.conf.5: Start a sentence in upper case.

17 months agotcpdump(1): Fix some sizeof(sizeof(x)) issues.
Sascha Wildner [Thu, 8 Dec 2011 08:26:24 +0000]
tcpdump(1): Fix some sizeof(sizeof(x)) issues.

Has been committed upstream too:

http://sourceforge.net/tracker/?func=detail&aid=3453360&group_id=53066&atid=469573

17 months agoacpi: Include acdragonfly.h from acenv.h.
Sascha Wildner [Thu, 8 Dec 2011 08:16:15 +0000]
acpi: Include acdragonfly.h from acenv.h.

17 months agokernel - Support bdwrite() on tmpfs buffer cache buffers
Matthew Dillon [Thu, 8 Dec 2011 06:32:33 +0000]
kernel - Support bdwrite() on tmpfs buffer cache buffers

* tmpfs itself does not call bdwrite() when no swap space has been
  allocated but certain system side effects such as nvtruncbuf()
  when a file is truncated CAN cause bdwrite() to be called.

  This eventually causes the buffer to run through tmpfs's strategy
  function.

* Adjust the strategy function to handle the no-swap case by marking
  the underlying pages dirty and valid and completing the I/O.

* Also handle the case when swap exists but fills up.  If the
  swap_strategy() function fails with ENOMEM fall-back to again
  marking the pages dirty andvalid and completing the I/O.

  This allows tmpfs to fill up to the system's total memory+swap instead
  of just the system's swap.

17 months agotcp: Don't check PRUS_OOB again in tcp_usr_send
Sepherosa Ziehau [Thu, 8 Dec 2011 05:38:37 +0000]
tcp: Don't check PRUS_OOB again in tcp_usr_send

- It is not necessary; it was checked in sosendtcp
- It does not work w/ asynchronized pru_send

Reminded-by: dillon@

17 months agokernel - Fix missing token release on I/O error during exec
Matthew Dillon [Thu, 8 Dec 2011 05:36:57 +0000]
kernel - Fix missing token release on I/O error during exec

* If an EIO occurs while exec is mapping pages from the binary we need
  to drop the vm_object we are holding before returning.

* Fixes panic when the system runs out of memory and no swap is present.

17 months agokernel - Remove partially commit debug code
Matthew Dillon [Thu, 8 Dec 2011 04:22:45 +0000]
kernel - Remove partially commit debug code

* Remove partially committed debug code that will cause the compile
  to fail.

17 months agokernel - Remove unneeded initialization
Matthew Dillon [Thu, 8 Dec 2011 04:19:40 +0000]
kernel - Remove unneeded initialization

* vm_object->flags is set to 0 by _vm_object_allocate() and does not
  need to be set to 0 again.

17 months agokernel - Clear the quick-return flag when changing PSL_IOPL.
Matthew Dillon [Thu, 8 Dec 2011 04:18:07 +0000]
kernel - Clear the quick-return flag when changing PSL_IOPL.

* Make sure we do a full syscall return when changing PSL_IOPL.

17 months agokernel - Add additional safety assertions in the pmap path
Matthew Dillon [Thu, 8 Dec 2011 04:16:36 +0000]
kernel - Add additional safety assertions in the pmap path

* Assert additional state is correct in pmap_pinit()

* Assert that the critical section count makes preemption impossible
  in pmap_interlock_wait(), which is called from the depths of swtch.s
  during a thread switch.

17 months agokernel - Adjust stack by an addition 128 in sendupcall()
Matthew Dillon [Thu, 8 Dec 2011 04:14:56 +0000]
kernel - Adjust stack by an addition 128 in sendupcall()

* Adjust stack by an addition 128 in sendupcall() for red-zone
  Note however that this code is currently unused, so it has no effect.

* If getmemsize() finds an overlapping region we break out of the inner
  loop so we can continue the outer loop.

Reported-by: swildner

17 months agokernel - Add -fno-stack-protector for kernel build
Matthew Dillon [Thu, 8 Dec 2011 04:14:04 +0000]
kernel - Add -fno-stack-protector for kernel build

* Add -fno-stack-protector for kernel build in order to be consistent
  with the other platform kernel builds

* Has no effect with the current version of gcc but may prevent bad vibes
  in the future.

17 months agokernel - Do not use LK_NOWAIT for vfs_busy() after initialization
Matthew Dillon [Thu, 8 Dec 2011 04:13:09 +0000]
kernel - Do not use LK_NOWAIT for vfs_busy() after initialization

* Minor adjustment, this is more appropriate then what we had but it
  will not effect the code since nobody references the mp yet at this
  point (thus the lock always succeeds even w/ LK_NOWAIT).

17 months agokernel - Fix panic during diskless mount
Matthew Dillon [Thu, 8 Dec 2011 04:10:13 +0000]
kernel - Fix panic during diskless mount

* Remove improper vfs_unbusy()'s from the nfs_mountroot path.  The mount
  is unbusied by the caller instead.  This fixes a lockmgr panic.

17 months agokernel - Fix endless nfs error 70 during shutdown
Matthew Dillon [Thu, 8 Dec 2011 04:08:03 +0000]
kernel - Fix endless nfs error 70 during shutdown

* When shutting down NFS rw mounts left over buffers may not be able to
  flush during a forced unmount.

* When unable to flush during a forced unmount mark the bp EIO instead
  of ESTALE and also mark it B_INVAL to remove the buffer from the the
  vnode.

17 months agokernel - Add TDF_RUNNING assertions
Matthew Dillon [Thu, 8 Dec 2011 02:51:52 +0000]
kernel - Add TDF_RUNNING assertions

* Assert that the target lwkt thread being switched to is not flagged as
  running.

* Assert that the originating lwkt thread being switched from is flagged as
  running.

* Fix the running flag initial condition for the idle thread.

17 months agokernel - Fix alarm() timer race against exit
Matthew Dillon [Thu, 8 Dec 2011 02:44:15 +0000]
kernel - Fix alarm() timer race against exit

* Stop the callout synchronously to ensure that any pending alarm timeout
  is completely removed before we allow a process to exit.

* Add a required PHOLD() to the relaitexpire() function.

17 months agokernel - add DEBUG_LOCKS_LATENCY option
Matthew Dillon [Thu, 8 Dec 2011 02:42:01 +0000]
kernel - add DEBUG_LOCKS_LATENCY option

* This is for debugging only, default disabled.  If optioned this adds
  a sysctl to add a forced latency loop (count to N) in front of any
  spinlock or gettoken.

17 months agobuildworld - Add uuid for HAMMER2
Matthew Dillon [Thu, 8 Dec 2011 02:40:06 +0000]
buildworld - Add uuid for HAMMER2

* Add the uuid for a HAMMER2 filesystem

17 months agobuildworld - Fix -j n collisions
Matthew Dillon [Thu, 8 Dec 2011 02:38:07 +0000]
buildworld - Fix -j n collisions

* Each of _gcc41_tools and _gcc44_tools needs to be ordered

* Currently installation of the objc include files can collide in a way
  that interferes with a parallel build, when gcc41 and gcc44 are built
  concurrently.  For now don't build them concurrently :-(.

17 months agokernel - Fix panic in vm_page_try_to_free()
Matthew Dillon [Thu, 8 Dec 2011 02:36:10 +0000]
kernel - Fix panic in vm_page_try_to_free()

* This function is supposed to work with the VM page in any state, including
  a potentially free state.

* Add additional checks to ignore the page if it is already in PQ_FREE or
  PQ_HOLD

Reported-by: sephe

17 months agokernel - Fix kqueue race with NOTE_EXIT
Matthew Dillon [Thu, 8 Dec 2011 02:34:01 +0000]
kernel - Fix kqueue race with NOTE_EXIT

* Fix a kqueue race where the process receiving a NOTE_EXIT can go
  away while the NOTE_EXIT is being delivered.

* Add a required PHOLD/PRELE since knote_remove() can block.

* Properly return on-zero if KN_DETACHED is set at the end of knote_release()
  so the caller knows to restart the list scan.

Reported-by: sephe

17 months agokernel/netgraph: Set resp to NULL if it is kfree()'d in the switch case.
Sascha Wildner [Wed, 7 Dec 2011 21:11:09 +0000]
kernel/netgraph: Set resp to NULL if it is kfree()'d in the switch case.

This will prevent a later kfree() in the function from freeing it again.

17 months agokfree.cocci: Add a few more memory freeing functions to take into account.
Sascha Wildner [Wed, 7 Dec 2011 18:03:13 +0000]
kfree.cocci: Add a few more memory freeing functions to take into account.

17 months agox86_64/ioapic: Always allow user to specify GSI's target CPU
Sepherosa Ziehau [Wed, 7 Dec 2011 13:07:19 +0000]
x86_64/ioapic: Always allow user to specify GSI's target CPU

Even if interrupt automatic load balance is disable we still should
obey the explicit GSI target CPU configuration.

17 months agox86_64/icu: Implement rman_setup MachIntrABI method
Sepherosa Ziehau [Wed, 7 Dec 2011 12:05:16 +0000]
x86_64/icu: Implement rman_setup MachIntrABI method

- Add per-cpu IRQ mapping support
- Use MachIntrABI.rman_setup to set the interrupt rman's managing
  regions properly

17 months agokernel: Save another bzero() by using M_ZERO.
Sascha Wildner [Tue, 6 Dec 2011 19:01:43 +0000]
kernel: Save another bzero() by using M_ZERO.

17 months agokernel: Remove another NULL check after kmalloc() with M_WAITOK.
Sascha Wildner [Tue, 6 Dec 2011 19:01:11 +0000]
kernel: Remove another NULL check after kmalloc() with M_WAITOK.

17 months agovknetd - Document recently added rc.d script.
Antonio Huete Jimenez [Tue, 6 Dec 2011 18:47:53 +0000]
vknetd - Document recently added rc.d script.

17 months ago<sys/malloc.h>: Remove the MALLOC() and FREE() macros.
Sascha Wildner [Tue, 6 Dec 2011 17:09:15 +0000]
<sys/malloc.h>: Remove the MALLOC() and FREE() macros.

17 months agokernel: Replace all usage of MALLOC()/FREE() with kmalloc()/kfree().
Sascha Wildner [Tue, 6 Dec 2011 17:58:34 +0000]
kernel: Replace all usage of MALLOC()/FREE() with kmalloc()/kfree().

17 months agorc.d - Add a basic vknetd script.
Antonio Huete Jimenez [Tue, 6 Dec 2011 17:59:30 +0000]
rc.d - Add a basic vknetd script.

17 months agokernel - Remove unnecessary < 0 checks for sopt_valsize unsigned field + fixup
Matthew Dillon [Tue, 6 Dec 2011 17:21:35 +0000]
kernel - Remove unnecessary < 0 checks for sopt_valsize unsigned field + fixup

* Remove unnecessary < 0 checks for sopt_valsize, which is an unsigned field

* Add an upper-bound test in one place which did not have it.

Reported-by: Edward O'callaghan, logan1

17 months agovknetd.8: Use the full month name in .Dd.
Sascha Wildner [Tue, 6 Dec 2011 13:41:20 +0000]
vknetd.8: Use the full month name in .Dd.

17 months agokfree.cocci: We neither have BUG() nor BUG_ON().
Sascha Wildner [Tue, 6 Dec 2011 13:41:12 +0000]
kfree.cocci: We neither have BUG() nor BUG_ON().

17 months agoAdd a coccinelle patch that searches for use-after-kfree.
Sascha Wildner [Tue, 6 Dec 2011 11:14:13 +0000]
Add a coccinelle patch that searches for use-after-kfree.

Taken-from: Linux

17 months agomlx(4): Don't free 'meo' until we're finished using it.
Sascha Wildner [Tue, 6 Dec 2011 10:35:01 +0000]
mlx(4): Don't free 'meo' until we're finished using it.

17 months agokernel/nfs: Don't free 'info' until we're finished using it.
Sascha Wildner [Tue, 6 Dec 2011 10:34:35 +0000]
kernel/nfs: Don't free 'info' until we're finished using it.

17 months agocryptodev(4): Fix a bug where the wrong key was bzero()'d before kfree().
Sascha Wildner [Tue, 6 Dec 2011 09:33:29 +0000]
cryptodev(4): Fix a bug where the wrong key was bzero()'d before kfree().

17 months agodpt(4): Remove duplicate bit in an | operation.
Sascha Wildner [Tue, 6 Dec 2011 07:46:32 +0000]
dpt(4): Remove duplicate bit in an | operation.

17 months agopthread_condattr_setclock(3): Fix the check for a known clock.
Sascha Wildner [Mon, 5 Dec 2011 21:46:06 +0000]
pthread_condattr_setclock(3): Fix the check for a known clock.

The way it was before, this function would always return EINVAL.

17 months agovknetd - Fix a bug in previous commit.
Antonio Huete Jimenez [Mon, 5 Dec 2011 15:45:45 +0000]
vknetd - Fix a bug in previous commit.

We have to create pidfile and install signal handlers for the child.

17 months agokernel: Use M_ZERO for kmalloc() instead of bzero()ing.
Sascha Wildner [Mon, 5 Dec 2011 13:53:56 +0000]
kernel: Use M_ZERO for kmalloc() instead of bzero()ing.

17 months agokernel: Remove some unneeded NULL checks after kmalloc() with M_WAITOK.
Sascha Wildner [Mon, 5 Dec 2011 10:39:06 +0000]
kernel: Remove some unneeded NULL checks after kmalloc() with M_WAITOK.

17 months agovknetd - Add pidfile and signal handlers.
Antonio Huete Jimenez [Sun, 4 Dec 2011 23:47:17 +0000]
vknetd - Add pidfile and signal handlers.

When started up, vknetd will create a pidfile in
/var/run/vknetd.pid by default or where specified
by option -i.

Add signal handlers to cleanup pid file.

17 months agokernel/netinet6: Add back a ':' I accidentally removed.
Sascha Wildner [Sun, 4 Dec 2011 22:09:31 +0000]
kernel/netinet6: Add back a ':' I accidentally removed.

17 months agokernel/netinet6: Fix stupid NULL pointer derefs.
Sascha Wildner [Sun, 4 Dec 2011 22:00:42 +0000]
kernel/netinet6: Fix stupid NULL pointer derefs.

17 months agokernel: Move some dereferences below the NULL checks.
Sascha Wildner [Sun, 4 Dec 2011 19:15:43 +0000]
kernel: Move some dereferences below the NULL checks.

17 months agokernel: Fix two cases of sizeof(sizeof(x)).
Sascha Wildner [Sun, 4 Dec 2011 17:08:16 +0000]
kernel: Fix two cases of sizeof(sizeof(x)).

17 months agoAdd a simple coccinelle patch for finding NELEM() candidates.
Sascha Wildner [Sun, 4 Dec 2011 16:06:44 +0000]
Add a simple coccinelle patch for finding NELEM() candidates.

From a similar NetBSD patch from the web.

17 months agokernel: Use NELEM() in some more places.
Sascha Wildner [Sun, 4 Dec 2011 13:32:47 +0000]
kernel: Use NELEM() in some more places.

17 months agopru_send: Allow non-NULL address parameter to be passed
Sepherosa Ziehau [Sun, 4 Dec 2011 13:21:51 +0000]
pru_send: Allow non-NULL address parameter to be passed

Currently the passed in address is copied into a newly allocated
memory (grr, additional blocking kmalloc), and the PRUS_FREEADDR
will be set so that protocol thread could know when to free the
address.

Before this change netperf UDP_STREAM (unconnected socket) could
only do ~200Kpps (w/ -m 18), now it could do ~990Kpps (w/ -m 18).
This gives ~500% performance improvement for tiny UDP packet TX.
The improvement is not as good as the connected socket, which is
~600%, mainly because of the additional memory allocation for
the address.  We _may_ further optimize out the address allocation.

17 months agoudp: Support asynchronized pru_send for connected socket
Sepherosa Ziehau [Sun, 4 Dec 2011 10:43:40 +0000]
udp: Support asynchronized pru_send for connected socket

The result:

192.168.3.1 PhenomII 970 (runs netperf, hw 82571EB)
192.168.3.2 Phenom 9550 (runs netserver, hw 82574L)

netperf -H 192.168.3.2 -t UDP_STREAM -P0 -l 30 -- -n -m 18
(10 second `netstat -nI emx0 -w 1`, unit: pps)

  old      new
204736   1225536
203712   1224960
203520   1224640
202880   1228416
203392   1225408
203648   1224960
203456   1219968
203648   1224064
203712   1218880
204224   1222464

This gives ~600% tiny UDP packet TX performance improvement.

The the current tiny UDP packet TX rate (1.22Mpps) is quite near
the 1.48Mpps 1000baseT limitation.

17 months agoudp: Prepare for the asynchronized pru_send 2
Sepherosa Ziehau [Sat, 3 Dec 2011 14:07:10 +0000]
udp: Prepare for the asynchronized pru_send 2

Save the MSG_DONTROUTE in the netmsg instead of messing w/ socket.so_options

17 months agoudp: Prepare for the asynchronized pru_send
Sepherosa Ziehau [Sat, 3 Dec 2011 13:41:17 +0000]
udp: Prepare for the asynchronized pru_send

Save necessary netmsg information into stack variables

17 months agoudp: Simplify udp_output interface
Sepherosa Ziehau [Sat, 3 Dec 2011 13:26:47 +0000]
udp: Simplify udp_output interface

17 months agodhclient - Use -q option instead of redirection.
Antonio Huete Jimenez [Sat, 3 Dec 2011 21:08:40 +0000]
dhclient - Use -q option instead of redirection.

Obtained-from: OpenBSD

17 months agodhclient - Do not add/remove route 127.0.0.1 for our newly assigned IP/aliases.
Antonio Huete Jimenez [Sat, 3 Dec 2011 18:18:21 +0000]
dhclient - Do not add/remove route 127.0.0.1 for our newly assigned IP/aliases.

Taken-from: FreeBSD 149479