Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2833564pxf; Sun, 14 Mar 2021 13:51:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwje4dA8Mc57bLTjOWxX6iKNqJfxx5DcFFkIGnvRvZ9tmhSOxKhibTwas8bjBAJq6Cs15lA X-Received: by 2002:a17:906:9515:: with SMTP id u21mr20630932ejx.86.1615755078041; Sun, 14 Mar 2021 13:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615755078; cv=none; d=google.com; s=arc-20160816; b=qsRZo2a63LUclVT6LbT84ud3M91tqIh90o3fUF9RyX/RSB9Q+zojATihZY4QsblQL3 4WkqTe+DloDNwLokTPB/pjMh+NsOwQV3/ClvK4j54I1W3Oj94IUlR8+nX+O+I1isSJ8N flEEHm0hSeKNXDcIhOQHzIjcUwDQ66XJTwDlZ+yvkenmUbMYTEl8k59z7wS3vAsHbGrS h+t4UyamUSXlTQDgxObQw73fYIkgY03j/doFxPcj8MRh0rBtGaMBXWLSi0Ucfj0sXuTb etdTQD6cNSQ1nwOk17Q3OXJ5maro4XlLir17r5X4QFmC+0TqWeRUfbzwdow10G94rapv +zeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=TkyAmAFAwVpLZP5ZvI37HWGnsFvc2heLhMOFieDfSys=; b=MmOW7P6Kx8JerMomeyaFntFqbaS5yauCN/YbXIu3aKHEtbqS4JZR4DW6pLCdwQH0O1 HmpoQB8TGQ1Thg+abXDVi2YoMgkhCSwmS9sQPfhAiwGbKPoZozQh6physyDlX5ato6LT zAAdVrN2qIyjWw1sCilae9rsIZhrU1K9RJMzksh5fhA+0aSO+cI3oB/mpL8m1VmboUmk wnxQ9ww96XyaddG/oNJjxGjCa7sxmvlFXO1JWPLLvyJsiKn7SEYCiZMMTUZ/zzZMYn95 u7KdI/x62wdM2i31v2g0b2QrLN4/CCn8lcHn+yO0Jp8RlHACpcgnwI1kgINFBar4phxe XReQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i20si9112608edq.582.2021.03.14.13.50.55; Sun, 14 Mar 2021 13:51:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233389AbhCNUtv (ORCPT + 99 others); Sun, 14 Mar 2021 16:49:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbhCNUtX (ORCPT ); Sun, 14 Mar 2021 16:49:23 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 61D1BC061574; Sun, 14 Mar 2021 13:49:23 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id EC59192009C; Sun, 14 Mar 2021 21:49:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id DE19592009B; Sun, 14 Mar 2021 21:49:19 +0100 (CET) Date: Sun, 14 Mar 2021 21:49:19 +0100 (CET) From: "Maciej W. Rozycki" To: Tiezhu Yang cc: Thomas Bogendoerfer , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li , David Laight Subject: Re: [PATCH v2] MIPS: Check __clang__ to avoid performance influence with GCC in csum_tcpudp_nofold() In-Reply-To: <1615263493-10609-1-git-send-email-yangtiezhu@loongson.cn> Message-ID: References: <1615263493-10609-1-git-send-email-yangtiezhu@loongson.cn> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 9 Mar 2021, Tiezhu Yang wrote: > diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h > index 1e6c135..80eddd4 100644 > --- a/arch/mips/include/asm/checksum.h > +++ b/arch/mips/include/asm/checksum.h > @@ -128,9 +128,13 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) > > static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, > __u32 len, __u8 proto, > - __wsum sum) > + __wsum sum_in) > { > - unsigned long tmp = (__force unsigned long)sum; > +#ifdef __clang__ > + unsigned long sum = (__force unsigned long)sum_in; > +#else > + __wsum sum = sum_in; > +#endif This looks much better to me, but I'd keep the variable names unchanged as `sum_in' isn't used beyond the initial assignment anyway (you'll have to update the references with asm operands accordingly of course). Have you verified that code produced by GCC remains the same with your change in place as it used to be up to commit 198688edbf77? I can see no such information in the commit description whether here or in the said commit. Maciej