summaryrefslogtreecommitdiff
path: root/drivers/pci/switch
diff options
context:
space:
mode:
authorTal Gilboa <talgi@mellanox.com>2018-03-30 08:37:44 -0500
committerBjorn Helgaas <helgaas@kernel.org>2018-04-03 08:58:29 -0500
commit6db79a88c67e4679d9c1e4a3f05c6385e21f6e9a (patch)
tree0a382af9924ea5146d648539fb4ea993c940e499 /drivers/pci/switch
parentb852f63aa6cee3f4846383377c414ae9c4fbc166 (diff)
PCI: Add pcie_bandwidth_available() to compute bandwidth available to device
Add pcie_bandwidth_available() to compute the bandwidth available to a device. This may be limited by the device itself or by a slower upstream link leading to the device. The available bandwidth at each link along the path is computed as: link_width * link_speed * (1 - encoding_overhead) 2.5 and 5.0 GT/s links use 8b/10b encoding, which reduces the raw bandwidth available by 20%; 8.0 GT/s and faster links use 128b/130b encoding, which reduces it by about 1.5%. The result is in Mb/s, i.e., megabits/second, of raw bandwidth. Also return the device with the slowest link and the speed and width of that link. Signed-off-by: Tal Gilboa <talgi@mellanox.com> [bhelgaas: changelog, leave pcie_get_minimum_link() alone for now, return bw directly, use pci_upstream_bridge(), check "next_bw <= bw" to find uppermost limiting device, return speed/width of the limiting device] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/switch')
0 files changed, 0 insertions, 0 deletions