freebsd with flexible iflib nic queues
Go to file
Adrian Chadd c5239edb98 Implement frame (data) transmission using if_transmit(), rather than
if_start().

This removes the overlapping data path TX from occuring, which
solves quite a number of the potential TX queue races in ath(4).
It doesn't fix the net80211 layer TX queue races and it doesn't
fix the raw TX path yet, but it's an important step towards this.

This hasn't dropped the TX performance in my testing; primarily
because now the TX path can quickly queue frames and continue
along processing.

This involves a few rather deep changes:

* Use the ath_buf as a queue placeholder for now, as we need to be
  able to support queuing a list of mbufs (ie, when transmitting
  fragments) and m_nextpkt can't be used here (because it's what is
  joining the fragments together)

* if_transmit() now simply allocates the ath_buf and queues it to
  a driver TX staging queue.

* TX is now moved into a taskqueue function.

* The TX taskqueue function now dequeues and transmits frames.

* Fragments are handled correctly here - as the current API passes
  the fragment list as one mbuf list (joined with m_nextpkt) through
  to the driver if_transmit().

* For the couple of places where ath_start() may be called (mostly
  from net80211 when starting the VAP up again), just reimplement
  it using the new enqueue and taskqueue methods.

What I don't like (about this work and the TX code in general):

* I'm using the same lock for the staging TX queue management and the
  actual TX.  This isn't required; I'm just being slack.

* I haven't yet moved TX to a separate taskqueue (but the taskqueue is
  created); it's easy enough to do this later if necessary.  I just need
  to make sure it's a higher priority queue, so TX has the same
  behaviour as it used to (where it would preempt existing RX..)

* I need to re-review the TX path a little more and make sure that
  ieee80211_node_*() functions aren't called within the TX lock.
  When queueing, I should just push failed frames into a queue and
  when I'm wrapping up the TX code, unlock the TX lock and
  call ieee80211_node_free() on each.

* It would be nice if I could hold the TX lock for the entire
  TX and TX completion, rather than this release/re-acquire behaviour.
  But that requires that I shuffle around the TX completion code
  to handle actual ath_buf free and net80211 callback/free outside
  of the TX lock.  That's one of my next projects.

* the ic_raw_xmit() path doesn't use this yet - so it still has
  sequencing problems with parallel, overlapping calls to the
  data path.  I'll fix this later.

Tested:

* Hostap - AR9280, AR9220
* STA - AR5212, AR9280, AR5416
2013-01-15 18:01:23 +00:00
bin sh: Simplify cd-hash interaction. 2013-01-14 16:40:50 +00:00
cddl The current ZFS code expects ddt_zap_count to always succeed by asserting 2013-01-10 19:26:56 +00:00
contrib Switch the default CPU to an arm9. This removes compiler support for the 2013-01-14 08:39:48 +00:00
crypto Indicate that we are using OpenSSL with some local modifications. 2013-01-02 21:00:00 +00:00
etc Add an option DB_FROM_SRC to use src/etc's user/group databases when 2013-01-15 00:12:34 +00:00
games Use Bernard Baruch's full name. 2012-12-05 13:57:00 +00:00
gnu Set the correct relocation type for R_ARM_TARGET2 to R_ARM_GOT_PREL. The 2013-01-06 07:14:04 +00:00
include Add CLOCK_PROCESS_CPUTIME_ID to <time.h>, to synchronize the CLOCK_* 2013-01-14 18:01:19 +00:00
kerberos5 Add support for bmake. This includes: 2012-10-06 20:01:05 +00:00
lib - Use standard RETURN VALUES section. 2013-01-15 14:09:08 +00:00
libexec Use correct size in snprintf. 2012-12-25 17:06:05 +00:00
release Add now missing color.4th. 2013-01-12 23:44:13 +00:00
rescue Disconnect non-MPSAFE SMBFS from the build in preparation for dropping 2012-10-18 12:04:56 +00:00
sbin Allow to insert new component to geom_raid3 without specifying number. 2013-01-15 10:06:35 +00:00
secure Fix typo; s/ouput/output 2012-11-07 07:00:59 +00:00
share Add gjb as my co-mentor now that I have a full doc/www bit. 2013-01-15 17:17:54 +00:00
sys Implement frame (data) transmission using if_transmit(), rather than 2013-01-15 18:01:23 +00:00
tools Remember the . in .\" in the WITH_NMTREE file and regenerate the output. 2013-01-14 20:38:32 +00:00
usr.bin Add myself as a port committer (with eadler@ and bdrewery@ as mentors). 2013-01-15 05:33:40 +00:00
usr.sbin Don't use f_show_msg() unless printf(1) syntax is required (this reduces the 2013-01-14 21:03:34 +00:00
COPYRIGHT Happy New Year 2013! 2012-12-31 11:22:55 +00:00
LOCKS Test commit to make sure commit mail works after moving the server. 2012-12-29 16:03:23 +00:00
MAINTAINERS Fix typo ('a' and 'o' are not the same letter apparently) 2012-10-22 14:48:14 +00:00
Makefile Add the buildLINT convenience target, handy for build automation. 2012-11-03 20:43:12 +00:00
Makefile.inc1 Add an option DB_FROM_SRC to use src/etc's user/group databases when 2013-01-15 00:12:34 +00:00
ObsoleteFiles.inc The new sade(8) is installed and works on all architectures, courtesy of 2013-01-12 16:23:16 +00:00
README Add the cddl/ directory. 2010-11-14 11:32:56 +00:00
UPDATING UPDATING: add a note about the clang+zfs+i386 stack overflow issue 2012-12-23 13:04:04 +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