dragonfly.git
11 years agolibc/sl_find: sync prototype with NetBSD
John Marino [Tue, 19 Mar 2013 20:57:26 +0000 (21:57 +0100)]
libc/sl_find: sync prototype with NetBSD

The sl_find function does not modify the 'name' argument.
Set the constant qualifier on it to match NetBSD.  FreeBSD will make this
change in the future as well.

Submitted by: Eitan Eadler <eadler@freebsd.org>

11 years agoasync_rcvd: Don't add/drop socket reference on hot path
Sepherosa Ziehau [Tue, 19 Mar 2013 08:51:49 +0000 (16:51 +0800)]
async_rcvd: Don't add/drop socket reference on hot path

Instead, add reference in tcp_attach(), and drop the reference in
tcp_close()

11 years agoasync_rcvd: Move MSGF_DONE test under async rcvd spinlock
Sepherosa Ziehau [Tue, 19 Mar 2013 07:56:11 +0000 (15:56 +0800)]
async_rcvd: Move MSGF_DONE test under async rcvd spinlock

This flag is meant to be protected by the async rcvd spinlock; use
ssleep instead of tsleep if race happened.

Sysctl node kern.ipc.async_rcvd_drop_race is added to count the
number of async rcvd message dropping races.

11 years agoasync_rcvd: Remove the dead async rcvd message debug logging
Sepherosa Ziehau [Tue, 19 Mar 2013 06:24:16 +0000 (14:24 +0800)]
async_rcvd: Remove the dead async rcvd message debug logging

This race does happen.

11 years agosh: Sync with FreeBSD:
Peter Avalos [Mon, 18 Mar 2013 00:29:29 +0000 (17:29 -0700)]
sh: Sync with FreeBSD:

* Expand assignment-like words specially for export/readonly/local.
* Remove unused variables.
* Reset pendingsigs before checking pending traps, not after.
* Track continued jobs (even if not continued by bg or fg).
* Inline waitproc() into its only caller.
* Fix EINTR race condition in "wait" and "set -T" using sigsuspend().
* use setinputfile instead of open/setinputfd.
* Prefer internal nextopt() to libc getopt().
* Use C99 flexible array instead of accessing array beyond bounds.
* Fix two issues when an alias is redefined.
* Detect and flag write errors on stdout in builtins.
* Prefer strsignal() to accessing sys_siglist directly.
* Don't lose $? when backquoted command ends with semicolon or newline.
* Fix crash when parsing '{ } &'.
* Pass $? to command substitution containing compound/multiple commands.
* Simplify cd-hash interaction.
* Remove mkinit's initialization routine.
* Move some stackmarks to fix high memory usage in some loops.
* Show negated commands (!) in jobs output.
* Prefer our character classification functions to <ctype.h>.
* Expand here documents in the current process.
* Do not test for digit_contig in mksyntax.
* Simplify mksyntax
* Fix a crash with the stackmark code.
* If a SIGINT or SIGQUIT interrupts "wait", return status 128+sig.
* When executing a trap, keep exit status along with evalskip.
* Update $FreeBSD$ to include SVN id.

Obtained-from:   FreeBSD

11 years agomiidevs: regen
Sepherosa Ziehau [Sun, 17 Mar 2013 12:45:52 +0000 (20:45 +0800)]
miidevs: regen

11 years agomiidevs: Flip BCM5720C and BCM5718C IDs
Sepherosa Ziehau [Sun, 17 Mar 2013 12:44:48 +0000 (20:44 +0800)]
miidevs: Flip BCM5720C and BCM5718C IDs

Datasheet is wrong on the the IDs' names.

11 years agomiidevs: regen
Sepherosa Ziehau [Sun, 17 Mar 2013 12:25:12 +0000 (20:25 +0800)]
miidevs: regen

11 years agomiidevs: Add PHY IDs for Broadcom 5762
Sepherosa Ziehau [Sun, 17 Mar 2013 12:24:54 +0000 (20:24 +0800)]
miidevs: Add PHY IDs for Broadcom 5762

11 years agopcidevs: regen
Sepherosa Ziehau [Sun, 17 Mar 2013 11:45:35 +0000 (19:45 +0800)]
pcidevs: regen

11 years agopcidevs: Add device IDs for Broadcom 5762/5725/5727
Sepherosa Ziehau [Sun, 17 Mar 2013 11:45:05 +0000 (19:45 +0800)]
pcidevs: Add device IDs for Broadcom 5762/5725/5727

11 years agopcidevs: regen
Sepherosa Ziehau [Sun, 17 Mar 2013 11:38:43 +0000 (19:38 +0800)]
pcidevs: regen

11 years agopcidevs: Sort Broadcom chips device IDs in numeric order
Sepherosa Ziehau [Sun, 17 Mar 2013 11:38:08 +0000 (19:38 +0800)]
pcidevs: Sort Broadcom chips device IDs in numeric order

11 years ago<paths.h>: Add /usr/local/{bin,sbin} to _PATH_DEFPATH.
Sascha Wildner [Sun, 17 Mar 2013 02:24:10 +0000 (03:24 +0100)]
<paths.h>: Add /usr/local/{bin,sbin} to _PATH_DEFPATH.

11 years agopciconf(8): Add support for displaying extended capabilities with -c.
Sascha Wildner [Fri, 15 Mar 2013 19:37:29 +0000 (20:37 +0100)]
pciconf(8): Add support for displaying extended capabilities with -c.

Also, bring in some additional minor fixes.

Taken-from: FreeBSD

11 years ago<bus/pci/pcireg.h>: Add some more definitions.
Sascha Wildner [Fri, 15 Mar 2013 19:29:29 +0000 (20:29 +0100)]
<bus/pci/pcireg.h>: Add some more definitions.

11 years agopciconf(8): Adjust some whitespace.
Sascha Wildner [Fri, 15 Mar 2013 19:27:16 +0000 (20:27 +0100)]
pciconf(8): Adjust some whitespace.

11 years agobsd-family-tree: Sync with FreeBSD (adds FreeBSD 9.1).
Sascha Wildner [Fri, 15 Mar 2013 17:52:50 +0000 (18:52 +0100)]
bsd-family-tree: Sync with FreeBSD (adds FreeBSD 9.1).

11 years agoUpdate the pciconf(8) database.
Sascha Wildner [Fri, 15 Mar 2013 16:29:00 +0000 (17:29 +0100)]
Update the pciconf(8) database.

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

11 years agoroute(8): Fix a possible infinite loop in "route flush"
Sepherosa Ziehau [Fri, 15 Mar 2013 09:44:11 +0000 (17:44 +0800)]
route(8): Fix a possible infinite loop in "route flush"

Obtained-from: FreeBSD 230989
DragonFly-bug: http://bugs.dragonflybsd.org/issues/2523

11 years agoifnet: Simplify ifnet_serialize_array function interface
Sepherosa Ziehau [Fri, 15 Mar 2013 08:35:40 +0000 (16:35 +0800)]
ifnet: Simplify ifnet_serialize_array function interface

It is no longer used to hold RX or TX serializers, so the RX/TX
serializer offset function arguments are not necessary at all.

11 years agoifsq: Let ifaltq_subque know its related hardware TX queue's serializer
Sepherosa Ziehau [Fri, 15 Mar 2013 05:57:21 +0000 (13:57 +0800)]
ifsq: Let ifaltq_subque know its related hardware TX queue's serializer

This avoids following operations on packet transmission hot path:
- Dereferening device driver supplied serialize function pointers
- Locating hardware TX queue's serializer

Comparing to the lwkt_serialize functions, the above two operations are
costful.

Driver changes:
- For device drivers which use the default ifnet serializer, no additional
  code will be needed, if_attach() will assign ifnet serializer to
  ifaltq_subque.
- For device drivers which use independent serializers for main function,
  RX queues and TX queues, ifsq_set_hw_serialize() must be called to
  properly assign the hardware TX queue's serializer to ifaltq_subque.
  Drivers in this category are bce(4), emx(4), igb(4) and jme(4).

11 years agokern.post.mk: Put three more (minor) files under -Werror.
Sascha Wildner [Thu, 14 Mar 2013 21:03:52 +0000 (22:03 +0100)]
kern.post.mk: Put three more (minor) files under -Werror.

11 years agokern.post.mk: Remove some old commented out code.
Sascha Wildner [Thu, 14 Mar 2013 20:11:34 +0000 (21:11 +0100)]
kern.post.mk: Remove some old commented out code.

11 years agokernel: Remove 'nowerror' from two more files that don't need it.
Sascha Wildner [Thu, 14 Mar 2013 19:43:23 +0000 (20:43 +0100)]
kernel: Remove 'nowerror' from two more files that don't need it.

11 years agokernel: Remove 'nowerror' from two files that don't need it.
Sascha Wildner [Thu, 14 Mar 2013 19:39:47 +0000 (20:39 +0100)]
kernel: Remove 'nowerror' from two files that don't need it.

11 years agoSync zoneinfo database with tzdata2013b from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Thu, 14 Mar 2013 17:10:19 +0000 (18:10 +0100)]
Sync zoneinfo database with tzdata2013b from ftp://ftp.iana.org/tz/releases

* africa: Morocco does not observe DST during Ramadan; try to predict
    Ramadan in Morocco as best we can. (Thanks to Erik Homoet for the
    heads-up.)

* northamerica: Haiti uses US daylight-saving rules this year, and
    presumably future years. This changes recent time stamps. (Thanks
    to Steffen Thorsen.)

* southamerica: Paraguay will end DST on March 24 this year. For now,
    assume it's just this year. (Thanks to Steffen Thorsen.)

11 years agokernel/pci: Don't perform the maximum register number check.
Sascha Wildner [Sun, 26 Feb 2012 14:41:52 +0000 (15:41 +0100)]
kernel/pci: Don't perform the maximum register number check.

Different sub-kinds of PCI buses may have different rules and thus it
is up for the bus backends to do proper input checks. For example,
PCIe allows configuration register numbers < 0x1000, while for PCI
proper the limit is 0x100.

Taken-from: FreeBSD

11 years agoDon't install manpage for spic(4), which is i386 only, on x86_64.
Sascha Wildner [Wed, 13 Mar 2013 17:12:03 +0000 (18:12 +0100)]
Don't install manpage for spic(4), which is i386 only, on x86_64.

11 years agoet: Enable MSI
Sepherosa Ziehau [Wed, 13 Mar 2013 13:34:04 +0000 (21:34 +0800)]
et: Enable MSI

11 years agore: Don't loop in the interrupt handler; it does no good
Sepherosa Ziehau [Wed, 13 Mar 2013 13:22:40 +0000 (21:22 +0800)]
re: Don't loop in the interrupt handler; it does no good

11 years agore: Use memory mapped IO for PCIe chips
Sepherosa Ziehau [Wed, 13 Mar 2013 13:15:10 +0000 (21:15 +0800)]
re: Use memory mapped IO for PCIe chips

11 years agore: Enable MSI on PCIe chips by default
Sepherosa Ziehau [Wed, 13 Mar 2013 12:18:19 +0000 (20:18 +0800)]
re: Enable MSI on PCIe chips by default

11 years agomsk.4: Document hw.mskc.msi.enable.
Sascha Wildner [Tue, 12 Mar 2013 21:04:32 +0000 (22:04 +0100)]
msk.4: Document hw.mskc.msi.enable.

11 years agokernel: Turn on -Werror for the gcc47 buildkernel.
Sascha Wildner [Tue, 12 Mar 2013 20:49:28 +0000 (21:49 +0100)]
kernel: Turn on -Werror for the gcc47 buildkernel.

11 years agokernel: Disable -Winline and -Wunused-but-set-variable for buildkernel.
Sascha Wildner [Tue, 12 Mar 2013 20:45:37 +0000 (21:45 +0100)]
kernel: Disable -Winline and -Wunused-but-set-variable for buildkernel.

-Winline's behavior is kind of unobvious to fix without further knowledge
about how the compiler decides what can be inlined and what not. A better
solution might be to remove "inline" from most declarations and instead
use __always_inline for what we absolutely need to inline.

-Wunused-but-set-variable (a gcc47 specific warning) is nice and can
point at places that need cleaning up (which we did for a lot of its
warnings) but at the end of the day, it doesn't catch many real bugs and
it also warns about some cases that we'd like to stay as they are, simply
because it's more convenient or would result in unnecessarily silly code.
We also moved it to WARNS=6 (from WARNS=2) for userland code.

Thanks to aggelos and sephe for sharing their thoughts.

11 years agokernel/asr: Fix -Waddress on gcc47.
Sascha Wildner [Tue, 12 Mar 2013 20:31:20 +0000 (21:31 +0100)]
kernel/asr: Fix -Waddress on gcc47.

gcc47 was complaining about two cases where an address that could never
be NULL was checked against NULL in the SG() macro. Work around it by
using a pointer in between.

11 years ago<sys/proc.h>: Fix buildworld.
Sascha Wildner [Tue, 12 Mar 2013 18:04:34 +0000 (19:04 +0100)]
<sys/proc.h>: Fix buildworld.

11 years agoemx: Update comment about multiple TX queues on 82574
Sepherosa Ziehau [Tue, 12 Mar 2013 12:38:58 +0000 (20:38 +0800)]
emx: Update comment about multiple TX queues on 82574

The watchdog timeout on TX queue0 when multiple TX queues are enable
is _not_ related to hardware TX checksum offloading.

In the latest 82574 specification (Feb 2013, rev 3.3), it claims the
same TX context setting up requirement for multiple TX queues as with
82571.  However, 82571 works quite well with multiple TX queues.

Sigh.

11 years agoigb: Fix comment; 82575 expects TX context index instead of ring index
Sepherosa Ziehau [Tue, 12 Mar 2013 12:32:49 +0000 (20:32 +0800)]
igb: Fix comment; 82575 expects TX context index instead of ring index

11 years agomsk: Enable MSI
Sepherosa Ziehau [Tue, 12 Mar 2013 12:28:03 +0000 (20:28 +0800)]
msk: Enable MSI

11 years agokernel/netgraph7: Fix -Wcast-qual.
Sascha Wildner [Mon, 11 Mar 2013 19:50:05 +0000 (20:50 +0100)]
kernel/netgraph7: Fix -Wcast-qual.

11 years ago<sys/proc.h>: Make ONLY_LWP_IN_PROC() an inline function.
Sascha Wildner [Mon, 11 Mar 2013 16:53:32 +0000 (17:53 +0100)]
<sys/proc.h>: Make ONLY_LWP_IN_PROC() an inline function.

More readable, plus it also fixes some warnings we were getting with
gcc47 (-Wunused-value).

Thanks for comments to aggelos and vsrinivas.

11 years agonetif: Setup TX ring CPUID before hooking up interrupt vectors
Sepherosa Ziehau [Mon, 11 Mar 2013 12:33:28 +0000 (20:33 +0800)]
netif: Setup TX ring CPUID before hooking up interrupt vectors

11 years agorl: Take DLink DFE520TX C1
Sepherosa Ziehau [Mon, 11 Mar 2013 09:22:23 +0000 (17:22 +0800)]
rl: Take DLink DFE520TX C1

Obtained-from: FreeBSD 245485

11 years agopcidevs: regen
Sepherosa Ziehau [Mon, 11 Mar 2013 09:22:15 +0000 (17:22 +0800)]
pcidevs: regen

11 years agopcidevs: Add device id for DLink 520TX C1
Sepherosa Ziehau [Mon, 11 Mar 2013 09:21:54 +0000 (17:21 +0800)]
pcidevs: Add device id for DLink 520TX C1

11 years agoemx: Setup TX queues before hooking up interrupt vectors
Sepherosa Ziehau [Mon, 11 Mar 2013 09:06:31 +0000 (17:06 +0800)]
emx: Setup TX queues before hooking up interrupt vectors

11 years agoigb: Disable interrupts before setting up the interrupt vectors
Sepherosa Ziehau [Mon, 11 Mar 2013 08:15:00 +0000 (16:15 +0800)]
igb: Disable interrupts before setting up the interrupt vectors

The spurious interrupts (even MSI-X, that's amazing) had been observed
on several types of LOMs, before the devices were initialized, which
could potentially crash the system.  Disabling interrupts in hardware
and on serializers before setting up the interrupt vectors should be
enough.

See-also: FreeBSD PR kern/172113

11 years agoigb: Setup TX queues before hooking up interrupt vectors
Sepherosa Ziehau [Mon, 11 Mar 2013 07:17:20 +0000 (15:17 +0800)]
igb: Setup TX queues before hooking up interrupt vectors

11 years agojme: Setup TX ring CPUID before hooking up interrupt vectors
Sepherosa Ziehau [Mon, 11 Mar 2013 06:38:53 +0000 (14:38 +0800)]
jme: Setup TX ring CPUID before hooking up interrupt vectors

11 years agojme: Set TX queue's CPUID before enable/disable interrupt
Sepherosa Ziehau [Mon, 11 Mar 2013 06:24:48 +0000 (14:24 +0800)]
jme: Set TX queue's CPUID before enable/disable interrupt

11 years agorc.d/ldconfig: Add a mechanism to include files added by dports.
Peter Avalos [Sun, 10 Mar 2013 16:45:58 +0000 (09:45 -0700)]
rc.d/ldconfig:  Add a mechanism to include files added by dports.

Add a mechanism to include files added by dports which contain
the names of directories to include in the base ldconfig script.
This will eliminate the need for each port to install its own
boot script which does nothing but ldconfig a given directory.

Obtained-from:   FreeBSD

11 years agotzsetup: Fix VERBOSE reporting when removing _PATH_LOCALTIME for UTC.
Peter Avalos [Mon, 4 Mar 2013 17:01:38 +0000 (09:01 -0800)]
tzsetup: Fix VERBOSE reporting when removing _PATH_LOCALTIME for UTC.

Obtained-from:   FreeBSD

11 years agospkrtest: use new dialog auto-sizing syntax.
Peter Avalos [Mon, 4 Mar 2013 16:54:58 +0000 (08:54 -0800)]
spkrtest: use new dialog auto-sizing syntax.

Obtained-from:   FreeBSD

11 years agokbdmap: Sync with FreeBSD.
Peter Avalos [Sun, 3 Mar 2013 20:15:43 +0000 (12:15 -0800)]
kbdmap: Sync with FreeBSD.

* Let bsd.prog.mk set SRCS and MAN to their default values.
* kbdmap.1 markup fixes and fix path for locale.alias.
* Spelling fix in a comment.
* Place quotes around the output, designed to be pasted into rc.conf.
* Fix fd leak in get_font().
* Use auto-sizing syntax appropriate for the new dialog(1).
* Update files with FreeBSD SVN tags.
* Output keymap choice to stderr so it is easier to parse.
* Use sizeof() for calculating the buffer size instead of hard-coded
  values.
* Fixed two bugs in Perl to C conversion that prevented locale name
  from being parsed correctly.

Obtained-from:   FreeBSD

11 years agoasync_rcvd: Fix possible deadlock
Sepherosa Ziehau [Mon, 11 Mar 2013 01:50:05 +0000 (09:50 +0800)]
async_rcvd: Fix possible deadlock

It is possible when we try dropping the asynchronized rcvd message, the
message is not on the msgport yet, but sendmsg_stage1 is done, i.e.
MSG_DONE is cleared.  Originally we were waiting for the MSG_DONE to be
set, however, it will _never_ be set, since the message dropping is done
in the netisr and the MSG_DONE will only be turned on when the message
is dequeued and runs in the _same_ netisr.

Fixing this deadlock by keeping dropping the asynchronized rcvd message,
if the message's MSG_DONE flag is not set.

Reported-by: pavalos@
11 years agobce: Setup TX queues before hooking up interrupt vectors
Sepherosa Ziehau [Sun, 10 Mar 2013 13:01:36 +0000 (21:01 +0800)]
bce: Setup TX queues before hooking up interrupt vectors

11 years agomake upgrade: Remove some reappeared files from the list.
Sascha Wildner [Sun, 10 Mar 2013 10:20:15 +0000 (11:20 +0100)]
make upgrade: Remove some reappeared files from the list.

In-discussion-with: pavalos

11 years agokernel: Use __offsetof() in a few more places.
Sascha Wildner [Sat, 9 Mar 2013 20:40:22 +0000 (21:40 +0100)]
kernel: Use __offsetof() in a few more places.

11 years agokernel/hptmv: Use __offsetof().
Sascha Wildner [Fri, 8 Mar 2013 19:41:17 +0000 (20:41 +0100)]
kernel/hptmv: Use __offsetof().

11 years agojme: Correct RSS key registers configuration order
Sepherosa Ziehau [Sat, 9 Mar 2013 14:22:06 +0000 (22:22 +0800)]
jme: Correct RSS key registers configuration order

Low bytes of RSS key should go into high RSS key registers.  However,
original way does not affect DragonFly's RSS implementation; since
DragonFly's RSS key is duplicated from 2 bytes, all values written
to the RSS key registers are actually same.

11 years agoshlock(1) - Fix a possible overflow.
Gwenio [Sat, 9 Mar 2013 11:28:05 +0000 (12:28 +0100)]
shlock(1) - Fix a possible overflow.

11 years agoddb.4 - Mention recently added 'show tokens' command.
Antonio Huete Jimenez [Fri, 8 Mar 2013 13:32:12 +0000 (14:32 +0100)]
ddb.4 - Mention recently added 'show tokens' command.

11 years agobce: Utilize hardware supplied RSS hash
Sepherosa Ziehau [Sat, 9 Mar 2013 09:37:13 +0000 (17:37 +0800)]
bce: Utilize hardware supplied RSS hash

The IP fragment detection needs further investigation.  Currently we
can't tell for 100% sure whether the received packet is an IP fragment
or not; we just test the hardware supplied checksum against 0xffff for
IP fragment detection.  However, it is not a big deal in the current
code base, since IP fragments reassemabling is under a token (the IP
fragments reassemabing used to be only allowed on netisr0)

11 years agoethernet: Make hash check possible even if RSS_DEBUG is not defined
Sepherosa Ziehau [Sat, 9 Mar 2013 03:06:15 +0000 (11:06 +0800)]
ethernet: Make hash check possible even if RSS_DEBUG is not defined

This makes debugging RSS hash related stuffs easier

11 years agokernel/ddb - Add 'show tokens' function.
Antonio Huete Jimenez [Fri, 8 Mar 2013 00:40:39 +0000 (01:40 +0100)]
kernel/ddb - Add 'show tokens' function.

11 years agobce: Pack RX/TX mbuf related fields into struct
Sepherosa Ziehau [Thu, 7 Mar 2013 13:24:18 +0000 (21:24 +0800)]
bce: Pack RX/TX mbuf related fields into struct

Mainly to improve cache utilization.

11 years agobce: Strip extra blank lines
Sepherosa Ziehau [Thu, 7 Mar 2013 07:54:55 +0000 (15:54 +0800)]
bce: Strip extra blank lines

11 years agoSync zoneinfo database with tzdata2013a from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Thu, 7 Mar 2013 02:04:19 +0000 (03:04 +0100)]
Sync zoneinfo database with tzdata2013a from ftp://ftp.iana.org/tz/releases

* antarctica & southamerica: Chile's 2013 rules, and we guess rules for
    2014 and later, will be the same as 2012, namely Apr Sun>=23 03:00 UTC
    to Sep Sun>=2 04:00 UTC. (Thanks to Steffen Thorsen and Robert Elz.)

* europe: New "Asia/Khandyga" and "Asia/Ust-Nera" and "Europe/Busingen"
    zones. Also, improve the commentary about which districts observe
    what times in Russia. (Thanks to Tobias Conradi, Oscar van Vlijmen
    and Arthur David Olson.)

* various files: Many changes affecting historical time stamps before
    1940. These were deduced from: Milne J. Civil time. Geogr J. 1899
    Feb;13(2):173-94 <http://www.jstor.org/stable/1774359>.

11 years agovkernel.7: Use .Pa and break line on new sentence.
Sascha Wildner [Wed, 6 Mar 2013 16:49:10 +0000 (17:49 +0100)]
vkernel.7: Use .Pa and break line on new sentence.

11 years agovke(4) - Use M_ZERO for tx/rx ring allocation.
Antonio Huete Jimenez [Wed, 6 Mar 2013 15:59:34 +0000 (16:59 +0100)]
vke(4) - Use M_ZERO for tx/rx ring allocation.

Pointed-out-by: sephe
11 years agobce: White space cleanup
Sepherosa Ziehau [Wed, 6 Mar 2013 13:13:34 +0000 (21:13 +0800)]
bce: White space cleanup

11 years agobce: Put per RX ring received packets debug stats under BCE_RSS_DEBUG
Sepherosa Ziehau [Wed, 6 Mar 2013 13:11:32 +0000 (21:11 +0800)]
bce: Put per RX ring received packets debug stats under BCE_RSS_DEBUG

11 years agobce: Implement multiple TX/RX rings and MSI-X support for 5709/5716
Sepherosa Ziehau [Wed, 27 Feb 2013 13:53:37 +0000 (21:53 +0800)]
bce: Implement multiple TX/RX rings and MSI-X support for 5709/5716

5709/5716 support 9 RX rings, 9 TX rings and 9 MSI-X vectors; each
MSI-X vector has its own interrupt moderation parameters.

(N + 1) RX rings, N TX rings and (N + 1) MSI-X vectors will be enabled;
N is ncpus2, if ncpus2 is less than 8, else N will be 8.

The extra RX ring is enabled mainly because:
The first RX ring is only used for packets whose RSS hash could not
be calculated, so it is actually _not_ involved in RSS.  This extra RX
ring is used for the packets whose masked RSS hash equal 0.

An extra MSI-X vector is allocated for this extra RX ring; there is no
correponding TX ring for this extra RX ring.  In polling(4), this extra
RX ring is polled along with the first RX ring in the first RX polling
handler, in which the packets whose RSS hash equal 0 should be processed.

Hardware provided RSS hash and packet type are not utilized yet; they will
be supported in the upcoming commits.

Related hardware registers and hardware initialization order are infered
from Linux's bnx2 (*); NetXtremeII-PG203-R.pdf provided on Broadcom's
website does not contain enough information for multiple rings and MSI-X
to function.

(*) Unlike Linux's bnx2, which limits number of RX rings to 8, DragonFly
limits number of RX rings to 9 and 9 RX rings actually work quite well.

11 years agomkinitrd(8) - Exit upon vnconfig failure.
Antonio Huete Jimenez [Wed, 6 Mar 2013 10:56:48 +0000 (11:56 +0100)]
mkinitrd(8) - Exit upon vnconfig failure.

11 years agovke(4) - Add a tunable to set the max number of mbuf clusters per device.
Antonio Huete Jimenez [Tue, 5 Mar 2013 22:33:11 +0000 (23:33 +0100)]
vke(4) - Add a tunable to set the max number of mbuf clusters per device.

* Also cap it to 256 mbuf clusters by default.

11 years agokernel - Fix namecache hash list corruption
Matthew Dillon [Wed, 6 Mar 2013 01:22:33 +0000 (17:22 -0800)]
kernel - Fix namecache hash list corruption

* Fix namecache hash list corruption.  A rare race is possible where
  a dummy namecache element used as a placeholder in hash list scans
  might be improperly removed by another cpu.

Reported-by: ftigeot
11 years agokernel/pf: Fix a bunch of gcc47 -Waddress warnings.
Sascha Wildner [Tue, 5 Mar 2013 17:50:53 +0000 (18:50 +0100)]
kernel/pf: Fix a bunch of gcc47 -Waddress warnings.

The REASON_SET() macro is sometimes called with the address of a local
u_short instead of a pointer passed to the macro's caller. In its NULL
check, gcc47 detects that the address can never be NULL and issues a
-Waddress warning which part of -Wall.

To silence it, go via a u_short pointer in the macro. This fix is about
as harmless as the "issue" gcc47 was warning about.

While here, put two "x" parameters in parentheses.

11 years agokernel - remove kprintf info about magazine capacity
John Marino [Tue, 5 Mar 2013 17:08:54 +0000 (18:08 +0100)]
kernel - remove kprintf info about magazine capacity

This kprintf was added when the magazine capacity calculation was
modified (commit 765b1ae0159cca211559c3035641d842f28defd7).

While it only emits with verbose boot, the message can become quite a
nuisance with tmpfs mounts.  Running poudriere with verbose boot
effectively takes away the first virtual terminal.  This information
isn't very useful anymore, so get rid of it altogether.

Approved-by: dillon
11 years agostrchr.3: Small wording fixes.
Sascha Wildner [Tue, 5 Mar 2013 17:03:01 +0000 (18:03 +0100)]
strchr.3: Small wording fixes.

11 years agokernel - Fix at least one 64-bit ddb backtrace issue
Matthew Dillon [Tue, 5 Mar 2013 01:15:09 +0000 (17:15 -0800)]
kernel - Fix at least one 64-bit ddb backtrace issue

* Fix DDB support functions which were overflowing a 4-byte buffer when
  reading and writing 8-byte values.

Reported-by: tuxillo
11 years agokernel - Attempt to fix SMP races with ^T
Matthew Dillon [Mon, 4 Mar 2013 22:42:07 +0000 (14:42 -0800)]
kernel - Attempt to fix SMP races with ^T

* The ^T (ttyinfo()) code was still using critical-sections to protect
  its probe.  This no longer works.  Replace with appropriate hold's and
  tokens.

Reported-by: marino
11 years agolibc: Add strchrnul(), a glibc extension
François Tigeot [Sun, 3 Mar 2013 19:04:26 +0000 (20:04 +0100)]
libc: Add strchrnul(), a glibc extension

* This function behaves like strchr() but returns a pointer to the
  terminating \0 byte of the string instead of NULL if the character
  was not found

* It was first implemented in glibc-2.1.1

Obtained-from: FreeBSD

11 years agoaltq: Don't use poll cache
Sepherosa Ziehau [Mon, 4 Mar 2013 07:37:48 +0000 (15:37 +0800)]
altq: Don't use poll cache

The poll/dequeue model is no longer applicable to SMP system, e.g.

   CPU-A            CPU-B
     :                :
   poll               :
     :              poll
   dequeue (+)        :

The dequeue at (+) will hit the poll cache set by CPU-B.

Reported-by: pavalos@
11 years agokernel - Increase size of savefpu area in pcb for vkernel64
Matthew Dillon [Mon, 4 Mar 2013 02:25:14 +0000 (18:25 -0800)]
kernel - Increase size of savefpu area in pcb for vkernel64

* The vkernel64 uses bcopy.  The ucontext_t/mcontext_t reserves a 1024
  byte space for the fpu area, but the savefpu structure only reserves
  834 bytes.  Increase the savefpu structure appropriately.

* Did not effect real 64-bit kernels because they used machine instructions
  to save/restore the FP state and/or bcopy'd using the savefpu structure
  sdize instead of the size of the fpu area in the ucontext/mcontext
  structure.

* Fixes panics in vkernel64

Reported-by: tuxillo
11 years agokernel/ufs: Use __offsetof() instead of offsetof() (unbreaks buildworld).
Sascha Wildner [Mon, 4 Mar 2013 00:51:24 +0000 (01:51 +0100)]
kernel/ufs: Use __offsetof() instead of offsetof() (unbreaks buildworld).

__offsetof() is known to userland too, and <vfs/ufs/dir.h> is shared with
some userland programs.

Reported-by: marino
11 years agokernel: Use our offsetof() from <sys/types.h> instead of a local one.
Sascha Wildner [Sun, 3 Mar 2013 19:23:26 +0000 (20:23 +0100)]
kernel: Use our offsetof() from <sys/types.h> instead of a local one.

On GCC 4.1 and later, our offsetof() winds up being __builtin_offsetof(),
which is constant to GCC, so as a nice benefit this commit also fixes two
GCC 4.7 warnings:

.../dirhash.h:97:95: warning: variably modified 'dh_firstfree' at file scope
.../vdevice.h:145:2: warning: variably modified '_ArrayTables' at file scope

There are more offsetof() candidates I need to get to but since those two
fix warnings, I commit them now.

11 years agokernel/tmpfs: Add missing include for vm_wait_nominal() prototype.
Sascha Wildner [Sun, 3 Mar 2013 17:16:31 +0000 (18:16 +0100)]
kernel/tmpfs: Add missing include for vm_wait_nominal() prototype.

11 years agokernel/arpresolve: Initialize 'rt' with NULL.
Sascha Wildner [Sun, 3 Mar 2013 12:19:41 +0000 (13:19 +0100)]
kernel/arpresolve: Initialize 'rt' with NULL.

This fixes a case where NULL was passed for 'rt0' and 'rt' could end up
uninitialized at the log() call in line 509.

Review by sephe showed that we never pass NULL as 'rt0' but let's fix it
anyway, to be safer.

Reported-by: enroljas
Reviewed-by: sephe
11 years agokernel - Improve vm.vmmeter sysctl performance
Matthew Dillon [Sun, 3 Mar 2013 08:17:42 +0000 (00:17 -0800)]
kernel - Improve vm.vmmeter sysctl performance

* Improve performance by reducing the rate at which the marker is moved.

* Fix a bug, noting that lwkt_yield() can cause us to lose the token,
  by always using the marker for both it and the collision case.

11 years agokernel - Refactor swapoff scan code
Matthew Dillon [Sun, 3 Mar 2013 08:15:42 +0000 (00:15 -0800)]
kernel - Refactor swapoff scan code

* Refactor the scan code to be far more optimal.  The old scan was
  restarting the entire VM object scan on each swap block removed
  from the swap device being turned off.

* Scan twice before giving up to try to catch any elements which
  are in-transition.

11 years agokernel - Make VM fault waits in low memory the same as other low memory waits
Matthew Dillon [Sun, 3 Mar 2013 01:11:19 +0000 (17:11 -0800)]
kernel - Make VM fault waits in low memory the same as other low memory waits

* Nominal memory allocations, particularly by tmpfs, allow allocations
  down to the 'min' before waiting for memory to recover to 'target'.
  The VM fault code required memory to be at or above the 'target'
  at all times.  This led to extreme starvation because other user-accessible
  subsystems could force free memory to remain below 'target'.

* Change the VM code to use substantially the same down-to 'min' and
  recover-to 'target' parameters that other subsystems use.  This
  should reduce the excessive stalls under low memory conditions.

* Rename vm_waitpfault() to vm_wait_pfault() to conform with other
  naming schemes in the same API.

11 years agokernel - Add swap block allocation iterator
Matthew Dillon [Sun, 3 Mar 2013 01:03:17 +0000 (17:03 -0800)]
kernel - Add swap block allocation iterator

* Instead of allocating the first available block the swap allocator
  now has an iterator and attempts to allocate a block near the iterator.
  On failure the iterator resets to the beginning of swap (0) and it
  tries again.

* This theoretically should result in more linearized allocations of
  swap space, allowing the pageout daemon to flush memory to a
  hard-drive-based swap at much higher bandwidth.

* Greatly improves poudriere when using stressful memory parameters,
  at least in the first pass.

* There are still some obvious linearity issues that can occur once
  the iterator recycles back to 0 which need to be addressed.  However,
  this change is certainly not going to be worse and should
  prevent degenerative swap situations where performance winds up
  being permanently bad due to fragmented data laid down earlier that
  is never paged back into memory.

11 years agokernel - Abort pageout operations when free memory recovers
Matthew Dillon [Sat, 2 Mar 2013 06:07:51 +0000 (22:07 -0800)]
kernel - Abort pageout operations when free memory recovers

* Nominal pageout operations free memory.  On systems with large amounts
  of ram the pageout count can be very large and take a long time to
  clear.  During this period, other unrelated processes might free memory.
  But even when sufficient memory is freed the pageout daemon still tries
  to finish clearing its previously calculated number of pages.

* Add a check in the deactivation scan to break out of the loop if
  a sufficient number of free pages is detected.

* Fixes unnecessary extra paging out of data (which can go on for several
  minutes) on large systems when memory is freed by other means.

11 years agokernel - Fix tmpfs hogging of the VM system
Matthew Dillon [Sat, 2 Mar 2013 06:06:42 +0000 (22:06 -0800)]
kernel - Fix tmpfs hogging of the VM system

* tmpfs pretty much bypasses the buffer cache's normal clean/dirty
  handling.  Add appropriate VM paging wait states to prevent
  tmpfs operations from hogging free memory and causing other processes
  to stall for long periods of time in low memory situations.

11 years agokernel - Change namecache negative caching algorithm
Matthew Dillon [Sat, 2 Mar 2013 06:02:18 +0000 (22:02 -0800)]
kernel - Change namecache negative caching algorithm

* Use desiredvnodes instead of numcache (current number of namecache
  entries) to scale the number of negative cache entries.

  This allows for more negative cache entries and no longer has
  degenerate situations when the value of numcache is low.

* namecache entries are still cleaned up in the critical namecache
  paths, but vnlru() now also cleans up the namecache when it exceeds
  80% of its nominal maximum.  The result is that the namecache is
  kept under better control AND the cleanups are generally able to be
  handled by vnlru() and do not effect the critical paths.

* Huge improvement in poudriere during concurrent python easy_install
  execution.  The python easy_install performs horribly without sufficient
  negative caching.  This fixes that.

Reported-by: thesjg
11 years agokernel - remove PAGE RACE kprintf
Matthew Dillon [Sat, 2 Mar 2013 01:08:33 +0000 (17:08 -0800)]
kernel - remove PAGE RACE kprintf

* Used for debugging verification of the race, no longer needed.

Reported-by: tuxillo
11 years agoamd(4): Remove duplicate assignment.
Sascha Wildner [Fri, 1 Mar 2013 21:21:16 +0000 (22:21 +0100)]
amd(4): Remove duplicate assignment.

11 years agolibc/regex: Fix setting the maximum of the range.
Sascha Wildner [Fri, 1 Mar 2013 21:59:55 +0000 (22:59 +0100)]
libc/regex: Fix setting the maximum of the range.