From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 04/30] net: fec: fix interrupt handling races
Date: Fri, 20 Jun 2014 16:36:14 +0100 [thread overview]
Message-ID: <20140620153614.GU32514@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1725F962@AcuExch.aculab.com>
On Fri, Jun 20, 2014 at 12:39:57PM +0000, David Laight wrote:
> It is usually possible to reduce the interrupt count even further by:
> 1) processing the rings.
> 2) clear the IRQ.
> 3) check the rings for new entries, if any start again.
> This means that you don't take the interrupt for anything that completes
> while processing the earlier ring entries.
>
> The slight downside is that it is easy to exit the ISR before the IRQ
> line actually drops - resulting in a spurious interrupt.
>
> (patch 24 seems to be similar).
ITYM patch 26, as patch 24 is an update to the errata workaround.
Patch 4 is what I regard to be the bare minimum fix, patch 26 is an
improvement over it.
Remember though that the real interrupt processing happens in the NAPI
handler, not the main interrupt handler - upon seeing a transmit and/or
receive complete interrupt, the main interrupt handler masks both of
these interrupts at the chip and triggers the NAPI handler to run.
Nevertheless, your suggestion is equally valid for a NAPI handler:
- process the rings
- clear the interrupt(s)
- if more work is allowed (according to the NAPI weight), repeat
This is simple enough for the RX ring, where each packet received is
equal one one NAPI unit of work. The TX side is less obvious as
the NAPI documentation suggests that cleaning the ring partially
equates to no NAPI units of work but a clean of the entire ring
equates to the full allowance. Maybe I've mis-understood something
there (which would mean there's another bug which needs fixing in the
tx reaping code...)
--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
next prev parent reply other threads:[~2014-06-20 15:36 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-20 12:11 [PATCH RFC 00/30] Initial round of Freescale FEC ethernet patches Russell King - ARM Linux
2014-06-20 12:11 ` [PATCH RFC 01/30] net: fec: Don't clear IPV6 header checksum field when IP accelerator enable Russell King
2014-06-20 12:11 ` [PATCH RFC 02/30] net: fec: iMX6 FEC does not support half-duplex gigabit Russell King
2014-06-20 12:11 ` [PATCH RFC 03/30] net: fec: fix ethtool set_pauseparam duplex bug Russell King
2014-06-20 12:12 ` [PATCH RFC 04/30] net: fec: fix interrupt handling races Russell King
2014-06-20 12:39 ` David Laight
2014-06-20 15:36 ` Russell King - ARM Linux [this message]
2014-06-20 16:00 ` David Laight
2014-06-22 6:38 ` fugang.duan at freescale.com
2014-06-20 12:12 ` [PATCH RFC 05/30] net: fec: use netif_tx_disable() rather than netif_stop_queue() Russell King
2014-06-20 12:12 ` [PATCH RFC 06/30] net: fec: remove checking for NULL phy_dev in fec_enet_close() Russell King
2014-06-20 12:12 ` [PATCH RFC 07/30] net: fec: ensure that a disconnected phy isn't configured Russell King
2014-06-20 12:12 ` [PATCH RFC 08/30] net: fec: stop the phy before shutting down the MAC Russell King
2014-06-20 12:12 ` [PATCH RFC 09/30] net: fec: remove useless fep->opened Russell King
2014-06-20 12:12 ` [PATCH RFC 10/30] net: fec: make rx skb handling more robust Russell King
2014-06-20 12:12 ` [PATCH RFC 11/30] net: fec: clean up transmit descriptor setup Russell King
2014-06-20 12:12 ` [PATCH RFC 12/30] net: fec: ensure fec_enet_free_buffers() properly cleans the rings Russell King
2014-06-20 12:12 ` [PATCH RFC 13/30] net: fec: fix missing kmalloc() failure check in fec_enet_alloc_buffers() Russell King
2014-06-20 12:12 ` [PATCH RFC 14/30] net: fec: improve safety of suspend/resume/transmit timeout paths Russell King
2014-06-20 12:12 ` [PATCH RFC 15/30] net: fec: ensure fec_enet_close() copes with resume failure Russell King
2014-06-20 12:13 ` [PATCH RFC 16/30] net: fec: only restart or stop the device if it is present and running Russell King
2014-06-20 12:13 ` [PATCH RFC 17/30] net: fec: move calls to quiesce/resume packet processing out of fec_restart() Russell King
2014-06-20 12:13 ` [PATCH RFC 18/30] net: fec: remove inappropriate calls around fec_restart() Russell King
2014-06-22 6:54 ` fugang.duan at freescale.com
2014-06-22 7:55 ` Russell King - ARM Linux
2014-06-22 8:07 ` fugang.duan at freescale.com
2014-06-20 12:13 ` [PATCH RFC 19/30] net: fec: quiesce packet processing before stopping device in fec_suspend() Russell King
2014-06-20 12:13 ` [PATCH RFC 20/30] net: fec: quiesce packet processing before stopping device in fec_set_features() Russell King
2014-06-20 12:13 ` [PATCH RFC 21/30] net: fec: quiesce packet processing before changing features Russell King
2014-06-20 12:13 ` [PATCH RFC 22/30] net: fec: quiesce packet processing when taking link down in fec_enet_adjust_link() Russell King
2014-06-20 12:13 ` [PATCH RFC 23/30] net: fec: clean up duplex mode handling Russell King
2014-06-20 12:13 ` [PATCH RFC 24/30] net: fec: better implementation of iMX6 ERR006358 quirk Russell King
2014-06-22 7:49 ` fugang.duan at freescale.com
2014-06-22 8:12 ` Russell King - ARM Linux
2014-06-22 8:24 ` Russell King - ARM Linux
2014-06-22 8:38 ` fugang.duan at freescale.com
2014-06-22 8:49 ` Russell King - ARM Linux
2014-06-24 10:29 ` Russell King - ARM Linux
2014-06-25 1:41 ` fugang.duan at freescale.com
2014-06-20 12:13 ` [PATCH RFC 25/30] net: fec: replace delayed work with standard work Russell King
2014-06-20 12:13 ` [PATCH RFC 26/30] net: fec: clear receive interrupts before processing a packet Russell King
2014-06-20 12:14 ` [PATCH RFC 27/30] net: fec: reorder ethtool ops to match order in struct declaration Russell King
2014-06-20 12:14 ` [PATCH RFC 28/30] net: fec: add support for dumping transmit ring on timeout Russell King
2014-06-20 12:14 ` [PATCH RFC 29/30] net: fec: remove useless status check in tx reap path Russell King
2014-06-20 12:14 ` [PATCH RFC 30/30] net: fec: consolidate hwtstamp implementation Russell King
2014-06-21 6:11 ` Richard Cochran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140620153614.GU32514@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).