From: Robert Olsson <Robert.Olsson@data.slu.se>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-kernel@vger.kernel.org, Robert.Olsson@data.slu.se
Subject: e1000 fixes (NAPI)
Date: Wed, 20 Nov 2002 20:01:16 +0100 [thread overview]
Message-ID: <15835.56316.564937.169193@robur.slu.se> (raw)
Two fixes the NAPI branch of e1000.
1) e1000_irq_disable was used to disable irqs which called synchronize_irq
which in turn caused a solid hang on SMP systems.
2) Interrupt acking patch previously sent by DaveM.
Cheers.
--ro
--- linux/drivers/net/e1000.vanilla/e1000.h 2002-11-13 12:54:49.000000000 +0100
+++ linux/drivers/net/e1000/e1000.h 2002-11-20 15:00:14.000000000 +0100
@@ -181,6 +181,10 @@
uint32_t tx_abs_int_delay;
int max_data_per_txd;
+#ifdef CONFIG_E1000_NAPI
+ uint32_t icr_pending;
+#endif
+
/* RX */
struct e1000_desc_ring rx_ring;
uint64_t hw_csum_err;
--- linux/drivers/net/e1000.vanilla/e1000_main.c 2002-11-13 12:54:49.000000000 +0100
+++ linux/drivers/net/e1000/e1000_main.c 2002-11-20 17:37:55.000000000 +0100
@@ -1896,15 +1896,29 @@
{
struct net_device *netdev = data;
struct e1000_adapter *adapter = netdev->priv;
+ uint32_t icr;
+ int i = E1000_MAX_INTR;
+
#ifdef CONFIG_E1000_NAPI
- if (netif_rx_schedule_prep(netdev)) {
- e1000_irq_disable(adapter);
+ icr = E1000_READ_REG(&adapter->hw, ICR);
+ if (icr && netif_rx_schedule_prep(netdev)) {
+
+ /* Disable interrupts */
+ atomic_inc(&adapter->irq_sem);
+ E1000_WRITE_REG(&adapter->hw, IMC, ~0);
+
+ /* E1000_WRITE_FLUSH(&adapter->hw);
+ * E1000_READ below syncs it --ro
+ */
+
__netif_rx_schedule(netdev);
+
+ adapter->icr_pending = icr;
+ while (i-- && (icr = E1000_READ_REG(&adapter->hw, ICR)) != 0)
+ adapter->icr_pending |= icr;
}
#else
- uint32_t icr;
- int i = E1000_MAX_INTR;
while(i && (icr = E1000_READ_REG(&adapter->hw, ICR))) {
@@ -1930,7 +1944,15 @@
int i = E1000_MAX_INTR;
int hasReceived = 0;
- while(i && (icr = E1000_READ_REG(&adapter->hw, ICR))) {
+ while(i) {
+ if (adapter->icr_pending) {
+ icr = adapter->icr_pending;
+ adapter->icr_pending = 0;
+ } else
+ icr = E1000_READ_REG(&adapter->hw, ICR);
+ if (!icr)
+ break;
+
if (icr & E1000_ICR_RXT0)
hasReceived = 1;
next reply other threads:[~2002-11-20 18:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-20 19:01 Robert Olsson [this message]
2002-11-20 23:43 ` Jeff V. Merkey
2002-11-21 10:43 ` Robert Olsson
2002-11-21 18:05 ` Jeff V. Merkey
2002-11-21 18:10 ` Jeff V. Merkey
2002-11-21 17:13 ` Jeff Garzik
2002-11-21 18:30 ` Jeff V. Merkey
2002-11-21 17:31 ` Jeff Garzik
2002-11-21 22:03 ` Jeff V. Merkey
2002-11-21 1:18 Feldman, Scott
2002-11-22 10:21 Robert Olsson
2002-11-22 19:05 ` Jeff V. Merkey
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=15835.56316.564937.169193@robur.slu.se \
--to=robert.olsson@data.slu.se \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®