Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

platform/linux-generic/odp_packet.c
line 31
@@ -1948,6 +1949,35 @@ int _odp_packet_copy_md_to_packet(odp_packet_t srcpkt, 
odp_packet_t dstpkt)
        return dst_uarea_size < src_uarea_size;
 }
 
+static uint16_t packet_sum_ones_comp16(odp_packet_hdr_t *pkt_hdr,
+                                      uint32_t offset,
+                                      uint32_t len)
+{
+       uint32_t sum = pkt_hdr->p.l4_part_sum;
+       odp_bool_t odd_offset = false;
+
+       if (offset + len > pkt_hdr->frame_len)
+               return 0;
+
+       while (len > 0) {
+               uint32_t seglen = 0; /* GCC */
+               void *mapaddr = packet_map(pkt_hdr, offset, &seglen, NULL);
+
+               if (seglen < len)
+                       seglen = len;
+
+               len -= seglen;
+               sum += _odp_chksum_ones_comp16_32(mapaddr, seglen, odd_offset);
+               odd_offset ^= (seglen % 2);


Comment:
Drop use of `odd_offset` as noted earlier.

> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
> Checkpatch flag:
> ```
> WARNING: line over 80 characters
> #102: FILE: platform/linux-generic/odp_packet.c:2204:
> +             ip_proto = parse_ipv4(prs, &parseptr, &offset, frame_len, 
> chksums);
> total: 0 errors, 1 warnings, 0 checks, 163 lines checked
> ```


>> Bill Fischofer(Bill-Fischofer-Linaro) wrote:
>> 2018


https://github.com/Linaro/odp/pull/389#discussion_r161932843
updated_at 2018-01-17 01:41:46

Reply via email to