diff options
| author | Michael Brown | 2025-07-10 13:50:00 +0200 |
|---|---|---|
| committer | Michael Brown | 2025-07-10 14:32:45 +0200 |
| commit | 634d9abefbb896e0c563ede4b6a7df40d0948501 (patch) | |
| tree | 7cb4d796a8e74685a69f9cacb87f4953655b5e21 /src/arch/riscv/include | |
| parent | [riscv] Provide a DMA API implementation for RISC-V bare-metal systems (diff) | |
| download | ipxe-634d9abefbb896e0c563ede4b6a7df40d0948501.tar.gz ipxe-634d9abefbb896e0c563ede4b6a7df40d0948501.tar.xz ipxe-634d9abefbb896e0c563ede4b6a7df40d0948501.zip | |
[riscv] Add optimised TCP/IP checksumming
Add a RISC-V assembly language implementation of TCP/IP checksumming,
which is around 50x faster than the generic algorithm. The main loop
checksums aligned xlen-bit words, using almost entirely compressible
instructions and accumulating carries in a separate register to allow
folding to be deferred until after all loops have completed.
Experimentation on a C910 CPU suggests that this achieves around four
bytes per clock cycle, which is comparable to the x86 implementation.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/riscv/include')
| -rw-r--r-- | src/arch/riscv/include/bits/tcpip.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/arch/riscv/include/bits/tcpip.h b/src/arch/riscv/include/bits/tcpip.h new file mode 100644 index 000000000..0ac55b1a0 --- /dev/null +++ b/src/arch/riscv/include/bits/tcpip.h @@ -0,0 +1,15 @@ +#ifndef _BITS_TCPIP_H +#define _BITS_TCPIP_H + +/** @file + * + * Transport-network layer interface + * + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +extern uint16_t tcpip_continue_chksum ( uint16_t partial, const void *data, + size_t len ); + +#endif /* _BITS_TCPIP_H */ |
