[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260122192158.428882-2-mohsin.bashr@gmail.com>
Date: Thu, 22 Jan 2026 11:21:56 -0800
From: Mohsin Bashir <mohsin.bashr@...il.com>
To: netdev@...r.kernel.org
Cc: alexanderduyck@...com,
alok.a.tiwari@...cle.com,
andrew+netdev@...n.ch,
andrew@...n.ch,
chuck.lever@...cle.com,
davem@...emloft.net,
donald.hunter@...il.com,
edumazet@...gle.com,
gal@...dia.com,
horms@...nel.org,
idosch@...dia.com,
jacob.e.keller@...el.com,
kernel-team@...a.com,
kory.maincent@...tlin.com,
kuba@...nel.org,
lee@...ger.us,
mohsin.bashr@...il.com,
o.rempel@...gutronix.de,
pabeni@...hat.com,
vadim.fedorenko@...ux.dev
Subject: [PATCH net-next 1/3] net: ethtool: Track pause storm events
With TX pause enabled, if a device is unable to pass packets up to the
stack (e.g., CPU is hanged), the device can cause pause storm. Given
that devices can have native support to protect the neighbor from such
flooding, such events need some tracking. This support is to track TX
pause storm events for better observability.
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Signed-off-by: Mohsin Bashir <mohsin.bashr@...il.com>
---
Documentation/netlink/specs/ethtool.yaml | 13 +++++++++++++
include/linux/ethtool.h | 2 ++
include/uapi/linux/ethtool_netlink_generated.h | 1 +
net/ethtool/pause.c | 4 +++-
4 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml
index 0a2d2343f79a..4707063af3b4 100644
--- a/Documentation/netlink/specs/ethtool.yaml
+++ b/Documentation/netlink/specs/ethtool.yaml
@@ -879,6 +879,19 @@ attribute-sets:
-
name: rx-frames
type: u64
+ -
+ name: tx-pause-storm-events
+ type: u64
+ doc: >-
+ TX pause storm event count. Increments each time device
+ detects that its pause assertion condition has been true
+ for too long for normal operation. As a result, the device
+ has temporarily disabled its own Pause TX function to
+ protect the network from itself.
+ This counter should never increment under normal overload
+ conditions; it indicates catastrophic failure like an OS
+ crash. The rate of incrementing is implementation specific.
+
-
name: pause
attr-cnt-name: __ethtool-a-pause-cnt
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 798abec67a1b..83c375840835 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -512,12 +512,14 @@ struct ethtool_eth_ctrl_stats {
*
* Equivalent to `30.3.4.3 aPAUSEMACCtrlFramesReceived`
* from the standard.
+ * @tx_pause_storm_events: TX pause storm event count (see ethtool.yaml).
*/
struct ethtool_pause_stats {
enum ethtool_mac_stats_src src;
struct_group(stats,
u64 tx_pause_frames;
u64 rx_pause_frames;
+ u64 tx_pause_storm_events;
);
};
diff --git a/include/uapi/linux/ethtool_netlink_generated.h b/include/uapi/linux/ethtool_netlink_generated.h
index 556a0c834df5..114b83017297 100644
--- a/include/uapi/linux/ethtool_netlink_generated.h
+++ b/include/uapi/linux/ethtool_netlink_generated.h
@@ -381,6 +381,7 @@ enum {
ETHTOOL_A_PAUSE_STAT_PAD,
ETHTOOL_A_PAUSE_STAT_TX_FRAMES,
ETHTOOL_A_PAUSE_STAT_RX_FRAMES,
+ ETHTOOL_A_PAUSE_STAT_TX_PAUSE_STORM_EVENTS,
__ETHTOOL_A_PAUSE_STAT_CNT,
ETHTOOL_A_PAUSE_STAT_MAX = (__ETHTOOL_A_PAUSE_STAT_CNT - 1)
diff --git a/net/ethtool/pause.c b/net/ethtool/pause.c
index 0f9af1e66548..5d28f642764c 100644
--- a/net/ethtool/pause.c
+++ b/net/ethtool/pause.c
@@ -130,7 +130,9 @@ static int pause_put_stats(struct sk_buff *skb,
if (ethtool_put_stat(skb, pause_stats->tx_pause_frames,
ETHTOOL_A_PAUSE_STAT_TX_FRAMES, pad) ||
ethtool_put_stat(skb, pause_stats->rx_pause_frames,
- ETHTOOL_A_PAUSE_STAT_RX_FRAMES, pad))
+ ETHTOOL_A_PAUSE_STAT_RX_FRAMES, pad) ||
+ ethtool_put_stat(skb, pause_stats->tx_pause_storm_events,
+ ETHTOOL_A_PAUSE_STAT_TX_PAUSE_STORM_EVENTS, pad))
goto err_cancel;
nla_nest_end(skb, nest);
--
2.47.3
Powered by blists - more mailing lists