Commit Graph

120592 Commits

Author SHA1 Message Date
Bruce Evans
7aac169e18 Added comments about the apparently-magic rational function used in
the second step of approximating cbrt(x).  It turns out to be neither
very magic not nor very good.  It is just the (2,2) Pade approximation
to 1/cbrt(r) at r = 1, arranged in a strange way to use fewer operations
at a cost of replacing 4 multiplications by 1 division, which is an
especially bad tradeoff on machines where some of the multiplications
can be done in parallel.  A Remez rational approximation would give
at least 2 more bits of accuracy, but the (2,2) Pade approximation
already gives 6 more bits than needed.  (Changed the comment which
essentially says that it gives 3 more bits.)

Lower order Pade approximations are not quite accurate enough for
double precision but are plenty for float precision.  A lower order
Remez rational approximation might be enough for double precision too.
However, rational approximations inherently require an extra division,
and polynomial approximations work well for 1/cbrt(r) at r = 1, so I
plan to switch to using the latter.  There are some technical
complications that tend to cost a division in another way.
2005-12-15 16:23:22 +00:00
Søren Schmidt
5608e472c1 Add support for writing VIA metadata.
Null out the metadata on disks when array is deleted.
2005-12-15 13:30:23 +00:00
Gleb Smirnoff
7e27542a4a o Rewrite bge_encap() to use bus_dmamap_load_mbuf_sg(9), inlining the
callback function bge_dma_map_tx_desc() into the bge_encap() itself.
o If busdma returns EFBIG, try to m_defrag() the packet.

Reviewed by:	yongari
2005-12-15 09:45:53 +00:00
Pyun YongHyeon
e907febf6a Add bge(4) support for big-endian architectures(part 1/2).
- Give up endianess support and switch to native-endian format for
   accessing hardware structures. In fact embedded processor for
   BCM57xx is big-endian architure(MIPS) and it requires native-endian
   format for NIC structures.The NIC performs necessary byte/word
   swapping depending on programmed endian type.
 - With above changes all htole16/htole32 calls were gone.
 - Remove bge_vhandle member in softc and changed to use explicit
   register access. This may add additional performance penalty
   that than that of previous memory access. But most of the access
   is performed on initialization phase(e.g. RCB setup), it would be
   negligible.

Due to incorrect use of bus_dma(9) in bge(4) it still panics sparc64
system in device detach path. The issue would be fixed in next patch.

Reviewed by:	jkim (initial version)
Silence from:	ps
Tested by:	glebius
Obtained from:	NetBSD via OpenBSD
2005-12-15 05:48:49 +00:00
Ian Dowse
25298bc2b6 Remove one more reference to usbd.conf. 2005-12-15 01:14:35 +00:00
Ian Dowse
2e46a159cc Remove usbd(8) and all references to it. It is no longer necessary
since devd(8) now provides the same functionality.

Submitted by:	Anish Mistry
2005-12-15 01:04:51 +00:00
Ed Maste
63e6f39011 When using m_dup(9) to copy more than MHLEN bytes of data, don't create an
mbuf chain that starts with a cluster containing just MHLEN bytes.  This
happened because m_dup called m_get or m_getcl depending on the amount of
data to copy, but then always set the size available in the first mbuf to
MHLEN.

Submitted by:	Matt Koivisto <mkoivisto at sandvine dot com>
Approved by:	jmg
Silence from:	rwatson (mentor)
2005-12-14 23:34:26 +00:00
Maxime Henrion
e59898ff36 Fix a bunch of SYSCTL_INT() that should have been SYSCTL_ULONG() to
match the type of the variable they are exporting.

Spotted by:	Thomas Hurst <tom@hur.st>
MFC after:	3 days
2005-12-14 22:27:48 +00:00
John Baldwin
05ee80c796 Fix stale comment. 2005-12-14 21:47:02 +00:00
John Baldwin
3ca629a373 Whitespace. 2005-12-14 21:42:12 +00:00
Christian Brueffer
b77c8db1f4 Add Via VT8251 support. 2005-12-14 21:10:59 +00:00
Wilko Bulte
d000225ad0 Spelling fixes and minor nit.
PR: doc/9035
Submitted by: Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
2005-12-14 19:50:55 +00:00
Sam Leffler
29d58c7173 add control for packet bursting 2005-12-14 19:44:39 +00:00
Sam Leffler
c27e4e31fe make packet bursting configurable (default to on if device is capable) 2005-12-14 19:32:53 +00:00
John Baldwin
23de16f9a7 Add support for the nForce2/3/4 SMBus controllers which all contain two
SMBus busses.  Because of limitations in smbus_if.m, the second smbus is
attached to an amdpm1 device that is a child of amdpm0.

Submitted by:	Artemiev Igor ai (at) bmc dot brk dot ru
2005-12-14 17:49:45 +00:00
Maxim Konovalov
e20daf376d Fix the name of the country I was born. 2005-12-14 17:33:12 +00:00
Maxim Konovalov
19d099fc86 o Now when SIG_IGN signal action for SIGCHLD reap zombies
automatically it is possible wait4(2) returns -1 and sets
errno = ECHILD if there were forked children.  A user can
set such signal handler e.g. via ``trap "" 20'', see a PR
for the test case.  Deal with this case and mark a job as
JOBDONE.

PR:		bin/90334
Submitted by:	bde
MFC after:	4 weeks
2005-12-14 17:26:29 +00:00
Søren Schmidt
59a269294f Add RAID0+1 and RAID5 support to VIA RAID code.
Fix support for multiple arrays.
2005-12-14 13:07:49 +00:00
Søren Schmidt
a569390328 Add support for VIA VT8251 southbridge.
SATA support for now in compat mode, but all 4 channels usable.
2005-12-14 12:13:00 +00:00
Søren Schmidt
c6c6c58a89 Correct calculation of RAID0 sizes on VIA RAID arrays. 2005-12-14 12:11:51 +00:00
Maxim Konovalov
54ccb3ac94 o Correct usage(): delete command takes as argument array not channel.
PR:		bin/90353
Submitted by:	Gavin Atkinson
MFC after:	1 week
2005-12-14 06:33:18 +00:00
Scott Long
5351742ea2 Mega update to the LSI MegaRAID driver:
1.  Implement a large set of ioctl shims so that the Linux management apps
from LSI will work.  This includes infrastructure to support adding, deleting
and rescanning arrays at runtime.  This is based on work from Doug Ambrosko,
heavily augmented by LSI and Yahoo.

2.  Implement full 64-bit DMA support.  Systems with more than 4GB of RAM
can now operate without the cost of bounce buffers.  Cards that cannot do
64-bit DMA will automatically revert to using bounce buffers.  This option
can be forced off by setting the 'hw.amr.force_sg32" tunable in the loader.
It should only be turned off for debugging purposes.  This work was sponsored
by Yahoo.

3.  Streamline the command delivery and interrupt handler paths after
much discussion with Dell and LSI.  The logic now closely matches the
intended design, making it both more robust and much faster.  Certain
i/o failures under heavy load should be fixed with this.

4.  Optimize the locking.  In the interrupt handler, the card can be checked
for completed commands without any locks held, due to the handler being
implicitely serialized and there being no need to look at any shared data.
Only grab the lock to return the command structure to the free pool.  A
small optimization can still be made to collect all of the completions
together and then free them together under a single lock.

Items 3 and 4 significantly increase the performance of the driver.  On an
LSI 320-2X card, transactions per second went from 13,000 to 31,000 in my
testing with these changes.  However, these changes are still fairly
experimental and shouldn't be merged to 6.x until there is more testing.

Thanks to Doug Ambrosko, LSI, Dell, and Yahoo for contributing towards
this.
2005-12-14 03:26:49 +00:00
Andrew Thompson
91f6764e93 Add support for creating span ports so that one can snoop bridged traffic
from another interface/machine/network.

Obtained from:	OpenBSD
MFC after:	2 weeks
2005-12-14 02:52:13 +00:00
David Xu
dbcf945af6 Style fixs, add missing word 'signal'.
Reviewed by: deischen
2005-12-14 01:59:11 +00:00
Sam Leffler
aa5eb8878e display a bssid that's zero with the -v option 2005-12-14 01:22:26 +00:00
Sam Leffler
8e292e8ecd When creating neighbor entries for an ahdemo bss apply the local
settings.  In particular this allows us to use QoS frames in a
bss and in turn enables disabling ack's.
2005-12-14 01:18:36 +00:00
Sam Leffler
50d8b493e4 when creating an ahdemo bss use any requested bssid; otherwise use zero
Obtained from:	madwifi
2005-12-14 01:16:22 +00:00
Sam Leffler
259bb4d3b9 allow setting the bssid in any mode
Obtained from:	netbsd
2005-12-14 01:14:22 +00:00
Dag-Erling Smørgrav
0430a5e289 Eradicate caddr_t from the VFS API. 2005-12-14 00:49:52 +00:00
Dag-Erling Smørgrav
e26b05cf44 Nuke vnodeop_desc.vdesc_transports, which has been unused since the dawn
of time (or the inception of ncvs, whichever came last)
2005-12-14 00:15:11 +00:00
Scott Long
6239708b1c Fix the Tigon I/II driver to support 64-bit DMA. In the process, convert it
to use busdma.  Unlike most of the other drivers, but similar to the
if_em driver, pre-allocate the dmamaps at init time instead of allocating
them on the fly when descriptors need to be filled.  This isn't ideal right
now because a map is allocated for every descriptor slot in the tx, rx, mini,
and jumbo rings (which is a lot!) in order to simplify the bookkeeping, even
though the driver might support filling only a subset of those slots.
Luckily, maps are typically NULL on i386 and amd64, so the cost isn't
very high.  It could be an issue with sparc64, but the driver isn't endian
clean either, and that is a much bigger problem to solve first.

Note that jumbo frame support is under-tested, and I'm not even sure if
it till really works correctly given the evil VM magic that is does.
The changes here attempt to preserve the existing semanitcs.

Thanks to Martin Nillson for contributing the Netgear card for this work.

MFC-After: 3 weeks
2005-12-14 00:03:41 +00:00
John Baldwin
d272fe53a4 Add a new 'show lock' command to ddb. If the argument has a valid lock
class, then it displays various information about the lock and calls a
new function pointer in lock_class (lc_ddb_show) to dump class-specific
information about the lock as well (such as the owner of a mutex or
xlock'ed sx lock).  This is easier than staring at hex dumps of locks to
figure out who owns the lock, etc.  Note that extending lock_class doesn't
affect the ABI for any kernel modules as the only code that deals with
lock_class structures directly is kern_mutex.c, kern_sx.c, and witness.

MFC after:	1 week
2005-12-13 23:14:35 +00:00
Craig Rodrigues
63ec04adea Hide DDB-specific functions inside check for #ifdef DDB.
Noticed by:	des
2005-12-13 22:42:02 +00:00
Dag-Erling Smørgrav
fea562c089 Add a -c option to control caddr_t replacement (which was commented out in
the previous revision)
2005-12-13 22:21:46 +00:00
Sam Leffler
4ffa4230f0 fix include path 2005-12-13 22:15:09 +00:00
Sam Leffler
7613cbabe4 update 2005-12-13 22:13:41 +00:00
Sam Leffler
44301bc9d5 fix include pathnames 2005-12-13 22:12:16 +00:00
Dag-Erling Smørgrav
d44231a0ce Add a script that converts K&R-style function definitions to ANSI style. 2005-12-13 22:09:50 +00:00
Bruce Evans
ec761d7501 Optimize by not doing excessive conversions for handling the sign bit.
This gives an optimization of between 9 and 22% on Athlons (largest
for cbrt() on amd64 -- from 205 to 159 cycles).

We extracted the sign bit and worked with |x|, and restored the sign
bit as the last step.  We avoided branches to a fault by using accesses
to FP values as bits to clear and restore the sign bit.  Avoiding
branches is usually good, but the bit access macros are not so good
(especially for setting FP values), and here they always caused pipeline
stalls on Athlons.  Even using branches would be faster except on args
that give perfect branch misprediction, since only mispredicted branches
cause stalls, but it possible to avoid touching the sign bit in FP
values at all (except to preserve it in conversions from bits to FP
not related to the sign bit).  Do this.  The results are identical
except in 2 of the 3 unsupported rounding modes, since all the
approximations use odd rational functions so they work right on strictly
negative values, and the special case of -0 doesn't use an approximation.
2005-12-13 20:17:23 +00:00
Alan Cox
984922d761 Assert that the page that is given to vm_page_free_toq() does not have any
managed mappings.
2005-12-13 19:59:09 +00:00
Peter Wemm
737429bc96 MFamd64 rev 1.223: Use the TSC to implement DELAY() if not marked broken
and it has been calibrated.
2005-12-13 19:08:55 +00:00
John Baldwin
e83f6bcb75 Revert previous commit. The BIOS braindamage is even worse than I
originally thought.  The BIOS that cleared CPUID_APIC actually managed
to disable the local APIC entirely and even Windows 64 doesn't boot on
it.

Reported by:	bz
2005-12-13 18:29:10 +00:00
Bruce Evans
7d5a4821ba Fixed some especially horrible style bugs (indentation that is neither
KNF nor fdlibmNF combined with multiple statements per line).
2005-12-13 18:22:00 +00:00
Dag-Erling Smørgrav
1cd4b9861a Print user, system and real time upon exit. 2005-12-13 17:51:56 +00:00
Ruslan Ermilov
a5b0d9050a [mdoc] add missing space before a punctuation type argument. 2005-12-13 17:07:52 +00:00
Xin LI
1278dd6847 In Linux, kernel parameters passed to ioctl are by value, while in FreeBSD
they are passed by reference.  Handle the difference within the
linux_ioctl_termio on the LINUX_TCFLSH path.

Submitted by:	Jaroslav Drzik <jaro_AT_coop-voz_dot_sk>
2005-12-13 15:32:52 +00:00
John Baldwin
15b7edbeaa Don't check the CPUID_APIC bit in the cpu_features flags field to determine
if the boot CPU has a local APIC because some BIOS vendors are not
competent enough to set this bit.  Instead, just assume that we always have
a local APIC on amd64.  For i386 the check is a bit more subtle.  FreeBSD
requires either an MP Table or an ACPI MADT table to enumerate APICs.  The
only systems that have one of those tables that don't have local APICs are
some presumably rare (and old) SMP 486 systems using external APICs.  Thus,
instead of checking the CPUID_APIC flag, check the CPU class and abort if
we are running on a 486.

MFC after:	1 week
Reported by:	bz
2005-12-13 15:09:40 +00:00
David Xu
412295fdbd Sort .Xr by section number.
Submitted by: ru
2005-12-13 13:43:35 +00:00
Poul-Henning Kamp
b384108ed6 /* You're not supposed to hit this problem */
For some denormalized long double values, a bug in __hldtoa() (called
from *printf()'s %A format) results in a base 16 digit being rounded
up from 0xf to 0x10.

When this digit is subsequently converted to string format, an index
of 10 reaches past the end of the uppper-case hex/char array, picking
up whatever the code segment happen to contain at that address.

This mostly seem to be some character from the upper half of the
byte range.

When using the %a format instead of %A, the first character past
the end of the lowercase hex/char table happens to be index 0 in
the uppercase hex/char table hextable and therefore the string
representation features a '0', which is supposedly correct.

This leads me to belive that the proper fix _may_ be as simple as
masking all but the lower four bits off after incrementing a hex-digit
in libc/gdtoa/_hdtoa.c:roundup().  I worry however that the upper
bit in 0x10 indicates a carry not carried.

Until das@ or bde@ finds time to visit this issue, extend the
hexdigit arrays with a 17th index containing '?' so that we get a
invalid but consistent and printable output in both %a and %A formats
whenever this bug strikes.

This unmasks the bug in the %a format therefore solving the real
issue may both become easier and more urgent.

Possibly related to:	PR 85080
With help by:		bde@
2005-12-13 13:23:27 +00:00
Gleb Smirnoff
40b1ae9e00 Add a new feature for optimizining ipfw rulesets - substitution of the
action argument with the value obtained from table lookup. The feature
is now applicable only to "pipe", "queue", "divert", "tee", "netgraph"
and "ngtee" rules.

An example usage:

  ipfw pipe 1000 config bw 1000Kbyte/s
  ipfw pipe 4000 config bw 4000Kbyte/s
  ipfw table 1 add x.x.x.x 1000
  ipfw table 1 add x.x.x.y 4000
  ipfw pipe tablearg ip from table(1) to any

In the example above the rule will throw different packets to different pipes.

TODO:
  - Support "skipto" action, but without searching all rules.
  - Improve parser, so that it warns about bad rules. These are:
    - "tablearg" argument to action, but no "table" in the rule. All
      traffic will be blocked.
    - "tablearg" argument to action, but "table" searches for entry with
      a specific value. All traffic will be blocked.
    - "tablearg" argument to action, and two "table" looks - for src and
      for dst. The last lookup will match.
2005-12-13 12:16:03 +00:00