On Thu, Oct 17, 2024 at 09:24:37AM -0700, Stephen Hemminger wrote: > On Thu, 17 Oct 2024 15:22:12 +0100 > Bruce Richardson <bruce.richard...@intel.com> wrote: > > > There are multiple instances in the DPDK app folder where we set up an > > IP header and then compute the checksum field by direct addition of > > nine uint16_t values in the header (20 bytes less the cksum field). > > The existing rte_ip.h checksum function is more general than necessary > > here and requires that the checksum field is already set to zero - > > rather than having it skipped. > > > > Fix the code duplication present in the apps by creating a new > > rte_ipv4_cksum_simple function - taking the code from the existing > > testpmd icmpecho.c file - and using that in app/test, testpmd and > > testeventdev. > > > > Within that new function, we can adjust slightly how the typecasting to > > uint16_t is done, and thereby ensure that the app can all be compiled > > without -Wno-address-of-packed-member compiler flag. > > > > Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> > > DPDK should use the same optimization as FreeBSD and Linux > and use 32 bit add's here. >
Yep. And if we get this patch applied, there is only one place to optimize, not a dozen! :-)