mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Nicolai Buchwitz <nb@tipi-net.de>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: reject a netdev that implements only one hwtstamp NDO
Date: Thu, 1 Oct 2026 17:25:18 -0700	[thread overview]
Message-ID: <20261001172518.4902bc1b@kernel.org> (raw)
In-Reply-To: <20260929213233.1555567-1-nb@tipi-net.de>

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

      reply	other threads:[~2026-10-02  0:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 21:32 Nicolai Buchwitz
2026-10-02  0:25 ` Jakub Kicinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261001172518.4902bc1b@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nb@tipi-net.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®