freebsd with flexible iflib nic queues
Go to file
Adrian Chadd 8cc724d9be Fix the busdma logic to work with EDMA chipsets when using bounce
buffers (ie, >4GB on amd64.)

The underlying problem was that PREREAD doesn't sync the mbuf
with the DMA memory (ie, bounce buffer), so the bounce buffer may
have had stale information.  Thus it was always considering the
buffer completed and things just went off the rails.

This change does the following:

* Make ath_rx_pkt() always consume the mbuf somehow; it no longer
  passes error mbufs (eg CRC errors, crypt errors, etc) back up
  to the RX path to recycle.  This means that a new mbuf is always
  allocated each time, but it's cleaner.

* Push the RX buffer map/unmap to occur in the RX path, not
  ath_rx_pkt().  Thus, ath_rx_pkt() now assumes (a) it has to consume
  the mbuf somehow, and (b) that it's already been unmapped and
  synced.

* For the legacy path, the descriptor isn't mapped, it comes out of
  coherent, DMA memory anyway.  So leave it there.

* For the EDMA path, the RX descriptor has to be cleared before
  its passed to the hardware, so that when we check with
  a POSTREAD sync, we actually get either a blank (not finished)
  or a filled out descriptor (finished.)  Otherwise we get stale
  data in the DMA memory.

* .. so, for EDMA RX path, we need PREREAD|PREWRITE to sync the
  data -> DMA memory, then POSTREAD|POSTWRITE to finish syncing
  the DMA memory -> data.

* Whilst we're here, make sure that in EDMA buffer setup (ie,
  bzero'ing the descriptor part) is done before the mbuf is
  map/synched.

NOTE: there's been a lot of commits besides this one with regards to
tidying up the busdma handling in ath(4).  Please check the recent
commit history.

Discussed with and thanks to:	scottl

Tested:

* AR5416 (non-EDMA) on i386, with the DMA tag for the driver
  set to 2^^30, not 2^^32, STA

* AR9580 (EDMA) on i386, as above, STA

* User - tested AR9380 on amd64 with 32GB RAM.

PR:		kern/177530
2013-04-04 08:21:56 +00:00
bin IFP4 change 222074. 2013-04-03 19:19:45 +00:00
cddl Follow up to r247960 and rr247960 by also amending ctfmerge. For the 2013-04-01 21:16:32 +00:00
contrib Update to bmake-20130330 2013-04-02 21:31:11 +00:00
crypto Merge upstream patch to silence spurious "no such identity file" warnings. 2013-04-02 11:44:55 +00:00
etc Format per etc/mtree/README 2013-04-01 17:15:04 +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 Replace access to /dev/random with the kernel pseudo-random number 2013-04-02 23:41:20 +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 Remove all legacy ATA code parts, not used since options ATA_CAM enabled in 2013-04-04 07:12:24 +00:00
sbin Remove all legacy ATA code parts, not used since options ATA_CAM enabled in 2013-04-04 07:12:24 +00:00
secure Upgrade to OpenSSH 6.2p1. The most important new features are support 2013-03-22 17:55:38 +00:00
share Remove all legacy ATA code parts, not used since options ATA_CAM enabled in 2013-04-04 07:12:24 +00:00
sys Fix the busdma logic to work with EDMA chipsets when using bounce 2013-04-04 08:21:56 +00:00
tools wordexp(): Remove wrong IFS usage. 2013-04-01 20:50:07 +00:00
usr.bin Update to bmake-20130330 2013-04-02 21:31:11 +00:00
usr.sbin Fix dates in manual pages modified in 249009. 2013-04-02 09:44:59 +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 Update wiht the times. 2013-03-28 02:44:15 +00:00
Makefile Import bmake-20130330 2013-04-01 21:12:55 +00:00
Makefile.inc1 Fix xdev-install when installing to a location other than / 2013-03-31 08:54:04 +00:00
ObsoleteFiles.inc Remove obsolete files of the legacy ATA stack. 2013-04-04 07:57:32 +00:00
README
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