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

Philippe De Muyter phdm at macqel.be
Mon Mar 26 17:42:11 EST 2007


On Mon, Mar 26, 2007 at 10:32:25AM -0600, Michael Broughton wrote:
> Hi Philippe,
> 
> If the link goes down, netif_tx_disable() should be called. Then you 
> wouldn't have to worry about your hard_start_xmit function being called 
> when the link is known to be down.

Is there also a netif_tx_enable() ?

Philippe

> 
> Mike
> 
> 
> 
> Philippe De Muyter wrote:
> >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 */
> >_______________________________________________
> >uClinux-dev mailing list
> >uClinux-dev at uclinux.org
> >http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> >This message was resent by uclinux-dev at uclinux.org
> >To unsubscribe see:
> >http://mailman.uclinux.org/mailman/options/uclinux-dev
> >
> >  
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org
> To unsubscribe see:
> http://mailman.uclinux.org/mailman/options/uclinux-dev

-- 
Philippe De Muyter  phdm at macqel dot be  Tel +32 27029044
Macq Electronique SA  rue de l'Aeronef 2  B-1140 Bruxelles  Fax +32 27029077


More information about the uClinux-dev mailing list