kib [Wed, 23 Feb 2011 13:50:24 +0000 (13:50 +0000)]
Move the max_threads_per_proc and max_threads_hits variables to the
file where they are used. Declare the kern.threads sysctl node at the
same location. Since no external use for the variables exists, make them
static.
jhb [Wed, 23 Feb 2011 13:23:28 +0000 (13:23 +0000)]
Use umtx_key objects to uniquely identify futexes. Private futexes in
different processes that happen to use the same user address in the
separate processes will now be treated as distinct futexes rather than the
same futex. We can now honor shared futexes properly by mapping them to a
PROCESS_SHARED umtx_key. Private futexes use THREAD_SHARED umtx_key
objects.
jhb [Wed, 23 Feb 2011 12:58:50 +0000 (12:58 +0000)]
Properly handle BARs bigger than 4G. The '1' was treated as an int
causing the size calculation to be truncated to the size of an int
(32-bits on all current architectures).
Submitted by: Anish akgupt3 of gmail
MFC after: 1 week
yongari [Wed, 23 Feb 2011 02:40:31 +0000 (02:40 +0000)]
Remove unnecessary controller reinitialization which resulted in
link flips during alias address insertion or dhclient operation.
While I'm here remove dc_reset() in DC_ISR_BUS_ERR case. Device is
fully reinitialized again in dc_init_locked().
dougb [Tue, 22 Feb 2011 21:13:40 +0000 (21:13 +0000)]
Update how accounting log files are rotated.
The old version had a race between the time that the old file was
cp'ed to acct.0 and the time that 'sa -s' was run that prevented
the commands that occurred in the meantime from being backed up.
It's also arguable that the old version was inefficient in using
cp which can be a problem on a space-constrained system.
This version avoids both problems, albeit it's considerably more
complicated. The advantage of putting the log rotation in the rc.d
script is that it can handle the _enable and _file questions without
having to do gymnastics to discover either value in the periodic script.
As a side effect of reviewing the rc.d script I cleaned it up a bit.
bschmidt [Tue, 22 Feb 2011 19:05:42 +0000 (19:05 +0000)]
Make sure to only accept and handle action frames which are for us. In
promiscuous mode we might receive stuff which otherwise gets filtered
by hardware.
alc [Tue, 22 Feb 2011 14:47:10 +0000 (14:47 +0000)]
Eliminate two dubious attempts at optimizing the implementation of a
file's last accessed, modified, and changed times:
TMPFS_NODE_ACCESSED and TMPFS_NODE_CHANGED should be set unconditionally
in tmpfs_remove() without regard to the number of hard links to the file.
Otherwise, after the last directory entry for a file has been removed, a
process that still has the file open could read stale values for the last
accessed and changed times with fstat(2).
Similarly, tmpfs_close() should update the time-related fields even if all
directory entries for a file have been removed. In this case, the effect
is that the time-related fields will have values that are later than
expected. They will correspond to the time at which fstat(2) is called.
nwhitehorn [Tue, 22 Feb 2011 13:56:59 +0000 (13:56 +0000)]
Add support for optional distributions, installation of the ports tree and
src. Fitting all of this on a single CD along with a full system requires
changing the default compression algorithm from gzip to xz.
nyan [Tue, 22 Feb 2011 13:52:03 +0000 (13:52 +0000)]
MFi386: revision 218926
In sys/boot/i386/boot2/boot2.c, change the type of the 'opts' variable
from uint16_t back to uint32_t. The actual option bitmasks (RB_* and
RBX_*) assume at least a 32 bit variable.
lstewart [Tue, 22 Feb 2011 10:09:34 +0000 (10:09 +0000)]
Use a single list to simplify future maintenance and ensure all list items are
aligned the same (no functional change at the moment as both list items are the
same number of characters).
sobomax [Tue, 22 Feb 2011 09:11:47 +0000 (09:11 +0000)]
Make code more friendly to the non-C99 compilers - don't allocate
local variables in the `for' loop declaration. This allows trunk
newsyslog.c to be compiled on 7.x. This change should be no-op from
the functional POV.
uqs [Tue, 22 Feb 2011 08:13:49 +0000 (08:13 +0000)]
Flesh out WITHOUT_GROFF support to DTRT.
A full featured groff is required during buildworld, so build it always
and don't rely on it being present on the host system.
vgrind(1) is tightly coupled to a roff processor and will not be
built/installed when groff is disabled. Also much of the roff'ed
documentation under share/doc will not be built/installed when
WITHOUT_GROFF is defined.
jchandra [Tue, 22 Feb 2011 07:49:51 +0000 (07:49 +0000)]
Fix bzero() for 64-bit.
The existing implementation of bzero incorrectly clears bytes when the
start address is not word aligned. Fix it by using REG_SHI macro which
works on both 32 and 64 bit.
imp [Tue, 22 Feb 2011 04:49:57 +0000 (04:49 +0000)]
Back out 218933 and 281934. The easy cases still worked, but some
hard cases broke in worse ways than the status quo. Back them out
until that can be resolved.
imp [Tue, 22 Feb 2011 04:07:15 +0000 (04:07 +0000)]
Select building CLANG based on ${TARGET_ARCH} and existence of
WITH{,OUT}_CLANG. We default to yes on some archs, no on others,
unless WITHOUT_CLANG or WITH_CLANG is defined respectively.
imp [Tue, 22 Feb 2011 04:03:33 +0000 (04:03 +0000)]
Testing based on MACHINE_ARCH is problematic. Default to yes to build
clang. A separate change will fix buildworld to default to yes or no
based on the target.
adrian [Tue, 22 Feb 2011 00:37:53 +0000 (00:37 +0000)]
Shuffle around the RTS/CTS rate/duration logic.
* Turn ath_tx_calc_ctsduration() into a function that
returns the ctsduration, or -1 for HT rates;
* add a printf() to ath_tx_calc_ctsduration() which will be
very loud if somehow that function is called with an MCS
rate;
* Add ath_tx_get_rtscts_rate() which returns the RTS/CTS
rate to use for the given data rate, incl. the short
preamble flag;
* Only call ath_tx_calc_ctsduration() for non-11n chipsets;
11n chipsets don't require the rtscts duration to be
calculated.
bschmidt [Mon, 21 Feb 2011 19:59:43 +0000 (19:59 +0000)]
Add a new mgmt subtype "ACTION NO ACK" defined in 802.11n-2009, while here
clean up parts of the *_recv_mgmt() functions.
- make sure appropriate counters are bumped and debug messages are printed
- order the unhandled subtypes by value and add a few missing ones
- fix some whitespace nits
- remove duplicate code in adhoc_recv_mgmt()
- remove a useless comment, probably left in while c&p
dim [Mon, 21 Feb 2011 19:46:02 +0000 (19:46 +0000)]
In sys/boot/i386/boot2/boot2.c, change the type of the 'opts' variable
from uint16_t back to uint32_t. The actual option bitmasks (RB_* and
RBX_*) assume at least a 32 bit variable.
adrian [Mon, 21 Feb 2011 18:58:58 +0000 (18:58 +0000)]
Add a vocal warning to ath_hal_computetxtime() function is used for non-11n rates.
It's used to calculate:
* the initial per-rate entries for short/long preamble ACK durations;
* packet durations for TDMA slot decisions;
* RTS/CTS protection durations;
* updating the duration field in the 802.11 frame header
This way invalid durations will generate a warning, prompting for it to be
fixed.
adrian [Mon, 21 Feb 2011 15:49:59 +0000 (15:49 +0000)]
Default to the lowest negotiated rate for mgmt/multicast traffic in 11n mode
The current code transmits management and multicast frames at MCS 0.
What it should do is check whether the negotiated basic set is zero (and
the MCS set is not) before making this decision.
For now, simply default to the lowest negotiated rate, rather than
MCS 0. This fixes the behaviour with at least the DLINK DIR-825, which
ACKs but silently ignores block-ack (BA) response frames.
nwhitehorn [Mon, 21 Feb 2011 14:28:31 +0000 (14:28 +0000)]
Add some error checking on the return values of chdir() and calloc(). The
first might actually happen, so it displays the error message in a prettier
way.
Found by: Coverity Prevent(tm)
CID: 9121, 9122, 9123, 9124
lstewart [Mon, 21 Feb 2011 11:56:11 +0000 (11:56 +0000)]
Final commit to round out the "Five New TCP Congestion Control Algorithms for
FreeBSD" FreeBSD Foundation funded project.
- Add new man pages for the modular congestion control, Khelp and Hhook
frameworks (cc.4, cc.9, khelp.9 and hhook.9).
- Add new man pages for each available congestion control algorithm (cc_chd.4,
cc_cubic.4, cc_hd.4, cc_htcp.4, cc_newreno.4 and cc_vegas.4).
- Add a new man page for the Enhanced Round Trip Time (ERTT) Khelp module
(h_ertt.4).
- Update the TCP (tcp.4) man page to mention the TCP_CONGESTION socket option,
cross reference to cc.4 and remove references to the retired
"net.inet.tcp.newreno" sysctl MIB variable.
In collaboration with: David Hayes <dahayes at swin edu au> and
Grenville Armitage <garmitage at swin edu au>
Sponsored by: FreeBSD Foundation
MFC after: 3 months
brucec [Mon, 21 Feb 2011 09:56:08 +0000 (09:56 +0000)]
The FD_FORM ioctl used to ignore errors from the floppy controller; now when
it encounters an error it returns an error from the ioctl.
Ignore any errors when using the FD_FORM ioctl.
mm [Sun, 20 Feb 2011 22:32:21 +0000 (22:32 +0000)]
Add opteron-sse3, athlon64-sse3 and k8-sse3 cpu types to bsd.cpu.mk.
- add "sse3" to MACHINE_CPU for the new cpu types
- for i386, default to CPUTYPE=prescott for the new cpu types
mm [Sun, 20 Feb 2011 22:25:23 +0000 (22:25 +0000)]
Backport svn r124339 from gcc 4.3 and add opteron-sse3, athlon64-sse3
and k8-sse3 cpu-types for -march=/-mtune= gcc options.
These new cpu-types include the SSE3 instruction set that is supported
by all newer AMD Athlon 64 and Opteron processors.
All three cpu-types are supported by clang and all gcc versions
starting with 4.3 SVN rev 124339 (at that time GPLv2 licensed).
dchagin [Sun, 20 Feb 2011 07:58:30 +0000 (07:58 +0000)]
Do not clobber %rdx.
Before calling vfork() syscall the linux user-space stores the current PID
in the %rdx and restore it when the parent process will leave the kernel.
jh [Sat, 19 Feb 2011 14:27:14 +0000 (14:27 +0000)]
Don't restore old mount options and flags if VFS_MOUNT(9) succeeds but
vfs_export() fails. Restoring old options and flags after successful
VFS_MOUNT(9) call may cause the file system internal state to become
inconsistent with mount options and flags. Specifically the FFS super
block fs_ronly field and the MNT_RDONLY flag may get out of sync.
ed [Sat, 19 Feb 2011 11:44:04 +0000 (11:44 +0000)]
Add a utility, utxrm(8).
Most of the ports I broke when I imported utmpx, were simple management
utilities for the utmp database, allowing you to add/remove entries
manually.
Add a small tool called utxrm(8), which allows you to remove an entry
from the utmpx database by hand. This is useful when a login daemon
crashes or fails to remove the entry during shutdown.
brucec [Sat, 19 Feb 2011 09:08:13 +0000 (09:08 +0000)]
In the distribution list, 'A' is listed as the key to press to select both
'All' and 'Minimal'. Update the keys for Minimal and Custom to avoid the
conflict.
PR: bin/153809
Submitted by: Janne Snabb <snabb at epipe.com>
MFC after: 3 days
yongari [Sat, 19 Feb 2011 02:47:10 +0000 (02:47 +0000)]
Split common TX/RX descriptor DMA tag to TX and RX DMA tags
respectively and fix all bus_dma(9) issues seen when bounce buffers
are used.
o Setup frame handling had no bus_dmamap_sync(9) which prevented
driver from configuring RX filter. Add missing bus_dmamap_sync(9)
in both dc_setfilt_21143()/dc_setfilt_xircom() and dc_txeof().
o Use bus_addr_t for DMA segment instead of using u_int32_t.
o Introduce dc_dma_alloc()/dc_dma_free() functions to allocate/free
DMA'able memory.
o Create two DMA descriptor list for each TX/RX lists. This change
will minimize the size of bounce buffers that would be used in
each TX/RX path. Previously driver had to copy both TX/RX lists
when bounce buffer is active.
o 21143 data sheet says descriptor list requires 4 bytes alignment.
Remove PAGE_SIZE alignment restriction and use
sizeof(struct dc_dec).
o Setup frame requires 4 bytes alignment. Remove PAGE_SIZE
alignment restriction and use sizeof(struct dc_dec).
o Add missing DMA map unload for both setup frame and TX/RX
descriptor list.
o Overhaul RX handling logic such that make driver always allocate
new RX buffer with dc_newbuf(). Previously driver allowed to
copy received frame with m_devget(9) after passing the
descriptor ownership to controller. This can lead to passing
wrong frame to upper stack.
o Introduce dc_discard_rxbuf() which will discard received frame
and reuse loaded DMA map and RX mbuf.
o Correct several wrong bus_dmamap_sync(9) usage in dc_rxeof and
dc_txeof. The TX/RX descriptor lists are updated by both driver
and HW so READ/WRITE semantics should be used.
o If driver failed to allocate new RX buffer, update if_iqdrops
counter instead of if_ierrors since driver received the frame
without errors.
o Make sure to unload loaded setup frame DMA map in dc_txeof and
clear the mark of setup frame of the TX descriptor in dc_txeof().
o Add check for possible TX descriptor overruns in dc_encap() and
move check for free buffer to caller, dc_start_locked().
o Swap the loaded DMA map and the last DMA map for multi-segmented
frames. Since dc_txeof() assumes the last descriptor of the
frame has the DMA map, driver should swap the first and the last
DMA map in dc_encap(). Previously driver tried to unload
not-yet-loaded DMA map such that the loaded DMA map was not
unloaded at all for multi-segmented frames.
o Rewrite DC_RXDESC/DC_TXDESC macro to simpler one.
o Remove definition of ETHER_ALIGN, it's already defined in
ethernet.h.
With this changes, dc(4) works with bounce buffers and it shall
also fix issues which might have shown in PAE environments.
yongari [Sat, 19 Feb 2011 01:37:28 +0000 (01:37 +0000)]
Rearrange interrupt handler a bit and remove forever loop.
Previously dc(4) always checked whether there is pending interrupts
and this consumed a lot of CPU cycles in interrupt handler. Limit
the number of processing for TX/RX frames to 16. Also allow sending
frames in the loop not to starve TX under high RX load.
Reading DC_ISR register should be protected with driver lock,
otherwise interrupt handler could be run(e.g. link state change)
before the completion of dc_init_locked().
yongari [Sat, 19 Feb 2011 00:00:32 +0000 (00:00 +0000)]
Send frames only when there is a valid link and driver is running
as well as controller has enough free TX descriptors.
Remove check for number of queued frames before attempting to
transmit. I guess it was added to allow draining queued frames
even if there is no link. I'm under the impression this type of
check should be done in upper layer. No other drivers in tree do
that.
yongari [Fri, 18 Feb 2011 23:18:08 +0000 (23:18 +0000)]
Fix a long standing bug where driver handed over RX descriptor
ownership to controller before completion of access to the
descriptor. Driver is faking up status word so it should not give
ownership to controller until it completes RX processing.
yongari [Fri, 18 Feb 2011 23:08:05 +0000 (23:08 +0000)]
There is no need to execute filter configuration when driver is not
running. Remove wrong driver state change in dc_setfilt_xircom().
While I'm here nuke unnecessary assignments.
mdf [Fri, 18 Feb 2011 22:25:11 +0000 (22:25 +0000)]
Modify kdb_trap() so that it re-calls the dbbe_trap function as long as
the debugger back-end has changed. This means that switching from ddb
to gdb no longer requires a "step" which can be dangerous on an
already-crashed kernel.
Also add a capability to get from the gdb back-end back to ddb, by
typing ^C in the console window.
While here, simplify kdb_sysctl_available() by using
sbuf_new_for_sysctl(), and use strlcpy() instead of strncpy() since the
strlcpy semantic is desired.
nwhitehorn [Fri, 18 Feb 2011 21:44:53 +0000 (21:44 +0000)]
Turn off default generation of userland dot symbols on powerpc64 now that
we have a binutils that supports it. Kernel dot symbols remain on to assist
DDB.
dim [Fri, 18 Feb 2011 20:54:12 +0000 (20:54 +0000)]
Merge binutils 2.17.50 to head. This brings a number of improvements to
x86 CPU support, better support for powerpc64, some new directives, and
many other things. Bump __FreeBSD_version, and add a note to UPDATING.
Thanks to the many people that have helped to test this.
yongari [Fri, 18 Feb 2011 20:38:05 +0000 (20:38 +0000)]
For controllers that have TX interrupt moderation capability,
request TX completion interrupt for every 8-th frames. Previously
dc(4) requested TX completion interrupt if number of queued TX
descriptors is greater than 64. This caused a lot of TX completion
interrupt under high TX load once driver queued more than 64 TX
descriptors. It's quite normal to see more than 64 queued TX
descriptors under high TX load.
This change reduces the number of TX completion interrupts to be
less than 17k under high TX load. Because this change does not
generate TX completion interrupt for each frame, add reclaiming
transmitted buffers in dc_tick not to generate false watchdog
timeouts.
While I'm here add check for queued descriptors in dc_txeof() since
there is no more work to do when there is no pending descriptors.