Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6293153imm; Mon, 23 Jul 2018 15:15:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdhHmr9tg8QyxqnT+SQEIruTRuXATDQorCe0HA/wMeBz3FX6+PlZYW6G/k96NF2JuFa0+WT X-Received: by 2002:a62:cc4d:: with SMTP id a74-v6mr15076971pfg.200.1532384151672; Mon, 23 Jul 2018 15:15:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532384151; cv=none; d=google.com; s=arc-20160816; b=dajUP5hs0pgGu8hgylB1cEVVr4jcbWPoSRJc26IiGnf+29LOVxwP6DHHYJvrwkZIV7 yx1hv5d7IVwtp1GJTIkvNqfHiRaFRHpPi9dvErruAbwxFpkzkkxEBDSeZLpZS1n+Xrmm qwIgVf0O66SCHNwDWxxRDxiF+3CzNqf3T0ZJ1gvWNhcXJIKJI2SHlvrZPmPG7fObs2N4 f0HxuufstQbYfcse/85DnpxMTmFiYv18ZKMoVbuzUoX1eENW9cYZ2htsQCWUcj+c2ncI 3eFIjbz2Y30YF+ocUYbNknPzDJKSvNNM5UizZYLnFvBrPEs+s4iT8DkTyhbKUHHZrEj8 FZeg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature:arc-authentication-results; bh=KrkqEjJFOsHl+Iwy5c5qahdjQwUj6SbT9QwR396+5O4=; b=KvH4t/dZBF43AKI4T6ocf7WThuLLSIaLdO5FDJwsS004OXWSgBaQA2Juqxntl3F0Ui tb+o8A1ylM3qG5dwPrCgSFchUCJWPkhmxRbs6mrX9QISvtqDeQF8DQO52CmuvJHY03Pl SYieVY0OyGpLXyXWy/g3/iORB+Tyr4i5+cMvWInlIrbuuC3XUUVZ4w+qjMG8z5Z4oywE b0RgFm5kBCAT8yeotJZCxJA9ZdpELfL1OIrkfaSCnNvKSfgmPPIOXiQpKoAJTa2qQoHu O2HS36+8ns1HbgNPpnTWXMZxg3LM3A01yWUJ5Ln4gamZgH5x/Ptfzx4WInW2X+fMUko6 B/Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b="Rzwj3/8Y"; 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 c2-v6si8396907plb.394.2018.07.23.15.15.37; Mon, 23 Jul 2018 15:15:51 -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; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b="Rzwj3/8Y"; 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 S2388224AbeGWXSE (ORCPT + 99 others); Mon, 23 Jul 2018 19:18:04 -0400 Received: from mail-qt0-f178.google.com ([209.85.216.178]:43058 "EHLO mail-qt0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388199AbeGWXSD (ORCPT ); Mon, 23 Jul 2018 19:18:03 -0400 Received: by mail-qt0-f178.google.com with SMTP id f18-v6so2270292qtp.10 for ; Mon, 23 Jul 2018 15:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=KrkqEjJFOsHl+Iwy5c5qahdjQwUj6SbT9QwR396+5O4=; b=Rzwj3/8YxsgdqD/dJeXu4PMZ/fgiJmFdjsqWHpw/kA4j/21hccDT8reQhG4rHE0Mqb t1FlXURVf9Raw4KmkfE2K4x2gjUpB9AXD8IZ0Moqg4vKJokIXRlLjtNo2WtpP0zNgPCK anPAB2I845vatUXigmgwHH4I0eAaAwoPCPcoOjvwAQCuf0nsaczIUHN1cutHz9QS+sgH j0MNYK3j5DCF5mwqDILa6JzPsXi5L41GOO9Ae08143bArZyaF+ADu4YTBz7fz8hDZth6 aHdLO7w8Q11rh/22JDEVYd9fAJgnVI+3HSdH8RR75o6U1u1ro4WtZJ6g5AqOlTxIcg9S qx9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=KrkqEjJFOsHl+Iwy5c5qahdjQwUj6SbT9QwR396+5O4=; b=IL44mOBlBAcl3qZqiwQ5UxXVnVDHGhajuGJ9bLUxJURg0dSS0ylc9BtiDN4sW7RA4m sTaFsiFGjWiyE3WuTZIUPVxZzOYiST9uGnz2NaEnrbUi238zpz2ast+NALM9BbDWKmQ9 vthdKB/eq+Y7DrC7YcsEYtd3/yQ7Rk/kQlswHAlRGM7VikYaiWfqZu9T4KFnwpbqqFGG mFibwy1geDBZ66caiP3zXL59IjcSyam9jjDIEg3MiuhY+4JvRfs/UD3zD+C0LRLYerOe gLbYT8sAkycblCkJ+7twkZ7JWU6oCo9s2XdnxVHS2CqGyiA55bWgMYF3t+psVk9W3sMs IAxg== X-Gm-Message-State: AOUpUlFZpTuwF3FvSJUpbXLuwkT5Y3aWmYmQnza+Zvsxe2lD39hEXE3p rVcv9JVSzoKepSMkHCCj+EH15g== X-Received: by 2002:a0c:f9c8:: with SMTP id j8-v6mr12938786qvo.177.1532384084575; Mon, 23 Jul 2018 15:14:44 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id r27-v6sm10832223qkr.17.2018.07.23.15.14.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 15:14:44 -0700 (PDT) Date: Mon, 23 Jul 2018 15:14:39 -0700 From: Jakub Kicinski To: Tal Gilboa Cc: Alexandru Gagniuc , "linux-pci@vger.kernel.org" , "bhelgaas@google.com" , "keith.busch@intel.com" , "alex_gagniuc@dellteam.com" , "austin_bolen@dell.com" , "shyam_iyer@dell.com" , "jeffrey.t.kirsher@intel.com" , "ariel.elior@cavium.com" , "michael.chan@broadcom.com" , "ganeshgr@chelsio.com" , Tariq Toukan , "airlied@gmail.com" , "alexander.deucher@amd.com" , "mike.marciniszyn@intel.com" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v5] PCI: Check for PCIe downtraining conditions Message-ID: <20180723151439.50524a2a@cakuba.netronome.com> In-Reply-To: References: <20180718215359.GG128988@bhelgaas-glaptop.roam.corp.google.com> <20180723200339.23943-1-mr.nuke.me@gmail.com> <20180723140143.1a46902f@cakuba.netronome.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Jul 2018 00:52:22 +0300, Tal Gilboa wrote: > On 7/24/2018 12:01 AM, Jakub Kicinski wrote: > > On Mon, 23 Jul 2018 15:03:38 -0500, Alexandru Gagniuc wrote: > >> PCIe downtraining happens when both the device and PCIe port are > >> capable of a larger bus width or higher speed than negotiated. > >> Downtraining might be indicative of other problems in the system, and > >> identifying this from userspace is neither intuitive, nor > >> straightforward. > >> > >> The easiest way to detect this is with pcie_print_link_status(), > >> since the bottleneck is usually the link that is downtrained. It's not > >> a perfect solution, but it works extremely well in most cases. > >> > >> Signed-off-by: Alexandru Gagniuc > >> --- > >> > >> For the sake of review, I've created a __pcie_print_link_status() which > >> takes a 'verbose' argument. If we agree want to go this route, and update > >> the users of pcie_print_link_status(), I can split this up in two patches. > >> I prefer just printing this information in the core functions, and letting > >> drivers not have to worry about this. Though there seems to be strong for > >> not going that route, so here it goes: > > > > FWIW the networking drivers print PCIe BW because sometimes the network > > bandwidth is simply over-provisioned on multi port cards, e.g. 80Gbps > > card on a x8 link. > > > > Sorry to bike shed, but currently the networking cards print the info > > during probe. Would it make sense to move your message closer to probe > > time? Rather than when device is added. If driver structure is > > available, we could also consider adding a boolean to struct pci_driver > > to indicate if driver wants the verbose message? This way we avoid > > duplicated prints. > > > > I have no objection to current patch, it LGTM. Just a thought. > > I don't see the reason for having two functions. What's the problem with > adding the verbose argument to the original function? IMHO it's reasonable to keep the default parameter to what 90% of users want by a means on a wrapper. The non-verbose output is provided by the core already for all devices. What do you think of my proposal above Tal? That would make the extra wrapper unnecessary since the verbose parameter would be part of the driver structure, and it would avoid the duplicated output.