Received: by 10.223.176.5 with SMTP id f5csp212288wra; Thu, 1 Feb 2018 18:46:21 -0800 (PST) X-Google-Smtp-Source: AH8x224c6tB0HcHI/RaU1KSV0l4Ql88Qywe6U9zk2B9d2yFUriMW46T+1JwZxOijRKKTuO+fNkrF X-Received: by 2002:a17:902:221:: with SMTP id 30-v6mr34355242plc.134.1517539581724; Thu, 01 Feb 2018 18:46:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517539581; cv=none; d=google.com; s=arc-20160816; b=SQNhf1IDM8INvJizZfbZqx88lMNTdwHLkEioYgr0UjdcRZC08eyvBzFRTjX0nzvBCl tNGGLR11FrujU5EadNQp7ItlWJCnzAKP5bxr0qzYDq/MK4ils9sFbZfFjHEI3JF+ZXgs 8jOo4srDUfWDzuKg1Q1s4pdI8cwfWsmxpLZ/rfjblSIw3y4ZJywP9+uYwt3QJt3maE7Z dExQT5ffCt9Ow2ycq9ouNk0geA9haQLWAozIYvm8Q63Ia4J68ANb+5aAUGzCOZRDFkoY lOKYCGclUskXtgQoNqcg0dp/97aWOK3P2cYM/FK55PlOMqSzbFsSAIyJ9qJQ5YOnN8NE ZzmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :user-agent:in-reply-to:references:subject:cc:to:from:message-id :date:arc-authentication-results; bh=4s/gyyG84c7YBSkUkhMcxov1wxsNuS3pndakjckzrNc=; b=fU8t/FLR5zUwvWBw4mJAUZLqaZ/Qj75l2oQyjBvyOff3jluiqa+riXUE90Lp4LIDVp e32u2bSFbu0O0TrYMZqHd0a5asAl0WlCzLVx6Bv7dWDTT+Vu/HyNYX6e/R/QLiOHJ/uj 1fGEcf5bJOyrt1vPxZ2Wi5NPd2MyY1ukABjPRuAkiqO16vpgRguAeRj3sbNxfj/2m4D9 fv9JHsHDZuKVWdkYY2+MYOTeZWdKHjNTD43y8sjf0HOKudse3NrQwVDJ25V1ChEpu6IC N1a/C+DeIJkDgQxhDvRl+0/C5LrBouzSUaTlU9/2pSACVsMwOx6dbuf8iYjdvhWq1i0V FXjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b92-v6si872835plb.51.2018.02.01.18.46.06; Thu, 01 Feb 2018 18:46:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755070AbeBBCg1 (ORCPT + 99 others); Thu, 1 Feb 2018 21:36:27 -0500 Received: from gateway24.websitewelcome.com ([192.185.50.66]:48413 "EHLO gateway24.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753803AbeBBCgU (ORCPT ); Thu, 1 Feb 2018 21:36:20 -0500 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway24.websitewelcome.com (Postfix) with ESMTP id A3CF2C2E2 for ; Thu, 1 Feb 2018 20:32:07 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id hR95eCRNYmzEzhR95eG3Dz; Thu, 01 Feb 2018 20:32:07 -0600 Received: from gator4166.hostgator.com ([108.167.133.22]:43053) by gator4166.hostgator.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1ehR93-000u4M-9t; Thu, 01 Feb 2018 20:32:05 -0600 Received: from 189.152.201.65 ([189.152.201.65]) by gator4166.hostgator.com (Horde Framework) with HTTPS; Thu, 01 Feb 2018 20:32:05 -0600 Date: Thu, 01 Feb 2018 20:32:05 -0600 Message-ID: <20180201203205.Horde.YtKPm_GK0EOCMEr9mvnfcDd@gator4166.hostgator.com> From: "Gustavo A. R. Silva" To: Andrew Lunn Cc: Alan Cox , "Gustavo A. R. Silva" , "Wong Hoi Sing, Edison" , "Hung Hing Lun, Mike" , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tcp_lp: use 64-bit arithmetic instead of 32-bit References: <20180201002407.GA1608@embeddedgus> <20180201003236.06143fd0@alans-desktop> <20180131190749.Horde.bsc7GhewsZwdnkmDtMlSwWO@gator4166.hostgator.com> <20180201015126.GH16547@lunn.ch> In-Reply-To: <20180201015126.GH16547@lunn.ch> User-Agent: Horde Application Framework 5 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 108.167.133.22 X-Source-L: Yes X-Exim-ID: 1ehR93-000u4M-9t X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: gator4166.hostgator.com [108.167.133.22]:43053 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 2 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, Quoting Andrew Lunn : > On Wed, Jan 31, 2018 at 07:07:49PM -0600, Gustavo A. R. Silva wrote: >> >> Hi Alan, >> >> Quoting Alan Cox : >> >> >On Wed, 31 Jan 2018 18:24:07 -0600 >> >"Gustavo A. R. Silva" wrote: >> > >> >>Cast to s64 some variables and a macro in order to give the >> >>compiler complete information about the proper arithmetic to >> >>use. Notice that these elements are used in contexts that >> >>expect expressions of type s64 (64 bits, signed). >> >> >> >>Currently such expression are being evaluated using 32-bit >> >>arithmetic. >> > >> >The question you need to ask is 'can it overflow 32bit maths', otherwise >> >you are potentially making the system do extra work for no reason. >> > >> >> Yeah, I get your point and it seems that in this particular case there is no >> risk of a 32bit overflow, but in general and IMHO as the code evolves, the >> use of incorrect arithmetic may have security implications in the future, so >> I advocate for code correctness in this case. > > Hi Gustavo > > Is this on the hotpath? How much overhead does it add to 32 bit > architectures which don't have 64 bit arithmetic in hardware? There > are a lot of embedded systems which are 32 bit. > I'm sorry, I don't have access to 32-bit hardware at the moment. Thanks -- Gustavo