dragonfly.git
8 months agodoc: Update porting_drivers.txt
François Tigeot [Mon, 5 Aug 2013 20:22:52 +0000 (22:22 +0200)]
doc: Update porting_drivers.txt

8 months agottm porting: Small changes (3/3)
François Tigeot [Wed, 7 Aug 2013 11:00:58 +0000 (13:00 +0200)]
ttm porting: Small changes (3/3)

* Fix taskqueue_start_threads() calls

* Remove VPO_UNMANAGED

* Remove VM_ALLOC_WIRED and VM_ALLOC_NOOBJ

* Remove VM_ALLOC_NOBUSY

* Replace VPO_BUSY by PG_BUSY

* Fix calls to pmap_copy_page()

* Fix calls to pmap_zero_page()

8 months agottm porting: Small changes (2/3)
François Tigeot [Wed, 7 Aug 2013 09:47:43 +0000 (11:47 +0200)]
ttm porting: Small changes (2/3)

* Remove vm_page_lock() and vm_page_unlock()

* vm_page_busy() => vm_page_busy_try()

* Replace kern_yield() by lwkt_yield()

* Remove vm_page_sleep() calls

* vm_pager_allocate() => swap_pager_alloc()

* vm_pager_get_pages() => vm_pager_get_page()

* Fix vm_pager_has_page() call

8 months agottm porting: Small changes (1/3)
François Tigeot [Wed, 7 Aug 2013 15:33:41 +0000 (17:33 +0200)]
ttm porting: Small changes (1/3)

* fix kern_psignal()

* fix sf_buf.h

* TAILQ_FOREACH_XXX_SAFE => TAILQ_FOREACH_XXX_MUTABLE()

* mb() => cpu_mfence()

* kernel_map => &kernel_map

* fix kmem_alloc_nofault() calls

* taskqueue_thread => taskqueue_thread[mycpuid]

8 months agottm porting: Fix vm_page_alloc_contig() calls
François Tigeot [Wed, 7 Aug 2013 07:54:47 +0000 (09:54 +0200)]
ttm porting: Fix vm_page_alloc_contig() calls

8 months agottm porting: msleep => lksleep
François Tigeot [Tue, 6 Aug 2013 06:38:18 +0000 (08:38 +0200)]
ttm porting: msleep => lksleep

8 months agottm porting: Translate locking primitives
François Tigeot [Mon, 5 Aug 2013 19:12:10 +0000 (21:12 +0200)]
ttm porting: Translate locking primitives

* rw locks to lockmgr locks

* sx locks to lockmgr locks

* Some mtx locks to lockmgr locks

* Some mtx_locks to spinlocks

Some more locks could probably be converted to spinlocks but this
can be dangerous.
Better use lockmgr locks first and be sure the code runs without any
issue before trying to optimize it.

8 months agottm porting: malloc / free / printf
François Tigeot [Tue, 6 Aug 2013 07:38:49 +0000 (09:38 +0200)]
ttm porting: malloc / free / printf

* printf() => kprintf()

* malloc() => kmalloc()

* free() => drm_free()

8 months agottm porting: MPASS -> KKASSERT
François Tigeot [Mon, 5 Aug 2013 18:28:00 +0000 (20:28 +0200)]
ttm porting: MPASS -> KKASSERT

8 months agottm porting: Fix include files
François Tigeot [Wed, 7 Aug 2013 09:38:05 +0000 (11:38 +0200)]
ttm porting: Fix include files

8 months agodrm: Import the ttm memory manager from FreeBSD
François Tigeot [Sun, 4 Aug 2013 06:11:28 +0000 (08:11 +0200)]
drm: Import the ttm memory manager from FreeBSD

It is needed by some recent GPU drivers such as nouveau and radeon
for nvidia and AMD hardware

8 months agodrm: Locally implement VM_OBJECT_LOCK variants
François Tigeot [Thu, 8 Aug 2013 15:51:25 +0000 (17:51 +0200)]
drm: Locally implement VM_OBJECT_LOCK variants

8 months agodrm: Move PROC_LOCK define to common file
François Tigeot [Wed, 7 Aug 2013 15:19:24 +0000 (17:19 +0200)]
drm: Move PROC_LOCK define to common file

8 months agokernel: Add a memattr argument to vm_page_alloc_contig()
François Tigeot [Wed, 7 Aug 2013 12:36:50 +0000 (14:36 +0200)]
kernel: Add a memattr argument to vm_page_alloc_contig()

8 months agoroute/inet: Add comment about read/write shared global variables
Sepherosa Ziehau [Thu, 8 Aug 2013 14:28:50 +0000 (22:28 +0800)]
route/inet: Add comment about read/write shared global variables

8 months agoroute/inet: Dispatch PRCLONed route expiration to netisr
Sepherosa Ziehau [Thu, 8 Aug 2013 14:25:02 +0000 (22:25 +0800)]
route/inet: Dispatch PRCLONed route expiration to netisr

8 months agopmap/i386: Unbreak buildkernel
Sepherosa Ziehau [Thu, 8 Aug 2013 14:23:04 +0000 (22:23 +0800)]
pmap/i386: Unbreak buildkernel

- Comment out pmap_change_attr function call.  Add notes about what
  needs fix.
- Minor style change.

8 months agolibc/db: Add missing MLINK for mpool_delete().
Sascha Wildner [Thu, 8 Aug 2013 12:32:03 +0000 (14:32 +0200)]
libc/db: Add missing MLINK for mpool_delete().

8 months agoAvoid potentially freeing NULL pointers in dmi_found()
François Tigeot [Thu, 8 Aug 2013 11:49:08 +0000 (13:49 +0200)]
Avoid potentially freeing NULL pointers in dmi_found()

8 months agokernel: Add pmap_page_set_memattr()
François Tigeot [Tue, 6 Aug 2013 09:44:51 +0000 (11:44 +0200)]
kernel: Add pmap_page_set_memattr()

Obtained-from: FreeBSD

8 months agodrm: Improve dmi_found()
François Tigeot [Thu, 8 Aug 2013 08:48:59 +0000 (10:48 +0200)]
drm: Improve dmi_found()

* The OpenBSD code didn't distinguish between board and system names as
  well as board and system vendors

* Properly release memory allocated by kgetenv() while I'm at it

8 months agokernel: Add VM_MAX_ADDRESS and VM_MIN_ADDRESS constants
François Tigeot [Thu, 8 Aug 2013 06:28:44 +0000 (08:28 +0200)]
kernel: Add VM_MAX_ADDRESS and VM_MIN_ADDRESS constants

8 months agodrm: Use NELEM() in dmi_check_system()
François Tigeot [Thu, 8 Aug 2013 05:33:21 +0000 (07:33 +0200)]
drm: Use NELEM() in dmi_check_system()

Spotted-by: swildner
8 months agodrm: Implement dmi_check_system()
François Tigeot [Wed, 7 Aug 2013 16:55:41 +0000 (18:55 +0200)]
drm: Implement dmi_check_system()

* The original function imported from FreeBSD was just a stub

* Replace it by a working implementation from OpenBSD

* And modify it slightly to use SMBIOS information from the loader

* This makes it possible to avoid display detection issues on some
  slightly broken hardware reporting phantom outputs or other weird
  invalid data.

8 months agoigb.4: This driver is not much related to em/emx
Sepherosa Ziehau [Wed, 7 Aug 2013 14:39:53 +0000 (22:39 +0800)]
igb.4: This driver is not much related to em/emx

8 months agobnx.4: Add missing .El
Sepherosa Ziehau [Wed, 7 Aug 2013 13:58:33 +0000 (21:58 +0800)]
bnx.4: Add missing .El

8 months agobnx.4: Add HARDWARE section
Sepherosa Ziehau [Wed, 7 Aug 2013 13:49:08 +0000 (21:49 +0800)]
bnx.4: Add HARDWARE section

8 months agobnx.4: Mention 5717C, which is quite similar to 5720
Sepherosa Ziehau [Wed, 7 Aug 2013 13:37:58 +0000 (21:37 +0800)]
bnx.4: Mention 5717C, which is quite similar to 5720

8 months agoshare/man/man9/Makefile: Keep MLINKS lines sorted.
Sascha Wildner [Wed, 7 Aug 2013 09:14:53 +0000 (11:14 +0200)]
share/man/man9/Makefile: Keep MLINKS lines sorted.

8 months agohammer2 - Add missing bzero() (2)
Matthew Dillon [Wed, 7 Aug 2013 03:14:48 +0000 (20:14 -0700)]
hammer2 - Add missing bzero() (2)

* Fix type-o

8 months agohammer2 - Add missing bzero()
Matthew Dillon [Wed, 7 Aug 2013 03:13:29 +0000 (20:13 -0700)]
hammer2 - Add missing bzero()

* In hammer2_chain_load_async_callback() we have to bzero the buffer
  if the chain is still in the INITIAL state.

8 months agohammer2 - Add missing bqrelse()
Matthew Dillon [Wed, 7 Aug 2013 03:07:44 +0000 (20:07 -0700)]
hammer2 - Add missing bqrelse()

* Add missing bqrelse() in hammer2_chain_load_async()

Reported-by: iostream
8 months agokprintf.9: %D was removed, so don't mention it.
Sascha Wildner [Tue, 6 Aug 2013 17:00:26 +0000 (19:00 +0200)]
kprintf.9: %D was removed, so don't mention it.

8 months agoarp: Dispatch arp cache expiration operation to netisr
Sepherosa Ziehau [Tue, 6 Aug 2013 14:10:50 +0000 (22:10 +0800)]
arp: Dispatch arp cache expiration operation to netisr

8 months agopthread.3: Fix typo from previous commit.
Sascha Wildner [Tue, 6 Aug 2013 11:53:52 +0000 (13:53 +0200)]
pthread.3: Fix typo from previous commit.

8 months agopthread.3: add pthread barrier routines
Joris GIOVANNANGELI [Tue, 6 Aug 2013 07:15:27 +0000 (09:15 +0200)]
pthread.3: add pthread barrier routines

8 months agokernel - Adjust impossible conditions in kdmsg_state_*()
Matthew Dillon [Tue, 6 Aug 2013 06:22:56 +0000 (23:22 -0700)]
kernel - Adjust impossible conditions in kdmsg_state_*()

* kdmsg_state_reply() and kdmsg_state_result() require a non-NULL state.
  Assert the condition and remove the else clause that was broken in the
  first place.

Reported-by: Joris giovannang
8 months agohammer2 - Fix freemap bugs
Matthew Dillon [Tue, 6 Aug 2013 05:50:51 +0000 (22:50 -0700)]
hammer2 - Fix freemap bugs

* The linear iterator must not be used if aligned on an allocation
  chunk (16K) boundary.  Reserved areas just set the bitmap to all 1's
  but were leaving the iterator set to 0.  Fix both the boundary check
  and initialized bmap->linear for reserved areas to HAMMER2_SEGSIZE.

  This fixes a corruption issue where allocates were being made out of
  reserved areas and then overwritten by e.g. the freemap, and where
  the linear iterator would reallocate areas already allocated via the
  bitmap.

* Fix the code which marks device bufferse B_CACHE when freshly allocated.
  It wasn't handling the 32KB case properly.

* Our pre-caching gets and releases a block.  B_CACHE must be used in addition
  to calling vfs_bio_clrbuf() because we aren't holding onto the locked buffer.

8 months agohammer2 - fix crash in temporary code
Matthew Dillon [Tue, 6 Aug 2013 04:43:06 +0000 (21:43 -0700)]
hammer2 - fix crash in temporary code

* Fix a crash in the not-yet-working inode stats rollup code.

8 months agohammer2 - temorarily track free space (3)
Matthew Dillon [Tue, 6 Aug 2013 00:10:22 +0000 (17:10 -0700)]
hammer2 - temorarily track free space (3)

* Correct type-o, add missing assignment.

8 months agohammer2 - temorarily track free space (2)
Matthew Dillon [Tue, 6 Aug 2013 00:08:37 +0000 (17:08 -0700)]
hammer2 - temorarily track free space (2)

* Move the tracking to a better spot

8 months agohammer2 - temorarily track free space
Matthew Dillon [Mon, 5 Aug 2013 23:44:30 +0000 (16:44 -0700)]
hammer2 - temorarily track free space

* Temorarily track free space in the volume header.  This code will
  eventually inherit from the flush so it is properly synchronized to
  the transaction id.

8 months agohammer2 - Adjustments for freemap changes
Matthew Dillon [Mon, 5 Aug 2013 23:20:34 +0000 (16:20 -0700)]
hammer2 - Adjustments for freemap changes

* Adjustments to hammer2 debug/show stuff for freemap changes.

8 months agohammer2 - Change freemap segment delineation, other stuff
Matthew Dillon [Mon, 5 Aug 2013 22:46:07 +0000 (15:46 -0700)]
hammer2 - Change freemap segment delineation, other stuff

* Change the freemap delineation to encode the BREF type as
  well as the radix, in order to avoid mixing data and meta-data
  types together in the same device buffer.

* Reorganize the freemap to remove one indirection level.  Reserve
  two bits per block instead of one.  Change bitmap granularity to 16KB
  but leave allocation granularity at 1KB.

* Fix hammer2_devblksize() to match hammer2_devblkradix().

* Add hammer2_chain_iterate(), a chain iteration with a
  callback.

* Fix issue when hammer2_chain_get() is called with HAMMER2_LOOKUP_ALWAYS.

* Start working on proper statistics rollups during flush (not complete).

8 months agousb4bsd: Next attempt at fixing BIOS handoff for XHCI
Markus Pfeiffer [Sun, 2 Dec 2012 19:00:26 +0000 (19:00 +0000)]
usb4bsd: Next attempt at fixing BIOS handoff for XHCI

If the BIOS does not give up the XHCI, then force the takeover.
Linux does it that way. It might not be clean or correct, but
it works for the time being.
Conflicts:

sys/bus/pci/pci.c
sys/bus/u4b/controller/xhci_pci.c
sys/bus/u4b/controller/xhcireg.h

8 months agousb4bsd: more cleanup of superflous debug messages
Markus Pfeiffer [Sun, 2 Dec 2012 20:11:47 +0000 (20:11 +0000)]
usb4bsd: more cleanup of superflous debug messages

Conflicts:

sys/bus/u4b/usb_hub.c

8 months agousb4bsd: fix breakage caused by earlier commit
Markus Pfeiffer [Sun, 2 Dec 2012 19:07:42 +0000 (19:07 +0000)]
usb4bsd: fix breakage caused by earlier commit

8 months agousb4bsd: xhci cleanup
Markus Pfeiffer [Sat, 1 Dec 2012 21:39:52 +0000 (21:39 +0000)]
usb4bsd: xhci cleanup

Conflicts:

sys/bus/u4b/controller/xhci.c
sys/bus/u4b/controller/xhci_pci.c
sys/bus/u4b/controller/xhcireg.h

8 months agousb4bsd: Bring in fix for endpoint setup on Etron XHCI
Markus Pfeiffer [Sat, 1 Dec 2012 21:00:32 +0000 (21:00 +0000)]
usb4bsd: Bring in fix for endpoint setup on Etron XHCI

This makes usb2 devices work on Etron xhci controllers. The Etron controller expects the maximum valid endpoint to be set in the slot context when an endpoint is configured.

This patch has gone into FreeBSD as well.

Conflicts:

sys/bus/u4b/controller/xhci.c

8 months agousb4bsd, pci: pull in bios takeover code from FreeBSD
Markus Pfeiffer [Mon, 5 Nov 2012 21:00:49 +0000 (21:00 +0000)]
usb4bsd, pci: pull in bios takeover code from FreeBSD

Submitted-By: swildner
8 months agousb4bsd: Fix EHCI
Markus Pfeiffer [Wed, 31 Oct 2012 23:06:40 +0000 (23:06 +0000)]
usb4bsd: Fix EHCI

This is a part of the sync with FreeBSD svn r242385

8 months agousb4bsd: Fix scsi sense handling in umass
Markus Pfeiffer [Wed, 31 Oct 2012 03:55:02 +0000 (03:55 +0000)]
usb4bsd: Fix scsi sense handling in umass

8 months agousb4bsd: sync with FreeBSD svn r242385
Markus Pfeiffer [Tue, 30 Oct 2012 22:39:07 +0000 (22:39 +0000)]
usb4bsd: sync with FreeBSD svn r242385

8 months agousb4bsd: Add detection for Etron EJ168 controller
Markus Pfeiffer [Mon, 29 Oct 2012 00:45:52 +0000 (00:45 +0000)]
usb4bsd: Add detection for Etron EJ168 controller

8 months agokernel: Move some header files to the drivers that only need them.
Sascha Wildner [Mon, 5 Aug 2013 19:37:54 +0000 (21:37 +0200)]
kernel: Move some header files to the drivers that only need them.

8 months agokernel: Remove some unused externs.
Sascha Wildner [Mon, 5 Aug 2013 18:24:02 +0000 (20:24 +0200)]
kernel: Remove some unused externs.

8 months agosocket: SO_LINGER only affects sockets that have been connected
Sepherosa Ziehau [Mon, 5 Aug 2013 15:11:24 +0000 (23:11 +0800)]
socket: SO_LINGER only affects sockets that have been connected

8 months agoUpdate UPDATING a bit.
Sascha Wildner [Mon, 5 Aug 2013 14:03:40 +0000 (16:03 +0200)]
Update UPDATING a bit.

8 months agoRemove some unused externs.
Sascha Wildner [Mon, 5 Aug 2013 11:48:48 +0000 (13:48 +0200)]
Remove some unused externs.

8 months agorp(4): Remove ISA attachment and some dead code, too.
Sascha Wildner [Mon, 5 Aug 2013 11:48:18 +0000 (13:48 +0200)]
rp(4): Remove ISA attachment and some dead code, too.

8 months agokernel/raid: Match xpt_alloc_ccb() and xpt_free_ccb() for rescan callbacks.
Sascha Wildner [Sun, 4 Aug 2013 20:24:17 +0000 (22:24 +0200)]
kernel/raid: Match xpt_alloc_ccb() and xpt_free_ccb() for rescan callbacks.

8 months agokernel/drm2: Remove two unused externs.
Sascha Wildner [Sun, 4 Aug 2013 18:54:28 +0000 (20:54 +0200)]
kernel/drm2: Remove two unused externs.

8 months agodrm/i915: Do not check only primary displays
François Tigeot [Sun, 4 Aug 2013 14:58:23 +0000 (16:58 +0200)]
drm/i915: Do not check only primary displays

* On IBM-PC compatible systems, only one graphic adapter can be
  VGA-compatible at the same time

* This adapter is marked with the PCIS_DISPLAY_VGA capability in
  the PCI device list

* With KMS, we do not care about VGA compatibility anymore; let's
  just use whatever hardware is present

* Tested-with: A radeon X550 as primary display adapter

8 months agoacpi/pstate: AMD CPUs' Family >= 10h use same P-State controls
Sepherosa Ziehau [Sun, 4 Aug 2013 13:52:26 +0000 (21:52 +0800)]
acpi/pstate: AMD CPUs' Family >= 10h use same P-State controls

While I'm here, clean up the code little bit by using CPUID_TO_FAMILY
and cpu_exthigh.

8 months agodrm2: Synchronize with FreeBSD
François Tigeot [Sun, 4 Aug 2013 12:14:46 +0000 (14:14 +0200)]
drm2: Synchronize with FreeBSD

as of r253709 (2013-07-27): The pmap_qenter() and pmap_qremove() perform
TLB invalidation on its own, no need to call pmap_invalidate_range() one
more time.

8 months agobce.4: Mention the tranmission queue arbitration
Sepherosa Ziehau [Sun, 4 Aug 2013 12:28:42 +0000 (20:28 +0800)]
bce.4: Mention the tranmission queue arbitration

8 months agoloader.conf - Clarify kernel early boot comport operation
Matthew Dillon [Sun, 4 Aug 2013 02:39:03 +0000 (19:39 -0700)]
loader.conf - Clarify kernel early boot comport operation

* Add clarification.  sioX.port must also be specified for early kernel
  boot messages, otherwise the serial console doesn't activate until
  init is executed.

  Defaulting this value is difficult because missing serial ports can
  cause different units to probe to different ports.  Thus this is a
  required field if a serial console is desired.

8 months agoFix typo in some manpages: specifed -> specified
Sascha Wildner [Sat, 3 Aug 2013 18:13:53 +0000 (20:13 +0200)]
Fix typo in some manpages: specifed -> specified

8 months agokernel: Use TABs to indent in 'files'.
Sascha Wildner [Sat, 3 Aug 2013 08:33:50 +0000 (10:33 +0200)]
kernel: Use TABs to indent in 'files'.

8 months agokernel - Fix panic when usched is used to force a cpu w/the dfly scheduler (2)
Matthew Dillon [Fri, 2 Aug 2013 22:53:28 +0000 (15:53 -0700)]
kernel - Fix panic when usched is used to force a cpu w/the dfly scheduler (2)

* Missing file in last commit.

8 months agokernel - Fix sendfile() based deadlock
Matthew Dillon [Fri, 2 Aug 2013 22:51:23 +0000 (15:51 -0700)]
kernel - Fix sendfile() based deadlock

* Fix a sendfile() based deadlock.  It turns out that after all of
  that work we can't soft-busy the page anyway because it can deadlock
  against a vfs_msync() -> ... -> vm_object_page_clean() sequence.

Reported-by: pavalos
8 months agokernel/amr: Move amrd (disk) adding before amrp (cam passthrough).
Sascha Wildner [Fri, 2 Aug 2013 17:58:28 +0000 (19:58 +0200)]
kernel/amr: Move amrd (disk) adding before amrp (cam passthrough).

This fixes a panic seen when amr/amrp were compiled into the kernel.

Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2575>
Reported-by: justin
Actual-fix-by: sephe
8 months agokernel - Fix panic when usched is used to force a cpu w/the dfly scheduler
Matthew Dillon [Fri, 2 Aug 2013 17:46:40 +0000 (10:46 -0700)]
kernel - Fix panic when usched is used to force a cpu w/the dfly scheduler

* Fix a panic for 'usched dfly:0x1 sh', or other similar cpu forcing
  mechanic.

* The scheduler was not being notified of the forced migration which
  caused it to assert on a sanity check later on.  Add the needed
  infrastructure.

Reported-by: vsrinivas
8 months agokernel - Fix /dev/mem
Matthew Dillon [Fri, 2 Aug 2013 17:09:37 +0000 (10:09 -0700)]
kernel - Fix /dev/mem

* Fix offset vs page-index mistake for old-style device mmap.  This
  fixes /dev/mem and programs that use it like acpidump.

* There may be other issues.

Reported-by: David Shao bug #2576
8 months agokernel: Fix bus_dmamem_alloc()
François Tigeot [Fri, 2 Aug 2013 17:02:55 +0000 (19:02 +0200)]
kernel: Fix bus_dmamem_alloc()

Its call to pmap_change_attr() contained a typo which caused kernel
panics on some machines.

Reported-by: Markus Pfeiffer
With-advice-from: Venkatesh Srinivas

8 months agoigb.4: Mention the tranmission queue arbitration
Sepherosa Ziehau [Fri, 2 Aug 2013 09:55:55 +0000 (17:55 +0800)]
igb.4: Mention the tranmission queue arbitration

8 months agobnx.4: Mention the tranmission queue arbitration
Sepherosa Ziehau [Fri, 2 Aug 2013 09:43:30 +0000 (17:43 +0800)]
bnx.4: Mention the tranmission queue arbitration

8 months agoem/emx.4: Mention the tranmission queue arbitration
Sepherosa Ziehau [Fri, 2 Aug 2013 09:35:00 +0000 (17:35 +0800)]
em/emx.4: Mention the tranmission queue arbitration

8 months agokernel - Fix pageout algorithm regression
Matthew Dillon [Thu, 1 Aug 2013 20:30:14 +0000 (13:30 -0700)]
kernel - Fix pageout algorithm regression

* The pageout algorithm was trying to calculate when it might have
  to do 'a little extra' moving of pages active->inactive and wound
  up forcing an active->inactive queue run in all cases, even when
  the inactive queue was well over target.

* Remove the broken case.

* Greatly improves (as in restores) performance on systems with heavy
  paging and file caching activity.

8 months agokernel/drm2: Add a missing #include (for drm_free()).
Sascha Wildner [Thu, 1 Aug 2013 12:47:20 +0000 (14:47 +0200)]
kernel/drm2: Add a missing #include (for drm_free()).

8 months agomake_dev.9: Adjust make_dev_covering() description too.
Sascha Wildner [Thu, 1 Aug 2013 11:55:34 +0000 (13:55 +0200)]
make_dev.9: Adjust make_dev_covering() description too.

Pointed-out-by: alexh
8 months agoAdjust two devfs manual pages and some comments to match reality.
Sascha Wildner [Thu, 1 Aug 2013 11:17:32 +0000 (13:17 +0200)]
Adjust two devfs manual pages and some comments to match reality.

8 months agotcp: Allow socket/syncache inheritance between SO_REUSEPORT listen sockets
Sepherosa Ziehau [Wed, 31 Jul 2013 08:31:02 +0000 (16:31 +0800)]
tcp: Allow socket/syncache inheritance between SO_REUSEPORT listen sockets

This is intend to address the drawback of the following SO_REUSEPORT tcp
listen socket usage model:
Multiple processses create their own listen socket w/ SO_REUSEPORT, if
one of the process crashed, i.e. the listen socket is closed, then any
syncache, pending sockets on the completion and incompletion queues
are just dropped.

Compared w/ multiple processes sharing the same tcp listen socket, this
drawback could be unacceptable (e.g. when nginx reload configure).

This commit addresses this drawback by allowing another tcp listen socket
in the same local group, i.e. bound to the same listen port and address,
to inherit the syncache and pending sockets of the to-be-closed tcp
listen socket.  The tcp listen socket, which inherits the syncache and
pending sockets, is the last tcp listen socket in the same local group.

8 months agonrelease: Install a default pkg.conf from pkg(8)
François Tigeot [Thu, 1 Aug 2013 07:13:06 +0000 (09:13 +0200)]
nrelease: Install a default pkg.conf from pkg(8)

Do not hardcode the file contents anymore

8 months agoigb: Force status register reading in ifmedia status, if iface is not up
Sepherosa Ziehau [Thu, 1 Aug 2013 03:00:47 +0000 (11:00 +0800)]
igb: Force status register reading in ifmedia status, if iface is not up

Reported-by: dillon@
8 months agokernel - Add hw.cpu_mwait_haltand hw.cpu_mwait_spin
Matthew Dillon [Wed, 31 Jul 2013 23:34:28 +0000 (16:34 -0700)]
kernel - Add hw.cpu_mwait_haltand hw.cpu_mwait_spin

* Add globals with machine-specific meanings.  This allows us to operate
  with MONITOR/MWAIT and gain the same power savings that we get with
  ACPI halt mode when idle.  Waiting on a follow-up commit to set the
  the defaults.

* For example, if we sysctl hw.cpu_mwait_halt=0x44 hw.cpu_mwait_spin=0x11
  (and leaving machdep.cpu_idle_hlt=2) on a haswell cpu it will shave the
  idle power down by another 5W, from 25W to 20W on an idle Haswell Xeon
  3.4 GHz server chip without impacting wakeup performance too badly.

8 months agosh: Fix compilation for older DragonFly versions.
Peter Avalos [Wed, 31 Jul 2013 21:39:03 +0000 (14:39 -0700)]
sh: Fix compilation for older DragonFly versions.

O_CLOEXEC and F_DUPFD_CLOEXEC were added in the past year, and since sh
is a bootstrap tool, older versions of DragonFly won't be able to
compile this latest version.

Reviewed-by: swildner
8 months agodrm: consistently use drm_free()
Johannes Hofmann [Wed, 31 Jul 2013 20:30:56 +0000 (22:30 +0200)]
drm: consistently use drm_free()

Rename the drm specific kfree() wrapper to drm_free(), as free()
is confusing.

8 months agodrm: remove unused size parameter from drm_free
Johannes Hofmann [Wed, 31 Jul 2013 20:09:37 +0000 (22:09 +0200)]
drm: remove unused size parameter from drm_free

8 months agotest
Johannes Hofmann [Wed, 31 Jul 2013 19:00:34 +0000 (21:00 +0200)]
test

8 months agotest: Sync with FreeBSD.
Peter Avalos [Wed, 31 Jul 2013 04:07:10 +0000 (21:07 -0700)]
test: Sync with FreeBSD.

* Add examples and non-standard primaries to the manual page.
* Reduce code size of ops table.
* Put some static keywords in the source code.
* Accept == as an alias of = which is a popular GNU extension.
* Add more regression tests.

-We have eaccess(2) now, so use it.

Obtained-from:   FreeBSD

8 months agosh: Sync with FreeBSD
Peter Avalos [Wed, 31 Jul 2013 02:47:45 +0000 (19:47 -0700)]
sh: Sync with FreeBSD

* Recognize "--" and explicitly reject options in wait builtin.
* Mention possible ambiguities with $(( and ((.
* Write as much into the heredoc pipe as possible, to avoid forking.
* Don't modify exit status when break/continue/return passes !.
* Document a few expansions for the $PS1 and $PS2 environmental
  variables.
* Don't consider jobs -s/-p as reporting the status of jobs.
* Improve error handling in read builtin.
* Use O_CLOEXEC and F_DUPFD_CLOEXEC instead of separate fcntl() call.
* Remove linked list of stack marks.
* Allow multiple operands in wait builtin.
* Return status 127 for unknown jobs in wait builtin.
* Do not read from stdin if an error occurs during -i -c cmd.
* Remove mkinit.

Obtained-from:   FreeBSD

8 months agokernel/drm2: Some build and warning fixes.
Sascha Wildner [Wed, 31 Jul 2013 13:58:28 +0000 (15:58 +0200)]
kernel/drm2: Some build and warning fixes.

8 months agodrm: Fix incorrect usage of taskqueue_thread
François Tigeot [Wed, 31 Jul 2013 11:48:38 +0000 (13:48 +0200)]
drm: Fix incorrect usage of taskqueue_thread

Replace invalid occurences by taskqueue_thread[mycpuid]

8 months agogetservent.3: Adjust getservent() prototype.
Sascha Wildner [Wed, 31 Jul 2013 09:02:03 +0000 (11:02 +0200)]
getservent.3: Adjust getservent() prototype.

8 months agoi386: Partially revert 9e5e15787783090b6f8cc9f3dc990820c0d66248
François Tigeot [Wed, 31 Jul 2013 08:10:26 +0000 (10:10 +0200)]
i386: Partially revert 9e5e15787783090b6f8cc9f3dc990820c0d66248

* The new fake page handling changes were breaking assertions in the
  existing i386 pmap code.

* This commit fixes boot panics on i386

8 months agoboot - Clarify loader.conf documentation
Matthew Dillon [Wed, 31 Jul 2013 05:00:42 +0000 (22:00 -0700)]
boot - Clarify loader.conf documentation

* Add clarification for situations where you want the boot loader
  to use video output for IPMI purposes, but you want the kernel to
  use sio1.

8 months agoboot - Add loader.conf variable sioX.baud for console operation
Matthew Dillon [Wed, 31 Jul 2013 03:03:18 +0000 (20:03 -0700)]
boot - Add loader.conf variable sioX.baud for console operation

* We already have 'comconsole' and 'sioX.flags=0x10' to set the
  serial port to use as the console, which the kernel boot uses.
  Add in 'sioX.baud' to set the baud rate, so we don't have to
  compile a custom kernel.

* Useful for IPMI setups.

8 months agolibc/db: Sync with FreeBSD
Peter Avalos [Sun, 2 Jun 2013 14:22:33 +0000 (07:22 -0700)]
libc/db: Sync with FreeBSD

- libc/db/hash: cap auto-tuned block size with a value that actually
  works
- Consider flag == 0 as the same of flag == R_NEXT
- Minor changes from Berkeley DB 1.86 and further improvements from
  OpenBSD
- Allow O_SYNC and O_NOFOLLOW flags in dbopen()
- Plug memory leaks and a potential NULL dereference
- Simplify the logic when determining whether to zero out a db file to
  after open().
- When deleting a big key, the offset of an empty page should be bsize,
  not bsize-1
- Avoid overwriting the cursor page when the cursor page becomes the LRU
  page.
- Fix for sequential retrieval failure when using large key/data pairs.
- Fix a crash when iterating over a hash and removing its elements.
- Only squeeze a short key/value pair onto a page with other complete
  key/value pairs
- Return meaningful errno in overflow case
- Save errno before calling _close(), which may clear it
- Explicitly specify bit width for on-disk data structure.

Obtained-from:   FreeBSD

8 months agoatomic.9: add brackets in a C snippet
Joris GIOVANNANGELI [Tue, 30 Jul 2013 20:43:58 +0000 (22:43 +0200)]
atomic.9: add brackets in a C snippet