public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel•com>
To: Vadim Fedorenko <vadim.fedorenko@linux•dev>,
	Shyam Sundar S K <Shyam-sundar.S-k@amd•com>,
	Andrew Lunn <andrew+netdev@lunn•ch>,
	"David S. Miller" <davem@davemloft•net>,
	Eric Dumazet <edumazet@google•com>,
	"Jakub Kicinski" <kuba@kernel•org>,
	Paolo Abeni <pabeni@redhat•com>,
	Egor Pomozov <epomozov@marvell•com>,
	Potnuri Bharat Teja <bharat@chelsio•com>,
	"Dimitris Michailidis" <dmichail@fungible•com>,
	MD Danish Anwar <danishanwar@ti•com>,
	Roger Quadros <rogerq@kernel•org>
Cc: Richard Cochran <richardcochran@gmail•com>,
	Russell King <linux@armlinux•org.uk>,
	Vladimir Oltean <vladimir.oltean@nxp•com>,
	"Simon Horman" <horms@kernel•org>, <netdev@vger•kernel.org>
Subject: Re: [PATCH net-next v2 3/7] amd-xgbe: convert to ndo_hwtstamp callbacks
Date: Wed, 15 Oct 2025 13:23:30 -0700	[thread overview]
Message-ID: <ebeb9fdd-1fb7-4ebe-861a-820e17468bb2@intel.com> (raw)
In-Reply-To: <a8a523bb-a50a-419c-8ba8-78a3e7aa0daa@linux.dev>


[-- Attachment #1.1: Type: text/plain, Size: 2197 bytes --]



On 10/15/2025 12:58 PM, Vadim Fedorenko wrote:
> On 15.10.2025 20:47, Jacob Keller wrote:
>>
>>
>> On 10/14/2025 3:42 PM, Vadim Fedorenko wrote:
>>> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-hwtstamp.c b/drivers/net/ethernet/amd/xgbe/xgbe-hwtstamp.c
>>> index bc52e5ec6420..0127988e10be 100644
>>> --- a/drivers/net/ethernet/amd/xgbe/xgbe-hwtstamp.c
>>> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-hwtstamp.c
>>> @@ -157,26 +157,24 @@ void xgbe_tx_tstamp(struct work_struct *work)
>>>   	spin_unlock_irqrestore(&pdata->tstamp_lock, flags);
>>>   }
>>>   
>>> -int xgbe_get_hwtstamp_settings(struct xgbe_prv_data *pdata, struct ifreq *ifreq)
>>> +int xgbe_get_hwtstamp_settings(struct net_device *netdev,
>>> +			       struct kernel_hwtstamp_config *config)
>>>   {
>>> -	if (copy_to_user(ifreq->ifr_data, &pdata->tstamp_config,
>>> -			 sizeof(pdata->tstamp_config)))
>>> -		return -EFAULT;
>>> +	struct xgbe_prv_data *pdata = netdev_priv(netdev);
>>> +
>>> +	*config = pdata->tstamp_config;
>>>   
>>>   	return 0;
>>>   }
>>>   
>>> -int xgbe_set_hwtstamp_settings(struct xgbe_prv_data *pdata, struct ifreq *ifreq)
>>> +int xgbe_set_hwtstamp_settings(struct net_device *netdev,
>>> +			       struct kernel_hwtstamp_config *config,
>>> +			       struct netlink_ext_ack *extack)
>>>   {
>>> -	struct hwtstamp_config config;
>>> -	unsigned int mac_tscr;
>>> -
>>> -	if (copy_from_user(&config, ifreq->ifr_data, sizeof(config)))
>>> -		return -EFAULT;
>>> -
>>> -	mac_tscr = 0;
>>> +	struct xgbe_prv_data *pdata = netdev_priv(netdev);
>>> +	unsigned int mac_tscr = 0;
>>>   
>>
>> I noticed in this driver you didn't bother to add NL_SET_ERR_MSG calls.
>> Any particular reason?
> 
> The only error here is the -ERANGE which is self-explanatory, so I decided to
> keep the amount of changed lines as low as possible.
> 

Makes sense.

> We might think of adding netlink error message for ERANGE error in
> dev_set_hwtstamp() in case the driver skips setting specific message.

I think this is a good approach. Use a generic message when unset by the
driver.

For the patch:

Reviewed-by: Jacob Keller <jacob.e.keller@intel•com>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  reply	other threads:[~2025-10-15 20:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14 22:42 [PATCH net-next v2 0/7] convert net drivers to ndo_hwtstamp API part 1 Vadim Fedorenko
2025-10-14 22:42 ` [PATCH net-next v2 1/7] net: ti: am65-cpsw: move hw timestamping to ndo callback Vadim Fedorenko
2025-10-15 14:39   ` Simon Horman
2025-10-15 19:45   ` Jacob Keller
2025-10-14 22:42 ` [PATCH net-next v2 2/7] ti: icssg: convert to ndo_hwtstamp API Vadim Fedorenko
2025-10-15 14:39   ` Simon Horman
2025-10-15 19:46   ` Jacob Keller
2025-10-14 22:42 ` [PATCH net-next v2 3/7] amd-xgbe: convert to ndo_hwtstamp callbacks Vadim Fedorenko
2025-10-15 14:40   ` Simon Horman
2025-10-15 19:47   ` Jacob Keller
2025-10-15 19:58     ` Vadim Fedorenko
2025-10-15 20:23       ` Jacob Keller [this message]
2025-10-14 22:42 ` [PATCH net-next v2 4/7] net: atlantic: convert to ndo_hwtstamp API Vadim Fedorenko
2025-10-15 14:40   ` Simon Horman
2025-10-15 19:49   ` Jacob Keller
2025-10-14 22:42 ` [PATCH net-next v2 5/7] cxgb4: " Vadim Fedorenko
2025-10-15 10:05   ` Simon Horman
2025-10-15 10:33     ` Vadim Fedorenko
2025-10-15 14:37       ` Simon Horman
2025-10-15 20:05         ` Vadim Fedorenko
2025-10-16  8:10           ` Simon Horman
2025-10-15 20:18       ` Jacob Keller
2025-10-14 22:42 ` [PATCH net-next v2 6/7] tsnep: convert to ndo_hwtstatmp API Vadim Fedorenko
2025-10-15 10:03   ` Simon Horman
2025-10-15 10:38     ` Vadim Fedorenko
2025-10-15 14:38       ` Simon Horman
2025-10-14 22:42 ` [PATCH net-next v2 7/7] funeth: convert to ndo_hwtstamp API Vadim Fedorenko
2025-10-15 14:40   ` Simon Horman
2025-10-15 20:20   ` Jacob Keller

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=ebeb9fdd-1fb7-4ebe-861a-820e17468bb2@intel.com \
    --to=jacob.e.keller@intel$(echo .)com \
    --cc=Shyam-sundar.S-k@amd$(echo .)com \
    --cc=andrew+netdev@lunn$(echo .)ch \
    --cc=bharat@chelsio$(echo .)com \
    --cc=danishanwar@ti$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=dmichail@fungible$(echo .)com \
    --cc=edumazet@google$(echo .)com \
    --cc=epomozov@marvell$(echo .)com \
    --cc=horms@kernel$(echo .)org \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux@armlinux$(echo .)org.uk \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=richardcochran@gmail$(echo .)com \
    --cc=rogerq@kernel$(echo .)org \
    --cc=vadim.fedorenko@linux$(echo .)dev \
    --cc=vladimir.oltean@nxp$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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