netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Cc: Manish Chopra <manishc@marvell.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Simon Horman <horms@kernel.org>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Kory Maincent <kory.maincent@bootlin.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next v3 2/2] qede: convert to use ndo_hwtstamp callbacks
Date: Wed, 12 Nov 2025 18:35:08 -0800	[thread overview]
Message-ID: <20251112183508.3c20e21d@kernel.org> (raw)
In-Reply-To: <20251111151900.1826871-3-vadim.fedorenko@linux.dev>

On Tue, 11 Nov 2025 15:19:00 +0000 Vadim Fedorenko wrote:
> The driver implemented SIOCSHWTSTAMP ioctl cmd only, but it stores
> configuration in private structure, so it can be reported back to users.
> Implement both ndo_hwtstamp_set and ndo_hwtstamp_set callbacks.
> ndo_hwtstamp_set implements a check of unsupported 1-step timestamping
> and qede_ptp_cfg_filters() becomes void as it cannot fail anymore.
> 
> Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

> -static int qede_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
> -{
> -	struct qede_dev *edev = netdev_priv(dev);
> -
> -	if (!netif_running(dev))
> -		return -EAGAIN;

Isn't this running check gone after conversion?

> -	switch (cmd) {
> -	case SIOCSHWTSTAMP:
> -		return qede_ptp_hw_ts(edev, ifr);
> -	default:
> -		DP_VERBOSE(edev, QED_MSG_DEBUG,
> -			   "default IOCTL cmd 0x%x\n", cmd);
> -		return -EOPNOTSUPP;
> -	}
> -
> -	return 0;
> -}
> -

> +	switch (config->tx_type) {
> +	case HWTSTAMP_TX_ONESTEP_SYNC:
> +	case HWTSTAMP_TX_ONESTEP_P2P:
> +		NL_SET_ERR_MSG_MOD(extack,
> +				   "One-step timestamping is not supported");
> +		return -ERANGE;
> +	}

Eh, I guess the warning I was imagining isn't actually enabled at W=1 :(
And config->.x_type does not use enums..

Could you switch this to the slightly more resilient:

	switch (config->tx_type) {
	case HWTSTAMP_TX_ON:
	case HWTSTAMP_TX_OFF:
		break;
	default:
		NL_SET_ERR_MSG_MOD(extack,
				   "One-step timestamping is not supported");
		return -ERANGE;
	}

? Guess similar adjustment would also work for patch 1.
-- 
pw-bot: cr

  reply	other threads:[~2025-11-13  2:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11 15:18 [PATCH net-next v3 0/2] convert drivers to use ndo_hwtstamp callbacks part 4 Vadim Fedorenko
2025-11-11 15:18 ` [PATCH net-next v3 1/2] bnx2x: convert to use ndo_hwtstamp callbacks Vadim Fedorenko
2025-11-11 15:19 ` [PATCH net-next v3 2/2] qede: " Vadim Fedorenko
2025-11-13  2:35   ` Jakub Kicinski [this message]
2025-11-13 11:20     ` Vadim Fedorenko

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=20251112183508.3c20e21d@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kory.maincent@bootlin.com \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=vadim.fedorenko@linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).