[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <02874ECE860811409154E81DA85FBB5882D4AA53@ORSMSX115.amr.corp.intel.com>
Date: Tue, 3 Apr 2018 16:54:52 +0000
From: "Keller, Jacob E" <jacob.e.keller@...el.com>
To: Bjorn Helgaas <helgaas@...nel.org>,
Jacob Keller <jacob.keller@...il.com>
CC: Tal Gilboa <talgi@...lanox.com>,
Tariq Toukan <tariqt@...lanox.com>,
Ariel Elior <ariel.elior@...ium.com>,
Ganesh Goudar <ganeshgr@...lsio.com>,
"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
"everest-linux-l2@...ium.com" <everest-linux-l2@...ium.com>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>
Subject: RE: [PATCH v5 03/14] PCI: Add pcie_bandwidth_capable() to compute
max supported link bandwidth
> -----Original Message-----
> From: Bjorn Helgaas [mailto:helgaas@...nel.org]
> Sent: Tuesday, April 03, 2018 7:06 AM
> To: Jacob Keller <jacob.keller@...il.com>
> Cc: Tal Gilboa <talgi@...lanox.com>; Tariq Toukan <tariqt@...lanox.com>;
> Keller, Jacob E <jacob.e.keller@...el.com>; Ariel Elior <ariel.elior@...ium.com>;
> Ganesh Goudar <ganeshgr@...lsio.com>; Kirsher, Jeffrey T
> <jeffrey.t.kirsher@...el.com>; everest-linux-l2@...ium.com; intel-wired-
> lan@...ts.osuosl.org; netdev@...r.kernel.org; linux-kernel@...r.kernel.org;
> linux-pci@...r.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 <helgaas@...nel.org> 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
Powered by blists - more mailing lists