dragonfly.git
2 years agohammer2 - SPAN protocol work
Matthew Dillon [Thu, 9 Aug 2012 01:32:16 +0000 (18:32 -0700)]
hammer2 - SPAN protocol work

* Because we allow loops in the graph the loss of a feeder node can
  result in a tail-chasing loop of SPAN updates with an ever-growing
  distance parameter.

  To deal with this a spanning tree distance limit is required, beyond
  which no propagation occurs which terminates the chase.  The tail
  then catches up to the head and the node is finally removed from
  the spanning tree entirely.

  This fixes the propagation of spanning tree deletions e.g. when we
  umount a HAMMER2 PFS.

* Fix a state insertion bug.  A structure was being inserted into the
  red-black tree before the required fields were being initialized.
  Corrects a SPAN propagation fault.

2 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Thu, 9 Aug 2012 01:32:06 +0000 (18:32 -0700)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

2 years agocut(1): Add back -w (split on whitespace functionality).
Sascha Wildner [Thu, 9 Aug 2012 00:56:25 +0000 (02:56 +0200)]
cut(1): Add back -w (split on whitespace functionality).

Reported-by: Tim Darby <t+dfbsd@timdarby.net>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2385>

2 years agohammer2 - userland API / span work
Matthew Dillon [Wed, 8 Aug 2012 22:04:50 +0000 (15:04 -0700)]
hammer2 - userland API / span work

* Fix a stall bug in the streaming write code

* Add some pretty-printing support for debug output.  Also remove
  a ton of debug messages.

* Add a remote shell 'tree' command to dump the spanning tree.

* Cleanup some of the state handling and error codes.

2 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Wed, 8 Aug 2012 22:04:02 +0000 (15:04 -0700)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

2 years agocut: Sync with FreeBSD
John Marino [Wed, 8 Aug 2012 21:22:08 +0000 (23:22 +0200)]
cut: Sync with FreeBSD

Addresses:
http://bugs.dragonflybsd.org/issues/2385
reported-by: Tim Darby

2 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Wed, 8 Aug 2012 16:29:57 +0000 (09:29 -0700)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

2 years agohpt27xx(4): Use NULL for pointers.
Sascha Wildner [Wed, 8 Aug 2012 13:42:58 +0000 (15:42 +0200)]
hpt27xx(4): Use NULL for pointers.

2 years agoAdd the hpt27xx(4) driver for HighPoint RocketRAID 27xx SAS controllers.
Sascha Wildner [Wed, 8 Aug 2012 12:18:22 +0000 (14:18 +0200)]
Add the hpt27xx(4) driver for HighPoint RocketRAID 27xx SAS controllers.

The manual page mentions the following adapters to be supported:

* RocketRAID 271x
* RocketRAID 272x
* RocketRAID 274x
* RocketRAID 276x
* RocketRAID 278x

I have tested it with a RocketRAID 2720.

Taken-from: FreeBSD

2 years agobnx: Disable RX max BDs based interrupt moderation
Sepherosa Ziehau [Wed, 8 Aug 2012 13:11:11 +0000 (21:11 +0800)]
bnx: 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 4000Hz is already enough for the chip to sink 1.48Mpps
tiny packets, so ticks based RX interrupt moderation should be prefered.

2 years agobnx: Allow TX/RX max coalesce BDs to be 0; mainly for debugging
Sepherosa Ziehau [Wed, 8 Aug 2012 11:11:03 +0000 (19:11 +0800)]
bnx: Allow TX/RX max coalesce BDs to be 0; mainly for debugging

2 years agobnx: Correct debug messages
Sepherosa Ziehau [Wed, 8 Aug 2012 08:35:53 +0000 (16:35 +0800)]
bnx: Correct debug messages

2 years agobnx: Rearrange the code to check the spare TX descripors first
Sepherosa Ziehau [Wed, 8 Aug 2012 08:11:11 +0000 (16:11 +0800)]
bnx: Rearrange the code to check the spare TX descripors first

While im here, remove the useless fragmentation checksum code, which
is never supported by this driver

2 years agobnx: Increase spare TX descriptors to 33 to incorporate TSO segment
Sepherosa Ziehau [Wed, 8 Aug 2012 07:53:30 +0000 (15:53 +0800)]
bnx: Increase spare TX descriptors to 33 to incorporate TSO segment

2 years agoemx: emx_timer() only requires main serializer
Sepherosa Ziehau [Wed, 8 Aug 2012 05:31:56 +0000 (13:31 +0800)]
emx: emx_timer() only requires main serializer

2 years agoem/emx: Fix up detach path
Sepherosa Ziehau [Wed, 8 Aug 2012 05:21:20 +0000 (13:21 +0800)]
em/emx: Fix up detach path

- We could release management control only if PCI BAR is mapped
- Release multicase array memory

2 years agohammer2 - SPAN protocol work
Matthew Dillon [Wed, 8 Aug 2012 04:28:40 +0000 (21:28 -0700)]
hammer2 - SPAN protocol work

* Initial implementation of the LNK_SPAN protocol between two hammer
  service daemons running on different machines.  There's still lots to do.

  mount x P PFSs (P pipes) (machine A)
|
  service daemon  (machine A) (handling P + 1 connections)
|
  INET SOCKET
|
  service daemon (machine B) (handling Q + 1 connections)
|
  mount x Q PFSs (Q pipes) (machine B)

* Service deamons starts with LNK_CONN and then interconnect SPANs.

* SPAN protocol allows any number of connections between services daemons and
  from service daemons to physical HAMMER2 mounts.

* Fixed a message write() sequencing bug

* Added some additional debug directives, and also added a remote debug
  directive to connect from one already-running service daemon to another.

2 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Wed, 8 Aug 2012 04:28:02 +0000 (21:28 -0700)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

2 years agoemx: Increase spare TX descriprors to 33 incorporate TSO segment
Sepherosa Ziehau [Wed, 8 Aug 2012 04:18:26 +0000 (12:18 +0800)]
emx: Increase spare TX descriprors to 33 incorporate TSO segment

2 years agoemx: Make sure that mbuf is changed before busdma sync
Sepherosa Ziehau [Wed, 8 Aug 2012 04:09:51 +0000 (12:09 +0800)]
emx: Make sure that mbuf is changed before busdma sync

This should not be problem for emx, since it does not have any
busdma constraint thus no effective busdma sync will happen.

2 years agoigb: Make sure that mbuf is changed before busdma sync
Sepherosa Ziehau [Wed, 8 Aug 2012 03:49:41 +0000 (11:49 +0800)]
igb: Make sure that mbuf is changed before busdma sync

This should not be problem for igb, since it does not have any
busdma constraint thus no effective busdma sync will happen.

2 years agoalc: Stablize this driver and fix various porting overlooks
Sepherosa Ziehau [Mon, 6 Aug 2012 12:15:15 +0000 (20:15 +0800)]
alc: Stablize this driver and fix various porting overlooks

- Use ifnet serializer to protect driver data.  This should fix the
  various panics that were observed on the network output path.
- Fix busdma setup.
- Always allocate the descriptor rings and status blocks at the lower
  4GB.  The original way will require the RX/TX bufs to be located at
  the lower 4GB, which is a great waste of bounce buffers, cpu cycles
  and memory bandwidth.
- Don't mess up M_PKTHDR on RX path.
- Allocate mbuf w/ MB_WAIT on initialization path.
- Enable MSI by default.

2 years agohammer2 - more userland msg API work
Matthew Dillon [Tue, 7 Aug 2012 23:15:48 +0000 (16:15 -0700)]
hammer2 - more userland msg API work

* Simplify the messaging API further.

* Add a state function callback for state machine transitions

* Open a LNK_CONN transaction on connect, allowing daemon<->daemon spanning
  tree operation (untested).

2 years agohammer2 - Correct state recording bugs in vfs
Matthew Dillon [Tue, 7 Aug 2012 23:15:12 +0000 (16:15 -0700)]
hammer2 - Correct state recording bugs in vfs

* Correct similar bugs in the vfs that were present in the userland code.

2 years agohammer2 - Add pfs-fsid, pfs-clid directive
Matthew Dillon [Tue, 7 Aug 2012 21:22:15 +0000 (14:22 -0700)]
hammer2 - Add pfs-fsid, pfs-clid directive

* Add commands to retrieve specific uuid's for named PFSs.

2 years agohammer2 - spanning tree and messaging work
Matthew Dillon [Tue, 7 Aug 2012 19:40:24 +0000 (12:40 -0700)]
hammer2 - spanning tree and messaging work

* Fix numerous bugs and cleanup the messaging infrastructure further.

  Fix issues with state tracking and incorrect message flags, assert that
  flags are correct.

* Fix issues with connection termination.  All active transactions must be
  completely closed from both ends before the iocom can be destroyed.

  Fix bugs in the MSGF_DELETE message simulator when a socket error occurs
  (simulating the other end closing any active transactions going over
  the iocom).

* Implement the spanning tree relay code.  The relay code is even relatively
  optimal though ultimately we need to add additional filters to make
  client<->service rendezvous's less cpu intensive.

2 years agohammer2 - Adjust LNK_SPAN/LNK_CONN
Matthew Dillon [Tue, 7 Aug 2012 19:38:33 +0000 (12:38 -0700)]
hammer2 - Adjust LNK_SPAN/LNK_CONN

* Adjust the SPAN and CONN structures, rename 'weight' to 'dist' (for
  distance).

2 years agohammer2 - add HAMMER2IOC_PFS_LOOKUP
Matthew Dillon [Tue, 7 Aug 2012 19:37:53 +0000 (12:37 -0700)]
hammer2 - add HAMMER2IOC_PFS_LOOKUP

* Add the HAMMER2IOC_PFS_LOOKUP ioctl which looks up a specific PFS
  by name.

2 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Tue, 7 Aug 2012 19:37:18 +0000 (12:37 -0700)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

2 years agoncurses: Fix pkgsrc check and use of ncurses
John Marino [Tue, 7 Aug 2012 11:35:26 +0000 (13:35 +0200)]
ncurses: Fix pkgsrc check and use of ncurses

Without the macro SET_NEED_WCHAR_H defined, the ncurses header will not
include wchar.h which is where the wint_t type is defined.  This breaks
any program loading ncurses.h without defining this macro because several
functions use the wint_t type.

Define wint_t as int if wchar.h isn't included.  This fixes the ncurses
check on several pkgsrc configuration checks and allows the package to
build with the system ncurses.

2 years agoarcmsr(4): Use cam_calc_geometry().
Sascha Wildner [Tue, 7 Aug 2012 07:19:35 +0000 (09:19 +0200)]
arcmsr(4): Use cam_calc_geometry().

2 years agompt(4): Fix a porting mistake I did in 6d259fc1.
Sascha Wildner [Tue, 7 Aug 2012 07:16:38 +0000 (09:16 +0200)]
mpt(4): Fix a porting mistake I did in 6d259fc1.

I left in both the code of the "#if __FreeBSD_version" as well as that of
its "#else". This caused the geometry to be calculated twice.

2 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Tue, 7 Aug 2012 06:37:21 +0000 (23:37 -0700)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

2 years agokernel/dsched: Add a version parameter to the DSCHED_POLICY_MODULE macro.
Sascha Wildner [Tue, 7 Aug 2012 01:31:59 +0000 (03:31 +0200)]
kernel/dsched: Add a version parameter to the DSCHED_POLICY_MODULE macro.

2 years agohptmv(4): Use cam_calc_geometry().
Sascha Wildner [Tue, 7 Aug 2012 01:25:51 +0000 (03:25 +0200)]
hptmv(4): Use cam_calc_geometry().

Also add a dependency on cam(4).

Taken-from: FreeBSD

2 years agohptiop(4): Add some more PCI IDs.
Sascha Wildner [Tue, 7 Aug 2012 01:03:31 +0000 (03:03 +0200)]
hptiop(4): Add some more PCI IDs.

The following adapters were added:

RocketRAID 4210
RocketRAID 4211
RocketRAID 4310
RocketRAID 4311
RocketRAID 3530
RocketRAID 3560

This commit also adds a cam(4) dependency.

Taken-from: FreeBSD

2 years agolibc/rpc: Remove redundant check.
Sascha Wildner [Mon, 6 Aug 2012 13:56:12 +0000 (15:56 +0200)]
libc/rpc: Remove redundant check.

2 years agokernel/x86_64: Fix kernel build without DDB.
Sascha Wildner [Mon, 6 Aug 2012 13:53:41 +0000 (15:53 +0200)]
kernel/x86_64: Fix kernel build without DDB.

Reported-by: nant
2 years agohammer2 - Flesh out span code, API cleanups
Matthew Dillon [Sat, 4 Aug 2012 22:11:40 +0000 (15:11 -0700)]
hammer2 - Flesh out span code, API cleanups

* Cleanup the transactional APIs and add a few functions to help with
  simple (error code only) message replies.

* Better message protocol layering for both the kernel and userland code.

* Kernel now opens a LNK_CONN transaction which will enable the SPAN
  protocol on the link and also serve to install a PFS filter (which is
  not yet implemented).

  Upon success the kernel then initiates the SPAN.

  Basically for the kernel:

send LNK_CONN
wait for streaming reply (transaction remains open on both sides)
send LNK_SPAN

TODO: Receive/track LNK_SPANs, each representing a virtual circuit.

TODO: Track LNK_SPANs that match our PFS.

TODO: Issue higher level protocol transaction messages over these
      circuits based on VNOPS, caching, mirroring, etc.
      (transactional failures can occur when the LNK_SPAN state
      changes, forcing a retry, etc).

* Userland now accepts the LNK_CONN and uses the open transaction to
  install tracking structures for those connections participating in
  the SPAN protocol.

* Userland now installs tracking structures for received SPAN messages.

* Start fleshing out the userland side of the SPAN relay/transmit code.
  This will involve yet more structures to track which SPANs are being
  relayed over each connection, so changes can be propagated (not yet
  implemented).

  For userland the TODO is very large so no point iterating it here.

* Kernel now accepts DBG_SHELL replies (basically debug output messages)
  and will kprintf() them.  DBG_SHELL commands not yet accepted by the
  kernel.

2 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Sat, 4 Aug 2012 22:06:57 +0000 (15:06 -0700)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

2 years agoAnsify some function definitions that were previously overlooked.
Sascha Wildner [Sat, 4 Aug 2012 10:29:28 +0000 (12:29 +0200)]
Ansify some function definitions that were previously overlooked.

2 years agohptrr(4): Add a __printflike().
Sascha Wildner [Sat, 4 Aug 2012 09:11:21 +0000 (11:11 +0200)]
hptrr(4): Add a __printflike().

2 years agoMerge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Sat, 4 Aug 2012 02:57:58 +0000 (19:57 -0700)]
Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2

2 years agoopen.2: Fix .Dv and combine lines.
Sascha Wildner [Fri, 3 Aug 2012 21:27:39 +0000 (23:27 +0200)]
open.2: Fix .Dv and combine lines.

2 years agomdoc.local: Add FreeBSD 7.3 and 8.1 which we are referencing.
Sascha Wildner [Fri, 3 Aug 2012 20:51:27 +0000 (22:51 +0200)]
mdoc.local: Add FreeBSD 7.3 and 8.1 which we are referencing.

2 years agohptrr.4: Move the tunable info into its own section and improve wording.
Sascha Wildner [Fri, 3 Aug 2012 20:29:02 +0000 (22:29 +0200)]
hptrr.4: Move the tunable info into its own section and improve wording.

2 years agoamr.4: Add missing .Bd
Sascha Wildner [Fri, 3 Aug 2012 20:28:24 +0000 (22:28 +0200)]
amr.4: Add missing .Bd

2 years agodisklabel32/64: Add support for 'T' size specifier.
Sascha Wildner [Fri, 3 Aug 2012 19:45:49 +0000 (21:45 +0200)]
disklabel32/64: Add support for 'T' size specifier.

2 years agoSync zoneinfo database with tzdata2012e from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Fri, 3 Aug 2012 10:20:15 +0000 (12:20 +0200)]
Sync zoneinfo database with tzdata2012e from ftp://ftp.iana.org/tz/releases

* australasia (Pacific/Fakaofo): Tokelau is UTC+13, not UTC+14.
    (Thanks to Steffen Thorsen.)

2 years agokernel: add a flags argument to LOCK_SYSINIT
François Tigeot [Fri, 3 Aug 2012 09:23:11 +0000 (11:23 +0200)]
kernel: add a flags argument to LOCK_SYSINIT

We may not want to use LK_CAN_RECURSE in all situations

2 years agobnx: Remove unused code
Sepherosa Ziehau [Fri, 3 Aug 2012 07:57:43 +0000 (15:57 +0800)]
bnx: Remove unused code

2 years agokernel: add a LOCK_SYSINIT helper macro
François Tigeot [Fri, 22 Jun 2012 13:55:49 +0000 (15:55 +0200)]
kernel: add a LOCK_SYSINIT helper macro

* Inspired from FreeBSD's MTX_SYSINIT

* This will help with driver porting

2 years agokernel: Fix kernel build when compiled without INVARIANTS.
Nuno Antunes [Fri, 3 Aug 2012 06:27:52 +0000 (07:27 +0100)]
kernel: Fix kernel build when compiled without INVARIANTS.

2 years agoAdd the hptrr(4) driver for HighPoint RocketRAID 17xx, 22xx, 23xx and 25xx.
Sascha Wildner [Fri, 3 Aug 2012 00:18:34 +0000 (02:18 +0200)]
Add the hptrr(4) driver for HighPoint RocketRAID 17xx, 22xx, 23xx and 25xx.

The manual page mentions the following adapters to be supported:

* RocketRAID 172x series
* RocketRAID 174x series
* RocketRAID 2210
* RocketRAID 222x series
* RocketRAID 2240
* RocketRAID 230x series
* RocketRAID 231x series
* RocketRAID 232x series
* RocketRAID 2340
* RocketRAID 2522

I have tested it with a RocketRAID 2300.

Taken-from: FreeBSD

2 years agohptmv(4): Reduce si_iosize_max to 64KB.
Sascha Wildner [Thu, 2 Aug 2012 22:42:39 +0000 (00:42 +0200)]
hptmv(4): Reduce si_iosize_max to 64KB.

This fixes busdma panics we were getting with it.

busdma-clue-by: sephe

2 years agokernel/cam: Make si_iosize_max overridable by drivers.
Sascha Wildner [Thu, 2 Aug 2012 22:14:28 +0000 (00:14 +0200)]
kernel/cam: Make si_iosize_max overridable by drivers.

2 years agohptmv.4: Improve wording and s/amd64/x86_64/
Sascha Wildner [Fri, 3 Aug 2012 00:28:19 +0000 (02:28 +0200)]
hptmv.4: Improve wording and s/amd64/x86_64/

2 years agocustomcc: Fix the setup of the /usr/include path to use.
Sascha Wildner [Thu, 2 Aug 2012 17:16:08 +0000 (19:16 +0200)]
customcc: Fix the setup of the /usr/include path to use.

With the recent O_DIRECTORY addition, this apparent bug in the script was
exposed. Using -isysroot/-isystem doesn't seem to cut it for what we want
here (which is to completely override the /usr/include path).

I didn't verify in 100% detail, but all evidence looks like the reason is
that when -I is present on the command line, the paths of the headers
which are included by headers from this directory are not prefixed with
-isysroot's argument.

So for now, use -iprefix and -iwithbeforeprefix for /usr/include, which
seem to do what we want.

While here, add our copyright.

Reported-by: marino
2 years agoigb: Add TSO support
Sepherosa Ziehau [Thu, 2 Aug 2012 13:38:51 +0000 (21:38 +0800)]
igb: Add TSO support

2 years agoigb: Change TXCSUM does not require reinitialize hardware
Sepherosa Ziehau [Thu, 2 Aug 2012 11:59:27 +0000 (19:59 +0800)]
igb: Change TXCSUM does not require reinitialize hardware

2 years agoigb: Utilize mbuf's header length to setup TX context
Sepherosa Ziehau [Thu, 2 Aug 2012 11:53:07 +0000 (19:53 +0800)]
igb: Utilize mbuf's header length to setup TX context

While im here, also fix the case that VLAN hardware tagging is enabled
but IP checksum offloading is not enable.

2 years agostatclock: Fix intr% counting on heavily interrupted systems
Sepherosa Ziehau [Thu, 2 Aug 2012 09:26:30 +0000 (17:26 +0800)]
statclock: Fix intr% counting on heavily interrupted systems

statclock() has high probability to run from crit_exit() on heavily
interrupted systems and 'frame' is NULL in this case, so intr% is
mis-counted as sys%.

To fix this, TDF_INTTHREAD is used to determine whether intr% should
be counted or not, in addition to testing gd_intr_nest_level and
'frame'

2 years agoem/emx: Reduce the default interrupt rate to 6000Hz
Sepherosa Ziehau [Thu, 2 Aug 2012 01:43:38 +0000 (09:43 +0800)]
em/emx: Reduce the default interrupt rate to 6000Hz

2 years agotools/pktgen: Setup link header length properly
Sepherosa Ziehau [Thu, 2 Aug 2012 01:27:09 +0000 (09:27 +0800)]
tools/pktgen: Setup link header length properly

2 years agoemx: Add EMX_TSO_DEBUG
Sepherosa Ziehau [Wed, 1 Aug 2012 09:09:58 +0000 (17:09 +0800)]
emx: Add EMX_TSO_DEBUG

It is used to measure TSO context reuse rate.  Setting up TX context
interferes TX data fetching pipelining, thus reduces performance, so
TX context setting up should be avoided as much as possible.

According to limited measurement:
- 1 one direction TX stream, reuse rate is ~40%
- 16 one direction TX streams, reuse rate is ~20%
- 16 bi-direction streams (total 32), reuse rate is ~10%

2 years agoemx: Remove dependency on opt_rss.h; RSS is always enabled
Sepherosa Ziehau [Wed, 1 Aug 2012 08:52:44 +0000 (16:52 +0800)]
emx: Remove dependency on opt_rss.h; RSS is always enabled

2 years agoemx: Add TSO support
Sepherosa Ziehau [Wed, 1 Aug 2012 08:51:02 +0000 (16:51 +0800)]
emx: Add TSO support

2 years agoemx: Remove unused macros
Sepherosa Ziehau [Wed, 1 Aug 2012 04:21:53 +0000 (12:21 +0800)]
emx: Remove unused macros

2 years agotools/pktgen: Setup header length properly
Sepherosa Ziehau [Wed, 1 Aug 2012 03:24:53 +0000 (11:24 +0800)]
tools/pktgen: Setup header length properly

2 years agoemx: Utilize mbuf's header lengthes
Sepherosa Ziehau [Wed, 1 Aug 2012 03:20:49 +0000 (11:20 +0800)]
emx: Utilize mbuf's header lengthes

2 years agombuf: segsz -> tso_segsz, which is more expressive
Sepherosa Ziehau [Wed, 1 Aug 2012 02:54:12 +0000 (10:54 +0800)]
mbuf: segsz -> tso_segsz, which is more expressive

2 years agobnx: Utilize header lengthes in mbuf to setup TSO
Sepherosa Ziehau [Wed, 1 Aug 2012 02:50:00 +0000 (10:50 +0800)]
bnx: Utilize header lengthes in mbuf to setup TSO

2 years agombuf: Regroup fields, mainly to improve cache utilization
Sepherosa Ziehau [Wed, 1 Aug 2012 02:47:53 +0000 (10:47 +0800)]
mbuf: Regroup fields, mainly to improve cache utilization

2 years agombuf: Save linker layer, IP and TCP/UDP header length
Sepherosa Ziehau [Wed, 1 Aug 2012 02:35:06 +0000 (10:35 +0800)]
mbuf: Save linker layer, IP and TCP/UDP header length

This could ease most drivers's TSO operation and avoid extra data
area accessing during TSO setting up.

This could also help Intel's 1000M/10G drivers' hardware checksum
offloading, which requires protocol header length.

2 years agoixgbe: remove some FreeBSD version checks
François Tigeot [Tue, 31 Jul 2012 13:19:57 +0000 (15:19 +0200)]
ixgbe: remove some FreeBSD version checks

2 years agoLINT/LINT64: Add BNX_TSO_DEBUG.
Sascha Wildner [Tue, 31 Jul 2012 11:39:05 +0000 (13:39 +0200)]
LINT/LINT64: Add BNX_TSO_DEBUG.

2 years agoopendir(3): use O_CLOEXEC
François Tigeot [Tue, 31 Jul 2012 08:32:24 +0000 (10:32 +0200)]
opendir(3): use O_CLOEXEC

2 years agokernel: Implement O_CLOEXEC
François Tigeot [Mon, 30 Jul 2012 20:39:46 +0000 (22:39 +0200)]
kernel: Implement O_CLOEXEC

* Using fcntl(2) just after open(2) is not enough to avoid race conditions
  in programs doing fork+exec sequences. Child processes may be created
  before fcntl() is run and inherit the parent's file descriptors.

* In some circonstances this behavior may even create security issues.

* O_CLOEXEC can be used to atomically set the close-on-exec flag for new
  file descriptors, avoiding the whole mess in the first place.

* Fixes issue #2356

Inspired-from: NetBSD

2 years agokdump(1)/truss(1): Fix occasional quickworld breakage.
Sascha Wildner [Mon, 30 Jul 2012 17:51:07 +0000 (19:51 +0200)]
kdump(1)/truss(1): Fix occasional quickworld breakage.

Whenever we messed with our ioctls or certain definitions
(like fcntl(2)'s O_* flags), kdump and truss could break
quickworld because their generated ioctl.c and kdump_subr.c
files in /usr/obj would still have removed stuff.

Fix this by regenerating them every time, no matter what.

2 years ago<sys/fcntl.h>: Mark O_DIRECTORY as being new in POSIX.1-2008.
Sascha Wildner [Mon, 30 Jul 2012 16:28:00 +0000 (18:28 +0200)]
<sys/fcntl.h>: Mark O_DIRECTORY as being new in POSIX.1-2008.

It is also visible in our default environment, just not if the code
explicitly requests an older POSIX version.

2 years agoopendir(3) - use O_DIRECTORY
Alex Hornung [Mon, 30 Jul 2012 15:58:05 +0000 (15:58 +0000)]
opendir(3) - use O_DIRECTORY

2 years agolinkat(2) man page
Alex Hornung [Mon, 30 Jul 2012 11:37:09 +0000 (11:37 +0000)]
linkat(2) man page

2 years agoimplement linkat
Alex Hornung [Mon, 30 Jul 2012 11:21:53 +0000 (11:21 +0000)]
implement linkat

2 years agoopen.2 - document O_DIRECTORY
Alex Hornung [Mon, 30 Jul 2012 14:02:26 +0000 (14:02 +0000)]
open.2 - document O_DIRECTORY

2 years agoopen - implement O_DIRECTORY
Alex Hornung [Mon, 30 Jul 2012 11:20:00 +0000 (11:20 +0000)]
open - implement O_DIRECTORY

2 years agokernel: remove O_FRNONBLOCKING
François Tigeot [Sun, 29 Jul 2012 17:26:02 +0000 (19:26 +0200)]
kernel: remove O_FRNONBLOCKING

* Like O_ROOTCRED it was effectively unused and removing it frees up
  a precious bit among the various O_xxx flags

* Partially fixes issue #2357

2 years agokernel: remove O_ROOTCRED
François Tigeot [Sun, 29 Jul 2012 16:23:31 +0000 (18:23 +0200)]
kernel: remove O_ROOTCRED

* This flag was DragonFly-specific and effectively unused

* Removing it frees up flag space for interacting with the rest of the world

* Partially fixes issue #2357

2 years agotcp: Increase tcp_sosend_agglim from 2 to 3
Sepherosa Ziehau [Mon, 30 Jul 2012 06:36:52 +0000 (14:36 +0800)]
tcp: Increase tcp_sosend_agglim from 2 to 3

This change makes better use of TSO.

When 2 is used, most of the large TCP segments' size are 2*MSS or 3*MSS.
When 3 is used, most of the large TCP segments' size are 4*MSS or 5*MSS.

The math is quite simple, given 1448B segment size:
2 == 4096B == 2 segments
3 == 6144B == 4 segments

Increasing it to a higher value improves single full speed stream's CPU
utilization, but does not have much effect on multiple streams'.

2 years agotools: Add toeplitz, which calculate toeplitz on given addresses/ports
Sepherosa Ziehau [Mon, 30 Jul 2012 04:29:31 +0000 (12:29 +0800)]
tools: Add toeplitz, which calculate toeplitz on given addresses/ports

2 years agobnx: Add TSO support
Sepherosa Ziehau [Sun, 29 Jul 2012 05:29:49 +0000 (13:29 +0800)]
bnx: Add TSO support

Obtained-from: FreeBSD if_bge.c

For TSO header information, ether_tso_pullup() is used instead of
making our own wheel.

BNX_TSO_DEBUG is added to help testing various TCP parameters tuning

2 years agoixgbe: Unbreak compile
Sepherosa Ziehau [Mon, 30 Jul 2012 05:58:57 +0000 (13:58 +0800)]
ixgbe: Unbreak compile

2 years agotcp: Add TSO support for IPv4
Sepherosa Ziehau [Fri, 27 Jul 2012 06:07:27 +0000 (14:07 +0800)]
tcp: Add TSO support for IPv4

It is implemented mainly according to NetBSD's TSO implementation.

Following stuffs are only in DragonFly
- Add comment about devices' expected behaviour upon PUSH and FIN flags
  Obtained-from: Microsoft's LSO online document
- Don't use TSO, if there are SACK or DSACK blocks to report
- Don't use TSO, if congestion window needs validation
- Don't use TSO, if URG flag is to be set
- Take IP and TCP header sizes into consideration when calculate the
  large TCP segment size
- Pseudo checksum for the large TCP segment is calculated using only
  source address, destination address and IPPROTO_TCP according to
  Microsoft's LSO online document.  This fashion of pseudo checksum
  calculation seems to be adopted by several NIC chips.

Several driver helper functions are added:
- tcp_tso_pullup(), which extracts IPv4 and TCP header's location and
  length.  And make sure that IPv4 and TCP headers are in contiguous
  memory.
- ether_tso_pullup(), in addition to what tcp_tso_pullup() does, it
  also extracts ethernet header's length and make sure that ethernet,
  IPv4 and TCP headers are in contiguous memory.

Sysctl node net.inet.tcp.tso could be used to globally disable TSO.
TSO is by default on.

tso/-tso are added to ifconfig(8), which could be used to enable or
disable TSO on the specific interface.

2 years agociss.4: Document some tunables.
Sascha Wildner [Sun, 29 Jul 2012 19:06:30 +0000 (21:06 +0200)]
ciss.4: Document some tunables.

2 years agociss(4): Sync with FreeBSD.
Sascha Wildner [Sun, 29 Jul 2012 18:49:26 +0000 (20:49 +0200)]
ciss(4): Sync with FreeBSD.

Tons of good stuff. MPSAFEness, MSI interrupts, better performance,
and a lot more (I'm too lazy to go through FreeBSD's logs :P).

Support for a number of adapters has been added, too:

* HP Smart Array P220i
* HP Smart Array P222
* HP Smart Array P420
* HP Smart Array P420i
* HP Smart Array P421
* HP Smart Array P700m
* HP Smart Array P712m
* HP Smart Array P721m
* HP Smart Array P822

I've tested it with a HP Smart Array P212.

Many thanks to FreeBSD.

2 years agomptable - use the table's cpu_flags
Alex Hornung [Sun, 29 Jul 2012 15:28:00 +0000 (15:28 +0000)]
mptable - use the table's cpu_flags

 * Sometimes the CPUs are marked as disabled in the APIC table, and for
   good reason (e.g. a machine having only 24 cores, but 32 appearing in
   the APIC table, 8 of them disabled).

 * Just in case, provide an override that falls back to the old
   behaviour. This is the tunable hw.lapic_force_enable. It will force
   all lapic entries to be marked as enabled. It is however not the
   default.

 * When parsing, don't error out when a lapic id is invalid (255) but it
   is disabled.

Reported-by: Mihai Carabas, Francois Tigeot
2 years agoacpidump - be a bit more lenient and don't assert
Alex Hornung [Sun, 29 Jul 2012 15:23:47 +0000 (15:23 +0000)]
acpidump - be a bit more lenient and don't assert

 * Asserting in this case causes the dump not to continue, although it
   is safe to do so.

Reported-by: Mihai Carabas
2 years agox86_64 mptable - maximum lapic id is 64
Alex Hornung [Sun, 29 Jul 2012 12:00:53 +0000 (12:00 +0000)]
x86_64 mptable - maximum lapic id is 64

 * In x86_64, lapic ids with HT can be up to 64, not 32 as in i386.

Reported-by: Mihai Carabas, Francois Tigeot
2 years agoRemove some more unused headers.
Sascha Wildner [Sun, 29 Jul 2012 00:27:27 +0000 (02:27 +0200)]
Remove some more unused headers.

2 years agoRemove unused header.
Sascha Wildner [Sat, 28 Jul 2012 23:40:18 +0000 (01:40 +0200)]
Remove unused header.

2 years agogcore(1): Make it work again.
Sascha Wildner [Sat, 28 Jul 2012 20:29:43 +0000 (22:29 +0200)]
gcore(1): Make it work again.

Two commits broke things:

64fce751acfda11e21846e900fc774e88f32f52e which changed us to no longer
claiming that we're FreeBSD in core files.

0b684e3f9af3abc5ded676c43a1a5a478b45325c which added another field to
/proc/<pid>/map (the vnode path for vn-backed vm objects).

Both changes need adjustments in gcore(1).