]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years ago- Simplify the fixed string pattern preprocessing code
gabor [Thu, 7 Apr 2011 13:01:03 +0000 (13:01 +0000)]
- Simplify the fixed string pattern preprocessing code
- Improve readability

Approved by: delphij (mentor)
Obtained from: The NetBSD Project

13 years ago- Replace some strcpy()-family functions with memcpy() ones. It has been
gabor [Thu, 7 Apr 2011 12:52:46 +0000 (12:52 +0000)]
- Replace some strcpy()-family functions with memcpy() ones. It has been
  discussed earlier that the extra safeness is not required in these
  cases and we can avoid the overhead by using the more general
  memory copy functions.

Approved by: delphij (mentor)
Obtained from: The NetBSD Project

13 years agoProperly unref ng_hub nodes on shutdown, so that we don't leak them.
zec [Thu, 7 Apr 2011 11:40:10 +0000 (11:40 +0000)]
Properly unref ng_hub nodes on shutdown, so that we don't leak them.

MFC after: 3 days

13 years agoFix spelling.
mav [Thu, 7 Apr 2011 08:32:53 +0000 (08:32 +0000)]
Fix spelling.

13 years agoAdd one more ID for Marvell 88SE912x chip found on Asus U3S6 card.
mav [Thu, 7 Apr 2011 08:28:53 +0000 (08:28 +0000)]
Add one more ID for Marvell 88SE912x chip found on Asus U3S6 card.

Submitted by: Jonas Jonsson <fatbrain@gmail.com>

13 years agoMake ada(4) driver to control device write cache, same as ata(4) does.
mav [Thu, 7 Apr 2011 08:17:53 +0000 (08:17 +0000)]
Make ada(4) driver to control device write cache, same as ata(4) does.
Add kern.cam.ada.write_cache sysctl/tunable to control it alike hw.ata.wc.

13 years agoModify read/write ioctls to work with 64 bit registers too.
np [Thu, 7 Apr 2011 07:10:42 +0000 (07:10 +0000)]
Modify read/write ioctls to work with 64 bit registers too.

MFC after: 3 days

13 years ago - Don't invalidate jnewblks immediately upon discovering that the block
jeff [Thu, 7 Apr 2011 03:19:10 +0000 (03:19 +0000)]
 - Don't invalidate jnewblks immediately upon discovering that the block
   will be removed.  Permit the journal to proceed so that we don't leave
   a rollback in a cg for a very long time as this can cause terrible perf
   problems in low memory situations.

Tested by:      pho

13 years agoImplement atomic_load_acq_64(9) and atomic_store_rel_64(9) for i386. These
jkim [Wed, 6 Apr 2011 23:59:59 +0000 (23:59 +0000)]
Implement atomic_load_acq_64(9) and atomic_store_rel_64(9) for i386.  These
functions are implemented with CMPXCHG8B instruction where it is available,
i. e., all Pentium-class and later processors.  Note this instruction is
also used for atomic_store_rel_64() because a simple XCHG-like instruction
for 64-bit memory access does not exist, unfortunately.  If the processor
lacks the instruction, i. e., 80486-class CPUs, two 32-bit load/store are
performed with interrupt temporarily disabled, assuming it does not support
SMP.  Although this assumption may be little naive, it is true in reality.
This implementation is inspired by Linux.

13 years agoUpdate arcmsr(4) to vendor version 1.20.00.21. This release primarily
delphij [Wed, 6 Apr 2011 20:54:26 +0000 (20:54 +0000)]
Update arcmsr(4) to vendor version 1.20.00.21.  This release primarily
improves command timeout handling.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by: Ching-Lung Huang <ching2048 areca com tw>
MFC after: 2 months

13 years agoRegenerate after r220401. It turns out makeman is clever about implied
uqs [Wed, 6 Apr 2011 20:19:07 +0000 (20:19 +0000)]
Regenerate after r220401. It turns out makeman is clever about implied
flags, so remove that part from WITHOUT_CXX again.

This is only partially regenerated, as the entries for FDT and GPIO seem to
have switched their default state, too.

13 years agoComplete WITHOUT_CXX support. It implies WITHOUT_GROFF and
uqs [Wed, 6 Apr 2011 20:08:23 +0000 (20:08 +0000)]
Complete WITHOUT_CXX support. It implies WITHOUT_GROFF and
WITHOUT_CLANG.

Don't build clang bootstrap/build-tools depending on this flag. We also
keep gperf, devd and libstdc++ around to prevent foot-shooting and to
make this a two-way street.

13 years agoAdd RACCT_NOFILE accounting.
trasz [Wed, 6 Apr 2011 19:13:04 +0000 (19:13 +0000)]
Add RACCT_NOFILE accounting.

Sponsored by: The FreeBSD Foundation
Reviewed by: kib (earlier version)

13 years agoStyle fix.
trasz [Wed, 6 Apr 2011 19:08:50 +0000 (19:08 +0000)]
Style fix.

Submitted by: jhb@

13 years agoAdd accounting for SysV-related resources.
trasz [Wed, 6 Apr 2011 18:11:24 +0000 (18:11 +0000)]
Add accounting for SysV-related resources.

Sponsored by: The FreeBSD Foundation
Reviewed by: kib (earlier version)

13 years agoMove getc() body before xgetc() so gcc does not emit a warning about function
rdivacky [Wed, 6 Apr 2011 17:54:12 +0000 (17:54 +0000)]
Move getc() body before xgetc() so gcc does not emit a warning about function
having no body.

Approved by:    jhb

13 years agoFix several places to ignore processes that are not yet fully constructed.
jhb [Wed, 6 Apr 2011 17:47:22 +0000 (17:47 +0000)]
Fix several places to ignore processes that are not yet fully constructed.

MFC after: 1 week

13 years agoMark getc() as inline, this has no effect on gcc but helps clang.
rdivacky [Wed, 6 Apr 2011 17:29:40 +0000 (17:29 +0000)]
Mark getc() as inline, this has no effect on gcc but helps clang.

Approved by:    jhb

13 years agoAdd ucred pointer to the SysV-related memory structures. This is required
trasz [Wed, 6 Apr 2011 16:59:54 +0000 (16:59 +0000)]
Add ucred pointer to the SysV-related memory structures.  This is required
for racct.

Note that after this commit, ipcs(1) needs to be rebuilt.  Otherwise, it will
fail with "ipcs: sysctlbyname: kern.ipc.msqids: Cannot allocate memory".

Sponsored by: The FreeBSD Foundation
Reviewed by: kib (earlier version)

13 years agoIn vm_daemon(), do not skip processes stopped with SIGSTOP.
trasz [Wed, 6 Apr 2011 16:27:04 +0000 (16:27 +0000)]
In vm_daemon(), do not skip processes stopped with SIGSTOP.

13 years agoAdd RACCT_RSS.
trasz [Wed, 6 Apr 2011 16:24:24 +0000 (16:24 +0000)]
Add RACCT_RSS.

Sponsored by: The FreeBSD Foundation
Reviewed by: kib (earlier version)

13 years agoImplement mxge_init()
gallatin [Wed, 6 Apr 2011 15:45:32 +0000 (15:45 +0000)]
Implement mxge_init()

This fixes a long standing bug in mxge(4) where "ifconfig mxge0 $IP"
did not bring the interface into a RUNNING state, like it does on
most (all?) other FreeBSD NIC drivers.

Thanks to gnn for mentioning the bug, and yongari for pointing out that
ether_ioctl() invokes ifp->if_init() in SIOCSIFADDR.

MFC after: 7 days

13 years agoCorrect 'list scan' description in the examples. The previous description
gjb [Wed, 6 Apr 2011 11:20:54 +0000 (11:20 +0000)]
Correct 'list scan' description in the examples.  The previous description
was incorrect - 'list scan' does not actually do a scan, but instead lists
the results of the background 'scan' cache.

Submitted by: Fabian Keil (freebsd-listen of fabiankeil de) (via email)
Discussed with: bschmidt
MFC after: 3 days

13 years ago- Removed multiple console error messages and replaced with statistic
davidch [Tue, 5 Apr 2011 22:13:33 +0000 (22:13 +0000)]
- Removed multiple console error messages and replaced with statistic
  counters to reduce spew.
- Fixed a TSO problem when an mbuf contains both header and payload in
  the same cluster.

MFC after: One week.

13 years agoAllow strerror(0) and strerror_r(0, ...).
jilles [Tue, 5 Apr 2011 21:56:05 +0000 (21:56 +0000)]
Allow strerror(0) and strerror_r(0, ...).

Of course, strerror_r() may still fail with ERANGE.

Although the POSIX specification said this could fail with EINVAL and
doing this likely indicates invalid use of errno, most other
implementations permitted it, various POSIX testsuites require it to
work (matching the older sys_errlist array) and apparently some
applications depend on it.

PR: standards/151316
MFC after: 1 week

13 years agoImportant update for the igb driver:
jfv [Tue, 5 Apr 2011 21:55:43 +0000 (21:55 +0000)]
Important update for the igb driver:
  - Add the change made in em to the actual unrefreshed number
    of descriptors is used as a basis in rxeof on the way out
    to determine if more refresh is needed. NOTE: there is a
    difference in the ring setup in igb, this is not accidental,
    it is necessitated by hardware behavior, when you reset the
    newer adapters it will not let you write RDH, it ALWAYS sets
    it to 0. Thus the way em does it is not possible.
  - Change the sysctl handling of flow control, it will now make
    the change dynamically when the variable setting changes rather
    than requiring a reset.
  - Change the eee sysctl naming, validation found the old unintuitive :)
  - Last but not least, some important performance tweaks in the TX
    path, I found that UDP behavior could be drastically hindered or
    improved with just small changes in the start loop. What I have
    here is what testing has shown to be the best overall. Its interesting
    to note that changing the clean threshold to start at a full half of
    the ring, made a BIG difference in performance.  I hope that this
    will prove to be advantageous for most workloads.

MFC in a week.

13 years agoBe far more persistent in reclaiming blocks and inodes before giving
mckusick [Tue, 5 Apr 2011 21:26:05 +0000 (21:26 +0000)]
Be far more persistent in reclaiming blocks and inodes before giving
up and declaring a filesystem out of space. Especially necessary when
running on a small filesystem. With this improvement, it should be
possible to use soft updates on a small root filesystem.

Kudos to: Peter Holm
Testing by: Peter Holm
MFC: 2 weeks

13 years agoAdd accounting for most of the memory-related resources.
trasz [Tue, 5 Apr 2011 20:23:59 +0000 (20:23 +0000)]
Add accounting for most of the memory-related resources.

Sponsored by: The FreeBSD Foundation
Reviewed by: kib (earlier version)

13 years agoAdd missing stubs.
trasz [Tue, 5 Apr 2011 19:50:34 +0000 (19:50 +0000)]
Add missing stubs.

13 years agoFix buildworld -DMODULES_WITH_WORLD
uqs [Tue, 5 Apr 2011 19:41:18 +0000 (19:41 +0000)]
Fix buildworld -DMODULES_WITH_WORLD

13 years ago* Add the readline(3) API to libedit. The libedit versions of
obrien [Tue, 5 Apr 2011 18:41:01 +0000 (18:41 +0000)]
* Add the readline(3) API to libedit.  The libedit versions of
  {readline,history}.h are in /usr/include/edit so as to not conflict with
  the GNU libreadline versions.  To use the libedit readline(3) one should
  add "-I/usr/include/edit" to their Makefile
  (spelled "-I${DESTDIR}/${INCLUDEDIR}/edit" within the FreeBSD source tree).

* Enable its use in the BSD licensed utilities that support readline(3).

* To make it easier to sync libedit development with NetBSD, histedit.h
  is moved into libedit's directory as history shows shown we keep merging
  it into that location.

Obtained from: NetBSD
Sponsored by: Juniper Networks

13 years agoLower the bar for ACPI-fast on real machines slightly. Empirical evidences
jkim [Tue, 5 Apr 2011 18:40:19 +0000 (18:40 +0000)]
Lower the bar for ACPI-fast on real machines slightly.  Empirical evidences
show that there are perfectly working PM timers with occasional "hiccups",
probably because of an SMI.  Now we ignore the maximum if it happens once in
the test loop and the width is small enough.  Also, relax normal width a bit
to count in a boundary case.

13 years agoAdd initial jumbo frame support for BCM5714/BCM5715 and BCM5780.
yongari [Tue, 5 Apr 2011 17:41:54 +0000 (17:41 +0000)]
Add initial jumbo frame support for BCM5714/BCM5715 and BCM5780.
Unlike other controllers which have more advanced jumbo support,
these controllers have one send ring, one standard receive producer
ring and one receive return ring. In order to receive jumbo frames
on the controllers, driver now will increase Rx buffer size to 9k.
Two Rx modes are supported on these controllers and I chose
standard Rx BDs over extended Rx BDs. The extended Rx BD mode
allows up to 4 segmentations for each Rx BDs such that kernel does
not have to allocate large buffer of contiguous memory for
receiving. The extended Rx BD mode is already used on controllers
that have separate jumbo receive ring. However, using extended Rx
BDs on BCM5714/BCM5715/BCM5780 reduces the number of Rx BDs to 256
entries which in turn may reduce the performance.  Also UMA backed
page allocator for jumbo frame returns contiguous memory so using
extended Rx BD has no advantage on FreeBSD unless highly customized
local allocator implemented in driver is used.
To use jumbo buffers in standard receive ring, Rx buffer allocation
handler was changed to allocate MJUM9BYTES sized mbuf.

PR: kern/155192
Tested by: Vijay Singh <vijju.singh <> gmail dot com>
Submitted by: mjacob (initial version)

13 years agoMake the alq log path tunable
adrian [Tue, 5 Apr 2011 16:14:54 +0000 (16:14 +0000)]
Make the alq log path tunable

13 years ago* re-enable marker stuff, I accidentally disabled it during debugging
adrian [Tue, 5 Apr 2011 16:12:38 +0000 (16:12 +0000)]
* re-enable marker stuff, I accidentally disabled it during debugging
* correct arg check

13 years agoFlesh out a simple tool to print the ALQ dump generated by the HAL.
adrian [Tue, 5 Apr 2011 15:11:09 +0000 (15:11 +0000)]
Flesh out a simple tool to print the ALQ dump generated by the HAL.

13 years agoAdd the ability to manage the state of write caching when the battery
jhb [Tue, 5 Apr 2011 14:19:05 +0000 (14:19 +0000)]
Add the ability to manage the state of write caching when the battery
back-up is missing or dead.  The current state of this field is reported
in 'mfiutil cache <volume>' and can be adjusted via
'mfiutil cache <volume> bad-bbu-write-cache <enable|disable>'.  This
setting should generally be disabled to avoid data loss.

MFC after: 1 week

13 years agoExtend the DDB command "watchdog" with the ability to specify a timeout
attilio [Tue, 5 Apr 2011 14:15:58 +0000 (14:15 +0000)]
Extend the DDB command "watchdog" with the ability to specify a timeout
value.

The timeout is expressed in the form T(N) = (2^N * nanoseconds) and can
be easilly extracted from the watchdog interface as a WD_TO_* macro.
That new functionality is supposed to fix re-entering the kernel from DDB
re-enabling the watchdog again (previously disabled) and also offer the
possibility to break for deadlocked DDB commands.

Please note that retro-compatibility is retained.

Sponsored by: Sandvine Incorporated
Approved by: des
MFC after: 10 days

13 years agoMFi386: revision 220337
nyan [Tue, 5 Apr 2011 13:48:53 +0000 (13:48 +0000)]
MFi386: revision 220337

  Build boot2 with -mregparm=3.

13 years agoThe xpaBiasLvlFreq[] fields in the modal header also need swapping
adrian [Tue, 5 Apr 2011 13:14:17 +0000 (13:14 +0000)]
The xpaBiasLvlFreq[] fields in the modal header also need swapping
when the EEPROM contents are byte-swapped.

13 years agoMake clang default on x86 and powerpc, but not on other architectures.
imp [Tue, 5 Apr 2011 08:49:47 +0000 (08:49 +0000)]
Make clang default on x86 and powerpc, but not on other architectures.
Make fdt default on arm and powerpc.

This now includes cross compiled targets, where before we tried to
make it host-based.

Also, move the lists of default yes and no options to a variable.

In general, only build tools should get this treatment in bsd.own.mk.
Also, the use of TARGET* in the bsd.*mk files is discouraged, but
necessary here due to the ordering of things in buildworld.  We make
the native case work by testing MACHINE_ARCH after TARGET_ARCH.

13 years agoDocument -w for swapuse.
pluknet [Tue, 5 Apr 2011 07:56:40 +0000 (07:56 +0000)]
Document -w for swapuse.

PR: docs/156089
Submitted by: Andrey Ignatov <rdna att rdna.ru>
MFC after: 1 week

13 years agoif_arge has had a strange bug that only appears during high traffic
adrian [Tue, 5 Apr 2011 06:46:07 +0000 (06:46 +0000)]
if_arge has had a strange bug that only appears during high traffic
levels. TX would hang, RX wouldn't. A bit of digging showed the interface
send queue was full, but IFF_DRV_OACTIVE was clear and the hardware TX
queue was empty.

It turns out that there wasn't a check to drain the interface send
queue once hardware TX had completed, so if the interface send queue
had filled up in the meantime, subsequent packets would be dropped
by the higher layers and if_start (and thus arge_start()) would never
be called.

The fix is simple - call arge_start_locked() in the software interrupt
handler after the hardware TX queue has been handled or a TX underrun
occured. This way the interface send queue gets drained.

13 years ago* Add some more debugging to if_arge
adrian [Tue, 5 Apr 2011 06:33:35 +0000 (06:33 +0000)]
* Add some more debugging to if_arge
* Make doubly sure that IFF_DRV_OACTIVE is set if the hardware TX queue is full

13 years agoPut the ARGE_DEBUG behind a kernel config option.
adrian [Tue, 5 Apr 2011 05:29:10 +0000 (05:29 +0000)]
Put the ARGE_DEBUG behind a kernel config option.

13 years agoBegin fleshing out a functioning debugging setup for if_arge.
adrian [Tue, 5 Apr 2011 05:15:48 +0000 (05:15 +0000)]
Begin fleshing out a functioning debugging setup for if_arge.

I'm seeing TX hangs when doing large amounts of TX traffic;
an interface reset fixes it. This will hopefully help me identify
why.

13 years agoCheck correctly for whether there are any available wireless networks. This
nwhitehorn [Tue, 5 Apr 2011 03:11:21 +0000 (03:11 +0000)]
Check correctly for whether there are any available wireless networks. This
was tested on a train in the middle of an upstate New York swamp.

13 years agoImprove logging by always sending stderr to the installation log file.
nwhitehorn [Tue, 5 Apr 2011 03:09:44 +0000 (03:09 +0000)]
Improve logging by always sending stderr to the installation log file.
Reduce warnings by making sure the temporary etc directory exists.

13 years agoUse cpu_ticks() for get_cyclecount(9) rather than checking existence of TSC
jkim [Mon, 4 Apr 2011 22:56:33 +0000 (22:56 +0000)]
Use cpu_ticks() for get_cyclecount(9) rather than checking existence of TSC
at run-time on i386.  cpu_ticks() is set to use RDTSC early enough on i386
where it is available.  Otherwise, cpu_ticks() is driven by the current
timecounter hardware as binuptime(9) does.  This also avoids unnecessary
namespace pollution from <machine/cputypes.h>.

13 years agoAdd a manpage for the nvram2env driver.
adrian [Mon, 4 Apr 2011 22:30:12 +0000 (22:30 +0000)]
Add a manpage for the nvram2env driver.

13 years agoMove a trivial acpi_TimerDelta() to acpivar.h to make it inlineable.
jkim [Mon, 4 Apr 2011 18:39:04 +0000 (18:39 +0000)]
Move a trivial acpi_TimerDelta() to acpivar.h to make it inlineable.

13 years agoBuild boot2 with -mregparm=3, ie. pass upto 3 arguments via registers.
rdivacky [Mon, 4 Apr 2011 18:23:55 +0000 (18:23 +0000)]
Build boot2 with -mregparm=3, ie. pass upto 3 arguments via registers.
This modifies CFLAGS and tweaks sio.S to use the new calling convention.
The sio_init() and sio_putc() prototypes are modified so that other
users of this code know the correct calling convention.

This makes the code smaller when compiled with clang.

Reviewed by:    jhb
Tested by:      me and Freddie Cash <fjwcash gmail com>

13 years agoAlways check the current minimum value to make the test more predictable.
jkim [Mon, 4 Apr 2011 17:44:26 +0000 (17:44 +0000)]
Always check the current minimum value to make the test more predictable.
Use INT32_MAX instead of an arbitrary big number for the initial minimum.

13 years agoerrno.h: fix couple of whitespace nits
avg [Mon, 4 Apr 2011 17:39:30 +0000 (17:39 +0000)]
errno.h: fix couple of whitespace nits

Submitted by: bde (a half of the changes)
MFC after: 1 week

13 years agoFix bogus logic to calculate delta between two values from ACPI timers.
jkim [Mon, 4 Apr 2011 17:30:33 +0000 (17:30 +0000)]
Fix bogus logic to calculate delta between two values from ACPI timers.

13 years agoLower the bar for ACPI-fast on virtual machines. The current logic depends
jkim [Mon, 4 Apr 2011 17:00:50 +0000 (17:00 +0000)]
Lower the bar for ACPI-fast on virtual machines.  The current logic depends
on the fact that real hardware has almost fixed cost to read the ACPI timer.
It is virtually always false for hardware emulation and it makes no sense to
read it multiple times, which is already quite expensive for full emulation.

13 years agoFix a long standing bug where file_load() passes down the global loadaddr
marcel [Mon, 4 Apr 2011 16:59:46 +0000 (16:59 +0000)]
Fix a long standing bug where file_load() passes down the global loadaddr
to the l_load() method in the file_formats structure, while being passed
an address as an argument (dest). With file_load() calling arch_loadaddr()
now, this bug is a little bit more significant.

Spotted by: nyan@ (nice catch!)

13 years agoAdd inline to acpi_timer_read() to reduce unnecessary jumps and calls.
jkim [Mon, 4 Apr 2011 16:47:42 +0000 (16:47 +0000)]
Add inline to acpi_timer_read() to reduce unnecessary jumps and calls.

13 years ago"Tag" the "2010/08/04 20:29:18 UTC" import.
obrien [Mon, 4 Apr 2011 16:24:05 +0000 (16:24 +0000)]
"Tag" the "2010/08/04 20:29:18 UTC" import.

13 years agoVendor import NetBSD's libedit of "2010/08/04 20:29:18 UTC".
obrien [Mon, 4 Apr 2011 16:23:32 +0000 (16:23 +0000)]
Vendor import NetBSD's libedit of "2010/08/04 20:29:18 UTC".

Obtained from: NetBSD

13 years agoRemove malloc type M_NETADDR unused since splitting into vfs_subr.c
pluknet [Mon, 4 Apr 2011 16:23:01 +0000 (16:23 +0000)]
Remove malloc type M_NETADDR unused since splitting into vfs_subr.c
and vfs_export.c.

MFC after: 1 week

13 years agoCommit missing bits from the last commit:
adrian [Mon, 4 Apr 2011 14:53:36 +0000 (14:53 +0000)]
Commit missing bits from the last commit:

* add the hal capability flag
* make sure its disabled for the ar9280/ar9285.

13 years agoAdd a HAL capability bit for supporting self-linked RX descriptors and disable it...
adrian [Mon, 4 Apr 2011 14:52:31 +0000 (14:52 +0000)]
Add a HAL capability bit for supporting self-linked RX descriptors and disable it for the 11n chipsets.

From the ath9k source:

==

11N: we can no longer afford to self link the last descriptor.
MAC acknowledges BA status as long as it copies frames to host
buffer (or rx fifo). This can incorrectly acknowledge packets
to a sender if last desc is self-linked.

==

Since this is useful for pre-AR5416 chips that communicate PHY errors
via error frames rather than by on-chip counters, leave the support
in there, but disable it for AR5416 and later.

13 years agoAt least set the coverage class value here; worry about populating the
adrian [Mon, 4 Apr 2011 11:01:53 +0000 (11:01 +0000)]
At least set the coverage class value here; worry about populating the
register values at a later date.

13 years agoDo not increment num_args if strsep(3) returned an empty field.
pluknet [Mon, 4 Apr 2011 09:25:27 +0000 (09:25 +0000)]
Do not increment num_args if strsep(3) returned an empty field.
That fixes devstat_buildmatch(3) crashes with certain strings.

Reported by: arundel
MFC after: 2 weeks

13 years agoWhen removing ifnets, we should first remove the reference to ifnet
glebius [Mon, 4 Apr 2011 07:45:08 +0000 (07:45 +0000)]
When removing ifnets, we should first remove the reference to ifnet
from the interface index, then decrease refcount, not vice versa.

Otherwise there is a race (reproducible) when if_free_internal()
contests on IFNET_WLOCK(), and we got a zero-refed ifnet in the
index for a long time. It may be picked by some other thread,
that runs ifnet_byindex_ref(), who takes the ifnet from index,
and bumps refcount. When reader drops the lock, if_free_internal()
proceeds with free. Then reader tries to free it a second time.

13 years agoLower WARNS to unbreak the build, some archs may have alignment issues.
thompsa [Mon, 4 Apr 2011 03:43:13 +0000 (03:43 +0000)]
Lower WARNS to unbreak the build, some archs may have alignment issues.

13 years agofix printing of tv_usec
thompsa [Mon, 4 Apr 2011 02:57:19 +0000 (02:57 +0000)]
fix printing of tv_usec

13 years agoUse the new arch_loadaddr I/F to align ELF objects to PBVM page
marcel [Sun, 3 Apr 2011 23:49:20 +0000 (23:49 +0000)]
Use the new arch_loadaddr I/F to align ELF objects to PBVM page
boundaries. For good measure, align all other objects to cache
lines boundaries.

Use the new arch_loadseg I/F to keep track of kernel text and
data so that we can wire as much of it as is possible. It is
the responsibility of the kernel to link critical (read IVT
related) code and data at the front of the respective segment
so that it's covered by TRs before the kernel has a chance to
add more translations.

Use a better way of determining whether we're loading a legacy
kernel or not. We can't check for the presence of the PBVM page
table, because we may have unloaded that kernel and loaded an
older (legacy) kernel after that. Simply use the latest load
address for it.

13 years ago- Include usbdump into default build.
hselasky [Sun, 3 Apr 2011 22:36:40 +0000 (22:36 +0000)]
- Include usbdump into default build.

MFC after: 7 days
Approved by: thompsa (mentor)

13 years agoAdd 2 new archsw interfaces:
marcel [Sun, 3 Apr 2011 22:31:51 +0000 (22:31 +0000)]
Add 2 new archsw interfaces:
1.  arch_loadaddr - used by platform code to adjust the address at which
    the object gets loaded. Implement PC98 using this new interface instead
    of using conditional compilation. For ELF objects the ELF header is
    passed as the data pointer. For raw files it's the filename. Note that
    ELF objects are first considered as raw files.
2.  arch_loadseg - used by platform code to keep track of actual segments,
    so that (instruction) caches can be flushed or translations can be
    created. Both the ELF header as well as the program header are passed
    to allow platform code to treat the kernel proper differently from any
    additional modules and to have all the relevant details of the loaded
    segment (e.g. protection).

13 years ago- Fix for missing event if a libUSB USB transfer is started and
hselasky [Sun, 3 Apr 2011 20:22:49 +0000 (20:22 +0000)]
- Fix for missing event if a libUSB USB transfer is started and
stopped rapidly in succession.

Reported by: J.R. Oldroyd
MFC after: 7 days
Approved by: thompsa (mentor)

13 years ago- Correct EHCI interrupt disabling at detach.
hselasky [Sun, 3 Apr 2011 20:17:49 +0000 (20:17 +0000)]
- Correct EHCI interrupt disabling at detach.

Submitted by: Luiz Otavio O Souza
MFC after: 7 days
Approved by: thompsa (mentor)

13 years agoI missed committing this last time - it's needed for the 5ghz fast clock calculation.
adrian [Sun, 3 Apr 2011 20:15:41 +0000 (20:15 +0000)]
I missed committing this last time - it's needed for the 5ghz fast clock calculation.

13 years ago- Improvements to USB PF solution
hselasky [Sun, 3 Apr 2011 20:03:45 +0000 (20:03 +0000)]
- Improvements to USB PF solution
- Add more fields for USB device and host mode
- Add more information to USB PF header so that decoding
  can easily be done by software analyzer tools like
  Wireshark.
- Optimise usbdump to display USB streams in text format
  more efficiently.
- Software using USB PF must be recompiled after
  this commit, due to structure changes.

MFC after: 7 days
Approved by: thompsa (mentor)

13 years agoIn g_eli_read_done() and g_eli_write_done(), for a bio with
trociny [Sun, 3 Apr 2011 17:38:12 +0000 (17:38 +0000)]
In g_eli_read_done() and g_eli_write_done(), for a bio with
bio_children > 1, g_destroy_bio() is never called and the bio
leaks. Fix this by calling g_destroy_bio() earlier, before the check.

Submitted by: Victor Balada Diaz <victor@bsdes.net> (initial version)
Approved by: pjd (mentor)
MFC after: 1 week

13 years agoAdd in the clock timing calculation when Merlin is using the 5ghz fast clock.
adrian [Sun, 3 Apr 2011 17:36:32 +0000 (17:36 +0000)]
Add in the clock timing calculation when Merlin is using the 5ghz fast clock.
This is a 44mhz clock, not a 40mhz clock like normal for 5ghz operation.

13 years agoImport the initial CPU support for the MIPS RALink RT305x SoC.
adrian [Sun, 3 Apr 2011 14:39:55 +0000 (14:39 +0000)]
Import the initial CPU support for the MIPS RALink RT305x SoC.
This is a MIPS4KC CPU with various embedded peripherals, including
wireless and ethernet support.

This commit includes the platform, UART, ethernet MAC and GPIO support.
The interrupt-driven GPIO code is disabled for now pending GPIO changes
from the submitter.

Submitted by: Aleksandr Rybalko <ray@dlink.ua>

13 years agoAdd in some missing flags in the EHCI initialisation code,
adrian [Sun, 3 Apr 2011 14:34:28 +0000 (14:34 +0000)]
Add in some missing flags in the EHCI initialisation code,
needed to get USB working on the AR913x/AR724x.

13 years agoCommit configuration files for the AR913x SoC and the TP-Link WR-1043ND.
adrian [Sun, 3 Apr 2011 13:19:58 +0000 (13:19 +0000)]
Commit configuration files for the AR913x SoC and the TP-Link WR-1043ND.

The AR91XX_BASE{,.hints} files define all the common parameters for
the AR913x SoC systems.

The TP-1043ND config file adds local parameters.

13 years agoImport a fix from the ath9k - reduce the TX FIFO size for Kite (AR9285.)
adrian [Sun, 3 Apr 2011 12:02:49 +0000 (12:02 +0000)]
Import a fix from the ath9k - reduce the TX FIFO size for Kite (AR9285.)

13 years agoAdd an explanation of the inivals
adrian [Sun, 3 Apr 2011 11:59:52 +0000 (11:59 +0000)]
Add an explanation of the inivals

13 years agoImport nvram2env, a device driver which imports various NVRAM-style
adrian [Sun, 3 Apr 2011 11:55:48 +0000 (11:55 +0000)]
Import nvram2env, a device driver which imports various NVRAM-style
environments into the kernel environment.

The eventual aim is to replace these with specific drivers for
the various bootloaders (redboot, uboot, etc.) This however will
work for the time being until it can be properly addressed.

Submitted by: Aleksandr Rybalko <ray@dlink.ua>

13 years agoRevert rev 165325. The arch_maphint interface hasn't been in use for
marcel [Sun, 3 Apr 2011 05:09:25 +0000 (05:09 +0000)]
Revert rev 165325. The arch_maphint interface hasn't been in use for
more than 4 years.

13 years agoMFV of tzdata2011e:
edwin [Sun, 3 Apr 2011 03:42:42 +0000 (03:42 +0000)]
MFV of tzdata2011e:

Change for Africa/Casablanca:
- The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
- The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00

Update for SouthAmerica/Chili:
- Chile's clocks will go back an hour this year on the 7th of May instead
  of this Saturday. They will go forward again the 3rd Saturday in
  August, not in October as they have since 1968. This is a pilot plan
  which will be reevaluated in 2012.

13 years agoMake the ski loader functional again after the previous set of changes.
marcel [Sun, 3 Apr 2011 03:26:12 +0000 (03:26 +0000)]
Make the ski loader functional again after the previous set of changes.

13 years agoFix problems that manifested from filesystem full conditions:
jeff [Sat, 2 Apr 2011 21:52:58 +0000 (21:52 +0000)]
Fix problems that manifested from filesystem full conditions:

 - In softdep_revert_mkdir() find the dotaddref before we attempt to cancel
   the jaddref so we can make assumptions about where the dotaddref is on
   the list.  cancel_jaddref() does not always remove items from the list
   anymore.
 - Always set GOINGAWAY on an inode in softdep_freefile() if DEPCOMPLETE
   was never set.  This ensures that dependencies will continue to be
   processed on the inowait/bufwait list and is more an artifact of
   the structure of the code than a pure ordering problem.
 - Always set DEPCOMPLETE on canceled jaddrefs so that they can be freed
   appropriately.  This normally occurs when the refs are added to the
   journal but if they are canceled before this point the state would
   never be set and the dependency could never be freed.

Reported by: pho
Tested by: pho

13 years agoImplement compat32 shims for PCIOCGETCONF.
kib [Sat, 2 Apr 2011 16:02:25 +0000 (16:02 +0000)]
Implement compat32 shims for PCIOCGETCONF.

There is a generic problem with the shims for ioctls that receive
pointers to the usermode data areas in the data argument. We either have
to modify the handler to accept UIO_USERSPACE/UIO_SYSSPACE indicator, or
allocate and fill a usermode memory for data buffer in the host format.
The change goes the second route, in particular because we do not need
to modify the handler.

Submitted by: John Wehle <john feith com>
MFC after: 2 weeks

13 years agoProvide the structures and ioctl number definition for handling
kib [Sat, 2 Apr 2011 15:47:23 +0000 (15:47 +0000)]
Provide the structures and ioctl number definition for handling
PCIOCGETCONF compat32.

Submitted by: John Wehle <john feith com>
MFC after: 2 weeks

13 years agoAdd accounting for RACCT_NPTS.
trasz [Sat, 2 Apr 2011 15:02:42 +0000 (15:02 +0000)]
Add accounting for RACCT_NPTS.

13 years agoAdd missing include.
adrian [Sat, 2 Apr 2011 09:46:09 +0000 (09:46 +0000)]
Add missing include.

Reported by: Ulrich Sporlein <uqs@spoerlein.net>

13 years agoIncrease default timeout from 5 seconds to 20 seconds. 5 seconds is definitely
pjd [Sat, 2 Apr 2011 09:34:33 +0000 (09:34 +0000)]
Increase default timeout from 5 seconds to 20 seconds. 5 seconds is definitely
to short under heavy load and I was experiencing those timeouts in my recent
tests.

MFC after: 1 week

13 years agoHandle ENOBUFS on send(2) by retrying for a while and logging the problem.
pjd [Sat, 2 Apr 2011 09:31:02 +0000 (09:31 +0000)]
Handle ENOBUFS on send(2) by retrying for a while and logging the problem.

MFC after: 1 week

13 years agoWhen we are operating on blocking socket and get EAGAIN on send(2) or recv(2)
pjd [Sat, 2 Apr 2011 09:29:53 +0000 (09:29 +0000)]
When we are operating on blocking socket and get EAGAIN on send(2) or recv(2)
this means that request timed out. Translate the meaningless EAGAIN to
ETIMEDOUT to give administrator a hint that he might need to increase timeout
in configuration file.

MFC after: 1 month

13 years agoDeclare directions for sockets between primary and secondary.
pjd [Sat, 2 Apr 2011 09:25:13 +0000 (09:25 +0000)]
Declare directions for sockets between primary and secondary.
In HAST we use two sockets - one for only sending the data and one for only
receiving the data.

MFC after: 1 month

13 years agoAllow to disable sends or receives on a socket using shutdown(2) by
pjd [Sat, 2 Apr 2011 09:22:06 +0000 (09:22 +0000)]
Allow to disable sends or receives on a socket using shutdown(2) by
interpreting NULL 'data' argument passed to proto_common_send() or
proto_common_recv() as a will to do so.

MFC after: 1 month

13 years agoHandle the problem described in r220264 by using GEOM GATE queue of unlimited
pjd [Sat, 2 Apr 2011 07:01:09 +0000 (07:01 +0000)]
Handle the problem described in r220264 by using GEOM GATE queue of unlimited
length. This should fix deadlocks reported by HAST users.

MFC after: 1 week

13 years agoBecause ggatel(8) operates on local GEOM providers, use unlimited queue size in
pjd [Sat, 2 Apr 2011 06:59:05 +0000 (06:59 +0000)]
Because ggatel(8) operates on local GEOM providers, use unlimited queue size in
GEOM GATE to fix the issue described in r220264. This also means that we no
longer need -q option, remove it. Don't bother to leaving it as a no-op, as
ggatel(8) is just an example utility.

13 years agoGEOM has an internal mechanism to deal with ENOMEM errors returned via
pjd [Sat, 2 Apr 2011 06:56:06 +0000 (06:56 +0000)]
GEOM has an internal mechanism to deal with ENOMEM errors returned via
g_io_deliver(). In such case it increases 'pace' counter on each ENOMEM and
reschedules the request. The 'pace' counter is decreased for each request going
down, but until 'pace' is greater than zero, GEOM will handle at most 10
requests per second. For GEOM GATE users that are proxy to local GEOM providers
(like ggatel(8) and HAST) we can end up with almost permanent slow down of GEOM
down queue. This is because once we reach GEOM GATE queue limit, we return
ENOMEM to the GEOM. This means that we have, eg. 1024 I/O requests in the GEOM
GATE queue. To make room in the queue and stop returning ENOMEM we need to
proceed the requests of course, but those requests are handled by userland
daemons that handle them by reading/writing also from/to local GEOM providers.
For example with HAST, a new requests comes to /dev/hast/data, which is GEOM
GATE provider. GEOM GATE passes the request to hastd(8) and hastd(8)
reads/writes from/to /dev/da0. Once we reach GEOM GATE queue limit, to free up
a slot in GEOM GATE queue, hastd(8) has to read/write from/to /dev/da0, but
this request will also be very slow, because GEOM now slows down all the
requests. We end up with full queue that we can unload at the speed of 10
requests per second. This simply looks like a deadlock.

Fix it by allowing userland daemons that work with both GEOM GATE and local
GEOM providers to specify unlimited queue size, so GEOM GATE will never return
ENOMEM to the GEOM.

MFC after: 1 week

13 years agoOverhaul locale handling.
gordon [Sat, 2 Apr 2011 05:01:09 +0000 (05:01 +0000)]
Overhaul locale handling.

Use locale(1) to determine the locale instead of trying to hand roll it.
Correctly construct groff call based on charset and locale independently,
not the mix between the two.

Submitted by: uqs@