jhb [Wed, 13 Oct 2010 13:17:38 +0000 (13:17 +0000)]
Suggest that DEBUG_FLAGS be used to enable extra debugging rather than
frobbing CFLAGS directly. DEBUG_FLAGS is something that can be specified
on the make command line without having to edit the Makefile directly.
jmallett [Wed, 13 Oct 2010 09:17:44 +0000 (09:17 +0000)]
o) Make it possible to attach a PHY directly to an octe device rather than
using miibus, since for some devices that use multiple addresses on the bus,
going through miibus may be unclear, and for devices that are not standard
MII PHYs, miibus may throw a fit, necessitating complicated interfaces to
fake the interface that it expects during probe/attach.
o) Make the mv88e61xx SMI interface in octe attach a PHY directly and fix some
mistakes in the code that resulted from trying too hard to present a nice
interface to miibus.
o) Add a PHY driver for the mv88e61xx. If attached (it is optional in kernel
compiles so the default behavior of having a dumb switch is preserved) it
will place the switch in a VLAN-tagging mode such that each physical port
has a VLAN associated with it and interfaces for the VLANs can be created to
address or bridge between them.
XXX It would be nice for this to be part of a single module including the
SMI interface, and for it to fit into a generic switch configuration
framework and for it to use DSA rather than VLANs, but this is a start
and gives some sense of the parameters of such frameworks that are not
currently present in FreeBSD. In lieu of a switch configuration
interface, per-port media status and VLAN settings are in a sysctl tree.
XXX There may be some minor nits remaining in the handling of broadcast,
multicast and unknown destination traffic. It would also be nice to go
through and replace the few remaining magic numbers with macros at some
point in the future.
XXX This has only been tested with the MV88E6161, but it should work with
minimal or no modification on related switches, so support for probing
them was included.
Thanks to Pat Saavedra of TELoIP and Rafal Jaworowski of Semihalf for their
assistance in understanding the switch chipset.
rmacklem [Wed, 13 Oct 2010 00:57:14 +0000 (00:57 +0000)]
Fix the krpc so that it can handle NFSv3,UDP mounts with a read/write
data size greater than 8192. Since soreserve(so, 256*1024, 256*1024)
would always fail for the default value of sb_max, modify clnt_dg.c
so that it uses the calculated values and checks for an error return
from soreserve(). Also, add a check for error return from soreserve()
to clnt_vc.c and change __rpc_get_t_size() to use sb_max_adj instead of
the bogus maxsize == 256*1024.
jkim [Wed, 13 Oct 2010 00:21:53 +0000 (00:21 +0000)]
Use AcpiReset() from ACPICA instead of rolling our own, which is actually
incomplete. If FADT says the register is available, enable the capability
by default. Remove the previous default value from acpi(4).
yongari [Tue, 12 Oct 2010 19:22:03 +0000 (19:22 +0000)]
Fix a regression introduced in r213495. r213495 disabled mini
receive producer ring only for BCM5700. It was believed that
BCM5700 with external SSRAM is the only controller that supports
mini ring but it seems all BCM570[0-4] requires to disable mini
receive producer ring. Otherwise, it caused unexpected RX DMA
error or watchdog timeouts.
Reported by: marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>
Tested by: marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>
avg [Tue, 12 Oct 2010 17:53:01 +0000 (17:53 +0000)]
acpi_ec: changes in communication with hardware
Short description of the changes:
- attempt to retry some commands for which it is possible (read, query)
- always make a short sleep before checking EC status in polled mode
- periodically poll EC status in interrupt mode
- change logic for detecting broken interrupt delivery and falling back
to polled mode
- check that EC is ready for input before starting a new command, wait
if necessary
This commit is based on the original patch by David Naylor.
avg [Tue, 12 Oct 2010 17:40:45 +0000 (17:40 +0000)]
generic_stop_cpus: prevent parallel execution
This is based on the same approach as used in panic().
In theory parallel execution of generic_stop_cpus() could lead to two CPUs
stopping each other and everyone else, and thus a total system halt.
Also, in theory, we should have some smarter locking here, because two
(or more CPUs) could be stopping unrelated sets of CPUs.
But in practice, it seems, this function is only used to stop
"all other" CPUs.
Additionally, I took this opportunity to make amd64-specific suspend_cpus()
function use generic_stop_cpus() instead of rolling out essentially
duplicate code.
This code is based on code by Sandvine Incorporated.
avg [Tue, 12 Oct 2010 17:04:21 +0000 (17:04 +0000)]
zfs + sendfile: do not produce partially valid pages for vnode's tail
Since r212650 and before this change sendfile(2) could produce
a partially valid page for a trailing portion of a ZFS vnode.
vm_fault() always wants to see a fully valid page even if it's the last
page that partially extends beyond vnode's end. Otherwise it calls
vop_getpages() to bring in the page. In the case of ZFS this means
that the data is read from the page into the same page and this breaks
checks in ZFS mappedread() - a thread that set VPO_BUSY on the page in
vm_fault() will get blocked forever waiting for it to be cleared.
Many thanks to Kai and Jeremy for reproducing the issue and providing
important debugging information and help.
Reported by: Kai Gallasch <gallasch@free.de>,
Jeremy Chadwick <freebsd@jdc.parodius.com>
Tested by: Kai Gallasch <gallasch@free.de>,
Jeremy Chadwick <freebsd@jdc.parodius.com>
Reviewed by: kib
MFC after: 3 days
To-Do: apply the same treatment to tmpfs + sendfile
bschmidt [Tue, 12 Oct 2010 16:52:13 +0000 (16:52 +0000)]
Fix monitor mode which is implemented by doing a firmware scan. This
is a port of stable/6, seems like the code got lost during the
background scan changes in r170530.
kib [Tue, 12 Oct 2010 09:18:17 +0000 (09:18 +0000)]
Add macro DECLARE_MODULE_TIED to denote a module as requiring the
kernel of exactly the same __FreeBSD_version as the headers module was
compiled against.
Mark our in-tree ABI emulators with DECLARE_MODULE_TIED. The modules
use kernel interfaces that the Release Engineering Team feel are not
stable enough to guarantee they will not change during the life cycle
of a STABLE branch. In particular, the layout of struct sysentvec is
declared to be not part of the STABLE KBI.
rmacklem [Mon, 11 Oct 2010 23:15:18 +0000 (23:15 +0000)]
Try and make the nfsrv_localunlock() function in the experimental
NFSv4 server more readable. Mostly changes to comments, but a
case of >= is changed to >, since == can never happen. Also, I've
added a couple of KASSERT()s and a slight optimization, since
once the "else if" case happens, subsequent locks in the list can't
have any effect. None of these changes fixes any known bug.
yongari [Mon, 11 Oct 2010 23:07:12 +0000 (23:07 +0000)]
The IFF_DRV_RUNNING flag is set at the end of bge_init_locked. But
before setting the flag, interrupt was already enabled such that
interrupt handler could be run before setting IFF_DRV_RUNNING flag.
This can lose initial link state change interrupt which in turn
make bge(4) think that it still does not have valid link. Fix this
race by protecting the taskqueue with a driver lock.
While I'm here move reenabling interrupt code after handling of link
state chage.
yongari [Mon, 11 Oct 2010 22:56:23 +0000 (22:56 +0000)]
Remove one last reference of BGE_MI_MODE register for auto polling.
Previously bge(4) always enabled auto polling for non-BGE_FLAG_TBI
controllers. With this change, auto polling is not used anymore so
polling through mii(4) was introduced.
yongari [Mon, 11 Oct 2010 19:20:53 +0000 (19:20 +0000)]
Do not setup interrupt endpoint for axe(4).
It seems axe(4) controllers support interrupt endpoint such that
enabling interrupt endpoint generates about 1000 interrupts/sec.
Controllers transfer 8 bytes data through interrupt endpoint and
the data include link UP/DOWN state as well as some PHY related
information. Previously axe(4) didn't use the transferred data and
didn't even try to read the data. Because axe(4) counts on mii(4)
to detect link state changes there is no need to use interrupt
endpoint here.
This change fixes generation of unnecessary interrupts which was
seen when interface is brought to UP.
dim [Mon, 11 Oct 2010 17:22:16 +0000 (17:22 +0000)]
Remove more unneeded files and directories from contrib/llvm. This
still allows us to build tblgen and clang, and further reduces the
footprint in the tree.
rpaulo [Mon, 11 Oct 2010 17:18:23 +0000 (17:18 +0000)]
Rework the analysis of the 'r' specifier. It turns out that we can't
make it like xArg because they are different ('x' doesn't accept sign,
but 'r' does).
This fixes some warnings when building DDB with clang.
gnn [Mon, 11 Oct 2010 14:31:24 +0000 (14:31 +0000)]
Add code to print the number and type of the CPU that is present in
the system as well has how many PMCs there are per CPU. In this code
CPU and core are equivalent.
avg [Mon, 11 Oct 2010 09:27:37 +0000 (09:27 +0000)]
cam_get_device, cam_open_device: make behavior simpler and more deterministic
Remove or re-work support for the several features from the past:
- remove incomplete support for trimming slice/partition names
- remove mapping from old device names "sd" and "st"
- remove whitespace trimming
- remove unconditional skipping of leading 'r' in a device name
- skip leading 'n' or 'e' only if the following device name matches
a list of known devices that support no-rewind and eject-on-close
features; currently this is only sa(4)
- reflect the above changes in comments in code and in cam(3)
- remove a note cautioning against use of cam_get_device and
cam_open_device in cam(3)
pjd [Sun, 10 Oct 2010 20:49:33 +0000 (20:49 +0000)]
Provide internal ioflags() function that converts ioflag provided by FreeBSD's
VFS to OpenSolaris-specific ioflag expected by ZFS. Use it for read and write
operations.
kib [Sun, 10 Oct 2010 07:05:47 +0000 (07:05 +0000)]
The r184588 changed the layout of struct export_args, causing an ABI
breakage for old mount(2) syscall, since most struct <filesystem>_args
embed export_args. The mount(2) is supposed to provide ABI
compatibility for pre-nmount mount(8) binaries, so restore ABI to
pre-r184588.
avg [Sat, 9 Oct 2010 08:07:49 +0000 (08:07 +0000)]
panic_cpu variable should be volatile
This is to prevent caching of its value in a register when it is checked
and modified by multiple CPUs in parallel.
Also, move the variable into the scope of the only function that uses it.
kientzle [Sat, 9 Oct 2010 05:31:08 +0000 (05:31 +0000)]
Add -D (deterministic) option to ar.
When set, it forces all timestamps and owners to zero and
modes to 0644. Useful for producing libraries that are
bitwise identical across multiple build runs.
Submitted by: Erik Cederstrand
Reviewed by: Kai Wang
davidxu [Sat, 9 Oct 2010 02:50:23 +0000 (02:50 +0000)]
Create a global thread hash table to speed up thread lookup, use
rwlock to protect the table. In old code, thread lookup is done with
process lock held, to find a thread, kernel has to iterate through
process and thread list, this is quite inefficient.
With this change, test shows in extreme case performance is
dramatically improved.
markm [Fri, 8 Oct 2010 20:17:17 +0000 (20:17 +0000)]
Don't let the "available"/"not available" logs flap quite so badly. In the
case of a multi-interfaced host, sub-second flapping can fill up the logs
too quickly. This fixes that.
yongari [Fri, 8 Oct 2010 17:58:07 +0000 (17:58 +0000)]
Do not blindly UP the interface when interface's MTU is changed. If
driver is not running there is no need to up the interface. While
I'm here hold driver lock before modifying MTU as it is referenced
in RX handler.
pjd [Fri, 8 Oct 2010 15:02:15 +0000 (15:02 +0000)]
We close the event socketpair early in the mainloop to prevent spaming with
error messages, so when we clean up after child process, we have to check if
the event socketpair is still there.
Submitted by: Mikolaj Golub <to.my.trociny@gmail.com>
MFC after: 3 days
marius [Fri, 8 Oct 2010 14:59:45 +0000 (14:59 +0000)]
In the replacement text of the __bswapN_const() macros cast the argument
to the expected type so they work like the corresponding __bswapN_var()
functions and the compiler doesn't complain when arguments of different
width are passed.
emaste [Fri, 8 Oct 2010 01:03:30 +0000 (01:03 +0000)]
In r207768 I silenced a console warning from rum(4). There was legitimate
opposition to the change, since really we need to implement missing
functionality in drivers or the 802.3 layer.
For now, restore a reminder message for a missing rum_update_mcast, but
print it only once.
ken [Thu, 7 Oct 2010 21:56:10 +0000 (21:56 +0000)]
Turn on serialization of task management commands going down to the
controller, but make it optional.
After a problem report from Andrew Boyer, it looks like the LSI
chip may have issues (the watchdog timer fired) if too many aborts
are sent down to the chip at the same time. We know that task
management commands are serialized, and although the manual doesn't
say it, it may be a good idea to just send one at a time.
But, since I'm not certain that this is necessary, add a tunable
and sysctl variable (hw.mps.%d.allow_multiple_tm_cmds) to control
the driver's behavior.
mps.c: Add support for the sysctl and tunable, and add a
comment about the possible return values to
mps_map_command().
mps_sas.c: Run all task management commands through two new
routines, mpssas_issue_tm_request() and
mpssas_complete_tm_request().
This allows us to optionally serialize task
management commands. Also, change things so that
the response to a task management command always
comes back through the callback. (Before it could
come via the callback or the return value.)
mpsvar.h: Add softc variables for the list of active task
management commands, the number of active commands,
and whether we should allow multiple active task
management commands. Add an active command flag.
mps.4: Describe the new sysctl/loader tunable variable.