Skip to contentSkip to conversation

ethtool: tsconfig: always take rtnl_lock

PATCH Applied Jakub Kicinski 6 participants 8 messages Jun 11 – Jun 12

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 ethtool: tsconfig: always take rtnl_lock

mlx5 throws ASSERT_RTNL() warnings on timestamp config, because it tries to update features. mlx5e_hwtstamp_set() calls netdev_update_features().

I missed this while grepping the drivers because tsconfig goes through ndo_hwtstamp_set/get, not ethtool ops, even tho the new uAPI is in ethtool Netlink. We could add a dedicated opt out bit for mlx5, but NDOs were not supposed to be part of the ethtool locking conversion in the first place.

The mlx5 features update is related to the "compressed CQE" format which lacks timestamp, apparently. See commit c0194e2d0ef0 ("net/mlx5e:
Disable rxhash when CQE compress is enabled").

Fixes 6e9e2eed4f39 ("net: ethtool: Add support for tsconfig command to get/set hwtstamp config")

---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

---
 net/ethtool/common.h | 7 +++++++
 1 file changed, 7 insertions(+)
net/ethtool/common.h +7 -0
index e3052972f953..2b3847f00801 100644
@@ -113,6 +113,13 @@ ethtool_nl_msg_needs_rtnl(const struct net_device *dev, u8 cmd)
 		return ops->op_needs_rtnl & ETHTOOL_OP_NEEDS_RTNL_SPAUSEPARAM;
 	case ETHTOOL_MSG_RSS_SET:
 		return ops->op_needs_rtnl & ETHTOOL_OP_NEEDS_RTNL_RSS;
+	case ETHTOOL_MSG_TSCONFIG_GET:
+	case ETHTOOL_MSG_TSCONFIG_SET:
+		/* tsconfig calls ndos (ndo_hwtstamp_set/get), not ethtool ops.
+		 * Also, there is no corresponding ethtool ioctl, therefore
+		 * these cases are Netlink-only.
+		 */
+		return true;
 	}
 	return false;
 }
Signature · 1 line
2.54.0
author maintainer
#1 lore raw
Quoted 1 line · On Thu, 11 Jun 2026 13:03:55 -0700 Jakub Kicinski wrote:
Fixes 6e9e2eed4f39 ("net: ethtool: Add support for tsconfig command to get/set hwtstamp config")

Ugh, wrong fixes tag of course, should be:

Fixes f9a3e05114b8 ("net: ethtool: optionally skip rtnl_lock on Netlink path for SET ops")

I guess the GET side was also wrong but its harmless.

author maintainer
#2 lore raw
Quoted 8 lines · On Thu, 11 Jun 2026 13:05:20 -0700 Jakub Kicinski wrote:
Quoted 1 line · On Thu, 11 Jun 2026 13:03:55 -0700 Jakub Kicinski wrote:
Fixes 6e9e2eed4f39 ("net: ethtool: Add support for tsconfig command to get/set hwtstamp config")

Ugh, wrong fixes tag of course, should be:

Fixes f9a3e05114b8 ("net: ethtool: optionally skip rtnl_lock on Netlink path for SET ops")

I guess the GET side was also wrong but its harmless.

I mean -- so it doesn't need a Fixes tag, it's covered by the patch, of course.

Acked-by on v1 1/1
#3 lore raw
In reply to Jakub Kicinski
Quoted 10 lines · Jakub Kicinski

mlx5 throws ASSERT_RTNL() warnings on timestamp config, because it tries to update features. mlx5e_hwtstamp_set() calls netdev_update_features().

I missed this while grepping the drivers because tsconfig goes through ndo_hwtstamp_set/get, not ethtool ops, even tho the new uAPI is in ethtool Netlink. We could add a dedicated opt out bit for mlx5, but NDOs were not supposed to be part of the ethtool locking conversion in the first place.

Quoted 6 lines

The mlx5 features update is related to the "compressed CQE" format which lacks timestamp, apparently. See commit c0194e2d0ef0 ("net/mlx5e:
Disable rxhash when CQE compress is enabled").

Fixes 6e9e2eed4f39 ("net: ethtool: Add support for tsconfig command to get/set hwtstamp config")
Reviewed-by on v1 1/1
#4 lore raw
In reply to Jakub Kicinski
Quoted 9 lines · Jakub Kicinski

mlx5 throws ASSERT_RTNL() warnings on timestamp config, because it tries to update features. mlx5e_hwtstamp_set() calls netdev_update_features().

I missed this while grepping the drivers because tsconfig goes through ndo_hwtstamp_set/get, not ethtool ops, even tho the new uAPI is in ethtool Netlink. We could add a dedicated opt out bit for mlx5, but NDOs were not supposed to be part of the ethtool locking conversion in the first place.

Makes sense, even if we have plans to improve that in the future we didn't plan to change it right now.

Quoted 35 lines

The mlx5 features update is related to the "compressed CQE" format which lacks timestamp, apparently. See commit c0194e2d0ef0 ("net/mlx5e:
Disable rxhash when CQE compress is enabled").

Fixes 6e9e2eed4f39 ("net: ethtool: Add support for tsconfig command to get/set hwtstamp config")

---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

---
 net/ethtool/common.h | 7 +++++++
 1 file changed, 7 insertions(+)
net/ethtool/common.h +7 -0
index e3052972f953..2b3847f00801 100644
@@ -113,6 +113,13 @@ ethtool_nl_msg_needs_rtnl(const struct net_device *dev, u8 cmd)
 		return ops->op_needs_rtnl & ETHTOOL_OP_NEEDS_RTNL_SPAUSEPARAM;
 	case ETHTOOL_MSG_RSS_SET:
 		return ops->op_needs_rtnl & ETHTOOL_OP_NEEDS_RTNL_RSS;
+	case ETHTOOL_MSG_TSCONFIG_GET:
+	case ETHTOOL_MSG_TSCONFIG_SET:
+		/* tsconfig calls ndos (ndo_hwtstamp_set/get), not ethtool ops.
+		 * Also, there is no corresponding ethtool ioctl, therefore
+		 * these cases are Netlink-only.
+		 */
+		return true;
 	}
 	return false;
 }
Reviewed-by on v1 1/1
#5 lore raw
In reply to Jakub Kicinski
Quoted 34 lines · Jakub Kicinski

mlx5 throws ASSERT_RTNL() warnings on timestamp config, because it tries to update features. mlx5e_hwtstamp_set() calls netdev_update_features().

I missed this while grepping the drivers because tsconfig goes through ndo_hwtstamp_set/get, not ethtool ops, even tho the new uAPI is in ethtool Netlink. We could add a dedicated opt out bit for mlx5, but NDOs were not supposed to be part of the ethtool locking conversion in the first place.

The mlx5 features update is related to the "compressed CQE" format which lacks timestamp, apparently. See commit c0194e2d0ef0 ("net/mlx5e:
Disable rxhash when CQE compress is enabled").

Fixes 6e9e2eed4f39 ("net: ethtool: Add support for tsconfig command to get/set hwtstamp config")

---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

---
  net/ethtool/common.h | 7 +++++++
  1 file changed, 7 insertions(+)
net/ethtool/common.h +0 -0
index e3052972f953..2b3847f00801 100644
@@ -113,6 +113,13 @@ ethtool_nl_msg_needs_rtnl(const struct net_device *dev, u8 cmd)
  		return ops->op_needs_rtnl & ETHTOOL_OP_NEEDS_RTNL_SPAUSEPARAM;
  	case ETHTOOL_MSG_RSS_SET:
  		return ops->op_needs_rtnl & ETHTOOL_OP_NEEDS_RTNL_RSS;

net/ethtool/common.h ethtool_nl_msg_needs_rtnl(const struct net_device *dev, u8 cmd) · line 125

Quoted 10 lines
net/ethtool/common.h +7 -0
+	case ETHTOOL_MSG_TSCONFIG_GET:
+	case ETHTOOL_MSG_TSCONFIG_SET:
+		/* tsconfig calls ndos (ndo_hwtstamp_set/get), not ethtool ops.
+		 * Also, there is no corresponding ethtool ioctl, therefore
+		 * these cases are Netlink-only.
+		 */
+		return true;
  	}
  	return false;
  }
Reviewed-by on v1 1/1
#6 lore raw
In reply to Jakub Kicinski
Quoted 10 lines · On Thu, 11 Jun 2026 13:03:55 -0700 Jakub Kicinski <[email protected]> wrote:

mlx5 throws ASSERT_RTNL() warnings on timestamp config, because it tries to update features. mlx5e_hwtstamp_set() calls netdev_update_features().

I missed this while grepping the drivers because tsconfig goes through ndo_hwtstamp_set/get, not ethtool ops, even tho the new uAPI is in ethtool Netlink. We could add a dedicated opt out bit for mlx5, but NDOs were not supposed to be part of the ethtool locking conversion in the first place.

Quoted 3 lines

The mlx5 features update is related to the "compressed CQE" format which lacks timestamp, apparently. See commit c0194e2d0ef0 ("net/mlx5e:
Disable rxhash when CQE compress is enabled").

Thank you!

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#7 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Thu, 11 Jun 2026 13:03:55 -0700 you wrote:

mlx5 throws ASSERT_RTNL() warnings on timestamp config, because it tries to update features. mlx5e_hwtstamp_set() calls netdev_update_features().

I missed this while grepping the drivers because tsconfig goes through ndo_hwtstamp_set/get, not ethtool ops, even tho the new uAPI is in ethtool Netlink. We could add a dedicated opt out bit for mlx5, but NDOs were not supposed to be part of the ethtool locking conversion in the first place.

[...]

Here is the summary with links:
- [net-next] ethtool: tsconfig: always take rtnl_lock

    https://git.kernel.org/netdev/net-next/c/f48cd5b47bfe

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html