Received: by 10.213.65.68 with SMTP id h4csp2760249imn; Mon, 2 Apr 2018 13:33:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx49CV3TZtM8U9Ci0ZHSi5XVbp724gWOyDnr40Qc0nENbs8AHkYzWiaBvhxaYFWqZZsJjg5du X-Received: by 10.101.93.2 with SMTP id e2mr7141161pgr.100.1522701193110; Mon, 02 Apr 2018 13:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522701193; cv=none; d=google.com; s=arc-20160816; b=kxDyxdoZ4r4jsEBWCS4LLzOn8KrU93bgq0Vow+xTc4caomdyn1S3TCFbrB5vN7FV27 TPx3YnTgSIye4KnnpOzHZhoC6FBq9UgGsEvSRcLH83aHkFykvhfBR43cuCh78rMusEF9 n9dAy7W/a769u4Bay7WiPKhLPxSvEzVTTA03UsCa/hRuK+7r2NJt8rRS5XGrehW2fvYB EDZtL00YX8uXuljJlqrvSJHK/dquMr1YA0uJA4zL2TWZ6K0mVFL6Y1JhlecAaAq+8r// ya6NMO6PaRCir5xEV2Eigv17Tsbtf+HspUSrdyEVHkvbcYQIZ3G6biAmAL8Qm8Mzzd+B hbPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:arc-authentication-results; bh=oEFCS9zbi9n+e8bRQzq9kxasefRm9ovnrMQaSQ/My+8=; b=xhOPfPWaIFs1hjXP7Bh+ucnhjlpYKZxTlQVfgp2X+m9UsqJEndhIaSUfAWw6skkTKl CdjfM4yG3EeAByCb/w15oOnMEtGN8ywzun4Tp4KKK2Blc7I/ivS7DMVi4GBtTQqp/cVZ dS3wyKxDXjVmZ1J4qsqkrUhstZ928DziN1YtLlRVknloPkGvopydikzmPzeMHEGfn1VQ 0bRuNWsAVRAdo0dBwl+hLSJUEKHpGG1afJwmWyJKOIPbFl4+DXJFg07PNsucdGkzmQiJ geTpweF71VZa0Fu6TfAjmjxfKh3simQJ4kpasxmanyFiZZQnVElvB1X6hba2sI+hy7Se C9pQ== 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 x190si742337pgx.378.2018.04.02.13.32.58; Mon, 02 Apr 2018 13:33:13 -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 S932456AbeDBUbs (ORCPT + 99 others); Mon, 2 Apr 2018 16:31:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:39722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756748AbeDBUbr (ORCPT ); Mon, 2 Apr 2018 16:31:47 -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 017D620838; Mon, 2 Apr 2018 20:31:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 017D620838 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 Date: Mon, 2 Apr 2018 15:31:44 -0500 From: Bjorn Helgaas To: "Keller, Jacob E" Cc: Tal Gilboa , Tariq Toukan , Ariel Elior , Ganesh Goudar , "Kirsher, Jeffrey T" , "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" Subject: Re: [PATCH v5 12/14] fm10k: Report PCIe link properties with pcie_print_link_status() Message-ID: <20180402203144.GM9322@bhelgaas-glaptop.roam.corp.google.com> References: <152244269202.135666.3064353823697623332.stgit@bhelgaas-glaptop.roam.corp.google.com> <152244397259.135666.12655029447932912161.stgit@bhelgaas-glaptop.roam.corp.google.com> <02874ECE860811409154E81DA85FBB5882D497EE@ORSMSX115.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <02874ECE860811409154E81DA85FBB5882D497EE@ORSMSX115.amr.corp.intel.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 02, 2018 at 03:56:06PM +0000, Keller, Jacob E wrote: > > -----Original Message----- > > From: Bjorn Helgaas [mailto:helgaas@kernel.org] > > Sent: Friday, March 30, 2018 2:06 PM > > To: Tal Gilboa > > Cc: Tariq Toukan ; Keller, Jacob E > > ; Ariel Elior ; Ganesh > > Goudar ; Kirsher, Jeffrey T > > ; 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 > > Subject: [PATCH v5 12/14] fm10k: Report PCIe link properties with > > pcie_print_link_status() > > > > 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. > > This comment is about what's being fixed, so it would have been easier to > parse if it were written to more clearly indicate that we're removing > (and not adding) this behavior. Good point. Is this any better? fm10k: Report PCIe link properties with pcie_print_link_status() Previously the driver used pcie_get_minimum_link() to warn when the NIC is in a slot that can't supply as much bandwidth as the NIC could use. pcie_get_minimum_link() can be misleading because it finds the slowest link and the narrowest link (which may be different links) without considering the total bandwidth of each link. For a path with a 16 GT/s x1 link and a 2.5 GT/s x16 link, it returns 2.5 GT/s x1, which corresponds to 250 MB/s of bandwidth, not the true available bandwidth of about 1969 MB/s for a 16 GT/s x1 link. Use pcie_print_link_status() to report PCIe link speed and possible limitations instead of implementing this in the driver itself. This finds the slowest link in the path to the device by computing the total bandwidth of each link and compares that with the capabilities of the device. Note that the driver previously used dev_warn() to suggest using a different slot, but pcie_print_link_status() uses dev_info() because if the platform has no faster slot available, the user can't do anything about the warning and may not want to be bothered with it.