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.
ken [Fri, 18 Feb 2011 17:06:06 +0000 (17:06 +0000)]
Fix several issues with the mps(4) driver.
When the driver ran out of DMA chaining buffers, it kept the timeout for
the I/O, and I/O would stall.
The driver was not freezing the device queue on errors.
mps.c: Pull command completion logic into a separate
function, and call the callback/wakeup for commands
that are never sent due to lack of chain buffers.
Add a number of extra diagnostic sysctl variables.
Handle pre-hardware errors for configuration I/O.
This doesn't panic the system, but it will fail the
configuration I/O and there is no retry mechanism.
So the device probe will not succeed. This should
be a very uncommon situation, however.
mps_sas.c: Freeze the SIM queue when we run out of chain
buffers, and unfreeze it when more commands
complete.
Freeze the device queue when errors occur, so that
CAM can insure proper command ordering.
Report pre-hardware errors for task management
commands. In general, that shouldn't be possible
because task management commands don't have S/G
lists, and that is currently the only error path
before we get to the hardware.
Handle pre-hardware errors (like out of chain
elements) for SMP requests. That shouldn't happen
either, since we should have enough space for two
S/G elements in the standard request.
For commands that end with
MPI2_IOCSTATUS_SCSI_IOC_TERMINATED and
MPI2_IOCSTATUS_SCSI_EXT_TERMINATED, return them
with CAM_REQUEUE_REQ to retry them unconditionally.
These seem to be related to back end, transport
related problems that are hopefully transient. We
don't want to go through the retry count for
something that is not a permanent error.
Keep track of the number of outstanding I/Os.
mpsvar.h: Track the number of free chain elements.
Add variables for the number of outstanding I/Os,
and I/O high water mark.
Add variables to track the number of free chain
buffers and the chain low water mark, as well as
the number of chain allocation failures.
ken [Fri, 18 Feb 2011 17:01:57 +0000 (17:01 +0000)]
In the MPS driver, during device removal processing, don't assume that
the controller firmware will return all of our commands. Instead, keep
track of outstanding I/Os and return them to CAM once device removal
processing completes.
mpsvar.h: Declare the new "io_list" in the mps_softc.
mps.c: Initialize the new "io_list" in the mps softc.
mps_sas.c: o Track SCSI I/O requests on the io_list from the
time of mpssas_action() through mpssas_scsiio_complete().
o Zero out the request structures used for device
removal commands prior to filling them out.
o Once the target reset task management function completes
during device removal processing, assume any SCSI I/O
commands that are still oustanding will never return
from the controller, and process them manually.
nwhitehorn [Fri, 18 Feb 2011 14:54:34 +0000 (14:54 +0000)]
Import bsdinstall. This is meant to be (eventually in conjunction with
pc-sysinstall) a replacement for sysinstall in the 9.0 release and beyond.
Currently supported platforms are sparc64, pc98, i386, amd64, powerpc, and
powerpc64. Integration into the build system will occur in the coming
weeks.
Merging with pc-sysinstall will use this code as a frontend, while
temporarily retaining the interactive partition editor here. This work
will be done in parallel with improvements on this code and release
integration.
Thanks to all who have provided testing and comments!
vanhu [Fri, 18 Feb 2011 09:40:13 +0000 (09:40 +0000)]
Fixed IPsec's HMAC_SHA256-512 support to be RFC4868 compliant.
This will break interoperability with all older versions of
FreeBSD for those algorithms.
hselasky [Fri, 18 Feb 2011 07:37:30 +0000 (07:37 +0000)]
- Make an enum for all the umidi USB transfers.
- Use the USB stack's builtin clear-stall feature.
- Wrap some long lines.
- Use memcpy() instead of bcopy().
- Use memset() instead of bzero().
- Tested applications:
/usr/ports/audio/fluidsynth
yongari [Fri, 18 Feb 2011 03:37:53 +0000 (03:37 +0000)]
Remove use case of DC_TX_ONE. It was used to limit queue just 1 TX
frame in DM910x controllers. In r67595(more than 10 years ago) it
was replaced to use "Store and Forward" mode and made controller
generate TX completion interrupt for every frame.
yongari [Fri, 18 Feb 2011 02:58:09 +0000 (02:58 +0000)]
Apply special PHY initialization code for 21143 controllers before
any other media configuration. Otherwise some 21143 controller
cannot establish a link. While I'm here remove the PHY
initialization code in dc_setcfg(). Since dc_setcfg() is called
whenever link state is changed, having the PHY initialization code
in dc_setcfg() resulted in continuous link flips.
After driver resets SIA, use default SIA transmit/receive
configuration instead of disabling autosense/autonegotiation.
Otherwise, controller fails to establish a link as well as losing
auto-negotiation capability. For manual media configuration, always
configure 21143 controller with specified media to ensure media
change. This change makes ANA-6922 establish link with/without
auto-negotiation.
While I'm here be more strict on link UP/DOWN detection logic.
Many thanks to marius who fixed several bugs in initial patch and
even tested the patch on a couple of dc(4) controllers.
PR: kern/79262
Reviewed by: marius
Tested by: marius
yongari [Fri, 18 Feb 2011 02:14:53 +0000 (02:14 +0000)]
When driver have to use base softc due to lack of SROM on second
port, copy SROM information from base softc as well and run SROM
parser again. This change is necessary for some dual port
controllers to make dc(4) correctly detect PHY media based on first
port configuration table.
While I'm here add a check for validity of the base softc before
duplicating SROM contents from base softc. If driver failed to
attach to the first port it can access invalid area.
jhb [Thu, 17 Feb 2011 17:03:56 +0000 (17:03 +0000)]
Save a copy of errno before invoking syslog() if accept() or select() fail.
syslog() can trash the errno value causing nfsd to exit for non-fatal
errors like ECONNABORTED from accept().
jpaetzel [Thu, 17 Feb 2011 16:33:41 +0000 (16:33 +0000)]
Add "Extract Only" functionality to pc-sysinstall. This allows disk setup to
be done manually, pc-sysinstall is pointed to a mount-point for installation.
osa [Thu, 17 Feb 2011 12:21:14 +0000 (12:21 +0000)]
Fix the beginning day of the Great Lent, it starts on Monday for 7 weeks before Paskha.
Fix the Exaltation of the Holy Cross day.
Add more Twelve holidays (dvunadesyatye prazdniki).
adrian [Thu, 17 Feb 2011 05:56:03 +0000 (05:56 +0000)]
Add in ANI parameters for the AR9280. These aren't enabled by default
as they're likely not entirely correct, but they give people something
to toy with to compare behaviour/performance.
Disable the anti-noise part, as this apparently interferes with
RIFS. I haven't verified this.
VNET socket push back:
try to minimize the number of places where we have to switch vnets
and narrow down the time we stay switched. Add assertions to the
socket code to catch possibly unset vnets as seen in r204147.
While this reduces the number of vnet recursion in some places like
NFS, POSIX local sockets and some netgraph, .. recursions are
impossible to fix.
The current expectations are documented at the beginning of
uipc_socket.c along with the other information there.
Sponsored by: The FreeBSD Foundation
Sponsored by: CK Software GmbH
Reviewed by: jhb
Tested by: zec
dim [Wed, 16 Feb 2011 20:46:57 +0000 (20:46 +0000)]
Fix the last binary in the base system that still has an executable
stack, /usr/sbin/uathload.
Since this program links in a .o file containing a firmware blob, and
there is no clean way to add a .note.GNU-stack section to this .o file,
we simply use the -z noexecstack option to ld here.
adrian [Wed, 16 Feb 2011 20:07:44 +0000 (20:07 +0000)]
Modify the spi flash driver to allow smaller read IO sizes, but enforce
the larger, aligned write+erase sizes the driver currently implements.
This preserves write behaviour but makes the flash driver usable for things
like a read-only FFS or a geom_uzip/geom_compress .
Note that since GEOM will now return the sector size as being smaller,
writes of sector size/alignment will now fail with an EIO. Code which
writes to the flash device will have to be (for now) manually taught
about the flash write blocksize.
imp [Wed, 16 Feb 2011 18:05:10 +0000 (18:05 +0000)]
Remove reading of symbols from a.out loaded files. Since we are tight
on space for clang and a.out support is only needed for /boot/loader,
they are excess bytes that serve no useful purpose other than to
support really old kernels (FreeBSD < 3.2 or so). Prefer clang
support over support for these old kernels and remove this code. We
gain about 100 bytes of space this way.
dchagin [Wed, 16 Feb 2011 17:50:21 +0000 (17:50 +0000)]
To avoid excessive code duplication create wrapper for fill regs
from stack frame. Change the trap() code to use newly created function
instead of explicit regs assignment.
dim [Tue, 15 Feb 2011 22:03:09 +0000 (22:03 +0000)]
Fix some leftover binaries and shared libraries in the system that still
have an executable stack, due to linking in hand-assembled .S or .s
files, that have no .GNU-stack sections:
dchagin [Tue, 15 Feb 2011 21:42:48 +0000 (21:42 +0000)]
Make a linux_rt_sigtimedwait() system call is actually working.
1) Translate the native signal number in the appropriate Linux signal.
2) Remove bogus code, which can lead to a panic as it calls
kern_sigtimedwait with same ksiginfo.
3) Return the corresponding signal number.
dim [Tue, 15 Feb 2011 20:18:52 +0000 (20:18 +0000)]
Apply a few small optimizations to boot2's code, to make it shrink a
little further. This gets us further on the way to be able to build it
successfully with clang. Using in-tree gcc, this shrinks boot2.bin with
60 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 bytes.
yongari [Tue, 15 Feb 2011 18:16:04 +0000 (18:16 +0000)]
Fix a regression introduced in r215906. The change made in r215906
caused link re-negotiation whenever application joins or leaves a
multicast group. If driver is running, it would have established a
link so there is no need to start re-negotiation. The re-negotiation
broke established link which in turn stopped multicast application
working while re-negotiation is in progress.
kib [Tue, 15 Feb 2011 09:03:58 +0000 (09:03 +0000)]
Since r218070 reenabled the call to vm_map_simplify_entry() from
vm_map_insert(), the kmem_back() assumption about newly inserted
entry might be broken due to interference of two factors. In the low
memory condition, when vm_page_alloc() returns NULL, supplied map is
unlocked. If another thread performs kmem_malloc() meantime, and its
map entry is placed right next to our thread map entry in the map,
both entries wire count is still 0 and entries are coalesced due to
vm_map_simplify_entry().
Mark new entry with MAP_ENTRY_IN_TRANSITION to prevent coalesce.
Fix some style issues, tighten the assertions to account for
MAP_ENTRY_IN_TRANSITION state.
marius [Mon, 14 Feb 2011 21:50:51 +0000 (21:50 +0000)]
- Use the correct DMA tag/map pair for synchronize the FC scratch area.
- Allocate coherent DMA memory for the request/response queue area and
and the FC scratch area.
These changes allow isp(4) to work properly on sparc64 with usage of the
IOMMU streaming buffers enabled.
adrian [Mon, 14 Feb 2011 21:24:54 +0000 (21:24 +0000)]
Some statistics additions - prepare for error codes > 32 (since the AR5416
error mask is > 5 bits) and add some extra CRC/HT40/ShortGI counters to
help debug 802.11n issues.
hselasky [Mon, 14 Feb 2011 08:14:06 +0000 (08:14 +0000)]
* Fix page fault caused by referring freed node.
While updating Tx stats, already freed node could be referred and cause
page fault. To avoid such panic, spool Tx stats in driver's softc. Then,
on every ratectl interval, grab node though ieee80211_iterate_nodes() and
update ratectl stats.
luigi [Mon, 14 Feb 2011 08:09:02 +0000 (08:09 +0000)]
Correct a subtle bug in the 'gsched_rr' disk scheduler.
The algorithm is supposed to work as follows:
in order to prevent starvation, when a new client starts being served we
record the start time and reset the counter of bytes served.
We then switch to a new client after a certain amount of time or bytes,
even if the current one still has pending requests.
To avoid charging a new client the time of the first seek,
we start counting time when the first request is served.
Unfortunately a bug in the previous version of the code failed
to set the start time in certain cases, resulting in some processes
exceeding their timeslice.
The fix (in this patch) is trivial, though it took a while to find
out and replicate the bug.
Thanks to Tommaso Caprai for investigating and fixing the problem.
marcel [Sun, 13 Feb 2011 19:46:55 +0000 (19:46 +0000)]
Use the preload_fetch_addr() and preload_fetch_size() convenience
functions to obtain the address and size of the preloaded pool
configuration file/repository.