dragonfly.git
2 years agoBuild fixes.
Venkatesh Srinivas [Sat, 5 Jan 2013 17:40:37 +0000 (12:40 -0500)]
Build fixes.

2 years agokernel -- Tie virtio, virtio-blk into build.
Venkatesh Srinivas [Sat, 5 Jan 2013 16:41:38 +0000 (11:41 -0500)]
kernel -- Tie virtio, virtio-blk into build.

2 years agokernel/virtio: Some cleanup (Makefiles and gcc47 warnings).
Sascha Wildner [Wed, 2 Jan 2013 16:39:08 +0000 (17:39 +0100)]
kernel/virtio: Some cleanup (Makefiles and gcc47 warnings).

2 years agoRename vtblk_intr_task to vtblk_complete.
Venkatesh Srinivas [Tue, 25 Dec 2012 22:08:42 +0000 (17:08 -0500)]
Rename vtblk_intr_task to vtblk_complete.

2 years agokernel -- Import virtio & virtio-block drivers.
Venkatesh Srinivas [Mon, 24 Dec 2012 18:41:27 +0000 (13:41 -0500)]
kernel -- Import virtio & virtio-block drivers.

virtio-blk provides a paravirtualized storage controller, with one
disk per virtio device.

This driver is based on Tim Bisson's port of FreeBSD's virtio and
virtio-blk devices. Differences from Tim's port:

* Import all FreeBSD updates from 4/16 on.
* Remove indirect descriptor support from virtio device.
* Mark devices as D_MPSAFE; removes mplock around disk routines, they
  are all correctly self-synchronized.
* Implement devstat support.
* Move I/O completion routine to threaded taskqueue.
* Do not hold target spinlock around virtqueue notify.
* Move objcache caches to kmalloc.

2 years agoif: Move if_start_nmsg into ifaltq; prepare multiple TX queue support
Sepherosa Ziehau [Sun, 6 Jan 2013 12:01:27 +0000 (20:01 +0800)]
if: Move if_start_nmsg into ifaltq; prepare multiple TX queue support

While im here, also rename some functions to be consistent in naming
convention.

2 years agopktgen: Allow pktgenctl to specify # of packets to be queued onto TX queue
Sepherosa Ziehau [Sun, 6 Jan 2013 09:21:34 +0000 (17:21 +0800)]
pktgen: Allow pktgenctl to specify # of packets to be queued onto TX queue

2 years agoif: Move if_cpuid into ifaltq; prepare multiple TX queues support
Sepherosa Ziehau [Sat, 5 Jan 2013 13:55:26 +0000 (21:55 +0800)]
if: Move if_cpuid into ifaltq; prepare multiple TX queues support

if_cpuid and if_npoll_cpuid are merged and moved into ifaltq as
altq_cpuid, which indicates the owner CPU of the tx queue.  Since
we already have code in if_start_dispatch() to catching tx queue
owner CPU changes, this merging is quite safe.

2 years agokernel/netinet6: Remove some unused variables.
Sascha Wildner [Sat, 5 Jan 2013 12:27:50 +0000 (13:27 +0100)]
kernel/netinet6: Remove some unused variables.

2 years agokernel: Remove some unused variables in kern/, opencrypto/ and platform/.
Sascha Wildner [Sat, 5 Jan 2013 12:08:39 +0000 (13:08 +0100)]
kernel: Remove some unused variables in kern/, opencrypto/ and platform/.

2 years agokernel/disk: Remove some unused variables and add __debugvar.
Sascha Wildner [Sat, 5 Jan 2013 11:44:01 +0000 (12:44 +0100)]
kernel/disk: Remove some unused variables and add __debugvar.

2 years agokernel/dm: Remove some unused variables.
Sascha Wildner [Sat, 5 Jan 2013 11:21:47 +0000 (12:21 +0100)]
kernel/dm: Remove some unused variables.

Also start using a previously unused variable in dm_target_crypt.

2 years agoigb: Save TX interrupt CPUID into tx_ring struct
Sepherosa Ziehau [Sat, 5 Jan 2013 09:41:50 +0000 (17:41 +0800)]
igb: Save TX interrupt CPUID into tx_ring struct

This will be used to unify the ifnet.if_cpuid and ifnet.if_npoll_cpuid

2 years agojme: Always save TX interrupt CPUID
Sepherosa Ziehau [Sat, 5 Jan 2013 09:26:29 +0000 (17:26 +0800)]
jme: Always save TX interrupt CPUID

This will be used to unify the ifnet.if_cpuid and ifnet.if_npoll_cpuid

2 years agokernel/posix scheduling: Style, indentation, etc.
Sascha Wildner [Sat, 5 Jan 2013 03:32:05 +0000 (04:32 +0100)]
kernel/posix scheduling: Style, indentation, etc.

2 years agokernel: COMPAT_DF12 is valid for vkernel (32 bit) too.
Sascha Wildner [Sat, 5 Jan 2013 02:26:36 +0000 (03:26 +0100)]
kernel: COMPAT_DF12 is valid for vkernel (32 bit) too.

2 years agolibc - Add poor man's cache coloring optimization to nmalloc module.
Matthew Dillon [Fri, 4 Jan 2013 22:24:12 +0000 (14:24 -0800)]
libc - Add poor man's cache coloring optimization to nmalloc module.

* A series of large allocations in excess of 32KB will be offset by 4K from
  each other.  This fixes performance issues on SandyBridge and later cpus
  related to large matrix operations.

  This eats an extra 4K of VM for such allocations but does not eat any
  additional real memory.

* Greatly improves large FP matrix benchmarks.  Real-world effects are more
  questionable.

* The Sandybridge and later cpus use a virtually indexed, physically tagged
  L1 cache, and tend to be sensitive to substantially different memory
  addresses winding up on the same cache line.  Matrix operations (primarily
  benchmarks) can cause these sorts of effects.

Reported-by: alexh
2 years agolibc - Revert to nmalloc for now
Matthew Dillon [Fri, 4 Jan 2013 22:22:53 +0000 (14:22 -0800)]
libc - Revert to nmalloc for now

* Disable dmalloc on 64-bit systems, use nmalloc for everything for now.
  dmalloc appears to have some severe fragmentation and/or leak issues
  in long running programs (aka xulrunner) which are worse than nmalloc.

2 years agokernel: Remove some unused variables in gpio/spic/cardbus/ndis.
Sascha Wildner [Fri, 4 Jan 2013 02:23:10 +0000 (03:23 +0100)]
kernel: Remove some unused variables in gpio/spic/cardbus/ndis.

2 years agokernel: Remove some unused variables in netgraph/netgraph7.
Sascha Wildner [Fri, 4 Jan 2013 01:51:31 +0000 (02:51 +0100)]
kernel: Remove some unused variables in netgraph/netgraph7.

2 years agoStop removing bsd.port.*.mk via 'make upgrade'.
Sascha Wildner [Thu, 3 Jan 2013 23:24:20 +0000 (00:24 +0100)]
Stop removing bsd.port.*.mk via 'make upgrade'.

2 years agokernel: Remove some unused variables in bktr(4) and cxm(4).
Sascha Wildner [Thu, 3 Jan 2013 21:44:56 +0000 (22:44 +0100)]
kernel: Remove some unused variables in bktr(4) and cxm(4).

2 years agokernel: Remove unused variables in ACPI code (and add a __debugvar).
Sascha Wildner [Thu, 3 Jan 2013 21:23:37 +0000 (22:23 +0100)]
kernel: Remove unused variables in ACPI code (and add a __debugvar).

2 years agokernel: Move sys/dev/acpica5 to sys/dev/acpica.
Sascha Wildner [Thu, 3 Jan 2013 20:27:34 +0000 (21:27 +0100)]
kernel: Move sys/dev/acpica5 to sys/dev/acpica.

The 5 used to indicate that it was imported from FreeBSD 5 but that
doesn't matter anymore.

In-discussion-with: sephe

2 years agokernel: Remove some unused variables in network drivers.
Sascha Wildner [Thu, 3 Jan 2013 19:38:45 +0000 (20:38 +0100)]
kernel: Remove some unused variables in network drivers.

2 years agokprintf(9): Implement optional 'precision' for numbers.
Sascha Wildner [Thu, 3 Jan 2013 18:14:38 +0000 (19:14 +0100)]
kprintf(9): Implement optional 'precision' for numbers.

Previously, it was parsed but ignored. Some third-party modules
(e.g., APCICA) prefer this format over zero padding flag '0'.

Before this commit:

ACPI Warning: 32/64X FACS address mismatch in FADT - 0x3F611E40/0x       03F611D40, using 32 (20110527/tbfadt-589)

After this commit:

ACPI Warning: 32/64X FACS address mismatch in FADT - 0x3F611E40/0x000000003F611D40, using 32 (20110527/tbfadt-589)

Taken-from: FreeBSD (r209836 and r209949)

2 years agokernel: The NPX_DEBUG kernel option is pc32 specific, too.
Sascha Wildner [Thu, 3 Jan 2013 16:56:33 +0000 (17:56 +0100)]
kernel: The NPX_DEBUG kernel option is pc32 specific, too.

2 years agokernel: The COMPAT_DF12 kernel option is pc32 specific.
Sascha Wildner [Thu, 3 Jan 2013 16:46:42 +0000 (17:46 +0100)]
kernel: The COMPAT_DF12 kernel option is pc32 specific.

2 years agoif: if_start_need_schedule -> ifq_ifstart_need_schedule
Sepherosa Ziehau [Thu, 3 Jan 2013 12:14:19 +0000 (20:14 +0800)]
if: if_start_need_schedule -> ifq_ifstart_need_schedule

Consistent function naming as other related functions

2 years agoif: Add if_devstart_sched to schedule ifnet.if_start call
Sepherosa Ziehau [Thu, 3 Jan 2013 12:03:50 +0000 (20:03 +0800)]
if: Add if_devstart_sched to schedule ifnet.if_start call

Mainly to hide ifnet.if_start_nmsg from drivers, avoid code duplication
and ease upcoming multiple tx queues work.

2 years agoif: if_start_schedule -> ifq_ifstart_schedule
Sepherosa Ziehau [Thu, 3 Jan 2013 11:57:38 +0000 (19:57 +0800)]
if: if_start_schedule -> ifq_ifstart_schedule

The argument is changed to ifaltq; this eases further changes to
add multiple tx queues support.

2 years agoifq: Add ifq_get_stage to loacte proper altq_stage data
Sepherosa Ziehau [Thu, 3 Jan 2013 10:04:57 +0000 (18:04 +0800)]
ifq: Add ifq_get_stage to loacte proper altq_stage data

2 years agoifq: Add ifq_{is,set,clr}_started to access/modify altq_started
Sepherosa Ziehau [Thu, 3 Jan 2013 09:21:34 +0000 (17:21 +0800)]
ifq: Add ifq_{is,set,clr}_started to access/modify altq_started

2 years agoifq: Update comment in net/ifq_var.h
Sepherosa Ziehau [Thu, 3 Jan 2013 08:40:57 +0000 (16:40 +0800)]
ifq: Update comment in net/ifq_var.h

2 years agoif: Update IF_ macros comment
Sepherosa Ziehau [Thu, 3 Jan 2013 08:15:29 +0000 (16:15 +0800)]
if: Update IF_ macros comment

2 years agonet: Don't use IF_{EN,DE}QUEUE on ifnet.if_snd
Sepherosa Ziehau [Thu, 3 Jan 2013 07:23:06 +0000 (15:23 +0800)]
net: Don't use IF_{EN,DE}QUEUE on ifnet.if_snd

2 years agowi: Don't use IF_ macros on ifnet.if_snd
Sepherosa Ziehau [Thu, 3 Jan 2013 04:30:05 +0000 (12:30 +0800)]
wi: Don't use IF_ macros on ifnet.if_snd

2 years agode: Don't use IF_ macros on ifnet.if_snd
Sepherosa Ziehau [Thu, 3 Jan 2013 04:29:07 +0000 (12:29 +0800)]
de: Don't use IF_ macros on ifnet.if_snd

2 years agoral: Don't use IF_ macros on ifnet.if_snd
Sepherosa Ziehau [Thu, 3 Jan 2013 03:52:31 +0000 (11:52 +0800)]
ral: Don't use IF_ macros on ifnet.if_snd

2 years agoiwi: Dont' use IF_ macros on ifnet.if_snd
Sepherosa Ziehau [Thu, 3 Jan 2013 03:50:49 +0000 (11:50 +0800)]
iwi: Dont' use IF_ macros on ifnet.if_snd

2 years agonet: Don't use IF_DROP on ifnet.if_snd
Sepherosa Ziehau [Thu, 3 Jan 2013 03:37:14 +0000 (11:37 +0800)]
net: Don't use IF_DROP on ifnet.if_snd

2 years agoef: Don't use IF_ queue macros on ifnet.if_snd
Sepherosa Ziehau [Thu, 3 Jan 2013 03:29:34 +0000 (11:29 +0800)]
ef: Don't use IF_ queue macros on ifnet.if_snd

2 years agotun: Don't use IF_DROP on ifnet.if_snd
Sepherosa Ziehau [Thu, 3 Jan 2013 03:26:04 +0000 (11:26 +0800)]
tun: Don't use IF_DROP on ifnet.if_snd

2 years agonpx: Always embed saveymm in savefpu and remove dependency on opt_cpu.h
Sepherosa Ziehau [Thu, 3 Jan 2013 03:21:22 +0000 (11:21 +0800)]
npx: Always embed saveymm in savefpu and remove dependency on opt_cpu.h

- pcb and mdglobaldata size will not change depending on CPU_DISABLE_AVX
- Modules' makefiles need not to be modified (well, almost all modules)

2 years agox86_64/options: Indentation
Sepherosa Ziehau [Thu, 3 Jan 2013 03:21:04 +0000 (11:21 +0800)]
x86_64/options: Indentation

2 years agoif: Remove deprecated if_handoff and related macros
Sepherosa Ziehau [Thu, 3 Jan 2013 02:52:15 +0000 (10:52 +0800)]
if: Remove deprecated if_handoff and related macros

2 years agoppp: Don't use IF_HANDOFF, use IF_ENQUEUE instead.
Sepherosa Ziehau [Thu, 3 Jan 2013 02:51:40 +0000 (10:51 +0800)]
ppp: Don't use IF_HANDOFF, use IF_ENQUEUE instead.

This nukes the last reference of the IF_HANDOFF

2 years agonetgraph7/fec: Don't use IF_ macros on ifnet.if_snd
Sepherosa Ziehau [Thu, 3 Jan 2013 01:46:50 +0000 (09:46 +0800)]
netgraph7/fec: Don't use IF_ macros on ifnet.if_snd

2 years agoif: Remove IFF_POLLING from kernel space.
Sepherosa Ziehau [Thu, 3 Jan 2013 01:29:44 +0000 (09:29 +0800)]
if: Remove IFF_POLLING from kernel space.

User space macro is kept for compatibility.  Adjust comment a little bit.

2 years agox86_64 - support for AVX instructions
Alex Hornung [Sat, 29 Dec 2012 23:52:54 +0000 (23:52 +0000)]
x86_64 - support for AVX instructions

 * CPU will be checked for XSAVE and AVX support on boot. If both are
   found, they will be enabled.

 * If enabled, the kernel will use the XSAVE and XRSTOR instructions to
   save and restore FPU, SSE and AVX registers.

Originally-Submitted-by: Adam Sakareassen (with modifications)
2 years agoif: Move IFF_OACTIVE bit into ifaltq; prepare multiple TX queues support
Sepherosa Ziehau [Fri, 28 Dec 2012 09:31:10 +0000 (17:31 +0800)]
if: Move IFF_OACTIVE bit into ifaltq; prepare multiple TX queues support

ifaltq.altq_hw_oactive is now used to record that NIC's TX queue is full.
IFF_OACTIVE is removed from kernel.  User space IFF_OACTIVE is kept for
compability.

ifaltq.altq_hw_oactive should not be accessed directly.  Following set of
functions are provided and should be used:
ifq_is_oactive(ifnet.if_snd)  - Whether NIC's TX queue is full or not
ifq_set_oactive(ifnet.if_snd) - NIC's TX queue is full
ifq_clr_oactive(ifnet.if_snd) - NIC's TX queue is no longer full

2 years agoRemove some emacs variable settings.
Sascha Wildner [Wed, 2 Jan 2013 11:32:52 +0000 (12:32 +0100)]
Remove some emacs variable settings.

2 years agokernel -- ccd: Concatenated disk MPLOCK rework.
Venkatesh Srinivas [Wed, 2 Jan 2013 05:36:25 +0000 (00:36 -0500)]
kernel -- ccd: Concatenated disk MPLOCK rework.

* Remove freelist of ccdbuf structures; kmalloc is good enough for them,
  removes a global list.

* Rework ccdlock/ccdunlock to use a real lockmgr lock rather than a
  hand-rolled "lock" in the flags field.

* Mark ccd disk D_MPSAFE; calls disk strategy routines without the MPLOCK.

* Remove mplock from ccdiodone biodone callback; use ccdlock() on the
  softcontroller instead.

* Remove unneeded critical section around ccdstart and in ccdioctl.

* Remove mplock2.h.

* Remove cb_freenext linkage from ccd buffers.

2 years agomsgport.9: Adjust some comments to be <80 chars.
Sascha Wildner [Tue, 1 Jan 2013 22:25:24 +0000 (23:25 +0100)]
msgport.9: Adjust some comments to be <80 chars.

While here, rename NOTES to IMPLEMENTATION NOTES and move it to the
conventional place.

2 years agoBump copyright years.
Sascha Wildner [Mon, 31 Dec 2012 23:59:22 +0000 (00:59 +0100)]
Bump copyright years.

Happy new year, everyone!

2 years agoFix aio_* manual pages section in references to them.
Sascha Wildner [Mon, 31 Dec 2012 12:31:11 +0000 (13:31 +0100)]
Fix aio_* manual pages section in references to them.

2 years agoMake ng_fec compilable into the kernel and add it to the LINTs.
Sascha Wildner [Mon, 31 Dec 2012 11:03:04 +0000 (12:03 +0100)]
Make ng_fec compilable into the kernel and add it to the LINTs.

2 years agokernel/atm: Include <net/ifq_var.h> for ifq_set_max().
Sascha Wildner [Mon, 31 Dec 2012 11:02:59 +0000 (12:02 +0100)]
kernel/atm: Include <net/ifq_var.h> for ifq_set_max().

2 years agong_fec: Fix a typo and include <net/ifq_var.h> for ifq_set_maxlen().
Sascha Wildner [Mon, 31 Dec 2012 11:00:08 +0000 (12:00 +0100)]
ng_fec: Fix a typo and include <net/ifq_var.h> for ifq_set_maxlen().

2 years agoReinforce that make dports-replace does not update, but _replaces_ ./dports.
Justin C. Sherrill [Mon, 31 Dec 2012 03:02:05 +0000 (22:02 -0500)]
Reinforce that make dports-replace does not update, but _replaces_ ./dports.

2 years agoboot - Use ether_sprintf() where appropriate.
Antonio Huete Jimenez [Sat, 29 Dec 2012 16:58:59 +0000 (17:58 +0100)]
boot - Use ether_sprintf() where appropriate.

%D is non standard and it is going to be removed soon.

2 years agolibstand - Make ether_sprintf() public.
Antonio Huete Jimenez [Sat, 29 Dec 2012 10:17:27 +0000 (11:17 +0100)]
libstand - Make ether_sprintf() public.

* Use ETHER_ADDR_LEN for ethernet address length where
  appriopriate.

Pointed-out-by: swildner
2 years agoRevert "if_vke"
Antonio Huete Jimenez [Sat, 29 Dec 2012 20:17:44 +0000 (21:17 +0100)]
Revert "if_vke"

This reverts commit 8e3ef667d37ca26db190779e67073d6a16b47b88.

Wrong master branch pushed.

2 years agoif_vke
Antonio Huete Jimenez [Sat, 29 Dec 2012 17:07:56 +0000 (18:07 +0100)]
if_vke

2 years agore: RealTek8111F found in ASUS C60M1-I
YONETANI Tomokazu [Sat, 22 Dec 2012 13:10:04 +0000 (22:10 +0900)]
re: RealTek8111F found in ASUS C60M1-I

DragonFly-issue: http://bugs.dragonflybsd.org/issue2479

2 years agoem: Don't update TDT upon very packets transmitted
Sepherosa Ziehau [Fri, 28 Dec 2012 07:12:02 +0000 (15:12 +0800)]
em: Don't update TDT upon very packets transmitted

Merged following commits on emx(4):
7f32a9b0f8f25e43ab2ae4ee0d82ce69325d3b4b
0aba36eb844503423f414a3235eca72a78dc575a
b691889cfe23462069618f44bcf2ba0e71dcbb79

With following exception:
This optimization is not performed for 82547

2 years agopktgen: Pregenerate 3/4 of the ifq_maxlen should be enough
Sepherosa Ziehau [Fri, 28 Dec 2012 07:11:32 +0000 (15:11 +0800)]
pktgen: Pregenerate 3/4 of the ifq_maxlen should be enough

2 years agoigb: Fix comment
Sepherosa Ziehau [Fri, 28 Dec 2012 06:40:30 +0000 (14:40 +0800)]
igb: Fix comment

2 years agoemx: Fix comment
Sepherosa Ziehau [Fri, 28 Dec 2012 06:40:11 +0000 (14:40 +0800)]
emx: Fix comment

2 years agonetgraph7/iface: Use ifq_dispatch() instead of ifq_handoff()
Sepherosa Ziehau [Fri, 28 Dec 2012 03:48:32 +0000 (11:48 +0800)]
netgraph7/iface: Use ifq_dispatch() instead of ifq_handoff()

2 years agovlan: Use ifq_dispatch() instead of ifq_handoff()
Sepherosa Ziehau [Fri, 28 Dec 2012 03:47:55 +0000 (11:47 +0800)]
vlan: Use ifq_dispatch() instead of ifq_handoff()

2 years agoatm: Use ifq_dispatch() instead of ifq_handoff()
Sepherosa Ziehau [Fri, 28 Dec 2012 03:47:19 +0000 (11:47 +0800)]
atm: Use ifq_dispatch() instead of ifq_handoff()

2 years agoifq: Add ifq_purge_all(); currently it's same as ifq_purge()
Sepherosa Ziehau [Fri, 28 Dec 2012 03:08:35 +0000 (11:08 +0800)]
ifq: Add ifq_purge_all(); currently it's same as ifq_purge()

This paves the way for the multiple transmission queues support.

ifq_purge_all() is used when ALTQ packet scheduler is changed,
interface routing is changed and pseudo devices are closed.

2 years ago/usr/Makefile: Support dports and add error checking
John Marino [Wed, 26 Dec 2012 15:05:35 +0000 (16:05 +0100)]
/usr/Makefile: Support dports and add error checking

* Check for git before issuing git command
* Check if directories existing when expected for a target
* Check if directories do not exist when they shouldn't for a target
* Issue error messages when above criteria are not met
* Convert to prinf to make spacing changes easier in future
* Remove options from help screen that are currently invalid
  ("make" by itself now reflects only options that are valid at the time)
* Remove reference to cvs repositories, that's obsolete now
* Add "dports-create" option (full git repository cloned from github)
* Add "dports-create-shallow" option (Depth=1 repository github clone)
* Add "dports-update" option to pull latest from git repository
* Add "dports-download" option (Download tarball from github, extract)
  (Has benefit that dports can be installed without git on system).
* Add "dports-replace" option (When dports was previously installed from
  tarball, use the option to replace it by downloading and extracting
  newer tarball)
* general cleanup

2 years agoAdd native dports support
John Marino [Wed, 26 Dec 2012 15:13:39 +0000 (16:13 +0100)]
Add native dports support

DPorts, the ports building system tailored for Dragonfly,  requires
five bsd.*.mk scripts to be placed at /usr/share/mk in order to work
on DragonFly without any type of bootstrapping.

After installing dports using the /usr/Makefile script, any dport can
be built using the same instructions as FreeBSD (e.g. make install clean)

The resulting packages will be handled by "pkg", which will also be used
in the future for downloading prebuild binaries from an official
repository.

2 years agoifq: Move ifq_set_maxlen declaration to the declaration code block
Sepherosa Ziehau [Thu, 27 Dec 2012 12:42:24 +0000 (20:42 +0800)]
ifq: Move ifq_set_maxlen declaration to the declaration code block

2 years agoip6: Don't test ifq_len against ifq_maxlen; let IFQ make the decision
Sepherosa Ziehau [Thu, 27 Dec 2012 09:52:56 +0000 (17:52 +0800)]
ip6: Don't test ifq_len against ifq_maxlen; let IFQ make the decision

2 years agosctp: Don't test ifq_len against ifq_maxlen; let IFQ make the decision
Sepherosa Ziehau [Thu, 27 Dec 2012 09:52:21 +0000 (17:52 +0800)]
sctp: Don't test ifq_len against ifq_maxlen; let IFQ make the decision

2 years agoifq: Use ifq_set_maxlen for ifnet.if_snd
Sepherosa Ziehau [Thu, 27 Dec 2012 09:39:50 +0000 (17:39 +0800)]
ifq: Use ifq_set_maxlen for ifnet.if_snd

2 years agoifq/staging: Add comment about IFQ packet staging mechanism
Sepherosa Ziehau [Thu, 27 Dec 2012 03:20:48 +0000 (11:20 +0800)]
ifq/staging: Add comment about IFQ packet staging mechanism

2 years agoifq/staging: Remove debug code
Sepherosa Ziehau [Wed, 26 Dec 2012 12:29:29 +0000 (20:29 +0800)]
ifq/staging: Remove debug code

2 years agoifq/staging: Clean up IFQ packet staging resources
Sepherosa Ziehau [Wed, 26 Dec 2012 12:24:43 +0000 (20:24 +0800)]
ifq/staging: Clean up IFQ packet staging resources

- Make sure pending if_start scheduling IPIs are synchronized
- Make sure IFQ packets are no longer staged on any CPUs
- Free IFQ packet staging bookkeeping memory

2 years agoifq/staging: Increase ifq_maxlen a little bit for packets get staged
Sepherosa Ziehau [Tue, 25 Dec 2012 13:03:01 +0000 (21:03 +0800)]
ifq/staging: Increase ifq_maxlen a little bit for packets get staged

Increase ifq_maxlen by the amount that IFQ packet staging will take.

There are several places in the tree that if_snd.ifq_maxlen is set
directly instead of using ifq_set_maxlen().  These will be fixed in
some later commits.

2 years agoifq/staging: Perform IFQ packet staging for if_start scheduling
Sepherosa Ziehau [Mon, 24 Dec 2012 09:35:29 +0000 (17:35 +0800)]
ifq/staging: Perform IFQ packet staging for if_start scheduling

IFQ packets staging is now performed for ifnet's if_start scheduling,
i.e. if_start_schedule(), in addition to direct ifnet's if_start calling.

IFQ packets staging stopping condition
- if_start interlock (if_snd.altq_started) is not released.
is now changed to
- if_start_schedule() is not pending on the current CPU and if_start
  interlock (if_snd.altq_started) is not released.

By setting net.link.stage_cntmax to 8 and hw.igbX.tx_wreg_nsegs to 16,
following performance improvement is gained:
+80Kpps for normal IP forwarding
+30Kpps for fast IP forwarding

2 years agoif_start: Use if_start_schedule in if_start_dispatch
Sepherosa Ziehau [Mon, 24 Dec 2012 07:58:47 +0000 (15:58 +0800)]
if_start: Use if_start_schedule in if_start_dispatch

Ease further optimization.

2 years agopolling: Perform RX polling before TX polling
Sepherosa Ziehau [Mon, 24 Dec 2012 07:23:38 +0000 (15:23 +0800)]
polling: Perform RX polling before TX polling

2 years agoifq/staging: Initial implementation of IFQ packet staging mechanism
Sepherosa Ziehau [Sun, 23 Dec 2012 12:31:32 +0000 (20:31 +0800)]
ifq/staging: Initial implementation of IFQ packet staging mechanism

The packets enqueued into IFQ are staged to a certain amount before the
ifnet's if_start is called.  In this way, the driver could avoid writing
to hardware registers upon every packet, instead, hardware registers
could be written when certain amount of packets are put onto hardware
TX ring.  The measurement on several modern NICs (emx(4), igb(4), bnx(4),
bge(4), jme(4)) shows that the hardware registers writing aggregation
could save ~20% CPU time when 18bytes UDP datagrams are transmitted at
1.48Mpps.

IFQ packets staging is performed for direct ifnet's if_start calling,
i.e. ifq_try_ifstart()

IFQ packets staging will be stopped upon any of the following conditions:
- If the count of packets enqueued on the current CPU is great than or
  equal to ifq_stage_cntmax.
- If the total length of packets enqueued on the current CPU is great
  than or equal to the hardware's MTU - max_protohdr.  max_protohdr is
  cut from the hardware's MTU mainly bacause a full TCP segment's size
  is usually less than hardware's MTU.
- if_start interlock (if_snd.altq_started) is not released.
- The if_start_rollup(), which is registered as low priority netisr
  rollup function, is called; probably because no more work is pending
  for netisr.

Currently IFQ packet staging is only performed in netisr threads.

Inspired-by: Luigi Rizzo's netmap paper
    (http://info.iet.unipi.it/~luigi/netmap/)
Also-Suggested-by: dillon@
2 years agokernel/powernow: Remove two unused variables.
Sascha Wildner [Tue, 25 Dec 2012 23:00:38 +0000 (00:00 +0100)]
kernel/powernow: Remove two unused variables.

2 years agolibpthread: Add sem_timedwait().
Sascha Wildner [Tue, 25 Dec 2012 19:37:29 +0000 (20:37 +0100)]
libpthread: Add sem_timedwait().

It was commented out and I'm not sure why.

It needed a bit of adjustment to properly check the nanoseconds field but
with that, it passes all eleven tests of the Open POSIX Test Suite. Other
people (thesjg, vsrinivas) have tested and used it too in the past.

While here, also add a manual page (taken from FreeBSD).

In-discussion-with: vsrinivas

2 years agoaio_write.3: Bring back a bit that should not have been deleted.
Sascha Wildner [Tue, 25 Dec 2012 01:02:21 +0000 (02:02 +0100)]
aio_write.3: Bring back a bit that should not have been deleted.

2 years agokernel/clock: Remove some pointless #include/#ifdef.
Sascha Wildner [Tue, 25 Dec 2012 00:59:00 +0000 (01:59 +0100)]
kernel/clock: Remove some pointless #include/#ifdef.

2 years agoaio*.3: Some cleanup, wording improvement, etc.
Sascha Wildner [Mon, 24 Dec 2012 23:01:12 +0000 (00:01 +0100)]
aio*.3: Some cleanup, wording improvement, etc.

2 years agoMove AIO manual pages to librt.
Sascha Wildner [Mon, 24 Dec 2012 22:24:03 +0000 (23:24 +0100)]
Move AIO manual pages to librt.

While doing it, remove aio_waitcomplete(), as it has no librt (or POSIX)
counterpart.

2 years agolibrt/aio_cancel(): Set errno to EBADF if the fd is not valid.
Sascha Wildner [Mon, 24 Dec 2012 21:48:03 +0000 (22:48 +0100)]
librt/aio_cancel(): Set errno to EBADF if the fd is not valid.

2 years agokernel: Add CLOCK_THREAD_CPUTIME_ID
Fran├žois Tigeot [Sat, 22 Dec 2012 18:35:30 +0000 (19:35 +0100)]
kernel: Add CLOCK_THREAD_CPUTIME_ID

And make it usable with clock_gettime() and clock_getres()

With-advice-from: Sascha Wildner

2 years agoiscontrol(8): Remove some unneeded includes.
Sascha Wildner [Sat, 22 Dec 2012 20:27:12 +0000 (21:27 +0100)]
iscontrol(8): Remove some unneeded includes.

2 years agomount_ntfs(8): Remove old __FreeBSD_version checks.
Sascha Wildner [Sat, 22 Dec 2012 20:18:34 +0000 (21:18 +0100)]
mount_ntfs(8): Remove old __FreeBSD_version checks.

2 years agofwcontrol(8): Remove dead code.
Sascha Wildner [Sat, 22 Dec 2012 20:04:41 +0000 (21:04 +0100)]
fwcontrol(8): Remove dead code.

2 years agokernel/ndis: We want the ctx_list and oid for now.
Sascha Wildner [Sat, 22 Dec 2012 20:04:07 +0000 (21:04 +0100)]
kernel/ndis: We want the ctx_list and oid for now.

2 years agokernel/acpi: Fix #include, <sys/mutex.h> is not needed.
Sascha Wildner [Sat, 22 Dec 2012 19:58:43 +0000 (20:58 +0100)]
kernel/acpi: Fix #include, <sys/mutex.h> is not needed.