[U-Boot] [RFC] - sanve the server's mac address...

Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :)
This sets the evn var "serveraddr" (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to....
addnetconsole=set bootargs $(bootargs) netconsole=@$(ipaddr)/eth0,@$(serverip)/$(serveraddr)
I'm sure this is white space damaged - but you get the idea...
Index: net/net.c =================================================================== --- net/net.c (revision 1961) +++ net/net.c (working copy) @@ -1273,6 +1273,15 @@ /* are we waiting for a reply */ if (!NetArpWaitPacketIP || !NetArpWaitPacketMAC) break; + +#ifdef CONFIG_KEEP_SERVERADDR + if (NetServerIP == NetArpWaitPacketIP) { + char buf[20]; + sprintf(buf, "%pM", arp->ar_data); + setenv("serveraddr", buf); + } +#endif + #ifdef ET_DEBUG printf("Got ARP REPLY, set server/gtwy eth addr (%pM)\n", arp->ar_data)

On Wed 8 Jul 2009 14:50, Robin Getz pondered:
Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :)
This sets the evn var "serveraddr" (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to....
addnetconsole=set bootargs $(bootargs) netconsole=@$(ipaddr)/eth0,@$(serverip)/$(serveraddr)
I'm sure this is white space damaged - but you get the idea...
Wolfgang - did you want me to push this through the Blackfin tree (via Mike) or wait for Ben?
Index: net/net.c
--- net/net.c (revision 1961) +++ net/net.c (working copy) @@ -1273,6 +1273,15 @@ /* are we waiting for a reply */ if (!NetArpWaitPacketIP || !NetArpWaitPacketMAC) break;
+#ifdef CONFIG_KEEP_SERVERADDR
if (NetServerIP == NetArpWaitPacketIP) {
char buf[20];
sprintf(buf, "%pM", arp->ar_data);
setenv("serveraddr", buf);
}
+#endif
#ifdef ET_DEBUG printf("Got ARP REPLY, set server/gtwy eth addr (%pM)\n", arp->ar_data) _______________________________________________

On Thursday 09 July 2009 11:12:47 Robin Getz wrote:
On Wed 8 Jul 2009 14:50, Robin Getz pondered:
Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :)
This sets the evn var "serveraddr" (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to....
addnetconsole=set bootargs $(bootargs) netconsole=@$(ipaddr)/eth0,@$(serverip)/$(serveraddr)
I'm sure this is white space damaged - but you get the idea...
Wolfgang - did you want me to push this through the Blackfin tree (via Mike) or wait for Ben?
all net stuff goes through Ben -mike

Dear Robin Getz,
In message 200907091112.47264.rgetz@blackfin.uclinux.org you wrote:
On Wed 8 Jul 2009 14:50, Robin Getz pondered:
Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :)
This sets the evn var "serveraddr" (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to....
addnetconsole=set bootargs $(bootargs) netconsole=@$(ipaddr)/eth0,@$(serverip)/$(serveraddr)
I'm sure this is white space damaged - but you get the idea...
Wolfgang - did you want me to push this through the Blackfin tree (via Mike) or wait for Ben?
If at all this has to go through Ben and his tree.
Note though that I don't think this is intended for inclusion yet - mind the "RFC" part in the subject.
Best regards,
Wolfgang Denk

On Thu 9 Jul 2009 15:45, Wolfgang Denk pondered:
Dear Robin Getz,
In message 200907091112.47264.rgetz@blackfin.uclinux.org you wrote:
On Wed 8 Jul 2009 14:50, Robin Getz pondered:
Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :)
This sets the evn var "serveraddr" (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to....
addnetconsole=set bootargs $(bootargs) netconsole=@$(ipaddr)/eth0,@$(serverip)/$(serveraddr)
I'm sure this is white space damaged - but you get the idea...
Wolfgang - did you want me to push this through the Blackfin tree (via Mike) or wait for Ben?
If at all
?
Do you have some comments on it? - if so - that is that the RFC is for...
this has to go through Ben and his tree.
Note though that I don't think this is intended for inclusion yet - mind the "RFC" part in the subject.
I guess - what is the "reasonable" amount of time to wait for a comment before I just resend with a [PATCH] subject line?

Dear Robin Getz,
In message 200907091603.42609.rgetz@blackfin.uclinux.org you wrote:
Do you have some comments on it? - if so - that is that the RFC is for...
It's oK with me. Just fix the typo ("evn var"), please.
I guess - what is the "reasonable" amount of time to wait for a comment before I just resend with a [PATCH] subject line?
3...4 working days or so.
Best regards,
Wolfgang Denk

Dear Robin,
In message 20090709205116.E4E26832E416@gemini.denx.de I wrote:
It's oK with me. Just fix the typo ("evn var"), please.
And the "sanve" typo, too, of course.
Best regards,
Wolfgang Denk

Hi Robin,
Robin Getz wrote: <snip>
I guess - what is the "reasonable" amount of time to wait for a comment before I just resend with a [PATCH] subject line?
Like Wolfgang says, a few days is probably reasonable. Generally, if you post something as RFC and it's controversial, you'll hear back quickly. Protracted silence means "go ahead and post as a real patch".
In this case, fix the typos and make sure it's not WS-damaged and I'll try to pick it up quickly.
regards, Ben

From: Robin Getz rgetz@blackfin.uclinux.org
Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :)
This sets the env var "serveraddr" (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to....
addnetconsole=set bootargs $(bootargs) netconsole=@$(ipaddr)/eth0,@$(serverip)/$(serveraddr)
Signed-of-by: Robin Getz rgetz@blackfin.uclinux.org
---
Index: net/net.c =================================================================== --- net/net.c (revision 1968) +++ net/net.c (working copy) @@ -1273,6 +1274,15 @@ /* are we waiting for a reply */ if (!NetArpWaitPacketIP || !NetArpWaitPacketMAC) break; + +#ifdef CONFIG_KEEP_SERVERADDR + if (NetServerIP == NetArpWaitPacketIP) { + char buf[20]; + sprintf(buf, "%pM", arp->ar_data); + setenv("serveraddr", buf); + } +#endif + #ifdef ET_DEBUG printf("Got ARP REPLY, set server/gtwy eth addr (%pM)\n", arp->ar_data);
Index: README =================================================================== --- README (revision 1968) +++ README (working copy) @@ -1165,6 +1165,11 @@ Defines a default value for the IP address of a TFTP server to contact when using the "tftboot" command.
+ CONFIG_KEEP_SERVERADDR + + Keeps the server's MAC address, in the env 'serveraddr' + for passing to bootargs (like Linux's netconsole option) + - Multicast TFTP Mode: CONFIG_MCAST_TFTP

On Monday 13 July 2009 16:19:51 Robin Getz wrote:
CONFIG_KEEP_SERVERADDR
Keeps the server's MAC address, in the env 'serveraddr'
for passing to bootargs (like Linux's netconsole option)
is a config option really necessary ? i'd say just add it for everyone -mike

On Wed 15 Jul 2009 11:00, Mike Frysinger pondered:
On Monday 13 July 2009 16:19:51 Robin Getz wrote:
CONFIG_KEEP_SERVERADDR
Keeps the server's MAC address, in the env 'serveraddr'
for passing to bootargs (like Linux's netconsole option)
is a config option really necessary ? i'd say just add it for everyone
I was just thinking that there would be pollution in the env - growing it unnecessarily for those who didn't want it.
However - when I look at the number of CONFIG_ options in ./include/config - is seemed to be alot - more than necessary...
1787 CONFIG_options, which only appear in one file. 534 CONFIG_options, which only appear in two files 368 3 259 4 161 5 157 6 95 7 92 8 54 9 42 10
seems to be a little crazy...
-Robin

Mike Frysinger wrote:
On Monday 13 July 2009 16:19:51 Robin Getz wrote:
CONFIG_KEEP_SERVERADDR
Keeps the server's MAC address, in the env 'serveraddr'
for passing to bootargs (like Linux's netconsole option)
is a config option really necessary ? i'd say just add it for everyone -mike
ACK

On Thu 16 Jul 2009 12:56, Ben Warren pondered:
Mike Frysinger wrote:
On Monday 13 July 2009 16:19:51 Robin Getz wrote:
CONFIG_KEEP_SERVERADDR
Keeps the server's MAC address, in the env 'serveraddr'
for passing to bootargs (like Linux's netconsole option)
is a config option really necessary ? i'd say just add it for everyone -mike
ACK
Does that mean you want a new patch with the ifdef removed?
-Robin

Dear Robin Getz,
In message 200907170753.53732.rgetz@blackfin.uclinux.org you wrote:
On Thu 16 Jul 2009 12:56, Ben Warren pondered:
Mike Frysinger wrote:
On Monday 13 July 2009 16:19:51 Robin Getz wrote:
CONFIG_KEEP_SERVERADDR
Keeps the server's MAC address, in the env 'serveraddr'
for passing to bootargs (like Linux's netconsole option)
is a config option really necessary ? i'd say just add it for everyone -mike
ACK
Does that mean you want a new patch with the ifdef removed?
No!
Best regards,
Wolfgang Denk

Hi Robin, Robin Getz wrote:
From: Robin Getz rgetz@blackfin.uclinux.org
Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :)
This sets the env var "serveraddr" (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to....
addnetconsole=set bootargs $(bootargs) netconsole=@$(ipaddr)/eth0,@$(serverip)/$(serveraddr)
Signed-of-by: Robin Getz rgetz@blackfin.uclinux.org
Index: net/net.c
--- net/net.c (revision 1968) +++ net/net.c (working copy)
Can you please re-submit using git tools?
thanks, Ben

On Tue 21 Jul 2009 02:37, Ben Warren pondered:
Can you please re-submit using git tools?
From: Robin Getz rgetz@blackfin.uclinux.org
Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :)
This sets the env var "serveraddr" (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to....
addnetconsole=set bootargs $(bootargs) netconsole=@$(ipaddr)/eth0,@$(serverip)/$(serveraddr)
Signed-of-by: Robin Getz rgetz@blackfin.uclinux.org
-----
diff --git a/README b/README index 4c74cb7..9071472 100644 --- a/README +++ b/README @@ -1184,6 +1184,11 @@ The following options need to be configured: Defines a default value for the IP address of a TFTP server to contact when using the "tftboot" command.
+ CONFIG_KEEP_SERVERADDR + + Keeps the server's MAC address, in the env 'serveraddr' + for passing to bootargs (like Linux's netconsole option) + - Multicast TFTP Mode: CONFIG_MCAST_TFTP
diff --git a/net/net.c b/net/net.c index 7ce947d..641c37c 100644 --- a/net/net.c +++ b/net/net.c @@ -1287,6 +1287,15 @@ NetReceive(volatile uchar * inpkt, int len) /* are we waiting for a reply */ if (!NetArpWaitPacketIP || !NetArpWaitPacketMAC) break; + +#ifdef CONFIG_KEEP_SERVERADDR + if (NetServerIP == NetArpWaitPacketIP) { + char buf[20]; + sprintf(buf, "%pM", arp->ar_data); + setenv("serveraddr", buf); + } +#endif + #ifdef ET_DEBUG printf("Got ARP REPLY, set server/gtwy eth addr (%pM)\n", arp->ar_data);

Robin,
Please keep in mind that the exact subject text becomes the changelog title:
" - save the server's mac address..."
looks pretty dumb. I took the liberty of cleaning it up. Robin Getz wrote:
On Tue 21 Jul 2009 02:37, Ben Warren pondered:
Can you please re-submit using git tools?
From: Robin Getz rgetz@blackfin.uclinux.org
Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :)
This sets the env var "serveraddr" (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to....
addnetconsole=set bootargs $(bootargs) netconsole=@$(ipaddr)/eth0,@$(serverip)/$(serveraddr)
Signed-of-by: Robin Getz rgetz@blackfin.uclinux.org
Please create the patch using git tools, 'git format-patch' in particular. It takes care of generating nice lines with three hyphens. This one that you've created messes things up.
diff --git a/README b/README index 4c74cb7..9071472 100644 --- a/README +++ b/README @@ -1184,6 +1184,11 @@ The following options need to be configured: Defines a default value for the IP address of a TFTP server to contact when using the "tftboot" command.
CONFIG_KEEP_SERVERADDR
Keeps the server's MAC address, in the env 'serveraddr'
for passing to bootargs (like Linux's netconsole option)
- Multicast TFTP Mode: CONFIG_MCAST_TFTP
diff --git a/net/net.c b/net/net.c index 7ce947d..641c37c 100644 --- a/net/net.c +++ b/net/net.c @@ -1287,6 +1287,15 @@ NetReceive(volatile uchar * inpkt, int len) /* are we waiting for a reply */ if (!NetArpWaitPacketIP || !NetArpWaitPacketMAC) break;
+#ifdef CONFIG_KEEP_SERVERADDR
if (NetServerIP == NetArpWaitPacketIP) {
char buf[20];
sprintf(buf, "%pM", arp->ar_data);
setenv("serveraddr", buf);
}
+#endif
#ifdef ET_DEBUG printf("Got ARP REPLY, set server/gtwy eth addr (%pM)\n", arp->ar_data);
Anti-climatically...
applied to net repo.
thanks, Ben
participants (4)
-
Ben Warren
-
Mike Frysinger
-
Robin Getz
-
Wolfgang Denk