ed [Fri, 14 May 2010 12:34:06 +0000 (12:34 +0000)]
MFC r207453:
Remove WNOHANG flag from wait3().
Because script(1) now reliably terminates when the TTY is closed, it may
be the case that the call to wait3() occurs just before the child
process exits. This causes error codes to be ignored.
Just change script(1) to use waitpid() instead of wait3(). This makes it
more portable and prevents the need for a loop, since waitpid() only
returns a specified process.
attilio [Fri, 14 May 2010 01:43:13 +0000 (01:43 +0000)]
MFC r206878, r206897, r207921:
Fix a deadlock in the shutdown code when some CPUs are performing
smp_rendezvous() (or smp_tlb_shootdown()) and are waiting for
acknowledgment.
delphij [Thu, 13 May 2010 23:28:20 +0000 (23:28 +0000)]
MFC r205099-205100,205108:
Two optimizations to MI strlen(3) inspired by David S. Miller's
blog posting [1].
- Use word-sized test for unaligned pointer before working
the hard way.
Memory page boundary is always integral multiple of a word
alignment boundary. Therefore, if we can access memory
referenced by pointer p, then (p & ~word mask) must be also
accessible.
- Better utilization of multi-issue processor's ability of
concurrency.
The previous implementation utilized a formular that must be
executed sequentially. However, the ~, & and - operations can
actually be caculated at the same time when the operand were
different and unrelated.
The original Hacker's Delight formular also offered consistent
performance regardless whether the input would contain
characters with their highest-bit set, as it catches real
nul characters only.
These two optimizations has shown further improvements over the
previous implementation on microbenchmarks on i386 and amd64 CPU
including Pentium 4, Core Duo 2 and i7.
kib [Thu, 13 May 2010 20:26:16 +0000 (20:26 +0000)]
MFC elimination of several settings of PG_REFERENCED bit, that either
do not make sense or are harmful.
MFC r206761 (by alc):
Setting PG_REFERENCED on the requested page in swap_pager_getpages() is
either redundant or harmful, depending on the caller.
MFC r206768 (by alc):
In vm_object_backing_scan(), setting PG_REFERENCED on a page before
sleeping on that page is nonsensical.
MFC r206770 (by alc):
In vm_object_madvise() setting PG_REFERENCED on a page before sleeping on
that page only makes sense if the advice is MADV_WILLNEED.
MFC r206801 (by alc):
There is no justification for vm_object_split() setting PG_REFERENCED on a
page that it is going to sleep on.
np [Thu, 13 May 2010 17:45:32 +0000 (17:45 +0000)]
MFC r207639, r207643, r207687, r207688
r207639: Add IFCAP_LINKSTATE to cxgb
r207643: T3 hardware filters + cxgbtool interface to this functionality.
r207687: if_cxgb should not depend on the T3 firmware module directly.
r207688: various doorbell adjustments
jilles [Thu, 13 May 2010 15:44:49 +0000 (15:44 +0000)]
MFC r207734: sigaltstack(2): document some modernizations:
* un-document 'struct sigaltstack' tag for stack_t as this is BSD-specific;
this doesn't seem useful enough to document as such
* alternate stacks are per thread, not per process
* update error codes to what the kernel does and POSIX requires
kib [Thu, 13 May 2010 09:26:31 +0000 (09:26 +0000)]
MFC r207364:
In swap pager, do not free the non-requested pages from the run if they are
wired. Kstack pages are wired, this change prepares swap pager for handling
of long runs of kstack pages.
yongari [Wed, 12 May 2010 17:07:19 +0000 (17:07 +0000)]
MFC r207748:
It seems controller has two types of promiscuous control, one for
unicast and the other for multicast. To receive multicast frames
that host didn't join in promiscuous mode, driver have to set
promiscuous mode for multicast frames as well.
The Open Source Software Developer Manual for i8255x was not clear
how to handle promiscuous mode.
vanhu [Wed, 12 May 2010 11:49:15 +0000 (11:49 +0000)]
MFC:
Set/update SA's NAT-T stuff before calling key_mature() in
key_add() and key_update(), as the SA may be used as soon as
key_mature() has been called
bschmidt [Tue, 11 May 2010 17:21:54 +0000 (17:21 +0000)]
MFC r207709:
Add a workaround for a bug in the firmware regarding the transition
from passive to active scans. Basicly disable it by increasing the
amount packets to be received to an amount which can't be reached
during dwell times.
kib [Tue, 11 May 2010 13:18:41 +0000 (13:18 +0000)]
MFC r207468:
Extract thread_lock()/ruxagg()/thread_unlock() fragment into utility
function ruxagg_tlock().
Convert the definition of kern_getrusage() to ANSI C.
MFC r207602:
Implement RUSAGE_THREAD. Add td_rux to keep extended runtime and ticks
information for thread to allow calcru1() (re)use.
Rename ruxagg()->ruxagg_locked(), ruxagg_tlock()->ruxagg() [1].
The ruxagg_locked() function no longer clears thread ticks nor
td_incruntime.
Not an MFC: the td_rux is added to the end of struct thread to keep
the KBI. Explicit bzero() of td_rux is added to new thread initialization
points.
edwin [Mon, 10 May 2010 21:04:45 +0000 (21:04 +0000)]
MFC of 207898, tzdata2010j:
- Bahia de Banderas (Mexican state of Nayarit) changed time zone
UTC-7 to new time zone UTC-6 on April 4, 2010 (to share the same
time zone as nearby city Puerto Vallarta, Jalisco).
marius [Mon, 10 May 2010 20:55:24 +0000 (20:55 +0000)]
MFC: r207683
- Fix broken symlinks on cross platform zfs send/recv. [1]
- Enable zfs_ace_byteswap() on FreeBSD as it works just fine (tested between
amd64 and sparc64 in both directions by Michael Moll).
PR: 146272
Approved by: mm, pjd
Obtained from: OpenSolaris (onnv rev. 8283:1ca59f393041; Bug ID 6764193) [1]
marius [Mon, 10 May 2010 20:25:51 +0000 (20:25 +0000)]
MFC: r207537
Add support for SPARC64 V (and where it already makes sense for other
HAL/Fujitsu) CPUs. For the most part this consists of fleshing out the
MMU and cache handling, it doesn't add pmap optimizations possible with
these CPU, yet, though.
With these changes FreeBSD runs stable on Fujitsu Siemens PRIMEPOWER 250
and likely also other models based on SPARC64 V like 450, 650 and 850.
Thanks go to Michael Moll for providing access to a PRIMEPOWER 250.
yongari [Mon, 10 May 2010 20:01:51 +0000 (20:01 +0000)]
MFC r207622-207623,207638
r207622:
Drop driver lock before exiting from interrupt handler.
r207623:
Make sure to check whether driver is running before processing
received frames. Also check driver has valid ifp pointer before
calling msk_stop() in device_shutdown handler. While I'm here
remove unnecessary accesses to interrupt mask registers in
device_shutdown handler because driver puts the controller into
reset state.
With these changes, msk(4) now survive from heavy RX traffic(1byte
UDP frame) while reboot is in progress.
r207638:
When VLAN hardware tagging is disabled, make sure to disable VLAN
checksum offloading as well as TSO over VLAN.
yongari [Mon, 10 May 2010 19:47:37 +0000 (19:47 +0000)]
MFC r207628,207635:
r207628:
Enable multi-descriptor transmisstion for fragmented mbufs. There
is no more need to defragment mbufs. After transmitting the
multi-fragmented frame, the controller updates only the first
descriptor of multi-descriptor transmission so it's driver's
responsibility to clear OWN bits of remaining descriptor of
multi-descriptor transmission. It seems the controller behaves much
like jme(4) controllers in descriptor handling.
r207635:
Free entire mbuf chain instead of the first mbuf.
jkim [Mon, 10 May 2010 19:21:50 +0000 (19:21 +0000)]
MFC: r207330, r207620
- Remove dead code. Calculated greatest common divisor was not used at all.
- Prefer u_int32_t over unsigned int to make its intention more clearer.
- Move the function to a header file and make it a static inline function.
marius [Mon, 10 May 2010 18:56:36 +0000 (18:56 +0000)]
MFC: r207287
On sparc64 obtain the initiator ID to be used for SPI HBAs from the
Open Firmware device tree in order to match what the PROM built-in
driver uses. This is especially important when netbooting Fujitsu
Siemens PRIMEPOWER250 as in that case the built-in driver isn't used
and the port facts PortSCSIID defaults to 0, conflicting with the
disk at the same address.
marius [Mon, 10 May 2010 18:53:32 +0000 (18:53 +0000)]
MFC: r207285
- On sparc64 obtain the initiator ID from the Open Firmware device tree
in order to match what the PROM built-in driver uses.
- Remove some no longer used includes.
marius [Mon, 10 May 2010 18:50:26 +0000 (18:50 +0000)]
MFC: r207248
Don't bother enabling interrupts before we're ready to handle them. This
prevents the firmware of Fujitsu Siemens PRIMEPOWER250, which both causes
stray interrupts and erroneously enables interrupts at least when calling
SUNW,set-trap-table, from shooting itself in the foot.
marius [Mon, 10 May 2010 18:47:52 +0000 (18:47 +0000)]
MFC: r207243
Add OF_getscsinitid(), a helper similar to OF_getetheraddr() but for
obtaining the initiator ID to be used for SPI controllers from the
Open Firmware device tree.
delphij [Mon, 10 May 2010 02:07:57 +0000 (02:07 +0000)]
MFC r207247,r207283,207284:
- Add a signal handler for SIGINT which removes output file when necessary.
- While I'm there, move unlink_input() slightly down to after closing the
output file, in uncompression path.
- Language improvements to make the BUGS section easier to read.
emaste [Mon, 10 May 2010 01:22:29 +0000 (01:22 +0000)]
MFC r207590:
Update GRANDPARENTED text to match the contents of tzdata/factory r19879.
This eliminates "warning: time zone abbreviation differs from POSIX" on
installworld.
kib [Sat, 8 May 2010 18:54:47 +0000 (18:54 +0000)]
MFC r204051 (by imp):
n64 has a different size for KINFO_PROC_SIZE.
Approved by: imp
MFC r207152:
Move the constants specifying the size of struct kinfo_proc into
machine-specific header files. Add KINFO_PROC32_SIZE for struct
kinfo_proc32 for architectures providing COMPAT_FREEBSD32. Add
CTASSERT for the size of struct kinfo_proc32.
MFC r207269:
Style: use #define<TAB> instead of #define<SPACE>.
mav [Sat, 8 May 2010 16:06:54 +0000 (16:06 +0000)]
MFC r207499:
Make SATA XPT negotiate and enable some additional SATA features, such as:
- device initiated power management (some devices support only this way);
- Automatic Partial to Slumber Transition (more power saving);
- DMA auto-activation (expected to slightly improve performance).
More features could be added later, when hardware supports.
mav [Sat, 8 May 2010 13:09:36 +0000 (13:09 +0000)]
MFC r207433:
Revert r198705.
As scottl@ noticed, max_target/max_lun was intended to be only a hint for
existing bus scanner. Some FC/SAS SIMs report fake values there, that are
smaller then maximum supported IDs. In that case this check makes impossible
manual scan outside hinted range.
For ATA/SATA SIMs respective check was instead implemented at SIM level.
Newer SCSI SIMs expected to have these checks at driver or firmware level.
Some older SCSI SIMs have no this check and the issues will get back there.
mav [Sat, 8 May 2010 13:02:52 +0000 (13:02 +0000)]
MFC r207430:
Add Target/LUN ID checks and deny access to targets 1-14 when PMP absent.
Enforce PMA bit clearing when PMP detached to avoid further scan timeouts.
jilles [Fri, 7 May 2010 20:58:50 +0000 (20:58 +0000)]
MFC r207449: telnet: Fix infinite loop if local output generates SIGPIPE.
Instead of catching SIGPIPE and jumping out of the signal handler with
longjmp, ignore it and handle write errors to the local output by exiting
from there. I have changed the error message to mention the local output
instead of NetBSD's wrong "Connection closed by foreign host". Write errors
to the network were already handled by exiting immediately and this now
applies to EPIPE too.
The code assumed that SIGPIPE could only be generated by the network
connection; if it was generated by the local output, it would longjmp out of
the signal handler and write an error message which caused another SIGPIPE.
tuexen [Fri, 7 May 2010 20:02:36 +0000 (20:02 +0000)]
MFC 206758, 206840, 206891, 206892, 207099, 207191, 207197
* Fix a bug where SACKs are not sent when they should.
* Get delayed SACK working again.
* Really print the nr_mapping array when it should be printed.
* Update highest_tsn variables when sliding mapping arrays.
* Sending a FWDTSN chunk should not affect the retran count.
* Cleanups.
yongari [Thu, 6 May 2010 18:43:00 +0000 (18:43 +0000)]
MFC r207409,207442:
r207409:
Both RX_GMF_LP_THR and RX_GMF_UP_THR must be 16 bits register. If
it is 8bits register then RX FIFO size can't exceed 2KB which is
not true for almost all Yukon II controller.
r207442:
Disable non-ASF packet flushing on Yukon Extreme as vendor's driver
does. Without this change, Yukon Extreme seems to generate lots of
RX FIFO overruns even though controller has available RX buffers.
These excessive RX FIFO overruns generated lots of pause frames
which in turn killed devices plugged into switch. It seems there is
still occasional RX frame corruption on Yukon Extreme but this
change seems to fix the pause frame storm.
yongari [Thu, 6 May 2010 18:34:15 +0000 (18:34 +0000)]
MFC r207380:
Enable VLAN hardware tag insertion/stripping. Due to lack of SiS190
controller, I'm not sure whether this is also applicable to SiS190
so this feature is only activated on SiS191 controller.
In theory, controller reinitialization is not needed when VLAN tag
configuration is changed, but xclin said controller was not stable
whenever toggling VLAN tag bit. To address that, sge(4)
reinitialize controller for VLAN configuration which seems to work
as expected. VLAN tag information for TX/RX descriptor and
configure bit of RxMacControl register was found by xclin.
yongari [Thu, 6 May 2010 18:30:46 +0000 (18:30 +0000)]
MFC r207379:
Enable FCS stripping and padding 10 bytes bit of RX MAC control
register. Due to lack of SiS190 controller, I'm not sure whether
this is also applicable to SiS190 so this feature is only activated
on SiS191 controller.
The controller can pad 10 bytes before DMAing a received frame to
RX buffer and received bytes include the padded bytes. This padding
is very useful on strict-alignment architectures because driver
does not have to copy received frame to align IP header on 4 bytes
boundary. It also gives better RX performance on non-strict
alignment architectures. Special thanks to xclin to give me
valuable register information. Without his enthusiastic trial and
errors this wouldn't be even possible.
While I'm here tighten validity check of received frame. Controller
clears RDS_CRCOK bit when it received bad CRC frames. xclin found
that using loop back testing.
yongari [Thu, 6 May 2010 18:17:36 +0000 (18:17 +0000)]
MFC r207375-207377.
r207375:
Preserve unknown bits of RX MAC control register when driver
programs RX filter configuration. It seems RX MAC control register
is one of key registers to get various offloading features as well
as performance. Blindly clearing unrelated bits can result in
unexpected results.
Remove the need for some "init" functions within the network
stack, like pim6_init(), icmp_init() or significantly shorten
others like ip6_init() and nd6_init(), using static initialization
again where possible and formerly missed.
Move (most) variables back to the place they used to be before the
container structs and VIMAGE_GLOABLS (before r185088) and try to
reduce the diff to stable/7 and earlier as good as possible,
to help out-of-tree consumers to update from 6.x or 7.x to 8 or 9.
This also removes some header file pollution for putatively
static global variables.
Revert VIMAGE specific changes in ipfilter::ip_auth.c, that are
no longer needed.
Reviewed by: jhb
Discussed with: rwatson
Sponsored by: The FreeBSD Foundation
Sponsored by: CK Software GmbH
rmacklem [Thu, 6 May 2010 01:08:36 +0000 (01:08 +0000)]
MFC: r207350
For the experimental NFS client, it should always flush dirty
buffers before closing the NFSv4 opens, as the comment states.
This patch deletes the call to nfscl_mustflush() which would
return 0 for the case where a delegation still exists, which
was incorrect and could cause crashes during recovery from
an expired lease.
jilles [Wed, 5 May 2010 22:17:17 +0000 (22:17 +0000)]
MFC r206760: getcwd(3): Clarify that EACCES may or may not be checked.
POSIX permits but does not require checking access on the current and parent
directories.
Because various programs do not like it if getcwd(3) fails, it seems best
to avoid checking access as much as possible. There are various reports in
GNATS about this (search for getcwd).
Our getcwd(3) implementation first queries the kernel for the pathname
directly, which does not check any permissions but sometimes fails, and then
falls back to reading all parent directories for the names.
jilles [Wed, 5 May 2010 22:00:57 +0000 (22:00 +0000)]
MFC r207186: sysctl(3): Update description of various kern.* variables.
Also add xrefs for confstr(3) (as sysconf(3) but for strings) and kvm(3)
(which is a more convenient way to access some of the variables).
kensmith [Wed, 5 May 2010 16:58:29 +0000 (16:58 +0000)]
Merge r206423:
> Shift the version of perl used by the release build process over to
> perl-5.10. This aligns the release build process with the current
> default version of perl in the ports tree.
kensmith [Wed, 5 May 2010 16:25:57 +0000 (16:25 +0000)]
Merge r206422:
> Pass the HTTP_PROXY and FTP_PROXY environment variables through in addition
> to FTP_PASSIVE_MODE so release building works for a machine that needs
> to use a proxy.