OPNsense - FreeBSD source
Find a file
Bill Paul 73bf949c34 It appears that under certain circumstances that I still can't quite pin
down, the dc driver and receiver can fall out of sync with one another,
resulting in a condition where the chip continues to receive packets
but the driver never notices. Normally, the receive handler checks each
descriptor starting from the current producer index to see if the chip
has relinquished ownership, indicating that a packet has been received.
The driver hands the packet off to ether_input() and then prepares the
descriptor to receive another frame before moving on to the next
descriptor in the ring. But sometimes, the chip appears to skip a
descriptor. This leaves the driver testing the status word in a descriptor
that never gets updated. The driver still gets "RX done" interrupts but
never advances further into the RX ring, until the ring fills up and the
chip interrupts again to signal an error condition. Sometimes, the
driver will remain in this desynchronized state, resulting in spotty
performance until the interface is reset.

Fortunately, it's fairly simple to detect this condition: if we call
the rxeof routine but the number of received packets doesn't increase,
we suspect that there could be a problem. In this case, we call a new
routine called dc_rx_resync(), which scans ahead in the RX ring to see
if there's a frame waiting for us somewhere beyond that the driver thinks
is the current producer index. If it finds one, it bumps up the index
and calls the rxeof handler again to snarf up the packet and bring the
driver back in sync with the chip. (It may actually do this several times
in the event that there's more than one "hole" in the ring.)

So far the only card supported by if_dc which has exhibited this problem
is a LinkSys LNE100TX v2.0 (82c115 PNIC II), and it only seems to happen
on one particular system, however the fix is general enough and has low
enough overhead that we may as well apply it for all supported chipsets.
I also implemented the same fix for the 3Com xl driver, which is apparently
vulnerable to the same problem.

Problem originally noted and patch tested by: Matt Dillon
2000-01-03 15:28:47 +00:00
bin Added missing DPADD's. Removed unrequired SRCS's. 2000-01-01 15:44:11 +00:00
contrib Since this has left the vendor branch, sort this incredably disorganized 2000-01-02 11:13:23 +00:00
crypto Upgrade to the pam_ssh module, version 1.1.. 1999-12-28 05:32:54 +00:00
etc Add /usr/libexec/sendmail 1999-12-29 18:34:33 +00:00
games Backout rev1.7, as it broke adventure(6) (const'ing a non-r/o variable). 1999-12-25 03:50:42 +00:00
gnu Egads! This still refered to contrib/egcs/ 2000-01-03 10:41:11 +00:00
include Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
kerberos5 Bring in SRA for telnet. 1999-10-07 18:59:55 +00:00
kerberosIV Build some more build-toold so that "make world" works for the 1999-12-30 10:21:54 +00:00
lib Remove -g compiler flag. 2000-01-03 12:01:30 +00:00
libexec Moved flags_to_string and string_to_flags into libutil. It's used in 1999-12-30 13:15:15 +00:00
release kernel space savings allow reactivation of NFS installs. 2000-01-03 10:00:09 +00:00
sbin Remove -g compiler flag. 2000-01-03 12:01:30 +00:00
secure Since /etc/sendmail.cf got moved to /etc/mail/sendmail.cf, a 'make world' 1999-12-29 18:56:55 +00:00
share Fix typo. 2000-01-03 12:16:18 +00:00
sys It appears that under certain circumstances that I still can't quite pin 2000-01-03 15:28:47 +00:00
tools Don't use -C internally. Use -c. For some reason files are not copied 1999-12-15 18:08:56 +00:00
usr.bin Added missing DPADD's. Removed unrequired SRCS's. 2000-01-01 15:44:11 +00:00
usr.sbin Remove -g compiler flag. 2000-01-03 12:01:30 +00:00
COPYRIGHT Update to add the July 22, 1999 addendum. 1999-09-05 21:33:47 +00:00
Makefile Descent into sub-makes with a fixed PATH. The PATH does not contain 1999-12-23 13:53:44 +00:00
Makefile.inc0 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Makefile.inc1 Grrrr... This was supoosed to go with the commit to kerberosIV/.../libroken's 1999-12-30 10:31:21 +00:00
Makefile.upgrade $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
README $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
UPDATING Add import of ntpd 4.x 1999-12-19 23:51:50 +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 and the contents of /etc.  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 with config(8) is a somewhat more involved process,
documentation for which can be found at:
   http://www.freebsd.org/handbook/kernelconfig.html
And in the config(8) man page.

The sample kernel configuration files reside in the sys/i386/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 LINT contains entries for all possible devices, not
just those commonly used, and is meant more as a general reference
than an actual kernel configuration file (a kernel built from it
wouldn't even run).


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

contrib		Packages contributed by 3rd parties.

crypto		Export controlled 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.

kerberosIV	Kerberos package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

sbin		System commands.

secure		DES and DES-related utilities - NOT FOR EXPORT!

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/handbook/synching.html