Subject: Re: [PATCH v5 2/2] Ethernet driver for the WIZnet W5100 chip

From: Mike Sinkovsky <[email-masked]>
Date: Sat, 31 Mar 2012 15:52:37 +0600

30.03.2012 15:23, Eric Dumazet написал:

>> +static int w5100_start_tx(struct sk_buff *skb, struct net_device *ndev)
>> +{
>> +	struct w5100_priv *priv = netdev_priv(ndev);
>> +	u16 offset;
>> +
>> +	if (w5100_read16(priv, W5100_S0_TX_FSR)<  skb->len) {
>
> There is a race here.
> Interrupt came come right here before you set the stop_queue()
>
>> +		netif_stop_queue(ndev);
>
> So Here I suggest adding a test again
> 	
> 	if (w5100_read16(priv, W5100_S0_TX_FSR)>= skb->len)
> 		netif_wake_queue(ndev);
> 	else
> 		return NETDEV_TX_BUSY;
>
>> +		return NETDEV_TX_BUSY;

Maybe, but I cannot test this, sorry - when I set breakpoint on this 
branch - it never triggered, on all my tests on all boards.
Appears that my processor is too slow and cannot feed packets fast enough.

But will do, maybe it triggers for someone on fastest processors.

-- 
Mike