1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

use busy waiting for receiving the IP address => reduce the latency

This commit is contained in:
Stefan Lankes 2016-08-22 16:51:09 +02:00
parent e221677fe1
commit 5e9f932869

View file

@ -228,7 +228,19 @@ success:
int mscnt = 0;
/* wait for ip address */
while(!default_netif.ip_addr.addr) {
uint64_t end_tsc, start_tsc = rdtsc();
#if 1
do {
if (default_netif.ip_addr.addr)
return 0;
check_workqueues();
end_tsc = rdtsc();
} while(((end_tsc - start_tsc) / (get_cpu_frequency() * 1000)) < DHCP_FINE_TIMER_MSECS);
#else
sys_msleep(DHCP_FINE_TIMER_MSECS);
#endif
dhcp_fine_tmr();
mscnt += DHCP_FINE_TIMER_MSECS;
if (mscnt >= DHCP_COARSE_TIMER_SECS*1000) {
@ -238,7 +250,6 @@ success:
}
}
return 0;
}