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

Wolfgang Denk wd at denx.de
Fri Sep 26 09:36:53 CEST 2008


Dear Ben Warren,

In message <48DC7CAD.9040502 at gmail.com> 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?

> > This looks terribly inefficient to me - is there any rationale behind
> > this?
>
> Probably, but it escapes me.  It most certainly predates my involvement 
> in this project.

I should know, but if I ever understood that part of the code, I have
completely forgotten about it ;-)

> > Also, the eth_set_current() checking should IMHO be done  just  once,
> > before  we  start  a  network  transfer,  or  when we actually switch
> > interfaces, but not for each and every call to NetLoop() ?
>
> Maybe, but eth_set_current() is pretty lightweight.  NetLoop is only 
> called when we start a network transfer, so this doesn't seem too 
> egregious.  It could definitely stand to be refactored.

Do you plan to have a closer look on this in some near future?

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
Unix: Some say the learning curve is steep,  but  you  only  have  to
climb it once.                                      - Karl Lehenbauer


More information about the U-Boot mailing list