netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Jakub Kicinski <kuba@kernel.org>
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: Thu, 13 Nov 2025 11:20:07 +0000	[thread overview]
Message-ID: <3458a837-d7aa-45f0-9c3e-af6c4efed70c@linux.dev> (raw)
In-Reply-To: <20251112183508.3c20e21d@kernel.org>

On 13.11.2025 02:35, Jakub Kicinski wrote:
> 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?

Ah, yeah, I'll keep it in v4

> 
>> -	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..

Yeah, looks like it's because config::tx_type/rx_filter are not enums but plain
int type.

> 
> 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.

Sure, will do in v4 in both patches.


      reply	other threads:[~2025-11-13 11:20 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
2025-11-13 11:20     ` Vadim Fedorenko [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=3458a837-d7aa-45f0-9c3e-af6c4efed70c@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --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=kuba@kernel.org \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.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;
as well as URLs for NNTP newsgroup(s).