Received: by 10.213.65.68 with SMTP id h4csp54761imn; Fri, 30 Mar 2018 14:08:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/SSBgYLjUNRWKJ37f0zUG2xW89mtsPNcYTrRMLNLS6UGoPn1s4KVWxOGUW2ANzJ6YGk7vE X-Received: by 2002:a17:902:6b01:: with SMTP id o1-v6mr565545plk.350.1522444086085; Fri, 30 Mar 2018 14:08:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522444086; cv=none; d=google.com; s=arc-20160816; b=jxV5tvwzIacIi6xb/UdtD2EhpetH6VoFVmWNuBEV9DOAn/2dqABf5JA6XaQ+iTstrj CfN7Mp4mBf94aD071HaTk1Db6PWEbSxMHPdzLR+QueBwbY86jRwZDhVJHoqdU3IylwaU UbW4kWD/O7oVRutV+t0hh03wAWsE+2QF793nDSEsx6CABRHosnZiZ10O1GRmAsfGqqJo 4zdzdwWc+qxvA6SKrPaVTgQa5UMkwOBLqp+aGMdtAMHlSBPExk6Eg2OASL6zHwQz6uOD FLMYYf6AzzXvBozKSvE+D8jRrhUKaBF01gUdEl6SmSYCEl2r6SxvrimXde4/vuGcPvax t7kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dmarc-filter:arc-authentication-results; bh=NXfSB/6Yi5MWPi4SuxSeYxuFwUMaHjBn/2Q7166EKpk=; b=HVny5WCChDNcSvFdfDzeCvm2rXtZgeAy53SRo2t/XBz+DLRgfLBNqrpLe7wva79o1E eGZ/Tpwjl1wtDf+bRkvZ5eUMFTlGgakWN9Kq07+PNUIqBJcMJAy+Ydxui7EFgJV3CN58 VABW1yx1VzqnfkljqLsDFp282l7wFnci7lx9fOV6zhHUj1GhUBsMaC6rXhFlPofqW3ck gd4LOEpnaJ3y3HGYO23FRwXT5Iepd1aJ7vzibVGsAkQYrS3nObE8I8nxOJxAEuHCU2DC RkWiuxeYB7GofW7VPhZBWBgEgEb6hyp224s51LoJbNWu7vn3+JZDt21hghrEaEURJNPe Ajmw== 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 u9si6109524pge.641.2018.03.30.14.07.52; Fri, 30 Mar 2018 14:08:06 -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 S1753167AbeC3VGB (ORCPT + 99 others); Fri, 30 Mar 2018 17:06:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:33852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752774AbeC3VF6 (ORCPT ); Fri, 30 Mar 2018 17:05:58 -0400 Received: from localhost (unknown [69.71.5.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 435EC21777; Fri, 30 Mar 2018 21:05:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 435EC21777 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Subject: [PATCH v5 10/14] bnxt_en: Report PCIe link properties with pcie_print_link_status() From: Bjorn Helgaas To: Tal Gilboa Cc: Tariq Toukan , Jacob Keller , Ariel Elior , Ganesh Goudar , Jeff Kirsher , 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 Date: Fri, 30 Mar 2018 16:05:55 -0500 Message-ID: <152244395584.135666.5051262627122405867.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <152244269202.135666.3064353823697623332.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <152244269202.135666.3064353823697623332.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Helgaas Use pcie_print_link_status() to report PCIe link speed and possible limitations instead of implementing this in the driver itself. Note that pcie_get_minimum_link() can return misleading information because it finds the slowest link and the narrowest link without considering the total bandwidth of the link. If the path contains a 16 GT/s x1 link and a 2.5 GT/s x16 link, pcie_get_minimum_link() returns 2.5 GT/s x1, which corresponds to 250 MB/s of bandwidth, not the actual available bandwidth of about 2000 MB/s for a 16 GT/s x1 link. Signed-off-by: Bjorn Helgaas --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 1500243b9886..3be42431e029 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -8469,22 +8469,6 @@ static int bnxt_init_mac_addr(struct bnxt *bp) return rc; } -static void bnxt_parse_log_pcie_link(struct bnxt *bp) -{ - enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN; - enum pci_bus_speed speed = PCI_SPEED_UNKNOWN; - - if (pcie_get_minimum_link(pci_physfn(bp->pdev), &speed, &width) || - speed == PCI_SPEED_UNKNOWN || width == PCIE_LNK_WIDTH_UNKNOWN) - netdev_info(bp->dev, "Failed to determine PCIe Link Info\n"); - else - netdev_info(bp->dev, "PCIe: Speed %s Width x%d\n", - speed == PCIE_SPEED_2_5GT ? "2.5GT/s" : - speed == PCIE_SPEED_5_0GT ? "5.0GT/s" : - speed == PCIE_SPEED_8_0GT ? "8.0GT/s" : - "Unknown", width); -} - static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { static int version_printed; @@ -8694,8 +8678,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) netdev_info(dev, "%s found at mem %lx, node addr %pM\n", board_info[ent->driver_data].name, (long)pci_resource_start(pdev, 0), dev->dev_addr); - - bnxt_parse_log_pcie_link(bp); + pcie_print_link_status(pdev); return 0;