All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] Inefficient code in NetLoop() ?
@ 2008-09-12 19:50 Wolfgang Denk
  2008-09-26  6:09 ` Ben Warren
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2008-09-12 19:50 UTC (permalink / raw)
  To: u-boot

Dear Ben,

I just ran over this piece of code in NetLoop() [see "net/net.c"]:

 286 int
 287 NetLoop(proto_t protocol)
 288 {
 ...
 322         eth_halt();
 323 #ifdef CONFIG_NET_MULTI
 324         eth_set_current();
 325 #endif
 326         if (eth_init(bd) < 0) {
 327                 eth_halt();
 328                 return(-1);
 329         }

Am I reading this correctly that we  eth_halt()  and  eth_init()  the
network interface for each and every call to NetLoop?

This looks terribly inefficient to me - is there any rationale behind
this?

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() ?

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@denx.de
All easy problems have already been solved.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-09-26  8:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-12 19:50 [U-Boot] Inefficient code in NetLoop() ? Wolfgang Denk
2008-09-26  6:09 ` Ben Warren
2008-09-26  7:36   ` Wolfgang Denk
2008-09-26  7:55     ` Stefan Roese
2008-09-26  8:14       ` Rafal Jaworowski
2008-09-26  8:28       ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.