dragonfly.git
21 months agoCCVER: Add /usr/pkgsrc/lang/gcc-aux as 'gcc47'
John Marino [Mon, 9 Jul 2012 15:27:54 +0000 (17:27 +0200)]
CCVER: Add /usr/pkgsrc/lang/gcc-aux as 'gcc47'

There are two gcc-4.7.x packages in pkgsrc that will build gcc 4.7-based
compilers on Dragonfly.  One is located at lang/gcc47 and the other is
located at lang/gcc-aux.  Both have been patched by myself, but gcc-aux
seems to work better, especially with regards to link-time optimization.

Consequently, a new valid value for CCVER has been created, "gcc47", which
references lang/gcc-aux while building world and kernel.  Both will
compile, and the produced kernel will boot, but there are some network
issues.  Consequently, CCVER=gcc47 should only be used by developers who
have the express intent to fix any issues the arise from compiling
DragonFly sources with the latest GCC compiler.  Normal users looking
for non-base GCC compilers should stick with CCVER=gcc46 for now.

21 months agoLibc: Remove i386 gcc hack concerning popcountsi2
John Marino [Mon, 9 Jul 2012 17:59:01 +0000 (19:59 +0200)]
Libc: Remove i386 gcc hack concerning popcountsi2

Ref: 0cfd7e44b3676f6a43164acab0aaea46365b5c53
Ref: 4b548429247a10382073a0c227af306272160d8d

Back in Oct 2010, a "horrible hack" was added to libc in order to fix a
Firefox bug concerning a late dynamic link of a libcairo.so.2 symbol.  A
weak reference to popcountsi2 was added to i386 libc in order to force it
to be available.

Up through gcc 4.6, this hack worked because the symbol is global in the
libgcc.a library, but it's a hidden symbol starting with the gcc 4.7
version of libgcc.a.  This causes a build failure on bin/rmail while
building world with gcc 4.7.

Since Oct 2010, rtld has undergone significant changes.
With the hope that the issue is obsolete, the hack is being removed.
This allows gcc 4.7 to compile DragonFly world and kernel source.
We'll have to track firefox manually to verify the issue the hack fixed
doesn't return.

21 months agold/gold: Add link-time optimization plugin support
John Marino [Mon, 25 Jun 2012 16:39:37 +0000 (18:39 +0200)]
ld/gold: Add link-time optimization plugin support

The binutils 2.22 ld.bfd and ld.gold linkers were not configured to support
link-time optimization plugins (-plugin switch) previously.  This changeset
adds -plugin support to both linkers.  The ld.bfd linker was previously
built statically, but it was necessary to change this to use the libc and
libz shared libraries because the -plugin option requires the dynamic
function dlopen().

The same update was not applied to binutils 2.21 linkers.

21 months agokernel: Add descriptions to the intrhooks that miss them.
Sascha Wildner [Tue, 10 Jul 2012 16:33:44 +0000 (18:33 +0200)]
kernel: Add descriptions to the intrhooks that miss them.

The description is printed in the

"**WARNING** waiting for the following device to finish configuring: ..."

messages we occasionally see, from run_interrupt_driven_config_hooks(),
most of the times for xpt.

Some of them had been accidentally removed in past synchronizations with
FreeBSD (mostly by me).

21 months agoconfig_intrhook.9: Update struct intr_config_hook to ours.
Sascha Wildner [Tue, 10 Jul 2012 14:16:13 +0000 (16:16 +0200)]
config_intrhook.9: Update struct intr_config_hook to ours.

21 months ago<sys/kernel.h>: Remove unused sysinit id.
Sascha Wildner [Tue, 10 Jul 2012 13:46:47 +0000 (15:46 +0200)]
<sys/kernel.h>: Remove unused sysinit id.

21 months agoamr(4): Remove unused code.
Sascha Wildner [Tue, 10 Jul 2012 07:23:57 +0000 (09:23 +0200)]
amr(4): Remove unused code.

21 months agoamr(4): Remove some old code.
Sascha Wildner [Mon, 9 Jul 2012 19:43:46 +0000 (21:43 +0200)]
amr(4): Remove some old code.

21 months agoBring in the config_intrhook(9) manual page from FreeBSD.
Sascha Wildner [Mon, 9 Jul 2012 19:07:13 +0000 (21:07 +0200)]
Bring in the config_intrhook(9) manual page from FreeBSD.

21 months agokernel/amrp: Add a missing dependency.
Sascha Wildner [Mon, 9 Jul 2012 18:06:00 +0000 (20:06 +0200)]
kernel/amrp: Add a missing dependency.

21 months agotwa(4): Remove an extra : in a message (it will be automatically added).
Sascha Wildner [Mon, 9 Jul 2012 16:14:10 +0000 (18:14 +0200)]
twa(4): Remove an extra : in a message (it will be automatically added).

21 months agotwa(4): Request a bus scan after attaching the driver to CAM.
Sascha Wildner [Mon, 9 Jul 2012 16:04:04 +0000 (18:04 +0200)]
twa(4): Request a bus scan after attaching the driver to CAM.

Our CAM doesn't (yet) do this by default.

This fixes disk detection upon kldload.

Taken-from: FreeBSD (which has since moved it to CAM).

While here, add a cam_simq_release() I forgot and remove a comment that
does not apply to us.

21 months agotwa(4)/twe(4): Move dev_ops_remove_minor() after destroy_dev().
Sascha Wildner [Sun, 8 Jul 2012 23:07:10 +0000 (01:07 +0200)]
twa(4)/twe(4): Move dev_ops_remove_minor() after destroy_dev().

Fixes crash on module unload.

21 months agotwa(4): Really stop the callouts.
Sascha Wildner [Sun, 8 Jul 2012 23:05:37 +0000 (01:05 +0200)]
twa(4): Really stop the callouts.

21 months agotwa(4): Remove some unused code.
Sascha Wildner [Sun, 8 Jul 2012 21:58:08 +0000 (23:58 +0200)]
twa(4): Remove some unused code.

21 months agotwa(4): Add MSI support.
Sascha Wildner [Sun, 8 Jul 2012 21:33:20 +0000 (23:33 +0200)]
twa(4): Add MSI support.

It's off by default, set hw.twa.msi.enable to 1 in /boot/loader.conf to
try it out.

It works here with a 3ware 9650SE-2LP.

21 months agotwa(4): Add MODULE_VERSION.
Sascha Wildner [Sun, 8 Jul 2012 21:01:19 +0000 (23:01 +0200)]
twa(4): Add MODULE_VERSION.

21 months agotwa(4): Pass INTR_MPSAFE when setting up the interrupt.
Sascha Wildner [Sun, 8 Jul 2012 20:39:48 +0000 (22:39 +0200)]
twa(4): Pass INTR_MPSAFE when setting up the interrupt.

I removed it by mistake during porting.

While here, add some little fixes from FreeBSD.

Tested-with: 3ware 9650SE-2LP

21 months agolibkern - Add memcchr(9).
Antonio Huete Jimenez [Sun, 8 Jul 2012 12:37:50 +0000 (14:37 +0200)]
libkern - Add memcchr(9).

* It can be used for filesystem bitmap operations.
* FreeBSD introduced it to replace calls to skpc().
* It does compare entire words instead of single bytes.

Taken from: FreeBSD-SVN 229198

21 months agomdoc.local: Add FreeBSD 10.0.
Antonio Huete Jimenez [Sun, 8 Jul 2012 10:59:13 +0000 (12:59 +0200)]
mdoc.local: Add FreeBSD 10.0.

21 months agobge: Split if_bgereg.h into if_bgereg.h and if_bgevar.h
Sepherosa Ziehau [Sun, 8 Jul 2012 09:15:57 +0000 (17:15 +0800)]
bge: Split if_bgereg.h into if_bgereg.h and if_bgevar.h

if_bgevar.h conains only software related structs and macros

21 months agoif_bgereg.h: Add header guardian
Sepherosa Ziehau [Sun, 8 Jul 2012 05:33:06 +0000 (13:33 +0800)]
if_bgereg.h: Add header guardian

21 months agobge: Cosmetic cleanup
Sepherosa Ziehau [Sun, 8 Jul 2012 05:28:43 +0000 (13:28 +0800)]
bge: Cosmetic cleanup

21 months agotermcap.5: Bring in some mdoc fixes from FreeBSD.
Sascha Wildner [Sat, 7 Jul 2012 23:29:54 +0000 (01:29 +0200)]
termcap.5: Bring in some mdoc fixes from FreeBSD.

21 months agosln.4: Add ifmedia(4) reference.
Sascha Wildner [Sat, 7 Jul 2012 22:49:45 +0000 (00:49 +0200)]
sln.4: Add ifmedia(4) reference.

21 months agobce: Enabling MSI or MSI-X in interrupt handler does not need to mask first
Sepherosa Ziehau [Sat, 7 Jul 2012 14:16:49 +0000 (22:16 +0800)]
bce: Enabling MSI or MSI-X in interrupt handler does not need to mask first

This reduce number of register writing operation during interrupt handling

According-to: bnx2

21 months agobge: Remove unused structs and macros
Sepherosa Ziehau [Sat, 7 Jul 2012 09:08:26 +0000 (17:08 +0800)]
bge: Remove unused structs and macros

21 months agobrgphy: Remove debug prints
Sepherosa Ziehau [Sat, 7 Jul 2012 08:34:47 +0000 (16:34 +0800)]
brgphy: Remove debug prints

21 months agobge/bce: Use mii private data to pass various flags to brgphy
Sepherosa Ziehau [Sat, 7 Jul 2012 08:15:29 +0000 (16:15 +0800)]
bge/bce: Use mii private data to pass various flags to brgphy

This unbreaks if_name support on bce(4) and bge(4).  And this mechanism
is cleaner and easier to extend than checking if_name and accessing
NIC drivers' softc.

21 months agomii: Add private data tag and save private data into mii_softc
Sepherosa Ziehau [Sat, 7 Jul 2012 07:12:30 +0000 (15:12 +0800)]
mii: Add private data tag and save private data into mii_softc

While im here, add comment for the fields of mii_probe_args

21 months agoigb: Add comment for WTHRESH and header write back mode.
Sepherosa Ziehau [Sat, 7 Jul 2012 06:35:52 +0000 (14:35 +0800)]
igb: Add comment for WTHRESH and header write back mode.

21 months agoigb: Update comment about errata number
Sepherosa Ziehau [Sat, 7 Jul 2012 06:16:03 +0000 (14:16 +0800)]
igb: Update comment about errata number

21 months agoem/emx: Update comment concerning errata number
Sepherosa Ziehau [Sat, 7 Jul 2012 06:11:24 +0000 (14:11 +0800)]
em/emx: Update comment concerning errata number

21 months agoem: Fix "Missing Interrupt Following ICR read" errata
Sepherosa Ziehau [Sat, 7 Jul 2012 05:47:43 +0000 (13:47 +0800)]
em: Fix "Missing Interrupt Following ICR read" errata

IMS should be set to 0 before reading ICR.  It should be noted that
once IMS is 0, ICR.INT_ASSERTED will not be set, which is not mentioned
in the datasheet.

This errata exists on 82571, 82572, 82573, 82574 and 82583.  And the fix
is needed only if the legacy interrupt is used and the interrupt line is
shared with other devices.

hw.emX.irq.unshared tunable is added to give a hint to the driver that
the legacy interrupt is not shared with other devices.

21 months agoemx: Fix "Missing Interrupt Following ICR read" errata
Sepherosa Ziehau [Sat, 7 Jul 2012 05:24:52 +0000 (13:24 +0800)]
emx: Fix "Missing Interrupt Following ICR read" errata

IMS should be set to 0 before reading ICR.  It should be noted that
once IMS is 0, ICR.INT_ASSERTED will not be set, which is not mentioned
in the datasheet.

This errata exists on 82571, 82572, 82573, 82574 and 82583, while 82583
is not covered by emx(4).  And the fix is needed only if the legacy
interrupt is used and the interrupt line is shared with other devices.

hw.emxX.irq.unshared tunable is added to give a hint to the driver that
the legacy interrupt is not shared with other devices.

21 months agoigb: Move shared interrupt configure to igb_alloc_intr()
Sepherosa Ziehau [Fri, 6 Jul 2012 07:10:55 +0000 (15:10 +0800)]
igb: Move shared interrupt configure to igb_alloc_intr()

So resource allocation flags could be setup properly

21 months agokernel/vm: Remove some unused variables.
Sascha Wildner [Fri, 6 Jul 2012 23:14:11 +0000 (01:14 +0200)]
kernel/vm: Remove some unused variables.

21 months agokernel/gpio: Return EINVAL for GPIOPINUNSET and simplify a bit.
Sascha Wildner [Fri, 6 Jul 2012 17:43:50 +0000 (19:43 +0200)]
kernel/gpio: Return EINVAL for GPIOPINUNSET and simplify a bit.

21 months agopst(4): Remove a bogus (commented out) debug option from the Makefile.
Sascha Wildner [Fri, 6 Jul 2012 12:37:20 +0000 (14:37 +0200)]
pst(4): Remove a bogus (commented out) debug option from the Makefile.

21 months agosdpd(8): Fix a wrong sizeof.
Sascha Wildner [Fri, 6 Jul 2012 12:09:49 +0000 (14:09 +0200)]
sdpd(8): Fix a wrong sizeof.

21 months agomake upgrade: Remove a netgraph7 header that was moved.
Sascha Wildner [Fri, 6 Jul 2012 09:25:19 +0000 (11:25 +0200)]
make upgrade: Remove a netgraph7 header that was moved.

21 months agokernel - remove dead code in busdma
Markus Pfeiffer [Fri, 6 Jul 2012 08:40:17 +0000 (08:40 +0000)]
kernel - remove dead code in busdma

Remove some superflous code inserted in previous commit to
add BUS_DMA_KEEP_PG_OFFSET (x86_64)

21 months agokernel/sbuf: Add back a lost newline.
Sascha Wildner [Thu, 5 Jul 2012 19:16:18 +0000 (21:16 +0200)]
kernel/sbuf: Add back a lost newline.

21 months agoRemove tools/tools/mid (Message-ID/In-Reply-To db thingy we don't need).
Sascha Wildner [Thu, 5 Jul 2012 18:48:41 +0000 (20:48 +0200)]
Remove tools/tools/mid (Message-ID/In-Reply-To db thingy we don't need).

21 months agoCreate if_*(4) MLINKS for all network interface manual pages.
Sascha Wildner [Thu, 5 Jul 2012 15:48:54 +0000 (17:48 +0200)]
Create if_*(4) MLINKS for all network interface manual pages.

The modules are called if_*.ko for those, so follow the principle that
the user generally should be able to do 'man foo' for any 'foo.ko'.

Inspired-by: FreeBSD
21 months agoman4.i386/Makefile: Break lines.
Sascha Wildner [Thu, 5 Jul 2012 15:10:57 +0000 (17:10 +0200)]
man4.i386/Makefile: Break lines.

21 months agoAdd an MLINKS for ic(4) (it is documented in iicbus(4)).
Sascha Wildner [Thu, 5 Jul 2012 15:25:06 +0000 (17:25 +0200)]
Add an MLINKS for ic(4) (it is documented in iicbus(4)).

21 months agomdoc: Reorder manpage sections to keep them consistent.
Nuno Antunes [Thu, 5 Jul 2012 13:28:36 +0000 (14:28 +0100)]
mdoc: Reorder manpage sections to keep them consistent.

* Keep CAVEATS and BUGS sections at the end of the pages.
* EXIT STATUS section should come after ENVIRONMENT.

Found-with: mandoc -Tlint
Reviewed-by: Sacha Wildner <swildner@>
21 months agokernel - busdma.h correct whitespace and add description
Markus Pfeiffer [Thu, 5 Jul 2012 13:14:01 +0000 (13:14 +0000)]
kernel - busdma.h correct whitespace and add description

21 months agodpt(4): Remove some old #if 0'd code from a header file.
Sascha Wildner [Thu, 5 Jul 2012 12:46:30 +0000 (14:46 +0200)]
dpt(4): Remove some old #if 0'd code from a header file.

21 months agomdoc: Silence a few mdocml (mandoc) warnings and errors.
Nuno Antunes [Thu, 5 Jul 2012 07:00:14 +0000 (08:00 +0100)]
mdoc: Silence a few mdocml (mandoc) warnings and errors.

* Move CAVEATS section to the end of the page.
* Miscelaneous other fixes (taken from FreeBSD).
* Bump dates.

Found-with: mandoc -Tlint

21 months agonetgraph7/ng_tty: Remove two unused #define's.
Nuno Antunes [Wed, 4 Jul 2012 18:31:37 +0000 (19:31 +0100)]
netgraph7/ng_tty: Remove two unused #define's.

21 months agonetgraph7: Cleanup the Makefile.
Nuno Antunes [Wed, 4 Jul 2012 11:59:54 +0000 (12:59 +0100)]
netgraph7: Cleanup the Makefile.

* netgraph base and ng_socket node are already ported and listed
  in the Makefile. Remove the redundant commented lines.

21 months agoppp(8): Use netgraph7 tty node when WANT_NETGRAPH7 make variable is defined.
Nuno Antunes [Wed, 4 Jul 2012 11:46:06 +0000 (12:46 +0100)]
ppp(8): Use netgraph7 tty node when WANT_NETGRAPH7 make variable is defined.

* Now that netgraph7's ng_tty node is ported we can use it instead of
  legacy netgraph's node. This fixes the hack introduced in commit
  f0f93f7f2d479e18fe43625ce59583ba7a773bf2.

21 months agonetgraph7: Welcome ng_tty.
Nuno Antunes [Wed, 4 Jul 2012 08:48:55 +0000 (09:48 +0100)]
netgraph7: Welcome ng_tty.

21 months agoem/emx: Correct ASPM settings for 82571/82572/82573
Sepherosa Ziehau [Thu, 5 Jul 2012 07:22:42 +0000 (15:22 +0800)]
em/emx: Correct ASPM settings for 82571/82572/82573

21 months agoemx: Don't enable MSI on 82571/82572
Sepherosa Ziehau [Thu, 5 Jul 2012 06:48:40 +0000 (14:48 +0800)]
emx: Don't enable MSI on 82571/82572

You could still forcefully enable MSI by using hw.emX.msi.enable;
useful certain systems

Obtained-from: OpenBSD

21 months agoem: Don't enable MSI on non-PCIe chips and 82571/82572
Sepherosa Ziehau [Thu, 5 Jul 2012 06:40:46 +0000 (14:40 +0800)]
em: Don't enable MSI on non-PCIe chips and 82571/82572

You could still forcefully enable MSI by using hw.emX.msi.enable;
useful for 82571/82572 on certain systems

Obtained-from: OpenBSD

21 months agobge: Add commented out code to set "clear ticks upon TX"
Sepherosa Ziehau [Thu, 5 Jul 2012 02:37:40 +0000 (10:37 +0800)]
bge: Add commented out code to set "clear ticks upon TX"

As far as I have tested, this coalesce mode does not have visiable
effect on both TX performance and interrupt rate.

To ease further tuning, the current TX performance and interrupt
rate that I have gathered on BCM5750 B1:
1472B UDP datagram   perf: 957Mbps, intr rate: ~1200Hz
18B   UDP datagram   perf: 565Kpps, intr rate: ~4400Hz

21 months agobge: Define clear ticks upon RX/TX for host coalesce mode register
Sepherosa Ziehau [Thu, 5 Jul 2012 02:35:28 +0000 (10:35 +0800)]
bge: Define clear ticks upon RX/TX for host coalesce mode register

21 months agobge: Add BGE_IS_CRIPPLED to test BCM5788 and BCM5700
Sepherosa Ziehau [Wed, 4 Jul 2012 12:19:41 +0000 (20:19 +0800)]
bge: Add BGE_IS_CRIPPLED to test BCM5788 and BCM5700

21 months agobge: Make sure coalesce parameters are in sane range
Sepherosa Ziehau [Wed, 4 Jul 2012 10:56:33 +0000 (18:56 +0800)]
bge: Make sure coalesce parameters are in sane range

21 months agobge: Increase default RX coalesce to 160us (~6000Hz)
Sepherosa Ziehau [Wed, 4 Jul 2012 09:55:45 +0000 (17:55 +0800)]
bge: Increase default RX coalesce to 160us (~6000Hz)

21 months agobge: Correct comment
Sepherosa Ziehau [Wed, 4 Jul 2012 09:32:09 +0000 (17:32 +0800)]
bge: Correct comment

21 months agobge: Factor our bge_link_poll()
Sepherosa Ziehau [Wed, 4 Jul 2012 09:23:26 +0000 (17:23 +0800)]
bge: Factor our bge_link_poll()

21 months agobge: Add comment about coalesce parameters during interrupt
Sepherosa Ziehau [Wed, 4 Jul 2012 09:15:24 +0000 (17:15 +0800)]
bge: Add comment about coalesce parameters during interrupt

21 months agokernel - Correct whitespace in BUS_DMA_KEEP_PG_OFFSET (x86_64)
Markus Pfeiffer [Wed, 4 Jul 2012 21:27:17 +0000 (21:27 +0000)]
kernel - Correct whitespace in BUS_DMA_KEEP_PG_OFFSET (x86_64)

21 months agomii: add AGERE ET1011 phy
Markus Pfeiffer [Wed, 4 Jul 2012 20:54:55 +0000 (20:54 +0000)]
mii: add AGERE ET1011 phy

21 months agokernel - Add BUS_DMA_KEEP_PG_OFFSET (i386)
Markus Pfeiffer [Wed, 4 Jul 2012 13:31:38 +0000 (13:31 +0000)]
kernel - Add BUS_DMA_KEEP_PG_OFFSET (i386)

Add BUS_DMA_KEEP_PG_OFFSET from FreeBSD in preparation of import of
FreeBSD's USB stack

21 months agokernel - Add BUS_DMA_KEEP_PG_OFFSET (x86_64)
Markus Pfeiffer [Wed, 4 Jul 2012 13:21:25 +0000 (13:21 +0000)]
kernel - Add BUS_DMA_KEEP_PG_OFFSET (x86_64)

Add BUS_DMA_KEEP_PG_OFFSET from FreeBSD in preparation of import of
FreeBSD's USB stack

21 months agokernel: add handling for ENODEV in poll_copyout and select_copyout
Markus Pfeiffer [Wed, 4 Jul 2012 13:12:46 +0000 (13:12 +0000)]
kernel: add handling for ENODEV in poll_copyout and select_copyout

21 months agoMerge branch 'vendor/FILE'
Peter Avalos [Wed, 4 Jul 2012 07:55:58 +0000 (00:55 -0700)]
Merge branch 'vendor/FILE'

21 months agoImport file-5.11. vendor/FILE
Peter Avalos [Wed, 4 Jul 2012 07:49:04 +0000 (00:49 -0700)]
Import file-5.11.

* Fix CDF parsing issues.

21 months agobge: Enable "tagged status" on non-BCM5788 and non-BCM5700 chips
Sepherosa Ziehau [Tue, 3 Jul 2012 09:39:58 +0000 (17:39 +0800)]
bge: Enable "tagged status" on non-BCM5788 and non-BCM5700 chips

By using "tagged status", we could:
- Detect whether the interrupt is for us or not.
- Avoid MAC_STS register read upon every interrupt.

Some implementation note:
- Interrupt must be disabled during interrupt handing, if "tagged status"
  is used, else the interrupt will be kept asserted.  This is the case at
  least on BCM5750 AX/BX.
- Coalesce parameters during interrupt must be properly configured; when
  "tagged status" is used we have "in interrupt" state.

Tunable hw.bgeX.status_tag is added to prevent driver from using "tagged
status".  hw.bgeX.{rx,tx}_coal_bds_int and hw.bgeX.{rx,tx}_coal_ticks_int
sysctls are added to tune "in interrupt" coalesce parameters.

21 months agokernel - reduce kernel stack use (2)
Matthew Dillon [Tue, 3 Jul 2012 17:42:03 +0000 (10:42 -0700)]
kernel - reduce kernel stack use (2)

* Correct hanging allocation on kldunload from previous commit.

* Rearrange the flow of the code a little for the exit case.

21 months agokernel - reduce kernel stack use
Matthew Dillon [Tue, 3 Jul 2012 17:22:09 +0000 (10:22 -0700)]
kernel - reduce kernel stack use

* fq_dispatcher() was eating 8K+ of kernel stack on x86-64 with a
  (512 x sizeof(pointer) * 2) sized array.  This is way too much kernel
  stack.

* Add a safety to the hz calculation in the lksleep() for hz values < 15.
  vkernels already use low hz values of ~20-ish.

Reported-by: swildner
21 months agomii: Wrong sizeof
Sepherosa Ziehau [Tue, 3 Jul 2012 08:18:21 +0000 (16:18 +0800)]
mii: Wrong sizeof

Pointed-by: swildner@
21 months agobge: BGE_PCI_MISC_CTL resides in PCI configuration space
Sepherosa Ziehau [Tue, 3 Jul 2012 06:27:19 +0000 (14:27 +0800)]
bge: BGE_PCI_MISC_CTL resides in PCI configuration space

21 months agobge: Regroup code, no functional changes
Sepherosa Ziehau [Tue, 3 Jul 2012 05:34:33 +0000 (13:34 +0800)]
bge: Regroup code, no functional changes

- Regroup chip information and bugs setup code
- Regroup MII information setup code

21 months agosbuf_vprintf: ap is not consistent at second call of kvsnprintf. Use a copy
Mihai Carabas [Sun, 1 Jul 2012 19:18:25 +0000 (22:18 +0300)]
sbuf_vprintf: ap is not consistent at second call of kvsnprintf. Use a copy

21 months agobge: Don't force PCI Express TLP to be 128 bytes
Sepherosa Ziehau [Mon, 2 Jul 2012 08:43:41 +0000 (16:43 +0800)]
bge: Don't force PCI Express TLP to be 128 bytes

Instead, status errors are cleared and "no snoop" and "relaxed ordering"
are disabled.

Obtained-from: FreeBSD 235821

21 months agopci: Add more definition for PCI Express device {control,status} registers
Sepherosa Ziehau [Mon, 2 Jul 2012 08:42:59 +0000 (16:42 +0800)]
pci: Add more definition for PCI Express device {control,status} registers

21 months agobge: Workaround mbox write reordering for PCI-X devices
Sepherosa Ziehau [Mon, 2 Jul 2012 08:20:05 +0000 (16:20 +0800)]
bge: Workaround mbox write reordering for PCI-X devices

Add per device tunable hw.bgeX.mbox_reorder to control this; it is
off by default.

Based-on: FreeBSD 232848

21 months agobge: If chip has CPMU, let it handle GPHY power down
Sepherosa Ziehau [Mon, 2 Jul 2012 08:14:35 +0000 (16:14 +0800)]
bge: If chip has CPMU, let it handle GPHY power down

Obtained-from: FreeBSD 226804

21 months agobge: Always enable buffer manager
Sepherosa Ziehau [Mon, 2 Jul 2012 08:11:44 +0000 (16:11 +0800)]
bge: Always enable buffer manager

Also make sure various blocks are stopped in bge_stop()

Obtained-from: NetBSD via FreeBSD 221712

21 months agobge: Workaround BCM5906 chip bug
Sepherosa Ziehau [Mon, 2 Jul 2012 07:56:59 +0000 (15:56 +0800)]
bge: Workaround BCM5906 chip bug

When auto-negotiation results in half-duplex operation, excess collision
on the ethernet link may cause internal chip delays that may result in
subsequent valid frames being dropped due to insufficient receive buffer
resources.  The workaround is to choose de-pipeline method as a flow
control decision for SDI.  De-pipeline method allows only 1 data in TxMbuf
at a time such that a request to RDMA from SDI is made only when TxMbuf
is empty.

Obtained-from: FreeBSD 214219

21 months agobge: Enable hardware patch for TX MAC lockup on BCM5755+ and BCM5906
Sepherosa Ziehau [Mon, 2 Jul 2012 07:49:22 +0000 (15:49 +0800)]
bge: Enable hardware patch for TX MAC lockup on BCM5755+ and BCM5906

Obtained-from: FreeBSD 214216

21 months agobge: Workaround "short DMA" bug on certain chips
Sepherosa Ziehau [Mon, 2 Jul 2012 07:45:30 +0000 (15:45 +0800)]
bge: Workaround "short DMA" bug on certain chips

If controllers receive two back-to-back send BDs with less than or equal
to 8 total bytes then the device may hang.  The two back-to-back send
BDs must be in the same frame for this failure to occur.

Obtained-from: FreeBSD 214087

21 months agobge: Avoid accessing invalid internal memory region on BCM5906
Sepherosa Ziehau [Mon, 2 Jul 2012 07:12:20 +0000 (15:12 +0800)]
bge: Avoid accessing invalid internal memory region on BCM5906

Obtained-from: FreeBSD 213747

21 months agobge: Properly configure receive and send RCBs
Sepherosa Ziehau [Mon, 2 Jul 2012 06:59:48 +0000 (14:59 +0800)]
bge: Properly configure receive and send RCBs

- More comment
- Limit receive and RCBs accessing according to chip type
- Always configure send RCB
- Move producer RX ring index resetting to the proper place

Obtained-from: FreeBSD 213495

21 months agobge: Force interrupt if link status changes
Sepherosa Ziehau [Mon, 2 Jul 2012 06:19:20 +0000 (14:19 +0800)]
bge: Force interrupt if link status changes

Obtained-from: FreeBSD 178785

21 months agobge: Rework MII register accessing and auto-polling support
Sepherosa Ziehau [Mon, 2 Jul 2012 05:30:04 +0000 (13:30 +0800)]
bge: Rework MII register accessing and auto-polling support

Obtained-from: FreeBSD 213485 213710 213808 213812

21 months agoixgbe.4: Remove trailing whitespace.
Sascha Wildner [Mon, 2 Jul 2012 08:13:02 +0000 (10:13 +0200)]
ixgbe.4: Remove trailing whitespace.

21 months agobge: Adjust PHY workaround settings
Sepherosa Ziehau [Mon, 2 Jul 2012 02:56:27 +0000 (10:56 +0800)]
bge: Adjust PHY workaround settings

Obtained-from: OpenBSD if_bge.c 1.309

21 months agomii: Define MII_PROBEMASK_DEFAULT and MII_CAPMASK_DEFAULT
Sepherosa Ziehau [Mon, 2 Jul 2012 02:33:54 +0000 (10:33 +0800)]
mii: Define MII_PROBEMASK_DEFAULT and MII_CAPMASK_DEFAULT

Avoid using magic number

21 months agobge/brgphy: Split PHY flags out of main flags
Sepherosa Ziehau [Mon, 2 Jul 2012 02:10:36 +0000 (10:10 +0800)]
bge/brgphy: Split PHY flags out of main flags

21 months ago<net/if_media.h>: Add 10Gb ethernet baudrate descriptions.
Sascha Wildner [Mon, 2 Jul 2012 02:02:46 +0000 (04:02 +0200)]
<net/if_media.h>: Add 10Gb ethernet baudrate descriptions.

21 months agokernel/net: On i386, make the interface baudrate 64 bits in a few places.
Sascha Wildner [Mon, 2 Jul 2012 02:02:31 +0000 (04:02 +0200)]
kernel/net: On i386, make the interface baudrate 64 bits in a few places.

For 10Gb ethernet.

For ifi_baudrate in struct if_data (which is public), NetBSD uses
uint64_t too, so no pkgsrc breakage is expected. However, a few
i386 binary packages we offer might be broken now on master.

Discussed-with: sephe

21 months agobge: Enable fix for read DMA FIFO overruns on certain controllers
Sepherosa Ziehau [Mon, 2 Jul 2012 01:49:15 +0000 (09:49 +0800)]
bge: Enable fix for read DMA FIFO overruns on certain controllers

Obtained-from: FreeBSD 213411

21 months agobge: NetExtreme/NetLink controllers require memory not across 4G boundary
Sepherosa Ziehau [Mon, 2 Jul 2012 01:28:13 +0000 (09:28 +0800)]
bge: NetExtreme/NetLink controllers require memory not across 4G boundary

Obtained-from: FreeBSD 226805