Browse Source

[ifmgmt] Do not sleep CPU while configuring network devices

iPXE currently calls cpu_nap() while performing DHCP, in order to
reduce CPU utilisation on virtual machines.  Under mild broadcast load
(~100 packets per second), this can cause received packets to be
dropped because the receive descriptor ring is overrun before the next
18Hz timer interrupt wakes up the CPU.  The result is that DHCP is
likely to intermittently fail on networks with appreciable amounts of
broadcast (or multicast) traffic.

This behaviour was introduced in the series of commits which
generalised the "dhcp" command to the "ifconf" command.  The earlier
code (which did not handle IPv6 configuration) had no call to
cpu_nap() and so did not suffer from this problem.

Fix by removing the call to cpu_nap() in ifpoller_progress().  This
has the undesirable side effect that CPU utilisation will remain at
100% while waiting for DHCP to complete (which can take several
seconds, if we have to wait around for potential ProxyDHCP offers to
arrive).

Reported-by: Alex Davies <adavies@jumptrading.com>
Reported-by: Christoffer Stokbæk <christoffers@easyspeedy.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
9f0b7f428a
1 changed files with 0 additions and 4 deletions
  1. 0
    4
      src/usr/ifmgmt.c

+ 0
- 4
src/usr/ifmgmt.c View File

28
 #include <ipxe/device.h>
28
 #include <ipxe/device.h>
29
 #include <ipxe/job.h>
29
 #include <ipxe/job.h>
30
 #include <ipxe/monojob.h>
30
 #include <ipxe/monojob.h>
31
-#include <ipxe/nap.h>
32
 #include <ipxe/timer.h>
31
 #include <ipxe/timer.h>
33
 #include <usr/ifmgmt.h>
32
 #include <usr/ifmgmt.h>
34
 
33
 
142
 static int ifpoller_progress ( struct ifpoller *ifpoller,
141
 static int ifpoller_progress ( struct ifpoller *ifpoller,
143
 			       struct job_progress *progress __unused ) {
142
 			       struct job_progress *progress __unused ) {
144
 
143
 
145
-	/* Reduce CPU utilisation */
146
-	cpu_nap();
147
-
148
 	/* Hand off to current progress checker */
144
 	/* Hand off to current progress checker */
149
 	return ifpoller->progress ( ifpoller );
145
 	return ifpoller->progress ( ifpoller );
150
 }
146
 }

Loading…
Cancel
Save