From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13DEC31C56D for ; Mon, 2 Mar 2026 23:01:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772492520; cv=none; b=B5kbKIOJHhPTixo9899Fatk+WjT8KZpoVzRp4yj0amrDigFGmwDoAxo5OCajCwCIlcKnY9OCcltl1HbFguETILUrvvuRW+jDBgX6y4El6hyG3byw1VZTd7Qhfr6yNwzku1A4kC7EpI7JFILmkZl8D5Eu8EtER/y/ivZiDR5soI4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772492520; c=relaxed/simple; bh=D9A1mjx3Bo2dp6Mntk51MlHtoIWxAsQL+/MQZTZBMrs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gCRxXGj/SQ0KIz5JPOvf5YJjG4AaD0eNQ8NrpOb8+4o1/gTEv+QHg7qOP4S0IgxTkVhsZS2ferd34C/30Ku9EeHOkXqSNAYtc8MPW0cCYpJB70W+MWVxiRYk7sjXxsq2aE26AU9zPZ9XAx3vwJImU5QsX0ueROsdQb4ZKuq7BPc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KSZPDkoL; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KSZPDkoL" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4806ce0f97bso42783315e9.0 for ; Mon, 02 Mar 2026 15:01:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772492517; x=1773097317; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CU2WMDwR3VgGVbtB5/gNO1+KxRbSdrRzqbkeoh8a3to=; b=KSZPDkoLm/mALs/aq2swRZoX3KY1HPLt3YBz3LuJIdZjk6lLCaKxInR4sM3HA3/m9Z dB32IaH2I2tFykaAPHOhW/NuJAL0sHbOqxKpP1Pd9AJz4tXHhvdyOJGudeJlN4F1hHmm IOpGKrISvXdL7irouAOkNaa4TebXP+OxI61fXA2El0uaJAQ4lrcoJhZMEx92oPRSWErW 0BFwHGYsbkr4P0K6B5sUObguOhORN73UV7JJ0oaDjSQgCBxnVziLyAhF2n19iCFW6BIU 8d8G34Aedbwhv2l0GxaLBwjT01OLt6GXM3sN66es7QNzhZ4E3AI76WH5W6EeYx+uDZGQ rEOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772492517; x=1773097317; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=CU2WMDwR3VgGVbtB5/gNO1+KxRbSdrRzqbkeoh8a3to=; b=c+bU8SaMfxyYRFWs9CRzKqgfpy5D4q3SoLjoh63fgg3PnTyUc+r1fMEWpLUBxGz6uz ehHaqLXUpgNX4xctab5HspQZperIVl3e2mueiQJYvczR/AfU+A06grbgFGEYz2MSV1Mg Gn1fNgicmyaMWq2Ix58TUEk8Y+jUAXorhAbFDqxVBCPpCwbAOWGsdPwxOPxWdYzDlJkM jLPA4XMtR8eCLOpDCy4aBqV6GQnNdSYDvynt8gaz4LQiKvsbRk2VuM0gjztj2Ijfxo3M mhumowfoI84bIzKnWkO6j3LKn2rfp7PsXn2NkMKcdU48MnOSZEyVP6mPeq3AfkU/47r5 4fUQ== X-Gm-Message-State: AOJu0YzlatEsZfk87t0INkcRO7Ul1dzdWMKLxKL9chb8Kx6pZ55h3Kd8 MQPZRB031Kg3bwSEMGOvD3OJbAne478L5FR3ZFBGaW1oeGYZgZff6s4vzwm9XWmD X-Gm-Gg: ATEYQzxwjlKUkyw8dOUOOCHjkQnoHK2woiUVMu4lFAZ5H6Vpk7HnZXZEFlqTCjUtG4m 0QmiI3uZ5bXKf63pXYQm8bIwzNhnnagUY29IMhMnBrdWLAj9AAMOpOwqf1gUoejw2Sdu86zgGOw aUwr6DR6gddm6zVU0O4QfSooksUozFwj+E3hpgrBmjr0nDE2PMkdGnrN2mRQ/yokSwPDIlYYndD 3IteBuNvnwvBXDH5gAFg3fFUWQ3tuOYOKwU0jsDKxmjqYnI7aK5PPvakoii2TOqwV/0GZszyaSL GG62gL6WfgKWyhMPWHAoi0XTVKLDhGbf4DavwdAV7kZZfPYBsmyls7fLnyMH+UtM9b+hdFRkr7y 2X6+thkGzreYZ7OgpdQ8YqyrB8GdueogTeAXstf+03Pz5ixA6LkG77lf7dCB+yV2DPFLlBNAqSp fFHyTmcIwL9F3bV8j+0SDx X-Received: by 2002:a05:600c:4fc8:b0:47b:e2a9:2bd7 with SMTP id 5b1f17b1804b1-483c9beaca0mr292444625e9.19.1772492516969; Mon, 02 Mar 2026 15:01:56 -0800 (PST) Received: from localhost ([2a03:2880:31ff:57::]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439ae3f31dbsm17149216f8f.1.2026.03.02.15.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2026 15:01:55 -0800 (PST) From: Mohsin Bashir To: netdev@vger.kernel.org Cc: alexanderduyck@fb.com, alok.a.tiwari@oracle.com, andrew+netdev@lunn.ch, andrew@lunn.ch, davem@davemloft.net, dg573847474@gmail.com, donald.hunter@gmail.com, edumazet@google.com, gal@nvidia.com, horms@kernel.org, idosch@nvidia.com, jacob.e.keller@intel.com, kernel-team@meta.com, kory.maincent@bootlin.com, kuba@kernel.org, lee@trager.us, leon@kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux@armlinux.org.uk, mbloch@nvidia.com, mike.marciniszyn@gmail.com, mohsin.bashr@gmail.com, o.rempel@pengutronix.de, pabeni@redhat.com, saeedm@nvidia.com, tariqt@nvidia.com, vadim.fedorenko@linux.dev Subject: [net-next V4 1/5] net: ethtool: Track pause storm events Date: Mon, 2 Mar 2026 15:01:45 -0800 Message-ID: <20260302230149.1580195-2-mohsin.bashr@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260302230149.1580195-1-mohsin.bashr@gmail.com> References: <20260302230149.1580195-1-mohsin.bashr@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jakub Kicinski Signed-off-by: Mohsin Bashir --- 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