diff options
| author | Michael Brown | 2012-06-26 18:19:18 +0200 |
|---|---|---|
| committer | Michael Brown | 2012-06-28 17:02:31 +0200 |
| commit | ec22e08db1fa61f5276b2ed1efbde28a1a45101e (patch) | |
| tree | f8e65353e71dee19449d2934fefd684ed101f386 /src/arch/x86/include/bits | |
| parent | [test] Add self-tests for TCP/IP checksum calculation (diff) | |
| download | ipxe-ec22e08db1fa61f5276b2ed1efbde28a1a45101e.tar.gz ipxe-ec22e08db1fa61f5276b2ed1efbde28a1a45101e.tar.xz ipxe-ec22e08db1fa61f5276b2ed1efbde28a1a45101e.zip | |
[tcpip] Add faster algorithm for calculating the TCP/IP checksum
The generic TCP/IP checksum implementation requires approximately 10
CPU clocks per byte (as measured using the TSC). Improve this to
approximately 0.5 CPU clocks per byte by using "lodsl ; adcl" in an
unrolled loop.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/x86/include/bits')
| -rw-r--r-- | src/arch/x86/include/bits/tcpip.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/arch/x86/include/bits/tcpip.h b/src/arch/x86/include/bits/tcpip.h index 9ae8d9205..a4b335eb1 100644 --- a/src/arch/x86/include/bits/tcpip.h +++ b/src/arch/x86/include/bits/tcpip.h @@ -9,4 +9,9 @@ FILE_LICENCE ( GPL2_OR_LATER ); +extern uint16_t x86_tcpip_continue_chksum ( uint16_t partial, + const void *data, size_t len ); + +#define tcpip_continue_chksum x86_tcpip_continue_chksum + #endif /* _BITS_TCPIP_H */ |
