Skip to contentSkip to conversation

- sanve the server's mac address...

RFC In review Robin Getz 4 participants 17 messages Jul 8, 2009 – Jul 23, 2009 Networking

lore
Share & tools
lore

Robin Getz

author
#0 lore raw

RFC 1/1 - 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...

net.c (working copy) renamed from net.c (revision 1961) +9 -0
Index: net/net.c
===================================================================
@@ -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)
author
#1 lore raw

On Wed 8 Jul 2009 14:50, Robin Getz pondered:

Quoted 10 lines

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?

Quoted 21 lines

Index: net/net.c
===================================================================

net.c (working copy) renamed from net.c (revision 1961) +9 -0
@@ -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)

_______________________________________________

#2 lore raw
Quoted 8 lines · On Thursday 09 July 2009 11:12:47 Robin Getz wrote:

On Wed 8 Jul 2009 14:50, Robin Getz pondered:

Quoted 7 lines

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....

Quoted 7 lines
Quoted 4 lines

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090709/f0a01b30/attachment.pgp

#3 lore raw
In reply to Robin Getz

Dear Robin Getz,

Quoted 8 lines · In message <[email protected]> you wrote:

On Wed 8 Jul 2009 14:50, Robin Getz pondered:

Quoted 7 lines

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....

Quoted 6 lines
Quoted 3 lines

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

Signature · 5 lines
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
"Consistency requires you to be as ignorant today as you were a  year
ago."                                              - Bernard Berenson
author
#4 lore raw

On Thu 9 Jul 2009 15:45, Wolfgang Denk pondered:

Quoted 11 lines

Dear Robin Getz,

Quoted 8 lines · In message <[email protected]> you wrote:

On Wed 8 Jul 2009 14:50, Robin Getz pondered:

Quoted 7 lines

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....

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

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...

Quoted 4 lines

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?

#5 lore raw

Dear Robin Getz,

Quoted 2 lines · In message <[email protected]> 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.

Quoted 1 line

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

Signature · 6 lines
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
As usual, this being a 1.3.x release, I haven't  even  compiled  this
kernel yet. So if it works, you should be doubly impressed.
      - Linus Torvalds in <[email protected]>
#6 lore raw

Dear Robin,

Quoted 2 lines · In message <[email protected]> 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

Signature · 4 lines
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
The faster I go, the behinder I get.                 -- Lewis Carroll
#7 lore raw
In reply to Robin Getz

Hi Robin,

Robin Getz wrote:
<snip>

Quoted 2 lines

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

author
#8 lore raw

PATCH 1/1 - save the server's mac address...

In reply to Robin Getz

From: Robin Getz <[email protected]>

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)

---

net.c +9 -0
Index: net/net.c
===================================================================
@@ -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);
README +5 -0
Index: README
===================================================================
@@ -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
 
#9 lore raw

PATCH 1/1 - save the server's mac address...

README line 1171

Quoted 4 lines · On Monday 13 July 2009 16:19:51 Robin Getz wrote:
README +4 -0
+		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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090715/832e9e75/attachment.pgp

author
#10 lore raw

PATCH 1/1 - save the server's mac address...

On Wed 15 Jul 2009 11:00, Mike Frysinger pondered:

Quoted 7 lines · On Monday 13 July 2009 16:19:51 Robin Getz wrote:

README line 1171

Quoted 4 lines
README +4 -0
+		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

#11 lore raw

PATCH 1/1 - save the server's mac address...

In reply to Mike Frysinger
Quoted 11 lines · Mike Frysinger

README line 1171

Quoted 5 lines · On Monday 13 July 2009 16:19:51 Robin Getz wrote:
README +4 -0
+		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

author
#12 lore raw

PATCH 1/1 - save the server's mac address...

On Thu 16 Jul 2009 12:56, Ben Warren pondered:

Quoted 12 lines
Quoted 11 lines · Mike Frysinger

README line 1171

Quoted 5 lines · On Monday 13 July 2009 16:19:51 Robin Getz wrote:
README +4 -0
+		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

Quoted 1 line

ACK

Does that mean you want a new patch with the ifdef removed?

-Robin

#13 lore raw

PATCH 1/1 - save the server's mac address...

Dear Robin Getz,

Quoted 13 lines · In message <[email protected]> you wrote:

On Thu 16 Jul 2009 12:56, Ben Warren pondered:

Quoted 12 lines
Quoted 11 lines · Mike Frysinger

README line 1171

Quoted 5 lines · On Monday 13 July 2009 16:19:51 Robin Getz wrote:
README +4 -0
+		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

Quoted 3 lines
Quoted 1 line

ACK

Does that mean you want a new patch with the ifdef removed?

No!

Best regards,

Wolfgang Denk

Signature · 7 lines
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
In the pitiful, multipage, connection-boxed form to which  the  flow-
chart  has  today  been  elaborated, it has proved to be useless as a
design tool -- programmers draw flowcharts after, not before, writing
the programs they describe.                        - Fred Brooks, Jr.
#14 lore raw

PATCH 1/1 - save the server's mac address...

In reply to Robin Getz

Hi Robin,

net.c

Quoted 20 lines · Robin Getz

From: Robin Getz <[email protected]>

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)

---

Index: net/net.c
===================================================================

net.c +0 -0

Can you please re-submit using git tools?

thanks,
Ben

author
#15 lore raw

PATCH 1/1 - save the server's mac address...

On Tue 21 Jul 2009 02:37, Ben Warren pondered:

Quoted 1 line

Can you please re-submit using git tools?

From: Robin Getz <[email protected]>

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)

-----

README +5 -0
index 4c74cb7..9071472 100644
@@ -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
 
net/net.c +9 -0
index 7ce947d..641c37c 100644
@@ -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);
Applied
#16 lore raw

PATCH 1/1 - save the server's mac address...

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.

Quoted 11 lines · Robin Getz

On Tue 21 Jul 2009 02:37, Ben Warren pondered:

Quoted 2 lines

Can you please re-submit using git tools?

From: Robin Getz <[email protected]>

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 :)

Quoted 10 lines

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)

-----

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.

Quoted 27 lines
README +5 -0
index 4c74cb7..9071472 100644
@@ -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
 
net/net.c +2 -0
index 7ce947d..641c37c 100644
@@ -1287,6 +1287,15 @@ NetReceive(volatile uchar * inpkt, int len)
 			/* are we waiting for a reply */
 			if (!NetArpWaitPacketIP || !NetArpWaitPacketMAC)
 				break;
+
+#ifdef CONFIG_KEEP_SERVERADDR

net/net.c NetReceive(volatile uchar * inpkt, int len) · line 1301

Quoted 10 lines
net/net.c +7 -0
+			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