* [PATCH] s2io: netpoll support
@ 2006-06-08 16:01 Brian Haley
2006-06-13 23:33 ` Ravinandan Arakali
0 siblings, 1 reply; 5+ messages in thread
From: Brian Haley @ 2006-06-08 16:01 UTC (permalink / raw)
To: netdev; +Cc: jgarzik
[-- Attachment #1: Type: text/plain, Size: 264 bytes --]
This adds netpoll support for things like netconsole/kgdboe to the s2io
10GbE driver.
This duplicates some code from s2io_poll() as I wanted to be
least-invasive, someone from Neterion might have other thoughts?
Signed-off-by: Brian Haley <brian.haley@hp.com>
[-- Attachment #2: s2io.netpoll.patch --]
[-- Type: text/x-patch, Size: 1831 bytes --]
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 79208f4..c2c5f46 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -2575,6 +2575,53 @@ no_rx:
#endif
/**
+ * s2io_netpoll - Rx interrupt service handler for netpoll support
+ * @dev : pointer to the device structure.
+ * Description:
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void s2io_netpoll(struct net_device *dev)
+{
+ nic_t *nic = dev->priv;
+ mac_info_t *mac_control;
+ struct config_param *config;
+ XENA_dev_config_t __iomem *bar0 = nic->bar0;
+ u64 val64;
+ int i;
+
+ atomic_inc(&nic->isr_cnt);
+
+ /* Disable all interrupts */
+ en_dis_able_nic_intrs(nic, ENA_ALL_INTRS, DISABLE_INTRS);
+
+ mac_control = &nic->mac_control;
+ config = &nic->config;
+
+ val64 = readq(&bar0->rx_traffic_int);
+ writeq(val64, &bar0->rx_traffic_int);
+
+ for (i = 0; i < config->rx_ring_num; i++)
+ rx_intr_handler(&mac_control->rings[i]);
+
+ for (i = 0; i < config->rx_ring_num; i++) {
+ if (fill_rx_buffers(nic, i) == -ENOMEM) {
+ DBG_PRINT(ERR_DBG, "%s:Out of memory", dev->name);
+ DBG_PRINT(ERR_DBG, " in Rx Netpoll!!\n");
+ break;
+ }
+ }
+ /* Re-enable all interrupts */
+ en_dis_able_nic_intrs(nic, ENA_ALL_INTRS, ENABLE_INTRS);
+ atomic_dec(&nic->isr_cnt);
+ return;
+}
+#endif
+
+/**
* rx_intr_handler - Rx interrupt handler
* @nic: device private variable.
* Description:
@@ -6210,6 +6257,10 @@ Defaulting to INTA\n");
dev->weight = 32;
#endif
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ dev->poll_controller = s2io_netpoll;
+#endif
+
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
if (sp->high_dma_flag == TRUE)
dev->features |= NETIF_F_HIGHDMA;
^ permalink raw reply related [flat|nested] 5+ messages in thread* RE: [PATCH] s2io: netpoll support
2006-06-08 16:01 [PATCH] s2io: netpoll support Brian Haley
@ 2006-06-13 23:33 ` Ravinandan Arakali
2006-06-15 18:36 ` Brian Haley
0 siblings, 1 reply; 5+ messages in thread
From: Ravinandan Arakali @ 2006-06-13 23:33 UTC (permalink / raw)
To: 'Brian Haley', netdev
Cc: jgarzik, Ananda. Raju (E-mail), Leonid. Grossman (E-mail)
I don't think we should disable and enable all interrupts in the
poll_controller entry point. With the current patch, at the end of
the routine _all_ interrupts get enabled which is not desirable.
Maybe you should just do disable_irq() at start of function and
enable_irq() before exiting, the way some of the other drivers do.
Ravi
-----Original Message-----
From: netdev-owner@vger.kernel.org
[mailto:netdev-owner@vger.kernel.org]On Behalf Of Brian Haley
Sent: Thursday, June 08, 2006 9:02 AM
To: netdev@vger.kernel.org
Cc: jgarzik@pobox.com
Subject: [PATCH] s2io: netpoll support
This adds netpoll support for things like netconsole/kgdboe to the s2io
10GbE driver.
This duplicates some code from s2io_poll() as I wanted to be
least-invasive, someone from Neterion might have other thoughts?
Signed-off-by: Brian Haley <brian.haley@hp.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] s2io: netpoll support
2006-06-13 23:33 ` Ravinandan Arakali
@ 2006-06-15 18:36 ` Brian Haley
2006-06-22 19:45 ` Ravinandan Arakali
0 siblings, 1 reply; 5+ messages in thread
From: Brian Haley @ 2006-06-15 18:36 UTC (permalink / raw)
To: netdev
Cc: ravinandan.arakali, jgarzik, Ananda. Raju (E-mail),
Leonid. Grossman (E-mail)
[-- Attachment #1: Type: text/plain, Size: 135 bytes --]
This adds netpoll support for things like netconsole/kgdboe to the s2io
10GbE driver.
Signed-off-by: Brian Haley <brian.haley@hp.com>
[-- Attachment #2: s2io.netpoll.patch --]
[-- Type: text/x-patch, Size: 1694 bytes --]
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 79208f4..f2b8dba 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -2575,6 +2575,50 @@ no_rx:
#endif
/**
+ * s2io_netpoll - Rx interrupt service handler for netpoll support
+ * @dev : pointer to the device structure.
+ * Description:
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void s2io_netpoll(struct net_device *dev)
+{
+ nic_t *nic = dev->priv;
+ mac_info_t *mac_control;
+ struct config_param *config;
+ XENA_dev_config_t __iomem *bar0 = nic->bar0;
+ u64 val64;
+ int i;
+
+ disable_irq(dev->irq);
+
+ atomic_inc(&nic->isr_cnt);
+ mac_control = &nic->mac_control;
+ config = &nic->config;
+
+ val64 = readq(&bar0->rx_traffic_int);
+ writeq(val64, &bar0->rx_traffic_int);
+
+ for (i = 0; i < config->rx_ring_num; i++)
+ rx_intr_handler(&mac_control->rings[i]);
+
+ for (i = 0; i < config->rx_ring_num; i++) {
+ if (fill_rx_buffers(nic, i) == -ENOMEM) {
+ DBG_PRINT(ERR_DBG, "%s:Out of memory", dev->name);
+ DBG_PRINT(ERR_DBG, " in Rx Netpoll!!\n");
+ break;
+ }
+ }
+ atomic_dec(&nic->isr_cnt);
+ enable_irq(dev->irq);
+ return;
+}
+#endif
+
+/**
* rx_intr_handler - Rx interrupt handler
* @nic: device private variable.
* Description:
@@ -6210,6 +6254,10 @@ Defaulting to INTA\n");
dev->weight = 32;
#endif
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ dev->poll_controller = s2io_netpoll;
+#endif
+
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
if (sp->high_dma_flag == TRUE)
dev->features |= NETIF_F_HIGHDMA;
^ permalink raw reply related [flat|nested] 5+ messages in thread* RE: [PATCH] s2io: netpoll support
2006-06-15 18:36 ` Brian Haley
@ 2006-06-22 19:45 ` Ravinandan Arakali
2006-06-26 16:33 ` Brian Haley
0 siblings, 1 reply; 5+ messages in thread
From: Ravinandan Arakali @ 2006-06-22 19:45 UTC (permalink / raw)
To: 'Brian Haley', netdev
Cc: jgarzik, 'Ananda. Raju (E-mail)',
'Leonid. Grossman (E-mail)'
Since the poll_controller entry point will be used by utilities such as
netdump, I am thinking we need to clear Tx interrupts as well here.
Did you get a chance to test this patch with netdump ?
Thanks,
Ravi
-----Original Message-----
From: Brian Haley [mailto:brian.haley@hp.com]
Sent: Thursday, June 15, 2006 11:37 AM
To: netdev@vger.kernel.org
Cc: ravinandan.arakali@neterion.com; jgarzik@pobox.com; Ananda. Raju
(E-mail); Leonid. Grossman (E-mail)
Subject: Re: [PATCH] s2io: netpoll support
This adds netpoll support for things like netconsole/kgdboe to the s2io
10GbE driver.
Signed-off-by: Brian Haley <brian.haley@hp.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] s2io: netpoll support
2006-06-22 19:45 ` Ravinandan Arakali
@ 2006-06-26 16:33 ` Brian Haley
0 siblings, 0 replies; 5+ messages in thread
From: Brian Haley @ 2006-06-26 16:33 UTC (permalink / raw)
To: ravinandan.arakali
Cc: netdev, jgarzik, 'Ananda. Raju (E-mail)',
'Leonid. Grossman (E-mail)'
Ravinandan Arakali wrote:
> Since the poll_controller entry point will be used by utilities such as
> netdump, I am thinking we need to clear Tx interrupts as well here.
> Did you get a chance to test this patch with netdump ?
No, I've only been testing Kgdb over Ethernet on Debian, I think netdump
is a Red Hat thing. I can test any changes you'd want to make with this
patch if you post the diffs.
-Brian
> -----Original Message-----
> From: Brian Haley [mailto:brian.haley@hp.com]
> Sent: Thursday, June 15, 2006 11:37 AM
> To: netdev@vger.kernel.org
> Cc: ravinandan.arakali@neterion.com; jgarzik@pobox.com; Ananda. Raju
> (E-mail); Leonid. Grossman (E-mail)
> Subject: Re: [PATCH] s2io: netpoll support
>
>
> This adds netpoll support for things like netconsole/kgdboe to the s2io
> 10GbE driver.
>
> Signed-off-by: Brian Haley <brian.haley@hp.com>
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-06-26 16:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-08 16:01 [PATCH] s2io: netpoll support Brian Haley
2006-06-13 23:33 ` Ravinandan Arakali
2006-06-15 18:36 ` Brian Haley
2006-06-22 19:45 ` Ravinandan Arakali
2006-06-26 16:33 ` Brian Haley
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).