[PATCH 0/2] Two more pasemi_mac patches for 2.6.26
From: Olof Johansson <hidden>
Date: 2008-03-26 01:56:25
Subsystems: linux for powerpc (32-bit and 64-bit), networking drivers, the rest · Maintainers: Madhavan Srinivasan, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds
Series: 2 patches touching 1 file, +33/-2
10 messages, 3 authors, 2008-03-29 · open the first message on its own page
From: Olof Johansson <hidden>
Date: 2008-03-26 01:56:25
Hi Jeff, The below two patches go on top of the previous patches that were acked by you but applied to pasemi.git for feed up through powerpc.git. One is a couple of fixes for various corner cases in the jumbo support configuration. The second is addition of netpoll support, from Nate Case. Review/ack would be appreciated, I'll feed them up the same path as the other changes. -Olof
From: Olof Johansson <hidden>
Date: 2008-03-26 01:57:10
Fix a couple of corner cases around interface up/down when jumbo frames are
configured. Resources weren't always freed and reallocated properly.
Signed-off-by: Olof Johansson <redacted>
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index c50f0f4..abb1dc4 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c@@ -404,6 +404,7 @@ static void pasemi_mac_free_csring(struct pasemi_mac_csring *csring) pasemi_dma_free_flag(csring->events[1]); pasemi_dma_free_ring(&csring->chan); pasemi_dma_free_chan(&csring->chan); + pasemi_dma_free_fun(csring->fun); } static int pasemi_mac_setup_rx_resources(const struct net_device *dev)
@@ -1150,7 +1151,10 @@ static int pasemi_mac_open(struct net_device *dev) if (!mac->tx) goto out_tx_ring; - if (dev->mtu > 1500) { + /* We might already have allocated rings in case mtu was changed + * before interface was brought up. + */ + if (dev->mtu > 1500 && !mac->num_cs) { pasemi_mac_setup_csrings(mac); if (!mac->num_cs) goto out_tx_ring;
@@ -1388,8 +1392,12 @@ static int pasemi_mac_close(struct net_device *dev) free_irq(mac->tx->chan.irq, mac->tx); free_irq(mac->rx->chan.irq, mac->rx); - for (i = 0; i < mac->num_cs; i++) + for (i = 0; i < mac->num_cs; i++) { pasemi_mac_free_csring(mac->cs[i]); + mac->cs[i] = NULL; + } + + mac->num_cs = 0; /* Free resources */ pasemi_mac_free_rx_resources(mac);
From: Olof Johansson <hidden>
Date: 2008-03-26 01:58:01
Add netpoll support to allow use of netconsole. Signed-off-by: Nate Case <redacted> Signed-off-by: Olof Johansson <redacted>
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index abb1dc4..6030ffe 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c@@ -1648,6 +1648,26 @@ static int pasemi_mac_poll(struct napi_struct *napi, int budget) return pkts; } +#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 pasemi_mac_netpoll(struct net_device *dev) +{ + const struct pasemi_mac *mac = netdev_priv(dev); + + disable_irq(mac->tx->chan.irq); + pasemi_mac_tx_intr(mac->tx->chan.irq, mac->tx); + enable_irq(mac->tx->chan.irq); + + disable_irq(mac->rx->chan.irq); + pasemi_mac_rx_intr(mac->rx->chan.irq, dev); + enable_irq(mac->rx->chan.irq); +} +#endif + static int pasemi_mac_change_mtu(struct net_device *dev, int new_mtu) { struct pasemi_mac *mac = netdev_priv(dev);
@@ -1807,6 +1827,9 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent) dev->mtu = PE_DEF_MTU; /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */ mac->bufsz = dev->mtu + ETH_HLEN + ETH_FCS_LEN + LOCAL_SKB_ALIGN + 128; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = pasemi_mac_netpoll; +#endif dev->change_mtu = pasemi_mac_change_mtu; dev->ethtool_ops = &pasemi_mac_ethtool_ops;
From: Jeff Garzik <hidden>
Date: 2008-03-26 04:12:30
Olof Johansson wrote:
Hi Jeff, The below two patches go on top of the previous patches that were acked by you but applied to pasemi.git for feed up through powerpc.git. One is a couple of fixes for various corner cases in the jumbo support configuration. The second is addition of netpoll support, from Nate Case. Review/ack would be appreciated, I'll feed them up the same path as the other changes.
ACK 1-2, though I would consider closely patch #2, whether you need disable_irq() or spin_lock_irqsave() -- which is best for your specific driver + platform?
From: Valentine Barshak <hidden>
Date: 2008-03-26 12:41:01
Olof Johansson wrote:
Add netpoll support to allow use of netconsole. Signed-off-by: Nate Case <redacted> Signed-off-by: Olof Johansson <redacted>diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index abb1dc4..6030ffe 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c@@ -1648,6 +1648,26 @@ static int pasemi_mac_poll(struct napi_struct *napi, int budget) return pkts; } +#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 pasemi_mac_netpoll(struct net_device *dev) +{ + const struct pasemi_mac *mac = netdev_priv(dev); + + disable_irq(mac->tx->chan.irq); + pasemi_mac_tx_intr(mac->tx->chan.irq, mac->tx); + enable_irq(mac->tx->chan.irq); + + disable_irq(mac->rx->chan.irq); + pasemi_mac_rx_intr(mac->rx->chan.irq, dev);
Shouldn't this actually be pasemi_mac_rx_intr(mac->rx->chan.irq, mac->rx)? Thanks, Valentine.
_______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
From: Olof Johansson <hidden>
Date: 2008-03-26 15:08:28
On Wed, Mar 26, 2008 at 03:41:01PM +0300, Valentine Barshak wrote:
quoted
+ pasemi_mac_tx_intr(mac->tx->chan.irq, mac->tx); + enable_irq(mac->tx->chan.irq); + + disable_irq(mac->rx->chan.irq); + pasemi_mac_rx_intr(mac->rx->chan.irq, dev);Shouldn't this actually be pasemi_mac_rx_intr(mac->rx->chan.irq, mac->rx)?
Yeah, it should. It used to take the netdev pointer instead. And the void * argument means I never got a compiler warning from it. Thanks! -Olof
From: Olof Johansson <hidden>
Date: 2008-03-27 19:22:04
On Wed, Mar 26, 2008 at 12:12:30AM -0400, Jeff Garzik wrote:
Olof Johansson wrote:quoted
Hi Jeff, The below two patches go on top of the previous patches that were acked by you but applied to pasemi.git for feed up through powerpc.git. One is a couple of fixes for various corner cases in the jumbo support configuration. The second is addition of netpoll support, from Nate Case. Review/ack would be appreciated, I'll feed them up the same path as the other changes.ACK 1-2, though I would consider closely patch #2, whether you need disable_irq() or spin_lock_irqsave() -- which is best for your specific driver + platform?
I'm tempted to leave the disable/enable_irq() in there. It's certainly heavier than doing cpu-side irq masking, but adding a spinlock to the common interrupt path seems worse to me. I didn't think we considered the polling to be a hot path anyway... -Olof
From: Jeff Garzik <hidden>
Date: 2008-03-27 19:41:19
Olof Johansson wrote:
On Wed, Mar 26, 2008 at 12:12:30AM -0400, Jeff Garzik wrote:quoted
Olof Johansson wrote:quoted
Hi Jeff, The below two patches go on top of the previous patches that were acked by you but applied to pasemi.git for feed up through powerpc.git. One is a couple of fixes for various corner cases in the jumbo support configuration. The second is addition of netpoll support, from Nate Case. Review/ack would be appreciated, I'll feed them up the same path as the other changes.ACK 1-2, though I would consider closely patch #2, whether you need disable_irq() or spin_lock_irqsave() -- which is best for your specific driver + platform?I'm tempted to leave the disable/enable_irq() in there. It's certainly heavier than doing cpu-side irq masking, but adding a spinlock to the common interrupt path seems worse to me. I didn't think we considered the polling to be a hot path anyway...
Definitely not a hot path :)
From: Olof Johansson <hidden>
Date: 2008-03-27 22:40:07
Add netpoll support to allow use of netconsole.
Signed-off-by: Nate Case <redacted>
Signed-off-by: Olof Johansson <redacted>
---
Changed the interrupt handler arguments as found by Valentine. Will push
through powerpc.git with Jeff's ACKs (that were already given).
-Olof
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index abb1dc4..965f2e4 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c@@ -1648,6 +1648,26 @@ static int pasemi_mac_poll(struct napi_struct *napi, int budget) return pkts; } +#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 pasemi_mac_netpoll(struct net_device *dev) +{ + const struct pasemi_mac *mac = netdev_priv(dev); + + disable_irq(mac->tx->chan.irq); + pasemi_mac_tx_intr(mac->tx->chan.irq, mac->tx); + enable_irq(mac->tx->chan.irq); + + disable_irq(mac->rx->chan.irq); + pasemi_mac_rx_intr(mac->rx->chan.irq, mac->rx); + enable_irq(mac->rx->chan.irq); +} +#endif + static int pasemi_mac_change_mtu(struct net_device *dev, int new_mtu) { struct pasemi_mac *mac = netdev_priv(dev);
@@ -1807,6 +1827,9 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent) dev->mtu = PE_DEF_MTU; /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */ mac->bufsz = dev->mtu + ETH_HLEN + ETH_FCS_LEN + LOCAL_SKB_ALIGN + 128; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = pasemi_mac_netpoll; +#endif dev->change_mtu = pasemi_mac_change_mtu; dev->ethtool_ops = &pasemi_mac_ethtool_ops;
From: Jeff Garzik <hidden>
Date: 2008-03-29 02:11:21
Olof Johansson wrote:
Add netpoll support to allow use of netconsole.
Signed-off-by: Nate Case <redacted>
Signed-off-by: Olof Johansson <redacted>
---
Changed the interrupt handler arguments as found by Valentine. Will push
through powerpc.git with Jeff's ACKs (that were already given).
-OlofACK