From 44e0cdda9a84d41d80c8de965036a35bb48632e3 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 24 Apr 2019 09:55:41 +0200 Subject: [PATCH] software/libnet/microudp: speed-up ARP by changing timeout/tries First ARP request does not seem to be transmitted (the link is probably not fully established). Reduce the timeout between tries and increase number of tries. --- litex/soc/software/libnet/microudp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litex/soc/software/libnet/microudp.c b/litex/soc/software/libnet/microudp.c index 69aa901d..955340fe 100644 --- a/litex/soc/software/libnet/microudp.c +++ b/litex/soc/software/libnet/microudp.c @@ -219,7 +219,7 @@ int microudp_arp_resolve(unsigned int ip) for(i=0;i<6;i++) cached_mac[i] = 0; - for(tries=0;tries<5;tries++) { + for(tries=0;tries<100;tries++) { /* Send an ARP request */ fill_eth_header(&txbuffer->frame.eth_header, broadcast, @@ -242,7 +242,7 @@ int microudp_arp_resolve(unsigned int ip) send_packet(); /* Do we get a reply ? */ - for(timeout=0;timeout<2000000;timeout++) { + for(timeout=0;timeout<100000;timeout++) { microudp_service(); for(i=0;i<6;i++) if(cached_mac[i]) return 1; -- 2.30.2