numam-dpdk/lib/librte_net
Hongzhi Guo 982bb68cab net: fix checksum on big endian CPUs
With current code, the checksum of odd-length buffers is wrong on
big endian CPUs: the last byte is not properly summed to the
accumulator.

Fix this by left-shifting the remaining byte by 8. For instance,
if the last byte is 0x42, we should add 0x4200 to the accumulator
on big endian CPUs.

This change is similar to what is suggested in Errata 3133 of
RFC 1071.

Fixes: 6006818cfb26("net: new checksum functions")
Cc: stable@dpdk.org

Signed-off-by: Hongzhi Guo <guohongzhi1@huawei.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2020-07-11 00:45:20 +02:00
..
Makefile build: disable experimental API check internally 2020-04-14 16:22:34 +02:00
meson.build build: disable experimental API check internally 2020-04-14 16:22:34 +02:00
net_crc_neon.h lib: use SPDX tag for Cavium copyright files 2018-01-09 16:19:01 +01:00
net_crc_sse.h add missing static keyword to globals 2018-10-29 02:01:08 +01:00
rte_arp.c remove experimental tags from all symbol definitions 2019-06-29 19:04:43 +02:00
rte_arp.h replace packed attributes 2020-04-16 18:16:46 +02:00
rte_esp.h replace packed attributes 2020-04-16 18:16:46 +02:00
rte_ether.c net: be more restrictive with ethernet address format 2019-07-23 14:31:35 +02:00
rte_ether.h replace packed attributes 2020-04-16 18:16:46 +02:00
rte_gre.h replace packed attributes 2020-04-16 18:16:46 +02:00
rte_gtp.h replace packed attributes 2020-04-16 18:16:46 +02:00
rte_higig.h ethdev: add HIGIG2 key field to flow API 2019-10-23 16:43:10 +02:00
rte_icmp.h replace packed attributes 2020-04-16 18:16:46 +02:00
rte_ip.h net: fix checksum on big endian CPUs 2020-07-11 00:45:20 +02:00
rte_mpls.h replace packed attributes 2020-04-16 18:16:46 +02:00
rte_net_crc.c net: hide internal CRC defines 2019-10-25 19:00:22 +02:00
rte_net_crc.h net: hide internal CRC defines 2019-10-25 19:00:22 +02:00
rte_net_version.map build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
rte_net.c net: add rte prefix to MPLS structure 2019-10-25 19:00:22 +02:00
rte_net.h net: fix how L4 checksum choice is tested 2019-06-28 20:32:18 +02:00
rte_sctp.h replace packed attributes 2020-04-16 18:16:46 +02:00
rte_tcp.h replace packed attributes 2020-04-16 18:16:46 +02:00
rte_udp.h replace packed attributes 2020-04-16 18:16:46 +02:00
rte_vxlan.h replace packed attributes 2020-04-16 18:16:46 +02:00