Commit 35353c2b42b97f5f62af5b5f7772d72334774d3a

Authored by Li RongQing
Committed by David S. Miller
1 parent 1bcac3b08e

ipv4: replace ip_fast_csum with csum_replace2

replace ip_fast_csum with csum_replace2 to save cpu cycles

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 2 additions and 3 deletions Side-by-side Diff

... ... @@ -29,6 +29,7 @@
29 29 #include <linux/module.h>
30 30 #include <linux/if_vlan.h>
31 31 #include <linux/inet_lro.h>
  32 +#include <net/checksum.h>
32 33  
33 34 MODULE_LICENSE("GPL");
34 35 MODULE_AUTHOR("Jan-Bernd Themann <themann@de.ibm.com>");
35 36  
... ... @@ -114,10 +115,8 @@
114 115 *(p+2) = lro_desc->tcp_rcv_tsecr;
115 116 }
116 117  
  118 + csum_replace2(&iph->check, iph->tot_len, htons(lro_desc->ip_tot_len));
117 119 iph->tot_len = htons(lro_desc->ip_tot_len);
118   -
119   - iph->check = 0;
120   - iph->check = ip_fast_csum((u8 *)lro_desc->iph, iph->ihl);
121 120  
122 121 tcph->check = 0;
123 122 tcp_hdr_csum = csum_partial(tcph, TCP_HDR_LEN(tcph), 0);