From f59be6e850b3856a4595b387c2b6c3607deb340a Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Fri, 25 Jul 2014 17:30:48 -0600 Subject: net: BOOTP retry timeout improvements Currently, the BOOTP code sends out its initial request as soon as the Ethernet driver indicates "link up". If this packet is lost or not replied to for some reason, the code waits for a 1s timeout before retrying. For some reason, such early packets are often lost on my system, so this causes an annoying delay. To optimize this, modify the BOOTP code to have very short timeouts for the first packet transmitted, but gradually increase the timeout each time a timeout occurs. This way, if the first packet is lost, the second packet is transmitted quite quickly and hence the overall delay is low. However, if there's still no response, we don't keep spewing out packets at an insane speed. It's arguably more correct to try and find out why the first packet is lost. However, it seems to disappear inside my Ethenet chip; the TX chip indicates no error during TX (not that it has much in the way of reporting...), yet wireshark on the RX side doesn't see any packet. FWIW, I'm using an ASIX USB Ethernet adapter. Perhaps "link up" is reported too early or based on the wrong condition in HW, and we should add some fixed extra delay into the driver. However, this would slow down every link up event even if it ends up not being needed in some cases. Having BOOTP retry quickly applies the fix/WAR to every possible Ethernet device, and is quite simple to implement, so seems a better solution. Signed-off-by: Stephen Warren Acked-by: Joe Hershberger --- net/bootp.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'net/bootp.h') diff --git a/net/bootp.h b/net/bootp.h index ecbcc4d509..3b95a0a2de 100644 --- a/net/bootp.h +++ b/net/bootp.h @@ -65,6 +65,7 @@ extern int BootpTry; /* Send a BOOTP request */ +extern void BootpReset(void); extern void BootpRequest(void); /****************** DHCP Support *********************/ @@ -88,8 +89,6 @@ typedef enum { INIT, #define DHCP_NAK 6 #define DHCP_RELEASE 7 -#define SELECT_TIMEOUT 3000UL /* Milliseconds to wait for offers */ - /**********************************************************************/ #endif /* __BOOTP_H__ */ -- cgit v1.2.1