Skip to contentSkip to conversation

efi_loader: Allow bouncing for network

PATCH Applied Alexander Graf 1 participant 2 messages Sep 6, 2016 – Oct 13, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_loader: Allow bouncing for network

So far bounce buffers were only used for disk I/O, but network I/O may suffer from the same problem.

On platforms that have problems doing DMA on high addresses, let's also bounce outgoing network packets. Incoming ones always already get bounced.

This patch fixes EFI PXE boot on ZynqMP for me.

---
 lib/efi_loader/efi_net.c | 7 +++++++
 1 file changed, 7 insertions(+)
lib/efi_loader/efi_net.c +7 -0
index dd3b485..6a8a0d7 100644
@@ -152,7 +152,14 @@ static efi_status_t EFIAPI efi_net_transmit(struct efi_simple_network *this,
 		return EFI_EXIT(EFI_INVALID_PARAMETER);
 	}
 
+#ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER
+	/* Ethernet packets always fit, just bounce */
+	memcpy(efi_bounce_buffer, buffer, buffer_size);
+	net_send_packet(efi_bounce_buffer, buffer_size);
+#else
 	net_send_packet(buffer, buffer_size);
+#endif
+
 	new_tx_packet = buffer;
 
 	return EFI_EXIT(EFI_SUCCESS);
Signature · 1 line
1.8.5.6
author Applied
#1 lore raw
Quoted 10 lines

So far bounce buffers were only used for disk I/O, but network I/O may suffer from the same problem.

On platforms that have problems doing DMA on high addresses, let's also bounce outgoing network packets. Incoming ones always already get bounced.

This patch fixes EFI PXE boot on ZynqMP for me.

Thanks, applied to