Re: [PATCH net-next] net: reject a netdev that implements only one hwtstamp NDO

From: Jakub Kicinski

Date: Thu Oct 01 2026 - 20:25:34 EST


On Tue, 29 Sep 2026 23:32:32 +0200 Nicolai Buchwitz wrote:
> @@ -11447,6 +11447,13 @@ int register_netdevice(struct net_device *dev)
> goto err_uninit;
> }
>
> + if (!dev->netdev_ops->ndo_hwtstamp_get !=
> + !dev->netdev_ops->ndo_hwtstamp_set) {
> + netdev_WARN(dev, "driver implements only one hwtstamp NDO\n");
> + ret = -EINVAL;
> + goto err_uninit;
> + }
> +
> if (netdev_need_ops_lock(dev) &&
> dev->netdev_ops->ndo_set_rx_mode &&
> !dev->netdev_ops->ndo_set_rx_mode_async)

Third such check added here.. we should probably factor all three
out of register_netdevice(). Hardest part is probably naming the
new helper. netdev_check_ops() ? We already have ethtool_check_ops()
We can't move it earlier because some drivers set features form
ndo_init And while you move it you can also make the warning
about not using _async return an error. It was "soft" to avoid
bricking people's systems on boot, but it's been there since v7.1
people will have enough time to spot offenders by v7.4
--
pw-bot: cr