Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1940990ybk; Mon, 11 May 2020 08:02:39 -0700 (PDT) X-Google-Smtp-Source: APiQypKQ1shuIXycUZCT/y762y+paaW5N6nrC6vXqbRA+rn7qDF+aU4rnEhaflFt35y9KHkZXqdM X-Received: by 2002:a50:dac4:: with SMTP id s4mr13279568edj.277.1589209358824; Mon, 11 May 2020 08:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589209358; cv=none; d=google.com; s=arc-20160816; b=0Ht0J6tYr2FZvRQRL3tURFvP/2gQ230v2XPN2E6+EAg9U64bg9tJncIkRXJCfRNMu/ Y+yGctIu4WSfPgeTvvZQrEmGwohK/t0c7N7dX141cyKFpaROQnuqZXBLhtf+Bb4hXDAT V3/8COzyL462+9HxZSk5+nZLtkBlQNElJgKDAU0wsgegOhTDc+pjLcVh/mcWXFSp85sx R7wJUsJzhDUFDjktftfafYc6VuosV+LB71zTNF3vuaXmp5bRtUqpyctNUI9XpkQJ9dab CixTnKACcpLDH5ufE5+14fl01aLvZ20crKR6ZHTUCUGmljYzFOyykt7tv0MTNm5lz3NF m/Rw== 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; bh=Ah4pFBe5a7ZxCtV67ETsABd71zNebqpX6AgUVJ7Whmc=; b=Cnp31LlxI5AWgJsj6Lj4m9ATX3drbKAonP5eV1Mdq4PJiKFl4weVQaZ46cYbl44Sju Wgg0R3ngET+7YVb0XUwkgGzaFWrvwDbGFN7vr1vj3m5n+Q8XhxgUNY2EKjti5AhV9qn7 kMSjcVeG3Zx1G9lKTZJIK40NQL8GvMDIeHHBHLcZUUIlVTLuZ0Lr5OlEiGMtK5R2QpIG 2M/9Llf4LbekiIsPYFNZQJCPVNEGvCzU08Kcl8ap32UYh0bqAFG/lAyOfT+aWIinhIeH C6yrZHk/B9ClRe6Kkd6HzHc2sLC7pnJkMpgjL97VqWfRjxEti2tMNy3DfiNI14w0k4Hp OzpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o17si6380342edv.44.2020.05.11.08.01.48; Mon, 11 May 2020 08:02:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729849AbgEKO7a (ORCPT + 99 others); Mon, 11 May 2020 10:59:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:34164 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729766AbgEKO7a (ORCPT ); Mon, 11 May 2020 10:59:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CBD3DADC2; Mon, 11 May 2020 14:59:30 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id 6182A6033E; Mon, 11 May 2020 16:59:26 +0200 (CEST) Date: Mon, 11 May 2020 16:59:26 +0200 From: Michal Kubecek To: Oleksij Rempel Cc: Andrew Lunn , "David S. Miller" , Florian Fainelli , Heiner Kallweit , Jakub Kicinski , Jonathan Corbet , David Jander , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Russell King , mkl@pengutronix.de, Marek Vasut , Christian Herber Subject: Re: signal quality and cable diagnostic Message-ID: <20200511145926.GC8503@lion.mk-sys.cz> References: <20200511141310.GA2543@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200511141310.GA2543@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 11, 2020 at 04:13:10PM +0200, Oleksij Rempel wrote: > > I continue to work on TJA11xx PHY and need to export some additional > cable diagnostic/link stability information: Signal Quality Index (SQI). > The PHY data sheet describes it as following [1]: > ================================================================================ > 6.10.3 Link stability > > The signal-to-noise ratio is the parameter used to estimate link > stability. The PMA Receive function monitors the signal-to-noise ratio > continuously. Once the signal-to-noise ratio falls below a configurable > threshold (SQI_FAILLIMIT), the link status is set to FAIL and > communication is interrupted. The TJA1100 allows for adjusting the > sensitivity of the PMA Receive function by configuring this threshold. > The microcontroller can always check the current value of the > signal-to-noise ratio via the SMI, allowing it to track a possible > degradation in link stability. > ================================================================================ > > Since this functionality is present at least on TJA11xx PHYs and > mandatory according to Open Alliance[2], I hope this functionality is > present on other 100/1000Base-T1 PHYs. So may be some common abstraction > is possible. What would be the best place to provide it for the user > space? According to the [2] SQI, is the part of Dynamic Channel Quality > (DCQ) together with Mean Square Error (MSE) and Peak MSE value (pMSE). IIUC these would be read-only parameters describing current state of the link which can be queried at any time. If this is the case, adding them as attributes to ETHTOOL_MSG_LINKSTATE_GET_REPLY message seems most fitting. As for getting / setting the threshold, perhaps ETHTOOL_MSG_LINKINFO_GET and ETHTOOL_MSG_LINKINFO_SET. Unless you expect more configurable parameters like this in which case we may want to consider adding new request type (e.g. link params or link management). Michal