From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 04837A0524; Thu, 3 Dec 2020 17:36:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3AF25C982; Thu, 3 Dec 2020 17:36:41 +0100 (CET) Received: from smtp-fw-33001.amazon.com (smtp-fw-33001.amazon.com [207.171.190.10]) by dpdk.org (Postfix) with ESMTP id 3BD2AC970 for ; Thu, 3 Dec 2020 17:36:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1607013399; x=1638549399; h=to:cc:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding:subject; bh=RyaP7R5uQrBoyG6qUp1kyuNfb5QRk+3CW1Dvprhgun4=; b=aKlczw0IhGEK69BSVC8QhGjNogObabM5CAHzHXUsK+YJKGMm4dvWkx/W LnfoYaiVv8JkxhExSBfuRkY1G9NOJ3Ao1pZ88N7KBSxjaW4P5/1h4K9KC dH1CEVByZV0BlAu/7o3giMC3yy1/T2sdVbGQaAK9I8fDZijusDeKUR0/w o=; X-IronPort-AV: E=Sophos;i="5.78,389,1599523200"; d="scan'208";a="100267972" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2a-69849ee2.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 03 Dec 2020 16:36:27 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2a-69849ee2.us-west-2.amazon.com (Postfix) with ESMTPS id AC9DEA5DC3; Thu, 3 Dec 2020 16:36:26 +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 16:36:26 +0000 Received: from [192.168.8.240] (10.43.160.67) by EX13D12UWC001.ant.amazon.com (10.43.162.78) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 3 Dec 2020 16:36:25 +0000 To: Stephen Hemminger CC: Wenzhuo Lu , Beilei Xing , Bernard Iremonger , References: <20201203135954.1127-1-prekageo@amazon.com> <20201203080812.3d9940c9@hermes.local> From: George Prekas Message-ID: <56967649-1494-aacf-ce65-9df575233b86@amazon.com> Date: Thu, 3 Dec 2020 10:35:50 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201203080812.3d9940c9@hermes.local> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.43.160.67] X-ClientProxiedBy: EX13D19UWC004.ant.amazon.com (10.43.162.56) To EX13D12UWC001.ant.amazon.com (10.43.162.78) Subject: Re: [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" On 12/3/2020 10:08 AM, Stephen Hemminger wrote: > On Thu, 3 Dec 2020 07:59:54 -0600 > 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. >> >> Signed-off-by: George Prekas > I don't think this is necessary. All other OS's don't have to do this. > The CPU is going to maintain proper memory order. Hi Stephen, This is not a CPU or OS issue. This is a compiler issue. The compiler is free to reorder statements if it does not detect dependencies between them. Without this compiler barrier, the calculated IP checksum is wrong.