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 9:45 AM, Matt Thomas wrote:

> 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

You are correct, I missed the added loop.

My interfaces still freeze.  Here's what I think the problem is.

If bnx_get_buf fails, we still call bnx_add_buf.  The mbuf gets put back in the 
ring.  We break out of the inner loop, and then end up calling ifp->ip_input, 
which eventually frees the mbuf.

I think there are some other problems with this change:

If there are receive frame problems, the mbuf is put back into the ring, and 
the mbuf is also processed.  This will have the same problem as bnx_get_buf 
failure.  However, in this case, we add processing a packet that probably 
shouldn't be processed.

Further down in the inner loop, we check for a VLAN tag.  This has a continue 
statement.  I believe we will now be in an infinite loop.  (There are some 
other weird outcomes I could posit, but in any case, I think we will have 
undesired behavior.)

I also think there's another bug in the original code.  sc->free_rx_bd is 
incremented before we check if the the mbuf pointer is NULL.  Shouldn't we only 
increment free_rx_bd if we're actually processing a packet?


Home | Main Index | Thread Index | Old Index