[U-Boot] Inefficient code in NetLoop() ?

Wolfgang Denk wd at denx.de
Fri Sep 26 10:28:21 CEST 2008


Dear Stefan,

in message <200809260955.59674.sr at denx.de> you wrote:
> 
> > > > Am I reading this correctly that we  eth_halt()  and  eth_init()  the
> > > > network interface for each and every call to NetLoop?
> > >
> > > Yes, it looks that way.  Ripe for gutting.
> >
> > I didn't have much time to look into the code, so I'm just speculating
> > - maybe this is needed for switching interfaces in case of errors?
> 
> Some ethernet interfaces (e.g. ppc4xx) need to get stopped after the network 
> transaction. Otherwise the interface will continue to DMA data to the buffers 
> and this could break OS booting. So please don't remove the eth_halt() after 
> the transaction is finished.

Agreed, *after* performing the task, i. e. before the network related
command returns to the shell, the network interface  should  be  shut
down. But not right in the middle, in each netloop.

Also, please be aware that we're discussing this in the context of
netconsole, where it actually happens for each and every character
transmitted :-(

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You cannot propel yourself forward by patting yourself on the back.


More information about the U-Boot mailing list