dragonfly.git
10 years agokernel - fix vkernel64 startup when no hw virtualization present
Mihai Carabas [Mon, 23 Sep 2013 14:14:53 +0000 (17:14 +0300)]
kernel - fix vkernel64 startup when no hw virtualization present

10 years agokernel: disable VMM for AMD SVM to not break the vkernel64
Mihai Carabas [Mon, 23 Sep 2013 07:54:38 +0000 (10:54 +0300)]
kernel: disable VMM for AMD SVM to not break the vkernel64

10 years agokmalloc.9: Mention M_NULLOK in RETURN VALUE section
Sepherosa Ziehau [Mon, 23 Sep 2013 01:47:52 +0000 (09:47 +0800)]
kmalloc.9: Mention M_NULLOK in RETURN VALUE section

10 years agokmalloc.9: Add kmalloc_raise_limit to NAME section
Sepherosa Ziehau [Mon, 23 Sep 2013 01:46:36 +0000 (09:46 +0800)]
kmalloc.9: Add kmalloc_raise_limit to NAME section

10 years agoem/emx: On attach path, perform another reset if the first one fails
Sepherosa Ziehau [Mon, 23 Sep 2013 01:41:34 +0000 (09:41 +0800)]
em/emx: On attach path, perform another reset if the first one fails

The second reset fixes the 82573L attaching failure.

Reported-and-Tested-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>
10 years agoem/emx: Fix attach error handling and media leakage in detach
Sepherosa Ziehau [Mon, 23 Sep 2013 01:34:17 +0000 (09:34 +0800)]
em/emx: Fix attach error handling and media leakage in detach

- Add missing ether_ifdetach() if reset fails.
Reported-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>
- Call ifmedia_removeall() on detach path, since these drivers add
  ifmedia themselves; move ifmedia_init() to the beginning of attach
  for this to work.

10 years agokernel: remove garbage symlink MYKERNEL64
Mihai Carabas [Sun, 22 Sep 2013 15:25:46 +0000 (18:25 +0300)]
kernel: remove garbage symlink MYKERNEL64

10 years agotest: test: README: testing commit bit
Mihai Carabas [Sun, 22 Sep 2013 14:52:03 +0000 (17:52 +0300)]
test: test: README: testing commit bit

10 years agokernel: Add vm_phys_fictitious_unreg_range()
François Tigeot [Fri, 20 Sep 2013 07:05:12 +0000 (09:05 +0200)]
kernel: Add vm_phys_fictitious_unreg_range()

Rework vm_phys_fictitious_reg_range() a bit

Obtained-from: FreeBSD

10 years agoifq: Add ifq_set_hw_serialize
Sepherosa Ziehau [Sun, 22 Sep 2013 12:14:22 +0000 (20:14 +0800)]
ifq: Add ifq_set_hw_serialize

This eases the drivers which use splitted serializers but only have one
transmit queue.

10 years agomxge: Simplify MSI handling; cleanup legacy interrupt handling
Sepherosa Ziehau [Sun, 22 Sep 2013 09:57:15 +0000 (17:57 +0800)]
mxge: Simplify MSI handling; cleanup legacy interrupt handling

10 years agomxge: Limit unrelated softc fields' visibility to RX and TX path
Sepherosa Ziehau [Sun, 22 Sep 2013 08:56:05 +0000 (16:56 +0800)]
mxge: Limit unrelated softc fields' visibility to RX and TX path

10 years agolibc/rpc: Fix some prototypes.
Sascha Wildner [Sun, 22 Sep 2013 08:54:58 +0000 (10:54 +0200)]
libc/rpc: Fix some prototypes.

10 years agokernel/drm: Remove bogus typedef.
Sascha Wildner [Sun, 22 Sep 2013 06:17:41 +0000 (08:17 +0200)]
kernel/drm: Remove bogus typedef.

10 years agomxge: Count oerrors in generic way
Sepherosa Ziehau [Sun, 22 Sep 2013 04:48:40 +0000 (12:48 +0800)]
mxge: Count oerrors in generic way

- Remove unused local oerrors field
- Remove stats updating code which applies only to FreeBSD IFNET_BUF_RING

10 years agokmalloc.9: Update 'date'
Sepherosa Ziehau [Sun, 22 Sep 2013 03:27:59 +0000 (11:27 +0800)]
kmalloc.9: Update 'date'

10 years agokmalloc.9: Mention kmalloc_raise_limit()
Sepherosa Ziehau [Sun, 22 Sep 2013 03:27:21 +0000 (11:27 +0800)]
kmalloc.9: Mention kmalloc_raise_limit()

10 years agokmalloc.9: M_INTWAIT is a proper "wait" flag too
Sepherosa Ziehau [Sun, 22 Sep 2013 03:20:20 +0000 (11:20 +0800)]
kmalloc.9: M_INTWAIT is a proper "wait" flag too

10 years agokmalloc.9: Mention M_NULLOK
Sepherosa Ziehau [Sun, 22 Sep 2013 03:19:27 +0000 (11:19 +0800)]
kmalloc.9: Mention M_NULLOK

10 years agokmalloc.9: Mention allocated memory alignment garantee
Sepherosa Ziehau [Sun, 22 Sep 2013 02:57:03 +0000 (10:57 +0800)]
kmalloc.9: Mention allocated memory alignment garantee

10 years agokmalloc.9: Mention kmalloc_cachealign()
Sepherosa Ziehau [Sun, 22 Sep 2013 02:56:13 +0000 (10:56 +0800)]
kmalloc.9: Mention kmalloc_cachealign()

10 years agomxge: DragonFly's kmalloc(9) always returns 8 bytes aligned memory
Sepherosa Ziehau [Sun, 22 Sep 2013 02:44:55 +0000 (10:44 +0800)]
mxge: DragonFly's kmalloc(9) always returns 8 bytes aligned memory

10 years agomxge: Fix various comment
Sepherosa Ziehau [Sun, 22 Sep 2013 01:48:57 +0000 (09:48 +0800)]
mxge: Fix various comment

10 years agomxge: Utilize if_watchdog instead of knocking its own wheel out
Sepherosa Ziehau [Sat, 21 Sep 2013 14:55:07 +0000 (22:55 +0800)]
mxge: Utilize if_watchdog instead of knocking its own wheel out

10 years agokernel/drm: ttm_mem_global_free() is void, so don't return any result.
Sascha Wildner [Sat, 21 Sep 2013 18:58:00 +0000 (20:58 +0200)]
kernel/drm: ttm_mem_global_free() is void, so don't return any result.

10 years agoFix typos (sytem -> system) in a manpage and a message.
Sascha Wildner [Sat, 21 Sep 2013 18:05:40 +0000 (20:05 +0200)]
Fix typos (sytem -> system) in a manpage and a message.

10 years agobuildworld - Fix buildworld conflict
Matthew Dillon [Sat, 21 Sep 2013 17:02:10 +0000 (10:02 -0700)]
buildworld - Fix buildworld conflict

* Remove EX_REBOOT from include/sysexits.h, it conflicts with the
  buildworld.

* Replace EX_REBOOT with a local #define'd symbol in
  vkernel64/platform/init.c.

10 years agomxge: Cleanup code that frees pending mbufs
Sepherosa Ziehau [Wed, 18 Sep 2013 05:27:42 +0000 (13:27 +0800)]
mxge: Cleanup code that frees pending mbufs

10 years agokernel/acpi: Sync acpi_thermal with FreeBSD.
Sascha Wildner [Sat, 7 Sep 2013 22:45:19 +0000 (00:45 +0200)]
kernel/acpi: Sync acpi_thermal with FreeBSD.

10 years agokernel: Fix some recently introduced breakage.
Sascha Wildner [Sat, 21 Sep 2013 07:58:30 +0000 (09:58 +0200)]
kernel: Fix some recently introduced breakage.

vm_page_free() and vm_page_undirty() are now inline functions
in <vm/vm_page2.h>.

10 years agokernel - Drop overlapping ipv6 fragments
Matthew Dillon [Sat, 21 Sep 2013 04:11:42 +0000 (21:11 -0700)]
kernel - Drop overlapping ipv6 fragments

* Unconditionally drop overlapping ipv6 fragments as per
  RFC 5722.

Reported-by: logan1, bug 2584, including patch
10 years agohammer2 - Merge Mihai Carabas's VKERNEL/VMM GSOC project into the main tree
Matthew Dillon [Fri, 20 Sep 2013 23:15:43 +0000 (16:15 -0700)]
hammer2 - Merge Mihai Carabas's VKERNEL/VMM GSOC project into the main tree

* This merge contains work primarily by Mihai Carabas, with some misc
  fixes also by Matthew Dillon.

* Special note on GSOC core

  This is, needless to say, a huge amount of work compressed down into a
  few paragraphs of comments.  Adds the pc64/vmm subdirectory and tons
  of stuff to support hardware virtualization in guest-user mode, plus
  the ability for programs (vkernels) running in this mode to make normal
  system calls to the host.

* Add system call infrastructure for VMM mode operations in kern/sys_vmm.c
  which vectors through a structure to machine-specific implementations.

  vmm_guest_ctl_args()
  vmm_guest_sync_addr_args()

  vmm_guest_ctl_args() - bootstrap VMM and EPT modes.  Copydown the original
  user stack for EPT (since EPT 'physical' addresses cannot reach that far
  into the backing store represented by the process's original VM space).
  Also installs the GUEST_CR3 for the guest using parameters supplied by
  the guest.

  vmm_guest_sync_addr_args() - A host helper function that the vkernel can
  use to invalidate page tables on multiple real cpus.  This is a lot more
  efficient than having the vkernel try to do it itself with IPI signals
  via cpusync*().

* Add Intel VMX support to the host infrastructure.  Again, tons of work
  compressed down into a one paragraph commit message.  Intel VMX support
  added.  AMD SVM support is not part of this GSOC and not yet supported
  by DragonFly.

* Remove PG_* defines for PTE's and related mmu operations.  Replace with
  a table lookup so the same pmap code can be used for normal page tables
  and also EPT tables.

* Also include X86_PG_V defines specific to normal page tables for a few
  situations outside the pmap code.

* Adjust DDB to disassemble SVM related (intel) instructions.

* Add infrastructure to exit1() to deal related structures.

* Optimize pfind() and pfindn() to remove the global token when looking
  up the current process's PID (Matt)

* Add support for EPT (double layer page tables).  This primarily required
  adjusting the pmap code to use a table lookup to get the PG_* bits.

  Add an indirect vector for copyin, copyout, and other user address space
  copy operations to support manual walks when EPT is in use.

  A multitude of system calls which manually looked up user addresses via
  the vm_map now need a VMM layer call to translate EPT.

* Remove the MP lock from trapsignal() use cases in trap().

* (Matt) Add pthread_yield()s in most spin loops to help situations where
  the vkernel is running on more cpu's than the host has, and to help with
  scheduler edge cases on the host.

* (Matt) Add a pmap_fault_page_quick() infrastructure that vm_fault_page()
  uses to try to shortcut operations and avoid locks.  Implement it for
  pc64.  This function checks whether the page is already faulted in as
  requested by looking up the PTE.  If not it returns NULL and the full
  blown vm_fault_page() code continues running.

* (Matt) Remove the MP lock from most the vkernel's trap() code

* (Matt) Use a shared spinlock when possible for certain critical paths
  related to the copyin/copyout path.

10 years agodc(1): Sync with OpenBSD
Joris Giovannangeli [Fri, 20 Sep 2013 21:31:56 +0000 (23:31 +0200)]
dc(1): Sync with OpenBSD

Changes include :

 * show an error message if the argument is a dir

 * check value against UINT_MAX before casting to u_int; while
   there fix a buglet in bexp(): x * UINT_MAX only overflows if x > 0

 * fix fractional number exponentiation

 * use BN_set_negative() and BN_is_negative() instead of subtracting or
   comparing to zero

 * For exponenttion, only warn if the fractional part of the exponent
   is non-zero and avoid div by zero.

 * let length(0.000) conform to what gnu bc does

 * check for unitialized elements when accessing an array

 * although there's no EOF condition defined for the handling of '?',
   but anyway reset the eof condition on stdin, so you don't get an
   infinite loop in the typical program after a ^D.

 * convert malloc to calloc

 * fix three leaks

 * use size_t as stack size and ssize_t as stack pointer

 * add missing bn_check

Revision for updated OpenBSD files are :

 - bcode.c : 1.45
 - bcode.h : 1.7
 - dc.c : 1.11
 - inout.c : 1.17
 - stack.c : 1.11

Obtained-from: OpenBSD

10 years agobc(1): Sync with openBSD
Joris Giovannangeli [Fri, 20 Sep 2013 21:17:36 +0000 (23:17 +0200)]
bc(1): Sync with openBSD

This include the following changes :

 * repair function when used with different scales

 * Better error message on unexpected newline

 * save/restore tty state on SIGTSTP/SIGCONT

 * protect errno from damage in the signal handler

 * make ^D behave well
   dont't echo it and make it work if the cursor is at start of line after a ^C

 * avoid usage of YY_FLUSH_BUFFER

    - avoid YY_FLUSH_BUFFER: it is not signal safe and it does not work as intended
    after the introduction of editline
    - honour editline edit off mode

OpenBSD updated files revisions :
    - scan.l : 1.28
    - bc.y : 1.42
    - bc.library : 1.4
    - extern.h : 1.10
    - tty.c : 1.1

Obtained-from: OpenBSD

10 years agotest/test: test commit
Joris Giovannangeli [Fri, 20 Sep 2013 16:47:32 +0000 (18:47 +0200)]
test/test: test commit

10 years agodrm: sync drmP.h with FreeBSD
François Tigeot [Sun, 15 Sep 2013 16:32:59 +0000 (18:32 +0200)]
drm: sync drmP.h with FreeBSD

10 years agodrm: Update drm_pciids.h with Linux 3.8 data
François Tigeot [Thu, 19 Sep 2013 19:50:55 +0000 (21:50 +0200)]
drm: Update drm_pciids.h with Linux 3.8 data

Obtained-from: FreeBSD

10 years agokernel/usb4bsd: Silence an 'unused variable' warning in run(4).
Sascha Wildner [Thu, 19 Sep 2013 20:38:52 +0000 (22:38 +0200)]
kernel/usb4bsd: Silence an 'unused variable' warning in run(4).

10 years agodrm/ttm: Fix a crash in vm_page_unwire()
François Tigeot [Tue, 17 Sep 2013 17:35:08 +0000 (19:35 +0200)]
drm/ttm: Fix a crash in vm_page_unwire()

10 years agokernel/x86_64: Add a 64-bit atomic function
François Tigeot [Sun, 15 Sep 2013 18:31:31 +0000 (20:31 +0200)]
kernel/x86_64: Add a 64-bit atomic function

* atomic_swap_long()

* also define atomic_store_rel_64() and atomic_swap_64() aliases

10 years agosleep.9: Adjust prototypes.
Sascha Wildner [Thu, 19 Sep 2013 16:15:24 +0000 (18:15 +0200)]
sleep.9: Adjust prototypes.

10 years agohammer2 - GSOC cleanup pass
Matthew Dillon [Thu, 19 Sep 2013 04:01:45 +0000 (21:01 -0700)]
hammer2 - GSOC cleanup pass

* Cleanup some syntax and convert // comments in core source files.
  Remove _t suffix on static compression type procedures, make a
  few variable names shorter, etc.

* Used in-memory hammer2_inode->comp_heuristic instead of the on-media
  ipdata->reserved85 field for the compression heuristic.  It doesn't
  need to be recorded on-media.

* If the write thread encounters an I/O error, flag the original logical
  bp with the error and continue rather than breaking out and killing
  the write thread.

10 years agohammer2 - Merge Daniel Flores's HAMMER2 GSOC project into the main tree
Matthew Dillon [Thu, 19 Sep 2013 02:56:07 +0000 (19:56 -0700)]
hammer2 - Merge Daniel Flores's HAMMER2 GSOC project into the main tree

* This merge contains work primarily by Daniel Flores, and also by
  Matthew Dillon.  Daniel's work is focused around adding the compression
  infrastructure while my work was focused around changing HAMMER2's
  I/O infrastructure to work with the compression code.

  Daniel's work involved adding the compression functions and heuristics,
  modifying mainly vnops and vfsops to use them, adding the new buffer
  cache write thread, and adding the new hammer2 utility directives and
  related ioctls.

  My work involved changing the H2 I/O infrastructure to always double-buffer
  (i.e. logical buffers vs device buffers) because device buffers can now
  wind up being a different size than the related logical buffers.  I also
  had to make changes to the hammer2_mount and hammer2_pfsmount mechanics
  and other things to prevent deadlocks.

    Daniel's Work

* Add the hammer2 setcomp directive which sets the compression mode on a
  directory or file.  If applie to a directory, the compression mode is
  inherited by any new files or directories created under the directory.
  Pre-existing subdirectories and files are not affected.

  The directive has a recursive option to recurse down and set the mode on
  everything underneath.

* Add wthread_bioq and related fields to hammer2_mount to support a
  buffer cache buffer writing thread.  This thread is responsible for
  calculating compression sizes, allocating device buffer blocks, and
  compressing logical buffers into the device buffers.

* Implement HAMMER2_COMP_AUTOZERO, HAMMER2_COMP_LZ4, and HAMMER2_COMP_ZLIB
  compression modes.  AUTOZERO is the zero-block detection code.  LZ4 will
  do zero-block-detection and LZ4 otherwise, and ZLIB will do
  zero-block-detection and gzip otherwise.

  This work entails a ton of new files imported from the LZ4 and ZLIB
  projects plus lots of wiring.

  The new files had to be cleaned up considerably, as well, since they
  were originally intended for userland.

* Move synchronous device buffer handling out of hammer2_vop_write() and
  into the support thread.  Numerous procedures were moved out of
  hammer2_vnops.c and into hammer2_vfsops.c as well.

  This greatly simplifies hammer2_vop_write() as well as the truncate and
  extend code, and improves the critical-path performance for write()
  (at least until the buffer cache fills up or gets too far behind).

* Implement semi-synchronous decompression callbacks for read I/O and
  read-ahead I/O.

* Add HAMMER2IOC_INODE_COMP_REC_SET and HAMMER2IOC_INODE_COMP_REC_SET2
  ioctls to support the setcomp directive.

  Matthew's Work

* The hammer2_inode copies additional fields from the inode data, allowing
  the inode data to be deallocated after use.

* Due to the way the buffer cache now operates, multiple deletions of the
  same chain key can occur within the same transaction.  Adjust the RBTREE
  compare code to handle the case.

* Track chain structure use on a pfsmount-by-pfsmount basis for current
  and future management of the kmalloc pools used by hammer2.

* Rework the way inodes are locked to track chain modifications.

* Rewrite hammer2_chain_delete_duplicate().

* Rewrite hammer2_trans_init() and the flush code primarily to fix
  deadlocks in the flush synchronization mechanics.

* Interlock very low level chain operations with a spin lock instead
  of the full-blown chain lock to deal with potential deadlocks and
  fix a few SMP races.

* For the moment make all logical buffers 64KB.  Not efficient for small
  files and will be changed back at some point but necessary for efficient
  compression at the moment.

* Implement an asynchronous buffer cache callback feature.

* Use a localized in-hammer2_inode-structure size field for frontend
  operations, including extend and truncate, to remove confusion against
  backend flushes.  This way the inode data can be modified only during
  the flush and not before where it might cause confusion with previously
  staged flushes.

10 years agoinet6: Add missing ifioctl credential checks
François Tigeot [Wed, 18 Sep 2013 19:48:58 +0000 (21:48 +0200)]
inet6: Add missing ifioctl credential checks

This fixes issue #2581 (again), but with SIOCSIFBRDADDR and
SIOCSIFNETMASK ioctls this time.

Security: CVE-2013-5691
Patch-from: Loganaden Velvindron, inspired by FreeBSD changes

10 years agodsched.9: Fix dsched_new_policy_thread_io()'s prototype (see 5374d04f).
Sascha Wildner [Wed, 18 Sep 2013 20:46:59 +0000 (22:46 +0200)]
dsched.9: Fix dsched_new_policy_thread_io()'s prototype (see 5374d04f).

10 years agotoken.9: lwkt_token_init()'s desc argument is const.
Sascha Wildner [Wed, 18 Sep 2013 20:45:54 +0000 (22:45 +0200)]
token.9: lwkt_token_init()'s desc argument is const.

10 years agofortune - Add a fun tip
Matthew Dillon [Wed, 18 Sep 2013 19:18:06 +0000 (12:18 -0700)]
fortune - Add a fun tip

* Works best with cowsay.

10 years agolibhammer_stats.3: Fix typo.
Sascha Wildner [Wed, 18 Sep 2013 18:49:37 +0000 (20:49 +0200)]
libhammer_stats.3: Fix typo.

10 years agomandoc: upstream fix for missed clearing of MDOC_NEWLINE
Franco Fichtner [Sun, 15 Sep 2013 21:10:36 +0000 (23:10 +0200)]
mandoc: upstream fix for missed clearing of MDOC_NEWLINE

Provided-by: Ingo Schwarze <schwarze at mdocml dot bsd dot lv>
10 years agokernel/drm: Add missing vm_phys_fictitious_to_vm_page() prototype.
Sascha Wildner [Wed, 18 Sep 2013 16:39:54 +0000 (18:39 +0200)]
kernel/drm: Add missing vm_phys_fictitious_to_vm_page() prototype.

10 years agomxge: Cleanup watchdog reset path
Sepherosa Ziehau [Wed, 18 Sep 2013 04:56:14 +0000 (12:56 +0800)]
mxge: Cleanup watchdog reset path

Change device_printf on that code path to if_printf

10 years agomxge: Cleanup sysctl handlers
Sepherosa Ziehau [Wed, 18 Sep 2013 03:07:51 +0000 (11:07 +0800)]
mxge: Cleanup sysctl handlers

10 years agomxge: Cleanup ioctl path
Sepherosa Ziehau [Wed, 18 Sep 2013 01:33:16 +0000 (09:33 +0800)]
mxge: Cleanup ioctl path

Change device_printf on that code path to if_printf

10 years agovm: Implement and use vm_page_initfake()
François Tigeot [Tue, 17 Sep 2013 19:26:03 +0000 (21:26 +0200)]
vm: Implement and use vm_page_initfake()

Replacing a possibly buggy in some corner cases drm-specific function

Inspired-from: FreeBSD

10 years agomxge: Cleanup TX completion path
Sepherosa Ziehau [Tue, 17 Sep 2013 09:43:11 +0000 (17:43 +0800)]
mxge: Cleanup TX completion path

While im here, remove unused stats fields in softc

10 years agomxge: Fix if_start implementation
Sepherosa Ziehau [Tue, 17 Sep 2013 09:09:05 +0000 (17:09 +0800)]
mxge: Fix if_start implementation

- Don't transmit, if interface is not up or OACTIVE
- Merge mxge_start_locked into mxge_start; we won't need locked version
  of if_start

10 years agomxge: Remove several unused fields in softc
Sepherosa Ziehau [Tue, 17 Sep 2013 08:44:44 +0000 (16:44 +0800)]
mxge: Remove several unused fields in softc

10 years agomxge: Cleanup TX descriptor capsulation
Sepherosa Ziehau [Tue, 17 Sep 2013 08:25:44 +0000 (16:25 +0800)]
mxge: Cleanup TX descriptor capsulation

10 years agomxge: inline -> __inline
Sepherosa Ziehau [Tue, 17 Sep 2013 07:49:26 +0000 (15:49 +0800)]
mxge: inline -> __inline

10 years agomxge: Clean up RX path
Sepherosa Ziehau [Tue, 17 Sep 2013 07:33:13 +0000 (15:33 +0800)]
mxge: Clean up RX path

10 years agomxge: Constify various const strings
Sepherosa Ziehau [Tue, 17 Sep 2013 02:54:24 +0000 (10:54 +0800)]
mxge: Constify various const strings

10 years agoifpoll: Use tsc_invariant consistently
Sepherosa Ziehau [Tue, 17 Sep 2013 02:34:14 +0000 (10:34 +0800)]
ifpoll: Use tsc_invariant consistently

10 years agomxge: Cleanup probe code
Sepherosa Ziehau [Tue, 17 Sep 2013 02:34:04 +0000 (10:34 +0800)]
mxge: Cleanup probe code

10 years agohammer - Unbreak buildkernel
Antonio Huete Jimenez [Mon, 16 Sep 2013 22:22:19 +0000 (00:22 +0200)]
hammer - Unbreak buildkernel

10 years agoHAMMER - Fix VFS_STATFS() after volume-add.
Antonio Huete Jimenez [Mon, 16 Sep 2013 21:48:05 +0000 (23:48 +0200)]
HAMMER - Fix VFS_STATFS() after volume-add.

* Make sure the new free bigblocks count is accurate
  when a volume is added to a HAMMER filesystem.

10 years agomxge: Fix big buf allocation
Sepherosa Ziehau [Mon, 16 Sep 2013 14:19:31 +0000 (22:19 +0800)]
mxge: Fix big buf allocation

- MB_WAIT should be used to allocate mbuf.
- m_freem() instead of m_free() should be called if busdma error happens.
- During initialization, there is no mbuf to be recycled; just return
  error.

10 years agomxge: Limit MTU to ~4K
Sepherosa Ziehau [Mon, 16 Sep 2013 13:53:54 +0000 (21:53 +0800)]
mxge: Limit MTU to ~4K

Various code for "gather" jumbo frame is just broken; limiting MTU to 4K
(MJUMPAGESIZE) should workaround this.

10 years agomxge: Fix small buf allocation
Sepherosa Ziehau [Mon, 16 Sep 2013 12:34:00 +0000 (20:34 +0800)]
mxge: Fix small buf allocation

- MB_WAIT should be used to allocate mbuf.
- m_freem() instead of m_free() should be called if busdma error happens.
- During initialization, there is no mbuf to be recycled; just return
  error.

10 years agomxge: Cleanup slice open code
Sepherosa Ziehau [Mon, 16 Sep 2013 09:38:14 +0000 (17:38 +0800)]
mxge: Cleanup slice open code

10 years agomxge: Cleanup stop path
Sepherosa Ziehau [Mon, 16 Sep 2013 08:42:23 +0000 (16:42 +0800)]
mxge: Cleanup stop path

10 years agomxge: Cleanup if_init path
Sepherosa Ziehau [Mon, 16 Sep 2013 08:31:08 +0000 (16:31 +0800)]
mxge: Cleanup if_init path

10 years agomake.1: correct a few style issues
Franco Fichtner [Fri, 13 Sep 2013 22:29:33 +0000 (00:29 +0200)]
make.1: correct a few style issues

10 years ago<sys/cdefs.h>: Fix the _Static_assert compatiblity macros.
Sascha Wildner [Sun, 15 Sep 2013 19:32:24 +0000 (21:32 +0200)]
<sys/cdefs.h>: Fix the _Static_assert compatiblity macros.

Remove the typedef hack (which was like our CTASSERT()). Emacs was
choking on it because it is using _Static_assert like this (in verify.h):

#define _GL_VERIFY_TYPE(R, DIAGNOSTIC)  \
     struct {                           \
       _Static_assert (R, DIAGNOSTIC);  \
       int _gl_dummy;                   \
     }

GCC supports it since 4.6, so take that into account too.

10 years agomxge: Make detach suitable for error handling and fix attach error handling
Sepherosa Ziehau [Sun, 15 Sep 2013 13:37:39 +0000 (21:37 +0800)]
mxge: Make detach suitable for error handling and fix attach error handling

10 years agodrm.4: Fix some mandoc warnings which I introduced.
Sascha Wildner [Sun, 15 Sep 2013 13:45:02 +0000 (15:45 +0200)]
drm.4: Fix some mandoc warnings which I introduced.

10 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sun, 15 Sep 2013 13:33:21 +0000 (15:33 +0200)]
Update the pciconf(8) database.

September 14, 2013 snapshot from http://pciids.sourceforge.net/

10 years agomxge: Cleanup attach path
Sepherosa Ziehau [Sun, 15 Sep 2013 05:37:43 +0000 (13:37 +0800)]
mxge: Cleanup attach path

Most of the changes are non-functional.  M_NOWAIT -> M_WAITOK is the most
important one.

10 years agodrm: Sync with FreeBSD
François Tigeot [Sat, 14 Sep 2013 17:47:40 +0000 (19:47 +0200)]
drm: Sync with FreeBSD

* As of commit r255045 (2013-08-30):
  'u_long' is consistently spelled 'unsigned long' in this file.  Fix it.

* Some of the changes are bug fixes, including a few memory leaks

* Others are necessary groundwork for the Radeon KMS driver

* Some new files were imported from Linux 3.8-rc3

* Support for E-DDC has been added

* Many atomic routines were revisited to make them more compatible with
  the Linux APIs and run-time behavior

10 years agokernel/i386: Implement ffsl()
François Tigeot [Sat, 14 Sep 2013 16:59:21 +0000 (18:59 +0200)]
kernel/i386: Implement ffsl()

It was only a builtin function on x86_64.

Obtained-from: FreeBSD

10 years agokernel: Import atomic_testandset_int() from FreeBSD
François Tigeot [Sat, 14 Sep 2013 15:17:12 +0000 (17:17 +0200)]
kernel: Import atomic_testandset_int() from FreeBSD

10 years agokernel - Fix issue revealed by new yield code
Matthew Dillon [Sat, 14 Sep 2013 09:08:18 +0000 (02:08 -0700)]
kernel - Fix issue revealed by new yield code

* Make sure the current lwp is released from the scheduler in all cases.
  There were a few race cases where it would not be released.

* Reorder the yield code a little.

10 years agokernel - Misc adjustments used by the vkernel and VMM, misc optimizations
Matthew Dillon [Sat, 14 Sep 2013 02:02:55 +0000 (19:02 -0700)]
kernel - Misc adjustments used by the vkernel and VMM, misc optimizations

* This section committed separately because it is basically independent
  of VMM.

* Improve pfind().  Don't get proc_token if the process being looked up
  is the current process.

* Improve kern_kill().  Do not obtain proc_token any more.  p->p_token
  is sufficient and the process group has its own lock now.

* Call pthread_yield() when spinning on various things.

    x Spinlocks
    x Tokens (spinning in lwkt_switch)
    x cpusync (ipiq)

* Rewrite sched_yield() -> dfly_yield().  dfly_yield() will
  unconditionally round-robin the LWP, ignoring estcpu.  It isn't
  perfect but it works fairly well.

  The dfly scheduler will also no longer attempt to migrate threads
  across cpus when handling yields.  They migrate normally in all
  other circumstances.

  This fixes situations where the vkernel is spinning waiting for multiple
  events from other cpus and in particular when it is doing a global IPI
  for pmap synchronization of the kernel_pmap.

10 years agoDisable making i915kms compilable into the kernel.
Sascha Wildner [Fri, 13 Sep 2013 21:58:26 +0000 (23:58 +0200)]
Disable making i915kms compilable into the kernel.

Right now, on systems with supported cards, it would cause the screen
go black before Xorg is started.

In-discussion-with: ftigeot

10 years agodrm.4: Update a bit to reflect the current state of affairs.
Sascha Wildner [Fri, 13 Sep 2013 21:54:32 +0000 (23:54 +0200)]
drm.4: Update a bit to reflect the current state of affairs.

While here, remove an obsolete MLINK, and add some more MLINKS to cover
module names too.

Based on a patch by ftigeot, with additional input by him.

10 years agotcp: Use mbuf jcluster (4K) in sosendtcp(); improve 10Ge TSO performance
Sepherosa Ziehau [Fri, 13 Sep 2013 09:26:22 +0000 (17:26 +0800)]
tcp: Use mbuf jcluster (4K) in sosendtcp(); improve 10Ge TSO performance

For the Myricom PCIE-8AL-C I have tested, this gives ~900Mbps performance
boost using 1500 MTU when TSO is enabled (from 7.7Gbps to 8.6Gbps).

Using mbuf jcluster could:
- Reduce the number of TX descriptors needed for one TSO packet.
- Let the NIC chip perform longer large data burst.

I believe this is the main reasons for the 10Ge performance boost.

Reduce sosend_agglim from 3 to 2, which means 8K aggregation (was 6K
aggregation) before user thread dispatches the sending buf to netisr.

net.inet.tcp.sosend_jcluster is added to enable this feature; it is
enabled by default.

10 years agombuf: Fix jcluster support
Sepherosa Ziehau [Fri, 13 Sep 2013 09:14:39 +0000 (17:14 +0800)]
mbuf: Fix jcluster support

- Free the jcluster to the correct objcache, which solves "jcluster mbuf"
  objcache exhaustion.
- By default, set the amount of the jclusters to half the amount of the
  normal clusters.  jcluster will be used on TCP sending path in the later
  commit to improve TSO performance for 10Ge.
- Add mbuf stat for jcluster; adjust netstat(1) to show it.
- Add m_getlj(), which will be used on TCP sending path in the later
  commit to improve TSO performnace for 10Ge.

10 years ago<sys/vnode.h>: Remove two unused externs.
Sascha Wildner [Thu, 12 Sep 2013 20:35:53 +0000 (22:35 +0200)]
<sys/vnode.h>: Remove two unused externs.

10 years agodirfs.5: Add missing .Ed
Sascha Wildner [Thu, 12 Sep 2013 16:57:12 +0000 (18:57 +0200)]
dirfs.5: Add missing .Ed

10 years agodrm: Replace the i915 driver by i915kms
François Tigeot [Thu, 12 Sep 2013 07:05:08 +0000 (09:05 +0200)]
drm: Replace the i915 driver by i915kms

i915kms was already an updated version of i915, there's no need to
keep maintaining two separate instances of the same driver.

10 years agofortune - Add yet another prompt tip.
Antonio Huete Jimenez [Thu, 12 Sep 2013 12:13:53 +0000 (14:13 +0200)]
fortune - Add yet another prompt tip.

10 years agomxge: Adjust interrupt moderation and TSO burst parameters
Sepherosa Ziehau [Thu, 12 Sep 2013 07:54:05 +0000 (15:54 +0800)]
mxge: Adjust interrupt moderation and TSO burst parameters

- Increase TSO burst to 48000 (32 x 1500B)
- Reduce interrupt rate from 30000Hz to 6000Hz

10 years agoin6: Fix DoS on INET6 w/ SIOCSIFADDR or SIOCSIFDSTADDR
Sepherosa Ziehau [Thu, 12 Sep 2013 02:36:40 +0000 (10:36 +0800)]
in6: Fix DoS on INET6 w/ SIOCSIFADDR or SIOCSIFDSTADDR

For reference:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/netinet6/in6.c?rev=1.104&content-type=text/x-cvsweb-markup&only_with_tag=MAIN

DragonFly-bug: http://bugs.dragonflybsd.org/issues/2581

10 years agotools: Add TCP_SENDFILE test to tcp_stream
Sepherosa Ziehau [Thu, 12 Sep 2013 01:54:32 +0000 (09:54 +0800)]
tools: Add TCP_SENDFILE test to tcp_stream

10 years agoem.4: I217 and I218 are supported by emx
Sepherosa Ziehau [Thu, 12 Sep 2013 01:49:10 +0000 (09:49 +0800)]
em.4: I217 and I218 are supported by emx

10 years agobuild: mxge_lro.c is gone
Sepherosa Ziehau [Thu, 12 Sep 2013 01:45:16 +0000 (09:45 +0800)]
build: mxge_lro.c is gone

10 years agomxge: Sync w/ FreeBSD
Sepherosa Ziehau [Fri, 6 Sep 2013 06:50:24 +0000 (14:50 +0800)]
mxge: Sync w/ FreeBSD

- Update firmware
- Sync w/ FreeBSD if_mxge.c rev 254263

Local changes:
- Adjust output path a little bit:
  o  Utilize bus_dmamap_load_mbuf_defrag()
  o  Utilize the header length fields in mbuf pkthdr instead of
     peeking at the packet data
- Change TSO mode to NDIS mode
- Minor white space changes
- Nuke mxge_lro.c; we won't need it

10 years agovkernel64 - Add newline to the end of options files.
Antonio Huete Jimenez [Wed, 11 Sep 2013 20:55:03 +0000 (22:55 +0200)]
vkernel64 - Add newline to the end of options files.

Spotted by: swildner

10 years agoacpi.4: Remove some unneeded commas, too.
Sascha Wildner [Wed, 11 Sep 2013 19:27:45 +0000 (21:27 +0200)]
acpi.4: Remove some unneeded commas, too.

10 years agoacpi.4: Fix typo, Diabling -> Disabling
Sascha Wildner [Wed, 11 Sep 2013 19:24:20 +0000 (21:24 +0200)]
acpi.4: Fix typo, Diabling -> Disabling

10 years agoifnet - Compute iface statistics for NET_RT_IFLIST
Antonio Huete Jimenez [Tue, 10 Sep 2013 11:11:32 +0000 (04:11 -0700)]
ifnet - Compute iface statistics for NET_RT_IFLIST

  Before the ifnet statistics went per-cpu, they were being stored in
  ifnet->if_data. Some functions, like getifaddrs(3), expect them to
  be there so make sure they are available.

Reported by: Tim Bishop, Jens Rehsack