Commit Graph

83861 Commits

Author SHA1 Message Date
Pyun YongHyeon
3c20120066 Rename BGE_FW_DRV_ALIVE/BGE_FW_PAUSE to BGE_FW_CMD_DRV_ALIVE/BGE_FW_CMD_PAUSE.
Also add more firmware commands(not used yet).
No functional changes.
2011-10-27 20:54:53 +00:00
Doug Barton
cec6213598 Fix svnversion for svn 1.7.x by not looking for .svn in ${SYSDIR} (since
it no longer exists). Instead, run svnversion if we can find the binary
and test that the output looks like a version string.

Reviewed by:	discussion on -current@
Tested by:	rodrigc for non-svn case (thanks!)
2011-10-27 20:44:28 +00:00
John Baldwin
464ff7d223 Sort function prototypes. 2011-10-27 17:44:51 +00:00
John Baldwin
62238a6791 Whitespace fix. 2011-10-27 17:43:36 +00:00
Alan Cox
125b695b6e Tidy up the comment at the head of vm_page_alloc, and mention that the
returned page has the flag VPO_BUSY set.
2011-10-27 17:29:19 +00:00
Alan Cox
703dec68bf Eliminate vestiges of page coloring in VM_ALLOC_NOOBJ calls to
vm_page_alloc().  While I'm here, for the sake of consistency, always
specify the allocation class, such as VM_ALLOC_NORMAL, as the first of
the flags.
2011-10-27 16:39:17 +00:00
Pawel Jakub Dawidek
0c879bd990 Before this change when GELI detected hardware crypto acceleration it will
start only one worker thread. For software crypto it will start by default
N worker threads where N is the number of available CPUs.

This is not optimal if hardware crypto is AES-NI, which uses CPU for AES
calculations.

Change that to always start one worker thread for every available CPU.
Number of worker threads per GELI provider can be easly reduced with
kern.geom.eli.threads sysctl/tunable and even for software crypto it
should be reduced when using more providers.

While here, when number of threads exceeds number of CPUs avilable don't
reduce this number, assume the user knows what he is doing.

Reported by:	Yuri Karaban <dev@dev97.com>
MFC after:	3 days
2011-10-27 16:12:25 +00:00
Pawel Jakub Dawidek
14a0d24607 Update Copyright.
MFC after:	3 days
2011-10-27 14:15:26 +00:00
Pawel Jakub Dawidek
5fa1b35081 Improve AES-NI performance for AES-XTS:
- Operate on uint64_t types when doing XORing, etc. instead of uint8_t.
- Don't bzero() temporary block for every AES block. Do it once for entire
  data block.
- AES-NI is available only on little endian architectures. Simplify code
  that takes block number from IV.

Benchmarks:

Memory-backed md(4) device, software AES-XTS, 4kB sector:

	# dd if=/dev/md0.eli bs=1m
	59.61MB/s

Memory-backed md(4) device, old AES-NI AES-XTS, 4kB sector:

	# dd if=/dev/md0.eli bs=1m
	97.29MB/s

Memory-backed md(4) device, new AES-NI AES-XTS, 4kB sector:

	# dd if=/dev/md0.eli bs=1m
	221.26MB/s

127% performance improvement between old and new code.

Harddisk, raw speed:

	# dd if=/dev/ada0 bs=1m
	137.63MB/s

Harddisk, software AES-XTS, 4kB sector:

	# dd if=/dev/ada0.eli bs=1m
	47.83MB/s (34% of raw disk speed)

Harddisk, old AES-NI AES-XTS, 4kB sector:

	# dd if=/dev/ada0.eli bs=1m
	68.33MB/s (49% of raw disk speed)

Harddisk, new AES-NI AES-XTS, 4kB sector:

	# dd if=/dev/ada0.eli bs=1m
	108.35MB/s (78% of raw disk speed)

58% performance improvement between old and new code.

As a side-note, GELI with AES-NI using AES-CBC can achive native disk speed.

MFC after:	3 days
2011-10-27 14:07:57 +00:00
Ken Smith
6168545a11 Adjust the debugger options slightly. This should help me do the right
thing when changing the debugging options as part of head becoming a new
stable branch.  It may also help people who for one reason or another want
to run head but don't want it slowed down by the debugging support.

Reviewed by:	kib
2011-10-27 13:07:49 +00:00
Sergey Kandaurov
3bedc94069 Remove the long reprecated ``/stand/sysinstall'' from the init_path.
It can be put back using the INIT_PATH config option or init_path
loader variable, if still needed (which I doubt).

MFC after:	1 week
2011-10-27 10:25:11 +00:00
Kevin Lo
a32376dd76 Check the return value of BUS_SETUP_INTR()
Reviewed by:	imp
2011-10-27 10:21:40 +00:00
Gleb Smirnoff
3e850a12ef Utilize new IF_DEQUEUE_ALL(ifq, m) macro in pfsyncintr() to reduce
contention on ifqueue lock.
2011-10-27 09:47:00 +00:00
Gleb Smirnoff
a0af7c3edb Add macro IF_DEQUEUE_ALL(ifq, m), that takes the entire mbuf chain off
the queue. It can be utilized in queue processing to avoid multiple
locking/unlocking.
2011-10-27 09:45:12 +00:00
Gleb Smirnoff
e5fe87b387 - If KDB & NETGRAPH_DEBUG are on, print traces on discovered failed
invariants.
- Reduce tautology in NETGRAPH_DEBUG output.
2011-10-27 09:43:25 +00:00
Alan Cox
f346986b76 contigmalloc(9) and contigfree(9) are now implemented in terms of other
more general VM system interfaces.  So, their implementation can now
reside in kern_malloc.c alongside the other functions that are declared
in malloc.h.
2011-10-27 02:52:24 +00:00
Pyun YongHyeon
224f878512 SRAM offset 0x0C04 is used by driver to inform the IPMI/ASF firmware
about the various driver events like load, unload, reset, suspend,
restart, and ioctl operations.
Define driver's event rather than using hard-coded values.  We don't
still send suspend/resume event to firmware.

Previously bge(4) used BGE_SDI_STATUS to send events. Because driver
has to access firmware mail box to inform current state, using
BGE_SDI_STATUS register was wrong. The end result was the same as
BGE_SDI_STATUS is 0x0C04.

No functional changes.
2011-10-26 23:52:02 +00:00
Pyun YongHyeon
3fed2d5d77 Offset 0x6810 is RX-RISC event register. Rename BGE_CPU_EVENT with
BGE_RX_CPU_EVENT for readability.
Additionally define BGE_TX_CPU_EVENT for TX-RSIC event register(BCM570[0-4] only).
2011-10-26 23:22:32 +00:00
Ken Smith
36d7cf2f1c Move the debugging support to its own section. This matches what is
in the other architectures' GENERIC and makes removing it at the point
we're creating a new stable branch a bit easier.

Discussed with:	marcel
2011-10-26 22:28:28 +00:00
Alexander Motin
733a1f3f52 Clarify disks/volumes above 2TiB support in geom_raid:
- add support for volumes above 2TiB with Promise metadata format;
 - enforse and document other limitations:
   - Intel and Promise metadata formats do not support disks above 2TiB;
   - NVIDIA metadata format does not support volumes above 2TiB.

Sponsored by:	iXsystems, Inc.
MFC after:	2 weeks
2011-10-26 21:50:10 +00:00
Pyun YongHyeon
7363541837 Define MAC address mail box and use it instead of using
hard-coded value.
2011-10-26 21:11:40 +00:00
Pyun YongHyeon
888b47f0c7 Rename definition of BGE_SOFTWARE_GENCOMM_* to more readable ones.
The origin of GENCOMM seems to come from Alteon Tigon Host/NIC
interface definition where it defines general communications region
which is active when firmware is loaded and running.  This region
was used in communication between the host and processor internal
to the Tigon chip.
Broadcom data sheet also defines the region as 'Software Gencomm'
in NetXtreme memory map but lacks detailed description of its
interface so it was hard to know which ones are used for which
interface.
This change shall slightly enhance readability.

No functional changes.
2011-10-26 21:05:45 +00:00
Olivier Houchard
1693ce4443 Add libkern/ucmpdi2.c 2011-10-26 19:07:36 +00:00
Pyun YongHyeon
a7fcfcf3ba BCM5719 cannot handle DMA requests for DMA segments that have
larger than 4KB in size.  However the maximum DMA segment size
created in DMA tag is 4KB, so we wouldn't encounter the issue here.
Just record this issue such that let developers not to create a DMA
segment that is larger than 4KB for BCM5719. It's possible to split
a DMA segment into multiple smaller ones in run time but I believe
it's not worth to implement that.
2011-10-26 18:37:02 +00:00
Pyun YongHyeon
d9820cd85e Broadcom says BCM5755 or higher and BCM5906 have short DMA bug.
Apply workaround to these controllers.
2011-10-26 18:27:01 +00:00
Pyun YongHyeon
d462212405 It is known that all Broadcom controllers have 4GB boundary DMA
bug.  Apply workaround to all controllers.
2011-10-26 18:19:50 +00:00
Pyun YongHyeon
5512ca01af Make CPMU handle GPHY power down control on controllers that have
CPMU capability.
2011-10-26 18:05:46 +00:00
Hans Petter Selasky
3d09c7b327 Fix suspend and resume of FULL and HIGH speed USB devices
in the generic XHCI driver. There appears to be some minor
logic missing for this feature to work.

MFC after:	3 days
2011-10-26 17:43:27 +00:00
Robert Millan
cbb7255e80 Revert r226665 untill the issues with this change have been resolved.
Approved by:	kib (mentor)
2011-10-26 17:26:38 +00:00
Adrian Chadd
b390e40af3 As a prelude to bringing over the 11n work, include some extra statistics fields. 2011-10-26 16:09:05 +00:00
John Baldwin
c48fb4da4c - Fixup filenames in a few more places where they are used.
- Some whitespace fixes.
2011-10-26 15:17:42 +00:00
Pyun YongHyeon
28276ad648 Fix long standing bge_sysctl_debug_info() issues.
o Protect bge(4) status block access and register dump with driver lock.
 o Add missing bus_dmamap_sync() before dumping status block.
 o Use minimum status block size, 32 bytes, for status block dump on most
   controllers except BCM5700 AX/BX.
While I'm here, make the handler show 5717 Plus in hardware flags.
2011-10-26 01:03:53 +00:00
Adrian Chadd
d79ac7a74f Add in some more 11n related HAL methods. 2011-10-25 23:33:54 +00:00
Adrian Chadd
e674b5f30d The AR5413 datasheet specifies that AR_TxIntrReq should be set consistently
for all frames, so do so.
2011-10-25 23:28:16 +00:00
Adrian Chadd
6897698afe Add some fixes to the 11n aggregation HAL calls:
* preserve AR_TxIntrReq on every descriptor in an aggregate chain,
  not just the first descriptor;
* always blank out the descriptor in ar5416ChainTxDesc() when forming
  aggregates - the way I'm using this in the 11n branch is to first
  chain aggregates together, then use the other HAL calls to fill in
  the details.
2011-10-25 23:24:05 +00:00
Adrian Chadd
00d829dae7 Correct/complete a partially-disabled TX interrupt mitigation configuration.
Although a previous commit disabled TX interrupt mitigation handling and
configuration, the mask register bits weren't setup correctly.
2011-10-25 23:17:53 +00:00
Adrian Chadd
9ff4b713b2 Fix an incorrect flag.
Obtained from:	Atheros
2011-10-25 23:14:40 +00:00
Adrian Chadd
0047ff7096 Save and restore the association ID across interface resets.
Obtained from:	Atheros
MFC after:	1 week
2011-10-25 23:13:36 +00:00
Adrian Chadd
5916ef68df Add some 11n bits from the if_ath_tx 11n branch:
* Add the TID field in the TX status descriptor;
* Add in the 11n first/middle/last functions for fiddling
  with the descriptors. These are from the Linux and the
  reference driver, but I'm not (currently) using them.
* Add further AR_ISR_S5 register definitions.

Obtained from:	Linux ath9k, Atheros
2011-10-25 23:09:07 +00:00
Adrian Chadd
24f5f7ee4e Reduce the NF wait timeout. When doing heavy 11n RX loads, this can actually
interfere with traffic, as the NF load can take quite a while and poking the
AGC every 10uS is just a bit silly.

Instead, just leave the baseband NF calibration where it is and just read it
back next time a longcal interval happens.
2011-10-25 23:01:53 +00:00
Pyun YongHyeon
76a9846cbf Whitespace nits. 2011-10-25 20:45:14 +00:00
John Baldwin
5b9e248af5 - Add a new header for the x86 boot code that defines various structures
and constants related to the BIOS Enhanced Disk Drive Specification.
- Use this header instead of magic numbers and various duplicate structure
  definitions for doing I/O.
- Use an actual structure for the request to fetch drive parameters in
  drvsize() rather than a gross hack of a char array with some magic
  size.  While here, change drvsize() to only pass the 1.1 version of
  the structure and not request device path information.  If we want
  device path information you have to set the length of the device
  path information as an input (along with probably checking the actual
  EDD version to see which size one should use as the device path
  information is variable-length).  This fixes data smashing problems
  from passing an EDD 3 structure to BIOSes supporting EDD 4.

Reviewed by:	avg
Tested by:	Dennis Koegel  dk neveragain.de
MFC after:	1 week
2011-10-25 19:54:06 +00:00
John Baldwin
4f88092408 Consolidate duplicate definitions of V86_CY() and V86_ZR() which check for
the carry and zero flags being set, respectively, in <btxv86.h> and use
them throughout the x86 boot code.
2011-10-25 19:45:12 +00:00
Pyun YongHyeon
cdc2a5ec78 Implement TX/RX checksum offloading support for ASIX AX88772B
controller.

AX88772B data sheet does not show detailed information about
checksum offloading related things. It seems the controller has
lots of options to support checksum offloading but I failed to
understand why this feature requires so much complex controller
configuration and status bits.
One of major difference between AX88772B and its predecessor is
AX88772B uses a new RX header format when RX checksum offloading is
enabled.  It also requires the received length of a frame should be
multiple of 4.  Controller will pad necessary bytes to make the
length of received frame to be multiple of 4.  It is driver's
responsibility to offset this pad bytes.
Note, AX88772B could be configured to get partial checksum value in
in RX header. This mode uses different RX header format and
currently we don't use that fature.

This change makes axe(4) use driver specific MII attach handler to
override uether(9)'s default MII attach and announce flow-control
capability for AX88178/AX88772A/AX88772B to PHY drivers.  It seems
original AX88772 also supports flow-control but I didn't enable it
due to lack of test/access to the controller.  The flow-control
threshold parameter is loaded from EEPROM and there is no way to
override this value without reprogramming EEPROM. For AX88772B,
TX/RX IP/TCP/UDP checksum offloading is announced to network stack.
IPv6 and PPPoE checksum offloading is also supported by controller
but we have no way to take advantage of these features.
Driver already knows PHY address so make PHY driver know that
information and remove unnecessary PHY address check used in
miibus_readreg/miibus_writereg callbacks.  Also announce AX88178,
AX88772A and AX88772B support VLAN over-sized frame.

While I'm here clean up headers and remove axe_start() in
axe_init() because the link wouldn't be available right after media
change.
2011-10-25 18:36:18 +00:00
Alan Cox
9c60ca3238 Speed up vm_page_cache() and vm_page_remove() by checking for a few
common cases that can be handled in constant time.  The insight being
that a page's parent in the vm object's tree is very often its
predecessor or successor in the vm object's ordered memq.

Tested by:	jhb
MFC after:	10 days
2011-10-25 16:35:08 +00:00
Pawel Jakub Dawidek
664015e27a Don't look for includes in userland directories. There is no need for it
and it breaks building the kernel without userland sources.

Reported by:	andre, imp
MFC after:	3 days
2011-10-25 16:22:43 +00:00
Pawel Jakub Dawidek
92f84a9fae Allow upper layers to discover than BIO_DELETE and/or BIO_FLUSH is not
supported by returning EOPNOTSUPP instead of 0 or ENODEV.

MFC after:	3 days
2011-10-25 14:07:17 +00:00
Pawel Jakub Dawidek
37f0f0a75e Improve style a bit.
MFC after:	3 days
2011-10-25 14:05:39 +00:00
Pawel Jakub Dawidek
9495476273 Simplify disk_alloc().
MFC after:	3 days
2011-10-25 14:04:59 +00:00
Pawel Jakub Dawidek
4c11f091df The v_data field is a pointer, so set it to NULL, not 0.
MFC after:	3 days
2011-10-25 14:01:17 +00:00