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 B147CA0524; Thu, 3 Dec 2020 19:33:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E3273C970; Thu, 3 Dec 2020 19:33:13 +0100 (CET) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 4FC8337AF for ; Thu, 3 Dec 2020 19:33:11 +0100 (CET) Received: by mail-pf1-f196.google.com with SMTP id q22so1844901pfk.12 for ; Thu, 03 Dec 2020 10:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KpE9G4tnWc38EePTHLTTwQ2JVIwXfHwoeh9RZB/MV+I=; b=DhfCnMe6NeZKmrkQzVUDygM/D5cUQ7UT15ULIx36Te/OsRxO4tidWCnQdUk7eDBnWh ES+NpmOIKTobNsJbcYgUu8rfX+EcacKAmJuArMke+toUQXn0iotyaKrE/FF0AgKv629G dQzuY9l9WC6ZZozlrbyZKOPpYQUrlf/vymtFA2APa9vrJvWWdhU84XSiBq/ufQ/hVDYK JxMV4DRnHvns7UisLrEYLYiHreewP4jdc41bAQ5WEK+N5XMq4l0MfAz6DL2lsEu2Nkal 51Rz6lihxrlXlKiGnKJ55HhnentoZdDFwe+rvixu0BYlc0hQ+TU0EWGlIaTEE6rCpGxG M8ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KpE9G4tnWc38EePTHLTTwQ2JVIwXfHwoeh9RZB/MV+I=; b=r6qcU1mD0/Z+cQ4Zw9hIdyfhWLK/WMrcmn/Pq/+hfsIlcEKsK0/BDOwpL0GMvPOxVs +eiYByBqGsEAZ/JELNXUhtOoN3NhH463Z8OQxHPps6dnNkP950KL4PdNABBDD2mKwZ4J Oa1o9jF9dKJZgF+H0InggV+NpTD355fD9culs0vjUGRrwL6DcXGXy+k+DcA2AvaTuhOZ i8622WRucIbZGUH7j71uzqxpGd4G0sg168H3LrCIiny22Tapm+AQ+jasj+ZTXo/qfoHT 4uiR5HI5BW15JMTwNlZq409qL0UobykPKuPRgMqsdy51ODHKF33kWADERbI2BebFpfJ7 uAQg== X-Gm-Message-State: AOAM5309n6eLR7Bt/ouXND1CvO7rDo/HqglU0KStGURXgBhbEp+oArFr bgFqjFHeQ+XVEnewK+QqPw3WxA== X-Google-Smtp-Source: ABdhPJxw6BciXOEu3GBXqnDm1lKWoyI9lZ21hvTgos6Xn8HYfYXDXRmh38EXdke1biIC2h4XkX+4FA== X-Received: by 2002:a65:6215:: with SMTP id d21mr4237060pgv.134.1607020390355; Thu, 03 Dec 2020 10:33:10 -0800 (PST) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id gw7sm112486pjb.36.2020.12.03.10.33.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2020 10:33:09 -0800 (PST) Date: Thu, 3 Dec 2020 10:33:05 -0800 From: Stephen Hemminger To: George Prekas Cc: Wenzhuo Lu , Beilei Xing , Bernard Iremonger , Message-ID: <20201203103305.568f14c3@hermes.local> In-Reply-To: <56967649-1494-aacf-ce65-9df575233b86@amazon.com> References: <20201203135954.1127-1-prekageo@amazon.com> <20201203080812.3d9940c9@hermes.local> <56967649-1494-aacf-ce65-9df575233b86@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Thu, 3 Dec 2020 10:35:50 -0600 George Prekas wrote: > 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. > > But the compiler should be detecting any aliasing here, if no you have a bad compiler.