5 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

Pointed-out-by: swildner
5 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.

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

5 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

5 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):

With following exception:
This optimization is not performed for 82547

5 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

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

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

5 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()

5 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()

5 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()

5 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.

5 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

5 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

5 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

5 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

5 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

5 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

5 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

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

5 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

5 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.

5 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

5 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.

5 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

5 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

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
Also-Suggested-by: dillon@
5 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.

5 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

5 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.

5 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.

5 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.

5 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)

5 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.

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

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

With-advice-from: Sascha Wildner

5 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.

5 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.

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

5 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.

5 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.

5 years agomlx(4): Remove unused defines.
Sascha Wildner [Sat, 22 Dec 2012 19:35:35 +0000 (20:35 +0100)]
mlx(4): Remove unused defines.

5 years agokernel/iscsi: Do not conditionalize on undefined names.
Sascha Wildner [Sat, 22 Dec 2012 19:27:36 +0000 (20:27 +0100)]
kernel/iscsi: Do not conditionalize on undefined names.

5 years agokernel/procfs: Silence gcc47's whining.
Sascha Wildner [Sat, 22 Dec 2012 12:19:56 +0000 (13:19 +0100)]
kernel/procfs: Silence gcc47's whining.

5 years agoifq_dispatch: Avoid accessing the mbuf after it has been queued to if_snd
Sepherosa Ziehau [Sat, 22 Dec 2012 15:32:20 +0000 (23:32 +0800)]
ifq_dispatch: Avoid accessing the mbuf after it has been queued to if_snd

The enqueued mbuf could have be freed when it is used to update the stats.

5 years agoarcmsr(4): Add missing D_MPSAFE (forgot when porting).
Sascha Wildner [Fri, 21 Dec 2012 07:49:09 +0000 (08:49 +0100)]
arcmsr(4): Add missing D_MPSAFE (forgot when porting).

5 years agokernel/mmc: Remove an unused variable.
Sascha Wildner [Sat, 22 Dec 2012 11:40:20 +0000 (12:40 +0100)]
kernel/mmc: Remove an unused variable.

5 years agoarcmsr(4): Remove some dead code and an unused variable.
Sascha Wildner [Fri, 21 Dec 2012 07:20:11 +0000 (08:20 +0100)]
arcmsr(4): Remove some dead code and an unused variable.

Interrupts won't be enabled again in arcmsr_shutdown().

5 years agoifq_dispatch: If mbuf can't be enqueued and ifq has data; kick if_start
Sepherosa Ziehau [Fri, 21 Dec 2012 05:50:20 +0000 (13:50 +0800)]
ifq_dispatch: If mbuf can't be enqueued and ifq has data; kick if_start

5 years agoip_forward: Optimize out the mbuf allocation for ICMP messages
Sepherosa Ziehau [Fri, 21 Dec 2012 05:00:12 +0000 (13:00 +0800)]
ip_forward: Optimize out the mbuf allocation for ICMP messages

A per-netisr mbuf template is used to save the necessary information
for later ICMP messages; this avoids unnecessary mbuf allocation
on forwarding path.  The mbufs for ICMP messages are allocated only
when ICMP messages do need to be sent.

Inspired-by: OpenBSD ip_forward
5 years agoip_output: Don't drop packet based on if_snd queue length
Sepherosa Ziehau [Thu, 20 Dec 2012 08:29:19 +0000 (16:29 +0800)]
ip_output: Don't drop packet based on if_snd queue length

Later if_snd queue enqueuing should make this decision

5 years agoinstaller: Remove CAPS remains.
Sascha Wildner [Thu, 20 Dec 2012 04:54:44 +0000 (05:54 +0100)]
installer: Remove CAPS remains.

5 years agoshare/Makefile: Break at initial letter boundary and sort terminfo.
Sascha Wildner [Mon, 17 Dec 2012 19:05:03 +0000 (20:05 +0100)]
share/Makefile: Break at initial letter boundary and sort terminfo.

5 years agoinstaller: Use the LiveDVD's pfi.conf generally (works for LiveCD too).
Sascha Wildner [Mon, 17 Dec 2012 17:23:13 +0000 (18:23 +0100)]
installer: Use the LiveDVD's pfi.conf generally (works for LiveCD too).

5 years agoRevert "mknod(2): Restrict functionality to creating FIFOs."
Sascha Wildner [Thu, 20 Dec 2012 03:54:32 +0000 (04:54 +0100)]
Revert "mknod(2): Restrict functionality to creating FIFOs."

This reverts commit d5056fe0532f6e09c1c52b6384f3ef6e6db77a68.

After the commit, stuff like cpdup, tar, etc. used on dev would
start whining when before they would create the nodes, even
though they were not actually usable.

Since the potential breakage in external software is unknown, make
up my mind and go with the lower risk approach, even if it is kind
of pointless.

The mknod(8) utility is left deleted.

5 years agoRemove the mknod(8) utility.
Sascha Wildner [Thu, 20 Dec 2012 03:09:25 +0000 (04:09 +0100)]
Remove the mknod(8) utility.

Now that we have devfs(5), it's of no use anymore.

5 years agomknod(2): Restrict functionality to creating FIFOs.
Sascha Wildner [Thu, 20 Dec 2012 02:57:05 +0000 (03:57 +0100)]
mknod(2): Restrict functionality to creating FIFOs.

Now that we have devfs(5) for handling our device nodes, we can retire
part of mknod(2) functionality and restrict it to what POSIX requires:

"The only portable use of mknod() is to create a FIFO-special file.
 If mode is not S_IFIFO or dev is not 0, the behavior of mknod() is

In-discussion-with: beket

5 years agostandards.7: Add URLs for a couple of standards.
Sascha Wildner [Thu, 20 Dec 2012 02:26:49 +0000 (03:26 +0100)]
standards.7: Add URLs for a couple of standards.

5 years agomdoc: Add definition for XSH, Issue 4, Version 2.
Sascha Wildner [Thu, 20 Dec 2012 02:26:25 +0000 (03:26 +0100)]
mdoc: Add definition for XSH, Issue 4, Version 2.

5 years agotools/toeplitz: Force 0 padding in result printing
Sepherosa Ziehau [Wed, 19 Dec 2012 10:00:32 +0000 (18:00 +0800)]
tools/toeplitz: Force 0 padding in result printing

5 years agopktgenctl: Allow pktgen device to be specified
Sepherosa Ziehau [Wed, 19 Dec 2012 09:12:49 +0000 (17:12 +0800)]
pktgenctl: Allow pktgen device to be specified

5 years agopktgen: Create 4 device nodes by default
Sepherosa Ziehau [Wed, 19 Dec 2012 09:12:23 +0000 (17:12 +0800)]
pktgen: Create 4 device nodes by default

5 years agopktgen: This module is MPSAFE
Sepherosa Ziehau [Wed, 19 Dec 2012 09:07:21 +0000 (17:07 +0800)]
pktgen: This module is MPSAFE

While im here, nuke no longer needed CDEV_MAJOR

5 years agonetisr: Remove unused macros
Sepherosa Ziehau [Tue, 18 Dec 2012 13:53:12 +0000 (21:53 +0800)]
netisr: Remove unused macros

5 years agonetisr: Add priority for netisr "rollup" functions
Sepherosa Ziehau [Tue, 18 Dec 2012 13:47:39 +0000 (21:47 +0800)]
netisr: Add priority for netisr "rollup" functions

Higher priority "rollup" will be run first.  This mechanism auguments
the original "rollup" functionality which now could be used to implement
things like transmission packets aggregation and software TCP LRO.

5 years agopolling: Increase default polling rate to 6000Hz
Sepherosa Ziehau [Tue, 18 Dec 2012 09:38:51 +0000 (17:38 +0800)]
polling: Increase default polling rate to 6000Hz

This increases the bidirational normal IP forwarding rate by 30~40Kpps

5 years agoif_start: Fix indentation
Sepherosa Ziehau [Tue, 18 Dec 2012 08:26:46 +0000 (16:26 +0800)]
if_start: Fix indentation

5 years agoinstaller: Always take the root directory's /dev.
Sascha Wildner [Mon, 17 Dec 2012 21:13:38 +0000 (22:13 +0100)]
installer: Always take the root directory's /dev.

Taking /dev relative to the directory we want to copy from was fine
until we got devfs, because we shipped actual device nodes in /dev
until then.

It only continued working because the directory we copy from is always
the distribution media's root directory currently.

5 years agokernel/atm: Fix wrong rt_tables[] access.
Sascha Wildner [Mon, 17 Dec 2012 08:25:33 +0000 (09:25 +0100)]
kernel/atm: Fix wrong rt_tables[] access.

5 years agoif_start: Fix a race that could delay the packets transmission
Sepherosa Ziehau [Mon, 17 Dec 2012 04:18:08 +0000 (12:18 +0800)]
if_start: Fix a race that could delay the packets transmission

Since if_start_need_schedule is called w/ the cached IFF_OACTIVE out
side of ifnet's TX serializer, there could be a race that IFF_OACTIVE
could be cleared before if_start_need_schedule but after releasing
ifnet's TX serializer.  This could delay already queued packets
transmission until the new packet is coming.  Fix this race by calling
if_start_need_schedule inside ifnet's TX serializer.

5 years agoRemove VFS_INIT(9) manpage via 'make upgrade'.
Sascha Wildner [Sun, 16 Dec 2012 21:07:37 +0000 (22:07 +0100)]
Remove VFS_INIT(9) manpage via 'make upgrade'.

5 years agosglist.9: Add a missing include to the SYNOPSIS.
Sascha Wildner [Sun, 16 Dec 2012 20:37:55 +0000 (21:37 +0100)]
sglist.9: Add a missing include to the SYNOPSIS.

5 years agoRemove VFS_INIT.9 manual page, there is no such macro.
Sascha Wildner [Sun, 16 Dec 2012 18:38:39 +0000 (19:38 +0100)]
Remove VFS_INIT.9 manual page, there is no such macro.

5 years agoVFS_MOUNT.9: Adjust to the current state in /usr/src.
Sascha Wildner [Sun, 16 Dec 2012 18:30:57 +0000 (19:30 +0100)]
VFS_MOUNT.9: Adjust to the current state in /usr/src.

5 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sat, 15 Dec 2012 10:31:44 +0000 (11:31 +0100)]
Update the pciconf(8) database.

December 13, 2012 snapshot from http://pciids.sourceforge.net/

5 years agohammer2 - Split flush code out into its own source file
Matthew Dillon [Sat, 15 Dec 2012 07:26:08 +0000 (23:26 -0800)]
hammer2 - Split flush code out into its own source file

* Add hammer2_flush.c, move flush code into its own source file.

5 years agokernel - Fix buffer cache mismatch assertion (hammer)
Matthew Dillon [Fri, 14 Dec 2012 22:42:52 +0000 (14:42 -0800)]
kernel - Fix buffer cache mismatch assertion (hammer)

* Fix an issue where cluster_write() could instantiate buffers with
  the wrong buffer size.  Only effects HAMMER1 which uses two different
  buffer sizes for files.

* Bug could cause a mismatched buffer size assertion in the kernel.

5 years agolibkiconv: Remove unneeded SHLIBDIR in the Makefile.
Sascha Wildner [Fri, 14 Dec 2012 21:33:56 +0000 (22:33 +0100)]
libkiconv: Remove unneeded SHLIBDIR in the Makefile.

5 years agokernel - ufs softdep fix under heavy load
Matthew Dillon [Fri, 14 Dec 2012 21:05:00 +0000 (13:05 -0800)]
kernel - ufs softdep fix under heavy load

Fix is from OpenBSD ffs_softdep.c v1.79, originally from FreeBSD
ffs_softdep.c 1.196. Commit message from OpenBSD:

"due to ffs_sync not be able to sync some buffers here is another
instance of softdep code that must ensure proper syncing.
try harder to flush MKDIR_BODY dependancy if such still exists
during pagedep flush (that is by syncing first block of the dir)."

5 years agowlandebug.8: Don't reference manual pages which we don't have.
Sascha Wildner [Fri, 14 Dec 2012 16:59:38 +0000 (17:59 +0100)]
wlandebug.8: Don't reference manual pages which we don't have.

Instead, point at the tools directories in our tree.

5 years agopolling: Increase default rx.each_burst to 50
Sepherosa Ziehau [Fri, 14 Dec 2012 09:15:49 +0000 (17:15 +0800)]
polling: Increase default rx.each_burst to 50

With this default the CPU usage still could be throttled to the desired
value (rx.user_frac), it gives reasonable burst for modern systems and
number of empty RX polling is reduced.

5 years agopolling: Diverge each CPU's polling frequency a little bit (within 50Hz)
Sepherosa Ziehau [Fri, 14 Dec 2012 08:50:04 +0000 (16:50 +0800)]
polling: Diverge each CPU's polling frequency a little bit (within 50Hz)

This avoids possible thunder hurd effect on ifnet.if_snd's serializer.

5 years agohammer2 - bigger stabilization & performance pass
Matthew Dillon [Fri, 14 Dec 2012 07:23:21 +0000 (23:23 -0800)]
hammer2 - bigger stabilization & performance pass

* Fix additional namecache bogons that could result in a crash.

* Fix volume header synchronization.  It was possible for the voldata
  structure to be modified after its crc had been calculated but before
  its write.  A mount after a crash would then refuse to use the volume

* Each flush now iterates available volume header backups instead of
  just writing to block 0.  (The mount code selects the most recent
  valid volume header from available backups.  There is nothing special
  about the volume header in block 0).

* Fix volume header flush staging, the fsync of the device buffers
  was not ensuring a complete flush before synchronizing the volume

5 years agoipfw: Don't spam the log if dynamic rules allocation failed
Sepherosa Ziehau [Fri, 14 Dec 2012 05:05:43 +0000 (13:05 +0800)]
ipfw: Don't spam the log if dynamic rules allocation failed

There is high chance that kmalloc w/ M_NOWAIT fails; no need to bark

5 years agohammer2 - small stabilization & performance pass
Matthew Dillon [Fri, 14 Dec 2012 03:18:33 +0000 (19:18 -0800)]
hammer2 - small stabilization & performance pass

* Change a few bawrite()'s to bdwrite()'s to the bufdaemon can cluster
  the meta-data.  This greatly improves continuous flushes (e.g. when
  running blogbench).

* Fix a number of improper cache_setvp() calls which can cause the
  system to panic later.  Basically the vnode was being cleared without
  the namecache error getting set (to ENOENT).  Easiest solution is to
  just not call cache_setvp() for those cases in the first place and
  just leave the ncp unresolved.

5 years agopktgen: Clear ip.ip_sum before calling in_cksum_hdr()
Sepherosa Ziehau [Fri, 14 Dec 2012 01:45:51 +0000 (09:45 +0800)]
pktgen: Clear ip.ip_sum before calling in_cksum_hdr()

5 years agohammer2 - redo the flush collision handling
Matthew Dillon [Thu, 13 Dec 2012 23:26:28 +0000 (15:26 -0800)]
hammer2 - redo the flush collision handling

  flag now indicates a chain has been deleted (as in unlink, rmdir, truncate,
  etc) but could not be removed due to a conflicting flush.

  DELETED means something different from dropped chains with 0 refs which
  wind up sticking around due to the lastdrop code not being able to
  acquire a lock on the parent or colliding with a flush.  0-ref chains
  can be considered to cache clean media state when it comes down to it.
  (modified chains have a ref and so don't hit the lastdrop code).

* The flush code is now able to reliably unlock the chain parent when
  processing a child.

* Clean up a number of flush cases.

* Began to add error handling in the hammer2_chain_create() path.  The path
  now handles EAGAIN errors when insertions would collide with a flush.
  (The wait/retry code is currently just a sleep/retry).

* Removed the MAYDELETE junk.  It was too junky.


5 years agokernel: Remove USERFS.
Sascha Wildner [Thu, 13 Dec 2012 18:05:39 +0000 (19:05 +0100)]
kernel: Remove USERFS.

It's an old project of Matt, but won't be continued anymore.

Approved-by: dillon
5 years agohammer2 - Cleanup various races, better flush
Matthew Dillon [Thu, 13 Dec 2012 08:08:05 +0000 (00:08 -0800)]
hammer2 - Cleanup various races, better flush

* Cleanup various topological scan races

* Temporarily release the parent lock when diving a child.

* Start work on a chain movement (disconnect from parent) interlock,
  which we need for stability during flushes, renames, and hardlink
  operations.  This will likely be rewritten.

5 years agokernel - Fix sync() system call
Matthew Dillon [Thu, 13 Dec 2012 07:19:43 +0000 (23:19 -0800)]
kernel - Fix sync() system call

* The sync() system call was syncing the filesystems MNT_NOWAIT | MNT_LAZY.
  We need the MNT_NOWAIT to avoid an endless sync on a busy filesystem, but
  MNT_LAZY is another issue entirely.

* Remove the MNT_LAZY from the sync() system call, it can cause whole
  files to not be synced.  It is meant only to be used by the automatic
  kernel 30-second sync (which eventually gets everything flushed out).

5 years agothread: Add td_type field; this avoids blowout td_flags w/ type flags
Sepherosa Ziehau [Thu, 13 Dec 2012 06:12:16 +0000 (14:12 +0800)]
thread: Add td_type field; this avoids blowout td_flags w/ type flags

- All lwkt threads are created as TD_TYPE_GENERIC
- Netisr threads now mark themselves as TD_TYPE_NETISR

Discussed-with: sjg@ and dillon@
Approved-by: dillon@
5 years agokernel - Fix missing B_ORDERED inheritance
Matthew Dillon [Thu, 13 Dec 2012 04:09:45 +0000 (20:09 -0800)]
kernel - Fix missing B_ORDERED inheritance

* The cluster code was not inheriting B_ORDERED on buffers when constructing
  the rollup buffer due to a coding error.

* I don't think anything uses B_ORDERED so this shouldn't matter, but fix
  it anyway.

Reported-by: vsrinivas
5 years agokernel -- ffs: ufs_ihash may not match for vnode recycling reasons.
Venkatesh Srinivas [Wed, 12 Dec 2012 20:17:50 +0000 (12:17 -0800)]
kernel -- ffs: ufs_ihash may not match for vnode recycling reasons.

* vnode recycling may cause VGET to not find an inode; handle the
  race as before, it was not a bug.

* print diradd pointer in ffs MKDIR_BODY panics; will help finding
  the panic, it is masked by the inode hash panic.

Reviewed-by: sjg
5 years agoRemove upc_{control,register} syscalls and everything that has to do with it.
Sascha Wildner [Wed, 12 Dec 2012 20:40:16 +0000 (21:40 +0100)]
Remove upc_{control,register} syscalls and everything that has to do with it.

It's no longer used for anything.

Requested-by: vsrinivas
Approved-by: dillon
5 years agobce: Disable RX max BDs based interrupt moderation
Sepherosa Ziehau [Tue, 11 Dec 2012 11:20:17 +0000 (19:20 +0800)]
bce: Disable RX max BDs based interrupt moderation

The RX max coalesce BDs is limited to 255, which means that the chip will
generate ~5800 interrupts/s when it sinks 1.48Mpps tiny packets.  However,
interrupt rate at 4500Hz is already enough for the chip to sink 1.48Mpps
tiny packets, so ticks based RX interrupt moderation should be prefered.

5 years agokernel/makesyscalls.sh: Fix copy/paste error.
Sascha Wildner [Wed, 12 Dec 2012 06:01:08 +0000 (07:01 +0100)]
kernel/makesyscalls.sh: Fix copy/paste error.

Reported-by: vsrinivas
5 years agokernel/makesyscalls.sh: Improve comment and regenerate all affected files.
Sascha Wildner [Tue, 11 Dec 2012 22:29:52 +0000 (23:29 +0100)]
kernel/makesyscalls.sh: Improve comment and regenerate all affected files.

5 years agokernel/makesyscalls.sh: Output a friendlier comment about how to regenerate.
Sascha Wildner [Tue, 11 Dec 2012 22:19:43 +0000 (23:19 +0100)]
kernel/makesyscalls.sh: Output a friendlier comment about how to regenerate.

5 years agokernel - Reduce the size of the callout wheel
Matthew Dillon [Mon, 10 Dec 2012 23:11:46 +0000 (15:11 -0800)]
kernel - Reduce the size of the callout wheel

* The callout wheel is per-cpu but ncallout is calculated based on memory.
  A system with many cpus tended to allocate an excessive amount of memory
  in aggregate for the callout wheels.

* Reduce the size of the per-cpu callout wheel by approximately a factor
  of (ncpus).  On a 16G machine with 8 cores, aggregate callout wheel
  allocations is reduced from 128MB to 16MB.

5 years agokernel - Fix softupdates panic with UFS
Matthew Dillon [Mon, 10 Dec 2012 23:02:01 +0000 (15:02 -0800)]
kernel - Fix softupdates panic with UFS

* If getdirtybuf() was unable to lookup a dirty buffer from the
  flush_pagedep_deps path, we need to retry the lookup, rather than
  proceeding through processing the diradd.

Reported-by: marino@
Submitted-by: vsrinivas
5 years agokernel - Remove unnecessary mplock from ata I/O path
Matthew Dillon [Mon, 10 Dec 2012 22:59:38 +0000 (14:59 -0800)]
kernel - Remove unnecessary mplock from ata I/O path

* ata_finish() doesn't need the MP Lock; moving it from taskqueue_swi
  to taskqueue_swi_mp will make sure it's not taken.

* Note that taskqueue_swi(_mp) will be processed when this ithread
  attempts to switch back to the thread it preempted. This means that
  taskqueue_swi(_mp) processing exclude processing further interrupts
  on the ithread while they're running. This may not be desirable and
  is different than taskqueue_swi / swi_* / setsoft* in FreeBSD 4.x.

Submitted-by: vsrinivas
5 years agokernel - Make UFS ihash table per-mount
Matthew Dillon [Mon, 10 Dec 2012 22:55:59 +0000 (14:55 -0800)]
kernel - Make UFS ihash table per-mount

* Make the UFS ihash table per-mount.

* Scale down the size of the hash table a bit so we have ~4 inodes per
  bucket instead of ~1.  Works fine for a single mount and this way
  multiple UFS mounts don't make [as] bloated kmalloc calls.

Submitted-by: vsrinivas