Skip to contentSkip to conversation

via-velocity netpoll enable (patch proposal)

PATCH Stéphane BERTHELOT 1 participant 1 message Feb 26, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello all,

I tried to use netconsole on via-velocity hardware to get some dmesg remotely. Surprisingly the current driver does not seem to have netpoll function code.

I had a look at how it is done in 8139cp and tg3 and borrowed some lines to make a patch for via-velocity.
Though I tested it for some time, I didn't put the hardware at stress especially with high number of netpoll packets.
I am no expert of the via-velocity hardware so I don't know if disabling interrupts is necessary, but it works for me this way and netconsole is happy and didn't crash yet...

via-velocity.c 2008-02-23 10:58:58.000000000 +0100 renamed from via-velocity.c.orig 2008-02-26 23:47:42.000000000 +0100 +0 -0
@@ -378,6 +379,9 @@

static int velocity_change_mtu(struct net_device *dev, int mtu); static int velocity_xmit(struct sk_buff *skb, struct net_device *dev); static int velocity_intr(int irq, void *dev_instance);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void velocity_poll_controller(struct net_device *dev); +#endif
static void velocity_set_multi(struct net_device *dev);
static struct net_device_stats *velocity_get_stats(struct net_device *dev); static int velocity_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); @@ -955,6 +959,9 @@

    dev->set_multicast_list = velocity_set_multi;
    dev->do_ioctl = velocity_ioctl;
    dev->ethtool_ops = &velocity_ethtool_ops;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+        dev->poll_controller = velocity_poll_controller;
+#endif
    dev->change_mtu = velocity_change_mtu;

    dev->vlan_rx_add_vid = velocity_vlan_rx_add_vid;

@@ -2252,6 +2264,18 @@

}

+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling receive - 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);

+}
+#endif

/**
* velocity_set_multi - filter list change callback

Signature · 6 lines
Stéphane BERTHELOT
EmisFR
- Réseau : Sécurité et Serveurs , Développements métier et spécifiques -
10 rue Mazagran, 54000 NANCY, France
http://www.emisfr.com
Tel/Fax. 03 83 32 25 75