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 19, 2012, at 4:54 PM, Joerg Sonnenberger wrote:

> On Thu, Apr 19, 2012 at 07:45:35PM -0400, Beverly Schwartz wrote:
>> That won't work in this case.  If bnx_get_buf succeeds in getting
>> an mbuf cluster, it then puts it in the rx ring.  If we haven't
>> removed the mbuf first, there will be no place to put the new mbuf.
> 
> That's circular reasoning. There are three places currently using
> bnx_get_buf:
> 
> bnx_init_rx_chain
> bnx_rx_intr
> bnx_tick
> 
> The last one can be dropped with the changed semantic, since the RX ring
> will never be depleted. The rest is solved by properly splitting up the
> actions into allocating a mbuf cluster for the RX ring, loading a
> cluster into the RX ring and unloading an already mapped entry.
> bnx_init_rx_chain wants to the first two in order, bnx_rx_intr wants to
> alloc, if that works: unload and load new cluster.

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.


Home | Main Index | Thread Index | Old Index