]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
gianfar: Separate out the Tx interrupt handling (Tx NAPI)
authorClaudiu Manoil <claudiu.manoil@freescale.com>
Fri, 7 Mar 2014 12:42:45 +0000 (14:42 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Mar 2014 17:17:22 +0000 (13:17 -0400)
commitaeb12c5ef7cb08d879af22fc0a56cab9e70689ea
treeba657f19e9c0a8c3658bb780dea4f52bcf66caeb
parentbe14cc98e9fd5416cc8f86799913fd3c52dc720e
gianfar: Separate out the Tx interrupt handling (Tx NAPI)

There are some concurrency issues on devices w/ 2 CPUs related
to the handling of Rx and Tx interrupts.  eTSEC has separate
interrupt lines for Rx and Tx but a single imask register
to mask these interrupts and a single NAPI instance to handle
both Rx and Tx work.  As a result, the Rx and Tx ISRs are
identical, both are invoking gfar_schedule_cleanup(), however
both handlers can be entered at the same time when the Rx and
Tx interrupts are taken by different CPUs.  In this case
spurrious interrupts (SPU) show up (in /proc/interrupts)
indicating a concurrency issue.  Also, Tx overruns followed
by Tx timeout have been observed under heavy Tx traffic load.

To address these issues, the schedule cleanup ISR part has
been changed to handle the Rx and Tx interrupts independently.
The patch adds a separate NAPI poll routine for Tx cleanup to
be triggerred independently by the Tx confirmation interrupts
only.  Existing poll functions are modified to handle only
the Rx path processing.  The Tx poll routine does not need a
budget, since Tx processing doesn't consume NAPI budget, and
hence it is registered with minimum NAPI weight.
NAPI scheduling does not require locking since there are
different NAPI instances between the Rx and Tx confirmation
paths now.
So, the patch fixes the occurence of spurrious Rx/Tx interrupts.
Tx overruns also occur less frequently now.

Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/gianfar.c
drivers/net/ethernet/freescale/gianfar.h