summaryrefslogtreecommitdiffstats
path: root/src/image
diff options
context:
space:
mode:
authorMichael Brown2014-03-14 15:16:05 +0100
committerMichael Brown2014-03-14 18:09:51 +0100
commitf473b9c3f66a2166129e1f60774f56e673423c5a (patch)
treef3e9688fb39fa298df425491ac5fb64a19308cb4 /src/image
parent[efi] Unload our own image before exiting UEFI application (diff)
downloadipxe-f473b9c3f66a2166129e1f60774f56e673423c5a.tar.gz
ipxe-f473b9c3f66a2166129e1f60774f56e673423c5a.tar.xz
ipxe-f473b9c3f66a2166129e1f60774f56e673423c5a.zip
[efi] Disable SNP devices when running iPXE as the application
Some UEFI builds will set up a timer to continuously poll any SNP devices. This can drain packets from the network device's receive queue before iPXE gets a chance to process them. Use netdev_rx_[un]freeze() to explicitly indicate when we expect our network devices to be driven via the external SNP API (as we do with the UNDI API on the standard BIOS build), and disable the SNP API except when receive queue processing is frozen. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/image')
-rw-r--r--src/image/efi_image.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/image/efi_image.c b/src/image/efi_image.c
index 1c1ee0c3..5de915b0 100644
--- a/src/image/efi_image.c
+++ b/src/image/efi_image.c
@@ -219,6 +219,9 @@ static int efi_image_exec ( struct image *image ) {
loaded.image->LoadOptionsSize =
( ( wcslen ( cmdline ) + 1 /* NUL */ ) * sizeof ( wchar_t ) );
+ /* Release network devices for use via SNP */
+ efi_snp_release();
+
/* Start the image */
if ( ( efirc = bs->StartImage ( handle, NULL, NULL ) ) != 0 ) {
rc = -EEFI_START ( efirc );
@@ -231,6 +234,7 @@ static int efi_image_exec ( struct image *image ) {
rc = 0;
err_start_image:
+ efi_snp_claim();
err_open_protocol:
/* Unload the image. We can't leave it loaded, because we
* have no "unload" operation.