netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	Russell King <linux@armlinux.org.uk>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next v3 1/1] phy: micrel: add Signal Quality Indicator (SQI) support for KSZ9477 switch PHYs
Date: Fri, 27 Jun 2025 17:45:49 +0200	[thread overview]
Message-ID: <aF68rU2XQQ8a3ww4@pengutronix.de> (raw)
In-Reply-To: <20250627112539.895255-1-o.rempel@pengutronix.de>

On Fri, Jun 27, 2025 at 01:25:39PM +0200, Oleksij Rempel wrote:
> Add support for the Signal Quality Indicator (SQI) feature on KSZ9477
> family switches, providing a relative measure of receive signal quality.
> 
> The hardware exposes separate SQI readings per channel. For 1000BASE-T,
> all four channels are read. For 100BASE-TX, only one channel is reported,
> but which receive pair is active depends on Auto MDI-X negotiation, which
> is not exposed by the hardware. Therefore, it is not possible to reliably
> map the measured channel to a specific wire pair.
> 
> This resolves an earlier discussion about how to handle multi-channel
> SQI. Originally, the plan was to expose all channels individually.
> However, since pair mapping is sometimes unavailable, this
> implementation treats SQI as a per-link metric instead. This fallback
> avoids ambiguity and ensures consistent behavior. The existing get_sqi()
> UAPI was designed for single-pair Ethernet (SPE), where per-pair and
> per-link are effectively equivalent. Restricting its use to per-link
> metrics does not introduce regressions for existing users.
> 
> The raw 7-bit SQI value (0–127, lower is better) is converted to the
> standard 0–7 (high is better) scale. Empirical testing showed that the
> link becomes unstable around a raw value of 8.
> 
> The SQI raw value remains zero if no data is received, even if noise is
> present. This confirms that the measurement reflects the "quality" during
> active data reception rather than the passive line state. User space
> must ensure that traffic is present on the link to obtain valid SQI
> readings.

Update for this statement: it is valid only if EEE is active. With
disabled EEE, SQI provide correct value even if no data is transferred.

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2025-06-27 15:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-27 11:25 [PATCH net-next v3 1/1] phy: micrel: add Signal Quality Indicator (SQI) support for KSZ9477 switch PHYs Oleksij Rempel
2025-06-27 15:45 ` Oleksij Rempel [this message]
2025-07-02  2:40 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aF68rU2XQQ8a3ww4@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).