freebsd with flexible iflib nic queues
Go to file
Ian Lepore 5ea561e03a Enable hardware flow control and high speed bulk data transfer in at91 uarts.
Changes to make rtc/cts flow control work...

This does not turn on the builtin hardware flow control on the SoC's usart
device, because that doesn't work on uart1 due to a chip erratum (they
forgot to wire up pin PA21 to RTS0 internally).  Instead it uses the
hardware flow control logic where the tty layer calls the driver to assert
and de-assert the flow control lines as needed.  This prevents overruns at
the tty layer (app doesn't read fast enough), but does nothing for overruns
at the driver layer (interrupts not serviced fast enough).

To work around the wiring problem with RTS0, the driver reassigns that pin
as a GPIO and controls it manually.  It only does so if given permission via
hint.uart.1.use_rts0_workaround=1, to prevent accidentally driving the pin
if uart1 is used without flow control (because something not related to
serial IO could be wired to that pin).

In addition to the RTS0 workaround, driver changes were needed in the area
of reading the current set of DCE signals.  A priming read is now done at
attach() time, and the interrupt routine now sets SER_INT_SIGCHG when any
of the DCE signals change.  Without these changes, nothing could ever be
transmitted, because the tty layer thought CTS was de-asserted (when in fact
we had just never read the status register, and the hwsig variable was
init'd to CTS de-asserted).

Changes to support bulk high-speed (230kbps and higher) data reception...

Allow the receive fifo size to be tuned with hint.uart.<dev>.fifo_bytes.
For high speed receive, a fifo size of 1024 works well.  The default is
still 128 bytes if no hint is provided.  Using a value larger than 384
requires a change in dev/uart/uart_core.c to size the intermediate
buffer as MAX(384, 3*sc->sc_rxfifosize).

Recalculate the receive timeout whenever the baud rate changes.  At low
baud rates (19.2kbps and below) the timeout is the number of bits in 2
characters.  At higher speed it's calculated to be 500 microseconds
worth of bits.  The idea is to compromise between being responsive in
interactive situations and not timing out prematurely during a brief
pause in bulk data flow.  The old fixed timeout of 1.5 characters was
just 32 microseconds at 460kbps.

At interrupt time, check for receiver holding register overrun status
and set the corresponding status bit in the return value.

When handling a buffer overrun, get a single buffer emptied and handed
back to the hardware as quickly as possible, then deal with the second
buffer.  This at least minimizes data loss compared to the old logic
that fully processed both buffers before restarting the hardware.

Rewrite the logic for handling buffers after a receive timeout.  The
original author speculated in a comment that there may be a race with
high speed data.  There was, although it was rare.  The code now handles
all three possible scenarios on receive timeout: two empty buffers, one
empty and one partial buffer, or one full and one partial buffer.

Reviewed by:	imp
2013-04-01 00:00:10 +00:00
bin Minor mdoc fix. 2013-03-29 08:12:09 +00:00
cddl Commit a patch that fixes a problem in the #pragma statement when searching 2013-03-28 20:31:03 +00:00
contrib Similar to r239870 and r239872, teach the other binutils tools about the 2013-03-27 19:21:36 +00:00
crypto Revert r247892 now that this has been fixed upstream. 2013-03-23 14:52:31 +00:00
etc rc.subr: disabling globbing while processing devfs rules 2013-03-28 08:13:52 +00:00
games Remove a reference to instant-server which has been removed from the 2013-03-21 12:42:25 +00:00
gnu KGDB: Accept KLD symbol files with the ".symbols" extension. 2013-03-28 17:07:02 +00:00
include Add an implementation of open_memstream() and open_wmemstream(). These 2013-02-27 19:50:46 +00:00
kerberos5 Add -lheimntlm to LDADD directly. 2013-02-11 09:45:24 +00:00
lib Remove EOL whitespace. 2013-03-29 08:32:49 +00:00
libexec Map libraries linked with -Ttext-segment=base_addr at base_addr. 2013-02-27 09:34:09 +00:00
release - Update hardware notes to reflect that amd64 is no longer "young"[1] 2013-03-28 22:52:42 +00:00
rescue WiP merge of libzfs_core (MFV r238590, r238592) 2013-03-05 08:09:53 +00:00
sbin Use errno and strerror to print more descriptive messages when operations 2013-03-26 22:14:47 +00:00
secure Upgrade to OpenSSH 6.2p1. The most important new features are support 2013-03-22 17:55:38 +00:00
share Welcome clang as the default compiler on ARM. 2013-03-28 22:49:49 +00:00
sys Enable hardware flow control and high speed bulk data transfer in at91 uarts. 2013-04-01 00:00:10 +00:00
tools cxgbe(4): Add support for Chelsio's Terminator 5 (aka T5) ASIC. This 2013-03-30 02:26:20 +00:00
usr.bin Update to upstream version 2.7 2013-03-28 20:33:07 +00:00
usr.sbin Add some more stats to keep track of all the reasons that a vcpu is exiting. 2013-03-30 17:46:03 +00:00
COPYRIGHT
LOCKS
MAINTAINERS Update wiht the times. 2013-03-28 02:44:15 +00:00
Makefile When building universe ensure the required worlds are finished before 2013-03-31 02:03:34 +00:00
Makefile.inc1 Fix xdev-install when installing to a location other than / 2013-03-31 08:54:04 +00:00
ObsoleteFiles.inc Add 2 more obsolete files and a missing date. 2013-03-24 12:39:26 +00:00
README Vendor import of OpenSSH 6.2p1. 2013-03-22 11:19:48 +00:00
UPDATING Merge r247814 from x86 modulo whitespace bug: 2013-03-08 13:11:45 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The ``world''
target should only be used in cases where the source tree has not
changed from the currently running version.  See:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The ``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html