Commit 64e69073c35439fa19c2ad2a4a18834e0314f071

Authored by Vineet Gupta
1 parent 0a5eae458e

asm-generic headers: Allow yet more arch overrides in checksum.h

arches can have more efficient implementation of these routines

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

Showing 2 changed files with 6 additions and 0 deletions Side-by-side Diff

include/asm-generic/checksum.h
... ... @@ -38,12 +38,15 @@
38 38 csum_partial_copy((src), (dst), (len), (sum))
39 39 #endif
40 40  
  41 +#ifndef ip_fast_csum
41 42 /*
42 43 * This is a version of ip_compute_csum() optimized for IP headers,
43 44 * which always checksum on 4 octet boundaries.
44 45 */
45 46 extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
  47 +#endif
46 48  
  49 +#ifndef csum_fold
47 50 /*
48 51 * Fold a partial checksum
49 52 */
... ... @@ -54,6 +57,7 @@
54 57 sum = (sum & 0xffff) + (sum >> 16);
55 58 return (__force __sum16)~sum;
56 59 }
  60 +#endif
57 61  
58 62 #ifndef csum_tcpudp_nofold
59 63 /*
... ... @@ -102,6 +102,7 @@
102 102 }
103 103 #endif
104 104  
  105 +#ifndef ip_fast_csum
105 106 /*
106 107 * This is a version of ip_compute_csum() optimized for IP headers,
107 108 * which always checksum on 4 octet boundaries.
... ... @@ -111,6 +112,7 @@
111 112 return (__force __sum16)~do_csum(iph, ihl*4);
112 113 }
113 114 EXPORT_SYMBOL(ip_fast_csum);
  115 +#endif
114 116  
115 117 /*
116 118 * computes the checksum of a memory block at buff, length len,