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.
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
Link: https://patch.msgid.link/20260302230149.1580195-2-mohsin.bashr@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-
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
*
* 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;
);
};
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)
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);