Skip to contentSkip to conversation

ucc_geth: add support for netpoll

PATCH In review Anton Vorontsov 4 participants 8 messages Oct 11, 2007 – Nov 1, 2007

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

PATCH 1/1 ucc_geth: add support for netpoll

This patch adds netpoll support for the QE UCC Gigabit Ethernet driver. The approach is very similar to the gianfar driver.

Tested using netconsole.

---
 drivers/net/ucc_geth.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
drivers/net/ucc_geth.c +19 -0
index 18a6f48..06807ce 100644
@@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
 	return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * 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.
+ */
+static void ucc_netpoll(struct net_device *dev)
+{
+	struct ucc_geth_private *ugeth = netdev_priv(dev);
+
+	disable_irq(ugeth->ug_info->uf_info.irq);
+	ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
+	enable_irq(ugeth->ug_info->uf_info.irq);
+}
+#endif /* CONFIG_NET_POLL_CONTROLLER */
+
 /* Called when something needs to use the ethernet device */
 /* Returns 0 for success. */
 static int ucc_geth_open(struct net_device *dev)
@@ -3969,6 +3985,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
 	dev->poll = ucc_geth_poll;
 	dev->weight = UCC_GETH_DEV_WEIGHT;
 #endif				/* CONFIG_UGETH_NAPI */
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ucc_netpoll;
+#endif
 	dev->stop = ucc_geth_close;
 	dev->get_stats = ucc_geth_get_stats;
 //    dev->change_mtu = ucc_geth_change_mtu;
Signature · 1 line
1.5.0.6
#1 lore raw

Hello.

Quoted 2 lines · Anton Vorontsov

This patch adds netpoll support for the QE UCC Gigabit Ethernet driver. The approach is very similar to the gianfar driver.

It's rather contrarywise -- this is standard approach and gianfar with its
3 TSEC IRQs has a quite non-standard poll_controller() implementation.

Quoted 1 line

Tested using netconsole.

KGDBoE is considered a better test (I hope you've also tested with it).

Quoted 12 lines
drivers/net/ucc_geth.c +3 -0
index 18a6f48..06807ce 100644
@@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
 	return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs

drivers/net/ucc_geth.c static irqreturn_t ucc_geth_irq_handler(int irq, void *info) · line 3706

Quoted 10 lines
drivers/net/ucc_geth.c +10 -0
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+static void ucc_netpoll(struct net_device *dev)
+{
+	struct ucc_geth_private *ugeth = netdev_priv(dev);
+
+	disable_irq(ugeth->ug_info->uf_info.irq);
+	ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
+	enable_irq(ugeth->ug_info->uf_info.irq);

Why not make it less complex (for a reader and gcc too :-) ?

	struct ucc_geth_private *ugeth = netdev_priv(dev);
	int irq = ugeth->ug_info->uf_info.irq;

	disable_irq(irq);
	ucc_geth_irq_handler(irq, dev);
	enable_irq(irq);

drivers/net/ucc_geth.c static irqreturn_t ucc_geth_irq_handler(int irq, void *info) · line 3712

Quoted 6 lines
drivers/net/ucc_geth.c +3 -0
+}
+#endif /* CONFIG_NET_POLL_CONTROLLER */
+
 /* Called when something needs to use the ethernet device */
 /* Returns 0 for success. */
 static int ucc_geth_open(struct net_device *dev)

WBR, Sergei

#2 lore raw
Quoted 9 lines · Sergei Shtylyov

Hello.

Quoted 2 lines · Anton Vorontsov

This patch adds netpoll support for the QE UCC Gigabit Ethernet driver. The approach is very similar to the gianfar driver.

It's rather contrarywise -- this is standard approach and gianfar with its
3 TSEC IRQs has a quite non-standard poll_controller() implementation.

Oh.. well, right -- gianfar a bit more comlex in that regard.

Quoted 4 lines
Quoted 2 lines

Tested using netconsole.

KGDBoE is considered a better test (I hope you've also tested with it).

At the time of posting it was tested using netconsole only, a few days later it's was tested using KGDBoE also. So, it works indeed.

Quoted 9 lines
Quoted 9 lines
drivers/net/ucc_geth.c +0 -0
index 18a6f48..06807ce 100644
@@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
 	return IRQ_HANDLED;
 }
 
Quoted 15 lines

drivers/net/ucc_geth.c static irqreturn_t ucc_geth_irq_handler(int irq, void *info) · line 3706

Quoted 13 lines
drivers/net/ucc_geth.c +13 -0
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * 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.
+ */
+static void ucc_netpoll(struct net_device *dev)
+{
+	struct ucc_geth_private *ugeth = netdev_priv(dev);
+
+	disable_irq(ugeth->ug_info->uf_info.irq);
+	ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
+	enable_irq(ugeth->ug_info->uf_info.irq);

Why not make it less complex (for a reader and gcc too :-) ?

Yup, I'm agree here but it's too late. Again. ;-)

This patch already accepted into the -mm (a week or so after the silence), so.. now I'd rather not bother Andrew with such really cosmetic changes. But if Jeff would directly apply modfied patch, I'll send it. ;-)

Anyhow, I'm sincerely appreciate your comments.

Thanks,

Signature · 4 lines
Anton Vorontsov
email: [email protected]
backup email: [email protected]
irc://irc.freenode.net/bd2
#3 lore raw
Quoted 60 lines

-----Original Message-----
From: Anton Vorontsov [mailto:[email protected]]
Sent: Saturday, October 27, 2007 10:38 PM
To: Sergei Shtylyov
Cc: Anton Vorontsov; [email protected]; Li Yang-r58472; [email protected]; [email protected]
Subject: Re: [PATCH] ucc_geth: add support for netpoll

Quoted 8 lines · Sergei Shtylyov

Hello.

Quoted 2 lines · Anton Vorontsov

This patch adds netpoll support for the QE UCC Gigabit Ethernet driver. The approach is very similar to the gianfar driver.

It's rather contrarywise -- this is standard approach

and gianfar

Quoted 2 lines

with its
3 TSEC IRQs has a quite non-standard poll_controller()

implementation.

Oh.. well, right -- gianfar a bit more comlex in that regard.

Quoted 4 lines
Quoted 2 lines

Tested using netconsole.

KGDBoE is considered a better test (I hope you've also

tested with it).

At the time of posting it was tested using netconsole only, a few days later it's was tested using KGDBoE also. So, it works indeed.

Quoted 1 line
Quoted 1 line
(quoted diff) +0 -0
Quoted 5 lines

drivers/net/ucc_geth.c static irqreturn_t

Quoted 5 lines

a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 18a6f48..06807ce 100644

drivers/net/ucc_geth.c +0 -0
@@ -3691,6 +3691,22 @@ static irqreturn_t 

ucc_geth_irq_handler(int irq, void *info)

Quoted 18 lines
Quoted 6 lines
drivers/net/ucc_geth.c +3 -0
 	return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send 

drivers/net/ucc_geth.c static irqreturn_t ucc_geth_irq_handler(int irq, void *info) · line 3706

Quoted 10 lines
drivers/net/ucc_geth.c +10 -0
+skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+static void ucc_netpoll(struct net_device *dev) {
+	struct ucc_geth_private *ugeth = netdev_priv(dev);
+
+	disable_irq(ugeth->ug_info->uf_info.irq);
+	ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
+	enable_irq(ugeth->ug_info->uf_info.irq);

Why not make it less complex (for a reader and gcc too :-) ?

Quoted 6 lines

Yup, I'm agree here but it's too late. Again. ;-)

This patch already accepted into the -mm (a week or so after the silence), so.. now I'd rather not bother Andrew with such really cosmetic changes. But if Jeff would directly apply modfied patch, I'll send it. ;-)

Oops. The original patch happened to hit the Junk mail box. :( I think the patch is good to merge after the cosmetic change. I can do it in next pull request to Jeff.

Thanks
- Leo

#4 lore raw

On Mon, Oct 29, 2007 at 02:12:07PM +0800, Li Yang-r58472 wrote:
[...]

Quoted 16 lines
Quoted 16 lines
Quoted 15 lines

Review

Quoted 13 lines
(quoted diff) +13 -0
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * 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.
+ */
+static void ucc_netpoll(struct net_device *dev) {
+	struct ucc_geth_private *ugeth = netdev_priv(dev);
+
+	disable_irq(ugeth->ug_info->uf_info.irq);
+	ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
+	enable_irq(ugeth->ug_info->uf_info.irq);

Why not make it less complex (for a reader and gcc too :-) ?

Quoted 8 lines
Quoted 6 lines

Yup, I'm agree here but it's too late. Again. ;-)

This patch already accepted into the -mm (a week or so after the silence), so.. now I'd rather not bother Andrew with such really cosmetic changes. But if Jeff would directly apply modfied patch, I'll send it. ;-)

Oops. The original patch happened to hit the Junk mail box. :(

That one as well? http://lkml.org/lkml/2007/10/11/128

Quoted 3 lines

I think
the patch is good to merge after the cosmetic change. I can do it in next pull request to Jeff.

Ok, great. Thanks.

Here it is:

- - - -
From: Anton Vorontsov <[email protected]>
Subject: [PATCH] ucc_geth: add support for netpoll

This patch adds netpoll support for the QE UCC Gigabit Ethernet driver. Tested using netconsole and KGDBoE.

---
 drivers/net/ucc_geth.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
drivers/net/ucc_geth.c +20 -0
index bec413b..94e78d8 100644
@@ -3678,6 +3678,23 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
 	return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * 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.
+ */
+static void ucc_netpoll(struct net_device *dev)
+{
+	struct ucc_geth_private *ugeth = netdev_priv(dev);
+	int irq = ugeth->ug_info->uf_info.irq;
+
+	disable_irq(irq);
+	ucc_geth_irq_handler(irq, dev);
+	enable_irq(irq);
+}
+#endif /* CONFIG_NET_POLL_CONTROLLER */
+
 /* Called when something needs to use the ethernet device */
 /* Returns 0 for success. */
 static int ucc_geth_open(struct net_device *dev)
@@ -3963,6 +3980,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
 #ifdef CONFIG_UGETH_NAPI
 	netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT);
 #endif				/* CONFIG_UGETH_NAPI */
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ucc_netpoll;
+#endif
 	dev->stop = ucc_geth_close;
 //    dev->change_mtu = ucc_geth_change_mtu;
 	dev->mtu = 1500;
Signature · 1 line
1.5.2.2
#5 lore raw

On Mon, Oct 29, 2007 at 03:17:44PM +0300, Anton Vorontsov wrote:
[...]

Quoted 9 lines
Quoted 1 line

Oops. The original patch happened to hit the Junk mail box. :(

That one as well? http://lkml.org/lkml/2007/10/11/128

Quoted 3 lines

I think
the patch is good to merge after the cosmetic change. I can do it in next pull request to Jeff.

Ok, great. Thanks.

I'm wondering if you missed that email again. Maybe your mail client/server doing weird things with emails from @ru.mvista.com?

Thanks.

Quoted 54 lines

Here it is:

- - - -
From: Anton Vorontsov <[email protected]>
Subject: [PATCH] ucc_geth: add support for netpoll

This patch adds netpoll support for the QE UCC Gigabit Ethernet driver. Tested using netconsole and KGDBoE.

---
 drivers/net/ucc_geth.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
drivers/net/ucc_geth.c +20 -0
index bec413b..94e78d8 100644
@@ -3678,6 +3678,23 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
 	return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * 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.
+ */
+static void ucc_netpoll(struct net_device *dev)
+{
+	struct ucc_geth_private *ugeth = netdev_priv(dev);
+	int irq = ugeth->ug_info->uf_info.irq;
+
+	disable_irq(irq);
+	ucc_geth_irq_handler(irq, dev);
+	enable_irq(irq);
+}
+#endif /* CONFIG_NET_POLL_CONTROLLER */
+
 /* Called when something needs to use the ethernet device */
 /* Returns 0 for success. */
 static int ucc_geth_open(struct net_device *dev)
@@ -3963,6 +3980,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
 #ifdef CONFIG_UGETH_NAPI
 	netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT);
 #endif				/* CONFIG_UGETH_NAPI */
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	dev->poll_controller = ucc_netpoll;
+#endif
 	dev->stop = ucc_geth_close;
 //    dev->change_mtu = ucc_geth_change_mtu;
 	dev->mtu = 1500;
Signature · 1 line
1.5.2.2
Signature · 4 lines
Anton Vorontsov
email: [email protected]
backup email: [email protected]
irc://irc.freenode.net/bd2
#6 lore raw
Quoted 16 lines

-----Original Message-----
From: Anton Vorontsov [mailto:[email protected]]
Sent: Thursday, November 01, 2007 5:59 AM
To: Li Yang-r58472
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] ucc_geth: add support for netpoll

On Mon, Oct 29, 2007 at 03:17:44PM +0300, Anton Vorontsov wrote:
[...]

Quoted 6 lines
Quoted 1 line

Oops. The original patch happened to hit the Junk mail box. :(

That one as well? http://lkml.org/lkml/2007/10/11/128

Quoted 2 lines

I think
the patch is good to merge after the cosmetic change. I

Quoted 7 lines

can do it

Quoted 3 lines
Quoted 1 line

in next pull request to Jeff.

Ok, great. Thanks.

I'm wondering if you missed that email again. Maybe your mail client/server doing weird things with emails from @ru.mvista.com?

No. I have explicitly add you to the whitelist. :) Please be patient, isn't this patch a new feature which can only be integrated in the merge window? Thanks.

- Leo

#7 lore raw
Quoted 17 lines · On Thu, Nov 01, 2007 at 10:33:24AM +0800, Li Yang-r58472 wrote:
Quoted 17 lines

-----Original Message-----
From: Anton Vorontsov [mailto:[email protected]]
Sent: Thursday, November 01, 2007 5:59 AM
To: Li Yang-r58472
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] ucc_geth: add support for netpoll

On Mon, Oct 29, 2007 at 03:17:44PM +0300, Anton Vorontsov wrote:
[...]

Quoted 6 lines
Quoted 1 line

Oops. The original patch happened to hit the Junk mail box. :(

That one as well? http://lkml.org/lkml/2007/10/11/128

Quoted 2 lines

I think
the patch is good to merge after the cosmetic change. I

can do it

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

in next pull request to Jeff.

Ok, great. Thanks.

I'm wondering if you missed that email again. Maybe your mail client/server doing weird things with emails from @ru.mvista.com?

No. I have explicitly add you to the whitelist. :)

Hehe, thanks. ;-)

Quoted 3 lines

Please be patient,
isn't this patch a new feature which can only be integrated in the merge window?

Sure it is. I didn't mean to "hurry up" you, of course not.

Just wondered if you've solved issues with getting my emails. Such wonders are quite normal if there was a precedent lately. ;-)

Sorry for troubling you,

Signature · 4 lines
Anton Vorontsov
email: [email protected]
backup email: [email protected]
irc://irc.freenode.net/bd2