opnsense-src/sys
Bjoern A. Zeeb dcceaf9f3c Merge atse(4) interrupt handling and race condition fixes from cheribsd:
commit 8bd88585ed8e3f7def0d780a1bc30d96fe642b9c

    Rework atse_rx_cycles handling: count packets instead of fills, and use the
    limit only when polling, not when in interrupt mode.  Otherwise, we may
    stop reading the FIFO midpacket and clear the event mask even though the
    FIFO still has data to read, which could stall receive when a large packet
    arrives.  Add a comment about races in the Altera FIFO interface: we may
    need to do a little more work to handle races than we are.

commit 20b39086cc612f8874dc9e6ef4c0c2eb777ba92a

    Use 'sizeof(data)' rather than '4' when checking an mbuf bound, as is the
    case for adjusting length/etc.

commit e18953174a265f40e9ba60d76af7d288927f5382

    Break out atse_intr() into two separate routines, one for each of the two
    interrupt sources: receive and transmit.

commit 6deedb43246ab3f9f597918361831fbab7fac4ce

    For the RX interrupt, take interest only in ALMOSTEMPTY and OVERFLOW.
    For the TX interrupt, take interest only in ALMOSTFULL and UNDERFLOW.

    Perform TX atse_start_locked() once rather than twice in TX interrupt
    handling -- and only if !FULL, rather than unconditionally.

commit 12601972ba08d4380201a74f5b967bdaeb23092c

    Experimentation suggests that the Altera Triple-Speed Ethernet documentation
    is incorrect and bits in the event and interrupt-enable registers are not
    irrationally rearranged relative to the status register.

commit 3cff2ffad769289fce3a728152e7be09405385d8

    Substantially rework interrupt handling in the atse(4) driver:

    - Introduce a new macro ATSE_TX_PENDING() which checks whether there is
      any pending data to transmit, either in an in-progress packet or in
      the TX queue.
    - Introduce new ATSE_RX_STATUS_READ() and ATSE_TX_STAUTS_WRITE() macros
      that query the FIFO status registers rather than event registers,
      offering level- rather than edge-triggered FIFO conditions.
    - For RX, interrupt only on full/overflow/underflow; for TX, interrupt
      only on empty/overflow/underflow.
    - Add new ATSE_RX_INTR_READ() and ATSE_RX_INTR_WRITE() macros useful for
      debugging interrupt behaviour.
    - Add a debug.atse_intr_debug_enable sysctl that causes various pieces
      of FIFO state to be printed out on each RX or TX interrupt.  This is
      disabled by default but good to turn on if the interface appears to
      wedge.  Also print debugging information when polling.
    - In the watchdog handler, do receive, not just transmit, processing, to
      ensure that the rx, not just tx, queue is being handled -- and, in
      particular, will be drained such that interrupts can resume.
    - Rework both atse_rx_intr() and atse_tx_intr() to eliminate many race
      conditions, and add comments on why various things are in various
      orders.  Interactions between modifications to the event and interrupt
      masks are quite subtle indeed, and we must actively check for a number
      of races (e.g., event mask cleared; packet arrives; interrupts enabled).
      We also now use the status registers rather than event registers for
      FIFO status checks to avoid other races; we continue to use event
      registers for underflow/overflow.

    With this change, interrupt-driven operation of atse appears (for the
    time being) robust.

commit 3393bbff5c68a4e61699f9b4a62af5d2a5f918f8

    atse: Fix build after 3cff2ffa

Obtained from:	cheribsd
Submitted by:	rwatson, emaste
Sponsored by:	DARPA/AFRL
MFC after:	3 days
2014-09-16 15:45:53 +00:00
..
amd64 Add a sysctl to export the EFI memory map along with a handler in the 2014-09-13 03:10:02 +00:00
arm The private peripheral interrupts start at offset 16, not 0. Also, use 2014-09-15 15:36:00 +00:00
boot add gptzfsboot.8, zfsboot.8 and zfsloader.8 manual pages 2014-09-15 06:21:28 +00:00
bsm
cam Add quirks to disable READ CAPACITY (16) for PNY USB 3.0 Flash Drives. 2014-09-15 19:48:27 +00:00
cddl Added missing ZFS sysctls 2014-09-14 12:23:00 +00:00
compat Add missing proctree locking to fill_kinfo_proc consumers. 2014-08-30 03:10:55 +00:00
conf Disable flow-director support until it's been debugged and verified. 2014-09-15 21:09:19 +00:00
contrib Add iwn-100 firmware. 2014-08-28 00:05:02 +00:00
crypto
ddb ins is only set and unused, but only when we're not doing software 2014-08-14 16:01:51 +00:00
dev Merge atse(4) interrupt handling and race condition fixes from cheribsd: 2014-09-16 15:45:53 +00:00
fs Provide the unique implementation for the VOP_GETPAGES() method used 2014-09-15 12:28:29 +00:00
gdb Add support for gdb's memory searching capabilities to our in-kernel gdb 2014-09-05 16:40:47 +00:00
geom Cache GELI passphrases entered at the console during the boot process, 2014-09-16 08:40:52 +00:00
gnu Merge forgotten .h files from vendor branch. 2014-09-05 02:21:45 +00:00
i386 MFamd64: Use initializecpu() to set various model-specific registers on 2014-09-10 21:37:47 +00:00
isa
kern Modify cpuset_setithread() to take a CPU ID as an integer, not a char. 2014-09-16 01:21:47 +00:00
kgssapi
libkern Use __DECONST to avoid compiler warnings (and thus build failures) 2014-09-08 08:12:09 +00:00
mips Fix RTC clock writes on many Octeon boards. 2014-09-14 00:02:40 +00:00
modules Disable flow-director support until it's been debugged and verified. 2014-09-15 21:09:19 +00:00
net Revert r271504. A new patch to solve this issue will be made. 2014-09-13 20:52:01 +00:00
net80211 After much toying around with this AMRR initial rate stuff, 2014-08-20 09:10:03 +00:00
netgraph
netinet Fix source address selection on unbound sockets in the presence of multiple 2014-09-16 15:28:19 +00:00
netinet6 Revisions 264905 and 266860 added a "int fib" argument to ifa_ifwithnet and 2014-09-11 20:21:03 +00:00
netipsec Change pr_output's prototype to avoid the need for explicit casts. 2014-08-15 02:43:02 +00:00
netnatm
netpfil - Provide a sleepable lock to protect against ioctl() vs ioctl() races. 2014-09-12 08:39:15 +00:00
netsmb
nfs
nfsclient Avoid an exclusive acquisition of the object lock on the expected execution 2014-09-14 18:07:55 +00:00
nfsserver Change NFS readdir() to only ignore cookies preceding the given offset for 2014-07-01 20:00:35 +00:00
nlm
ofed Revert r271504. A new patch to solve this issue will be made. 2014-09-13 20:52:01 +00:00
opencrypto Fix various issues with invalid file operations: 2014-09-12 21:29:10 +00:00
pc98 MFamd64: Use initializecpu() to set various model-specific registers on 2014-09-10 21:37:47 +00:00
pci
powerpc Rename OF_xref_phandle() to OF_node_from_xref() and add a new function 2014-09-01 18:51:01 +00:00
rpc Merge the NFSv4.1 server code in projects/nfsv4.1-server over 2014-07-01 20:47:16 +00:00
security Replace dev_clone with cdevpriv(9) KPI in audit_pipe code. 2014-08-20 16:04:30 +00:00
sparc64 Create a separate structure for per-CPU state saved across suspend and 2014-09-06 15:23:28 +00:00
sys Modify cpuset_setithread() to take a CPU ID as an integer, not a char. 2014-09-16 01:21:47 +00:00
teken
tools Allow the make_dtb script to work outside of a "make buildkernel" context 2014-08-30 22:39:15 +00:00
ufs Provide the unique implementation for the VOP_GETPAGES() method used 2014-09-15 12:28:29 +00:00
vm Add stricter checking of some mmap() arguments: 2014-09-15 17:20:13 +00:00
x86 xen: don't set suspend/resume methods for the PIRQ PIC 2014-09-15 15:15:52 +00:00
xdr
xen xen: implement event channel PIRQ support 2014-08-04 08:42:29 +00:00
Makefile Remove ia64. 2014-07-07 00:27:09 +00:00