[dpdk-dev] [PATCH v2] app/testpmd: fix IP checksum calculation

George Prekas prekageo at amazon.com
Tue Jan 5 17:26:59 CET 2021


On 12/4/2020 11:42 PM, George Prekas wrote:
> Strict-aliasing rules are violated by cast to uint16_t* in flowgen.c
> and the calculated IP checksum is wrong on GCC 9 and GCC 10.
>
> Signed-off-by: George Prekas <prekageo at amazon.com>
> ---
> v2:
> * Instead of a compiler barrier, use a compiler flag.
> ---
>   app/test-pmd/meson.build | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
> index 7e9c7bdd6..5d24e807f 100644
> --- a/app/test-pmd/meson.build
> +++ b/app/test-pmd/meson.build
> @@ -4,6 +4,7 @@
>   # override default name to drop the hyphen
>   name = 'testpmd'
>   cflags += '-Wno-deprecated-declarations'
> +cflags += '-fno-strict-aliasing'
>   sources = files('5tswap.c',
>   	'cmdline.c',
>   	'cmdline_flow.c',
Happy New Year!

Any updates on this?

Thanks,
George


More information about the dev mailing list