]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ethtool: tsconfig: always take rtnl_lock
authorJakub Kicinski <kuba@kernel.org>
Thu, 11 Jun 2026 20:03:55 +0000 (13:03 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 12 Jun 2026 23:41:56 +0000 (16:41 -0700)
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: f9a3e05114b8 ("net: ethtool: optionally skip rtnl_lock on Netlink path for SET ops")
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20260611200355.2020663-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/common.h

index e3052972f953bbf57836e150ea0d1ec5c4f10d5b..2b3847f0080183c887542fb212f9f9e3452f7d00 100644 (file)
@@ -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;
 }