* [SUNGEM] LLTX support
@ 2004-09-15 6:45 Eric Lemoine
2004-09-15 15:35 ` David S. Miller
0 siblings, 1 reply; 5+ messages in thread
From: Eric Lemoine @ 2004-09-15 6:45 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
[-- Attachment #1: Type: text/plain, Size: 125 bytes --]
The attached patch adds LLTX support to SunGEM NAPI. The tx_lock patch
I just sent must be applied first.
Thanks,
--
Eric
[-- Attachment #2: patch-rset-sungem_lltx-2-6-9-rc1 --]
[-- Type: application/octet-stream, Size: 1765 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/09/15 08:32:25+02:00 eric.lemoine@gmail.com
# [SUNGEM]: add LLTX support to SunGEM
#
# Signed-off-by: Eric Lemoine <eric.lemoine@gmail.com>
#
# drivers/net/sungem.c
# 2004/09/15 08:32:17+02:00 eric.lemoine@gmail.com +10 -4
# [SUNGEM]: add LLTX support to SunGEM
#
# Signed-off-by: Eric Lemoine <eric.lemoine@gmail.com>
#
diff -Nru a/drivers/net/sungem.c b/drivers/net/sungem.c
--- a/drivers/net/sungem.c 2004-09-15 08:38:20 +02:00
+++ b/drivers/net/sungem.c 2004-09-15 08:38:20 +02:00
@@ -942,6 +942,7 @@
struct gem *gp = dev->priv;
int entry;
u64 ctrl;
+ unsigned long flags;
ctrl = 0;
if (skb->ip_summed == CHECKSUM_HW) {
@@ -955,12 +956,17 @@
(csum_stuff_off << 21));
}
- spin_lock_irq(&gp->tx_lock);
+ local_irq_save(flags);
+ if (!spin_trylock(&gp->tx_lock)) {
+ /* Tell upper layer to requeue */
+ local_irq_restore(flags);
+ return -1;
+ }
/* This is a hard error, log it. */
if (TX_BUFFS_AVAIL(gp) <= (skb_shinfo(skb)->nr_frags + 1)) {
netif_stop_queue(dev);
- spin_unlock_irq(&gp->tx_lock);
+ spin_unlock_irqrestore(&gp->tx_lock, flags);
printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n",
dev->name);
return 1;
@@ -1047,7 +1053,7 @@
dev->name, entry, skb->len);
mb();
writel(gp->tx_new, gp->regs + TXDMA_KICK);
- spin_unlock_irq(&gp->tx_lock);
+ spin_unlock_irqrestore(&gp->tx_lock, flags);
dev->trans_start = jiffies;
@@ -2960,7 +2966,7 @@
pci_set_drvdata(pdev, dev);
/* GEM can do it all... */
- dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
+ dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_LLTX;
if (pci_using_dac)
dev->features |= NETIF_F_HIGHDMA;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [SUNGEM] LLTX support
2004-09-15 6:45 [SUNGEM] LLTX support Eric Lemoine
@ 2004-09-15 15:35 ` David S. Miller
2004-09-15 15:55 ` Eric Lemoine
2004-09-15 21:43 ` Eric Lemoine
0 siblings, 2 replies; 5+ messages in thread
From: David S. Miller @ 2004-09-15 15:35 UTC (permalink / raw)
To: Eric Lemoine; +Cc: netdev
On Wed, 15 Sep 2004 08:45:21 +0200
Eric Lemoine <eric.lemoine@gmail.com> wrote:
> The attached patch adds LLTX support to SunGEM NAPI. The tx_lock patch
> I just sent must be applied first.
Also applied, thanks Eric.
I remember you mentioning yesterday that Harald's sungem NAPI
patch had netpoll support, can you cook up a patch that adds
it for current sungem?
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [SUNGEM] LLTX support
2004-09-15 15:35 ` David S. Miller
@ 2004-09-15 15:55 ` Eric Lemoine
2004-09-15 21:43 ` Eric Lemoine
1 sibling, 0 replies; 5+ messages in thread
From: Eric Lemoine @ 2004-09-15 15:55 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
On Wed, 15 Sep 2004 08:35:59 -0700, David S. Miller <davem@davemloft.net> wrote:
> On Wed, 15 Sep 2004 08:45:21 +0200
> Eric Lemoine <eric.lemoine@gmail.com> wrote:
>
> > The attached patch adds LLTX support to SunGEM NAPI. The tx_lock patch
> > I just sent must be applied first.
>
> Also applied, thanks Eric.
>
> I remember you mentioning yesterday that Harald's sungem NAPI
> patch had netpoll support, can you cook up a patch that adds
> it for current sungem?
Can't do it right now but will do it soon...
--
Eric
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [SUNGEM] LLTX support
2004-09-15 15:35 ` David S. Miller
2004-09-15 15:55 ` Eric Lemoine
@ 2004-09-15 21:43 ` Eric Lemoine
2004-09-16 20:13 ` David S. Miller
1 sibling, 1 reply; 5+ messages in thread
From: Eric Lemoine @ 2004-09-15 21:43 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
[-- Attachment #1: Type: text/plain, Size: 647 bytes --]
On Wed, 15 Sep 2004 08:35:59 -0700, David S. Miller <davem@davemloft.net> wrote:
> On Wed, 15 Sep 2004 08:45:21 +0200
> Eric Lemoine <eric.lemoine@gmail.com> wrote:
>
> > The attached patch adds LLTX support to SunGEM NAPI. The tx_lock patch
> > I just sent must be applied first.
>
> Also applied, thanks Eric.
>
> I remember you mentioning yesterday that Harald's sungem NAPI
> patch had netpoll support, can you cook up a patch that adds
> it for current sungem?
Patch attached. Unlike Harald's, this patch doesn't disable_irq before
calling gem_interrupt because gem_interrupt is safe to reentrance.
Hopefully this is correct...
--
Eric
[-- Attachment #2: rset-sungem_netpoll-2-6-9-rc1.patch --]
[-- Type: application/octet-stream, Size: 1486 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/09/15 23:37:24+02:00 eric.lemoine@gmail.com
# [SUNGEM] netpoll support
#
# Signed-off-by: Eric Lemoine <eric.lemoine@gmail.com>
#
# drivers/net/sungem.c
# 2004/09/15 23:37:15+02:00 eric.lemoine@gmail.com +16 -0
# [SUNGEM] netpoll support
#
# Signed-off-by: Eric Lemoine <eric.lemoine@gmail.com>
#
diff -Nru a/drivers/net/sungem.c b/drivers/net/sungem.c
--- a/drivers/net/sungem.c 2004-09-15 23:38:12 +02:00
+++ b/drivers/net/sungem.c 2004-09-15 23:38:12 +02:00
@@ -5,6 +5,9 @@
*
* Support for Apple GMAC and assorted PHYs by
* Benjamin Herrenscmidt (benh@kernel.crashing.org)
+ *
+ * NAPI and NETPOLL support
+ * (C) 2004 by Eric Lemoine (eric.lemoine@gmail.com)
*
* TODO:
* - Get rid of all those nasty mdelay's and replace them
@@ -898,6 +901,16 @@
return IRQ_HANDLED;
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void gem_poll_controller(struct net_device *dev)
+{
+ /* gem_interrupt is safe to reentrance so no need
+ * to disable_irq here.
+ */
+ gem_interrupt(dev->irq, dev, NULL);
+}
+#endif
+
static void gem_tx_timeout(struct net_device *dev)
{
struct gem *gp = dev->priv;
@@ -2934,6 +2947,9 @@
dev->change_mtu = gem_change_mtu;
dev->irq = pdev->irq;
dev->dma = 0;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ dev->poll_controller = gem_poll_controller;
+#endif
if (register_netdev(dev)) {
printk(KERN_ERR PFX "Cannot register net device, "
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [SUNGEM] LLTX support
2004-09-15 21:43 ` Eric Lemoine
@ 2004-09-16 20:13 ` David S. Miller
0 siblings, 0 replies; 5+ messages in thread
From: David S. Miller @ 2004-09-16 20:13 UTC (permalink / raw)
To: Eric Lemoine; +Cc: netdev
On Wed, 15 Sep 2004 23:43:16 +0200
Eric Lemoine <eric.lemoine@gmail.com> wrote:
> On Wed, 15 Sep 2004 08:35:59 -0700, David S. Miller <davem@davemloft.net> wrote:
> > On Wed, 15 Sep 2004 08:45:21 +0200
> > Eric Lemoine <eric.lemoine@gmail.com> wrote:
> >
> > > The attached patch adds LLTX support to SunGEM NAPI. The tx_lock patch
> > > I just sent must be applied first.
> >
> > Also applied, thanks Eric.
> >
> > I remember you mentioning yesterday that Harald's sungem NAPI
> > patch had netpoll support, can you cook up a patch that adds
> > it for current sungem?
>
> Patch attached. Unlike Harald's, this patch doesn't disable_irq before
> calling gem_interrupt because gem_interrupt is safe to reentrance.
Looks fine to me. Patch applied, thanks Eric.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-09-16 20:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-15 6:45 [SUNGEM] LLTX support Eric Lemoine
2004-09-15 15:35 ` David S. Miller
2004-09-15 15:55 ` Eric Lemoine
2004-09-15 21:43 ` Eric Lemoine
2004-09-16 20:13 ` David S. Miller
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).