* [PATCH] via-velocity: add netpoll functionality for the benefit of netconsole
@ 2010-01-04 18:32 Jan Ceuleers
2010-01-05 6:28 ` Simon Kagstrom
0 siblings, 1 reply; 5+ messages in thread
From: Jan Ceuleers @ 2010-01-04 18:32 UTC (permalink / raw)
To: netdev; +Cc: David Miller, Stéphane Berthelot
In February 2008, Stéphane Bertelot submitted a patch to netdev adding
netpoll functionality to the via-velocity driver so that netconsole
could be used with it.
There was no discussion at the time and the patch was not committed to
mainline.
I'd like to try again with this version, which has been ported to the
current code base.
---------------------
This patch is a port to net-next-2.6 of a submission by Stéphane
Bertelot in February 2008.
Signed-off-by: Stéphane Berthelot <sberthelot@emisfr.com>
Signed-off-by: Jan Ceuleers <jan.ceuleers@computer.org>
---
drivers/net/via-velocity.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 4ceb441..90718f5 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -2216,6 +2216,20 @@ static irqreturn_t velocity_intr(int irq, void *dev_instance)
}
/**
+ * velocity_poll_controller - netpoll controller
+ * @dev: network device
+ *
+ * Used by netconsole and other diagnostic tools to allow network
+ * i/o with interrupts disabled.
+ */
+static void velocity_poll_controller(struct net_device *dev)
+{
+ disable_irq(dev->irq);
+ velocity_intr(dev->irq, dev);
+ enable_irq(dev->irq);
+}
+
+/**
* velocity_open - interface activation callback
* @dev: network layer device to open
*
@@ -2628,6 +2642,9 @@ static const struct net_device_ops velocity_netdev_ops = {
.ndo_vlan_rx_add_vid = velocity_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = velocity_vlan_rx_kill_vid,
.ndo_vlan_rx_register = velocity_vlan_rx_register,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = velocity_poll_controller,
+#endif
};
/**
--
1.6.3.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] via-velocity: add netpoll functionality for the benefit of netconsole
2010-01-04 18:32 [PATCH] via-velocity: add netpoll functionality for the benefit of netconsole Jan Ceuleers
@ 2010-01-05 6:28 ` Simon Kagstrom
2010-01-05 20:19 ` Jan Ceuleers
0 siblings, 1 reply; 5+ messages in thread
From: Simon Kagstrom @ 2010-01-05 6:28 UTC (permalink / raw)
To: Jan Ceuleers; +Cc: netdev, David Miller, Stéphane Berthelot
Hi,
Does the patch still work with the new NAPI support in the driver? Some
comments below:
On Mon, 04 Jan 2010 19:32:32 +0100
Jan Ceuleers <jan.ceuleers@computer.org> wrote:
> +static void velocity_poll_controller(struct net_device *dev)
> +{
> + disable_irq(dev->irq);
> + velocity_intr(dev->irq, dev);
> + enable_irq(dev->irq);
> +}
This should probably have an
#ifdef CONFIG_NET_POLL_CONTROLLER
...
#endif
around it since
> @@ -2628,6 +2642,9 @@ static const struct net_device_ops velocity_netdev_ops = {
> .ndo_vlan_rx_add_vid = velocity_vlan_rx_add_vid,
> .ndo_vlan_rx_kill_vid = velocity_vlan_rx_kill_vid,
> .ndo_vlan_rx_register = velocity_vlan_rx_register,
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> + .ndo_poll_controller = velocity_poll_controller,
> +#endif
This one has it (to avoid a warning when building without it).
// Simon
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] via-velocity: add netpoll functionality for the benefit of netconsole
2010-01-05 6:28 ` Simon Kagstrom
@ 2010-01-05 20:19 ` Jan Ceuleers
2010-01-07 6:26 ` Simon Kagstrom
0 siblings, 1 reply; 5+ messages in thread
From: Jan Ceuleers @ 2010-01-05 20:19 UTC (permalink / raw)
To: Simon Kagstrom; +Cc: netdev, David Miller, Stéphane Berthelot
Simon Kagstrom wrote:
> Does the patch still work with the new NAPI support in the driver?
Errr. (Is my ignorance showing yet?)
I will have to study this, based on other drivers and your commit dfff71.
I would be grateful for any hints, but otherwise will endeavour to figure it out myself.
>> +static void velocity_poll_controller(struct net_device *dev)
>> +{
>> + disable_irq(dev->irq);
>> + velocity_intr(dev->irq, dev);
>> + enable_irq(dev->irq);
>> +}
>
> This should probably have an
>
> #ifdef CONFIG_NET_POLL_CONTROLLER
> ...
> #endif
>
> around it
You are right, will add.
Thanks, Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] via-velocity: add netpoll functionality for the benefit of netconsole
2010-01-05 20:19 ` Jan Ceuleers
@ 2010-01-07 6:26 ` Simon Kagstrom
2010-01-10 9:06 ` Jan Ceuleers
0 siblings, 1 reply; 5+ messages in thread
From: Simon Kagstrom @ 2010-01-07 6:26 UTC (permalink / raw)
To: Jan Ceuleers; +Cc: netdev, David Miller, Stéphane Berthelot
On Tue, 05 Jan 2010 21:19:33 +0100
Jan Ceuleers <jan.ceuleers@computer.org> wrote:
> Simon Kagstrom wrote:
> > Does the patch still work with the new NAPI support in the driver?
>
> Errr. (Is my ignorance showing yet?)
>
> I will have to study this, based on other drivers and your commit dfff71.
Well, if you have tested it and netconsole works with the new driver I
would guess it's OK. I don't know netconsole myself, but I know the
interrupt handler (which you call from your patch) has changed with the
NAPI support, so that's why I was wondering if it still worked.
// Simon
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] via-velocity: add netpoll functionality for the benefit of netconsole
2010-01-07 6:26 ` Simon Kagstrom
@ 2010-01-10 9:06 ` Jan Ceuleers
0 siblings, 0 replies; 5+ messages in thread
From: Jan Ceuleers @ 2010-01-10 9:06 UTC (permalink / raw)
To: Simon Kagstrom; +Cc: netdev, David Miller, Stéphane Berthelot
Simon Kagstrom wrote:
>> I will have to study this, based on other drivers and your commit dfff71.
>
> Well, if you have tested it and netconsole works with the new driver I
> would guess it's OK. I don't know netconsole myself, but I know the
> interrupt handler (which you call from your patch) has changed with the
> NAPI support, so that's why I was wondering if it still worked.
I want to double-check but can't get my hands on the test machine at the moment. I will revert as soon as.
Thanks, Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-01-10 9:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-04 18:32 [PATCH] via-velocity: add netpoll functionality for the benefit of netconsole Jan Ceuleers
2010-01-05 6:28 ` Simon Kagstrom
2010-01-05 20:19 ` Jan Ceuleers
2010-01-07 6:26 ` Simon Kagstrom
2010-01-10 9:06 ` Jan Ceuleers
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).