numam-dpdk/lib/net
Mattias Rönnblom 1c9a7fba5c net: accept unaligned data in checksum routines
__rte_raw_cksum() (used by rte_raw_cksum() among others) accessed its
data through an uint16_t pointer, which allowed the compiler to assume
the data was 16-bit aligned. This in turn would, with certain
architectures and compiler flag combinations, result in code with SIMD
load or store instructions with restrictions on data alignment.

This patch keeps the old algorithm, but data is read using memcpy()
instead of direct pointer access, forcing the compiler to always
generate code that handles unaligned input. The __may_alias__ GCC
attribute is no longer needed.

The data on which the Internet checksum functions operates are almost
always 16-bit aligned, but there are exceptions. In particular, the
PDCP protocol header may (literally) have an odd size.

Performance impact seems to range from none to a very slight
regression.

Bugzilla ID: 1035
Fixes: 6006818cfb ("net: new checksum functions")
Cc: stable@dpdk.org

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2022-09-20 18:09:42 +02:00
..
meson.build ethdev: support L2TPv2 and PPP procotol 2021-10-21 14:15:59 +02:00
net_crc_avx512.c lib: remove unneeded header includes 2022-02-22 13:10:39 +01:00
net_crc_neon.c lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
net_crc_sse.c lib: remove unneeded header includes 2022-02-22 13:10:39 +01:00
net_crc.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_arp.c lib: remove unneeded header includes 2022-02-22 13:10:39 +01:00
rte_arp.h net: promote make rarp packet function to stable 2021-10-02 11:12:32 +02:00
rte_ecpri.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_esp.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_ether.c net: enable random address on Windows 2021-09-30 20:51:11 +02:00
rte_ether.h lib: remove unneeded header includes 2022-02-22 13:10:39 +01:00
rte_geneve.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_gre.h net: add optional fields in GRE header 2022-02-11 16:51:59 +01:00
rte_gtp.h net: fix GTP PSC headers 2022-06-23 13:38:09 +02:00
rte_higig.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_icmp.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_ip.h net: accept unaligned data in checksum routines 2022-09-20 18:09:42 +02:00
rte_l2tpv2.h app/testpmd: add 6 types of L2TPv2 message 2022-02-09 21:30:14 +01:00
rte_mpls.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_net_crc.c lib: remove unneeded header includes 2022-02-22 13:10:39 +01:00
rte_net_crc.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_net.c lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_net.h net: remove unneeded header includes 2022-06-21 16:46:56 +02:00
rte_ppp.h ethdev: support L2TPv2 and PPP procotol 2021-10-21 14:15:59 +02:00
rte_sctp.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_tcp.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_udp.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
rte_vxlan.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
version.map version: 22.11-rc0 2022-07-21 12:13:48 +02:00