summaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorMichael Brown2025-07-10 15:33:34 +0200
committerMichael Brown2025-07-10 15:39:07 +0200
commitbbabde8ff8182fcef738893c29a698783758a489 (patch)
tree2cf11a67941a992ccedfce0390169fcf9d7b683e /src/drivers
parent[riscv] Add optimised TCP/IP checksumming (diff)
downloadipxe-bbabde8ff8182fcef738893c29a698783758a489.tar.gz
ipxe-bbabde8ff8182fcef738893c29a698783758a489.tar.xz
ipxe-bbabde8ff8182fcef738893c29a698783758a489.zip
[riscv] Invalidate data cache on completed RX DMA buffers
The data cache must be invalidated twice for RX DMA buffers: once before passing ownership to the DMA device (in case the cache happens to contain dirty data that will be written back at an undefined future point), and once after receiving ownership from the DMA device (in case the CPU happens to have speculatively accessed data in the buffer while it was owned by the hardware). Only the used portion of the buffer needs to be invalidated after completion, since we do not care about data within the unused portion. Update the DMA API to include the used length as an additional parameter to dma_unmap(), and add the necessary second cache invalidation pass to the RISC-V DMA API implementation. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/net/intelxl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/net/intelxl.c b/src/drivers/net/intelxl.c
index 1d4c22a09..31a3e2577 100644
--- a/src/drivers/net/intelxl.c
+++ b/src/drivers/net/intelxl.c
@@ -90,7 +90,7 @@ int intelxl_msix_enable ( struct intelxl_nic *intelxl,
pci_msix_disable ( pci, &intelxl->msix.cap );
err_enable:
- dma_unmap ( &intelxl->msix.map );
+ dma_unmap ( &intelxl->msix.map, sizeof ( intelxl->msix.msg ) );
err_map:
return rc;
}
@@ -112,7 +112,7 @@ void intelxl_msix_disable ( struct intelxl_nic *intelxl,
pci_msix_disable ( pci, &intelxl->msix.cap );
/* Unmap dummy target location */
- dma_unmap ( &intelxl->msix.map );
+ dma_unmap ( &intelxl->msix.map, sizeof ( intelxl->msix.msg ) );
}
/******************************************************************************