* [PATCH v2 0/2] Add missing mmc statistics in DW GMAC
@ 2024-04-08 1:29 Minda Chen
2024-04-08 1:29 ` [PATCH v2 1/2] net: stmmac: mmc_core: Add GMAC LPI statistics Minda Chen
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Minda Chen @ 2024-04-08 1:29 UTC (permalink / raw)
To: Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Maxime Coquelin, netdev
Cc: linux-stm32, linux-arm-kernel, linux-kernel
Add miss MMC statistic in DW GMAC
base on 6.9-rc1
changed
v2:
patch2 : remove mmc_rx_control_g due to it is gotten in
ethtool_ops::get_eth_ctrl_stats.
Minda Chen (2):
net: stmmac: mmc_core: Add GMAC LPI statistics
net: stmmac: mmc_core: Add GMAC mmc tx/rx missing statistics
drivers/net/ethernet/stmicro/stmmac/mmc.h | 2 ++
drivers/net/ethernet/stmicro/stmmac/mmc_core.c | 15 +++++++++++++++
.../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 ++
3 files changed, 19 insertions(+)
base-commit: 4cece764965020c22cff7665b18a012006359095
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] net: stmmac: mmc_core: Add GMAC LPI statistics
2024-04-08 1:29 [PATCH v2 0/2] Add missing mmc statistics in DW GMAC Minda Chen
@ 2024-04-08 1:29 ` Minda Chen
2024-04-08 1:29 ` [PATCH v2 2/2] net: stmmac: mmc_core: Add GMAC mmc tx/rx missing statistics Minda Chen
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Minda Chen @ 2024-04-08 1:29 UTC (permalink / raw)
To: Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Maxime Coquelin, netdev
Cc: linux-stm32, linux-arm-kernel, linux-kernel
XGMAC MMC has already added LPI statistics. GMAC MMC lack of these
statistics. Add register definition and reading the LPI statistics
from registers.
Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Simon Horman <horms@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/mmc_core.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
index 7eb477faa75a..b0db5f4e8fe8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
@@ -79,6 +79,12 @@
#define MMC_RX_FIFO_OVERFLOW 0xd4
#define MMC_RX_VLAN_FRAMES_GB 0xd8
#define MMC_RX_WATCHDOG_ERROR 0xdc
+
+#define MMC_TX_LPI_USEC 0xec
+#define MMC_TX_LPI_TRAN 0xf0
+#define MMC_RX_LPI_USEC 0xf4
+#define MMC_RX_LPI_TRAN 0xf8
+
/* IPC*/
#define MMC_RX_IPC_INTR_MASK 0x100
#define MMC_RX_IPC_INTR 0x108
@@ -283,6 +289,8 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc)
mmc->mmc_tx_excessdef += readl(mmcaddr + MMC_TX_EXCESSDEF);
mmc->mmc_tx_pause_frame += readl(mmcaddr + MMC_TX_PAUSE_FRAME);
mmc->mmc_tx_vlan_frame_g += readl(mmcaddr + MMC_TX_VLAN_FRAME_G);
+ mmc->mmc_tx_lpi_usec += readl(mmcaddr + MMC_TX_LPI_USEC);
+ mmc->mmc_tx_lpi_tran += readl(mmcaddr + MMC_TX_LPI_TRAN);
/* MMC RX counter registers */
mmc->mmc_rx_framecount_gb += readl(mmcaddr + MMC_RX_FRAMECOUNT_GB);
@@ -316,6 +324,9 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc)
mmc->mmc_rx_fifo_overflow += readl(mmcaddr + MMC_RX_FIFO_OVERFLOW);
mmc->mmc_rx_vlan_frames_gb += readl(mmcaddr + MMC_RX_VLAN_FRAMES_GB);
mmc->mmc_rx_watchdog_error += readl(mmcaddr + MMC_RX_WATCHDOG_ERROR);
+ mmc->mmc_rx_lpi_usec += readl(mmcaddr + MMC_RX_LPI_USEC);
+ mmc->mmc_rx_lpi_tran += readl(mmcaddr + MMC_RX_LPI_TRAN);
+
/* IPv4 */
mmc->mmc_rx_ipv4_gd += readl(mmcaddr + MMC_RX_IPV4_GD);
mmc->mmc_rx_ipv4_hderr += readl(mmcaddr + MMC_RX_IPV4_HDERR);
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] net: stmmac: mmc_core: Add GMAC mmc tx/rx missing statistics
2024-04-08 1:29 [PATCH v2 0/2] Add missing mmc statistics in DW GMAC Minda Chen
2024-04-08 1:29 ` [PATCH v2 1/2] net: stmmac: mmc_core: Add GMAC LPI statistics Minda Chen
@ 2024-04-08 1:29 ` Minda Chen
2024-04-08 14:30 ` [PATCH v2 0/2] Add missing mmc statistics in DW GMAC patchwork-bot+netdevbpf
2024-04-09 14:26 ` Serge Semin
3 siblings, 0 replies; 5+ messages in thread
From: Minda Chen @ 2024-04-08 1:29 UTC (permalink / raw)
To: Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Maxime Coquelin, netdev
Cc: linux-stm32, linux-arm-kernel, linux-kernel
The missing statistics including Rx_Receive_Error_Packets and
Tx_OSize_Packets_Good.
Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Simon Horman <horms@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/mmc.h | 2 ++
drivers/net/ethernet/stmicro/stmmac/mmc_core.c | 4 ++++
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 ++
3 files changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc.h b/drivers/net/ethernet/stmicro/stmmac/mmc.h
index dff02d75d519..5d1ea3e07459 100644
--- a/drivers/net/ethernet/stmicro/stmmac/mmc.h
+++ b/drivers/net/ethernet/stmicro/stmmac/mmc.h
@@ -52,6 +52,7 @@ struct stmmac_counters {
unsigned int mmc_tx_excessdef;
unsigned int mmc_tx_pause_frame;
unsigned int mmc_tx_vlan_frame_g;
+ unsigned int mmc_tx_oversize_g;
unsigned int mmc_tx_lpi_usec;
unsigned int mmc_tx_lpi_tran;
@@ -80,6 +81,7 @@ struct stmmac_counters {
unsigned int mmc_rx_fifo_overflow;
unsigned int mmc_rx_vlan_frames_gb;
unsigned int mmc_rx_watchdog_error;
+ unsigned int mmc_rx_error;
unsigned int mmc_rx_lpi_usec;
unsigned int mmc_rx_lpi_tran;
unsigned int mmc_rx_discard_frames_gb;
diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
index b0db5f4e8fe8..0fab842902a8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c
@@ -53,6 +53,7 @@
#define MMC_TX_EXCESSDEF 0x6c
#define MMC_TX_PAUSE_FRAME 0x70
#define MMC_TX_VLAN_FRAME_G 0x74
+#define MMC_TX_OVERSIZE_G 0x78
/* MMC RX counter registers */
#define MMC_RX_FRAMECOUNT_GB 0x80
@@ -79,6 +80,7 @@
#define MMC_RX_FIFO_OVERFLOW 0xd4
#define MMC_RX_VLAN_FRAMES_GB 0xd8
#define MMC_RX_WATCHDOG_ERROR 0xdc
+#define MMC_RX_ERROR 0xe0
#define MMC_TX_LPI_USEC 0xec
#define MMC_TX_LPI_TRAN 0xf0
@@ -289,6 +291,7 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc)
mmc->mmc_tx_excessdef += readl(mmcaddr + MMC_TX_EXCESSDEF);
mmc->mmc_tx_pause_frame += readl(mmcaddr + MMC_TX_PAUSE_FRAME);
mmc->mmc_tx_vlan_frame_g += readl(mmcaddr + MMC_TX_VLAN_FRAME_G);
+ mmc->mmc_tx_oversize_g += readl(mmcaddr + MMC_TX_OVERSIZE_G);
mmc->mmc_tx_lpi_usec += readl(mmcaddr + MMC_TX_LPI_USEC);
mmc->mmc_tx_lpi_tran += readl(mmcaddr + MMC_TX_LPI_TRAN);
@@ -324,6 +327,7 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc)
mmc->mmc_rx_fifo_overflow += readl(mmcaddr + MMC_RX_FIFO_OVERFLOW);
mmc->mmc_rx_vlan_frames_gb += readl(mmcaddr + MMC_RX_VLAN_FRAMES_GB);
mmc->mmc_rx_watchdog_error += readl(mmcaddr + MMC_RX_WATCHDOG_ERROR);
+ mmc->mmc_rx_error += readl(mmcaddr + MMC_RX_ERROR);
mmc->mmc_rx_lpi_usec += readl(mmcaddr + MMC_RX_LPI_USEC);
mmc->mmc_rx_lpi_tran += readl(mmcaddr + MMC_RX_LPI_TRAN);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index e1537a57815f..542e2633a6f5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -212,6 +212,7 @@ static const struct stmmac_stats stmmac_mmc[] = {
STMMAC_MMC_STAT(mmc_tx_excessdef),
STMMAC_MMC_STAT(mmc_tx_pause_frame),
STMMAC_MMC_STAT(mmc_tx_vlan_frame_g),
+ STMMAC_MMC_STAT(mmc_tx_oversize_g),
STMMAC_MMC_STAT(mmc_tx_lpi_usec),
STMMAC_MMC_STAT(mmc_tx_lpi_tran),
STMMAC_MMC_STAT(mmc_rx_framecount_gb),
@@ -238,6 +239,7 @@ static const struct stmmac_stats stmmac_mmc[] = {
STMMAC_MMC_STAT(mmc_rx_fifo_overflow),
STMMAC_MMC_STAT(mmc_rx_vlan_frames_gb),
STMMAC_MMC_STAT(mmc_rx_watchdog_error),
+ STMMAC_MMC_STAT(mmc_rx_error),
STMMAC_MMC_STAT(mmc_rx_lpi_usec),
STMMAC_MMC_STAT(mmc_rx_lpi_tran),
STMMAC_MMC_STAT(mmc_rx_discard_frames_gb),
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] Add missing mmc statistics in DW GMAC
2024-04-08 1:29 [PATCH v2 0/2] Add missing mmc statistics in DW GMAC Minda Chen
2024-04-08 1:29 ` [PATCH v2 1/2] net: stmmac: mmc_core: Add GMAC LPI statistics Minda Chen
2024-04-08 1:29 ` [PATCH v2 2/2] net: stmmac: mmc_core: Add GMAC mmc tx/rx missing statistics Minda Chen
@ 2024-04-08 14:30 ` patchwork-bot+netdevbpf
2024-04-09 14:26 ` Serge Semin
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-08 14:30 UTC (permalink / raw)
To: Minda Chen
Cc: alexandre.torgue, joabreu, davem, edumazet, kuba, pabeni,
mcoquelin.stm32, netdev, linux-stm32, linux-arm-kernel,
linux-kernel
Hello:
This series was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Mon, 8 Apr 2024 09:29:41 +0800 you wrote:
> Add miss MMC statistic in DW GMAC
>
> base on 6.9-rc1
>
> changed
> v2:
> patch2 : remove mmc_rx_control_g due to it is gotten in
> ethtool_ops::get_eth_ctrl_stats.
>
> [...]
Here is the summary with links:
- [v2,1/2] net: stmmac: mmc_core: Add GMAC LPI statistics
https://git.kernel.org/netdev/net/c/dfe073f8714d
- [v2,2/2] net: stmmac: mmc_core: Add GMAC mmc tx/rx missing statistics
https://git.kernel.org/netdev/net/c/ff20393bdc45
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] Add missing mmc statistics in DW GMAC
2024-04-08 1:29 [PATCH v2 0/2] Add missing mmc statistics in DW GMAC Minda Chen
` (2 preceding siblings ...)
2024-04-08 14:30 ` [PATCH v2 0/2] Add missing mmc statistics in DW GMAC patchwork-bot+netdevbpf
@ 2024-04-09 14:26 ` Serge Semin
3 siblings, 0 replies; 5+ messages in thread
From: Serge Semin @ 2024-04-09 14:26 UTC (permalink / raw)
To: Minda Chen
Cc: Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Maxime Coquelin, netdev, linux-stm32,
linux-arm-kernel, linux-kernel
On Mon, Apr 08, 2024 at 09:29:41AM +0800, Minda Chen wrote:
> Add miss MMC statistic in DW GMAC
>
> base on 6.9-rc1
>
> changed
> v2:
> patch2 : remove mmc_rx_control_g due to it is gotten in
> ethtool_ops::get_eth_ctrl_stats.
The series has already been merged in. Just a small note about the
patches. Both the changes seems reasonable:
LPI-statistics for DW GMAC and DW QoS Eth,
and
Rx-Recv and Tx-oversize errors stat for DW GMAC and DW QoS Eth.
The former stats has originally been added for DW XGMAC and the later
stats aren't supported by DW XGMAC. So the provided change is
complete. Thanks.
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
-Serge(y)
>
> Minda Chen (2):
> net: stmmac: mmc_core: Add GMAC LPI statistics
> net: stmmac: mmc_core: Add GMAC mmc tx/rx missing statistics
>
> drivers/net/ethernet/stmicro/stmmac/mmc.h | 2 ++
> drivers/net/ethernet/stmicro/stmmac/mmc_core.c | 15 +++++++++++++++
> .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 ++
> 3 files changed, 19 insertions(+)
>
>
> base-commit: 4cece764965020c22cff7665b18a012006359095
> --
> 2.17.1
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-04-09 14:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-08 1:29 [PATCH v2 0/2] Add missing mmc statistics in DW GMAC Minda Chen
2024-04-08 1:29 ` [PATCH v2 1/2] net: stmmac: mmc_core: Add GMAC LPI statistics Minda Chen
2024-04-08 1:29 ` [PATCH v2 2/2] net: stmmac: mmc_core: Add GMAC mmc tx/rx missing statistics Minda Chen
2024-04-08 14:30 ` [PATCH v2 0/2] Add missing mmc statistics in DW GMAC patchwork-bot+netdevbpf
2024-04-09 14:26 ` Serge Semin
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).