From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Michael Chan <michael.chan@broadcom.com>,
Vadim Fedorenko <vadfed@meta.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Richard Cochran <richardcochran@gmail.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next] bnxt_en: add timestamping statistics support
Date: Wed, 29 May 2024 11:15:21 -0700 [thread overview]
Message-ID: <a26d530c-02c7-4e84-b014-561edbe0804e@linux.dev> (raw)
In-Reply-To: <CACKFLi=Mf8o6hxNEEy+hKbNhi7V56hpQrwH+Vpy6SEm8z_3ipA@mail.gmail.com>
On 29/05/2024 18:48, Michael Chan wrote:
> On Wed, May 29, 2024 at 10:19 AM Vadim Fedorenko <vadfed@meta.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@meta.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.
>
>> };
>>
prev parent reply other threads:[~2024-05-29 18:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 17:19 [PATCH net-next] bnxt_en: add timestamping statistics support Vadim Fedorenko
2024-05-29 17:48 ` Michael Chan
2024-05-29 18:15 ` Vadim Fedorenko [this message]
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=a26d530c-02c7-4e84-b014-561edbe0804e@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=vadfed@meta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).