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] [day] [month] [year] [list]
Message-ID: <a26d530c-02c7-4e84-b014-561edbe0804e@linux.dev>
Date: Wed, 29 May 2024 11:15:21 -0700
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Michael Chan <michael.chan@...adcom.com>,
 Vadim Fedorenko <vadfed@...a.com>
Cc: "David S. Miller" <davem@...emloft.net>, Jakub Kicinski
 <kuba@...nel.org>, Richard Cochran <richardcochran@...il.com>,
 netdev@...r.kernel.org
Subject: Re: [PATCH net-next] bnxt_en: add timestamping statistics support

On 29/05/2024 18:48, Michael Chan wrote:
> On Wed, May 29, 2024 at 10:19 AM Vadim Fedorenko <vadfed@...a.com> wrote:
>>
>> The ethtool_ts_stats structure was introduced earlier this year. Now
>> it's time to support this group of counters in more drivers.
>> This patch adds support to bnxt driver.
>>
>> Signed-off-by: Vadim Fedorenko <vadfed@...a.com>
>> ---
>>   drivers/net/ethernet/broadcom/bnxt/bnxt.c      | 18 +++++++++++++-----
>>   .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c  | 18 ++++++++++++++++++
>>   drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c  | 18 ++++++++++++++++++
>>   drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h  |  8 ++++++++
>>   4 files changed, 57 insertions(+), 5 deletions(-)
>>
> 
>> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
>> index 2c3415c8fc03..589e093b1608 100644
>> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
>> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
>> @@ -79,6 +79,12 @@ struct bnxt_pps {
>>          struct pps_pin pins[BNXT_MAX_TSIO_PINS];
>>   };
>>
>> +struct bnxt_ptp_stats {
>> +       u64             ts_pkts;
>> +       u64             ts_lost;
>> +       atomic64_t      ts_err;
>> +};
>> +
>>   struct bnxt_ptp_cfg {
>>          struct ptp_clock_info   ptp_info;
>>          struct ptp_clock        *ptp_clock;
>> @@ -125,6 +131,8 @@ struct bnxt_ptp_cfg {
>>          u32                     refclk_mapped_regs[2];
>>          u32                     txts_tmo;
>>          unsigned long           abs_txts_tmo;
>> +
>> +       struct bnxt_ptp_stats   *stats;
> 
> I think there is no need to allocate this small stats structure
> separately.  It can just be:
> 
> struct bnxt_ptp_stats    stats;
> 
> The struct bnxt_ptp_cfg will only be allocated if the device supports
> PTP.  So the stats can always be a part of struct bnxt_ptp_cfg.

Yeah, I was thinking about embedding the struct into bnxt_ptp_cfg.
Ok, I'll make v2 in 24hr then.

Thanks!

> Other than that, it looks good to me.  Thanks.
> 
>>   };
>>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ