Skip to contentSkip to conversation

net: bootp: Add BOOTP specific config for timeout value

PATCH Superseded amessier.tyco at gmail.com 3 participants 3 messages Jan 22, 2016 Networking

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 net: bootp: Add BOOTP specific config for timeout value

From: Alexandre Messier <[email protected]>

There is currently one config option (CONFIG_NET_RETRY_COUNT) that is available to tune the retries of the network stack. Unfortunately, it is global to all protocols, and the value is interpreted differently in all of them.

Add a new config option that sets directly the timeout delay used by BOOTP, instead of it being derived from CONFIG_NET_RETRY_COUNT.

---
 README      | 6 ++++++
 net/bootp.c | 4 ++++
 2 files changed, 10 insertions(+)
README +6 -0
index 05966ab..9703f83 100644
@@ -2191,6 +2191,7 @@ CBFS (Coreboot Filesystem) support
 		CONFIG_BOOTP_TIMEOFFSET
 		CONFIG_BOOTP_VENDOREX
 		CONFIG_BOOTP_MAY_FAIL
+		CONFIG_BOOTP_TIMEOUT_MS
 		CONFIG_BOOTP_DHCPREQ_BOOTFILE
 
 		CONFIG_BOOTP_SERVERIP - TFTP server will be the serverip
@@ -2232,6 +2233,11 @@ CBFS (Coreboot Filesystem) support
 		the DHCP timeout and retry process takes a longer than
 		this delay.
 
+		CONFIG_BOOTP_TIMEOUT_MS - Explicitly configure the BOOTP
+		timeout in milliseconds, instead of basing it on the configured
+		number of retries, which is either CONFIG_NET_RETRY_COUNT or
+		the BOOTP default value of 5 retries.
+
 		CONFIG_BOOTP_DHCPREQ_BOOTFILE - Set the bootfile name in
 		DHCPREQUEST packet, in addition to DHCPDISCOVER. This may be
 		needed by some DHCP servers in specific cases.
net/bootp.c +4 -0
index 8da94cf..edb0b39 100644
@@ -33,12 +33,16 @@
  * execute that many retries, and keep sending retry packets until that time
  * is reached.
  */
+#ifndef CONFIG_BOOTP_TIMEOUT_MS
 #ifndef CONFIG_NET_RETRY_COUNT
 # define TIMEOUT_COUNT	5		/* # of timeouts before giving up */
 #else
 # define TIMEOUT_COUNT	(CONFIG_NET_RETRY_COUNT)
 #endif
 #define TIMEOUT_MS	((3 + (TIMEOUT_COUNT * 5)) * 1000)
+#else
+#define TIMEOUT_MS	CONFIG_BOOTP_TIMEOUT_MS
+#endif
 
 #define PORT_BOOTPS	67		/* BOOTP server UDP port */
 #define PORT_BOOTPC	68		/* BOOTP client UDP port */
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 2/2 net: bootp: Add BOOTP specific config for timeout value

Quoted 29 lines · On Fri, Jan 22, 2016 at 1:22 PM, <[email protected]> wrote:

From: Alexandre Messier <[email protected]>

There is currently one config option (CONFIG_NET_RETRY_COUNT) that is available to tune the retries of the network stack. Unfortunately, it is global to all protocols, and the value is interpreted differently in all of them.

Add a new config option that sets directly the timeout delay used by BOOTP, instead of it being derived from CONFIG_NET_RETRY_COUNT.

---
 README      | 6 ++++++
 net/bootp.c | 4 ++++
 2 files changed, 10 insertions(+)
README +1 -0
index 05966ab..9703f83 100644
@@ -2191,6 +2191,7 @@ CBFS (Coreboot Filesystem) support
                CONFIG_BOOTP_TIMEOFFSET
                CONFIG_BOOTP_VENDOREX
                CONFIG_BOOTP_MAY_FAIL
+               CONFIG_BOOTP_TIMEOUT_MS
                CONFIG_BOOTP_DHCPREQ_BOOTFILE
 
                CONFIG_BOOTP_SERVERIP - TFTP server will be the serverip

README CBFS (Coreboot Filesystem) support · line 2239

Quoted 7 lines
README +4 -0
@@ -2232,6 +2233,11 @@ CBFS (Coreboot Filesystem) support
                the DHCP timeout and retry process takes a longer than
                this delay.
 
+               CONFIG_BOOTP_TIMEOUT_MS - Explicitly configure the BOOTP
+               timeout in milliseconds, instead of basing it on the configured
+               number of retries, which is either CONFIG_NET_RETRY_COUNT or
+               the BOOTP default value of 5 retries.

Please add new config options to the Kconfig system.

Quoted 32 lines
README +1 -0
+
                CONFIG_BOOTP_DHCPREQ_BOOTFILE - Set the bootfile name in
                DHCPREQUEST packet, in addition to DHCPDISCOVER. This may be
                needed by some DHCP servers in specific cases.
net/bootp.c +4 -1
index 8da94cf..edb0b39 100644
@@ -33,12 +33,16 @@
  * execute that many retries, and keep sending retry packets until that time
  * is reached.
  */
+#ifndef CONFIG_BOOTP_TIMEOUT_MS
 #ifndef CONFIG_NET_RETRY_COUNT
 # define TIMEOUT_COUNT 5               /* # of timeouts before giving up */
 #else
 # define TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT)
 #endif
 #define TIMEOUT_MS     ((3 + (TIMEOUT_COUNT * 5)) * 1000)
+#else
+#define TIMEOUT_MS     CONFIG_BOOTP_TIMEOUT_MS
+#endif
 
 #define PORT_BOOTPS    67              /* BOOTP server UDP port */
 #define PORT_BOOTPC    68              /* BOOTP client UDP port */
--

1.8.3.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#2 lore raw

PATCH 2/2 net: bootp: Add BOOTP specific config for timeout value

Quoted 41 lines

-----Original Message-----
From: Joe Hershberger [mailto:joe.hershberger at gmail.com]
Sent: January-22-16 2:36 PM
To: amessier.tyco at gmail.com
Cc: u-boot; Joe Hershberger; MESSIER, ALEXANDRE
Subject: Re: [U-Boot] [PATCH 2/2] net: bootp: Add BOOTP specific config for timeout value

Quoted 32 lines · On Fri, Jan 22, 2016 at 1:22 PM, <[email protected]> wrote:

From: Alexandre Messier <[email protected]>

There is currently one config option (CONFIG_NET_RETRY_COUNT) that is available to tune the retries of the network stack. Unfortunately, it is global to all protocols, and the value is interpreted differently in all of them.

Add a new config option that sets directly the timeout delay used by BOOTP, instead of it being derived from CONFIG_NET_RETRY_COUNT.

---
 README      | 6 ++++++
 net/bootp.c | 4 ++++
 2 files changed, 10 insertions(+)
README +1 -0
index 05966ab..9703f83 100644
@@ -2191,6 +2191,7 @@ CBFS (Coreboot Filesystem) support
                CONFIG_BOOTP_TIMEOFFSET
                CONFIG_BOOTP_VENDOREX
                CONFIG_BOOTP_MAY_FAIL
+               CONFIG_BOOTP_TIMEOUT_MS
                CONFIG_BOOTP_DHCPREQ_BOOTFILE
 
                CONFIG_BOOTP_SERVERIP - TFTP server will be the serverip
@@ -2232,6 +2233,11 @@ CBFS (Coreboot Filesystem) support
                the DHCP timeout and retry process takes a longer than
                this delay.
 
Quoted 6 lines

README CBFS (Coreboot Filesystem) support · line 2239

Quoted 4 lines
README +4 -0
+               CONFIG_BOOTP_TIMEOUT_MS - Explicitly configure the BOOTP
+               timeout in milliseconds, instead of basing it on the configured
+               number of retries, which is either CONFIG_NET_RETRY_COUNT or
+               the BOOTP default value of 5 retries.

Please add new config options to the Kconfig system.

OK will do.

Quoted 30 lines

net/bootp.c line 33

Quoted 11 lines
README +1 -0
+
                CONFIG_BOOTP_DHCPREQ_BOOTFILE - Set the bootfile name in
                DHCPREQUEST packet, in addition to DHCPDISCOVER. This may be
                needed by some DHCP servers in specific cases.
net/bootp.c +0 -0
index 8da94cf..edb0b39 100644
@@ -33,12 +33,16 @@
  * execute that many retries, and keep sending retry packets until that

time

Quoted 18 lines
net/bootp.c +4 -1
  * is reached.
  */
+#ifndef CONFIG_BOOTP_TIMEOUT_MS
 #ifndef CONFIG_NET_RETRY_COUNT
 # define TIMEOUT_COUNT 5               /* # of timeouts before giving up */
 #else
 # define TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT)
 #endif
 #define TIMEOUT_MS     ((3 + (TIMEOUT_COUNT * 5)) * 1000)
+#else
+#define TIMEOUT_MS     CONFIG_BOOTP_TIMEOUT_MS
+#endif
 
 #define PORT_BOOTPS    67              /* BOOTP server UDP port */
 #define PORT_BOOTPC    68              /* BOOTP client UDP port */
--

1.8.3.1

Quoted 8 lines
Quoted 4 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://urldefense.proofpoint.com/v2/url?u=http-

3A__lists.denx.de_mailman_listinfo_u-2Dboot&d=CwIBaQ&c=0YGvTs3tT- VMy8_v51yLDw&r=adEdfGeVvAp5D3jUKeOClnVoZZOSb93LtGg4Qgmpmjw& m=6vGNQE7IhCTnhn7IpITPEZMxcbzm9xD4_yl1dmVGsI0&s=M78bwo2zLUHN Avjy5n53KfWdSKM8CRGsFU1SSog0LKw&e=

________________________________

This e-mail contains privileged and confidential information intended for the use of the addressees named above. If you are not the intended recipient of this e-mail, you are hereby notified that you must not disseminate, copy or take any action in respect of any information contained in it. If you have received this e-mail in error, please notify the sender immediately by e-mail and immediately destroy this e-mail and its attachments.