From 35353c2b42b97f5f62af5b5f7772d72334774d3a Mon Sep 17 00:00:00 2001 From: Li RongQing Date: Thu, 14 Mar 2013 22:50:18 +0000 Subject: [PATCH] ipv4: replace ip_fast_csum with csum_replace2 replace ip_fast_csum with csum_replace2 to save cpu cycles Signed-off-by: Li RongQing Signed-off-by: David S. Miller --- net/ipv4/inet_lro.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c index cc280a3f4f96..1975f52933c5 100644 --- a/net/ipv4/inet_lro.c +++ b/net/ipv4/inet_lro.c @@ -29,6 +29,7 @@ #include #include #include +#include MODULE_LICENSE("GPL"); MODULE_AUTHOR("Jan-Bernd Themann "); @@ -114,11 +115,9 @@ static void lro_update_tcp_ip_header(struct net_lro_desc *lro_desc) *(p+2) = lro_desc->tcp_rcv_tsecr; } + csum_replace2(&iph->check, iph->tot_len, htons(lro_desc->ip_tot_len)); iph->tot_len = htons(lro_desc->ip_tot_len); - iph->check = 0; - iph->check = ip_fast_csum((u8 *)lro_desc->iph, iph->ihl); - tcph->check = 0; tcp_hdr_csum = csum_partial(tcph, TCP_HDR_LEN(tcph), 0); lro_desc->data_csum = csum_add(lro_desc->data_csum, tcp_hdr_csum); -- 2.20.1