lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <33cd1607-499f-49ba-8b75-b9f30e219dbc@intel.com>
Date: Wed, 15 Oct 2025 12:45:31 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Vadim Fedorenko <vadim.fedorenko@...ux.dev>, Shyam Sundar S K
	<Shyam-sundar.S-k@....com>, Andrew Lunn <andrew+netdev@...n.ch>, "David S.
 Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, "Jakub
 Kicinski" <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Egor Pomozov
	<epomozov@...vell.com>, Potnuri Bharat Teja <bharat@...lsio.com>, "Dimitris
 Michailidis" <dmichail@...gible.com>, MD Danish Anwar <danishanwar@...com>,
	Roger Quadros <rogerq@...nel.org>
CC: Richard Cochran <richardcochran@...il.com>, Russell King
	<linux@...linux.org.uk>, Vladimir Oltean <vladimir.oltean@....com>, "Simon
 Horman" <horms@...nel.org>, <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v2 1/7] net: ti: am65-cpsw: move hw timestamping
 to ndo callback



On 10/14/2025 3:42 PM, Vadim Fedorenko wrote:
> Migrate driver to new API for HW timestamping.
> 
> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
> ---
>  drivers/net/ethernet/ti/am65-cpsw-nuss.c | 44 +++++++++++-------------
>  1 file changed, 20 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> index 110eb2da8dbc..d5f358ec9820 100644
> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> @@ -1788,28 +1788,28 @@ static int am65_cpsw_nuss_ndo_slave_set_mac_address(struct net_device *ndev,
>  }
>  
>  static int am65_cpsw_nuss_hwtstamp_set(struct net_device *ndev,
> -				       struct ifreq *ifr)
> +				       struct kernel_hwtstamp_config *cfg,
> +				       struct netlink_ext_ack *extack)
>  {
>  	struct am65_cpsw_port *port = am65_ndev_to_port(ndev);
>  	u32 ts_ctrl, seq_id, ts_ctrl_ltype2, ts_vlan_ltype;
> -	struct hwtstamp_config cfg;
>  
> -	if (!IS_ENABLED(CONFIG_TI_K3_AM65_CPTS))
> +	if (!IS_ENABLED(CONFIG_TI_K3_AM65_CPTS)) {
> +		NL_SET_ERR_MSG(extack, "Time stamping is not supported");
>  		return -EOPNOTSUPP;
> -
> -	if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
> -		return -EFAULT;
> +	}
>  
>  	/* TX HW timestamp */
> -	switch (cfg.tx_type) {
> +	switch (cfg->tx_type) {
>  	case HWTSTAMP_TX_OFF:
>  	case HWTSTAMP_TX_ON:
>  		break;
>  	default:
> +		NL_SET_ERR_MSG(extack, "TX mode is not supported");

We could use NL_ST_ERR_MSG_MOD_FMT and format the particular invalid
type here, but not certain how helpful that would be in practice.
Perhaps the unsupported filter type is obvious from context of sending
the invalid netlink command?

Either way, the conversion looks quite straight forward.

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



Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ