Skip to contentSkip to conversation

tg3 netpoll hook

RFC PATCH In review Matt Mackall 3 participants 6 messages Oct 3, 2003 – Oct 5, 2003

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

RFC PATCH 2/3 tg3 netpoll hook

 l-mpm/drivers/net/tg3.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+)
drivers/net/tg3.c renamed from drivers/net/tg3.c~tg3-poll +16 -0
diff -puN drivers/net/tg3.c~tg3-poll drivers/net/tg3.c
@@ -2475,6 +2475,15 @@ static irqreturn_t tg3_interrupt(int irq
 static int tg3_init_hw(struct tg3 *);
 static int tg3_halt(struct tg3 *);
 
+#ifdef HAVE_POLL_CONTROLLER
+static void tg3_poll_controller(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	tg3_interrupt (dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
+
 static void tg3_reset_task(void *_data)
 {
 	struct tg3 *tp = _data;
@@ -7482,6 +7491,10 @@ static struct pci_dev * __devinit tg3_fi
 	return peer;
 }
 
+#ifdef HAVE_POLL_CONTROLLER
+static void tg3_poll_controller(struct net_device *dev);
+#endif
+
 static int __devinit tg3_init_one(struct pci_dev *pdev,
 				  const struct pci_device_id *ent)
 {
@@ -7632,6 +7645,9 @@ static int __devinit tg3_init_one(struct
 	dev->watchdog_timeo = TG3_TX_TIMEOUT;
 	dev->change_mtu = tg3_change_mtu;
 	dev->irq = pdev->irq;
+#ifdef HAVE_POLL_CONTROLLER
+	dev->poll_controller = tg3_poll_controller;
+#endif
 
 	err = tg3_get_invariants(tp);
 	if (err) {

_

Signature · 1 line
Matt Mackall : http://www.selenic.com : of or relating to the moon
#1 lore raw
Quoted 23 lines · Matt Mackall
 l-mpm/drivers/net/tg3.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+)

diff -puN drivers/net/tg3.c~tg3-poll drivers/net/tg3.c

drivers/net/tg3.c renamed from drivers/net/tg3.c~tg3-poll +9 -0
@@ -2475,6 +2475,15 @@ static irqreturn_t tg3_interrupt(int irq
 static int tg3_init_hw(struct tg3 *);
 static int tg3_halt(struct tg3 *);
 
+#ifdef HAVE_POLL_CONTROLLER
+static void tg3_poll_controller(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	tg3_interrupt (dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
+
 static void tg3_reset_task(void *_data)
 {
 	struct tg3 *tp = _data;

drivers/net/tg3.c static struct pci_dev * __devinit tg3_fi · line 7496

Quoted 6 lines
drivers/net/tg3.c renamed from drivers/net/tg3.c~tg3-poll +3 -0
@@ -7482,6 +7491,10 @@ static struct pci_dev * __devinit tg3_fi
 	return peer;
 }
 
+#ifdef HAVE_POLL_CONTROLLER
+static void tg3_poll_controller(struct net_device *dev);
+#endif

This prototype is pointless.

Quoted 14 lines
drivers/net/tg3.c renamed from drivers/net/tg3.c~tg3-poll +3 -0
@@ -7632,6 +7645,9 @@ static int __devinit tg3_init_one(struct
 	dev->watchdog_timeo = TG3_TX_TIMEOUT;
 	dev->change_mtu = tg3_change_mtu;
 	dev->irq = pdev->irq;
+#ifdef HAVE_POLL_CONTROLLER
+	dev->poll_controller = tg3_poll_controller;
+#endif
 
 	err = tg3_get_invariants(tp);
 	if (err) {

_

#2 lore raw
Quoted 26 lines · Jeff Garzik
Quoted 25 lines · Matt Mackall

l-mpm/drivers/net/tg3.c | 16 ++++++++++++++++

1 files changed, 16 insertions(+)

diff -puN drivers/net/tg3.c~tg3-poll drivers/net/tg3.c
+++ l-mpm/drivers/net/tg3.c 2003-09-25 11:56:37.000000000 -0500

drivers/net/tg3.c renamed from drivers/net/tg3.c~tg3-poll +9 -0
@@ -2475,6 +2475,15 @@ static irqreturn_t tg3_interrupt(int irq
 static int tg3_init_hw(struct tg3 *);
 static int tg3_halt(struct tg3 *);
 
+#ifdef HAVE_POLL_CONTROLLER
+static void tg3_poll_controller(struct net_device *dev)
+{
+	disable_irq(dev->irq);
+	tg3_interrupt (dev->irq, dev, NULL);
+	enable_irq(dev->irq);
+}
+#endif
+
 static void tg3_reset_task(void *_data)
 {
 	struct tg3 *tp = _data;
@@ -7482,6 +7491,10 @@ static struct pci_dev * __devinit tg3_fi
 	return peer;
 }
 
Quoted 5 lines

drivers/net/tg3.c static struct pci_dev * __devinit tg3_fi · line 7496

Quoted 3 lines
drivers/net/tg3.c renamed from drivers/net/tg3.c~tg3-poll +3 -0
+#ifdef HAVE_POLL_CONTROLLER
+static void tg3_poll_controller(struct net_device *dev);
+#endif

This prototype is pointless.

Indeed.

Have an opinion on s/->poll_controller/->netpoll/?

Signature · 1 line
Matt Mackall : http://www.selenic.com : of or relating to the moon
#3 lore raw
Quoted 1 line · Matt Mackall

Have an opinion on s/->poll_controller/->netpoll/?

I have an opinion, yes :) which I despise myself for holding...

I don't like either name, but don't have any better suggestions either, besides something extremely verbose like ->process_hw_events().

"poll_controller" is annoying because (a) it's way too close to NAPI, but (b) it's a reasonably accurate description of what it does.

I think "netpoll" is even worse... It describes who calls it, not what it does.

Jeff

#4 lore raw
Quoted 10 lines · Jeff Garzik
Quoted 1 line · Matt Mackall

Have an opinion on s/->poll_controller/->netpoll/?

I don't like either name, but don't have any better suggestions either, besides something extremely verbose like ->process_hw_events().

"poll_controller" is annoying because (a) it's way too close to NAPI, but (b) it's a reasonably accurate description of what it does.

I think "netpoll" is even worse... It describes who calls it, not what it does.

->polled_io ?

#5 lore raw
Quoted 6 lines · Keith Owens
Quoted 4 lines · Jeff Garzik
Quoted 1 line · Matt Mackall

Have an opinion on s/->poll_controller/->netpoll/?

Quoted 8 lines
Quoted 5 lines

I don't like either name, but don't have any better suggestions either, besides something extremely verbose like ->process_hw_events().

"poll_controller" is annoying because (a) it's way too close to NAPI, but (b) it's a reasonably accurate description of what it does.

I think "netpoll" is even worse... It describes who calls it, not what it does.

->polled_io ?

Not too bad... Better than any suggestion of mine, at any rate :)

Jeff