]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Use pcie_bandwidth_available() to compute bandwidth
authorTal Gilboa <talgi@mellanox.com>
Fri, 30 Mar 2018 14:01:51 +0000 (09:01 -0500)
committerBjorn Helgaas <helgaas@kernel.org>
Tue, 3 Apr 2018 13:58:33 +0000 (08:58 -0500)
commit57c1ef18683463b5edaa85ed89ac377129220a37
tree28dd8eb0a75acbfc0958bf8e8ef5e771ba308dfb
parent6ad02f715b443ceb0ae34c1e550a45f8ba559c92
net/mlx5e: Use pcie_bandwidth_available() to compute bandwidth

Use the new pci_bandwidth_available() function to calculate maximum
available bandwidth through the PCI chain instead of computing it ourselves
with mlx5e_get_pci_bw().

This is used to detect when the device is capable of more bandwidth than is
available in the current slot.  The driver may adjust compression settings
accordingly.

Note that pci_bandwidth_available() accounts for PCIe encoding overhead, so
it is more accurate than mlx5e_get_pci_bw() was.

Signed-off-by: Tal Gilboa <talgi@mellanox.com>
[bhelgaas: remove mlx5e_get_pci_bw() wrapper altogether]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c