From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50D95C433C1 for ; Thu, 3 Dec 2020 14:00:43 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id A3EE320798 for ; Thu, 3 Dec 2020 14:00:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A3EE320798 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C5536C954; Thu, 3 Dec 2020 15:00:38 +0100 (CET) Received: from smtp-fw-9102.amazon.com (smtp-fw-9102.amazon.com [207.171.184.29]) by dpdk.org (Postfix) with ESMTP id 3ACB9C910 for ; Thu, 3 Dec 2020 15:00:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1607004038; x=1638540038; h=from:to:cc:subject:date:message-id:mime-version; bh=IYXt0Grwm1zBn38ISDoctYxqQy43lae5fEUjYEbLI/4=; b=VboM3XvEV2NpqWz0FKTI6spdh1dHYFnrrS5ac6ZoNUzeCv6C35NunVD9 gNtrE2HKb2mBmVaM+7OU9IFtZS/bqAJjzmhaZbVhBWK7ToJMbJX9ePdHz 6Jw/SZ/m9JlZOB6G69BpE+ndNCmgflQhb+yfFsc35LEytGR8JGdLrKMGd U=; X-IronPort-AV: E=Sophos;i="5.78,389,1599523200"; d="scan'208";a="101487865" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2a-22cc717f.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 03 Dec 2020 14:00:30 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2a-22cc717f.us-west-2.amazon.com (Postfix) with ESMTPS id F2768A1BF1; Thu, 3 Dec 2020 14:00:28 +0000 (UTC) Received: from EX13D12UWC001.ant.amazon.com (10.43.162.78) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 3 Dec 2020 14:00:28 +0000 Received: from AUS-1800118119.amazon.com (10.43.161.43) by EX13D12UWC001.ant.amazon.com (10.43.162.78) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 3 Dec 2020 14:00:27 +0000 From: George Prekas To: Wenzhuo Lu , Beilei Xing , Bernard Iremonger CC: , George Prekas Date: Thu, 3 Dec 2020 07:59:54 -0600 Message-ID: <20201203135954.1127-1-prekageo@amazon.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.161.43] X-ClientProxiedBy: EX13D41UWC004.ant.amazon.com (10.43.162.31) To EX13D12UWC001.ant.amazon.com (10.43.162.78) Subject: [dpdk-dev] [PATCH] app/testpmd: fix IP checksum calculation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Insert a compiler barrier to make sure that the IP checksum calculation happens after setting all the fields of the IP header. Signed-off-by: George Prekas --- 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)); -- 2.17.1