From 1d77d032168bd495c53589cca596131a992473c4 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 27 Jun 2012 12:02:58 +0100 Subject: [tcpip] Allow for architecture-specific TCP/IP checksum routines Calculating the TCP/IP checksum on received packets accounts for a substantial fraction of the response latency. Signed-off-by: Michael Brown --- src/include/ipxe/tcpip.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/include/ipxe') diff --git a/src/include/ipxe/tcpip.h b/src/include/ipxe/tcpip.h index cdf554e..34d7f88 100644 --- a/src/include/ipxe/tcpip.h +++ b/src/include/ipxe/tcpip.h @@ -13,6 +13,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include +#include struct io_buffer; struct net_device; @@ -121,8 +122,15 @@ extern int tcpip_tx ( struct io_buffer *iobuf, struct tcpip_protocol *tcpip, struct sockaddr_tcpip *st_dest, struct net_device *netdev, uint16_t *trans_csum ); -extern uint16_t tcpip_continue_chksum ( uint16_t partial, - const void *data, size_t len ); +extern uint16_t generic_tcpip_continue_chksum ( uint16_t partial, + const void *data, size_t len ); extern uint16_t tcpip_chksum ( const void *data, size_t len ); +/* Use generic_tcpip_continue_chksum() if no architecture-specific + * version is available + */ +#ifndef tcpip_continue_chksum +#define tcpip_continue_chksum generic_tcpip_continue_chksum +#endif + #endif /* _IPXE_TCPIP_H */ -- cgit v1.1