[dpdk-dev] [PATCH] app/testpmd: fix IP checksum calculation
Ferruh Yigit
ferruh.yigit at intel.com
Fri Dec 4 09:59:42 CET 2020
On 12/3/2020 1:59 PM, George Prekas wrote:
> Insert a compiler barrier to make sure that the IP checksum calculation
> happens after setting all the fields of the IP header.
>
Can you please provide the compiler details, and if there is any specific
instruction on how to reproduce this failure?
> Signed-off-by: George Prekas <prekageo at amazon.com>
> ---
> app/test-pmd/flowgen.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c
> index acf3e2460..893b4b0b8 100644
> --- a/app/test-pmd/flowgen.c
> +++ b/app/test-pmd/flowgen.c
> @@ -150,6 +150,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
> next_flow);
> ip_hdr->total_length = RTE_CPU_TO_BE_16(pkt_size -
> sizeof(*eth_hdr));
> + rte_compiler_barrier();
> ip_hdr->hdr_checksum = ip_sum((unaligned_uint16_t *)ip_hdr,
> sizeof(*ip_hdr));
>
>
More information about the dev
mailing list