yongari [Thu, 27 Oct 2011 22:10:52 +0000 (22:10 +0000)]
Define BGE_FW_HB_TIMEOUT_SEC and remove one more magic value.
bge(4) sends BGE_FW_CMD_DRV_ALIVE command to firmware every 2
seconds. BGE_FW_CMD_DRV_ALIVE command requires 4 bytes data. This
data contains timeout value in seconds until the next
BGE_FW_CMD_DRV_ALIVE command.
Broadcom recommends driver set the value 3 times longer than the
interval that it sends BGE_FW_CMD_DRV_ALIVE. Currently bge(4) uses
3 seconds so probably we have to increase it in future and use
different ALIVE command(e.g. BGE_FW_CMD_DRV_ALIVE3).
yongari [Thu, 27 Oct 2011 21:27:37 +0000 (21:27 +0000)]
Rename hard-coded value 1 << 14 with BGE_RX_CPU_DRV_EVENT.
This bit(SW event 7 in publicly available data sheet) is used to
make RX CPU handle a firmware command and the bit is automatically
cleared after RX CPU completed the command.
Generally firmware command takes the following steps.
1. Write BGE_SRAM_FW_CMD_MB with a command.
2. Write BGE_SRAM_FW_CMD_LEN_MB with the length of the command in bytes.
3. Write BGE_SRAM_FW_CMD_DATA_MB with actual command data.
4. Generate BGE_RX_CPU_EVENT and let firmware handle the command.
5. Wait for the ACK of the firmware command.
dougb [Thu, 27 Oct 2011 20:44:28 +0000 (20:44 +0000)]
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!)
gavin [Thu, 27 Oct 2011 20:35:21 +0000 (20:35 +0000)]
Update the example rules in devfs.conf to reflect the changes since ATA_CAM.
While here, add another example rule, as many applications these days
expect to find /dev/dvd instead.
pjd [Thu, 27 Oct 2011 18:45:01 +0000 (18:45 +0000)]
Delay resuid generation until first connection to secondary, not until first
write. This way on first connection we will synchronize only the extents that
were modified during the lifetime of primary node, not entire GEOM provider.
ed [Thu, 27 Oct 2011 17:05:18 +0000 (17:05 +0000)]
Make our utmpx more like System V.
When booting the system, truncate the utx.active file, but do write the
BOOT_TIME record into it afterwards. This allows one to obtain the boot
time of the system as follows:
struct utmpx u1 = { .ut_type = BOOT_TIME }, *u2;
setutxent();
u2 = getutxid(&u1);
Now, the boot time is stored in u2->ut_tv, just like on Linux and other
systems.
We don't open the utx.active file with O_EXLOCK. It's rather unlikely
that other applications use this database at the same time and I want to
prevent the possibility of deadlocks in init(8).
alc [Thu, 27 Oct 2011 16:39:17 +0000 (16:39 +0000)]
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.
ed [Thu, 27 Oct 2011 16:20:29 +0000 (16:20 +0000)]
Print INIT_PROCESS and LOGIN_PROCESS entries as well.
Even though our implementation of utmpx never emits these types of
records, they are part of POSIX. Do print them when they show up in the
database files.
While there, also print the type number of unsupported records.
pjd [Thu, 27 Oct 2011 16:12:25 +0000 (16:12 +0000)]
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
pjd [Thu, 27 Oct 2011 14:07:57 +0000 (14:07 +0000)]
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.
kensmith [Thu, 27 Oct 2011 13:07:49 +0000 (13:07 +0000)]
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.
glebius [Thu, 27 Oct 2011 09:45:12 +0000 (09:45 +0000)]
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.
alc [Thu, 27 Oct 2011 02:52:24 +0000 (02:52 +0000)]
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.
yongari [Wed, 26 Oct 2011 23:52:02 +0000 (23:52 +0000)]
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.
yongari [Wed, 26 Oct 2011 23:22:32 +0000 (23:22 +0000)]
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).
kensmith [Wed, 26 Oct 2011 22:28:28 +0000 (22:28 +0000)]
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.
mav [Wed, 26 Oct 2011 21:50:10 +0000 (21:50 +0000)]
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.
yongari [Wed, 26 Oct 2011 21:05:45 +0000 (21:05 +0000)]
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.
yongari [Wed, 26 Oct 2011 18:37:02 +0000 (18:37 +0000)]
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.
hselasky [Wed, 26 Oct 2011 17:43:27 +0000 (17:43 +0000)]
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.
ed [Wed, 26 Oct 2011 07:49:47 +0000 (07:49 +0000)]
Attempt to fix build logic for gensnmptree.
There are two problems with the existing logic. It builds gensnmptree
on <700018, even if WITHOUT_BSNMP is set, but more importantly, we must
not forget to build gensnmptree on systems that have originally been
built without. This causes a buildworld on those systems to fail.
yongari [Wed, 26 Oct 2011 01:03:53 +0000 (01:03 +0000)]
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.
adrian [Tue, 25 Oct 2011 23:24:05 +0000 (23:24 +0000)]
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.
adrian [Tue, 25 Oct 2011 23:09:07 +0000 (23:09 +0000)]
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.
adrian [Tue, 25 Oct 2011 23:01:53 +0000 (23:01 +0000)]
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.
edwin [Tue, 25 Oct 2011 21:53:43 +0000 (21:53 +0000)]
MFV of r226750, tzdata2011m
Europe:
- Pridnestrovian Moldavian Republic (PMR, also known as
"Pridnestrovie") has abolished seasonal clock change (no transition
to the Winter Time).
- The recent change to the Ukranian time zone (Europe/Kiev) to
introduce permanent daylight saving time (similar to Russia) was
reverted.
South America:
- Bahia: The President signed a decree that includes Bahia in summer
time.
jhb [Tue, 25 Oct 2011 19:54:06 +0000 (19:54 +0000)]
- 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.
jhb [Tue, 25 Oct 2011 19:45:12 +0000 (19:45 +0000)]
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.
yongari [Tue, 25 Oct 2011 18:36:18 +0000 (18:36 +0000)]
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.
nwhitehorn [Tue, 25 Oct 2011 16:35:48 +0000 (16:35 +0000)]
Provide an error message and error handling if there are no network
interfaces in the system. This is a non-fatal error except when doing a
network installation.
alc [Tue, 25 Oct 2011 16:35:08 +0000 (16:35 +0000)]
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.
pjd [Tue, 25 Oct 2011 13:57:50 +0000 (13:57 +0000)]
Add support for creating GELI devices with older metadata version for use
with older FreeBSD versions:
- Add -V option to 'geli init' to specify version number. If no -V is given
the most recent version is used.
- If -V is given don't allow to use features not supported by this version.
- Print version in 'geli list' output.
- Update manual page and add table describing which GELI version is
supported by which FreeBSD version, so one can use it when preparing GELI
device for older FreeBSD version.
Inspired by: Garrett Cooper <yanegomi@gmail.com>
MFC after: 3 days
pjd [Tue, 25 Oct 2011 13:44:23 +0000 (13:44 +0000)]
When decoding metadata, check magic string, so we know this is not GELI device
before we check its version. We don't want to report that some garbage is
unsupported version if this is not even GELI provider.
mm [Tue, 25 Oct 2011 08:35:30 +0000 (08:35 +0000)]
Update copyright information in several ZFS files, as the clause 3.3
of the CDDL licence explicitly requires every Contributor to add
a copyright notice.
This also reflects the copyright notices for the changes recently
added by Illumos.
pjd [Tue, 25 Oct 2011 08:03:51 +0000 (08:03 +0000)]
Add 'geli version' subcommand, which will print GELI metadata version of each
given GEOM provider or if not providers are given it will print versions
supported by userland geli(8) utility and by ELI GEOM class.