Received: by 10.213.65.68 with SMTP id h4csp3742379imn; Tue, 3 Apr 2018 09:56:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+/9tSJWv7hge5q++jRRz4fQ5uI8f+bKTKHXSk16NSl/S7lY9uoyIIQvzwValYONJH2TjfJ X-Received: by 2002:a17:902:36a:: with SMTP id 97-v6mr14693965pld.186.1522774578990; Tue, 03 Apr 2018 09:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522774578; cv=none; d=google.com; s=arc-20160816; b=i2SSHwRIJv0LVlY3Wce4R+IW0HMzacj/UE6G/UjUL+L2hXGi+5z8vk8gVUWDfEetxd rHzfsHBb4xsnrxQcNKBHksvo7UNbzpkfLWbQyIQi1OtY4jJ9WAPyiiGkr649NCWq5wdT BpSl7Ne5evorKtScKqPun6KTTj1cS6olltY7dnn5c2CqsoUDJkIfm4VPkBTg1/ZId6n7 DAcKGw6fLwBzTN37mB9oH+VKJLJzlG1kBAUqM8viD70Bd0dyTF5qV7jtUp4P39lVPC0r W3fjj6Ki7IhTFw1HoP7XuxPqV/05SoK5hwFsY2iYjjNxkYiGnlVq3CAJA4BPqW7rDLlc FEag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=ZyUtNQDq0lexUb+Wurn0c48Uxf92HwAw2s27A7rfVQM=; b=XH+ei+Nt2wb+3Y8KfTUBPzw4R1DHIT/BpRB3BC6WUddQrtsKDC6Ab67LZRS5oBB9Jt 0n3yRenynWyeQSBTUhDoTsBKo8MdcHXGWZXMfByTUFb6GgBzWh+yJDQMkQxc2q2geknQ Y4S/FyXgvka98DkElEBWSE/FhVUfow0I4O7JMhuo1WAkrixTBL9azepavrJH/NbgHqxd 8dW2ZgCtD3Zti2Cf0LGL7HjgpD68Z7/THSg4qF36Tr5fkyRY7KN32T48xE1VfkJGiate G2+8RSixRBs/G66BSx1F+edQeJ0BK3p6mA4yPkucCXs0YtC2e1Y+wYGfzULMGhA0xdE6 c4Eg== 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 h1-v6si885871pld.222.2018.04.03.09.56.04; Tue, 03 Apr 2018 09:56:18 -0700 (PDT) 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 S1752307AbeDCQy4 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 3 Apr 2018 12:54:56 -0400 Received: from mga18.intel.com ([134.134.136.126]:59973 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbeDCQyy (ORCPT ); Tue, 3 Apr 2018 12:54:54 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2018 09:54:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,401,1517904000"; d="scan'208";a="40391597" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by orsmga003.jf.intel.com with ESMTP; 03 Apr 2018 09:54:53 -0700 Received: from orsmsx112.amr.corp.intel.com (10.22.240.13) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 3 Apr 2018 09:54:53 -0700 Received: from orsmsx115.amr.corp.intel.com ([169.254.4.6]) by ORSMSX112.amr.corp.intel.com ([169.254.3.146]) with mapi id 14.03.0319.002; Tue, 3 Apr 2018 09:54:52 -0700 From: "Keller, Jacob E" To: Bjorn Helgaas , Jacob Keller CC: Tal Gilboa , Tariq Toukan , Ariel Elior , Ganesh Goudar , "Kirsher, Jeffrey T" , "everest-linux-l2@cavium.com" , "intel-wired-lan@lists.osuosl.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" Subject: RE: [PATCH v5 03/14] PCI: Add pcie_bandwidth_capable() to compute max supported link bandwidth Thread-Topic: [PATCH v5 03/14] PCI: Add pcie_bandwidth_capable() to compute max supported link bandwidth Thread-Index: AQHTyGrIFr77DKg4/kStVKf2xuGFuqPs12iAgABDmICAAHO3AIAAbPqAgACu3wCAAOOzAP//ucyQ Date: Tue, 3 Apr 2018 16:54:52 +0000 Message-ID: <02874ECE860811409154E81DA85FBB5882D4AA53@ORSMSX115.amr.corp.intel.com> References: <152244269202.135666.3064353823697623332.stgit@bhelgaas-glaptop.roam.corp.google.com> <152244390359.135666.14890735614456271032.stgit@bhelgaas-glaptop.roam.corp.google.com> <31e66048-e8b8-47ba-baf5-023560b4c124@mellanox.com> <20180402004049.GA131023@bhelgaas-glaptop.roam.corp.google.com> <50346f44-de3f-b226-69ad-6de45e94e261@mellanox.com> <20180402140501.GA244675@bhelgaas-glaptop.roam.corp.google.com> <20180403140552.GB60020@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20180403140552.GB60020@bhelgaas-glaptop.roam.corp.google.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTMwZmZjODgtYWIyNS00ZWU1LWJlODQtYTlmM2UzZmNhNGMzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlloTDM5MmozSnY0NzR6MDQrbHN3XC92a3Z0bVNHcUFCWXBwTHlCdUsxK09NPSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Bjorn Helgaas [mailto:helgaas@kernel.org] > Sent: Tuesday, April 03, 2018 7:06 AM > To: Jacob Keller > Cc: Tal Gilboa ; Tariq Toukan ; > Keller, Jacob E ; Ariel Elior ; > Ganesh Goudar ; Kirsher, Jeffrey T > ; everest-linux-l2@cavium.com; intel-wired- > lan@lists.osuosl.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; > linux-pci@vger.kernel.org > Subject: Re: [PATCH v5 03/14] PCI: Add pcie_bandwidth_capable() to compute > max supported link bandwidth > > On Mon, Apr 02, 2018 at 05:30:54PM -0700, Jacob Keller wrote: > > On Mon, Apr 2, 2018 at 7:05 AM, Bjorn Helgaas wrote: > > > +/* PCIe speed to Mb/s reduced by encoding overhead */ > > > +#define PCIE_SPEED2MBS_ENC(speed) \ > > > + ((speed) == PCIE_SPEED_16_0GT ? (16000*(128/130)) : \ > > > + (speed) == PCIE_SPEED_8_0GT ? (8000*(128/130)) : \ > > > + (speed) == PCIE_SPEED_5_0GT ? (5000*(8/10)) : \ > > > + (speed) == PCIE_SPEED_2_5GT ? (2500*(8/10)) : \ > > > + 0) > > > + > > > > Should this be "(speed * x ) / y" instead? wouldn't they calculate > > 128/130 and truncate that to zero before multiplying by the speed? Or > > are compilers smart enough to do this the other way to avoid the > > losses? > > Yep, thanks for saving me yet more embarrassment. That's what patch review is for :D Thanks, Jake