From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC920344DA2 for ; Mon, 23 Feb 2026 09:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.13.80.246 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771837525; cv=none; b=rxzy21eHe6qXM2Pd0Z9e2Iwba0lhaa95XgXr4SfRA1Uv6K2qcblEqGpERiDKFtN2KbGlzG3Au43v60rvUVtwBSSMJmJR4CkcYPjB15o7sRD70hAD+PpWWRBfAGjpLhHDBsSk+Xe8kQbYuxbXLc0q5cwXZGUUfBTguyPyusvJPeg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771837525; c=relaxed/simple; bh=1LW1E3LuSHZZLirWNhCOrjialXghfkH+3l8NGLMu1X0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ag/8nsQ0ev/9dQpS6QwxfSQFiphZpgTh5bTTQjpBPTGy5Q5x4mLa2KJkctK0V6o5x78DXETVQV2cWAS+DXr4nxIMIQOCz8nhgdCFdKyxYJCncqLlj9qh89di2ypHGwRbeYx7lgmMRpnKSpoNC1ie4dm2WlAttowIHWcat+WrgzM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b=LtK/2SZ/; arc=none smtp.client-ip=194.13.80.246 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b="LtK/2SZ/" Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CE9E8A3ED1; Mon, 23 Feb 2026 10:05:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1771837522; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=hJs2yHp/wBGdoLlkdTjcS3vHsvQYBcvszxjelptE81s=; b=LtK/2SZ/9lw2mN3WnsoWPvj9KA7ThUZ2EFo1yvAvg6KuoYhzzAOAPQQyq5i9jGV/yKUJo1 /XoXMj34jYFiQdOIcnGxA+UWaNTKGucTRkYCGLRN1TvDTSOPpUK4/kOB0lQXsdMfX7pKkr rjFF9+YH7fWws/19FhXKvTmPFHm2Gw6pmUlPYcVVmKlX0UYJpnGASCu8x/8+YXKFR4rGvE Y10ANU3j9YHLyBCv3JDhZf47RXTsFp55Zv1Ml+P5BAcb6xjbUrnmk4kBophaWxsH+xEVxF q7vXwCbi0PmM+0czFptL8jAe3qegHfsLyCFJmaXFashfKShsPLEsHMwH5SRxJA== From: Nicolai Buchwitz To: netdev@vger.kernel.org Cc: andrew+netdev@lunn.ch, claudiu.beznea@tuxon.dev, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, nicolas.ferre@microchip.com, pabeni@redhat.com, linux@armlinux.org.uk, Nicolai Buchwitz Subject: [PATCH net-next 2/5] net: cadence: macb: add EEE LPI statistics counters Date: Mon, 23 Feb 2026 10:04:09 +0100 Message-Id: <20260223090412.44070-3-nb@tipi-net.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260223090412.44070-1-nb@tipi-net.de> References: <20260223090412.44070-1-nb@tipi-net.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 Expose the GEM MAC's EEE Low Power Idle hardware counters through ethtool -S: - rx_lpi_transitions: number of RX LPI entry events - rx_lpi_time: cumulative time spent in RX LPI - tx_lpi_transitions: number of TX LPI entry events (TXLPIEN 0->1) - tx_lpi_time: cumulative time in TX LPI These are clear-on-read hardware registers at offsets 0x270-0x27c, automatically collected by the existing gem_statistics read loop. Signed-off-by: Nicolai Buchwitz --- drivers/net/ethernet/cadence/macb.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index f8fdb83bb5f3..95317965080c 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -1052,6 +1052,10 @@ struct gem_stats { u64 rx_ip_header_checksum_errors; u64 rx_tcp_checksum_errors; u64 rx_udp_checksum_errors; + u64 rx_lpi_transitions; + u64 rx_lpi_time; + u64 tx_lpi_transitions; + u64 tx_lpi_time; }; /* Describes the name and offset of an individual statistic register, as @@ -1151,6 +1155,10 @@ static const struct gem_statistic gem_statistics[] = { GEM_BIT(NDS_RXERR)), GEM_STAT_TITLE_BITS(RXUDPCCNT, "rx_udp_checksum_errors", GEM_BIT(NDS_RXERR)), + GEM_STAT_TITLE(RXLPI, "rx_lpi_transitions"), + GEM_STAT_TITLE(RXLPITIME, "rx_lpi_time"), + GEM_STAT_TITLE(TXLPI, "tx_lpi_transitions"), + GEM_STAT_TITLE(TXLPITIME, "tx_lpi_time"), }; #define GEM_STATS_LEN ARRAY_SIZE(gem_statistics) -- 2.39.5