Current-Users archive

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

Re: BNX Double Buffer Allocation



How do I apply the patch?

I went to the /usr/src directory and entered "patch -u <bnx.add_buf",
but it fails.

I just updated the directory, and it still fails.

My version of if_bnx.c is 184251 long.

David

>>> David Young <dyoung%pobox.com@localhost> 8/22/2008 5:19 PM >>>
On Wed, Aug 20, 2008 at 07:26:21PM -0500, David Dudley wrote:
> Just updated -current and installed a new kernel on Sunday.
> 
> Installed on a dual-quad core DELL 1950.  Incredibly fast machine,
but
> I can only use one of the network interfaces.
> 
> I take it there hasn't been any movement on correcting the problem
with
> the double buffer allocation in the bnx(4) driver?
> 
> Still get a system crash in a few seconds.

David,

It looks to me like bnx_get_buf(), which tries to refill the rx buffer
chain almost to capacity, is used inappropriately on the double-buffer
error path.

On the double-buffer error path, mbufs have run out.  bnx_get_buf()
is handed back an mbuf that just came off of the rx chain, to put
back onto the chain.  After it has put that mbuf back onto the chain,
it may try to allocate another mbuf, in order to help fill the chain.
Since that fails, there is a panic.

My solution is to extract a subroutine from bnx_get_buf(),
bnx_add_buf(),
that does the very least work that is necessary to place an rx buffer
back on the chain.  I use bnx_add_buf() instead of bnx_get_buf() to
try
to recover from a failure of bnx_get_buf().

I have attached a patch.  It compiles, but I have not tested it,
because
my Dell 1950 is not plugged in these days.

Dave

-- 
David Young             OJC Technologies
dyoung%ojctech.com@localhost      Urbana, IL * (217) 278-3933 ext 24
BEGIN:VCARD
VERSION:2.1
X-GWTYPE:USER
FN:David Dudley
TEL;WORK:826-1265
ORG:;MIS
TEL;PREF;FAX:880-3741
EMAIL;WORK;PREF;NGW:DavidDu%cctexas.com@localhost
N:Dudley;David
TITLE:Functional Analyst
END:VCARD



Home | Main Index | Thread Index | Old Index