muvarov replied on github web page:

helper/include/odp/helper/chksum.h
line 21
@@ -44,21 +44,7 @@ typedef enum {
  */
 static inline odp_u16sum_t odph_chksum(void *buffer, int len)
 {
-       uint16_t *buf = (uint16_t *)buffer;
-       uint32_t sum = 0;
-       uint16_t result;
-
-       for (sum = 0; len > 1; len -= 2)
-               sum += *buf++;
-
-       if (len == 1)
-               sum += *(unsigned char *)buf;
-
-       sum = (sum >> 16) + (sum & 0xFFFF);
-       sum += (sum >> 16);
-       result = ~sum;
-
-       return  (__odp_force odp_u16sum_t) result;
+       return ~odp_chksum_ones_comp16(buffer, len);
 }
 


Comment:
for this patch I think more clean fix is to drop odph_chksum() completely. 
There is no need to implement helper function if it's simple follows odp 
function.

https://github.com/Linaro/odp/pull/280#discussion_r149771245
updated_at 2017-11-08 19:24:14

Reply via email to