zack [Wed, 12 Jan 2011 23:46:12 +0000 (23:46 +0000)]
In the experimental NFS server, when converting an open-owner to a lock-owner,
start at sequence id 1 instead of 0, to match up with both Solaris and Linux.
mdf [Wed, 12 Jan 2011 21:08:49 +0000 (21:08 +0000)]
Fix a brain fart. Since this file is shared between i386 and amd64, a
bus_size_t may be 32 or 64 bits. Change the bounce_zone alignment field
to explicitly be 32 bits, as I can't really imagine a DMA device that
needs anything close to 2GB alignment of data.
mdf [Wed, 12 Jan 2011 17:52:48 +0000 (17:52 +0000)]
Add type checking for static and dynamic sysctls using scalar types.
The code is turned off until the tree is fixed up so it compiles.
__FreeBSD_version was already bumped once today, so skip the bump, but
add an entry to UPDATING.
Note that __DESCR() is used in the SYSCTL_OID() macro and so is not
needed in macros that invoke it. This use was inconsistent in the
file and I have made it consistent any lines already being changed.
nwhitehorn [Wed, 12 Jan 2011 14:55:02 +0000 (14:55 +0000)]
Update dialog to version 20100428. This changes the license under which
dialog is distributed from GPLv2 to LGPLv2 and introduces a number of new
features and a new and better libdialog API. The existing libdialog will
be kept temporarily as libodialog for compatibility purposes until sade,
sysinstall and tzsetup have been either updated or replaced.
__FreeBSD_version is now 900030.
Discussed on: -current
Approved by: core
Obtained from: http://invisible-island.net/dialog
pjd [Wed, 12 Jan 2011 14:38:17 +0000 (14:38 +0000)]
Add a note that when custom signal handler is installed for a signal,
signal action is restored to default in child after fork(2).
In this case there is no need to do anything with dummy SIGCHLD handler,
because after fork(2) it will be automatically reverted to SIG_IGN.
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
MFC after: 3 days
pjd [Wed, 12 Jan 2011 14:35:29 +0000 (14:35 +0000)]
Install default signal handlers before masking signals we want to handle.
It is possible that the parent process ignores some of them and sigtimedwait()
will never see them, eventhough they are masked.
The most common situation for this to happen is boot process where init(8)
ignores SIGHUP before starting to execute /etc/rc. This in turn caused
hastd(8) to ignore SIGHUP.
Reported by: trasz
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
MFC after: 3 days
jchandra [Wed, 12 Jan 2011 13:16:35 +0000 (13:16 +0000)]
The message ring interrupt needs to be enabled for all cpus, not just
the ones which run the message ring handler.
Some bits of the interrupt mask are part of the status register which is
saved with the process context, and these bits are initialized from the
cpu on which the process is created. This means that all the processes
should have the same value for these interrupt mask bits, so that the
interrupt mask remains the same regardless of what thread is scheduled
on the cpu.
Submitted by: Sriram Gorti (srgorti at netlogicmicro dot com)
yongari [Wed, 12 Jan 2011 03:43:47 +0000 (03:43 +0000)]
For re(4) controllers that uses new jumbo frame scheme(RTL8168C/D/E),
limit maximum RX buffer size to RE_RX_DESC_BUFLEN instead of
blindly configuring it to 16KB. Due to lack of documentation, re(4)
didn't allow jumbo frame on these controllers. However it seems
controller is confused with jumbo frame such that it can DMA the
received frame to wrong address instead of splitting it into
multiple RX buffers. Of course, this caused panic.
Since re(4) does not support jumbo frames on these controllers,
make controller drop frame that is longer than RE_RX_DESC_BUFLEN
sized frame. Fortunately RTL810x controllers, which do not support
jumbo frame, have no such issues but this change also limited
maximum RX buffer size allowed to RTL810x controllers. Allowing
16KB RX buffer for controllers that have no such capability is
meaningless.
jfv [Wed, 12 Jan 2011 00:23:47 +0000 (00:23 +0000)]
A couple problems discovered by Andrew Boyer:
- failure code in em_xmit got mangled along the way
and was not properly handling errors.
- local timer code had a leftover UNLOCK call that
should be removed.
jhb [Tue, 11 Jan 2011 22:15:30 +0000 (22:15 +0000)]
- Retire some unused ithread priorities: PI_TTYHIGH, PI_TAPE, and
PI_DISKLOW. While here, rename PI_TTYLOW to PI_TTY.
- Add a macro PI_SWI() that takes a SWI_* constant as an argument and
returns the suitable thread priority.
andreast [Tue, 11 Jan 2011 21:18:29 +0000 (21:18 +0000)]
Add new functions, fcu_fan_set_pwm and fcu_fan_get_pwm, to set and get
the pwm values. We can now set the fan's speed of a PWM controlled fan
with % numbers between 30 and 100 % instead of trying to model a
% number based on rpm.
The fcu chip offers both, the dutycycle and the rpm value of the PWM
controlled fans. I added the rpm value to the list of information
available via sysctl(8).
Tested by: Paul Mather <paul at gromit dlib vt edu>
gavin [Tue, 11 Jan 2011 13:33:42 +0000 (13:33 +0000)]
Remove a bullet point that appears to have been accidentally inserted twice.
It has also been included within the feature lists to which it is relevant.
yongari [Mon, 10 Jan 2011 23:47:11 +0000 (23:47 +0000)]
When driver is not running, do not send DUMP command to controller
and just show old (cached) values. Controller will not respond to
the command unless MAC is enabled so DUMP request for down
interface caused request timeout.
yongari [Mon, 10 Jan 2011 23:28:46 +0000 (23:28 +0000)]
Implement TSO on RealTek RTL8168/8111 C or later controllers.
RealTek changed TX descriptor format for later controllers so these
controllers require MSS configuration in different location of TX
descriptor. TSO is enabled by default for controllers that use new
descriptor format.
For old controllers, TSO is still disabled by default due to broken
frames under certain conditions but users can enable it.
Special thanks to Hayes Wang at RealTek.
mav [Mon, 10 Jan 2011 22:27:52 +0000 (22:27 +0000)]
Add IDs for HighPoint RocketRAID 64x controllers.
These controllers consist of two Marvell 88SE9128 6Gbps SATA chips and
PLX PCIe bridge. As result, they seem to be agree to work with ahci(4)
as usual HBAs. The only noticed issue is that RAID BIOS disables all
drive caches during boot, though `camcontrol cmd ...` is able to fix that.
Those who wants RAID functionality can still use closed proprietary driver
from HighPoint site.
rmacklem [Mon, 10 Jan 2011 21:35:10 +0000 (21:35 +0000)]
Fix a bug in the client side krpc where it was, sometimes
erroneously, assumed that 4 bytes of data were in the first
mbuf of a list by replacing the bcopy() with m_copydata().
Also, replace the uses of m_pullup(), which can fail for
reasons other than not enough data, with m_copydata().
For the cases where it isn't known that there is enough
data in the mbuf list, check first via m_len and m_length().
This is believed to fix a problem reported by dpd at dpdtech.com
and george+freebsd at m5p.com.
jhb [Mon, 10 Jan 2011 20:59:19 +0000 (20:59 +0000)]
Add a nested include of <sys/linker_set.h> to make the sysctl(9) manpage
accurate. <sys/linker_set.h> is one of the very few headers similar to
<sys/queue.h> for which nested includes is allowed.
jkim [Mon, 10 Jan 2011 20:56:59 +0000 (20:56 +0000)]
Allow AcpiOsInstallInterruptHandler() and AcpiOsRemoveInterruptHandler() to
install or remove non-SCI interrupt handlers per ACPI Component Architecture
User Guide and Programmer Reference. ACPICA may install such interrupt
handler when a GPE block device is found, for example. Add a wrapper for
ACPI_OSD_HANDLER, convert its return values to ours, and make it a filter.
Prefer KASSERT(9) over panic(9) as we have never seen those in reality.
Clean up some style(9) nits and add my copyright.
yongari [Mon, 10 Jan 2011 17:45:09 +0000 (17:45 +0000)]
Apply DMA address space restriction to controllers that have 4GB
DMA boundary bug and runs with PCI-X mode. watchdog timeout was
observed on BCM5704 which lives behind certain PCI-X bridge(e.g.
AMD 8131 PCI-X bridge). It's still not clear whether the root
cause came from that PCI-X bridge or not. The watchdog timeout
indicates the issue is in TX path. If the bridge reorders TX
mailbox write accesses it would generate all kinds of problems but
I'm not sure. This should be revisited.
Tested by: Michael L. Squires (mikes <> siralan dot org)
yongari [Mon, 10 Jan 2011 17:37:49 +0000 (17:37 +0000)]
Backout r216973 and r216970. r216973 didn't solve watchdog timeout
issue seen on PCIX BCM5704 controller. r216970 fixed the issue but
the DMA address space restriction was applied to all bge(4)
controllers such that it caused unnecessary performance degradation
for controllers that have no such issues.
kib [Mon, 10 Jan 2011 16:10:25 +0000 (16:10 +0000)]
For the process that already loaded libthr but still not initialized
threading, fall back to libc method of performing
__pthread_map_stacks_exec() job.
Reported and tested by: Mykola Dzham <i levsha me>
kib [Mon, 10 Jan 2011 16:09:35 +0000 (16:09 +0000)]
get_program_var_addr() must prefer the strong symbol to the weak
one. Search global objects, together with main object and
dependencies, for the requested symbol.
Move the common code from symlook_default() into new helper
symlook_global(), and use it both in symlook_global() and
get_program_var_addr().
Supply lock state to get_program_var_addr().
Reviewed by: kan
Tested by: Mykola Dzham <i levsha me>
jmallett [Mon, 10 Jan 2011 06:46:18 +0000 (06:46 +0000)]
o) Free mbufs in error cases.
o) Clear/acknowledge receive interrupt at end of thread. This gives the
management interfaces performance on the order of 100Mbps rather than
the previous level of 10Mbps on my MR-730.
lstewart [Mon, 10 Jan 2011 06:12:01 +0000 (06:12 +0000)]
Reset the last_sack_ack SACK hint for TCP input processing to ensure that the
hint is 0 when no SACK data is received to update the hint with. This was
accidentally omitted from r216753.
jmallett [Mon, 10 Jan 2011 03:48:41 +0000 (03:48 +0000)]
o) Expand the CIU driver to be aware of newly-allocated parts of the IRQ range.
o) Add 'octm', a trivial driver for the 10/100 management ports found on some
Octeon systems.
o) Make the Simple Executive's management port helper routines compile on
FreeBSD (namely by not doing math on void pointers.)
o) Add a cvmx_mgmt_port_sendm routine to the Simple Executive to send an mbuf
so there is only one copy in the transmit path, rather than having to first
copy the mbuf to an intermediate buffer and then copy that to the Simple
Executive's transmit ring.
o) Properly work out MII addresses of management ports on the Lanner MR-730.
XXX The MR-730 also needs some patches to the MII read/write routines, but
this is sufficient for now. Media detection will be fixed in the future
when I can spend more time reading the vendor-supplied patches.
jmallett [Sun, 9 Jan 2011 23:46:24 +0000 (23:46 +0000)]
Now that we correctly enable rx interrupts on all cores, performance has gotten
quite awful, because e.g. 4 packets will come in and get processed on 4
different cores at the same time, really battling with the TCP stack quite
painfully. For now, just run one task at a time.
This gets performance up in most cases to where it was before the correctness
fixes that got interrupts to run on all cores (except in high-load TCP transmit
cases where all we're handling receive for is ACKs) and in some cases it's
better now. What would be ideal would be to use a more advanced interrupt
mitigation strategy and possibly to use different workqueue groups per port for
multi-port systems, and so on, but this is a fine stopgap.
jmallett [Sun, 9 Jan 2011 23:05:46 +0000 (23:05 +0000)]
o) Remove some unused local definitions of IP protocol numbers.
o) Use CPU_FOREACH rather than a miscrafted for loop with an off-by-one to
enable workq interrupts on all cores.
keramida [Sun, 9 Jan 2011 22:05:09 +0000 (22:05 +0000)]
regression/date: unset all LC_xxx vars and set LANG/LC_ALL
When running with a custom locale setup, it's easy to confuse the
date regression tests and cause them to fail, e.g. when LANG='C'
but LC_ALL='el_GR.UTF-8'. Set LC_ALL to 'C', which overrides all
other LC_xxx options, to avoid this sort of problem.
__assert() is called when an assertion fails. After printing an error
message, it will call abort(). abort() never returns, hence it has the
__dead2 attribute. Also add this attribute to __assert().
jilles [Sun, 9 Jan 2011 21:07:30 +0000 (21:07 +0000)]
sh: Remove special %builtin PATH entry.
All builtins are now always found before a PATH search.
Most ash derivatives have an undocumented feature where the presence of an
entry "%builtin" in $PATH will cause builtins to be checked at that point of
the PATH search, rather than before looking at any directories as documented
in the man page (very old versions do document this feature).
I am removing this feature from sh, as it complicates the code, may violate
expectations (for example, /usr/bin/alias is very close to a forkbomb with
PATH=/usr/bin:%builtin, only /usr/bin/builtin not being another link saves
it) and appears to be unused (all the %builtin google code search finds is
in some sort of ash source code).
Note that aliases and functions took and take precedence above builtins.
Because aliases work on a lexical level they can only ever be overridden on
a lexical level (quoting or preceding 'builtin' or 'command'). Allowing
override of functions via PATH does not really fit in the model of sh and it
would work differently from %builtin if implemented.
Note: POSIX says special builtins are found before functions. We comply to
this because we do not allow functions with the same name as a special
builtin.
Silence from: freebsd-hackers@ (message sent 20101225)
Discussed with: dougb
gavin [Sun, 9 Jan 2011 17:40:04 +0000 (17:40 +0000)]
Add support for the Zeagle N2iTion3 Dive Computer to uplcom(4). This brings
the list of supported devices in sync with kernel.org git revision f36ecd5de93e4c85a9e3d25100c6e233155b12e5, and OpenBSD uplcom.c r1.54
gavin [Sun, 9 Jan 2011 17:10:06 +0000 (17:10 +0000)]
Sync the list of devices supported by uslcom(4) with Linux, bringing in
all new devices added between our r211022 and their git revision 93ad03d60b5b18897030038234aa2ebae8234748
kib [Sun, 9 Jan 2011 12:50:44 +0000 (12:50 +0000)]
Move repeated MAXSLP definition from machine/vmparam.h to sys/vmmeter.h.
Update the outdated comments describing MAXSLP and the process
selection algorithm for swap out.
kib [Sun, 9 Jan 2011 12:38:40 +0000 (12:38 +0000)]
Implement the __pthread_map_stacks_exec() for libthr.
Stack creation code is changed to call _rtld_get_stack_prot() to get
the stack protection right. There is a race where thread is created
during dlopen() of dso that requires executable stacks. Then,
_rtld_get_stack_prot() may return PROT_READ | PROT_WRITE, but thread
is still not linked into the thread list. In this case, the callback
misses the thread stack, and rechecks the required protection
afterward.
das [Sun, 9 Jan 2011 06:05:48 +0000 (06:05 +0000)]
Fix the value for DECIMAL_DIG on UltraSparcs. The previous value of
35 wasn't quite big enough to ensure correct rounding for very-close-
to-halfway cases.
rmacklem [Sun, 9 Jan 2011 02:10:54 +0000 (02:10 +0000)]
Modify readdirplus in the experimental NFS server in a
manner analogous to r216633 for the regular server. This
change busies the file system so that VFS_VGET() is
guaranteed to be using the correct mount point even
during a forced dismount attempt. Since nfsd_fhtovp() is
not called immediately before readdirplus, the patch is
actually a clone of pjd@'s nfs_serv.c.4.patch instead of
the one committed in r216633.
csjp [Sat, 8 Jan 2011 23:06:54 +0000 (23:06 +0000)]
Change some variables from int to size_t. This is more accurate since
these variables represent sizes in one capacity or another. There is
no reason to allow negative numbers. Change userspace shared structure
elements that get used for the modified functions from int to uint32_t,
since it's not clear what userspace programs use these fields, and we
do not want to break binary compatibility. This fixes a panic when
corrupt or bogus data is passed into the kernel.