netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/gianfar: drop recycled skbs on MTU change
@ 2010-05-03 15:17 Sebastian Andrzej Siewior
  2010-05-03 22:29 ` David Miller
  2010-05-04 15:29 ` Andy Fleming
  0 siblings, 2 replies; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2010-05-03 15:17 UTC (permalink / raw)
  To: Andy Fleming; +Cc: netdev

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

The size for skb which is added to the recycled list is using the
current descriptor size which is current MTU. gfar_new_skb() is also
using this size. So after changing or alteast increasing the MTU all
recycled skbs should be dropped.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
I'm not 100% sure but it looks like it is wrong.

 drivers/net/gianfar.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 5267c27..9093106 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -2287,8 +2287,10 @@ static int gfar_change_mtu(struct net_device *dev, int new_mtu)
 
 	/* Only stop and start the controller if it isn't already
 	 * stopped, and we changed something */
-	if ((oldsize != tempsize) && (dev->flags & IFF_UP))
+	if ((oldsize != tempsize) && (dev->flags & IFF_UP)) {
 		stop_gfar(dev);
+		skb_queue_purge(&priv->rx_recycle);
+	}
 
 	priv->rx_buffer_size = tempsize;
 
-- 
1.6.6.1

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

end of thread, other threads:[~2010-05-06  7:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-03 15:17 [PATCH] net/gianfar: drop recycled skbs on MTU change Sebastian Andrzej Siewior
2010-05-03 22:29 ` David Miller
2010-05-04 15:29 ` Andy Fleming
2010-05-05  7:57   ` David Miller
2010-05-05  8:30     ` [PATCH v2] " Sebastian Andrzej Siewior
2010-05-05 15:18       ` Andy Fleming
2010-05-06  7:26         ` David 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).