mbox series

[next,V4,0/8] Report PCI device link status

Message ID 1522394086-3555-1-git-send-email-talgi@mellanox.com
Headers show
Series Report PCI device link status | expand

Message

Tal Gilboa March 30, 2018, 7:14 a.m. UTC
These patches introduce the ability to report PCI link width
and speed for all PCI devices in kernel log.
This would reduce code duplication between drivers and unify
the approach for reporting PCI link status.
Implemented and tested for Mellanox devices.

v4: Reverted most of v2, meaning re-introduced bandwidth limitation calculation.
Limiting device is now returned from the available PCIe bandwidth calculation
function and is logged in kernel log (suggested by Bjorn Helgaas and Jacob E.
Keller).

Applied PCIe encoding overhead to PCIe bandwidth calculation (available/capable).
this way upper bandwidth limit of the device is more accurate.

v3: Add Reviewed-by: Tariq Toukan to all commits.

v2: Remove chain BW calculation. This might be a nice feature, but
without the ability to know the exact limiting part, it is more
confusing than useful.
Remove warnings for failed PCI query actions, leaving only the status
and gaps from max capabilities report.
Use pci_warn()/pci_info() instead of dev_warn()/dev_info().
(suggested by Bjorn Helgaas).

v1: Split to multiple patches, calculate BW limitation and remove
MACRO definition for LNKCAP shift (suggested by Bjorn Helgaas).
Multiple fixes - conventions, typos, function naming and functional
(suggested by Tariq Toukan).

Tal Gilboa (8):
  PCI: Add a query function for PCI device's speed cap
  PCI: Add a query function for PCI device's width cap
  PCI: Add device link bandwidth capabilities calculation
  PCI: Calculate available bandwidth for PCI devices
  PCI: Print PCI device link status in kernel log
  net/mlx4_core: Report PCI properties using dedicated function
  net/mlx5: Report device PCI link status and issues
  net/mlx5e: Use generic PCI function for bandwidth calculation

 drivers/net/ethernet/mellanox/mlx4/main.c         |  81 +----------
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c |  17 +--
 drivers/net/ethernet/mellanox/mlx5/core/main.c    |   4 +
 drivers/pci/pci-sysfs.c                           |  28 ++--
 drivers/pci/pci.c                                 | 161 +++++++++++++++++++++-
 include/linux/pci.h                               |  24 ++++
 6 files changed, 194 insertions(+), 121 deletions(-)

Comments

Jacob Keller March 30, 2018, 4:29 p.m. UTC | #1
> -----Original Message-----
> From: Tal Gilboa [mailto:talgi@mellanox.com]
> Sent: Friday, March 30, 2018 12:15 AM
> To: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Linux PCI <linux-pci@vger.kernel.org>; Tariq Toukan <tariqt@mellanox.com>;
> Saeed Mahameed <saeedm@mellanox.com>; Keller, Jacob E
> <jacob.e.keller@intel.com>; Tal Gilboa <talgi@mellanox.com>
> Subject: [PATCH next V4 0/8] Report PCI device link status
> 
> These patches introduce the ability to report PCI link width
> and speed for all PCI devices in kernel log.
> This would reduce code duplication between drivers and unify
> the approach for reporting PCI link status.
> Implemented and tested for Mellanox devices.
> 
> v4: Reverted most of v2, meaning re-introduced bandwidth limitation calculation.
> Limiting device is now returned from the available PCIe bandwidth calculation
> function and is logged in kernel log (suggested by Bjorn Helgaas and Jacob E.
> Keller).
> 
> Applied PCIe encoding overhead to PCIe bandwidth calculation
> (available/capable).
> this way upper bandwidth limit of the device is more accurate.
> 

I didn't find any objections to the series. We can probably remove the old function in the future once no one uses it anymore.

Acked-by: Jacob Keller <jacob.e.keller@intel.com>

> v3: Add Reviewed-by: Tariq Toukan to all commits.
> 
> v2: Remove chain BW calculation. This might be a nice feature, but
> without the ability to know the exact limiting part, it is more
> confusing than useful.
> Remove warnings for failed PCI query actions, leaving only the status
> and gaps from max capabilities report.
> Use pci_warn()/pci_info() instead of dev_warn()/dev_info().
> (suggested by Bjorn Helgaas).
> 
> v1: Split to multiple patches, calculate BW limitation and remove
> MACRO definition for LNKCAP shift (suggested by Bjorn Helgaas).
> Multiple fixes - conventions, typos, function naming and functional
> (suggested by Tariq Toukan).
> 
> Tal Gilboa (8):
>   PCI: Add a query function for PCI device's speed cap
>   PCI: Add a query function for PCI device's width cap
>   PCI: Add device link bandwidth capabilities calculation
>   PCI: Calculate available bandwidth for PCI devices
>   PCI: Print PCI device link status in kernel log
>   net/mlx4_core: Report PCI properties using dedicated function
>   net/mlx5: Report device PCI link status and issues
>   net/mlx5e: Use generic PCI function for bandwidth calculation
> 
>  drivers/net/ethernet/mellanox/mlx4/main.c         |  81 +----------
>  drivers/net/ethernet/mellanox/mlx5/core/en_main.c |  17 +--
>  drivers/net/ethernet/mellanox/mlx5/core/main.c    |   4 +
>  drivers/pci/pci-sysfs.c                           |  28 ++--
>  drivers/pci/pci.c                                 | 161 +++++++++++++++++++++-
>  include/linux/pci.h                               |  24 ++++
>  6 files changed, 194 insertions(+), 121 deletions(-)
> 
> --
> 1.8.3.1
Bjorn Helgaas March 30, 2018, 8:36 p.m. UTC | #2
On Fri, Mar 30, 2018 at 10:14:38AM +0300, Tal Gilboa wrote:
> These patches introduce the ability to report PCI link width
> and speed for all PCI devices in kernel log.
> This would reduce code duplication between drivers and unify
> the approach for reporting PCI link status.
> Implemented and tested for Mellanox devices.

This is awesome.

I reworked a few things and converted the remaining users of
pcie_get_minimum_link().  I'll post the result as a V5 of this series and
you can see what you think.  Hopefully I didn't break too many things.

Bjorn