linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Two more pasemi_mac patches for 2.6.26
@ 2008-03-26  1:56 Olof Johansson
  2008-03-26  1:57 ` [PATCH 1/2] pasemi_mac: Jumbo frame bugfixes Olof Johansson
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Olof Johansson @ 2008-03-26  1:56 UTC (permalink / raw)
  To: jgarzik; +Cc: linuxppc-dev, pasemi-linux, netdev

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] pasemi_mac: Jumbo frame bugfixes
  2008-03-26  1:56 [PATCH 0/2] Two more pasemi_mac patches for 2.6.26 Olof Johansson
@ 2008-03-26  1:57 ` Olof Johansson
  2008-03-26  1:58 ` [PATCH 2/2] pasemi_mac: Netpoll support Olof Johansson
  2008-03-26  4:12 ` [PATCH 0/2] Two more pasemi_mac patches for 2.6.26 Jeff Garzik
  2 siblings, 0 replies; 10+ messages in thread
From: Olof Johansson @ 2008-03-26  1:57 UTC (permalink / raw)
  To: jgarzik; +Cc: linuxppc-dev, pasemi-linux, netdev

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 <olof@lixom.net>

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);

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] pasemi_mac: Netpoll support
  2008-03-26  1:56 [PATCH 0/2] Two more pasemi_mac patches for 2.6.26 Olof Johansson
  2008-03-26  1:57 ` [PATCH 1/2] pasemi_mac: Jumbo frame bugfixes Olof Johansson
@ 2008-03-26  1:58 ` Olof Johansson
  2008-03-26 12:41   ` Valentine Barshak
  2008-03-27 22:40   ` [PATCH 2/2 v2] " Olof Johansson
  2008-03-26  4:12 ` [PATCH 0/2] Two more pasemi_mac patches for 2.6.26 Jeff Garzik
  2 siblings, 2 replies; 10+ messages in thread
From: Olof Johansson @ 2008-03-26  1:58 UTC (permalink / raw)
  To: jgarzik; +Cc: linuxppc-dev, pasemi-linux, netdev

Add netpoll support to allow use of netconsole.

Signed-off-by: Nate Case <ncase@xes-inc.com>
Signed-off-by: Olof Johansson <olof@lixom.net>

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;

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/2] Two more pasemi_mac patches for 2.6.26
  2008-03-26  1:56 [PATCH 0/2] Two more pasemi_mac patches for 2.6.26 Olof Johansson
  2008-03-26  1:57 ` [PATCH 1/2] pasemi_mac: Jumbo frame bugfixes Olof Johansson
  2008-03-26  1:58 ` [PATCH 2/2] pasemi_mac: Netpoll support Olof Johansson
@ 2008-03-26  4:12 ` Jeff Garzik
  2008-03-27 19:22   ` Olof Johansson
  2 siblings, 1 reply; 10+ messages in thread
From: Jeff Garzik @ 2008-03-26  4:12 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, pasemi-linux, netdev

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?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] pasemi_mac: Netpoll support
  2008-03-26  1:58 ` [PATCH 2/2] pasemi_mac: Netpoll support Olof Johansson
@ 2008-03-26 12:41   ` Valentine Barshak
  2008-03-26 15:08     ` Olof Johansson
  2008-03-27 22:40   ` [PATCH 2/2 v2] " Olof Johansson
  1 sibling, 1 reply; 10+ messages in thread
From: Valentine Barshak @ 2008-03-26 12:41 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, pasemi-linux, jgarzik, netdev

Olof Johansson wrote:
> Add netpoll support to allow use of netconsole.
> 
> Signed-off-by: Nate Case <ncase@xes-inc.com>
> Signed-off-by: Olof Johansson <olof@lixom.net>
> 
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] pasemi_mac: Netpoll support
  2008-03-26 12:41   ` Valentine Barshak
@ 2008-03-26 15:08     ` Olof Johansson
  0 siblings, 0 replies; 10+ messages in thread
From: Olof Johansson @ 2008-03-26 15:08 UTC (permalink / raw)
  To: Valentine Barshak; +Cc: linuxppc-dev, pasemi-linux, jgarzik, netdev

On Wed, Mar 26, 2008 at 03:41:01PM +0300, Valentine Barshak wrote:
>> +	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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/2] Two more pasemi_mac patches for 2.6.26
  2008-03-26  4:12 ` [PATCH 0/2] Two more pasemi_mac patches for 2.6.26 Jeff Garzik
@ 2008-03-27 19:22   ` Olof Johansson
  2008-03-27 19:41     ` Jeff Garzik
  0 siblings, 1 reply; 10+ messages in thread
From: Olof Johansson @ 2008-03-27 19:22 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linuxppc-dev, pasemi-linux, netdev

On Wed, Mar 26, 2008 at 12:12:30AM -0400, Jeff Garzik wrote:
> 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?

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/2] Two more pasemi_mac patches for 2.6.26
  2008-03-27 19:22   ` Olof Johansson
@ 2008-03-27 19:41     ` Jeff Garzik
  0 siblings, 0 replies; 10+ messages in thread
From: Jeff Garzik @ 2008-03-27 19:41 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, pasemi-linux, netdev

Olof Johansson wrote:
> On Wed, Mar 26, 2008 at 12:12:30AM -0400, Jeff Garzik wrote:
>> 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?
> 
> 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 :)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2 v2] pasemi_mac: Netpoll support
  2008-03-26  1:58 ` [PATCH 2/2] pasemi_mac: Netpoll support Olof Johansson
  2008-03-26 12:41   ` Valentine Barshak
@ 2008-03-27 22:40   ` Olof Johansson
  2008-03-29  2:11     ` Jeff Garzik
  1 sibling, 1 reply; 10+ messages in thread
From: Olof Johansson @ 2008-03-27 22:40 UTC (permalink / raw)
  To: jgarzik; +Cc: linuxppc-dev, pasemi-linux, ncase, netdev

Add netpoll support to allow use of netconsole.
    
Signed-off-by: Nate Case <ncase@xes-inc.com>
Signed-off-by: Olof Johansson <olof@lixom.net>

---
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;

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2 v2] pasemi_mac: Netpoll support
  2008-03-27 22:40   ` [PATCH 2/2 v2] " Olof Johansson
@ 2008-03-29  2:11     ` Jeff Garzik
  0 siblings, 0 replies; 10+ messages in thread
From: Jeff Garzik @ 2008-03-29  2:11 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, pasemi-linux, ncase, netdev

Olof Johansson wrote:
> Add netpoll support to allow use of netconsole.
>     
> Signed-off-by: Nate Case <ncase@xes-inc.com>
> Signed-off-by: Olof Johansson <olof@lixom.net>
> 
> ---
> Changed the interrupt handler arguments as found by Valentine. Will push
> through powerpc.git with Jeff's ACKs (that were already given).
> 
> 
> -Olof

ACK

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-03-29  2:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-26  1:56 [PATCH 0/2] Two more pasemi_mac patches for 2.6.26 Olof Johansson
2008-03-26  1:57 ` [PATCH 1/2] pasemi_mac: Jumbo frame bugfixes Olof Johansson
2008-03-26  1:58 ` [PATCH 2/2] pasemi_mac: Netpoll support Olof Johansson
2008-03-26 12:41   ` Valentine Barshak
2008-03-26 15:08     ` Olof Johansson
2008-03-27 22:40   ` [PATCH 2/2 v2] " Olof Johansson
2008-03-29  2:11     ` Jeff Garzik
2008-03-26  4:12 ` [PATCH 0/2] Two more pasemi_mac patches for 2.6.26 Jeff Garzik
2008-03-27 19:22   ` Olof Johansson
2008-03-27 19:41     ` Jeff Garzik

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).