[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>
This commit is contained in:
Michael Brown
2012-06-26 17:19:18 +01:00
parent bb9961fb54
commit ec22e08db1
2 changed files with 174 additions and 0 deletions

View File

@@ -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 */