[uClinux-dev] [PATCH] fec : drop xmit packets when link down

Philippe De Muyter phdm at macqel.be
Mon Mar 26 11:10:37 EST 2007


Hi Greg,

Currently, when the link is down, we make the kernel save the message to xmit
and try again later.  This is bad, because we eat up memory and, when
the link comes back, we send old messages.  Change that : when the link
is down, pretend the message is sent, but discard it.

Signed-off-by: Philippe De Muyter <phdm at macqel.be>

diff -r f8b279fd0eab drivers/net/fec.c
--- a/drivers/net/fec.c	Mon Mar 19 20:20:56 2007 -0700
+++ b/drivers/net/fec.c	Mon Mar 26 18:02:37 2007 +0200
@@ -316,7 +316,8 @@ fec_enet_start_xmit(struct sk_buff *skb,
 
 	if (!fep->link) {
 		/* Link is down or autonegotiation is in progress. */
-		return 1;
+		dev_kfree_skb(skb);
+		return 0;
 	}
 
 	/* Fill in a Tx ring entry */


More information about the uClinux-dev mailing list