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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4d1e7b89-9316-4956-96fc-0ce306637e3b@linux.dev>
Date: Mon, 20 Oct 2025 11:15:12 +0100
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Tariq Toukan <ttoukan.linux@...il.com>, Jian Shen
 <shenjian15@...wei.com>, Salil Mehta <salil.mehta@...wei.com>,
 Jijie Shao <shaojijie@...wei.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>,
 Sunil Goutham <sgoutham@...vell.com>, Geetha sowjanya <gakula@...vell.com>,
 Subbaraya Sundeep <sbhatta@...vell.com>,
 Bharat Bhushan <bbhushan2@...vell.com>, Tariq Toukan <tariqt@...dia.com>,
 Brett Creeley <brett.creeley@....com>,
 Niklas Söderlund <niklas.soderlund@...natech.se>,
 Paul Barker <paul@...rker.dev>,
 Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
Cc: linux-renesas-soc@...r.kernel.org,
 Richard Cochran <richardcochran@...il.com>,
 Russell King <linux@...linux.org.uk>,
 Vladimir Oltean <vladimir.oltean@....com>, Simon Horman <horms@...nel.org>,
 Jacob Keller <jacob.e.keller@...el.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2 2/6] mlx4: convert to ndo_hwtstamp API

On 20/10/2025 11:11, Tariq Toukan wrote:
> 
> 
> On 17/10/2025 21:21, Vadim Fedorenko wrote:
>> Convert driver to use .ndo_hwtstamp_get()/.ndo_hwtstamp_set() callbacks.
>> mlx4_en_ioctl() becomes empty, remove it.
>>
>> Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
>> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
>> ---
>>   .../net/ethernet/mellanox/mlx4/en_netdev.c    | 61 ++++++++-----------
>>   drivers/net/ethernet/mellanox/mlx4/mlx4_en.h  |  6 +-
>>   2 files changed, 28 insertions(+), 39 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/ 
>> net/ethernet/mellanox/mlx4/en_netdev.c
>> index 308b4458e0d4..514f29f241c3 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
>> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
>> @@ -2420,21 +2420,21 @@ static int mlx4_en_change_mtu(struct 
>> net_device *dev, int new_mtu)
>>       return 0;
>>   }
>> -static int mlx4_en_hwtstamp_set(struct net_device *dev, struct ifreq 
>> *ifr)
>> +static int mlx4_en_hwtstamp_set(struct net_device *dev,
>> +                struct kernel_hwtstamp_config *config,
>> +                struct netlink_ext_ack *extack)
>>   {
>>       struct mlx4_en_priv *priv = netdev_priv(dev);
>>       struct mlx4_en_dev *mdev = priv->mdev;
>> -    struct hwtstamp_config config;
>> -
>> -    if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
>> -        return -EFAULT;
>>       /* device doesn't support time stamping */
>> -    if (!(mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS))
>> +    if (!(mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS)) {
>> +        NL_SET_ERR_MSG(extack, "device doesn't support time stamping");
> 
> Encouraged to add more extack messages, for error flows below.
> WDYT?
It may potentially be a follow up work, but I decided to keep -ERANGE as
is because it's kinda self explanatory and is consistent across all the
drivers, while EINVAL is bit outlier and needs a bit more explanation.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ