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: <6b2f7d72-a268-4dd8-9721-f1c2901ef316@gmail.com>
Date: Wed, 5 Feb 2025 08:04:08 +0200
From: Tariq Toukan <ttoukan.linux@...il.com>
To: Mateusz Polchlopek <mateusz.polchlopek@...el.com>,
 Tariq Toukan <tariqt@...dia.com>, "David S. Miller" <davem@...emloft.net>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Eric Dumazet <edumazet@...gle.com>, Andrew Lunn <andrew+netdev@...n.ch>
Cc: netdev@...r.kernel.org, Saeed Mahameed <saeedm@...dia.com>,
 Gal Pressman <gal@...dia.com>, Jianbo Liu <jianbol@...dia.com>,
 Moshe Shemesh <moshe@...dia.com>, Leon Romanovsky <leonro@...dia.com>,
 Mark Bloch <mbloch@...dia.com>, Carolina Jubran <cjubran@...dia.com>,
 Dragos Tatulea <dtatulea@...dia.com>
Subject: Re: [PATCH net-next 01/15] net/mlx5: Add helper functions for PTP
 callbacks



On 04/02/2025 10:43, Mateusz Polchlopek wrote:
> 
> 
> On 2/3/2025 10:35 PM, Tariq Toukan wrote:
>> From: Jianbo Liu <jianbol@...dia.com>
>>
>> The PTP callback functions should not be used directly by internal
>> callers. Add helpers that can be used internally and externally.
>>
>> Signed-off-by: Jianbo Liu <jianbol@...dia.com>
>> Reviewed-by: Carolina Jubran <cjubran@...dia.com>
>> Reviewed-by: Dragos Tatulea <dtatulea@...dia.com>
>> Signed-off-by: Tariq Toukan <tariqt@...dia.com>
>> ---
>>   .../ethernet/mellanox/mlx5/core/lib/clock.c   | 32 +++++++++++++------
>>   1 file changed, 22 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/ 
>> drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
>> index d61a1a9297c9..eaf343756026 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
>> @@ -119,6 +119,13 @@ static u32 mlx5_ptp_shift_constant(u32 dev_freq_khz)
>>              ilog2((U32_MAX / NSEC_PER_MSEC) * dev_freq_khz));
>>   }
> 
> [...]
> 
>> +static int mlx5_ptp_settime(struct ptp_clock_info *ptp, const struct 
>> timespec64 *ts)
>> +{
>> +    struct mlx5_clock *clock = container_of(ptp, struct mlx5_clock, 
>> ptp_info);
>> +    struct mlx5_core_dev *mdev;
>> +
>> +    mdev = container_of(clock, struct mlx5_core_dev, clock);
>> +
> 
> Maybe just oneliner for mdev instead of dividing it into two lines? But
> it's up to you
> 

We'll keep it as is.
This also maintains the reversed Christmas tree.

>> +    return  mlx5_clock_settime(mdev, clock, ts);
>> +}
>> +
>>   static
>>   struct timespec64 mlx5_ptp_gettimex_real_time(struct mlx5_core_dev 
>> *mdev,
>>                             struct ptp_system_timestamp *sts)
>> @@ -1129,7 +1141,7 @@ static void mlx5_init_timer_clock(struct 
>> mlx5_core_dev *mdev)
>>           struct timespec64 ts;
>>           ktime_get_real_ts64(&ts);
>> -        mlx5_ptp_settime(&clock->ptp_info, &ts);
>> +        mlx5_clock_settime(mdev, clock, &ts);
>>       }
>>   }
> 
> Only one small nitpick, overall the code looks good, nice rework.
> 
> Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@...el.com>
> 

Thanks for your review.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ