From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] NetLoop initialization bug
Date: Mon, 30 Mar 2009 07:12:26 +0200 [thread overview]
Message-ID: <49D054BA.1060904@denx.de> (raw)
In-Reply-To: <660c0f820903270059j5642e0dw62489939e4385326@mail.gmail.com>
Hello Michael,
Michael Zaidman wrote:
> Hi Heiko,
>
> The patch "netloop: speed up NetLoop" you delivered
> into the u-boot-2009.03 introduced bug I have described
> below a few days ago. Could you please take a look at
> the proposed fix?
>
Sorry, seems I missed it.
> Thanks,
> Michael
>
> ---------- Forwarded message ----------
> From: Michael Zaidman <michael.zaidman@gmail.com>
> Date: Sun, Mar 22, 2009 at 8:35 PM
> Subject: [U-Boot] [PATCH] NetLoop initialization bug
> To: u-boot at lists.denx.de
>
>
> [U-Boot] [PATCH] NetLoop initialization bug
>
Thanks for catching this.
Your patch doesn;t apply, I get "malformed patch". Before
sending a new one, please have a look at my comments:
>
>
> Upon u-boot's start up the first ping command causes a failure of the
> consequent TFTP command. It happens in the recently added mechanism of
> the NetLoop initialization where initialization of global network parameters is
> separated in the NetInitLoop routine which is called per env_id change.
> Thus, ping request will initialize the network parameters necessary for ping
> operation only, afterwards the env_changed_id will be set to the env_id
> that will prevent all following initialization requests from other protocols.
> The problem is that the initialized by ping subset of network parameters is not
> sufficient for other protocols and particularly for TFTP
> which requires the NetServerIp also.
>
> Signed-off-by: michael.zaidman at gmail.com
>
> diff --git a/net/net.c b/net/net.c
> index a89f6a0..dc98d0f 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -288,64 +288,13 @@ NetInitLoop(proto_t protocol)
> if (env_changed_id == env_id)
> return 0;
>
> - switch (protocol) {
> -#if defined(CONFIG_CMD_NFS)
> - case NFS:
> -#endif
> -#if defined(CONFIG_CMD_PING)
> - case PING:
> -#endif
> -#if defined(CONFIG_CMD_SNTP)
> - case SNTP:
> -#endif
> - case NETCONS:
> - case TFTP:
> - NetCopyIP(&NetOurIP, &bd->bi_ip_addr);
> - NetOurGatewayIP = getenv_IPaddr ("gatewayip");
> - NetOurSubnetMask= getenv_IPaddr ("netmask");
> - NetOurVLAN = getenv_VLAN("vlan");
> - NetOurNativeVLAN = getenv_VLAN("nvlan");
> + NetCopyIP(&NetOurIP, &bd->bi_ip_addr);
> + NetOurGatewayIP = getenv_IPaddr ("gatewayip");
> + NetOurSubnetMask= getenv_IPaddr ("netmask");
> + NetServerIP = getenv_IPaddr ("serverip");
>
The following 2 vars are just used, if CONFIG_CMD_CDP
is used, can we do a "#if defined" around it?
> + NetOurNativeVLAN = getenv_VLAN("nvlan");
> + NetOurVLAN = getenv_VLAN("vlan");
>
[...]
> @@ -443,18 +392,19 @@ restart:
> /* Start with a clean slate... */
> BootpTry = 0;
> NetOurIP = 0;
> - NetServerIP = getenv_IPaddr ("serverip");
> DhcpRequest(); /* Basically same as BOOTP */
> break;
> #endif
>
> case BOOTP:
> BootpTry = 0;
> + NetOurIP = 0;
>
why we need this here?
> BootpRequest ();
> break;
>
> case RARP:
> RarpTry = 0;
> + NetOurIP = 0;
>
also here?
Has this to do something with the bugfix?
bye
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2009-03-30 5:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-22 17:35 [U-Boot] [PATCH] NetLoop initialization bug Michael Zaidman
2009-03-27 7:59 ` Michael Zaidman
2009-03-30 5:12 ` Heiko Schocher [this message]
2009-03-30 7:45 ` Wolfgang Denk
2009-03-30 13:07 ` Michael Zaidman
2009-03-31 6:36 ` Heiko Schocher
2009-03-31 9:30 ` Detlev Zundel
2009-03-31 10:47 ` Michael Zaidman
2009-03-31 16:26 ` Michael Zaidman
2009-04-02 12:47 ` Detlev Zundel
2009-04-02 15:47 ` Michael Zaidman
2009-04-02 21:52 ` Ben Warren
2009-04-03 20:05 ` Wolfgang Denk
2009-04-03 20:20 ` Michael Zaidman
2009-04-03 20:28 ` Wolfgang Denk
2009-04-03 20:41 ` Ben Warren
2009-04-03 20:39 ` Ben Warren
2009-04-03 21:02 ` Michael Zaidman
-- strict thread matches above, loose matches on Subject: below --
2009-04-02 15:25 Michael Zaidman
2009-04-03 20:16 Michael Zaidman
2009-04-03 22:43 Michael Zaidman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49D054BA.1060904@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.