* [PATCH] e1000e: add netpoll support for MSI/MSI-X IRQ modes
@ 2010-10-26 5:54 Dongdong Deng
2010-10-27 18:20 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Dongdong Deng @ 2010-10-26 5:54 UTC (permalink / raw)
To: davem, jesse, jeffrey.t.kirsher, bruce.w.allan
Cc: alexander.h.duyck, carolyn.wyborny, donald.c.skidmore,
gregory.v.rose, peter.p.waskiewicz.jr, john.ronciak,
dongdong.deng, e1000-devel, netdev
With enabling CONFIG_PCI_MSI, e1000e could work in MSI/MSI-X IRQ mode,
and netpoll controller didn't deal with those IRQ modes on e1000e.
This patch add the handling MSI/MSI-X IRQ modes to netpoll controller,
so that netconsole could work with those IRQ modes.
Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
---
drivers/net/e1000e/netdev.c | 49 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index e561d15..36992ba 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -5369,6 +5369,36 @@ static void e1000_shutdown(struct pci_dev *pdev)
}
#ifdef CONFIG_NET_POLL_CONTROLLER
+
+static irqreturn_t e1000_intr_msix(int irq, void *data)
+{
+ struct net_device *netdev = data;
+ struct e1000_adapter *adapter = netdev_priv(netdev);
+ int vector, msix_irq;
+
+ if (adapter->msix_entries) {
+ vector = 0;
+ msix_irq = adapter->msix_entries[vector].vector;
+ disable_irq(msix_irq);
+ e1000_intr_msix_rx(msix_irq, netdev);
+ enable_irq(msix_irq);
+
+ vector++;
+ msix_irq = adapter->msix_entries[vector].vector;
+ disable_irq(msix_irq);
+ e1000_intr_msix_tx(msix_irq, netdev);
+ enable_irq(msix_irq);
+
+ vector++;
+ msix_irq = adapter->msix_entries[vector].vector;
+ disable_irq(msix_irq);
+ e1000_msix_other(msix_irq, netdev);
+ enable_irq(msix_irq);
+ }
+
+ return IRQ_HANDLED;
+}
+
/*
* Polling 'interrupt' - used by things like netconsole to send skbs
* without having to re-enable interrupts. It's not called while
@@ -5378,10 +5408,21 @@ static void e1000_netpoll(struct net_device *netdev)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
- disable_irq(adapter->pdev->irq);
- e1000_intr(adapter->pdev->irq, netdev);
-
- enable_irq(adapter->pdev->irq);
+ switch (adapter->int_mode) {
+ case E1000E_INT_MODE_MSIX:
+ e1000_intr_msix(adapter->pdev->irq, netdev);
+ break;
+ case E1000E_INT_MODE_MSI:
+ disable_irq(adapter->pdev->irq);
+ e1000_intr_msi(adapter->pdev->irq, netdev);
+ enable_irq(adapter->pdev->irq);
+ break;
+ default: /* E1000E_INT_MODE_LEGACY */
+ disable_irq(adapter->pdev->irq);
+ e1000_intr(adapter->pdev->irq, netdev);
+ enable_irq(adapter->pdev->irq);
+ break;
+ }
}
#endif
--
1.6.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] e1000e: add netpoll support for MSI/MSI-X IRQ modes
2010-10-26 5:54 [PATCH] e1000e: add netpoll support for MSI/MSI-X IRQ modes Dongdong Deng
@ 2010-10-27 18:20 ` David Miller
2010-10-27 21:12 ` Jeff Kirsher
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2010-10-27 18:20 UTC (permalink / raw)
To: dongdong.deng
Cc: jesse, jeffrey.t.kirsher, bruce.w.allan, alexander.h.duyck,
carolyn.wyborny, donald.c.skidmore, gregory.v.rose,
peter.p.waskiewicz.jr, john.ronciak, e1000-devel, netdev
Intel folks, I assume you guys will look at this and integrate it.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] e1000e: add netpoll support for MSI/MSI-X IRQ modes
2010-10-27 18:20 ` David Miller
@ 2010-10-27 21:12 ` Jeff Kirsher
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Kirsher @ 2010-10-27 21:12 UTC (permalink / raw)
To: David Miller
Cc: dongdong.deng@windriver.com, jesse@nicira.com, Allan, Bruce W,
Duyck, Alexander H, Wyborny, Carolyn, Skidmore, Donald C,
Rose, Gregory V, Waskiewicz Jr, Peter P, Ronciak, John,
e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 183 bytes --]
On Wed, 2010-10-27 at 11:20 -0700, David Miller wrote:
> Intel folks, I assume you guys will look at this and integrate it.
>
> Thanks.
Correct. I will add this to my queue.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-27 21:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-26 5:54 [PATCH] e1000e: add netpoll support for MSI/MSI-X IRQ modes Dongdong Deng
2010-10-27 18:20 ` David Miller
2010-10-27 21:12 ` Jeff Kirsher
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).