tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: BNX driver problem when mbuf clusters run out



On Apr 20, 2012, at 3:29 AM, Beverly Schwartz wrote:

> 
> On Apr 20, 2012, at 1:27 AM, Matt Thomas wrote:
> 
>> 
>> On Apr 19, 2012, at 6:48 PM, Beverly Schwartz wrote:
>> 
>>> 
>>> On Apr 19, 2012, at 8:27 PM, Matt Thomas wrote:
>>> 
>>>> 
>>>> On Apr 19, 2012, at 5:08 PM, Beverly Schwartz wrote:
>>>> 
>>>>> 
>>>>> On Apr 19, 2012, at 8:02 PM, Matt Thomas wrote:
>>>>>> 
>>>>>> Unfortunately, that can lead to receiver livelock (spend all the time 
>>>>>> servicing interrupts without making progress).  The best thing to do is 
>>>>>> pass the packet up the stack and just another packet to the hardware.  
>>>>>> Instead use bnx_tick to add mbufs if needed.  This gives the stack a 
>>>>>> chance to run and hopefully free some mbufs.
>>>>> 
>>>>> I tried that.  And at first, things move along.  But eventually, 
>>>>> bnx_rx_intr never gets called, because 
>>>>> if (sblk->status_rx_quick_consumer_index0 != sc->nw_rx_cons)
>>>>> in bnx_intr always fails.
>>>> 
>>>> For now, can you try the patch at
>>>> 
>>>> http://www.netbsd.org/~matt/if_bnx-diff.txt
>>>> 
>>>> It's kind of ugly but it is a minimal change.
>>> 
>>> Doesn't quite do it.  With this change, the sw_cons index doesn't get 
>>> incremented.  Next time bnx_rx_intr is called, we'll have the same 
>>> overwrite problem.  I'm now trying incremeing sw_cons before calling break. 
>>>  When I left work, it was still running.  Tomorrow morning, I'll see if 
>>> everything is still intact.
>> 
>> It should get incremented since 
>> 
>>      sw_cons = NEXT_RX_BD(sw_cons);
>> 
>> is after the loop.
> 
> It's after the if conditional.  It's still in the loop.

I don't think you applied the patch properly.

The "if" for testing the mbuf was changed to a while loop so the breaks 
just terminate that loop.  

The patch has been updated a bit to include a missing bus_dmamap_sync


Home | Main Index | Thread Index | Old Index