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

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

* 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

Sepherosa Ziehau [Mon, 2 Jul 2012 02:33:54 +0000 (10:33 +0800)]

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

21 months agobge: Utilize new mii_probe()
Sepherosa Ziehau [Sun, 1 Jul 2012 23:26:11 +0000 (07:26 +0800)]
bge: Utilize new mii_probe()

Thus avoid local hacking about fixed PHY in miibus_{read,write}reg().

21 months agomii: Allow NIC drivers to pass more information to MII probe
Sepherosa Ziehau [Sun, 1 Jul 2012 23:17:30 +0000 (07:17 +0800)]
mii: Allow NIC drivers to pass more information to MII probe

- mii_capmask, which is used to mask out uninstended BMSR bits.
- At which PHYs that MII should perform probing and attching
- mii_flags, which will be used for future mii flow control support.

Th he above information could only be passed using new mii_probe(),
it should be used in the following way:

struct mii_probe_args mii_args;

mii_probe_args_init(&mii_args, ifmedia_upd, ifmedia_sts);
 * Adjust mii_args if necessary
error = mii_probe(dev, &mii_dev, &mii_args);

Inspired-by: FreeBSD 213878
21 months agomii: M_WAITOK should be enough
Sepherosa Ziehau [Sun, 1 Jul 2012 12:11:53 +0000 (20:11 +0800)]
mii: M_WAITOK should be enough

21 months agokernel/ddb: Remove an unused file.
Sascha Wildner [Sun, 1 Jul 2012 20:45:42 +0000 (22:45 +0200)]
kernel/ddb: Remove an unused file.

21 months agoAdd a DB_COMMAND(9) manual page (adapted from FreeBSD).
Sascha Wildner [Sun, 1 Jul 2012 20:41:44 +0000 (22:41 +0200)]
Add a DB_COMMAND(9) manual page (adapted from FreeBSD).

21 months agomakeobjops.awk: Fix comment, it's actually doxygen comments we skip here.
Sascha Wildner [Sun, 1 Jul 2012 12:03:55 +0000 (14:03 +0200)]
makeobjops.awk: Fix comment, it's actually doxygen comments we skip here.

21 months agomakeobjops.awk: Skip C comments (it helps us deal with newer .m files).
Sascha Wildner [Sun, 1 Jul 2012 11:54:19 +0000 (13:54 +0200)]
makeobjops.awk: Skip C comments (it helps us deal with newer .m files).

Reported-by: ftigeot
21 months agomii: Cleanup "return", no functional changes
Sepherosa Ziehau [Sun, 1 Jul 2012 11:27:10 +0000 (19:27 +0800)]
mii: Cleanup "return", no functional changes

21 months agomii: Hide miibus_{probe,attach,detach}
Sepherosa Ziehau [Sun, 1 Jul 2012 11:23:42 +0000 (19:23 +0800)]
mii: Hide miibus_{probe,attach,detach}

While im here, cleanup white space

21 months agoifmedia.4: Adjust for the last 802.11 upgrade.
Sascha Wildner [Sat, 30 Jun 2012 20:00:19 +0000 (22:00 +0200)]
ifmedia.4: Adjust for the last 802.11 upgrade.

21 months agoixgbe.4: Add a reference to ifmedia(4).
Sascha Wildner [Sat, 30 Jun 2012 19:42:02 +0000 (21:42 +0200)]
ixgbe.4: Add a reference to ifmedia(4).

21 months agoifmedia.4: Add some documentation about 10G settings (adapted from OpenBSD).
Sascha Wildner [Sat, 30 Jun 2012 19:41:04 +0000 (21:41 +0200)]
ifmedia.4: Add some documentation about 10G settings (adapted from OpenBSD).

21 months ago<net/if_media.h>: Add 10G descriptions (taken from FreeBSD).
Sascha Wildner [Sat, 30 Jun 2012 21:38:10 +0000 (23:38 +0200)]
<net/if_media.h>: Add 10G descriptions (taken from FreeBSD).

21 months agoifmedia.4: Sync with NetBSD.
Sascha Wildner [Sat, 30 Jun 2012 18:25:49 +0000 (20:25 +0200)]
ifmedia.4: Sync with NetBSD.

21 months agoixgbe: Import Intel PRO/10GbE driver from FreeBSD
Fran├žois Tigeot [Sat, 30 Jun 2012 14:50:07 +0000 (16:50 +0200)]
ixgbe: Import Intel PRO/10GbE driver from FreeBSD

Local changes:

* Disable LRO and TSO hardware optimizations, commenting out the code
  with #if 0 directives

* Disable VLAN hardware acceleration code as well

* Disable MSI-X code, only use one queue per port for now

* Use code from Sascha Wildner to create a per-port sysctl tree

Tested-with: 82599EB

21 months agoFix more wrong sizeof() usages, part 4/x
Sascha Wildner [Sat, 30 Jun 2012 08:44:33 +0000 (10:44 +0200)]
Fix more wrong sizeof() usages, part 4/x

We want struct sizes here, not pointer sizes.

Found-with: Coccinelle (http://coccinelle.lip6.fr/)

21 months agoigb: Reduce MSI/legacy interrupt rate limit to 6000
Sepherosa Ziehau [Sat, 30 Jun 2012 03:25:54 +0000 (11:25 +0800)]
igb: Reduce MSI/legacy interrupt rate limit to 6000

Should work well enough as far as I have tested.

21 months agoigb: Make sure EITR interval is within range
Sepherosa Ziehau [Sat, 30 Jun 2012 03:24:10 +0000 (11:24 +0800)]
igb: Make sure EITR interval is within range

Suggested-by: dillon@
21 months agoigb: Add MSI-X support
Sepherosa Ziehau [Sun, 17 Jun 2012 08:03:11 +0000 (16:03 +0800)]
igb: Add MSI-X support

- As many RX rings will be enabled, if they are allowed by the number of
  available MSI-X vectors and number of CPUs.
- RX MSI-X vectors could be grouped to specific CPU set.  However, the
  first CPU of the CPU set must be aligned on RX MSI-X vector count; by
  default RX MSI-X vectors are grouped according to the device's software
  unit number.  Tunable hw.igbX.msix.rxoff could be used to regroup RX
  MSI-X vector to a specific set of CPUs.
- TX ring uses seperate MSI-X if possible.  TX MSI-X vector could be bound
  to a specific CPU; bydefault TX MSI-X vectors is bound to the CPU based
  on the device's software unit number.  Tunable hw.igbX.msix.txoff could
  be used to bind TX MSI-X to a specific CPU.
- Per MSI-X vector interrupt moderation sysctl hw.igbX.msiY_rate is added.
  The default interrupt rate for TX is 4000, which is enough to generate
  1.48Mpps small packets.  The default interrupt rate for RX is 6000.
- MSI-X must not be enabled on 82575 according to the specification update
  from Intel.

21 months agobge: Don't prevent bge_init if IFF_RUNNING is set
Sepherosa Ziehau [Fri, 29 Jun 2012 10:56:20 +0000 (18:56 +0800)]
bge: Don't prevent bge_init if IFF_RUNNING is set

This probably was old code which intended to guard against if_init()
triggered by SIOCSIFADDR in ether_ioctl().  It no longer makes sense.

Also don't call bge_init() if MTU is changed but device is not running
yet (FreeBSD 213587).

21 months agobge: Improve 5785 performance
Sepherosa Ziehau [Fri, 29 Jun 2012 10:36:30 +0000 (18:36 +0800)]
bge: Improve 5785 performance

By allowing write DMA to request larger DMA burst size

Obtained-from: OpenBSD via FreeBSD 213333

21 months agobge: Reduce the number of dropped frames when flow-control is enabled
Sepherosa Ziehau [Fri, 29 Jun 2012 10:31:10 +0000 (18:31 +0800)]
bge: Reduce the number of dropped frames when flow-control is enabled

Set the number of RX frames to receive after RX MBUF low watermark
has reached.  Previously it dropped incoming frames once
RX MBUF low watermark has reached.  The value used in MAC RX MBUF
low watermark is greater than or equal to 4 so receiving two more
RX frames should not be a problem.

Obtained-from: OpenBSD via FreeBSD 213255

21 months agobge: Disable UDP hardware checksum
Sepherosa Ziehau [Fri, 29 Jun 2012 10:26:36 +0000 (18:26 +0800)]
bge: Disable UDP hardware checksum

Broadcom NetExtreme controllers always generate 0 UDP checksum.

Obtained-from: FreeBSD 211596

21 months agobge: Avoid using magic number
Sepherosa Ziehau [Fri, 29 Jun 2012 10:22:44 +0000 (18:22 +0800)]
bge: Avoid using magic number

Obtained-from: FreeBSD 210152

21 months agobge: Properly enable Data Fifo Protection for certain chips
Sepherosa Ziehau [Fri, 29 Jun 2012 10:19:50 +0000 (18:19 +0800)]
bge: Properly enable Data Fifo Protection for certain chips

Obtained-from: FreeBSD 210083

21 months agobge: Zero out the status block during initialization
Sepherosa Ziehau [Fri, 29 Jun 2012 08:26:35 +0000 (16:26 +0800)]
bge: Zero out the status block during initialization

Obtained-from: FreeBSD 209741

21 months agobge: For dual mode PHY controllers, make sure to enable GMII
Sepherosa Ziehau [Fri, 29 Jun 2012 08:16:54 +0000 (16:16 +0800)]
bge: For dual mode PHY controllers, make sure to enable GMII

Obtained-from: OpenBSD via FreeBSD 202293

21 months agobge: Don't touch jumbo frame registers on chips which do not support them
Sepherosa Ziehau [Fri, 29 Jun 2012 08:00:09 +0000 (16:00 +0800)]
bge: Don't touch jumbo frame registers on chips which do not support them

Obtained-from: FreeBSD 200228

Unlike above FreeBSD commit, we don't change mini ring handling

21 months agobge: Improve TX performance on certain low end chips
Sepherosa Ziehau [Fri, 29 Jun 2012 07:39:10 +0000 (15:39 +0800)]
bge: Improve TX performance on certain low end chips

These chips, e.g. BCM5761, only allow one outstanding DMA read operation,
so on TX path, mbuf chain should be packed to reduce number of DMA reads
from chip to improve performance.

hw.bgeX.force_defrag is added for PCI-E chips to enable this mbuf chain
packing.  It is not enabled by default.

Obtained-from: FreeBSD 200088

21 months agobge: Reduce status block device update size
Sepherosa Ziehau [Fri, 29 Jun 2012 07:06:54 +0000 (15:06 +0800)]
bge: Reduce status block device update size

This reduced the amount of data that device needs to DMAed into
host mmeory update status updating.

Obtained-from: FreeBSD 199679

Changes made to the above FreeBSD commit:
- We don't reduce the amount of host memory allocated for status block
- Properly comment why BCM5700 AX/BX need to have full status block
  update setting according to the Broadcom datasheet

21 months agobge: x86_64 does not have alignment constraint either
Sepherosa Ziehau [Fri, 29 Jun 2012 01:48:30 +0000 (09:48 +0800)]
bge: x86_64 does not have alignment constraint either

21 months agotop - Display threads when asked to
Alex Hornung [Thu, 28 Jun 2012 11:11:09 +0000 (12:11 +0100)]
top - Display threads when asked to

21 months agoMerge branch 'master' of git://git.dragonflybsd.org/dragonfly
Alex Hornung [Thu, 28 Jun 2012 10:53:08 +0000 (11:53 +0100)]
Merge branch 'master' of git://git.dragonflybsd.org/dragonfly

21 months agobge: Proper configure PCI-X for BCM5703/5704 devices
Sepherosa Ziehau [Thu, 28 Jun 2012 06:55:18 +0000 (14:55 +0800)]
bge: Proper configure PCI-X for BCM5703/5704 devices

Set maximum read byte count to 2048.  Also disable relaxed ordering
as recommended by data sheet for PCI-X devices.  For PCI-X BCM5704,
set maximum outstanding split transactions to 0 as indicated by

Obtained-from: FreeBSD 204978

21 months agobge: For BCM5703, limit DMA read watermark
Sepherosa Ziehau [Thu, 28 Jun 2012 06:45:58 +0000 (14:45 +0800)]
bge: For BCM5703, limit DMA read watermark

For BCM5703 in PCI-X mode, DMA read watermark should be less than
or equal to maximum read byte count configuration. Enforce this
limitation in DMA read watermark configuration.

Obtained-from: FreeBSD 204978

21 months agobge: Enable hardware fixes for BCM5704 B0 as recommended by datasheet.
Sepherosa Ziehau [Thu, 28 Jun 2012 06:18:21 +0000 (14:18 +0800)]
bge: Enable hardware fixes for BCM5704 B0 as recommended by datasheet.

Obtained-from: FreeBSD 204975

21 months agobge: Revert small part of f47afe1, which setup PHY bugs
Sepherosa Ziehau [Thu, 28 Jun 2012 06:10:47 +0000 (14:10 +0800)]
bge: Revert small part of f47afe1, which setup PHY bugs

21 months agobge: In bge_stop, don't isolate PHY; it is unnecessary
Sepherosa Ziehau [Thu, 28 Jun 2012 05:54:54 +0000 (13:54 +0800)]
bge: In bge_stop, don't isolate PHY; it is unnecessary

21 months agobge: Add busdma constraints for old chips
Sepherosa Ziehau [Thu, 28 Jun 2012 05:41:15 +0000 (13:41 +0800)]
bge: Add busdma constraints for old chips

- Most pre BCM5755 controllers have a DMA bug when buffer address
  crosses a multiple of the 4GB boundary
- For BCM5714/BCM5715 controllers, limit the DMA address to be within
  40bit address space.

Obtained-from: FreeBSD 199670

21 months agobge: Add missing bit of commit f47afe1
Sepherosa Ziehau [Thu, 28 Jun 2012 04:45:32 +0000 (12:45 +0800)]
bge: Add missing bit of commit f47afe1

21 months agobge: Limit BCM5701 B5 to 32-bit mode
Sepherosa Ziehau [Thu, 28 Jun 2012 03:40:17 +0000 (11:40 +0800)]
bge: Limit BCM5701 B5 to 32-bit mode

This is a workaround for a bug which causes data corruption in
combination with certain bridges.

Obtained-from: FreeBSD 185812

21 months agotcp: Add XMITNOW which bypasses the Nagle algorithm temporarily
Sepherosa Ziehau [Fri, 15 Jun 2012 09:54:59 +0000 (17:54 +0800)]
tcp: Add XMITNOW which bypasses the Nagle algorithm temporarily

This flag acts differently from ACKNOW that no pure ACK will be sent.
It is currently used by the (extended) limited transmit and the SACK
based fast recovery.

This flag is intended to fix the following bug in the SACK based fast
The NextSeg() requires that if the unACKed segments could not pass
IsLost(), previously unsent segment should be selected.  In the
application limited period, the size of the previously unsent segment
could be less than the MSS, thus it could not be sent immediately
according to the Nagle algorithm.  In our SACK based fast recovery
implementation, if the tcp_output() sends no segments, the current
recovery transmit process will stop immediately.  This could stop ACK
clock and cause timeout retransmit, which could be avoided, if the
Nagle algorithm is bypassed temporarily for the small unsent segment
selected by NextSeg().

When this flag is used with (extended) limited transmit, certain amount
of spurious early retranmits could be avoided.

21 months agolibrefuse: No puffs_fuse_unlink() function exists.
Sascha Wildner [Sun, 24 Jun 2012 17:21:00 +0000 (19:21 +0200)]
librefuse: No puffs_fuse_unlink() function exists.

21 months agolibpuffs: Comment out some info about a non-existant function.
Sascha Wildner [Sun, 24 Jun 2012 17:15:39 +0000 (19:15 +0200)]
libpuffs: Comment out some info about a non-existant function.

21 months agolibpuffs: Fix some function names in the manpages.
Sascha Wildner [Sun, 24 Jun 2012 17:14:59 +0000 (19:14 +0200)]
libpuffs: Fix some function names in the manpages.

21 months agofind(1): Revert back to using statfs.f_type again for fstype comparison.
Sascha Wildner [Sat, 23 Jun 2012 12:14:16 +0000 (14:14 +0200)]
find(1): Revert back to using statfs.f_type again for fstype comparison.

It was breaking the weekly locate database update. More investigation
is needed here.

While here, also bring back 00a0ead88e3b856b49bc34aa4c3d8b0d80940600
which was accidentally removed.

21 months agoMerge branch 'master' of git://git.dragonflybsd.org/dragonfly
Alex Hornung [Thu, 21 Jun 2012 07:34:54 +0000 (08:34 +0100)]
Merge branch 'master' of git://git.dragonflybsd.org/dragonfly

21 months agokernel: Clean up some Makefiles (custom flags, useless .PATH).
Sascha Wildner [Thu, 21 Jun 2012 07:16:32 +0000 (09:16 +0200)]
kernel: Clean up some Makefiles (custom flags, useless .PATH).

21 months agoFix more wrong sizeof() usages, part 3/x
Sascha Wildner [Thu, 21 Jun 2012 02:25:19 +0000 (04:25 +0200)]
Fix more wrong sizeof() usages, part 3/x

Some comments:

* The gzip fix speeds up uncompression of compress(1)'d files with gzip.
  A test here took 9s with the fix when it previously took 15s.

* Our OpenSSH is without J-PAKE support, hence the OpenSSH fix is only

Found-with: Coccinelle (http://coccinelle.lip6.fr/)