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

Michael Broughton mbobowik at telusplanet.net
Mon Mar 26 18:09:14 EST 2007


netif_wake_queue()

The kernel documentation and LDD3 cover this stuff quite thoroughly.

Mike


Philippe De Muyter wrote:
> 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
>>     
>
>   


More information about the uClinux-dev mailing list